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 h1 = document.new.res1.value;
	var h2 = document.new.res2.value;
	var l = document.new.res3.value;
	var i = document.new.res4.value;
	
	if(ty == 1)
		h1 = null;
	if(ty == 2)
		h2 = null;
	if(ty == 3)
		l = null;
	if(ty == 4)
		i = null;
	
	if(i == "" || h1 == ""  || h2 == "" || l == "")
	{
		alert(" Please enter all required fields ");
	}

	if(l != null && h1 != null && h2 != null){
		i = Math.round(((h1-h2)/l)*100)/100;
		document.new.res4.value=i;
	}
	else if(h2 != null && l != null && i != null){
		h1 = Math.round((parseFloat(i*l) + parseFloat(h2))*100)/100;
		document.new.res1.value=h1;
	}
	else if(h1 != null && i != null && l != null){
		h2 = Math.round((h1-(i*l))*100)/100;
		document.new.res2.value=h2;
	}
	else if(h1 != null && h2 != null && i != null){
		l = Math.round(((h1-h2)/l)*100)/100;
		document.new.res3.value=l;
	}
	return false;
}

function modf()
{
	for(var h=1; h<5; 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;
}



