
//**START**
//Function fillSelect() 
//this will upload dynamicly the states and provinces when click on the country canada or usa.
//create arrays of all states and provinces.
var country = new Array();
country[0] = new Array("");
country[1] = new Array("Select Province","Alberta","British Columbia","Manitoba","Newfoundland","New Brunswick","Northwest Territories","Nova Scotia","Ontario","Prince Edouard Island","Quebec","Saskatchewan","Yukon");
country[2] = new Array("Select State","Alaska","Alabama","Arkansas","Arizona","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawai","Iowa","Idaho","Illinois","Indianna","Kansas","Kentucky","Louisianna","Massachusetts","Maryland","Maine","Michigan","Minnesota","Missouri","Mississippi","Montana","North Carolina","North Dakota","Nebraska","New Hamshire","New Jersey","New Mexico","Nevada","New York","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Virginia","Vermont","Washington","Wisconsin","West Virginia","Wyoming");

function fillSelect(index)
{
			
	for( var x = 0; x < document.form.province.options.length; x++)
	{
		document.form.province.options[x] = null;
	}//end for
		var temp = country[index];
		for( var x = 0; x < temp.length; x++)
		{
			document.form.province.options[x] = new Option(temp[x],temp[x]);
			//first is the text appears the second is the value
		}//end for
				
}//end of function fillSelect

//***************************FUNCTION SHOWDIV() FOR MARITAL STATUS*****************************
//Function ShowdDiv()
//This will show dynamicly the divs that are hidden 
//if select Married
var trigger=null;//declare var as global for all functions
	//declare trigger null cuz to tell to not do anything until we tell him his function
function showDiv(divid1,divid2)
{
		//if user choose married
		//show the hidden div spouse wife name textbox
		var marital = document.form.marital.options[document.form.marital.selectedIndex].value;
		
		if(marital == "married")
		{
			//show hid div input textbox for the spouse name
			document.getElementById(divid1).style.visibility="visible";
			document.getElementById(divid2).style.visibility="visible";
		}
		
			
}//end function showDiv()
//***************************END FUNCTION SHOWDIV()********************************************


//***************************FUNCTION SHOWDIV() FOR UZ AND CANADA POSTAL CODE TEXTBOX***********
//This will show the us zip code textbox if the user select country "USA"
//it will hide the textbox us zip code if the user select country "Canada"
//and make the textbox of canada postal code reappear
function showDiv2(divid3,divid4)
{
		//if user select usa
		//show the hidden div for usZipCode
		//and hide the canadian postalcode
		
		var country = document.form.country.options[document.form.country.selectedIndex].value;
		if(country == "US")
		{
			//show  div input textbox for the country zip code
			document.getElementById(divid3).style.visibility="visible";//show usa
			document.getElementById(divid4).style.visibility="hidden";//hide canada
						
		}
		else//if canada is select
		{
			//show the canada text boxes
			//hide the us textboxes
			document.getElementById(divid4).style.visibility="visible";//show canada
			document.getElementById(divid3).style.visibility="hidden";//hide usa
						
		}
		
			
}//end function showDiv2()
//***************************END FUNCTION SHOWDIV() FOR UZ AND CANADA POSTAL CODE TEXTBOX***********

//this will make sure the divs stay visible once on the textbox
function stopTrigger()
{
	//make sure the hidden divs dosent hide while over it or type on the textbox
	clearTimeout(trigger);
}//end function stopTrigger()