function SetArea(Prov, lArea)

{

lArea.length = 0;

switch(Prov)

{

case 1:

{

AddToList (lArea,0,"------","AllOfThisPROVINCE");

break

}



case 39:

{

AddToList (lArea,0,"Alberta","Alberta");

AddToList (lArea,1,"British Columbia","British Columbia");

AddToList (lArea,2,"Manitoba","Manitoba");

AddToList (lArea,3,"New Brunswick","New Brunswick");

AddToList (lArea,4,"Newfoundland and Labrador","Newfoundland and Labrador");

AddToList (lArea,5,"Nova Scotia","Nova Scotia");

AddToList (lArea,6,"Ontario","Ontario");

AddToList (lArea,7,"Prince Edward Island","Prince Edward Island");

AddToList (lArea,8,"Quebec","Quebec");

AddToList (lArea,9,"Saskatchewan","Saskatchewan");

break

}



case 2:

{



break

}



case 31:

{



break

}



case 220:

{



AddToList (lArea,0,"Alabama","Alabama");

AddToList (lArea,1,"Alaska","Alaska");

AddToList (lArea,2,"Arizona","Arizona");

AddToList (lArea,3,"California","California");

AddToList (lArea,4,"Colorado","Colorado");

AddToList (lArea,5,"Connecticut","Connecticut");

AddToList (lArea,6,"Delaware","Delaware");

AddToList (lArea,7,"Florida","Florida");

AddToList (lArea,8,"Georgia","Georgia");

AddToList (lArea,9,"Hawaii","Hawaii");

AddToList (lArea,10,"Idaho","Idaho");

AddToList (lArea,11,"Illinois","Illinois");

AddToList (lArea,12,"Indiana","Indiana");

AddToList (lArea,13,"Iowa","Iowa");

AddToList (lArea,14,"Kansas","Kansas");

AddToList (lArea,15,"Kentucky","Kentucky");

AddToList (lArea,16,"Louisiana","Louisiana");

AddToList (lArea,17,"California ","GON005");

AddToList (lArea,18,"Colorado<","GON028");

AddToList (lArea,19,"Connecticut","GON029");

AddToList (lArea,20,"Delaware","AllOfThisPROVINCE");

AddToList (lArea,21,"Maine","Maine");

AddToList (lArea,22,"Maryland","Maryland");

AddToList (lArea,23,"Massachusetts","Massachusetts");

AddToList (lArea,24,"Michigan","Michigan");

AddToList (lArea,25,"Minnesota","Minnesota");

AddToList (lArea,26,"Mississippi","Mississippi");

AddToList (lArea,27,"Missouri","Missouri");

AddToList (lArea,28,"Montana","Montana");

AddToList (lArea,29,"Nebraska","Nebraska");

AddToList (lArea,30,"Nevada","Nevada");

AddToList (lArea,31,"New Hampshire","New Hampshire");

AddToList (lArea,32,"New Jersey","New Jersey");

AddToList (lArea,33,"North Carolina","North Carolina");

AddToList (lArea,34,"North Dakota","North Dakota");

AddToList (lArea,35,"Ohio","Ohio");

AddToList (lArea,36,"Oklahoma","Oklahoma");

AddToList (lArea,37,"Oregon","Oregon");

AddToList (lArea,38,"Pennsylvania","Pennsylvania");

AddToList (lArea,39,"Puerto Rico","Puerto Rico");

AddToList (lArea,40,"Rhode Island","Rhode Island");

AddToList (lArea,41,"South Carolina","South Carolina");

AddToList (lArea,42,"South Dakota","South Dakota");

AddToList (lArea,43,"Tennessee","Tennesseea");

AddToList (lArea,44,"Texas","Texas");

AddToList (lArea,45,"Rhode Island","Rhode Island");

AddToList (lArea,46,"Utah","Utah");

AddToList (lArea,47,"Vermont","Vermont");

AddToList (lArea,48,"Virgin Islands","Virgin Islands");

AddToList (lArea,49,"Virginia","Virginia");

AddToList (lArea,50,"Washington","Washington");

AddToList (lArea,51,"West Virginia","West Virginia");

AddToList (lArea,52,"Wisconsin","Wisconsin");

AddToList (lArea,53,"Wyoming","Wyoming");



break

}



default:

{

AddToList (lArea, 0,"Outside of Canada/US", "Outside of Canada/US");

break;}

}

return lArea;

}

	//Use to fill Area list box 

	//Call by SetArea (Search_en.asp / Search_fr.as) to fill Area ListBox with <OPTION> item	

	function AddToList (ListItem, iPosi, sText, sValue)

  	{

	    //document.write(ListItem[0]);

	   	//Create new option

		ListItem[iPosi] = new Option;

   		//Add <OPTION> dispay Text

		ListItem[iPosi].text = sText;

   		//Add <OPTION> value

		ListItem[iPosi].value = sValue;

   		//Select first item on list

		if (iPosi == 0)

			{ 

		  	ListItem[0].selected = true;

			

			}    

			

   		return 0;

		

  	}



///////////////////////////////////////////////////////////////////



	//Use to fill Area list box

	//Set Area for selected province

	function GetCountryIndex(cCountry, cArea)

  	{

	    

   		//Wich Province is select?

   		var iSelected = GetIndex(cCountry);

   		//Set Lma on list for selected province

		cArea = SetArea (iSelected + 1, cArea);

   		cArea[0].selected = true;

   		return iSelected;

  	}



///////////////////////////////////////////////////////////////////



	//Use to fill Area list box

	//Determine wich province is selected

	function GetIndex(cCountryPosi)

  	{

	   	var iSelected = 0;

        //document.write(cCountryPosi[2]);

   

   		for (var i = 0; i < cCountryPosi.length; i++)

     		{

			

      		if (cCountryPosi[i].selected == true)

        		{

         		iSelected = i;

				//document.write(cCountryPosi.value);

				//document.write(iSelected);

				//document.write(cCountryPosi[2].selected);

        		}

     		}

   		return iSelected;

  	}


///////////////////////////////////////////////////////////////////

//////////////////////// For Agent //////////////////////



	//Use to fill Area list box

	//Set Area for selected province

	function GetAgentCountryIndex(aCountry, aArea)

  	{

	    

   		//Wich Agent Country is select?

   		var iSelected = GetAgentIndex(aCountry);

   		//Set Lma on list for selected province

		aArea = SetAgentArea (iSelected + 1, aArea);

   		aArea[0].selected = true;

   		return iSelected;

  	}



///////////////////////////////////////////////////////////////////





	//Use to fill Area list box

	//Determine wich province is selected


	function GetAgentIndex(aCountryPosi)

  	{

	   	var iSelected = 0;

        //document.write(aCountryPosi[2]);

   

   		for (var i = 0; i < aCountryPosi.length; i++)

     		{

			

      		if (aCountryPosi[i].selected == true)

        		{

         		iSelected = i;

				//document.write(cCountryPosi.value);

				//document.write(iSelected);

				//document.write(cCountryPosi[2].selected);

        		}

     		}

   		return iSelected;

  	}





function SetAgentArea(Prov, lArea)

{

lArea.length = 0;

switch(Prov)

{

case 1:

{

AddToList_Agent (lArea,0,"------","AllOfThisPROVINCE");

break

}



case 39:

{

AddToList_Agent (lArea,0,"Alberta","Alberta");

AddToList_Agent (lArea,1,"British Columbia","British Columbia");

AddToList_Agent (lArea,2,"Manitoba","Manitoba");

AddToList_Agent (lArea,3,"New Brunswick","New Brunswick");

AddToList_Agent (lArea,4,"Newfoundland and Labrador","Newfoundland and Labrador");

AddToList_Agent (lArea,5,"Nova Scotia","Nova Scotia");

AddToList_Agent (lArea,6,"Ontario","Ontario");

AddToList_Agent (lArea,7,"Prince Edward Island","Prince Edward Island");

AddToList_Agent (lArea,8,"Quebec","Quebec");

AddToList_Agent (lArea,9,"Saskatchewan","Saskatchewan");

break

}



case 2:

{



break

}



case 31:

{



break

}



case 220:

{



AddToList_Agent (lArea,0,"Alabama","Alabama");

AddToList_Agent (lArea,1,"Alaska","Alaska");

AddToList_Agent (lArea,2,"Arizona","Arizona");

AddToList_Agent (lArea,3,"California","California");

AddToList_Agent (lArea,4,"Colllorado","Colorado");

AddToList_Agent (lArea,5,"Connecticut","Connecticut");

AddToList_Agent (lArea,6,"Delaware","Delaware");

AddToList_Agent (lArea,7,"Florida","Florida");

AddToList_Agent (lArea,8,"Georgia","Georgia");

AddToList_Agent (lArea,9,"Hawaii","Hawaii");

AddToList_Agent (lArea,10,"Idaho","Idaho");

AddToList_Agent (lArea,11,"Illinois","Illinois");

AddToList_Agent (lArea,12,"Indiana","Indiana");

AddToList_Agent (lArea,13,"Iowa","Iowa");

AddToList_Agent (lArea,14,"Kansas","Kansas");

AddToList_Agent (lArea,15,"Kentucky","Kentucky");

AddToList_Agent (lArea,16,"Louisiana","Louisiana");

AddToList_Agent (lArea,17,"California ","GON005");

AddToList_Agent (lArea,18,"Colorado<","GON028");

AddToList_Agent (lArea,19,"Connecticut","GON029");

AddToList_Agent (lArea,20,"Delaware","AllOfThisPROVINCE");

AddToList_Agent (lArea,21,"Maine","Maine");

AddToList_Agent (lArea,22,"Maryland","Maryland");

AddToList_Agent (lArea,23,"Massachusetts","Massachusetts");

AddToList_Agent (lArea,24,"Michigan","Michigan");

AddToList_Agent (lArea,25,"Minnesota","Minnesota");

AddToList_Agent (lArea,26,"Mississippi","Mississippi");

AddToList_Agent (lArea,27,"Missouri","Missouri");

AddToList_Agent (lArea,28,"Montana","Montana");

AddToList_Agent (lArea,29,"Nebraska","Nebraska");

AddToList_Agent (lArea,30,"Nevada","Nevada");

AddToList_Agent (lArea,31,"New Hampshire","New Hampshire");

AddToList_Agent (lArea,32,"New Jersey","New Jersey");

AddToList_Agent (lArea,33,"North Carolina","North Carolina");

AddToList_Agent (lArea,34,"North Dakota","North Dakota");

AddToList_Agent (lArea,35,"Ohio","Ohio");

AddToList_Agent (lArea,36,"Oklahoma","Oklahoma");

AddToList_Agent (lArea,37,"Oregon","Oregon");

AddToList_Agent (lArea,38,"Pennsylvania","Pennsylvania");

AddToList_Agent (lArea,39,"Puerto Rico","Puerto Rico");

AddToList_Agent (lArea,40,"Rhode Island","Rhode Island");

AddToList_Agent (lArea,41,"South Carolina","South Carolina");

AddToList_Agent (lArea,42,"South Dakota","South Dakota");

AddToList_Agent (lArea,43,"Tennessee","Tennesseea");

AddToList_Agent (lArea,44,"Texas","Texas");

AddToList_Agent (lArea,45,"Rhode Island","Rhode Island");

AddToList_Agent (lArea,46,"Utah","Utah");

AddToList_Agent (lArea,47,"Vermont","Vermont");

AddToList_Agent (lArea,48,"Virgin Islands","Virgin Islands");

AddToList_Agent (lArea,49,"Virginia","Virginia");

AddToList_Agent (lArea,50,"Washington","Washington");

AddToList_Agent (lArea,51,"West Virginia","West Virginia");

AddToList_Agent(lArea,52,"Wisconsin","Wisconsin");

AddToList_Agent (lArea,53,"Wyoming","Wyoming");



break

}



default:

{

AddToList_Agent(lArea, 0,"Outside of Canada/US", "Outside of Canada/US");

break;}

}

return lArea;

}



function AddToList_Agent (ListItem, iPosi, sText, sValue)

  	{

	    //document.write(ListItem[0]);

	   	//Create new option

		ListItem[iPosi] = new Option;

   		//Add <OPTION> dispay Text

		ListItem[iPosi].text = sText;

   		//Add <OPTION> value

		ListItem[iPosi].value = sValue;

   		//Select first item on list

		if (iPosi == 0)

			{ 

		  	ListItem[0].selected = true;

			

			}    

			

   		return 0;

		

  	}