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.pow.ss.value;
	var f = document.pow.res1.value;
	var v = document.pow.res2.value;
	var p = document.pow.res3.value;

	if(ty == 1)
		f = null;
	if(ty == 2)
		v = null;
	if(ty == 3)
		p = null;
	
	if(f == "" || v == "" || p == "")
	{
		alert(" Please enter all required fields ");
	}

	if(f != null && v != null){
		p = Math.round((f*v)*100)/100;
		document.pow.res3.value=p;
	}
	else if(v != null && p != null){
		f = Math.round((p/v)*100)/100;
		document.pow.res1.value=f;
	}
	else if(f != null && p != null){
		v = Math.round((p/f)*100)/100;
		document.pow.res2.value=v;
	}
	return false;
}

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

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



