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 h1 = document.new.res2.value;
	var h2 = document.new.res3.value;
	var r1 = document.new.res4.value;
	var r2 = document.new.res5.value;
	var q = document.new.res6.value;

	if(ty == 1)
		k = null;
	if(ty == 2)
		h1 = null;
	if(ty == 3)
		h2 = null;
	if(ty == 4)
		r1 = null;
	if(ty == 5)
		r2 = null;
	if(ty == 6)
		q = null;
	
	if(k == "" || h1 == "" || h2 == "" || r1 == "" || r2 == "" || q == "")
	{
		alert(" Please enter all required fields ");
	}

	if(k != null && h1 != null && h2 != null && r1 != null && r2 != null){
		q = Math.round(((3.14*k*((h1*h1)-(h2*h2)))/(Math.log(r1/r2)))*100)/100;
		document.new.res6.value=q;
	}
	else if(q != null && h1 != null && h2 != null && r1 != null && r2 != null){
		k = Math.round(((q*Math.log(r1/r2))/(3.14*((h1*h1)-(h2*h2))))*100)/100;
		document.new.res1.value=k;
	}
	else if(k != null && q != null && h2 != null && r1 != null && r2 != null){
		h1 = Math.round((Math.sqrt(parseFloat((q*Math.log(r1/r2))/(3.14*k)) + parseFloat(h2*h2)))*100)/100;
		document.new.res2.value=h1;
	}
	else if(k != null && h1 != null && q != null && r1 != null && r2 != null){
		h2 = Math.round((Math.sqrt((h1*h1)-((q*Math.log(r1/r2))/(3.14*k))))*100)/100;
		document.new.res3.value=h2;
	}
	else if(k != null && h1 != null && h2 != null && q != null && r2 != null){
		r1 = Math.round((r2*Math.pow(2.72, ((3.14*k*((h1*h1)-(h2*h2)))/(q))))*100)/100;
		document.new.res4.value=r1;
	}
	else if(k != null && h1 != null && h2 != null && r1 != null && q != null){
		r2 = Math.round((r1/(Math.pow(2.72, ((3.14*k*((h1*h1)-(h2*h2)))/(q)))))*100)/100;
		document.new.res5.value=r2;
	}
	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;
}



