if (document.images) {
	
	upArrowOff= new Image();
	upArrowOff.src = "images/upArrowOff.jpg";
	
	upArrowOn= new Image();
	upArrowOn.src = "images/upArrowOn.jpg";
	
	downArrowOff= new Image();
	downArrowOff.src = "images/downArrowOff.jpg";
	
	downArrowOn= new Image();
	downArrowOn.src = "images/downArrowOn.jpg";
	
	leftArrowOff= new Image();
	leftArrowOff.src = "images/leftArrowOff.jpg";
	
	leftArrowOn= new Image();
	leftArrowOn.src = "images/leftArrowOn.jpg";
	
	rightArrowOff= new Image();
	rightArrowOff.src = "images/rightArrowOff.jpg";
	
	rightArrowOn= new Image();
	rightArrowOn.src = "images/rightArrowOn.jpg";
}



////////////////////////////////////////////////////////////////////////////////
/////////////////////////// PRELOAD IMAGES /////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//function preLoadFoodImages(){
//var i = new Array(11); // the number in"()" must match the number of images you use
//for(i1=0; i1 < i.length; i1++){
	//i[i1] = new Image();
	//i[i1].src = 'images/show/'+(i1+1)+'.jpg';
//}
//}

function reloadFoodPage(){
location.replace("food.php");
}
function reloadProductPage(){
location.replace("product.php");
}
function reloadPeoplePage(){
location.replace("people.php");
}
function reloadMorePage(){
location.replace("more.php");
}


//////////////// GLOBALS ////////////////////////////////////
var previous = null; // sets variable for hiding previous submenus so 2 won't show at one time...
var previousThumb = null; // sets variable for hiding previous submenus so 2 won't show at one time...
var previousThumbOver = null; // sets variable for hiding previous submenus so 2 won't show at one time...
var subTimer = 1000;  // this sets the timer delay for the sub menus in miliseconds...
var timerID;
var statement; //= null;
var previousDiv = null;
var	divNumber = 1;
var _numDivs;
var _numImages;
var f1 = 1;
var t1 = 1;
var _counter = 1;
var previousCopyDiv = null;
var _copyDivCounter = 1;
var _imageDivCounter = 1;
var previousStudioThumbCopy = null;
var previousImageDiv = null;


////////////////////////////////////////////////////////////////////////////////
/////////////////////////// HOME SLIDE SHOW /////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

var c1=0;


//function preLoadShow(){
//var i = new Array(11); // the number in"()" must match the number of images you use
//for(i1=0; i1 < i.length; i1++){
	//i[i1] = new Image();
	//i[i1].src = 'images/show/'+(i1+1)+'.jpg';
//}
//}

var showTimer = 2000; 
var showTimerID;

function swapShowImage(imageName, newImage) {
	if (document.images) {
			if (c1 >= i.length) {
				c1=0;
	      	function clearShowTimer() {
   window.clearInterval(showTimerID);
}
	    	}
		document[imageName].src = eval(newImage + '.src');
		c1++;
	}
}

function setShowTimer(imageName, newImage) {
 var fn = "swapShowImage('"+imageName+"', '"+newImage+"')";
   showTimerID = window.setInterval(fn, showTimer);
}

function clearShowTimer() {
   window.clearInterval(showTimerID);
}



/////////////////////////////////////////////////////////////////////////
// FUNCTION: HIDE AND SHOW FOOD IMAGE DIVS
/////////////////////////////////////////////////////////////////////////
function hideAndShowImageDiv(layerName){
		if (_counter >= imageDivArray.length+1) {
	      _counter = 1;
	      layerName = 'mainImageDiv'+_counter;
	    }
	    if (_counter < 1){
		_counter= imageDivArray.length;
		layerName = 'mainImageDiv'+_counter;
		}
	var reference = document.getElementById(layerName);
	if(previousImageDiv!= null){hide(previousImageDiv)} previousImageDiv=layerName;
	reference.style.visibility="visible";
}


/////////////////////////////////////////////////////////////////////////
// FUNCTION: MATCH FOOD DIVs WITH FOOD IMAGE DIVS
/////////////////////////////////////////////////////////////////////////
function matchFoodDivWithImage(){
	if (_counter >= 1 && _counter <= 6){////////////////// 1-6
		f1 =1;
		showThumb('thumbDiv'+ foodDivArray[f1-1]);}
			
	if (_counter >= 7 && _counter <= 12 ){////////////////// 7-12
		f1 = 2;
		showThumb('thumbDiv'+ foodDivArray[f1-1]);}
			
	if (_counter >= 13 && _counter <= 18 ){////////////////// 13-18
		f1 = 3;
		showThumb('thumbDiv'+ foodDivArray[f1-1]);}
			
	if (_counter >= 19 && _counter <= 24 ){////////////////// 19-24
		f1 = 4;
		showThumb('thumbDiv'+ foodDivArray[f1-1]);}
			
	if (_counter >= 25 && _counter <= 30 ){////////////////// 25-30
		f1 = 5;
		showThumb('thumbDiv'+ foodDivArray[f1-1]);}
			
	if (_counter >= 31 && _counter <= 36 ){////////////////// 31-36
		f1 = 6;
		showThumb('thumbDiv'+ foodDivArray[f1-1]);}
			
	if (_counter >= 37 && _counter <= 42 ){////////////////// 37-42
		f1 = 7;
		showThumb('thumbDiv'+ foodDivArray[f1-1]);}
			
	if (_counter >= 43 && _counter <= 48 ){////////////////// 43-48
		f1 = 8;
		showThumb('thumbDiv'+ foodDivArray[f1-1]);}
			
	if (_counter >= 49 && _counter <= 54 ){////////////////// 49-54
		f1 = 9;
		showThumb('thumbDiv'+ foodDivArray[f1-1]);}
			
	if (_counter >= 55 && _counter <= 60 ){////////////////// 55-60
		f1 = 10;
		showThumb('thumbDiv'+ foodDivArray[f1-1]);}
			
	if (_counter >= 61 && _counter <= 66 ){////////////////// 61-66
		f1 = 11;
		showThumb('thumbDiv'+ foodDivArray[f1-1]);}
			
	if (_counter >= 67 && _counter <= 72 ){////////////////// 67-72
		f1 = 12;
		showThumb('thumbDiv'+ foodDivArray[f1-1]);}
	}


/////////////////////////////////////////////////////////////////////////
// FUNCTION: MATCH PRODUCT DIVS WITH PRODUCT IMAGE DIVS
/////////////////////////////////////////////////////////////////////////
function matchProductDivWithImage(){
	if (_counter >= 1 && _counter <= 6){////////////////// 1-6
		f1 =1;
		showProductThumb('thumbDiv'+ productDivArray[f1-1]);}
			
	if (_counter >= 7 && _counter <= 12 ){////////////////// 7-12
		f1 = 2;
		showProductThumb('thumbDiv'+ productDivArray[f1-1]);}
			
	if (_counter >= 13 && _counter <= 18 ){////////////////// 13-18
		f1 = 3;
		showProductThumb('thumbDiv'+ productDivArray[f1-1]);}
			
	if (_counter >= 19 && _counter <= 24 ){////////////////// 19-24
		f1 = 4;
		showProductThumb('thumbDiv'+ productDivArray[f1-1]);}
			
	if (_counter >= 25 && _counter <= 30 ){////////////////// 25-30
		f1 = 5;
		showProductThumb('thumbDiv'+ productDivArray[f1-1]);}
			
	if (_counter >= 31 && _counter <= 36 ){////////////////// 31-36
		f1 = 6;
		showProductThumb('thumbDiv'+ productDivArray[f1-1]);}
			
	if (_counter >= 37 && _counter <= 42 ){////////////////// 37-42
		f1 = 7;
		showProductThumb('thumbDiv'+ productDivArray[f1-1]);}
			
	if (_counter >= 43 && _counter <= 48 ){////////////////// 43-48
		f1 = 8;
		showProductThumb('thumbDiv'+ productDivArray[f1-1]);}
			
	if (_counter >= 49 && _counter <= 54 ){////////////////// 49-54
		f1 = 9;
		showProductThumb('thumbDiv'+ productDivArray[f1-1]);}
			
	if (_counter >= 55 && _counter <= 60 ){////////////////// 55-60
		f1 = 10;
		showProductThumb('thumbDiv'+ productDivArray[f1-1]);}
			
	if (_counter >= 61 && _counter <= 66 ){////////////////// 61-66
		f1 = 11;
		showProductThumb('thumbDiv'+ productDivArray[f1-1]);}
			
	if (_counter >= 67 && _counter <= 72 ){////////////////// 67-72
		f1 = 12;
		showProductThumb('thumbDiv'+ productDivArray[f1-1]);}
	}
	
	
/////////////////////////////////////////////////////////////////////////
// FUNCTION: MATCH PEOPLE DIVS WITH PEOPLE IMAGE DIVS
/////////////////////////////////////////////////////////////////////////
function matchPeopleDivWithImage(){
	if (_counter >= 1 && _counter <= 6){////////////////// 1-6
		f1 =1;
		showPeopleThumb('thumbDiv'+ peopleDivArray[f1-1]);}
			
	if (_counter >= 7 && _counter <= 12 ){////////////////// 7-12
		f1 = 2;
		showPeopleThumb('thumbDiv'+ peopleDivArray[f1-1]);}
			
	if (_counter >= 13 && _counter <= 18 ){////////////////// 13-18
		f1 = 3;
		showPeopleThumb('thumbDiv'+ peopleDivArray[f1-1]);}
			
	if (_counter >= 19 && _counter <= 24 ){////////////////// 19-24
		f1 = 4;
		showPeopleThumb('thumbDiv'+ peopleDivArray[f1-1]);}
			
	if (_counter >= 25 && _counter <= 30 ){////////////////// 25-30
		f1 = 5;
		showPeopleThumb('thumbDiv'+ peopleDivArray[f1-1]);}
			
	if (_counter >= 31 && _counter <= 36 ){////////////////// 31-36
		f1 = 6;
		showPeopleThumb('thumbDiv'+ peopleDivArray[f1-1]);}
			
	if (_counter >= 37 && _counter <= 42 ){////////////////// 37-42
		f1 = 7;
		showPeopleThumb('thumbDiv'+ peopleDivArray[f1-1]);}
			
	if (_counter >= 43 && _counter <= 48 ){////////////////// 43-48
		f1 = 8;
		showPeopleThumb('thumbDiv'+ peopleDivArray[f1-1]);}
			
	if (_counter >= 49 && _counter <= 54 ){////////////////// 49-54
		f1 = 9;
		showPeopleThumb('thumbDiv'+ peopleDivArray[f1-1]);}
			
	if (_counter >= 55 && _counter <= 60 ){////////////////// 55-60
		f1 = 10;
		showPeopleThumb('thumbDiv'+ peopleDivArray[f1-1]);}
			
	if (_counter >= 61 && _counter <= 66 ){////////////////// 61-66
		f1 = 11;
		showPeopleThumb('thumbDiv'+ peopleDivArray[f1-1]);}
			
	if (_counter >= 67 && _counter <= 72 ){////////////////// 67-72
		f1 = 12;
		showPeopleThumb('thumbDiv'+ peopleDivArray[f1-1]);}
	}
	
	
/////////////////////////////////////////////////////////////////////////
// FUNCTION: MATCH MORE DIVS WITH MORE IMAGE DIVS
/////////////////////////////////////////////////////////////////////////
function matchMoreDivWithImage(){
	if (_counter >= 1 && _counter <= 6){////////////////// 1-6
		f1 =1;
		showMoreThumb('thumbDiv'+ moreDivArray[f1-1]);}
			
	if (_counter >= 7 && _counter <= 12 ){////////////////// 7-12
		f1 = 2;
		showMoreThumb('thumbDiv'+ moreDivArray[f1-1]);}
			
	if (_counter >= 13 && _counter <= 18 ){////////////////// 13-18
		f1 = 3;
		showMoreThumb('thumbDiv'+ moreDivArray[f1-1]);}
			
	if (_counter >= 19 && _counter <= 24 ){////////////////// 19-24
		f1 = 4;
		showMoreThumb('thumbDiv'+ moreDivArray[f1-1]);}
			
	if (_counter >= 25 && _counter <= 30 ){////////////////// 25-30
		f1 = 5;
		showMoreThumb('thumbDiv'+ moreDivArray[f1-1]);}
			
	if (_counter >= 31 && _counter <= 36 ){////////////////// 31-36
		f1 = 6;
		showMoreThumb('thumbDiv'+ moreDivArray[f1-1]);}
			
	if (_counter >= 37 && _counter <= 42 ){////////////////// 37-42
		f1 = 7;
		showMoreThumb('thumbDiv'+ moreDivArray[f1-1]);}
			
	if (_counter >= 43 && _counter <= 48 ){////////////////// 43-48
		f1 = 8;
		showMoreThumb('thumbDiv'+ moreDivArray[f1-1]);}
			
	if (_counter >= 49 && _counter <= 54 ){////////////////// 49-54
		f1 = 9;
		showMoreThumb('thumbDiv'+ moreDivArray[f1-1]);}
			
	if (_counter >= 55 && _counter <= 60 ){////////////////// 55-60
		f1 = 10;
		showMoreThumb('thumbDiv'+ moreDivArray[f1-1]);}
			
	if (_counter >= 61 && _counter <= 66 ){////////////////// 61-66
		f1 = 11;
		showMoreThumb('thumbDiv'+ moreDivArray[f1-1]);}
			
	if (_counter >= 67 && _counter <= 72 ){////////////////// 67-72
		f1 = 12;
		showMoreThumb('thumbDiv'+ moreDivArray[f1-1]);}
	}




// SHOW FOOD THUMB ////////////////////////////////
function showThumb(layerName){
		if (f1 >= foodDivArray.length+1) {
	      f1 = 1;
	      layerName = 'thumbDiv'+f1;
	    }
	    
	    if (f1 < 1){
		f1= foodDivArray.length;
		layerName = 'thumbDiv'+f1;
		}
		
	var reference = document.getElementById(layerName);
	if(previousThumb!= null){hide(previousThumb)} previousThumb=layerName;
	reference.style.visibility="visible";
}


// SHOW PRODUCT THUMB ////////////////////////////////
function showProductThumb(layerName){
		if (f1 >= productDivArray.length+1) {
	      f1 = 1;
	      layerName = 'thumbDiv'+f1;
	    }
	    
	    if (f1 < 1){
		f1= productDivArray.length;
		layerName = 'thumbDiv'+f1;
		}
		
	var reference = document.getElementById(layerName);
	if(previousThumb!= null){hide(previousThumb)} previousThumb=layerName;
	reference.style.visibility="visible";
}


// SHOW PEOPLE THUMB ////////////////////////////////
function showPeopleThumb(layerName){
		if (f1 >= peopleDivArray.length+1) {
	      f1 = 1;
	      layerName = 'thumbDiv'+f1;
	    }
	    
	    if (f1 < 1){
		f1= peopleDivArray.length;
		layerName = 'thumbDiv'+f1;
		}
		
	var reference = document.getElementById(layerName);
	if(previousThumb!= null){hide(previousThumb)} previousThumb=layerName;
	reference.style.visibility="visible";
}


// SHOW MORE THUMB ////////////////////////////////
function showMoreThumb(layerName){
		if (f1 >= moreDivArray.length+1) {
	      f1 = 1;
	      layerName = 'thumbDiv'+f1;
	    }
	    
	    if (f1 < 1){
		f1= moreDivArray.length;
		layerName = 'thumbDiv'+f1;
		}
		
	var reference = document.getElementById(layerName);
	if(previousThumb!= null){hide(previousThumb)} previousThumb=layerName;
	reference.style.visibility="visible";
}




function showThumbOver(layerName){
		if (t1 >= thumbOverArray.length+1) {
	      t1 = 1;
	      layerName = 'thumbOverDiv'+t1;
	    }
	    
	    if (t1 < 1){
		t1= thumbOverArray.length;
		layerName = 'thumbOverDiv'+t1;
		}
		
	var reference = document.getElementById(layerName);
	if(previousThumbOver!= null){hide(previousThumbOver)} previousThumbOver=layerName;
	reference.style.visibility="visible";
}



////////////////////////////////////////////////////////////////////////////////
/////////////////////////// GALLERY SWAP FUNTIONS /////////////////////////////////
////////////////////////////////////////////////////////////////////////////////


function swapIdentityDivImage(imageName, newImage, layerName) {
	if (document.images) {
	    var d = document[imageName];
	    if (layerName && document.layers) {
	       d = document.layers[layerName].document[imageName];
	    }
	    if (g1 >= identityArray.length +1) {
	      	g1 = 1;
	    	}
	    if (g1 < 1){
			g1= identityArray.length;
			}
	    d.src = eval(newImage + ".src");
	}
}




	
////////////////////////////////////////////////////////////////////////////////
/////////////////////////// GALLERY SWAP FUNTIONS /////////////////////////////////
////////////////////////////////////////////////////////////////////////////////




function turnOn(imageName) {
	if (document.images) {
		document[imageName].src = eval(imageName + "On.src");
	}
}

function turnOff(imageName) {
	if (document.images) {
		document[imageName].src = eval(imageName + "Off.src");
	}
}

function swapImage(imageName, newImage) {
	if (document.images) {
		document[imageName].src = eval(newImage + ".src");
	}
}


function setTimer(layerName) {
   var fn = "hideLayer('"+layerName+"')";
   timerID = setTimeout(fn, subTimer);
}

function clearTimer() {
   clearTimeout(timerID);
}

function showLayer(layerName){
	var reference = document.getElementById(layerName);
	reference.style.visibility="visible";
}

function hideLayer(layerName){
	var reference = document.getElementById(layerName);
	reference.style.visibility="hidden";
}

function show(layerName){
	var reference = document.getElementById(layerName);
	reference.style.visibility="visible";
}

function hide(layerName){
	var reference = document.getElementById(layerName);
	reference.style.visibility="hidden";
}







/*function hideAndShowCopyDiv(layerName){
	var reference = document.getElementById(layerName);
	if(previousCopyDiv!= null){hide(previousCopyDiv)} previousCopyDiv=layerName;
	reference.style.visibility="visible";
}*/


function hideAndShowArrowDiv(layerName){
	var reference = document.getElementById(layerName);
	if(previousArrowDiv!= null){hide(previousArrowDiv)} previousArrowDiv=layerName;
	reference.style.visibility="visible";
}

function hideImgDiv(layerName){
	var reference = document.getElementById(layerName);
	reference.style.visibility="hidden";
}

function showSubMenu(layerName){
	var reference = document.getElementById(layerName);
	if(previous!= null){hide(previous)} previous=layerName;
	reference.style.visibility="visible";
}

// THIS ONE WORKING FOR INCREMENTATION....
/*function showThumb(layerName){

	if(divNumber >= _numDivs){
	divNumber = 0}

	var reference = document.getElementById(layerName);
	if(previousThumb!= null){
	hide(previousThumb)}
	previousThumb=layerName;
	reference.style.visibility="visible";	
}*/


/*function showThumb(layerName){

	if (f1 >= foodDivArray.length) {
	      	f1 = 0;
	    	}

	var reference = document.getElementById(layerName);
	if(previousThumb!= null){
	hide(previousThumb)}
	previousThumb=layerName;
	reference.style.visibility="visible";
}*/

/*function showThumb(layerName){

	if (f1 <= 0) {
	      	f1 = foodDivArray.length -1;
	    	}

	var reference = document.getElementById(layerName);
	if(previousThumb!= null){
	hide(previousThumb)}
	previousThumb=layerName;
	reference.style.visibility="visible";
}*/




function hideAndShowCopyDiv(layerName){
		if (_copyDivCounter >= copyDivArray.length+1) {
	      _copyDivCounter = 1;
	      layerName = 'copyDiv'+_copyDivCounter;
	    }
	    if (_copyDivCounter < 1){
		_copyDivCounter= copyDivArray.length;
		layerName = 'copyDiv'+_copyDivCounter;
		}
	var reference = document.getElementById(layerName);
	if(previousCopyDiv!= null){hide(previousCopyDiv)} previousCopyDiv=layerName;
	reference.style.visibility="visible";
}






function hideSubMenu(layerName){
	var fn = "hide('"+layerName+"')";
	timerID = setTimeout(fn, subTimer);
}


function hideAndShowThumbCopy(layerName){
	var reference = document.getElementById(layerName);
	if(previousStudioThumbCopy!= null){hide(previousStudioThumbCopy)} previousStudioThumbCopy=layerName;
	reference.style.visibility="visible";
}

function swapStudioDivImage(imageName, newImage, layerName) {
	if (document.images) {
	    var d = document[imageName];
	    if (layerName && document.layers) {
	       d = document.layers[layerName].document[imageName];
	    }
	    d.src = eval(newImage + ".src");
	}
}

function swapContactDivImage(imageName, newImage, layerName) {
	if (document.images) {
	    var d = document[imageName];
	    if (layerName && document.layers) {
	       d = document.layers[layerName].document[imageName];
	    }
	    d.src = eval(newImage + ".src");
	}
}


function openQTVRWindow(url) {
     	window.open(url, "QTVRPopup","left=200,top=200,width=430,height=500,resizable=no,scrollbars=no,status=no,menubar=no,toolbar=no,alwaysRaised=yes");
}



























