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 v = document.new.res1.value;
	var p = document.new.res2.value;
	var f = document.new.res3.value;
	var s = document.new.res4.value;
	var g = document.new.res5.value;
	var n = document.new.res6.value;
	
	if(ty == 1)
		v = null;
	if(ty == 2)
		p = null;
	if(ty == 3)
		f = null;
	if(ty == 4)
		s = null;
	if(ty == 5)
		g = null;
	if(ty == 6)
		n = null;
	
	if(v == "" || p == "" || f == "" || s == "" || g == "" || n == "")
	{
		alert(" Please enter all required fields ");
	}
	
	if(v != null && p != null && f != null && s != null && g != null){
		n = Math.round((parseFloat((v*v)/(2*g)) + parseFloat(p/s) - parseFloat(f/s))*100)/100;
		document.new.res6.value=n;
	}
	else if(n != null && p != null && f != null && s != null && g != null){
		v = Math.round((Math.sqrt(2*g*(parseFloat(n) - parseFloat(p/s) + parseFloat(f/s))))*100)/100;
		document.new.res1.value=v;
	}
	else if(n != null && v != null && f != null && s != null && g != null){
		p = Math.round((s*(parseFloat(n) - parseFloat((v*v)/(2*g)) + parseFloat(f/s)))*100)/100;
		document.new.res2.value=p;
	}
	else if(n != null && v != null && p != null && s != null && g != null){
		f = Math.round((-s*(parseFloat(n) - parseFloat((v*v)/(2*g)) - parseFloat(p/s)))*100)/100;
		document.new.res3.value=f;
	}
	else if(n != null && v != null && p != null && f != null && g != null){
		s = Math.round(((p-f)/(n-((v*v)/(2*g))))*100)/100;
		document.new.res4.value=s;
	}
	else if(n != null && v != null && p != null && f != null && s != null){
		g = Math.round(((v*v)/(2*(parseFloat(n) - parseFloat(p/s) + parseFloat(f/s))))*100)/100;
		document.new.res5.value=g;
	}
	return false;
}

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




