function isNum(arg)
{
	var args = arg;

	if (args == "" || args == null || args.length == 0)
	{
		return false;
	}

	args = args.toString();

	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 DaysInMonth(Y, M) {
    with (new Date(Y, M, 1, 12)) {
        setDate(0);
        return getDate();
    }
}

function caldays()
{
	var curyear = document.cir.len.value;

	if(curyear=="")
	{
		alert("please fill the year and click go -");
	}
	else
	{
		var tot=0;

		var dm = DaysInMonth(curyear,1);
		document.cir.in1.value = dm;
		tot=tot+dm;

		dm = DaysInMonth(curyear,2);
		document.cir.in2.value = dm;
		tot=tot+dm;

		dm = DaysInMonth(curyear,3);
		document.cir.in3.value = dm;
		tot=tot+dm;

		dm = DaysInMonth(curyear,4);
		document.cir.in4.value = dm;
		tot=tot+dm;

		dm = DaysInMonth(curyear,5);
		document.cir.in5.value = dm;
		tot=tot+dm;

		dm = DaysInMonth(curyear,6);
		document.cir.in6.value = dm;
		tot=tot+dm;

		dm = DaysInMonth(curyear,7);
		document.cir.in7.value = dm;
		tot=tot+dm;

		dm = DaysInMonth(curyear,8);
		document.cir.in8.value = dm;
		tot=tot+dm;

		dm = DaysInMonth(curyear,9);
		document.cir.in9.value = dm;
		tot=tot+dm;

		dm = DaysInMonth(curyear,10);
		document.cir.in10.value = dm;
		tot=tot+dm;

		dm = DaysInMonth(curyear,11);
		document.cir.in11.value = dm;
		tot=tot+dm;

		dm = DaysInMonth(curyear,12);
		document.cir.in12.value = dm;
		tot=tot+dm;

		document.cir.yyyy.value = curyear;
		document.cir.tost.value = tot;
		
		if(tot >365)
			document.cir.isleap.value = "TRUE";
		else
			document.cir.isleap.value = "FALSE";
	}
}

function color(test)
{

	for(var j=2; j<14; j++)
	{
		var myI=document.getElementsByTagName("input").item(j);
		//myI.setAttribute("style",ch);
		myI.style.backgroundColor=test;
	}
}


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



