// Menu item definitions - to be passed from HTML as DrawMenu() parameters
var Main       = 0;
var Dashboard  = 1;
var Benchmark  = 2;
var Vote       = 3;
var Comments   = 4;
var Institute  = 5;

var None = 111;

function DrawMenu(id)
{
    // Menu class definitions
    var MenuClass = new Array(5);
    MenuClass[Main]      = "menu";
    MenuClass[Dashboard] = "menu";
    MenuClass[Benchmark] = "menu";
    MenuClass[Vote]      = "menu";
    MenuClass[Comments]  = "menu";
    MenuClass[Institute] = "menu";

	if (id != None) {
		MenuClass[id] = "selected";
	}

	// Draw the header
	document.write('<div class="header" >');
	document.write('	<div style="position: absolute; left: 20px; top: 5px; text-align: left; z-index: 2; ">');
	document.write('		<a href="index.php" title="MassCityStats Home"><img align="left" border="0" src="images/MassCityStatsLogo.jpg" title="MassCityStats Home" alt="MassCityStats Home"></a>');
	document.write('	</div>');
	document.write('	<div style="position: absolute; left: 604px; width: 295px; top: 20px; height: 90px; border: 1px solid #2a2a2a; z-index: 2; margin-top: 0px; padding: 0; background: #d1d1d1; ">');
	document.write('		<div style="position: absolute; left: 15px; width: 250px; top: 20px; height: 30px; border: 0; z-index: 2; color: #000000;">');
	document.write('			Enter your e-mail to join our mailing list');
	document.write('		</div>');
	document.write('		<form method="post" action="http://server1.streamsend.com/streamsend/signup.php" target=\'_new\'>');
	document.write('			<div style="position: absolute; left: 0px; width: 200px; top: 51px; height: 50px; border: 0; z-index: 2; color: #084695;">');
	document.write('				<input name="newuser_emailaddress" size="23" type="text" />');
	document.write('			</div>');
	document.write('			<div style="position: absolute; left: 200px; width: 80px; top: 50px; height: 30px; border: 0; z-index: 2; color: #084695;">');
	document.write('				<input type="submit" name="Submit" value="Submit" style="width: 75px;"/>');
	document.write('                <input name="cd" value="34292" type="hidden" />');
	document.write('                <input name="ld" value="232" type="hidden" />');
	document.write('			</div>');
	document.write('		</form>');
	document.write('	</div>');
	document.write('</div>');
	
	// Draw the menu
	document.write('<div class="menu" >');
	document.write('	<a href="index.php" class="' + MenuClass[Main] + '">Home</a> |');
	document.write('	<dl class="dropdown" style="display: inline;">');
	document.write('	  <dt id="one-ddheader" onmouseover="ddMenu(\'one\',1)" onmouseout="ddMenu(\'one\',-1)" style="display: inline;">City Dashboard</dt>');
	document.write('	  <dd id="one-ddcontent" onmouseover="cancelHide(\'one\')" onmouseout="ddMenu(\'one\',-1)" style="left: 0px;">');
	document.write('	    <ul>');
	document.write('	    	<li><a href="dashboard.php?city=Brockton" class="overline">Brockton</a></li>');
	document.write('			<li><a href="dashboard.php?city=Chicopee" class="underline">Chicopee</a></li>');
	document.write('			<li><a href="dashboard.php?city=FallRiver" class="underline">Fall River</a></li>');
	document.write('			<li><a href="dashboard.php?city=Fitchburg" class="underline">Fitchburg</a></li>');
	document.write('			<li><a href="dashboard.php?city=Holyoke" class="underline">Holyoke</a></li>');
	document.write('			<li><a href="dashboard.php?city=Lawrence" class="underline">Lawrence</a></li>');
	document.write('			<li><a href="dashboard.php?city=Leominster" class="underline">Leominster</a></li>');
	document.write('			<li><a href="dashboard.php?city=Lowell" class="underline">Lowell</a></li>');
	document.write('			<li><a href="dashboard.php?city=Lynn" class="underline">Lynn</a></li>');
	document.write('			<li><a href="dashboard.php?city=NewBedford" class="underline">New Bedford</a></li>');
	document.write('			<li><a href="dashboard.php?city=Pittsfield" class="underline">Pittsfield</a></li>');
	document.write('			<li><a href="dashboard.php?city=Springfield" class="underline">Springfield</a></li>');
	document.write('			<li><a href="dashboard.php?city=Taunton" class="underline">Taunton</a></li>');
	document.write('			<li><a href="dashboard.php?city=Worcester">Worcester</a></li>');
	document.write('	    </ul>');
	document.write('	  </dd>');
	document.write('	</dl>');

	document.write('	| <a href="benchmark.php" class="' + MenuClass[Benchmark] + '">Cities Benchmarking</a> | ');
	document.write('	<a href="vote.php" class="' + MenuClass[Vote] + '">Vote for Benchmarks</a> | ');
	document.write('	<a href="comments.php" class="' + MenuClass[Comments] + '">Comments & Contact</a> | ');
	document.write('	<a href="http://www.pioneerinstitute.org/" target=_blank class="' + MenuClass[Institute] + '">Pioneer Institute</a>');
	document.write('</div>');
}
