var alone = false ;

browser = navigator.appName;
ie = "Microsoft Internet Explorer";
netscape = "Netscape";
mac = "MacPPC"

var explorerwin = null;
function explorer(page,name,w,h)
{
  explorerwin = window.open(page,"explorer","width="+w+",height="+h+",scrollbars=no,resizable=no");
  explorerwin.focus();
}

/*
document.write('<link rel="stylesheet" type="text/css" href="http://www.washingtonpost.com/wp-srv/homepagessi/_main.css" title="master">');
if (is_nav4up && !is_mac) {
   document.write('<link rel="stylesheet" type="text/css" href="http://www.washingtonpost.com/wp-srv/homepagessi/_main.css" title="master">');
   // document.write('<link rel="stylesheet" type="text/css" href="http://www.washingtonpost.com/wp-srv/homepagessi/search_nn.css" title="search">');
   //document.write("case 1<br>") ;
} else if (is_nav4up && is_mac) {
   document.write('<link rel="stylesheet" type="text/css" href="http://www.washingtonpost.com/wp-srv/homepagessi/_main.css" title="master">');
   // document.write('<link rel="stylesheet" type="text/css" href="http://www.washingtonpost.com/wp-srv/homepagessi/search_macnn.css" title="search">');
   //document.write("case 2<br>") ;
} else if (is_ie4up && is_mac) {
   document.write('<link rel="stylesheet" type="text/css" href="http://www.washingtonpost.com/wp-srv/homepagessi/_main.css" title="master">');
   //document.write('<link rel="stylesheet" type="text/css" href="http://www.washingtonpost.com/wp-srv/homepagessi/search_macie.css" title="search">');
   //document.write("case 3<br>") ;
} else {
   document.write('<link rel="stylesheet" type="text/css" href="http://www.washingtonpost.com/wp-srv/homepagessi/_main.css" title="master">');
   //document.write('<link rel="stylesheet" type="text/css" href="http://www.washingtonpost.com/wp-srv/homepagessi/search_ie.css" title="search">');
   //document.write("case 4<br>") ;
}
*/

/*
function frontPopup(url,width,height) {
	window.open(url, "mainframe", "width="+width+",height="+height+",scrollbars=no,menubar=no,toolbar=no,directories=no");
}
*/

function simplePopup(page,name,w,h)      
{
  poupwin = window.open(page,name,"width="+w+",height="+h+",scrollbars=yes,resizable=yes");
  poupwin.focus();
}

// declare frontOpen variables
var popupwin = null;
var ary = new Array() ;
var first = true ;
var previous_url ;
function frontPopup(url,w,h) {
	if (first) {
		popupwin = browserOpen(url,w,h);
		popupwin.focus();
		first = false ;
	} else {
		if ( popupwin != null && !popupwin.closed && previous_url == url ) { popupwin.focus(); }
		else {
			if (popupwin.closed) {
				popupwin = browserOpen(url,w,h);
				popupwin.focus();
			} else {
				popupwin.location = url;
				popupwin.focus();
			}
		}	
	}
	previous_url = url ;
	
	function browserOpen(url,w,h) {
		var agt=navigator.userAgent.toLowerCase();
		var is_ie   = (agt.indexOf("msie") != -1);
		if (is_ie) {
			return window.open(url, "", "width="+w+",height="+h+",status=no,resizable=no,directories=no") ;
		} else {
			return window.open(url, "", "width="+w+",height="+h+",status=no,resizable=no,directories=no") ;
		}
	} // end browserOpen

} // end frontPopup

/* REMOVE FOR BILLBOARD CAMPAIGN. PUT BACK IN AFTER CAMPAIGN IS OVER */
if (top.location != self.location)
{
//  top.location = self.location
}

if(!window.saveInnerWidth) {
  window.onresize = resize;
  window.saveInnerWidth = window.innerWidth;
  window.saveInnerHeight = window.innerHeight;
}

function resize() {
    if (saveInnerWidth < window.innerWidth ||
        saveInnerWidth > window.innerWidth ||
        saveInnerHeight > window.innerHeight ||
        saveInnerHeight < window.innerHeight )
    {
        window.history.go(0);
    }
}

function show(tab,box) {
	if (browser == netscape) {
		document.layers[box].document.layers[tab].visibility = 'visible' ;
	}
	else { // IE
		document.all[tab].style.visibility = 'visible' ;
	}
}

function hide(tab,box) {
	if (browser == netscape) {
		document.layers[box].document.layers[tab].visibility = 'hidden';
	}
	else { // IE
		document.all[tab].style.visibility = 'hidden';
	}
}

function display(tab,box) {
	for (var i = 0; i < tabs.length; i++) {
		if (tabs[i] == tab) {
			show(tabs[i],box);
			show(datas[i],box);
		} else {
			hide(tabs[i],box);
			hide(datas[i],box);
		}
	}
}