<!-- Begin
/*----------------------------------------------------------------------------------------
|
|	Menu Script by Josh Miller
|	written for the the Mark Twain Golf Course
|	and the City of Elmira @ http://www.cityofelmira.net
|
-------------------------------------------------------------------------------------------*/ 

links=new Array();
title=new Array();
check=new Array();
x=0;

title[x]="Home"
links[x]="index.html"
check[x]="course"
x++;

title[x]="Book a Tee Time"
links[x]="teetime.html"
check[x]="time"
x++;

title[x]="Calendar & Events"
links[x]="calendar.html"
check[x]="events"
x++;

title[x]="Contact Our Staff"
links[x]="contact.html"
check[x]="staff"
x++;

title[x]="Course Information"
links[x]="course_info.html"
check[x]="information"
x++;

title[x]="Directions to MTGC"
links[x]="directions.html"
check[x]="directions"
x++;

title[x]="Golf Rates & Fees"
links[x]="rates.html"
check[x]="fees"
x++;

title[x]="Golf Shop & Snack Bar"
links[x]="shop.html"
check[x]="bar"
x++;

title[x]="History of the Course"
links[x]="history.html"
check[x]="ross"
x++;

title[x]="Lessons from the Pros"
links[x]="lessons.html"
check[x]="lessons"
x++;

title[x]="Online Mini-golf"
links[x]="minigolf.html"
check[x]="mini-golf"
x++;

title[x]="Player Recognition"
links[x]="recognition.html"
check[x]="players"
x++;

title[x]="Reciprocal Courses"
links[x]="reciprocals.html"
check[x]="courses"
x++;

title[x]="Rules & Etiquette"
links[x]="rules.html"
check[x]="etiquette"
x++;

title[x]="Season Passes"
links[x]="seasonpasses.html"
check[x]="passes"
x++;

title[x]="Sponsor a Hole"
links[x]="sponsor.html"
check[x]="twain"
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='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='"+links[i]+"' class='leftmenu'>"+title[i]+"</a></td></tr>						");
		}   
	}
	if (page==check[0]){
		document.write("<tr><td align='left'><img src='pics/dot.gif' width='5' height='12' border='0' alt=''></td></tr>				");
	}
	else{
		document.write("<tr><td align='left'><a href='"+links[0]+"' class='leftmenu'>"+title[0]+"</a></td></tr>						");
	}
	document.write("</table>");
}

function golfnav(){
	document.write("<table border='0' cellpadding='0' cellspacing='4' width='154'>													");
	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("<tr><td align='left'><a href='javascript:map(\"map=2&0&1&2&6&7&8&22\");' class='leftmenu'>Map to Golf Course</a></td></tr>										");
	document.write("<tr><td align='left'><a href='../index/calendar.html' class='leftmenu'>Community Calendar</a></td></tr>	");



	document.write("</table><br>");
        document.write("        <form method='GET' action='http://search.blossom.com/query/311'>        ");
        document.write("        <input type='text' name='key2' size='18'><input type='submit' name='submit' value='Search'>        ");
        document.write("        </form>        ");
        document.write("        <table border='0' cellpadding='0' cellspacing='0' width='140'>        ");
        document.write("        <tr><td align='left'><span class='navbar'>Go To</span><br></td></tr>        ");
        document.write("        <tr><td align='center'><form name='QL'><select name='quick' onChange='QuickLinks(this.form)'>        ");
        document.write("        <option value='#'>Select One</option>        ");
        document.write("        <option value='../index/index.html'>City Homepage</option>        ");
        document.write("        <option value='../about/index.html'>About Elmira</option>        ");
        document.write("        <option value='../offices/index.html'>Elmira City Hall</option>        ");
        document.write("        <option value='../fire/index.html'>Fire Department</option>        ");
        document.write("        <option value='../police/index.html'>Police Department</option>        ");
        document.write("        <option value='../dps/index.html'>Public Services</option>        ");
        document.write("        <option value='../history/index.html'>Pages in History</option>        ");
        document.write("        </select></form></td></tr></table>        ");
        document.write("        <table border='0' cellpadding='0' cellspacing='4' width='154'>        ");
        document.write("        <tr><td align='left'><a href='javascript:print()' class='lefttool'>Print this Page</a></td></tr>        ");
        document.write("        <tr><td align='left'><a href='javascript:sendlink()' class='lefttool'>Email this Page</a></td></tr>        ");
        document.write("        <tr><td align='left'><a href='javascript:addbookmark()' class='lefttool'>Bookmark Page</a></td></tr>        ");
		document.write("		<tr><td align='left'><a href=\"javascript:sethome()\" class='lefttool' style=\"cursor:hand\"  onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage(document.location);\">Set as Home Page</a></td></tr>")
        document.write("        <tr><td align='left'><a href='javascript:reportProblem()' class='lefttool'>Report a Problem</a><br><br></td></tr>        ");
        document.write("        <tr><td align='left'><a href='../golf/email.html?20' class='lefttool'>Email the Course</a></td></tr>        ");
        document.write("        <tr><td align='left'><a href='../golf/email.html' class='lefttool'>Email the Webmaster</a></td></tr>        ");
        document.write("        </table>        ");
		//<!-- BEGIN WebSTAT Activation Code -->
		document.write("<sc"+"ript type=\"text/javascript\" language=\"JavaScript\" src=\"http://hits.webstat.com/cgi-bin/wsv2.cgi?54793\"></scr"+"ipt>");
		document.write("<nos"+"cript>");
		document.write("<a href='http://www.webstat.com'>");
		document.write("<img SRC='http://hits.webstat.com/scripts/wsb.php?ac=54793' border='0' alt='WebSTAT - Free Web Statistics'></a>");
		document.write("</nosc"+"ript>");
}





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=0;i<links.length;i++){
			document.write("        <a href='"+links[i]+"' class='footer'>"+title[i]+"</a> |        ");
			if ( i==6 || 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 rightfeatures(){
	hole=[Math.ceil(Math.random()*(18))]
	
	document.write("    <table border='0' cellpadding='0' cellspacing='0' width='150'>        ");
	document.write("	<tr><td><img src='pics/dot.gif' width='5' height='5' border='0' alt=''></td></tr>			");
    document.write("    <tr><td><a href='http://www.golfdigest.com/'><img src='pics/index_golfdigest.gif' alt='Rated the #1 Best Kept Secret by Golf Digest Magazine' height='120' width='120' border='0'></a></td></tr>		");
    document.write("    <tr><td><span class='rightheader'>2275 Corning Road<br>Elmira NY 14903<br>(607) 737-5770</span></td></tr>		");
	document.write("	<tr><td><img src='pics/dot.gif' width='5' height='5' border='0' alt=''></td></tr>			");
	document.write("	<tr><td class='rightbar'>&nbsp;Featured Hole: "+hole+"</td></tr>	");
	document.write("	<tr><td align='left'><a href='course_info.html' border='0'><img src='pics/holes/hole"+hole+".jpg' width='150' height='113' border='0' alt='Hole "+hole+"'><br>	");
	document.write("	<table border='0' cellpadding='0' cellspacing='0' width='150'><tr>	");
	document.write("	<td><span class='righttext'>Blue Tee</span></td><td><span class='righttext'>"+blue[hole]+"</span></td>	");
	document.write("	<td><span class='righttext'>&nbsp;Men's Par</span></td><td><span class='righttext'>"+menspar[hole]+"</span></td></tr><tr>	");
	document.write("	<td><span class='righttext'>White Tee</span></td><td><span class='righttext'>"+white[hole]+"</span></td>	");
	document.write("	<td><span class='righttext'>&nbsp;Lady's Par</span></td><td><span class='righttext'>"+ladiespar[hole]+"</span></td></tr><tr>	");
	document.write("	<td><span class='righttext'>Gold Tee</span></td><td><span class='righttext'>"+gold[hole]+"</span></td></tr><tr>	");
	document.write("	<td><span class='righttext'>Red Tee</span></td><td><span class='righttext'>"+red[hole]+"</span></td></table>	");
	document.write("	<tr><td class='rightbar'>&nbsp;Staff</td></tr>	");
	document.write("	<tr><td align='right'><span class='righttext'>Manager/PGA Professional<br>Adam Augustine</span>	");
	document.write("	<tr><td><img src='pics/dot.gif' width='5' height='5' border='0' alt=''></td></tr>			");
	document.write("	<tr><td align='right'><span class='righttext'>Golf Shop Assistant<br>Chris Nichols</span>	");
	document.write("	<tr><td><img src='pics/dot.gif' width='5' height='5' border='0' alt=''></td></tr>			");
	document.write("	<tr><td align='right'><span class='righttext'>Superintendent<br>Tim Foss</span>			");
	document.write("	<tr><td><img src='pics/dot.gif' width='5' height='5' border='0' alt=''></td></tr>			");
	document.write("	<tr><td align='right'><span class='righttext'>Food Services Manager<br>Char Hoffman</span></td></tr>	");
	document.write("	<tr><td class='rightbar'>&nbsp;Greens Fees</td></tr>	");
	document.write("	<tr><td><span class='righttext'>18 Holes . . . . . . . . . . $24.00<br></span></td></tr>	");
	document.write("	<tr><td><span class='righttext'>9 Holes . . . . . . . . . . . $17.00</span></td></tr>	");
	document.write("	<tr><td align='center'><span class='righttext'><a href='rates.html'>Click here for more fees<br></a></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 opengolfhole(x){ 
	var hole=x;
	GolfWindow=window.open("", "newwin", "height=460,width=365,toolbar=no,scrollbars=no,menubar=no");
	GolfWindow.document.write("		<head><title>MTGC Hole "+hole);
	GolfWindow.document.write("		</title><LINK rel='stylesheet' type='text/css' href='_golf.css' title='golf'></head>	");
	GolfWindow.document.write("		<body background='pics/greenbg.gif' leftmargin='0' marginwidth='0' topmargin='0' marginheight='0'	");
	GolfWindow.document.write("		<center><table  align=center border='0' cellpadding='0' cellspacing='2' width='365'><tr><td><div align='center'><img src='pics/holes/mtgc_banner.gif'><br><font size='4' face='Verdana,Helvetica,Geneva,Swiss,SunSans-Regular'><b>Hole	");
	GolfWindow.document.write(		hole	);
	GolfWindow.document.write("		</b></font></div></td></tr><tr><td><img src='pics/holes/hole	");
	GolfWindow.document.write(		hole	);
	GolfWindow.document.write("		.jpg' width='360' height='263' border='2'></td></tr><tr><td><table border='0' cellpadding='0' cellspacing='2'  width='100%'><tr><td><b><font color='blue'>Blue Tee</font></b></td><td>	");
	GolfWindow.document.write(		blue[hole]	);
	GolfWindow.document.write("		</td><td><b>Men's Par</b></td><td align='center'>	");
	GolfWindow.document.write(		menspar[hole]	);
	GolfWindow.document.write("		</td></tr><tr><td><b>White Tee</b></td><td>	");
	GolfWindow.document.write(		white[hole]	);
	GolfWindow.document.write("		</td><td><b>Ladies' Par</b></td><td align='center'>	");
	GolfWindow.document.write(		ladiespar[hole]	);
	GolfWindow.document.write("		</td></tr><tr><td><b><font color='red'>Red Tee</font></b></td><td>	");
	GolfWindow.document.write(		red[hole]	);
	GolfWindow.document.write("		</td><td><b>Men's Handicap</b></td><td align='center'>	");
	GolfWindow.document.write(		menscap[hole]	);
	GolfWindow.document.write("		</td></tr><tr><td><b><font color='gold'>Gold Tee</font></b></td><td>	");
	GolfWindow.document.write(		gold[hole]	);
	GolfWindow.document.write("		</td><td><b>Ladies' Handicap</b></td><td align='center'>	");
	GolfWindow.document.write(		ladiescap[hole]	);
	GolfWindow.document.write("		</td></tr></table></td></tr></table>		");
	GolfWindow.document.write("		<table border=0 cellspacing=2 width='100%'><tr><td align='left'><a href='JavaScript:print();'>Print Window</a></td><td align='right'><a href='JavaScript:close();'>Close Window</a></td></tr><tr><td align='center' colspan='2'><font size=-2>City of Elmira | Copyright © 2005 | All Rights Reserved</font></td></tr></table>	");
	GolfWindow.document.write("		</center><p></p></body></html>	");
	//if user does not close, the previous window, close it and then recreate it
	GolfWindow.document.close();
	//bring the new window to the front
	GolfWindow.document.focus();
	self.name="main"
}

function bookteetime(){
	bookWindow=window.open("http://www.teeitup.com/golf/course.wpl?C=900063", "bookwin", "height=500,width=400,toolbar=no,scrollbars=yes,menubar=no");
}

function expired(date){
	today=new Date(); day=date-today;
	return day >= -86400000;
}

blue=new Array	(0,399,416,470,173,564,395,158,392,449,428,185,519,416,399,196,412,465,421);
white=new Array	(0,382,397,446,152,521,387,145,360,437,401,165,502,406,388,182,390,449,387);
red=new Array	(0,302,272,344,140,440,295,116,276,322,320,150,367,275,310,115,296,414,277);
gold=new Array	(0,352,278,430,142,442,308,140,296,324,321,160,482,280,311,165,300,440,357);
menspar=new Array	(0,4,4,5,3,5,4,3,4,4,4,3,5,4,4,3,4,5,4);
ladiespar=new Array	(0,4,4,5,3,5,4,3,4,4,4,3,5,4,4,3,4,5,4);
menscap=new Array	(0,5,3,9,15,1,17,13,11,7,2,4,14,8,12,16,6,18,10);
ladiescap= new Array(0,7,15,3,13,1,17,9,5,11,8,2,16,4,6,18,12,10,14);

//-->