﻿// booking.js

var showNames = new Array("", "Streets of Sudbury",
	"The Help (12A)", "Galaxy Big Band", "Streets of Sudbury", "New Year's Eve (12A)",
	"Patrick Monahan - Hug Me I Feel Good", "Caught on Camera", "A Woman of No Importance", "Streets of Sudbury",
	"My Week With Marilyn (15)", "The Ghost Train (U)", "The Ghost Train Porters", "Murder Mystery Evening",
	"Streets of Sudbury", "The Ides of March (15)", "Private Resistance", "IDMC Gospel Choir",
	"History Sundays", "Film - to be announced", "Hardeep Singh Kohli - The Nearly Naked Chef", "History Sundays",
	"War Horse (12A)", "The Ugly Duckling", "The Iron Lady (12A)", "Celebrating Dicken's 200th Anniversary - Nicholas Nickleby",
	"Red Barn Theatre Company - Variety Show", "History Sundays", "Salad Days", "Film - to be announced",
	"Michael Law - Cocktails and Laughter", "The Floyd Effect", "Kevin Precious - Not Appropriate", "Limehouse Lizzy",
	"Elsie and Norm's Macbeth", "The Artist (PG)", "Graffiti Classics");
var showDates = new Array("", "February 19th",
	"February 22nd", "February 25th", "February 26th", "February 29th",
	"March 1st", "March 2nd", "SDS", "March 11th",
	"March 14th", "March 15th", "March 16th", "March 17th",
	"March 18th", "March 21st", "March 22nd", "March 24th",
	"March 25th", "March 28th", "March 30th", "April 1st",
	"April 4th", "April 7th", "April 11th", "April 13th",
	"April 14th", "April 15th", "SMS", "April 25th",
	"April 27th", "April 28th", "May 3rd", "May 4th",
	"SDS2", "May 16th", "May 18th");
var showTimes = new Array("", "7.30pm",
	"film", "7.30pm", "7.30pm", "film",
	"7.30pm", "7.30pm", "7.45pm", "7.30pm",
	"film", "7pm", "7.30pm", "7.30pm",
	"7.30pm", "film", "7.30pm", "7.30pm",
	"7.30pm", "film", "7.30pm", "7.30pm",
	"film", "kids", "film", "7.30pm",
	"7.30pm", "7.30pm", "7.30pm", "film",
	"7.30pm", "7.30pm", "7.30pm", "7.30pm",
	"7.45pm", "film", "7.30pm");

function fillShowNames() {
	
	var selectShow = document.getElementById("showName");
	
// The first option is always blank
	selectShow.options[0] = new Option("", "");
	
	for (i=1; i<(showNames.length); i++)
		{
			selectShow.options[i] = new Option(showNames[i], showNames[i]);
		}

}
		
function fillOtherSelects() {

	var indexChosen = document.getElementById("showName").selectedIndex;
	var selectDate = document.getElementById("showDate");
	var selectTime = document.getElementById("showTime");
	
// Just in case ...
	selectDate.options.length = 0;
	selectTime.options.length = 0;
	
	if (showDates[indexChosen]=="streets0205")
		{
			selectDate.options[0] = new Option("February 5th", "February 5th");
			selectDate.options[1] = new Option("Book for all 5", "Book for all 5");
			
			selectTime.options[0] = new Option("7.30pm", "7.30pm");
		}
	else if (showDates[indexChosen]=="SDS")
		{
			selectDate.options[0] = new Option("March 6th", "March 6th");
			selectDate.options[1] = new Option("March 7th", "March 7th");
			selectDate.options[2] = new Option("March 8th", "March 8th");
			selectDate.options[3] = new Option("March 9th", "March 9th");
			selectDate.options[4] = new Option("March 10th", "March 10th");
			
			selectTime.options[0] = new Option("7.45pm", "7.45pm");
		}
	else if (showDates[indexChosen]=="SMS")
		{
			selectDate.options[0] = new Option("April 18th", "April 18th");
			selectDate.options[1] = new Option("April 19th", "April 19th");
			selectDate.options[2] = new Option("April 20th", "April 20th");
			selectDate.options[3] = new Option("April 21st", "April 21st");
			
			selectTime.options[0] = new Option("7.30pm", "7.30pm");
		}
	else if (showDates[indexChosen]=="SDS2")
		{
			selectDate.options[0] = new Option("May 8th", "May 8th");
			selectDate.options[1] = new Option("May 9th", "May 9th");
			selectDate.options[2] = new Option("May 10th", "May 10th");
			selectDate.options[3] = new Option("May 11th", "May 11th");
			selectDate.options[4] = new Option("May 12th", "May 12th");
			
			selectTime.options[0] = new Option("7.45pm", "7.45pm");
		}
	else if (showTimes[indexChosen]=="film")
		{
			selectDate.options[0] = new Option(showDates[indexChosen], showDates[indexChosen]);
					
			selectTime.options[0] = new Option("2pm", "2pm");
			selectTime.options[1] = new Option("7.30pm", "7.30pm");
		}
	else if (showTimes[indexChosen]=="kids")
		{
			selectDate.options[0] = new Option(showDates[indexChosen], showDates[indexChosen]);
					
			selectTime.options[0] = new Option("1pm", "1pm");
			selectTime.options[1] = new Option("4.30pm", "4.30pm");
		}
	else
		{
			selectDate.options[0] = new Option(showDates[indexChosen], showDates[indexChosen]);
			selectTime.options[0] = new Option(showTimes[indexChosen], showTimes[indexChosen]);
		}		
 	
}

function clearOtherSelects() {
// Reset doesn't clear the date and time boxes ...
	var selectDate = document.getElementById("showDate");
	var selectTime = document.getElementById("showTime");
	
	selectDate.options.length = 0;
	selectTime.options.length = 0;
}	
