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 vol()
{
	var l = document.volcu.l.value;
	
	if(isNum(l))
	{
		document.volcu.cub.value = Math.round(l*l*l*1000)/1000;
	}
	else
	{
		l = l.substring(0,l.length-1);
		document.volcu.l.value = l;
	}
}

function sa()
{
	var l = document.csacu.l.value;
	
	if(isNum(l))
	{
		document.csacu.cub.value = Math.round(6*l*l*1000)/1000;
	}
	else
	{
		l = l.substring(0,l.length-1);
		document.csacu.l.value = l;
	}
}

function dc()
{
	var l = document.diag.l.value;
	
	if(isNum(l))
	{
		document.diag.cub.value = Math.round(Math.sqrt(3)*l*1000)/1000;
	}
	else
	{
		l = l.substring(0,l.length-1);
		document.diag.l.value = l;
	}
}

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;
}



