<!-- Begin
/*----------------------------------------------------------------------------------------
|
|        Menu Script by Josh Miller
|        written for City of Elmira Website
|        @ http://www.cityofelmira.net
|
-------------------------------------------------------------------------------------------*/ 

links=new Array();
title=new Array();
check=new Array();
x=0;

title[x]="Back to City Homepage"
links[x]="../index/index.html"
check[x]="elmira"
x++;

title[x]="Fire Department Home"
links[x]="index.html"
check[x]="department"
x++;

title[x]="Administration"
links[x]="administration.html"
check[x]="administration"
x++;

title[x]="Apparatus"
links[x]="apparatus.html"
check[x]="apparatus"
x++;

title[x]="EFD Press Room"
links[x]="pressroom.html"
check[x]="room"
x++;

title[x]="Emergency Services"
links[x]="ems.html"
check[x]="services"
x++;

title[x]="Employment"
links[x]="employment.html"
check[x]="heroes"
x++;

title[x]="Fire Statistics"
links[x]="statistics.html"
check[x]="statistics"
x++;

title[x]="Hazardous Materials"
links[x]="haz_mat.html"
check[x]="materials"
x++;

//title[x]="History of EFD"
//links[x]="history.html"
//check[x]="history"
//x++;

title[x]="Incident Gallery"
links[x]="incidents.html"
check[x]="gallery"
x++;


title[x]="Inspection Services"
links[x]="inspection_services.html"
check[x]="division"
x++;

title[x]="&nbsp;-Code Enforcement"
links[x]="code_enforcement.html"
check[x]="enforcement"
x++;

title[x]="&nbsp;-Permits"
links[x]="permits.html"
check[x]="permits"
x++;

title[x]="&nbsp;-Property Maintenance"
links[x]="properties.html"
check[x]="maintenance"
x++;

title[x]="&nbsp;-Inspections"
links[x]="inspections.html"
check[x]="inspections"
x++;

title[x]="&nbsp;-Code Violations"
links[x]="violations.html"
check[x]="violations"
x++;

title[x]="&nbsp;-File a Complaint"
links[x]="complaint.html"
check[x]="complaint"
x++;

title[x]="Prevention Tips"
links[x]="prevention_adults.html"
check[x]="adults"
x++;

title[x]="Prevention Tips for Kids"
links[x]="prevention_kids.html"
check[x]="kids"
x++;

title[x]="Training"
links[x]="training.html"
check[x]="training"
x++;

title[x]="Training Gallery"
links[x]="training_gallery.html"
check[x]="exercises"
x++;

//Get the title to determine what page the user is viewing
x=document.title;                                                       	//get the title and store as a string in x
x=x.toLowerCase();                                                        	//make the whole title lower case
y=x.lastIndexOf(' ');                                                		//find the last space in the title and store in y
y=y+1;                                                                      //add 1 to y to find the letter after the last space
z=x.length;                                                                 //get the length of the whole string and store in z
page=x.substring(y,z);                                                		//store in page the last word of the html page's title

function mainnav(){
	document.write("<img src='../fire/pics/index_left_top.jpg'>");
	document.write("<table border='0' cellpadding='0' cellspacing='4' width='154'>");
	document.write("<tr><td><img src='pics/dot.gif' width='5' height='16' border='0'></td></tr>");
    for (i=1; i<title.length; i++){
		if(page==check[i]){
			document.write("<tr><td align='left'><span class='navhilite'>"+title[i]+"</span></td></tr>");
        }
        else{
			document.write("<tr><td align='left'><a href='../fire/"+links[i]+"' class='leftmenu'>"+title[i]+"</a></td></tr>");
		}   
	}
		document.write("<tr><td align='left'><br><a href='"+links[0]+"' class='leftmenu'>"+title[0]+"</a></td></tr>");
	document.write("</table>");
}



function rightFireDirectory(){
		document.write("        <table border='0' cellpadding='0' cellspacing='0' width='150'>        						");
       		document.write("<tr><td class='rightbar'>&nbsp;Fire Dept. Directory</td></tr>");
		document.write("<tr><td class='emergency'>EMERGENCY -Dial 911</td></tr>");
		document.write("<td class='righttext'>•&nbsp;A building is on fire</td></tr>");
		document.write("<td class='righttext'>•&nbsp;You smell gas in a structure</td></tr>");
		document.write("<td class='righttext'>•&nbsp;Accident with injuries</td></tr>");
		document.write("<td class='righttext'>•&nbsp;A life is in danger</td></tr>");

		document.write("<td class='righttext'><a href='../fire/ems.html'><b>Communications Center</b></a></td></tr>");
		document.write("<td class='righttext'><b>(607) 735-8600</b></td></tr>");
		document.write("<td class='righttext'>•&nbsp;You need FD assistance</td></tr>");
		document.write("<td class='righttext'>•&nbsp;File a complaint</td></tr>");

		document.write("<td class='righttext'><a href='../fire/permits.html'><b>Permit Clerk</b></a></td></tr>");
		document.write("<td class='righttext'><b>(607) 737-5653</b></td></tr>");
		document.write("<td class='righttext'>•&nbsp;Question about permits</td></tr>");
		document.write("<td class='righttext'>•&nbsp;Zoning information</td></tr>");

		document.write("<td class='righttext'><a href='../fire/inspection_services.html'><b>Inspection Services</b></a></td></tr>");
		document.write("<td class='righttext'><b>(607) 737-5654</b></td></tr>");
		document.write("<td class='righttext'>•&nbsp;Schedule an inspection</td></tr>");
		document.write("<td class='righttext'>•&nbsp;Report a code violation</td></tr>");
		document.write("<td class='righttext'>•&nbsp;Inquire about codes</td></tr>");
		document.write("<td class='righttext'>•&nbsp;Meet with an inspector</td></tr>");

		document.write("<td class='righttext'><a href='../fire/administration.html'><b>Administration</b></a></td></tr>");
		document.write("<td class='righttext'><b>(607) 737-5700</b></td></tr>");
		document.write("<td class='righttext'>•&nbsp;Fire Chief's Office</td></tr>");
		document.write("<td class='righttext'>•&nbsp;Policies and Procedures</td></tr>");
		document.write("<td class='righttext'>•&nbsp;Purchasing</td></tr>");

		document.write("<td class='righttext'><a href='../fire/training.html'><b>Training/Safety Office</b></a></td></tr>");
		document.write("<td class='righttext'><b>(607) 737-5708</b></td></tr>");
		document.write("<td class='righttext'>•&nbsp;Firefighter Training</td></tr>");
		document.write("<td class='righttext'>•&nbsp;Fire Station Tours</td></tr>");
		document.write("<td class='righttext'>•&nbsp;Classroom Visits</td></tr>");

		document.write("        <tr><td class='rightbar' >&nbsp;Citizen's Guides</td></tr>");
		document.write("        <tr><td class='righttext'>•&nbsp;<a href='javascript:download(192)'>Swimming Pool Installation</a></td></tr>");
		document.write("        <tr><td class='righttext'>•&nbsp;<a href='javascript:download(193)'>Property Maintenance</a></td></tr>");
		document.write("        <tr><td class='righttext'>•&nbsp;<a href='javascript:download(182)'>Fire Safety Checklist</a></td></tr>");
		document.write("        <tr><td class='righttext'>•&nbsp;<a href='javascript:download(181)'>Home Escape Plan</a></td></tr>");
		document.write("        <tr><td class='righttext'>•&nbsp;<a href='javascript:download(191)'>After the Fire</a></td></tr>");

		document.write("        <tr><td class='rightbar' >&nbsp;Annual Reports</td></tr>");
		document.write("        <tr><td class='righttext'>•&nbsp;<a href='javascript:download(212)'>2006 Annual Report</a></td></tr>");
		document.write("        <tr><td class='righttext'>•&nbsp;<a href='javascript:download(211)'>2005 Annual Report</a></td></tr>");
		document.write("        <tr><td class='righttext'>•&nbsp;<a href='javascript:download(210)'>2004 Annual Report</a></td></tr>");
		document.write("        <tr><td class='righttext'>•&nbsp;<a href='javascript:download(209)'>2003 Annual Report</a></td></tr>");
		document.write("        <tr><td class='righttext'>•&nbsp;<a href='javascript:download(208)'>2002 Annual Report</a></td></tr>");
		document.write("        <tr><td class='righttext'>•&nbsp;<a href='javascript:download(207)'>2001 Annual Report</a></td></tr>");


		document.write("<td class='rightbar' >&nbsp;Meet Elmira's Heroes</td></tr>");
		document.write("<td class='righttext'>•&nbsp;<a href='administration.html#chief'>Chief Pat Bermingham</a></td></tr>");
		document.write("<td class='righttext'>•&nbsp;<a href='administration.html#ashift'>DC Dan Sincock</a></td></tr>");
		document.write("<td class='righttext'>•&nbsp;<a href='administration.html#bshift'>DC David Jessick</a></td></tr>");
		//document.write("<td class='righttext'>•&nbsp;<a href='administration.html#cshift'>DC Pat Bermingham</a></td></tr>");
		document.write("<td class='righttext'>•&nbsp;<a href='administration.html#dshift'>DC James Kujawski</a></td></tr>");
		document.write("<td class='righttext'>•&nbsp;<a href='administration.html#training'>DC James Sincock</a></td></tr>");
		document.write("<td class='righttext'>•&nbsp;<a href='administration.html#marshal'>Fire Marshal Bill Wheeler</a></td></tr>");
		document.write("        </table>");
}


function firestats(){
		document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%'>");
		document.write("<tr><td bgcolor='#990000'><img src='pics/dot.gif' width='5' height='2' border='0'></td></tr>")
		document.write("<tr><td class='smalltext'>Statistics: | ")
		document.write("<a href='statistics.html'>2008</a> | ")
		document.write("<a href='statistics2007.html'>2007</a> | ")
		document.write("<a href='statistics2006.html'>2006</a> | ")
		document.write("<a href='statistics2005.html'>2005</a> | ")
		document.write("<a href='statistics2004.html'>2004</a> | ")
		document.write("<a href='statistics2003.html'>2003</a> | ")
		document.write("<a href='statistics2002.html'>2002</a> | ")
		document.write("<a href='statistics2001.html'>2001</a> | ")
		document.write("</td></tr></table>")
}



flag=0;

function rotateMainImage()
{
	stack= new Array(1,2,3,4,5,6,7)
	document.write("<img src='pics/main"+addZero(popIt())+".jpg' width='424' height='275' border='1' name='firemain'>");
	setTimeout("updatePhotos()",5000);
}

function updatePhotos(){
	stack= new Array(1,2,3,4,5,6,7)
	document.firemain.src="pics/main"+addZero(popIt())+".jpg"

	if (flag==0){
		setTimeout("updatePhotos()",5000);
	}
}


function rightWeather(){
		document.write("        <table border='0' cellpadding='0' cellspacing='0' width='150'>");
        document.write("<td class='rightbar'>Elmira Weather</td></tr>");
        document.write("<td><a href='http://english.wunderground.com/US/NY/Elmira.html'>");
        document.write("        <img src='http://banners.wunderground.com/banner/infoboxtr_both/language/www/US/NY/Elmira.gif' alt='Click for Elmira, New York Forecast' height='108' width='144' border='0'></a></td></tr>");
        document.write("        </table>");
}

function rightSafetyTips(){
}

function printChief(){
	document.write("		<a href='../fire/administration.html' class='rightheader'>Patrick Bermingham</a><br>");
	document.write("		<span class='rightheader'>Fire Department Chief</span>");
}

function validateFireQuiz(theForm){

jrname=theForm.jrname.value;
if (jrname == ""){
	alert("Oops!  Don't forget to put your name on your exam!");
	theForm.jrname.focus();
	return (false);
}

temp=getRadio("q1")
if (temp!="c"){
	alert("Oops!  Maybe you should check your answer to question 1.")
	return (false);
}
temp=getRadio("q2")
if (temp!="d"){
	alert("Oops!  Maybe you should check your answer to question 2.")
	return (false);
}
temp=getRadio("q3")
if (temp!="a"){
	alert("Oops!  Maybe you should check your answer to question 3.")
	return (false);
}
temp=getRadio("q4")
if (temp!="c"){
	alert("Oops!  Maybe you should check your answer to question 4.")
	return (false);
}
temp=getRadio("q5")
if (temp!="c"){
	alert("Oops!  Maybe you should check your answer to question 5.")
	return (false);
}
return true;
}


function getRadio(radioName){
    var radios = document.getElementsByName(radioName);
    for(var i = 0; i < radios.length; i++){
        if(radios[i].checked) return radios[i].value;
    }
    return null;
}

function smokeAlarmService(){
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%'>");
	document.write("<tr><td><span class='subtitle'>Subscribe for Smoke Alarm Reminders</span><br></td></tr>");
	document.write("<tr><td class='smalltext'><p class='justify'>If you would like to receive a monthly reminder to test the smoke alarms in your home, enter your email address below to subscribe to the Elmira Fire Department Smoke Alarm Reminder Service.  You will receive email at the beginning of each month reminding you to check your smoke alarms and an email message twice a year reminding you to change the batteries in your smoke alarms.</p><br></td></tr>");
	document.write("<tr><td><br>");
	document.write("<form name='subscribe' action='http://www.cityofelmira.net/fire/smokealarm.asp' method='get'>");
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='300'>");
	document.write("<tr><td><span class='featureheader'>Subscribe:</span></td>");
	document.write("<td><input type='text' name='subscribe' size='24'></td></tr>");
	document.write("<tr><td><span class='featureheader'>Unsubscribe:</span></td>");
	document.write("<td><input type='text' name='unsubscribe' size='24'></td></tr>");
	document.write("<tr><td colspan='2' align='center'><input type='submit' name='submit' value='Submit'></td></tr>");
	document.write("</table>");
	document.write("<br><span class='smalltext'>We will never share your email address for any reason.</span>");
	document.write("</form></td></tr></table>")
}



//------------------- Stack Functions------->

function stackShuffle(n) {
  var i, j, k;
  var temp;
  // Shuffle the stack 'n' times.
  for (i = 0; i < n; i++)
    for (j = 0; j < this.stack.length; j++) {
      k = Math.floor(Math.random() * this.stack.length);
      temp = this.stack[j];
      this.stack[j] = this.stack[k];
      this.stack[k] = temp;
    }
}

function stackPop() {
  if (this.stack.length > 0)
    return this.stack.shift();
  else
    return null;
}

function popIt(){
	stackShuffle(10)
	popped=stackPop()
	return popped
}

function addZero(x){
	if(x<10){return "0"+x}
	else{return x}
}//end addZero function





//-->
