<!-- Begin
/*----------------------------------------------------------------------------------------
|
|	Menu Script by Josh Miller
|	written for the the Elmira Animal Shelter
|	and the City of Elmira @ http://www.cityofelmira.net
|
-------------------------------------------------------------------------------------------*/ 

links=new Array();
title=new Array();
check=new Array();
x=0;

title[x]="Shelter Home"
links[x]="index.html"
check[x]="shelter"
x++;

title[x]="Pets for Adoption"
links[x]="adoption.html"
check[x]="adoption"
x++;

//title[x]="Ask the Vet"
//links[x]="ask_the_vet_index.html"
//check[x]="vet:index"
//x++;

//title[x]="Purr-fect Sense"
//links[x]="purrfect_sense_index.html"
//check[x]="sense:index"
//x++;

title[x]="Common Questions"
links[x]="questions.html"
check[x]="questions"
x++;

title[x]="Pet Resources"
links[x]="resources.html"
check[x]="resources"
x++;

title[x]="Animal Control"
links[x]="animal_control.html"
check[x]="control"
x++;

title[x]="No-Kill Movement"
links[x]="no_kill.html"
check[x]="movement"
x++;

title[x]="Friends of the Shelter"
links[x]="friends.html"
check[x]="group"
x++;

//title[x]="Upcoming Events"
//links[x]="events.html"
//check[x]="events"
//x++;

title[x]="Help & Volunteer"
links[x]="volunteer.html"
check[x]="volunteer"
x++;

title[x]="Happy Endings"
links[x]="happy_endings.html"
check[x]="endings"
x++;

title[x]="Shelter Press Room"
links[x]="pressroom.html"
check[x]="room"
x++;

title[x]="Links"
links[x]="links.html"
check[x]="links"
x++;

title[x]="Directions"
links[x]="directions.html"
check[x]="directions"
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("<table border='0' cellpadding='0' cellspacing='4' width='154'>														");
	document.write("<tr><td><img src='pics/dot.gif' width='5' height='15' border='0'></td></tr>								");
	if (page!=check[0]){
			document.write("<tr><td align='left'><a href='../shelter/"+links[0]+"' class='leftmenu'>"+title[0]+"</a></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='../shelter/"+links[i]+"' class='leftmenu'>"+title[i]+"</a></td></tr>						");
		}   
	}
	document.write("<tr><td align='left'><br><a href='../index/index.html' class='leftmenu'>City Homepage</a></td></tr>");
	document.write("<tr><td align='left'>")
	document.write("<script type=\"text/javascript\">var addthis_pub=\"cityofelmira\";</script>")
	document.write("<a href=\"http://www.addthis.com/bookmark.php?v=20\" onmouseover=\"return addthis_open(this, '', '[URL]', '[TITLE]')\" onmouseout=\"addthis_close()\" onclick=\"return addthis_sendto()\" class='leftmenu'>Bookmark & Share &nbsp;<img src='../index/pics/share.gif' border='0' height='12' width='12' alt=\"Bookmark and Share\" style=\"border:0\"/>&nbsp;</a><script type=\"text/javascript\" src=\"http://s7.addthis.com/js/200/addthis_widget.js\"></script>")
	document.write("</td></tr>")

	document.write("</table>");
}

function rightfeatures(){
	feature=[Math.ceil(Math.random()*(pet.length-1))]
	document.write("	<span class='rightheader'>842 Linden Place<br>Elmira NY 14901<br>(607) 737-5767</span><br>	");
	document.write("	<img src='pics/dot.gif' width='5' height='5' border='0' alt=''><br>	");
	document.write("	<table border='0' cellpadding='0' cellspacing='0' width='150'>	");
	document.write("	<tr><td class='rightbar'>&nbsp;Featured Pet</td></tr>	");
	document.write("	<tr><td align='left'><a href='adoption.html?"+feature+"' border='0'><img src='pets/"+pet[feature][pic]+".jpg' width='150' height='150' border='0' alt='Click here for information about adopting me.'><br>	");
	document.write("	<table border='0' cellpadding='0' cellspacing='0' width='150'><tr>	");
	if(pet[feature][name]!=""){
		document.write("	<td><span class='footer'>Name:</span></td><td><span class='footer'>"+pet[feature][name]+"</span></td></tr><tr>	");
	}
	document.write("	<td><span class='righttext'>Case#:</span></td><td><span class='righttext'>"+pet[feature][Case]+"</span></td></tr><tr>	");
	document.write("	<td><span class='righttext'>Sex:</span></td><td><span class='righttext'>"+pet[feature][gender]+"</span></td></tr><tr>	");
	document.write("	<td><span class='righttext'>Born:</span></td><td><span class='righttext'>"+pet[feature][age]+" old</span></td></tr><tr>	");
	document.write("	<td><img src='pics/dot.gif' width='5' height='5' border='0' alt=''></td></tr></table></td></tr>	");

	document.write("	<tr><td class='rightbar'>&nbsp;Shelter Hours</td></tr>	");
	document.write("	<tr><td><span class='righttext'>");
	document.write("	Monday.......Closed<br>	");
	document.write("	Tuesday......10:00am-4:00pm<br>	");
	document.write("	Wednesday..10:00am-4:00pm<br>	");
	document.write("	Thursday.....10:00am-4:00pm<br>	");
	document.write("	Friday.........10:00am-4:00pm<br>	");
	document.write("	Saturday.....10:00am-4:00pm<br>	");
	document.write("	Sunday.......Closed<br>	");
	document.write("	</span></td></tr>	");


	document.write("	<tr><td class='rightbar'>&nbsp;Animal Resources</td></tr>	");
	document.write("	<tr><td><span class='righttext'>");
	document.write("	Police: 911 (Emergency Only)</span><br>	");
	document.write("	<span class='righttext'>Animal Control Sergeant:</span><br><span class='righthilite'>&nbsp;&nbsp;(607) 737-5807</span><br>	");
	document.write("	<span class='righttext'>Animal Control Dispatch:</span><br><span class='righthilite'>&nbsp;&nbsp;(607) 735-8600</span><br>	");
	document.write("	<span class='righttext'>Wildlife Agents:</span><br><span class='righthilite'>&nbsp;&nbsp;(607) 739-5388</span><br>	");
	document.write("	<span class='righttext'>Animal Shelter:</span><br><span class='righthilite'>&nbsp;&nbsp;(607) 737-5767</span><br>	");
	document.write("	<span class='righttext'>City Clerk (Licensing):</span><br><span class='righthilite'>&nbsp;&nbsp;(607) 737-5672</span><br>	");
	document.write("	<span class='righttext'>Public Services:</span><br><span class='righthilite'>&nbsp;&nbsp;(607) 737-5750</span><br>	");
	document.write("	</span></td></tr>	");
	document.write("	<tr><td class='rightbar'>&nbsp;Adoption Fees</td></tr>	");
	document.write("	<tr><td><span class='footer'>Cat . . . . . . . . . . . . . $15.00<br></span></td></tr>	");
	document.write("	<tr><td><span class='footer'>Cat n/s. . . . . . . . . . . $10.00</span></td></tr>	");
	document.write("	<tr><td><span class='footer'>Dog . . . . . . . . . . . . . $25.00</span></td></tr>	");
	document.write("	<tr><td><span class='footer'>Dog n/s. . . . . . . . . . . $20.00</span></td></tr>	");
	document.write("	<tr><td><br><span class='footer'>*Adoption fees do not include vaccination and license fees when applicable.</span></td></tr>	");
	document.write("	<tr><td class='rightbar'>&nbsp;Weather</td></tr>	");
	document.write("	<tr><td><a href='http://english.wunderground.com/US/NY/Elmira.html'>	");
	document.write("	<img src='http://banners.wunderground.com/banner/infoboxtr_both/language/english/US/NY/Elmira.gif' alt='Click for Elmira, New York Forecast' height='108' width='144' border='0'></a></td></tr>	");
	document.write("	</table>");
}

function bottomnav(){
	document.write("<script type=\"text/javascript\">var addthis_pub=\"cityofelmira\";</script>")
	document.write("<a href=\"http://www.addthis.com/bookmark.php?v=20\" onmouseover=\"return addthis_open(this, '', '[URL]', '[TITLE]')\" onmouseout=\"addthis_close()\" onclick=\"return addthis_sendto()\"><img src=\"http://s7.addthis.com/static/btn/lg-share-en.gif\" width=\"125\" height=\"16\" alt=\"Bookmark and Share\" style=\"border:0\"/></a><script type=\"text/javascript\" src=\"http://s7.addthis.com/js/200/addthis_widget.js\"></script>")
	document.write("<br>");
	document.write("<br>");

		document.write("        <span class='footer'> |       ");
		for(i=1;i<links.length;i++){
			document.write("        <a href='../shelter/"+links[i]+"' class='footer'>"+title[i]+"</a> |        ");
			if ( i==5 || i==101){
			document.write("<br> |");
			}
		}
		document.write("        <br></span>        ");
        document.write("        <span class='copyright'><br>City of Elmira | Copyright &copy; 2009 | All Rights Reserved<br></span>	");
}


function printPet(friend){
	document.write("			<span class='subtitle'>Take me home!</span><br>");
	document.write("			<table border='0' cellpadding='0' cellspacing='0' width='424'>");
	document.write("			<tr><td width='206' valign='top'><img src='pets/"+pet[friend][pic]+".jpg' width='200' height='200' border='0'></td>");
	document.write("				<td width='218' valign='top'><span class='subtitle'>"+pet[friend][name]+"</span><br>");
	document.write("					Case# "+pet[friend][Case]+"<br><br>"+pet[friend][breed]+" / "+pet[friend][gender]+" / Born: "+pet[friend][age]+" / Size: "+pet[friend][size]+"<br><br>");
	document.write(					pet[friend][note]+"<br>");
	document.write("				<br></td></tr>");
	document.write("			<tr><td valign='top' colspan='2'>");
	document.write("			<table border='0' cellpadding='0' cellspacing='2' width='424'>");
	document.write("			<tr><td colspan='3' bgcolor='#000099'><img src='pics/dot.gif' width='5' height='2' border='0' alt=''></td></tr>");
	if(friend==1){
		document.write("			<tr><td width='100' valign='top'><a href='adoption.html?"+(pet.length-1) +"'>Previous Pet</a></td>");
	}
	else{
		document.write("			<tr><td width='100' valign='top'><a href='adoption.html?"+(parseInt(friend)-1)+"'>Previous Pet</a></td>");
	}
	document.write("			<td width='216' align='center' valign='top'><a href='petquestion.html?"+pet[friend][Case]+"'>Ask a question about this pet</a></td>");
	if(friend==pet.length-1){
		document.write("			<td width='100' align='right' valign='top'><a href='adoption.html?1'>Next Pet</a></td>");
	}
	else{
		document.write("			<td width='100' align='right' valign='top'><a href='adoption.html?"+(parseInt(friend)+1)+"'>Next Pet</a></td>");
	}
	document.write("			<tr><td colspan='3' bgcolor='#000099'><img src='pics/dot.gif' width='5' height='2' border='0' alt=''></td></tr>");
	document.write("			</table></td></tr></table>");
	document.write("			<br>I'm available for adoption as of "+last_update+".  If you are interested in adopting me, please contact the Animal Shelter by phone, email, or <a href='directions.html'>stop into the shelter</a>.<br>");
	document.write("			<br>When inquiring about me, please refer to my case number.<br><br><a href='adoption.html'>Return to the Pet Index</a><br><br>");
}

function printPetIndex(){
	catStore= new Array();
	dogStore= new Array();
	otherStore= new Array();
	catCounter=0;
	dogCounter=0;
	otherCounter=0;
	for (i=1; i<pet.length; i++){
		temp=pet[i][type]
		if (temp=="cat"){
			catStore[catCounter]=i;
			catCounter++;
		}	
		else if (temp=="dog"){
			dogStore[dogCounter]=i;
			dogCounter++;
		}
		else{
			otherStore[otherCounter]=i;
			otherCounter++;
		}
	}
	document.write("As of "+last_update+" the following pets are available for adoption.  Click a pet for more information and to ask a question about the pet.<br><br>");
	document.write("For answers to common questions about owning pets, <a href='questions.html'>click here</a>.<br><br>");
	document.write("All new adoptions include a coupon for a free initial vet exam from one of our <a href='resources.html'>partner vets</a>.<br><br>");
	document.write("	<table border='0' cellpadding='0' cellspacing='0' width='424'>");
	document.write("	<tr><td colspan='4'><span class='subtitle'>&nbsp;Cats for Adoption</span></td></tr>");
	if(catStore.length==0){
		document.write("<tr><td align='center' colspan='4'>There are no cats available online now.</td></tr>");
	}
	else{
		for (i=0; i<catStore.length; i++){
			if (i%4==0){
				document.write("<tr><td width='106' align='center'><a href='adoption.html?"+catStore[i]+"'><img src='pets/"+pet[catStore[i]][pic]+".jpg' width='75' height='75' border='0' alt='Click here for more information about me!'></a></td>");
			}
			else if (i%4==3){
				document.write("<td width='106' align='center'><a href='adoption.html?"+catStore[i]+"'><img src='pets/"+pet[catStore[i]][pic]+".jpg' width='75' height='75' border='0' alt='Click here for more information about me!'></a></td></tr>");
				document.write("<tr><td colspan='4'><img src='pics/dot.gif' width='5' height='10' border='0' alt=''></td></tr>");
			}
			else{
				document.write("<td width='106' align='center'><a href='adoption.html?"+catStore[i]+"'><img src='pets/"+pet[catStore[i]][pic]+".jpg' width='75' height='75' border='0' alt='Click here for more information about me!'></a></td>");
			}
		}
		if(catStore.length%3!=0){
			document.write("</tr><tr><td colspan='4'><img src='pics/dot.gif' width='5' height='10' border='0' alt=''></td></tr>");
		}
	}
	document.write("<tr><td colspan='4'><img src='pics/dot.gif' width='5' height='10' border='0' alt=''></td></tr>");
	document.write("	<tr><td colspan='4'><span class='subtitle'>&nbsp;Dogs for Adoption</span></td></tr>");
	if(dogStore.length==0){
		document.write("<tr><td align='center' colspan='4'>There are no dogs available online now.</td></tr>");
	}
	else{
		for (i=0; i<dogStore.length; i++){
			if (i%4==0){
				document.write("<tr><td width='106' align='center'><a href='adoption.html?"+dogStore[i]+"'><img src='pets/"+pet[dogStore[i]][pic]+".jpg' width='75' height='75' border='0' alt='Click here for more information about me!'></a></td>");
			}
			else if (i%4==3){
				document.write("<td width='106' align='center'><a href='adoption.html?"+dogStore[i]+"'><img src='pets/"+pet[dogStore[i]][pic]+".jpg' width='75' height='75' border='0' alt='Click here for more information about me!'></a></td></tr>");
				document.write("<tr><td colspan='4'><img src='pics/dot.gif' width='5' height='10' border='0' alt=''></td></tr>");
			}
			else{
				document.write("<td width='106' align='center'><a href='adoption.html?"+dogStore[i]+"'><img src='pets/"+pet[dogStore[i]][pic]+".jpg' width='75' height='75' border='0' alt='Click here for more information about me!'></a></td>");
			}
		}
		if(dogStore.length%3!=0){
			document.write("</tr><tr><td colspan='4'><img src='pics/dot.gif' width='5' height='10' border='0' alt=''></td></tr>");
		}
	}
	document.write("<tr><td colspan='4'><img src='pics/dot.gif' width='5' height='10' border='0' alt=''></td></tr>");
	document.write("	<tr><td colspan='4'><span class='subtitle'>&nbsp;Other Animals for Adoption</span></td></tr>");
	if(otherStore.length==0){
		document.write("<tr><td align='center' colspan='4'>There are no other animals available online now.</td></tr>");
	}
	else{
		for (i=0; i<otherStore.length; i++){
			if (i%4==0){
				document.write("<tr><td width='106' align='center'><a href='adoption.html?"+otherStore[i]+"'><img src='pets/"+pet[otherStore[i]][pic]+".jpg' width='75' height='75' border='0' alt='Click here for more information about me!'></a></td>");
			}
			else if (i%4==3){
				document.write("<td width='106' align='center'><a href='adoption.html?"+otherStore[i]+"'><img src='pets/"+pet[otherStore[i]][pic]+".jpg' width='75' height='75' border='0' alt='Click here for more information about me!'></a></td></tr>");
				document.write("<tr><td colspan='4'><img src='pics/dot.gif' width='5' height='10' border='0' alt=''></td></tr>");
			}
			else{
				document.write("<td width='106' align='center'><a href='adoption.html?"+otherStore[i]+"'><img src='pets/"+pet[otherStore[i]][pic]+".jpg' width='75' height='75' border='0' alt='Click here for more information about me!'></a></td>");
			}
		}
		if(otherStore.length%3!=0){
			document.write("</tr><tr><td colspan='4'><img src='pics/dot.gif' width='5' height='10' border='0' alt=''></td></tr>");
		}
	}
	document.write("</table>");
}

function caseInquiry(){
	var a=document.location.toString();		
	x=a.length;							
	y=a.lastIndexOf("html");				
	y=y+5;	
	var inquiry=a.substring(y,x);
	document.write("Case# "+inquiry);
}

function addSubject(){
	var a=document.location.toString();		
	x=a.length;							
	y=a.lastIndexOf("html");				
	y=y+5;	
	var inquiry=a.substring(y,x);
	document.write("<input type='hidden' name='subject' value='Question about Case# "+inquiry+"'>");
}

function happyEndings(){
	var a=document.location.toString();		
	x=a.length;							
	y=a.lastIndexOf("html");				
	y=y+5;	
	var ending=a.substring(y,x);
	if (ending==""){
		ending=[Math.round(Math.random()*txt.length)]
	}

	document.write("	<table border='0' cellpadding='0' cellspacing='2' width='424'>		");
	document.write("	<tr><td width='5'></td><td width='406'>								");
	document.write("	<table border='0' cellpadding='0' cellspacing='0' width='406'>		");
	if (ending==0){
		document.write("	<tr><td width='203' align='center'><a href='happy_endings.html?"+(src.length-1) +"'>Previous</a></td>");
	}
	else{
		document.write("	<tr><td width='203' align='center'><a href='happy_endings.html?"+(parseInt(ending)-1) +"'>Previous</a></td>");	
	}
	if (ending==src.length-1){
		document.write("	<td width='203' align='center'><a href='happy_endings.html?0'>Next</a></td></tr></table></td>");
	}
	else{
		document.write("	<td width='203' align='center'><a href='happy_endings.html?"+(parseInt(ending)+1) +"'>Next</a></td></tr></table></td>");	
	}
	document.write("	<td width='5'></td></tr><tr>");
	document.write("	<td width='5'><img src='pics/dot.gif' width='5' height='400' border='0'></td>");
	document.write("	<td width='406' valign='middle' align='center'><img src='endings/"+src[ending]+"' border='0'><br>");
	document.write("	<table border='0' cellpadding='0' cellspacing='0' width='350'><tr>");
	document.write("	<td>"+txt[ending]+"</td>");
	document.write("	</tr></table></td>");
	document.write("	<td width='5'><img src='pics/dot.gif' width='5' height='400' border='0'></td></tr></table>");
}

//-->