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

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

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

	return false;
}

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



