function checnum(as)
{
	var dd = as.value;
	
	if(isNaN(dd))
	{
		dd = dd.substring(0,(dd.length-1));
		as.value = dd;
	}		
}
function sign()
{
	var d = document.first.d.value;
	var mon = document.first.mon.value;
	var y = document.first.y.value;
	var curd = new Date(y,mon-1,d);
	var res2 = curd.getMonth();
	 var i = 0;
	
 	
	var images = new Array;
	images[0] = new Image(160, 216);
	images[0].src = "image/aquarius.gif";
	images[1] = new Image(200, 136);
	images[1].src = "image/pisces.gif";
	images[2] = new Image(200, 187);
	images[2].src = "image/aries.gif";
	images[3] = new Image(200, 184);
	images[3].src = "image/taurus.gif";
	images[4] = new Image(200, 127);
	images[4].src = "image/gemini.gif";
	images[5] = new Image(200, 150);
	images[5].src = "image/cancer.gif";
	images[6] = new Image(200, 192);
	images[6].src = "image/leo.gif";
	images[7] = new Image(150, 203);
	images[7].src = "image/virgo.gif";
	images[8] = new Image(200, 213);
	images[8].src = "image/libra.gif";
	images[9] = new Image(180, 212);
	images[9].src = "image/scorpio.gif";
	images[10] = new Image(160, 192);
	images[10].src = "image/sagittarius.gif";
	images[11] = new Image(200, 180);
	images[11].src = "image/capricorn.gif";
	
		
	if(res2 == (mon-1) && y!="")
	{
		if (mon == 1 && d >=20 || mon == 2 && d <=18) 
		{
			value = "Aquarius";
			document.first.pic1.width=160;
			document.first.pic1.height=216;			
			document.first.pic1.src="image/aquarius.gif";

		}
		
		else if (mon == 2 && d >=19 || mon == 3 && d <=20) {
			value = "Pisces";
			document.first.pic1.width=200;
			document.first.pic1.height=136;			
			document.first.pic1.src="image/pisces.gif";

		}
		
		else if (mon == 3 && d >=21 || mon == 4 && d <=19) {
			value = "Aries";
			document.first.pic1.width=200;
			document.first.pic1.height=187;			
			document.first.pic1.src="image/aries.gif";

		}
		
		else if (mon == 4 && d >=20 || mon == 5 && d <=20) {
			value = "Taurus";
			document.first.pic1.width=200;
			document.first.pic1.height=184;			
			document.first.pic1.src="image/taurus.gif";

		}
		
		else if (mon == 5 && d >=21 || mon == 6 && d <=21) {
			value = "Gemini";
			document.first.pic1.width=200;
			document.first.pic1.height=127;			
			document.first.pic1.src="image/gemini.gif";

		}
		
		else if (mon == 6 && d >=22 || mon == 7 && d <=22) {
			value = "Cancer";
			document.first.pic1.width=200;
			document.first.pic1.height=150;			
			document.first.pic1.src="image/cancer.gif";

		}
		
		else if (mon == 7 && d >=23 || mon == 8 && d <=22) {
			value = "Leo";
			document.first.pic1.width=200;
			document.first.pic1.height=192;			
			document.first.pic1.src="image/leo.gif";

		}
		
		else if (mon == 8 && d >=23 || mon == 9 && d <=22) {
			value = "Virgo";
			document.first.pic1.width=150;
			document.first.pic1.height=203;			
			document.first.pic1.src="image/virgo.gif";

		}
		
		else if (mon == 9 && d >=23 || mon == 10 && d <=22) {
			value = "Libra";
			document.first.pic1.width=200;
			document.first.pic1.height=213;			
			document.first.pic1.src="image/libra.gif";

		}
		
		else if (mon == 10 && d >=23 || mon == 11 && d <=21) {
			value = "Scorpio";
			document.first.pic1.width=180;
			document.first.pic1.height=212;			
			document.first.pic1.src="image/scorpio.gif";

		}
		
		else if (mon == 11 && d >=22 || mon == 12 && d <=21) {
			value = "Sagittarius";
			document.first.pic1.width=160;
			document.first.pic1.height=192;			
			document.first.pic1.src="image/sagittarius.gif";
		}
		
		else if (mon == 12 && d >=22 || mon == 1 && d <=19) {
			value = "Capricorn";
			document.first.pic1.width=200;
			document.first.pic1.height=180;			
			document.first.pic1.src="image/capricorn.gif";
		}
		
		document.first.r1.value = value;
		document.first.n1.value = value;
		
		
		x = (1901 - y) % 12
		if (x == 1 || x == -11) {value1 = "Rat";}
		if (x == 0) {value1 = "Ox";}
		if (x == 11 || x == -1) {value1 = "Tiger";}
		if (x == 10 || x == -2) {value1 = "Rabbit/Cat";}
		if (x == 9 || x == -3)  {value1 = "Dragon";}
		if (x == 8 || x == -4)  {value1 ="Snake";}
		if (x == 7 || x == -5)  {value1 = "Horse";}
		if (x == 6 || x == -6)  {value1 = "Sheep";}
		if (x == 5 || x == -7)  {value1 = "Monkey";}
		if (x == 4 || x == -8)  {value1 = "Cock/Phoenix";}
		if (x == 3 || x == -9)  {value1 = "Dog";}
		if (x == 2 || x == -10)  {value1 = "Boar";}  
		document.first.r2.value = value1;
	}
	else{
		alert("Invalid Date");
	}
	
}
	
		


function color(test)
{

	for(var j=2; j<10; 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;
}




