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.gas.ss.value;
	var pi = document.gas.res1.value;
	var ti = document.gas.res2.value;
	var pf = document.gas.res3.value;
	var tf = document.gas.res4.value;
	
	if(ty == 1)
		pi = null;
	if(ty == 2)
		ti = null;
	if(ty == 3)
		pf = null;
	if(ty == 4)
		tf = null;

	if(pi == "" || ti == "" || pf == "" || tf == "")
	{
		alert(" Please enter all required feilds ");
	}

	if(ti != null && ti != 0 && pi != null && pi != 0 && pf != null && pf != 0){
		tf = Math.round(((pf*ti)/pi)*100)/100;
		document.gas.res4.value=tf;
	}
	else if(pf != null && pf != 0 && ti != null && ti != 0 && tf != null && tf != 0){
		pi = Math.round(((pf*ti)/tf)*100)/100;
		document.gas.res1.value=pi;
	}
	else if(pf != null && pf != 0 && pi != null && pi != 0 && tf != null && tf != 0){
		ti = Math.round(((pi*tf)/pf)*100)/100;
		document.gas.res2.value=ti;
	}
	else if(ti != null && ti != 0 && pi != null && pi != 0 && tf != null && tf != 0){
		pf = Math.round(((tf*pi)/ti)*100)/100;
		document.gas.res3.value=pf;
	}

	return false;
}

function modf()
{
	for(var h=1; h<5; h++)
	{
		var dd = "document.gas.res"+h;
		ss = eval(dd);
		ss.disabled=false;
		ss.style.backgroundColor="#eefaff";
		ss.style.color= "#000000";
	}
	var vv = document.gas.ss.value;
	sse(vv);
}

function sse(vv){
	var dd = "document.gas.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;
}



