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 k = document.new.res1.value;
	var a = document.new.res2.value;
	var h = document.new.res3.value;
	var l = document.new.res4.value;
	var q = document.new.res5.value;

	if(ty == 1)
		k = null;
	if(ty == 2)
		a = null;
	if(ty == 3)
		h = null;
	if(ty == 4)
		l = null;
	if(ty == 5)
		q = null;
	
	if(k == "" || a == "" || h == "" || l == "" || q == "")
	{
		alert(" Please enter all required fields ");
	}

	if(k != null && a != null && h != null && l != null){
		q = Math.round(((k*a*h)/l)*100)/100;
		document.new.res5.value=q;
	}
	else if(q != null && a != null && h != null && l != null){
		k = Math.round(((q*l)/(a*h))*100)/100;
		document.new.res1.value=k;
	}
	else if(k != null && q != null && h != null && l != null){
		a = Math.round(((q*l)/(k*h))*100)/100;
		document.new.res2.value=a;
	}
	else if(k != null && a != null && q != null && l != null){
		h = Math.round(((q*l)/(k*a))*100)/100;
		document.new.res3.value=h;
	}
	else if(k != null && a != null && h != null && q != null){
		l = Math.round(((k*a*h)/q)*100)/100;
		document.new.res4.value=l;
	}
	return false;
}

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




