// JavaScript Document
	function pGetDays(Form)
	{
		var Year = Form.pyear
		var Month = Form.pmonth
		var Day = Form.pday
		var Days =  new Array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
		if(isLeap(Year.value))
			Days[2] = 29
		else
			Days[2] = 28
		var i
		for(i=Day.options.length-1;i>=0;i--)
		{
			Day.remove(i);
		}
		var option = document.createElement("option");	// First Element
			option.text = "Day"
			option.value = ""
			//option.selected = true
	 		Day.options.add(option)
		for(var i=1; i <= Days[Month.value] ; i++)
		{
			var option = document.createElement("option");	// First Element
			option.text = i
			option.value = i
	 		Day.options.add(option)
		}
	}
	function dGetDays(Form)
	{
		var Year = Form.dyear
		var Month = Form.dmonth
		var Day = Form.dday
		
		var Days =  new Array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
		if(isLeap(Year.value))
			Days[2] = 29
		else
			Days[2] = 28
		var i
		for(i=Day.options.length-1;i>=0;i--)
		{
			Day.remove(i);
		}
		var option = document.createElement("option");	// First Element
			option.text = "Day"
			option.value = ""
			//option.selected = true
	 		Day.options.add(option)
		for(var i=1; i <= Days[Month.value] ; i++)
		{
			var option = document.createElement("option");	// First Element
			option.text = i
			option.value = i
	 		Day.options.add(option)
		}
	}
	function isLeap(Year)
	{
		Year = parseInt(Year);
		if(Year%4 == 0)
		{
			if(Year%100 != 0)
			{
				return true;
			}
			else
			{
				if(Year%400 == 0)
					return true;
				else
					return false;
			}
		}
		return false;
	}
	
	/////
	function calc(year1,month1,day1)
{	year=year1.value;
	month=month1.value;
	day=day1.value;
	
	var val=eval(year)%4;
	
	if(val==0)
	{
		
		if(month=='feb')
		{
			if(eval(day)>29)
			{
			return false;}
		}
		if(month=='apr')
		{	
			if(eval(day)>30)
			{return false;}
		}
		if(month=='jun')
		{
			if(eval(day)>30)
			{return false;}
		}
		if(month=='sep')
		{
			if(eval(day)>30)
			{return false;}
		}
		if(month=='nov')
		{
			if(eval(day)>30)
			{return false;}
		}
		return true;
	
	}
	else(val==1)
	{
		if(month=='feb')
		{	
			if(eval(day)>28)
			{return false;}
		}
		if(month=='apr')
		{
			if(eval(day)>30)
			{return false;}
		}
		if(month=='jun')
		{
			if(eval(day)>30)
			{return false;}
		}
		if(month=='sep')
		{
			if(eval(day)>30)
			{return false;}
		}
		if(month=='nov')
		{
			if(eval(day)>30)
			{return false;}
		}
		return true;
	
	}
}


function copyval(form)
{
		if(form.copy.checked)
		{
				
				form.bfname.value 	= form.pfname.value+' '+form.plname.value 
				form.baddress1.value 	= form.paddress1.value
				form.baddress2.value 	= form.paddress2.value
				form.bstate.value 	= form.pstate.value;
				form.bzip.value 	= form.pzip.value;
				form.bcity.value 	= form.pcity.value;
				
		}
		else
		{
			form.bfname.value 	= ''
			form.baddress1.value 	= ''
			form.baddress2.value 	= ''
			form.bstate.value 	= ''
			form.bzip.value = ''
			form.bcity.value 	=''
		}	
}
function cop(field)
{
form1.uname.value=field.value;
}
