var link_home = "http://www.kb8sew.net";
document.write('<center>');
if (pagefound != "skywarn") {
	document.write('<map name="FPMapX">');
	document.write('<area href="' + link_home + '/~kc8wti/" shape="rect" coords="339, 10, 409, 65">');
	document.write('<area href="' + link_home + '/~k-man/" shape="rect" coords="25, 10, 90, 65">');
	document.write('<area href="' + link_home + '/~waldo/" shape="rect" coords="120, 10, 300, 65">');
	document.write('<area href="javascript:void(0)" onClick="window.open(\'' + link_home + '/cgi-bin/lighthouses.pl\',\'Lighthouses\',\'scrollbars=no,resizable=no,status=no,height=625,width=950\'); return false" shape="rect" coords="450, 0, 530, 115">');
	document.write('</map>');
	document.write('<div align=center class=normal><img src="/images/logo.gif" usemap="#FPMapX" /></div>');
}
else {
	document.write('<div align=center class=normal><img src="/images/skywarn/logo.gif"/></div><br><br>');
}
document.write('<table border="0" cellspacing="0" cellpadding="0">');
document.write('<tr align="center" valign="middle">');

getImages(pagefound,"home","Home","/","Back to the Beginning");
getImages(pagefound,"radio","Amateur Radio","/cgi-bin/radio.pl","Area Frequencies,<br>Local Events,<br>Autopatch Codes,<br>and Michigan Scanner Law");
getImages(pagefound,"links","Links","/cgi-bin/links.pl","Links to Other Websites");
getImages(pagefound,"photo","Photo Gallery","/gallery2/main.php","Photos for others to view");
getImages(pagefound,"skywarn","Skywarn","/cgi-bin/skywarn.pl","<b>Home of the GRR/NWS Skywarn Team - WX8GRR</b><br>Weather Alerts,<br>Contact Info,<br>Frequencies,<br>Hazardous Weather Outlook,<br>Rotation Schedule,<br>and reference material");
getImages(pagefound,"weather","Weather","/cgi-bin/weather.pl","Forecast,<br>NexRad Radar,<br>Wind Velocity Radar,<br>and Satelite Images");
// getImages(pagefound,"software","Software","/software.htm","KB8SEW Software");

document.write('<table cellspacing="0" cellpadding="4" width="100%" class=subnav>');
document.write('<tr align="center" width="100%">');
document.write('<td>');
document.write('<table cellspacing="0" cellpadding="4" class=subnav>');
document.write('<tr align="center">');

switch (pagefound) {
	case "home":
		subHome();
		break;
	case "radio":
		subRadio();
		break;
	case "calendar":
		subCalendar();
		break;
	case "links":
		subLinks();
		break;
	case "photo":
		subPhoto();
		break;
	case "skywarn":
		subSkywarn();
		break;
	case "weather":
		subWeather();
		break;
	case "software":
		subSoftware();
		break;
	case "search":
		subSearch();
		break;
	case "map":
		subMap();
		break;
}

if (sub_empty == "false") {
	document.write('<td valign="middle" height="15">');
	document.write(' <img src=/images/toolbar/spacer.gif align=middle width="1" height="15">');
	document.write('</td>');
}
document.write('</td>');

document.write('<SCRIPT>');
document.write('function view_pdf () {');
var pdf_page = window.location;
// pdf_page = pdf_old.replace(/\?/,/qwe/);
document.write('window.open("' + link_home + '/cgi-bin/pdf.pl?page=' + pdf_page + '","PDF","scrollbars,resizable,height=600,width=600");');
document.write('}');
document.write('</SCRIPT>');
document.write('<td valign="middle">');
document.write('<a href="javascript:void(0)" onClick="view_pdf(); return false"><img src=/images/toolbar/pdf.gif align=middle></a>');
document.write('</td>');
document.write('</tr>');
document.write('</table>');

document.write('</tr>');
document.write('</table>');
document.write('</td>');
document.write('</tr>');
document.write('</table>');

document.write('</center>');
document.write('<table border="0" cellpadding="2" cellspacing="0" width="100%">');
document.write('<tbody>');
document.write('<tr>');
document.write('<td width="135" valign=top align=center class="normal">');


function getImages (thisPage,theImage,theTitle,theURL,theHover) {
if (thisPage == theImage) {
	tab1 = "<td class='onlink' style='cursor: pointer; cursor: hand;' background='/images/toolbar/on_" + theImage + "_left.gif' width='13' height='26' onclick=window.location='" + link_home + theURL +  "'></td>";
	tab2 = "<td class='onlink' style='cursor: pointer; cursor: hand;' background='/images/toolbar/on_" + theImage + "_mid.gif' width='24' onclick=window.location='" + link_home + theURL +  "'><img src='/images/toolbar/icon_" + theImage + ".gif'></td>";
	tab3 = "<td class='onlink' style='cursor: pointer; cursor: hand;' background='/images/toolbar/on_" + theImage + "_mid.gif' onclick=window.location='" + link_home + theURL +  "'><a class='onlink' href='" + link_home + theURL +  "'>" + theTitle + "</a></td>";
	tab4 = "<td class='onlink' style='cursor: pointer; cursor: hand;' background='/images/toolbar/on_" + theImage + "_right.gif' width='13' onclick=window.location='" + link_home + theURL +  "'></td>";
}
else {
	if (theImage == "home") {
		tab1 = "<td class='offlink' style='cursor: pointer; cursor: hand;' background='/images/toolbar/off_closed_left.gif' width='13' height='26' onmouseover='return overlib(\"" + theHover + "\", RIGHT, CAPTION, \"<center>" + theTitle + "</center>\");' onmouseout='return nd();' onclick=window.location='" + link_home + theURL +    "'></td>";
	}
	else {
		tab1 = "<td class='offlink' style='cursor: pointer; cursor: hand;' background='/images/toolbar/off_open_left.gif' width='13' onmouseover='return overlib(\"" + theHover + "\", RIGHT, CAPTION, \"<center>" + theTitle + "</center>\");' onmouseout='return nd();' onclick=window.location='" + link_home + theURL +    "'></td>";
	}
	tab2 = "<td class='offlink' style='cursor: pointer; cursor: hand;' background='/images/toolbar/off_mid.gif' width='24' onmouseover='return overlib(\"" + theHover + "\", RIGHT, CAPTION, \"<center>" + theTitle + "</center>\");' onmouseout='return nd();' onclick=window.location='" + link_home + theURL +    "'><img src='/images/toolbar/icon_" + theImage + ".gif'></td>";
	tab3 = "<td class='offlink' style='cursor: pointer; cursor: hand;' background='/images/toolbar/off_mid.gif' valign='middle' onmouseover='return overlib(\"" + theHover + "\", RIGHT, CAPTION, \"<center>" + theTitle + "</center>\");' onmouseout='return nd();' onclick=window.location='" + link_home + theURL +    "'><a class='offlink' href='" + link_home + theURL +    "'>" + theTitle + "</a></td>";
	tab4 = "<td class='offlink' style='cursor: pointer; cursor: hand;' background='/images/toolbar/off_right.gif' width='13' onmouseover='return overlib(\"" + theHover + "\", RIGHT, CAPTION, \"<center>" + theTitle + "</center>\");' onmouseout='return nd();' onclick=window.location='" + link_home + theURL +  "'></td>";
}
document.write(tab1 + tab2 + tab3 + tab4);
}

function subHome (){
document.write('<td valign="middle">&nbsp;');
document.write('</td>');
sub_empty = "true";
}

function subRadio () {
document.write('<td valign="middle"><a href=/cgi-bin/radio.pl?page=repeaters>Area<br>Repeaters</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/radio.pl?page=radio_events>Events<br>Calendar</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/radio.pl?page=autopatch>Emergency<br>Autopatch</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href="' + link_home + '/MIscaner.pdf" target="_blank">Michigan<br>Scanner<br>Law</a></td>');
}

function subCalendar () {
document.write('<td valign="middle"><a href=/cgi-bin/calendar.pl>Default Calendar</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/radio.pl?page=radio_events>Amateur<br>Radio<br>Events</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/skywarn.pl?page=schedule>GRR/NWS<br>Rotation<br>Schedule</a></td>');
}

function subLinks () {
document.write('<td valign="middle">&nbsp;</td>');
sub_empty = "true";
}

function subPhoto (){
document.write('<td valign="middle">&nbsp;</td>');
sub_empty = "true";
}

function subSkywarn () {
document.write('<td valign="middle"><a href=/cgi-bin/skywarn.pl?page=alerts>Alerts</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/skywarn.pl?page=civil>Civil<br>Messages</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/skywarn.pl?page=contact>Contact<br>Info</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/skywarn.pl?page=forecast>DIY<br>Forecasting</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/radio.pl?page=skywarn>Frequencies</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/skywarn.pl?page=freq_map>Frequency<br>Map</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/skywarn.pl?page=outlook>Hazardous<br>Weather<br>Outlook</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/skywarn.pl?page=meso>Mesoscale<br>Discussions</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/skywarn.pl?page=guide>Observer\'s<br>Guide</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/skywarn.pl?page=schedule>Rotation<br>Schedule</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/rss.pl>RSS<br>Feeds</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/skywarn.pl?page=SOP>SOP</a></td>');
}

function subWeather () {
document.write('<td valign="middle"><a href=/cgi-bin/weather.pl?page=forecast>Forecast</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/weather.pl?page=radar_l>NexRad<br>Radar<br>(Long)</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/weather.pl?page=radar_s>NexRad<br>Radar<br>(Short)</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/weather.pl?page=radar_v>Velocity<br>Radar</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/weather.pl?page=radar_p>Precipitation<br>Radar</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/weather.pl?page=satelite_i>Infrared<br>Satelite<br>Images</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/weather.pl?page=satelite_v>Visible<br>Satelite<br>Images</a></td>');
document.write('<td valign="middle"><img src=/images/toolbar/spacer.gif align=middle width="1" height="15"></td>');
document.write('<td valign="middle"><a href=/cgi-bin/weather.pl?page=satelite_w>Water<br>Vapor<br>Satelite<br>Images</a></td>');
}

function subSoftware (){
document.write('<td valign="middle">&nbsp;</td>');
sub_empty = "true";
}

function subSearch (){
document.write('<td valign="middle">&nbsp;</td>');
sub_empty = "true";
}

function subMap (){
document.write('<td valign="middle">&nbsp;</td>');
sub_empty = "true";
}
