/*
'*****************************************************
'
'Created By: Synergistic Networks, Inc. (www.syn.net)
'
'Created For: Tivoli Enterprises, Inc. (www.classiccinemas.com)
'
'Copywrite: The attached copyright code was developed as a proprietary product by Synergistic Networks, Inc.
'and made available to Classic Cinemas/Tivoli Enterprises, Inc. under an exclusive use agreement.  
'As such, it may not be copied, used, or modified for use by any other party or parties without 
'the express written consent of Synergistic Networks, Inc.  
'
'*****************************************************
*/


//home page image rotation...
var interval = 4.5; // delay between rotating images (in seconds)
var random_display = 0; // 0 = no, 1 = yes

interval *= 1200;
isAOL = (navigator.appVersion.indexOf("AOL") != -1); 
if (isAOL){interval *= 9200;}

var image_index = 0;
image_list = new Array();
image_list[image_index++] = new imageItem("/images/Rotating/Theatre_45.gif");
image_list[image_index++] = new imageItem("/images/Rotating/Theatre_15.gif");
//image_list[image_index++] = new imageItem("/images/Rotating/Theatre_21.gif");
image_list[image_index++] = new imageItem("/images/Rotating/Theatre_5.gif");
image_list[image_index++] = new imageItem("/images/Rotating/Theatre_3.gif");
image_list[image_index++] = new imageItem("/images/Rotating/Theatre_18.gif");
image_list[image_index++] = new imageItem("/images/Rotating/Theatre_8.gif");

function verifyEmployForm(form){
	if(form.FirstName.value==""){alert('Please enter your first name.');form.FirstName.focus();return;}
	if(form.LastName.value==""){alert('Please enter your last name.');form.LastName.focus();return;}
	if(form.Address.value==""){alert('Please enter your address.');form.Address.focus();return;}
	if(form.City.value==""){alert('Please enter your city.');form.City.focus();return;}
	if(form.State.value==""){alert('Please enter your state.');form.State.focus();return;}
	if(form.Zip.value==""){alert('Please enter your zip.');form.Zip.focus();return;}
	if(form.DayPhone.value==""){alert('Please enter your day phone.');form.DayPhone.focus();return;}
	if(form.EveningPhone.value==""){alert('Please enter your evening phone.');form.EveningPhone.focus();return;}
	if(form.Locations.value==""){alert('Please select at least one location.');form.Locations.focus();return;}
	form.submit();
}//end function


var number_of_image = image_list.length;
function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}

function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}

function generate(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}

function getNextImage() {
if (random_display) {
image_index = generate(0, number_of_image-1);
}
else {
image_index = (image_index+1) % number_of_image;
}
var new_image = get_ImageItemLocation(image_list[image_index]);
return(new_image);
}

function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
setTimeout(recur_call, interval);
//changeStatusBar();
}

function changeStatusBar(){
var imageNumb
var statusMessage	
imageNumb = image_index
	if (imageNumb == 0){
	statusMessage="Charlestowne 18 Theatre";
	}
	if (imageNumb == 1){
	statusMessage="Elk Grove Theatre";
	}
	if (imageNumb == 2){
	statusMessage="Lake Theatre";
	}
	//if (imageNumb == 3){
	//statusMessage="Park Forest Theatre";
	//}
	if (imageNumb == 4){
	statusMessage="Tivoli Theatre";
	}
	if (imageNumb == 5){
	statusMessage="Woodstock Theatre";
	}
	if (imageNumb == 6){
	statusMessage="York Theatre";
	}
//window.status=statusMessage;return true;
}

//  End 