var time=5000;

var imgNum=0;

var totImg=55;/*TO ADD A NEW COURTHOUSE ADD ONE TO THIS NUMBER*/

imgarray= new Array('athabasca2.jpg', 'Barrhead.jpg', 'battleford.jpg', 'Bonnyville.jpg', 'boyle2.jpg', 'calgary.jpg', 'Camrose2.jpg.bmp', 'Canmore-s.jpg', 'cardston.jpg', 'cardston-old.jpg', 'Creighton.jpg', 'Cutknife.jpg', 'desmarais.jpg', 'Didsbury.jpg', 'edmonton.jpg', 'edson.jpg', 'Evansburg.jpg', 'fairview.jpg', 'FlinFlon.jpg', 'FortMcMurray.jpg', 'Fort Resolution.JPG', 'Fort Saskatchewan.jpg', 'FortSmith.jpg', 'FoxCreek.jpg', 'grandcache.jpg', 'GrandePrairie.jpg', 'Hanna.jpg', 'HayRiver.jpg', 'HighLevel.jpg', 'hinton.jpg', 'killam.jpg', 'laclabiche.jpg', 'leduc.jpg', 'Lethbridge.jpg', 'Lloydminster.jpg', 'Morinville.jpg', 'NorthBattleford.jpg', 'SCC.jpg', 'peace.jpg', 'red-deer.jpg', 'red-earth-creek.jpg', 'Regina.jpg', 'Rimbey.jpg', 'Sherwood Park.jpg', 'Stettler.jpg', 'StAlbert.jpg', 'St-Paul.jpg', 'St. Walburg.jpg', 'Strathmore.jpg', 'Swan-hills.jpg', 'Vegreville.jpg', 'Vermilion.jpg', 'wabasca.jpg', 'Wainwright.jpg', 'Wetaskiwin.jpg', 'Yellowknife.jpg');/*TO ADD A NEW COURTHOUSE ADD THE NAME OF THE IMAGE AT THE END OF THIS LIST AND SAVE IT IN THE courthouse directory*/

textarray=new Array('Athabasca', 'Barrhead', 'Battleford', 'Bonnyville', 'Boyle', 'Calgary', 'Camrose', 'Canmore', 'Cardston', 'Cardston', 'Creighton', 'Cut Knife', 'Desmarais', 'Didsbury', 'Edmonton', 'Edson', 'Evansburg', 'Fairview', 'Flin Flon', 'Fort McMurray', 'Fort Resolution', 'Fort Saskatchewan', 'Fort Smith', 'Fox Creek', 'Grande Cache', 'Grande Prairie', 'Hanna', 'Hay River', 'High Level', 'Hinton', 'Killam', 'Lac La Biche', 'Leduc', 'Lethbridge', 'Lloydminster', 'Morinville', 'North Battleford', 'Ottawa - Supreme Court of Canada', 'Peace River', 'Red Deer', 'Red Earth Creek', 'Regina', 'Rimbey', 'Sherwood Park', 'Stettler', 'St. Albert', 'St. Paul', 'St. Walburg', 'Strathmore', 'Swan Hills', 'Vegreville', 'Vermilion', 'Wabasca', 'Wainwright', 'Wetaskiwin','Yellowknife');/*ADD THE NAME OF THE COURTHOUSE TO THIS LIST*/

addressarray=new Array('4903 - 50 St', '6203 - 49 St', '291-23rd Street West (Sask)', '4902 - 50 Ave', '5006 - 3 St', '323 - 6 Ave' , '5210 - 49 Ave', '#101, 800 Railway Ave.', '576 Main St', 'Prov. Bldg. (Sask)', 'Old Courthouse', '204 Otter St (Sask.)', 'Stony Point Road', '1611 - 15 Ave', '1A Sir Winston Churchill Square', '111 - 54 St', '4921 - 50 St.', '10209 - 109 St', '104 – 143 Main Street (Man)', '9700 Franklin Ave', 'Fort Resolution, (NWT)', '10504 - 100 Ave', '25 ? Street (NWT)', '100 - 4th Ave', 'Hoppe Ave', '10260 - 99 St', '401 Centre St', '#201 - 8 Capital Drive (NWT)', '10106 - 100 Ave', '237 Jasper St, West & Pembina Ave', '4903 - 50 St', '9503 Beaver Hill Road', '4612 - 50 St', '320 - 4 St', '5124-50 St', '10008 - 107 St', '# 3 Railway Ave East (Sask)', '301 Wellington St. (Ont)', '9905 - 97 Ave', '4909 - 48 Ave', 'adjacent to Alberta Forestry Complex', '1815 Smith Street (Sask.)', '5025 - 55 St', '190 Chippewa Rd.', '4705 - 49 Ave', '3 St. Anne St','4704 - 50 St', 'Main St. (Sask)', '226 - 2 Ave', '4809 50 St', '4701 - 52 St', '5536 Main St', 'Stony Point Road', '738 2 Ave', '4605 - 51 St', '4903 - 49th St. (NWT)' );/* add address to list*/

var timeout;

var content;

/*function loadGallerychanger(path){
	
	content = document.getElementById( "galcontents" );
	
	content.innerHTML="<img src='"+path+"images/courthouses/"+imgarray[imgNum]+"' width='184px' alt='' /><p>Courthouse in "+textarray[imgNum]+"<br />"+addressarray[imgNum]+"</p>";
	
	imgNum++;
	
	timeout=setTimeout("nextImg('"+path+"');", time);
	
	//try to dynamically load select box
	for (i = 0; i < totImg; i++){
		this.document.forms.form1.courthouse.options[i] = new Option(textarray[i], i);
	}
}*/

function loadGallerychanger(language){
	
	content = document.getElementById( "galcontents" );
	
	if (language == "english") {
		path = "";
		courthousetext = "Courthouse in ";
	}else{
		path = "../";
		courthousetext = "Cour à ";
	}
	
	content.innerHTML="<img src='"+path+"images/courthouses/"+imgarray[imgNum]+"' width='184px' alt='' /><p>"+courthousetext+textarray[imgNum]+"<br />"+addressarray[imgNum]+"</p>";
	
	imgNum++;
	
	timeout=setTimeout("nextImg('"+language+"');", time);
	
	//try to dynamically load select box
	for (i = 0; i < totImg; i++){
		this.document.forms.form1.courthouse.options[i] = new Option(textarray[i], i);
	}
}


function nextImg(language){
	
	if (language == "english") {
		path = "";
		courthousetext = "Courthouse in ";
	}else{
		path = "../";
		courthousetext = "Cour à ";
	}
	
	clearTimeout(timeout);
	
	content.innerHTML="<img src='"+path+"images/courthouses/"+imgarray[imgNum]+"' width='184px' alt='' /><p>"+courthousetext+textarray[imgNum]+"<br />"+addressarray[imgNum]+"</p>";
	
	//change dropdownlist selection when changing image name
	this.document.forms.form1.courthouse.options.selectedIndex = imgNum;
	
	if ((imgNum+1)< totImg)
		imgNum++;
	else
		imgNum=0;
		
	timeout=setTimeout("nextImg('"+language+"');", time);
}

//choose which courthouse to view from dropdownlist
function chooseImg(courthouse, language){
	
	Img = courthouse.options[courthouse.selectedIndex].value;
	
	if (language == "english") {
		path = "";
		courthousetext = "Courthouse in ";
	}else{
		path = "../";
		courthousetext = "Cour à ";
	}
	
	if (Img != ""){
		
		imgNum = Img;
		
		content.innerHTML="<img src='"+path+"images/courthouses/"+imgarray[imgNum]+"' width='184px' alt='' /><p>"+courthousetext+textarray[imgNum]+"<br />"+addressarray[imgNum]+"</p>";
	
	}
}

/*function loadGallerychangerF(){

    content = document.getElementById( "galcontents" );

            content.innerHTML="<img src='../courthouses/"+imgarray[imgNum]+"' width='250px' alt='' /><p>Courthouse in "+textarray[imgNum]+"</p>";

            imgNum++;

            timeout=setTimeout("nextImgF();", time);

}

function nextImgF(){

            clearTimeout(timeout);

            content.innerHTML="<img src='../courthouses/"+imgarray[imgNum]+"' width='250px' alt='' /><p>Courthouse in "+textarray[imgNum]+"</p>";

            if ((imgNum+1)< totImg)

                        imgNum++;

            else

                        imgNum=0;

            timeout=setTimeout("nextImg();", time);

            }*/


