window.onload = initForm;

function initForm() {
     document.getElementById("Seminar").selectedIndex = 0;
     document.getElementById("Seminar").onchange = populateDays;
}

function populateDays() {

     var locationStr = this.options[this.selectedIndex].value;
     //Delete all options
     document.getElementById("Location").options.length = 0;

     //Repopulate options based on users choise
     if (locationStr == ""){
 	   							//Text, value 	       
           document.getElementById("Location").options[0] = new Option('Location & Date');
	
	}


     if (locationStr == "session"){
 	   							//Text, value 
 	   	   document.getElementById("EmailSubject").value = 'Seminar Registration';	       
           document.getElementById("Location").options[0] = new Option('TBA');
           //document.getElementById("Location").options[1] = new Option('Burlington - April 29th', 'Burlington - April 29th');
           //document.getElementById("Location").options[2] = new Option('Windsor - April 30th', 'Windsor - April 30th');
           //document.getElementById("Location").options[3] = new Option('London - May 1st', 'London - May 1st');
           //document.getElementById("Location").options[4] = new Option('Calgary - May 13th', 'Calgary - May 13th');
           //document.getElementById("Location").options[5] = new Option('Edmonton - May 15th', 'Edmonton - May 15th');
           //document.getElementById("Location").options[6] = new Option('Fort McMurray - June 19th', 'Fort McMurray - June 19th');

	}

     if (locationStr == "workshop"){
        							//Text, value
           document.getElementById("EmailSubject").value = 'Workshop Registration';
           document.getElementById("Location").options[0] = new Option('Burlington - May 27th', 'Burlington - May 27th');
           document.getElementById("Location").options[1] = new Option('London/Chatham - June 1st', 'London/Chatham - June 1st');
           document.getElementById("Location").options[2] = new Option('Calgary - June 16th', 'Calgary - June 16th');
           document.getElementById("Location").options[3] = new Option('Edmonton - June 17th', 'Edmonton - June 17th');
           document.getElementById("Location").options[4] = new Option('Fort McMurray - June 19th', 'Fort McMurray - June 19th');
           document.getElementById("Location").options[5] = new Option('Windsor/Chatham - June 24th', 'Windsor/Chatham - June 24th');
           document.getElementById("Location").options[6] = new Option('Toronto - July 8th', 'Toronto - July 8th');
          
        }
}

