// This script provides interactivity for the dropdown menu for Information Session dates

function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.smis_location, "Pleasant Hill", "Pleasant Hill", "");
addOption(document.drop_list.smis_location, "Los Angeles", "Los Angeles", "");
addOption(document.drop_list.smis_location, "Mission Viejo", "Mission Viejo", "");
addOption(document.drop_list.smis_location, "San Diego", "San Diego", "");
addOption(document.drop_list.smis_location, "Indianapolis", "Indianapolis", "");
addOption(document.drop_list.smis_location, "Atlanta", "Atlanta", "");
addOption(document.drop_list.smis_location, "Raleigh", "Raleigh", "");
addOption(document.drop_list.smis_location, "Pearland", "Pearland", "");
addOption(document.drop_list.smis_location, "Dallas", "Dallas", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.smis_date);
addOption(document.drop_list.smis_date, "", "Date", "");

if(document.drop_list.smis_location.value == 'Pleasant Hill'){
addOption(document.drop_list.smis_date,"January 21st", "January 21st");
addOption(document.drop_list.smis_date,"February 4th", "February 4th");
addOption(document.drop_list.smis_date,"February 11th", "February 11th");
addOption(document.drop_list.smis_date,"March 3rd", "March 3rd");
addOption(document.drop_list.smis_date,"March 17th", "March 17th");
addOption(document.drop_list.smis_date,"April 14th", "April 14th");
addOption(document.drop_list.smis_date,"April 21st", "April 21st");
addOption(document.drop_list.smis_date,"May 5th", "May 5th");
addOption(document.drop_list.smis_date,"May 12th", "May 12th");
addOption(document.drop_list.smis_date,"June 2nd", "June 2nd");
addOption(document.drop_list.smis_date,"July 14th", "July 14th");
addOption(document.drop_list.smis_date,"July 21st", "July 21st");
addOption(document.drop_list.smis_date,"August 4th", "August 4th");
addOption(document.drop_list.smis_date,"August 11th", "August 11th");
addOption(document.drop_list.smis_date,"September 8th", "September 8th");
addOption(document.drop_list.smis_date,"September 15th", "September 15th");
addOption(document.drop_list.smis_date,"October 13th", "October 13th");
addOption(document.drop_list.smis_date,"October 20th", "October 20th");
addOption(document.drop_list.smis_date,"November 3rd", "November 3rd");
addOption(document.drop_list.smis_date,"December 1st", "December 1st");
addOption(document.drop_list.smis_date,"December 8th", "December 8th");
}
if(document.drop_list.smis_location.value == 'Los Angeles'){
addOption(document.drop_list.smis_date,"February 4th", "February 4th");
addOption(document.drop_list.smis_date,"February 11th", "February 11th");
addOption(document.drop_list.smis_date,"March 10th", "March 10th");
addOption(document.drop_list.smis_date,"April 14th", "April 14th");
addOption(document.drop_list.smis_date,"April 21st", "April 21st");
addOption(document.drop_list.smis_date,"May 12th", "May 12th");
addOption(document.drop_list.smis_date,"June 2nd", "June 2nd");
addOption(document.drop_list.smis_date,"July 21st", "July 21st");
addOption(document.drop_list.smis_date,"August 4th", "August 4th");
addOption(document.drop_list.smis_date,"August 11th", "August 11th");
addOption(document.drop_list.smis_date,"September 15th", "September 15th");
addOption(document.drop_list.smis_date,"October 13th", "October 13th");
addOption(document.drop_list.smis_date,"October 20th", "October 20th");
addOption(document.drop_list.smis_date,"November 3rd", "November 3rd");
addOption(document.drop_list.smis_date,"December 1st", "December 1st");
}
if(document.drop_list.smis_location.value == 'Mission Viejo'){
addOption(document.drop_list.smis_date,"March 3rd", "March 3rd");
addOption(document.drop_list.smis_date,"May 5th", "May 5th");
addOption(document.drop_list.smis_date,"July 14th", "July 14th");
addOption(document.drop_list.smis_date,"September 8th", "September 8th");
addOption(document.drop_list.smis_date,"November 3rd", "November 3rd");
}
if(document.drop_list.smis_location.value == 'San Diego'){
addOption(document.drop_list.smis_date,"February 4th", "February 4th");
addOption(document.drop_list.smis_date,"April 14th", "April 14th");
addOption(document.drop_list.smis_date,"June 2nd", "June 2nd");
addOption(document.drop_list.smis_date,"August 4th", "August 4th");
addOption(document.drop_list.smis_date,"October 13th", "October 13th");
addOption(document.drop_list.smis_date,"December 1st", "December 1st");
}
if(document.drop_list.smis_location.value == 'Indianapolis'){
addOption(document.drop_list.smis_date,"February 4th", "February 4th");
addOption(document.drop_list.smis_date,"March 3rd", "March 3rd");
addOption(document.drop_list.smis_date,"April 14th", "April 14th");
addOption(document.drop_list.smis_date,"May 5th", "May 5th");
addOption(document.drop_list.smis_date,"June 2nd", "June 2nd");
addOption(document.drop_list.smis_date,"July 14th", "July 14th");
addOption(document.drop_list.smis_date,"August 4th", "August 4th");
addOption(document.drop_list.smis_date,"September 8th", "September 8th");
addOption(document.drop_list.smis_date,"October 13th", "October 13th");
addOption(document.drop_list.smis_date,"November 3rd", "November 3rd");
addOption(document.drop_list.smis_date,"December 1st", "December 1st");
}
if(document.drop_list.smis_location.value == 'Atlanta'){
addOption(document.drop_list.smis_date,"February 4th", "February 4th");
addOption(document.drop_list.smis_date,"March 3rd", "March 3rd");
addOption(document.drop_list.smis_date,"April 14th", "April 14th");
addOption(document.drop_list.smis_date,"May 5th", "May 5th");
addOption(document.drop_list.smis_date,"June 2nd", "June 2nd");
addOption(document.drop_list.smis_date,"July 14th", "July 14th");
addOption(document.drop_list.smis_date,"August 4th", "August 4th");
addOption(document.drop_list.smis_date,"September 8th", "September 8th");
addOption(document.drop_list.smis_date,"October 13th", "October 13th");
addOption(document.drop_list.smis_date,"November 3rd", "November 3rd");
addOption(document.drop_list.smis_date,"December 1st", "December 1st");
}
if(document.drop_list.smis_location.value == 'Raleigh'){
addOption(document.drop_list.smis_date,"February 4th", "February 4th");
addOption(document.drop_list.smis_date,"March 3rd", "March 3rd");
addOption(document.drop_list.smis_date,"April 14th", "April 14th");
addOption(document.drop_list.smis_date,"May 5th", "May 5th");
addOption(document.drop_list.smis_date,"June 2nd", "June 2nd");
addOption(document.drop_list.smis_date,"July 14th", "July 14th");
addOption(document.drop_list.smis_date,"August 4th", "August 4th");
addOption(document.drop_list.smis_date,"September 8th", "September 8th");
addOption(document.drop_list.smis_date,"October 6th", "October 6th");
addOption(document.drop_list.smis_date,"November 3rd", "November 3rd");
addOption(document.drop_list.smis_date,"December 2nd", "December 2nd");
}
if(document.drop_list.smis_location.value == 'Pearland'){
addOption(document.drop_list.smis_date,"January 21st", "January 21st");
addOption(document.drop_list.smis_date,"February 11th", "February 11th");
addOption(document.drop_list.smis_date,"March 10th", "March 10th");
addOption(document.drop_list.smis_date,"April 14th", "April 14th");
addOption(document.drop_list.smis_date,"May 12th", "May 12th");
addOption(document.drop_list.smis_date,"June 9th", "June 9th");
addOption(document.drop_list.smis_date,"July 14th", "July 14th");
addOption(document.drop_list.smis_date,"August 4th", "August 4th");
addOption(document.drop_list.smis_date,"September 8th", "September 8th");
addOption(document.drop_list.smis_date,"October 13th", "October 13th");
addOption(document.drop_list.smis_date,"November 3rd", "November 3rd");
addOption(document.drop_list.smis_date,"December 8th", "December 8th");
}
if(document.drop_list.smis_location.value == 'Dallas'){
addOption(document.drop_list.smis_date,"March 3rd", "March 3rd");
addOption(document.drop_list.smis_date,"May 5th", "May 5th");
addOption(document.drop_list.smis_date,"July 14th", "July 14th");
addOption(document.drop_list.smis_date,"September 15th", "September 15th");
addOption(document.drop_list.smis_date,"November 3rd", "November 3rd");
}
}
////////////////// 

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}

