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.imp.ss.value;
	var f = document.imp.res1.value;
	var t = document.imp.res2.value;
	var i = document.imp.res3.value;

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

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

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

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



