function isNum(args)
{
args = args.toString();

if (args.length == 0)
return false;

for (var i = 0;  i<args.length;  i++)
{
	if ((args.substring(i,i+1) < "0" || args.substring(i, i+1) > "9") && args.substring(i, i+1) != ".")
		{
		return false;
		}
}

return true;

}


function area(varr,c)
{
	var aa = document.recta.len1.value;
	var bb = document.recta.len2.value;

	if(isNum(aa) && isNum(bb))
	{
	   document.recta.are.value = Math.round((aa*bb)*1000)/1000;
	}
	else
	{
		if(c == "1" && !isNum(aa))
		{
			aa = aa.substring(0,aa.length-1);
			document.recta.len1.value = aa;
		}
		if(c == "2" && !isNum(bb))
		{
			bb = bb.substring(0,bb.length-1);
			document.recta.len2.value = bb;
		}
	}
}


function peri(varr,c)
{
	var aa = document.rectpe.len1.value;
	var bb = document.rectpe.len2.value;

	if(isNum(aa) && isNum(bb))
	{
	   document.rectpe.per.value = Math.round((parseInt(2*aa)+parseInt(2*bb))*1000)/1000;
	}
	else
	{
		if(c == "1" && !isNum(aa))
		{
			aa = aa.substring(0,aa.length-1);
			document.rectpe.len1.value = aa;
		}
		if(c == "2" && !isNum(bb))
		{
			bb = bb.substring(0,bb.length-1);
			document.rectpe.len2.value = bb;
		}
	}
}


function color(test)
{

//var ch ="background-color: "+test+"; width: 60px; height: 25px;";
//alert(ch);
	for(var j=1; j<10; j++)
	{
		if(j!=2 && j!=5 && j!=6 && j!=8 && j!=8 && j!=8 && j!=8)
		{
		var myI=document.getElementsByTagName("input").item(j);
		//myI.setAttribute("style",ch);
		myI.style.backgroundColor=test;
		}
	}
	for(var j=36; j<46; j++)
	{
		if(j==38 || j==42 || j==45)
		{
		var myI=document.getElementsByTagName("input").item(j);
		//myI.setAttribute("style",ch);
		myI.style.backgroundColor=test;
		}
	}

//myI.setAttribute("style","background-color: #F70808; width: 60px; height: 25px;");
}


function color1(test)
{
var myI=document.getElementsByTagName("table").item(0);
//myI.setAttribute("style",ch);
myI.style.backgroundColor=test;
}



