function checnum(as)
{
	var dd = as.value;
	
	if(isNaN(dd))
	{
		dd = dd.substring(0,(dd.length-1));
		as.value = dd;
	}		
}

function calsi()
{
	var ty = document.new.ss.value;
	var g = document.new.res1.value;
	var at = document.new.res2.value;
	var a = document.new.res3.value;

	if(ty == 1)
		g = null;
	if(ty == 2)
		at = null;
	if(ty == 3)
		a = null;
	
	if(g == "" || at == "" || a == "")
	{
		alert(" Please enter all required fields ");
	}

	if(g != null && at != null){
		a = Math.round((parseFloat(g) + parseFloat(at))*100)/100;
		document.new.res3.value=a;
	}
	else if(at != null && a != null){
		g = Math.round((at - a)*100)/100;
		document.new.res1.value=g;
	}
	else if(a != null && g != null){
		at = Math.round((g - a)*100)/100;
		document.new.res2.value=at;
	}
	return false;
}

function modf()
{
	for(var h=1; h<4; h++)
	{
		var dd = "document.new.res"+h;
		ss = eval(dd);
		ss.disabled=false;
		ss.style.backgroundColor="#eefaff";
		ss.style.color= "#000000";
	}
	var vv = document.new.ss.value;
	sse(vv);
}

function sse(vv){
	var dd = "document.new.res"+vv;
	ss = eval(dd);
	ss.disabled=true;
	ss.value="";
	ss.style.color= "black";
	ss.style.backgroundColor="#bbc7dd";
}

function color(test)
{
	var myI=document.getElementsByTagName("input").item(4);
	myI.style.backgroundColor=test;
}


function color1(test)
{
var myI=document.getElementsByTagName("table").item(0);
//myI.setAttribute("style",ch);
myI.style.backgroundColor=test;
}




