//populate Source script
function PopulateList(source,target) {

   var sourceList = source;
   var targetList=target;
   
   // Clear out the list of teams
   ClearOptions(target);
   
   if (sourceList[sourceList.selectedIndex].value == "Internet") {
      AddToOptionList(targetList, "Canadian Business Directory", "Canadian Business Directory");
      AddToOptionList(targetList, "Canadian-Universities.net", "Canadian-Universities.net");
      AddToOptionList(targetList, "Chef2Chef.net", "Chef2Chef.net");
      AddToOptionList(targetList, "CookingCareer.shawguides.com", "CookingCareer.shawguides.com");
	  AddToOptionList(targetList, "CookingSchoolGuide.com", "CookingSchoolGuide.com");
      AddToOptionList(targetList, "CookingSchools.com", "CookingSchools.com");
      AddToOptionList(targetList, "CulinarySchools.com", "CulinarySchools.com");
      AddToOptionList(targetList, "CulinarySchoolsOnline.com", "CulinarySchoolsOnline.com");
      AddToOptionList(targetList, "GO2HR.com", "GO2HR.com");
      AddToOptionList(targetList, "HospitalityGuild.com", "HospitalityGuild.com");
      AddToOptionList(targetList, "MapMuse.com", "MapMuse.com");
      AddToOptionList(targetList, "MyCookingSchools.com", "MyCookingSchools.com");	  
      AddToOptionList(targetList, "NWCAV.com", "NWCAV.com");
      AddToOptionList(targetList, "Schoolfinder.com", "Schoolfinder.com");
      AddToOptionList(targetList, "StarChefs.com", "StarChefs.com");
      AddToOptionList(targetList, "Strategis.lc.gc.ca/cdncc", "Strategis.lc.gc.ca/cdncc");	  
      AddToOptionList(targetList, "StudyAbroadLinks.com", "StudyAbroadLinks.com");
      AddToOptionList(targetList, "UC411.com", "UC411.com");
      AddToOptionList(targetList, "VancouverPersonalChef.ca", "VancouverPersonalChef.ca");	
					
   }

   if (sourceList[sourceList.selectedIndex].value == "Magazine") {
      AddToOptionList(targetList, "City Food Magazine", "City Food Magazine");
       AddToOptionList(targetList, "Eat Magazine", "Eat Magazine");
   }

   if (sourceList[sourceList.selectedIndex].value == "Newspaper") {
      AddToOptionList(targetList, "Georgia Straight", "Georgia Straight");
      AddToOptionList(targetList, "Vancouver Sun", "Vancouver Sun");
	  AddToOptionList(targetList, "Vannet Newspapers", "Vannet Newspapers");
   }
   if (sourceList[sourceList.selectedIndex].value == "Other") {
      AddToOptionList(targetList, "Education Fairs", "Education Fairs");
      AddToOptionList(targetList, "Open House", "Open House");
	  AddToOptionList(targetList, "Street Sign", "Street Sign");
	  AddToOptionList(targetList, "Trade Show", "Trade Show");
	  AddToOptionList(targetList, "Walk In", "Walk In");
   }

   if (sourceList[sourceList.selectedIndex].value == "Referral") {
       AddToOptionList(targetList, "Parent", "Parent");
       AddToOptionList(targetList, "ProD", "ProD");
       AddToOptionList(targetList, "Student", "Student")
       AddToOptionList(targetList, "Teacher", "Teacher");
   }

}

function PopulateState(source,target) {

   var sourceList = source;
   var targetList=target;
   
   // Clear out the list of teams
   ClearOptions(target);
   
   if (sourceList[sourceList.selectedIndex].value == "CA") {
      AddToOptionList(targetList, "0", "-- Select Province --");
	  AddToOptionList(targetList, "AB", "Alberta");
      AddToOptionList(targetList, "BC", "British Columbia");
      AddToOptionList(targetList, "MB", "Manitoba");
      AddToOptionList(targetList, "NB", "New Brunswick");
	  AddToOptionList(targetList, "NS", "Nova Scotia");
      AddToOptionList(targetList, "NL", "Newfoundland");
      AddToOptionList(targetList, "NT", "Northwest Territories");
      AddToOptionList(targetList, "NU", "Nunavut");
      AddToOptionList(targetList, "ON", "Ontario");
      AddToOptionList(targetList, "PE", "Prince Edward Island");
      AddToOptionList(targetList, "QC", "Quebec");
      AddToOptionList(targetList, "SK", "Saskatchewan");	  
      AddToOptionList(targetList, "YT", "Yukon Territory");
   }

   else if (sourceList[sourceList.selectedIndex].value == "US") {
      AddToOptionList(targetList, "0", "-- Select State --");
      AddToOptionList(targetList, "AK", "Alaska");
      AddToOptionList(targetList, "AL", "Alabama");
	  AddToOptionList(targetList, "AR", "Arkansas");
      AddToOptionList(targetList,"AZ", "Arizona");
      AddToOptionList(targetList,"CA", "California");	
      AddToOptionList(targetList, "CO", "Colorado");
      AddToOptionList(targetList, "CT", "Connecticut");
	  AddToOptionList(targetList, "DC", "District of Columbia");
      AddToOptionList(targetList,"DE", "Delaware");
      AddToOptionList(targetList,"FL", "Florida");
      AddToOptionList(targetList, "GA", "Georgia");
      AddToOptionList(targetList, "HI", "Hawaii");
	  AddToOptionList(targetList, "IA", "Iowa");
      AddToOptionList(targetList,"ID", "Idaho");
      AddToOptionList(targetList,"IL", "Illinois");	
	  AddToOptionList(targetList, "IN", "Indiana");
      AddToOptionList(targetList,"KS", "Kansas");
      AddToOptionList(targetList,"FL", "Kentucky");
      AddToOptionList(targetList, "LA", "Louisiana");
      AddToOptionList(targetList, "MA", "Massachusetts");
	  AddToOptionList(targetList, "MD", "Maryland");
      AddToOptionList(targetList,"ME", "Maine");
      AddToOptionList(targetList,"MI", "Michigan");	
	  AddToOptionList(targetList, "IN", "Minnesota");
      AddToOptionList(targetList,"KS", "Missouri");
      AddToOptionList(targetList, "MS", "Mississippi");
      AddToOptionList(targetList, "MT", "Montana");
	  AddToOptionList(targetList, "NC", "North Carolina");
      AddToOptionList(targetList,"ND", "North Dakota");
      AddToOptionList(targetList,"NE", "Nebraska");	
	  AddToOptionList(targetList,"NH", "New Hampshire");	
	  AddToOptionList(targetList,"NJ", "New Jersey");
      AddToOptionList(targetList,"NM", "New Mexico");
      AddToOptionList(targetList,"NV", "Nevada");
      AddToOptionList(targetList,"NY", "New York");
	  AddToOptionList(targetList,"OH", "Ohio");
      AddToOptionList(targetList,"OK", "Oklahoma");
      AddToOptionList(targetList,"OR", "Oregon");	
	  AddToOptionList(targetList,"PR", "Puerto Rico");	
	  AddToOptionList(targetList,"PA", "Pennsylvania");
      AddToOptionList(targetList,"RI", "Rhode Island");
      AddToOptionList(targetList,"SC", "South Carolina");
      AddToOptionList(targetList,"SD", "South Dakota");
	  AddToOptionList(targetList,"TN", "Tennessee");
      AddToOptionList(targetList,"TX", "Texas");
      AddToOptionList(targetList,"UT", "Utah");
	  AddToOptionList(targetList,"VA", "Virginia");	
	  AddToOptionList(targetList,"VT", "Vermont");
      AddToOptionList(targetList,"WA", "Washington");
      AddToOptionList(targetList,"WI", "Wisconsin");
      AddToOptionList(targetList,"WV", "West Virginia");
	  AddToOptionList(targetList,"WY", "Wyoming");
		  
   }
   else
   {
	  AddToOptionList(targetList,"Other", "Other");
   }


}


function ClearOptions(OptionList) {

   // Always clear an option list from the last entry to the first
   for (x = OptionList.length; x >= 0; x = x - 1) {
      OptionList[x] = null;
   }
}


function AddToOptionList(OptionList, OptionValue, OptionText) {
   // Add option to the bottom of the list
   OptionList[OptionList.length] = new Option(OptionText, OptionValue);
}

