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

	if(c != null && r != null && s != null){
		v = Math.round((0.85*c*(Math.pow(r,0.63))*(Math.pow(s,0.54)))*100)/100;
		document.new.res4.value=v;
	}
	else if(v != null && r != null && s != null){
		c = Math.round((v/(0.85*(Math.pow(r,0.63))*(Math.pow(s,0.54))))*100)/100;
		document.new.res1.value=c;
	}
	else if(c != null && v != null && s != null){
		r = Math.round(Math.pow((v/(0.85*c*(Math.pow(s,0.54)))),(1/0.63))*100)/100;
		document.new.res2.value=r;
	}
	else if(c != null && r != null && v != null){
		s = Math.round(Math.pow((v/(0.85*c*(Math.pow(r,0.63)))),(1/0.54))*100)/100;
		document.new.res3.value=s;
	}
	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;
}




