var myKey=1;
var newsKey=1;

function showCounties() {
document.getElementById("sportsTab").style.zIndex = 100;
document.getElementById("sportscounties").style.visibility = "visible";
document.getElementById("sportscounties").style.zIndex = 0;
}

function showChoices() {
document.getElementById("newsTab").style.zIndex = 200;
document.getElementById("newscounties").style.visibility = "visible";
document.getElementById("newscounties").style.zIndex = 0;
}


function laterMuch() {
if (myKey==1) {
document.getElementById("sportsTab").style.zIndex = 0;
document.getElementById("sportscounties").style.visibility = "hidden";
document.getElementById("sportscounties").style.zIndex = 100;
}
}

function laterMuch2() {
if (newsKey==1) {
document.getElementById("newsTab").style.zIndex = 0;
document.getElementById("newscounties").style.visibility = "hidden";
document.getElementById("newscounties").style.zIndex = 200;
}
}


function hideCounties() {
setTimeout('laterMuch()', 1000)
}

function hideChoices() {
setTimeout('laterMuch2()', 1000)
}


var home1="http://www.gazette.net";
var home2="http://staging.gazette.net";
var home3="http://www.gazette.net/";
var home4="http://staging.gazette.net/";
var home5="http://staging2.gazette.net/";
var thisurl=location.href;
var mont="";
var pg="";
var fred="";
var gbs="";
var sports="";
var politics="";
var biz="";
var ent="";
var speak="";
var jobs="";
var autos="";
var homes="";
var classifieds="";
var topnav;
var writeclassfooter="";
var inc_spotted="no";
var newsop="";
var calendarnav="";
var contact="class='last'";


if (thisurl == home1 || thisurl == home2 || thisurl == home3 || thisurl == home4 || thisurl == home5 || thisurl.indexOf(".net/montgomery") != -1 || thisurl.indexOf(".net/princegeorges") != -1 || thisurl.indexOf(".net/frederickcounty") != -1 || thisurl.indexOf(".net/sports") != -1 || thisurl.indexOf(".net/entertainment") != -1) {inc_spotted="yes";} else {inc_spotted="no";}

if (
thisurl.indexOf("mont") != -1 || thisurl.indexOf("aspe") != -1 || thisurl.indexOf("beth") != -1 || thisurl.indexOf("burt") != -1 || thisurl.indexOf("chev") != -1 || thisurl.indexOf("dama") != -1 || thisurl.indexOf("gait") != -1 || thisurl.indexOf("germ") != -1 || thisurl.indexOf("kens") != -1 || thisurl.indexOf("olne") != -1 || thisurl.indexOf("pool") != -1 || thisurl.indexOf("poto") != -1 || thisurl.indexOf("nort") != -1 || thisurl.indexOf("rock") != -1 || thisurl.indexOf("silv") != -1 || thisurl.indexOf("tako") != -1 || thisurl.indexOf("whea") != -1 || thisurl.indexOf("homemlo") != -1
)
{
newsop="class='sel'";
//mont="class='sel'";
mont="";
pg="";
fred="";
contact="class='last'";
gbs="";
}


if (thisurl.indexOf("buyandsell") != -1) {
gbs="class='sel'";
newsop="";
pg="";
mont="";
contact="class='last'";
fred="";
}

if (
thisurl.indexOf("princegeorge") != -1 || thisurl.indexOf("bowi") != -1 || thisurl.indexOf("clin") != -1 || thisurl.indexOf("coll") != -1 || thisurl.indexOf("fort") != -1 || thisurl.indexOf("gree") != -1 || thisurl.indexOf("hyat") != -1 || thisurl.indexOf("land") != -1 || thisurl.indexOf("lanh") != -1 || thisurl.indexOf("larg") != -1 || thisurl.indexOf("laur") != -1 || thisurl.indexOf("newc") != -1 || thisurl.indexOf("port") != -1 || thisurl.indexOf("uppe") != -1 || thisurl.indexOf("pg") != -1 || thisurl.indexOf("homeplo") != -1
)
{
	newsop="class='sel'";
pg="";
//pg="class='sel'";
gbs="";
mont="";
fred="";
contact="class='last'";
}

if (
thisurl.indexOf("prin") != -1 && thisurl.indexOf("silv") == -1 
)
{
newsop="class='sel'";
//pg="class='sel'";
pg="";
gbs="";
mont="";
contact="class='last'";
fred="";
}

if (
thisurl.indexOf("fred") != -1 || thisurl.indexOf("brun") != -1 || thisurl.indexOf("midd") != -1 || thisurl.indexOf("newm") != -1 || thisurl.indexOf("thur") != -1 || thisurl.indexOf("urba") != -1 || thisurl.indexOf("walk") != -1 || thisurl.indexOf("frederick") != -1 || thisurl.indexOf("homeflo") != -1
)
{
newsop="class='sel'";
//fred="class='sel'";
fred="";
mont="";
contact="class='last'";
pg="";
gbs="";
}

if (thisurl.indexOf("politics") != -1 || thisurl.indexOf("poli") != -1) {
newsop="class='sel'";
//politics="class='sel'";
politics="";
gbs="";
fred="";
mont="";
contact="class='last'";
pg="";
}

if (thisurl.indexOf("business") != -1 || thisurl.indexOf("busi") != -1) {
newsop="class='sel'";
//biz="class='sel'";
biz="";
gbs="";
fred="";
mont="";
contact="class='last'";
pg="";
}

if (thisurl.indexOf("entertainment") != -1 || thisurl.indexOf("ente") != -1) {
ent="class='sel'";
gbs="";
fred="";
newsop="";
contact="class='last'";
mont="";
pg="";
}

if (thisurl.indexOf("speak") != -1 || thisurl.indexOf("montlet") != -1 || thisurl.indexOf("prinlet") != -1 || thisurl.indexOf("carrlet") != -1 || thisurl.indexOf("fredlet") != -1 || thisurl.indexOf("montcol") != -1 || thisurl.indexOf("princol") != -1 || thisurl.indexOf("carrcol") != -1 || thisurl.indexOf("fredcol") != -1 || thisurl.indexOf("montedi") != -1 || thisurl.indexOf("prinedi") != -1 || thisurl.indexOf("carredi") != -1 || thisurl.indexOf("frededi") != -1) {
//speak="class='sel'";
speak="";
newsop="class='sel'";
gbs="";
contact="class='last'";
fred="";
mont="";
pg="";
}

if (thisurl.indexOf("classifieds") != -1) {
classifieds="class='sel'";
gbs="";
fred="";
newsop="";
contact="class='last'";
mont="";
pg="";
}

if (thisurl.indexOf("jobs") != -1 || thisurl.indexOf("Jobs") != -1) {
jobs="class='sel'";
classifieds="class='last'";
gbs="";
newsop="";
contact="class='last'";
fred="";
mont="";
pg="";
}

if (thisurl.indexOf("autos") != -1 || thisurl.indexOf("Autos") != -1) {
autos="class='sel'";
gbs="";
classifieds="class='last'";
newsop="";
fred="";
contact="class='last'";
mont="";
pg="";
}

if (thisurl.indexOf("homes") != -1 || thisurl.indexOf("Homes") != -1 || thisurl.indexOf("realestate") != -1) {
homes="class='sel'";
gbs="";
newsop="";
classifieds="class='last'";
fred="";
mont="";
pg="";
contact="class='last'";
}


if (typeof(myPage) != "undefined") {
if (myPage.toLowerCase() == "montgomeryhome")
{
//mont="class='sel'";
newsop="class='sel'";
pg="";
mont="";
fred="";
contact="class='last'";
gbs="";}

if (myPage.toLowerCase() == "princegeorgeshome")
{newsop="class='sel'";
//pg="class='sel'";
gbs="";
mont="";
pg="";
contact="class='last'";
fred="";}

if (myPage.toLowerCase() == "frederickcountyhome")
{newsop="class='sel'";
//fred="class='sel'";
fred="";
mont="";
contact="class='last'";
pg="";
gbs="";}


if (myPage.toLowerCase() == "businesshome")
{newsop="class='sel'";
//biz="class='sel'";
biz="";
gbs="";
fred="";
mont="";
pg="";}

if (myPage.toLowerCase() == "entertainmenthome")
{ent="class='sel'";
newsop="";
gbs="";
contact="class='last'";
fred="";
mont="";
pg="";}

if (myPage.toLowerCase() == "politicshome")
{newsop="class='sel'";
//politics="class='sel'";
politics="";
gbs="";
fred="";
contact="class='last'";
mont="";
pg="";}

if (myPage.toLowerCase() == "speakout")
{
	newsop="class='sel'";
	//speak="class='sel'";
	speak="";
gbs="";
fred="";
contact="class='last'";
mont="";
pg="";
	}


if (myPage.toLowerCase().indexOf("sports") != -1)
{	speak="";
newsop="";
gbs="";
fred="";
mont="";
contact="class='last'";
pg="";
sports="class='sel'";
}

if (thisurl.indexOf("cgi-bin") != -1)
{	speak="";
newsop="";
gbs="";
fred="";
mont="";
pg="";
contact="class='last'";
sports="";
}

if (myPage.toLowerCase().indexOf("searchpage") != -1)
{	speak="";
newsop="";
gbs="";
fred="";
mont="";
contact="class='last'";
pg="";
sports="";
classifieds="class='last'";
}

if (myPage.toLowerCase().indexOf("contact") != -1)
{	speak="";
newsop="";
gbs="";
fred="";
mont="";
contact="class='sel'";
pg="";
sports="";
classifieds="";
}
}




//writethis="<div class='nav-row'><div class='nav-row-bg'><a href='/montgomery/'"+mont+">Montgomery</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/princegeorges/'"+pg+">Prince George&#8217;s</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/frederickcounty/'"+fred+">Frederick</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/carroll/'"+carroll+">Carroll</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/sports/'"+sports+">Sports</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/politics/'"+politics+">Politics</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/business/'"+biz+">Business</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/entertainment/'"+ent+">Entertainment</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/speakout/'"+speak+">Speak Out</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='http://class.gazette.net/classifieds-bin/classifieds?tp=gazette%20classifieds&temp_type=browse&classification=Jobs'"+jobs+">Jobs</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='http://class.gazette.net/classifieds-bin/classifieds?tp=gazette%20classifieds&temp_type=browse&classification=Autos'"+autos+">Autos</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/homes/'"+homes+">Homes</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='http://class.gazette.net/classifieds-bin/classifieds?tp=gazette%20classifieds'"+classifieds+">Classifieds</a></div></div>"



//writethis="<div class='nav-row'><div class='nav-row-bg'><a href='/montgomery/'"+mont+">Montgomery</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/princegeorges/'"+pg+">Prince George&#8217;s</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/frederickcounty/'"+fred+">Frederick</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/sports/'"+sports+">Sports</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/politics/'"+politics+">Politics</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/business/'"+biz+">Business</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/entertainment/'"+ent+">Entertainment</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/speakout/'"+speak+">Speak Out</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='http://class.gazette.net/classifieds-bin/classifieds?tp=gazette%20classifieds&temp_type=browse&classification=Jobs'"+jobs+">Jobs</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='http://class.gazette.net/classifieds-bin/classifieds?tp=gazette%20classifieds&temp_type=browse&classification=Autos'"+autos+">Autos</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/homes/'"+homes+">Homes</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='http://class.gazette.net/classifieds-bin/classifieds?tp=gazette%20classifieds'"+classifieds+">Classifieds</a><img src='/images/misc/nav_div.gif' border='0' alt='' /><a href='/contact'"+contact+">Contact</a></div></div>"



//writethis="<!--[if IE]><style type='text/css'>@import url(/css/gaz_2008_ie_oldsite.css);</style><![endif]--><div class='nav-row'><div class='nav-row-bg'><a href='/montgomery/'"+mont+">Montgomery</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/princegeorges/'"+pg+">Prince George&#8217;s</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/frederickcounty/'"+fred+">Frederick</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><span id='sportsTab' style='zIndex:0; width:40px; height;20px;' onmouseover='myKey=0; showCounties();' onmouseout='myKey=1; hideCounties();'><a href='#'"+sports+"'>Sports</a></span><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/politics/'"+politics+">Politics</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/business/'"+biz+">Business</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/entertainment/'"+ent+">Entertainment</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/speakout/'"+speak+">Speak Out</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='http://www.gazettebuyandsell.net/'"+gbs+">Buy & Sell</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='http://class.gazette.net/classifieds-bin/classifieds?tp=gazette%20classifieds&temp_type=browse&classification=Jobs'"+jobs+">Jobs</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='http://class.gazette.net/classifieds-bin/classifieds?tp=gazette%20classifieds&temp_type=browse&classification=Autos'"+autos+">Autos</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/homes/'"+homes+">Homes</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='http://class.gazette.net/classifieds-bin/classifieds?tp=gazette%20classifieds'"+classifieds+">Classifieds</a></div></div><div id='sportscounties' style='visibility: hidden; z-index:100;' onmouseover='myKey=0; showCounties();' onMouseOut='myKey=1; hideCounties();'><a href='/montsports/'>Montgomery</a><img src='/images/misc/nav_div_2008.gif' border='0' alt=''  /><a href='/pgsports/'>Prince George's</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/fredsports'>Frederick</a></div>";



//USE THIS UNTIL WE LAUNCH BUY AND SELL

var topnav="<div class='nav-row'><div class='nav-row-bg'><span id='newsTab' style='zIndex:0; height;20px;' onmouseover='newsKey=0; showChoices();' onmouseout='newsKey=1; hideChoices();'><a href='#'"+newsop+"'>News & Opinion</a></span><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><span id='sportsTab' style='zIndex:0; height;20px;' onmouseover='myKey=0; showCounties();' onmouseout='myKey=1; hideCounties();'><a href='#'"+sports+"'>Sports</a></span><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/entertainment/'"+ent+">Entertainment</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='http://calendar.gazette.net/'"+calendarnav+">Calendar</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='http://class.gazette.net/classifieds-bin/classifieds?tp=gazette%20classifieds&temp_type=browse&classification=Jobs'"+jobs+">Jobs</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='http://class.gazette.net/classifieds-bin/classifieds?tp=gazette%20classifieds&temp_type=browse&classification=Autos'"+autos+">Autos</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/homes/'"+homes+">Homes</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='http://class.gazette.net/classifieds-bin/classifieds?tp=gazette%20classifieds'"+classifieds+">Classifieds</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/contact/'"+contact+">Contact Us</a></div></div>";

writethis="<!--[if IE]><style type='text/css'>@import url(/css/gaz_2008_ie_oldsite.css);</style><![endif]--><div class='nav-row'>"+topnav+"<div id='newscounties' style='visibility: hidden; z-index:200;' onmouseover='newsKey=0; showChoices();' onMouseOut='newsKey=1; hideChoices();'><a href='/montgomery/'>Montgomery</a><img src='/images/misc/nav_div_2008.gif' border='0' alt=''  /><a href='/princegeorges/'>Prince George's</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/frederick/'>Frederick</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/politics/'>Politics</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/business'>Business</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/speakout/'>Speak Out</a></div><div id='sportscounties' style='visibility: hidden; z-index:100;' onmouseover='myKey=0; showCounties();' onMouseOut='myKey=1; hideCounties();'><a href='/montsports/'>Montgomery</a><img src='/images/misc/nav_div_2008.gif' border='0' alt=''  /><a href='/pgsports/'>Prince George's</a><img src='/images/misc/nav_div_2008.gif' border='0' alt='' /><a href='/fredsports'>Frederick</a></div>";



var popUpWin=0;

function popUpWindow(url2, left, top, width, height)

{

  if(popUpWin)

  {

    if(!popUpWin.closed) popUpWin.close();

  }

  popUpWin = open(url2, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}

























// JavaScript Document



String.prototype.ltrim = function() {

	return this.replace(/^\s+/,"");

}

String.prototype.rtrim = function() {

	return this.replace(/\s+$/,"");

}





function sendRequest(url,callback,postData) {

	var req = createXMLHTTPObject();

	if (!req) return;

	var method = (postData) ? "POST" : "GET";

	req.open(method,url,true);

	req.setRequestHeader('User-Agent','XMLHTTP/1.0');

	if (postData)

		req.setRequestHeader('Content-type','application/x-www-form-urlencoded');

	req.onreadystatechange = function () {

		if (req.readyState != 4) return;

		if (req.status != 200 && req.status != 304) {

//			alert('HTTP error ' + req.status);

			return;

		}

		callback(req);

	}

	if (req.readyState == 4) return;

	req.send(postData);

}



var XMLHttpFactories = [

	function () {return new XMLHttpRequest()},

	function () {return new ActiveXObject("Msxml2.XMLHTTP")},

	function () {return new ActiveXObject("Msxml3.XMLHTTP")},

	function () {return new ActiveXObject("Microsoft.XMLHTTP")}

];



function createXMLHTTPObject() {

	var xmlhttp = false;

	for (var i=0;i<XMLHttpFactories.length;i++) {

		try {

			xmlhttp = XMLHttpFactories[i]();

		}

		catch (e) {

			continue;

		}

		break;

	}

	return xmlhttp;

}



function handleRequest(req) {

	var writeroot = document.getElementById('rss_here');

	 var rssFeeds="<ul>";

	 var mylink="";

	 var headline="";

	 var myReq=req.responseXML;

	// alert(myReq);

 var num=myReq.getElementsByTagName('link').length;

// alert(num);

 for (j=0;j<num;j++) { //alert(j);

mylink=myReq.getElementsByTagName('link')[j].firstChild.data;

headline=myReq.getElementsByTagName('title')[j].firstChild.data;

headline=headline.ltrim();

headline=headline.rtrim();

  rssFeeds=rssFeeds+"<li><a href='"+mylink+"' target='_blank'>"+headline+"</a></li>";

  }

 rssFeeds=rssFeeds+"</ul>";

// alert(rssFeeds);

	writeroot.innerHTML = rssFeeds;

}



var ffstyles="";

var yourversion = navigator.userAgent;

			var yourversion2 = navigator.appVersion;

	if (yourversion.indexOf("Firefox")!=-1 || yourversion2.indexOf("Firefox")!=-1) {ffstyles="<style type='text/css'>input, textarea, #specialremarks {border: 1px #000 solid;} .formbutton, .formbutton input {border:none; background-color:#000066; color:#fff;}</style>";}

document.write(ffstyles);	









	function MM_CheckFlashVersion(reqVerStr,msg){

  with(navigator){

    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);

    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);

    if (!isIE || !isWin){  

      var flashVer = -1;

      if (plugins && plugins.length > 0){

        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";

        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;

        if (desc == "") flashVer = -1;

        else{

          var descArr = desc.split(" ");

          var tempArrMajor = descArr[2].split(".");

          var verMajor = tempArrMajor[0];

          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");

          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;

          flashVer =  parseFloat(verMajor + "." + verMinor);

        }

      }

      // WebTV has Flash Player 4 or lower -- too low for video

      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;



      var verArr = reqVerStr.split(",");

      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);

  

      if (flashVer < reqVer){

        if (confirm(msg))

          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";

      }

    }

  } 

}



function preloadImages() {

	MM_CheckFlashVersion("9,0,0,0","Content on this page requires a newer version of Macromedia Flash Player. Do you want to download it now?");

}



function MM_preloadImages() {

	MM_CheckFlashVersion("9,0,0,0","Content on this page requires a newer version of Macromedia Flash Player. Do you want to download it now?");

}