//Browser Sniffer
window.name = "_thewindow";
browser = navigator.appName;
os = navigator.platform;
version = navigator.appVersion;
ie = "Microsoft Internet Explorer";
netscape = "Netscape";
mac = "MacPPC";

if(browser == netscape && os != mac) {
   document.write('<link rel=stylesheet type="text/css" href="/home/css/index_n.css">');
} else if(os == mac && version.indexOf("5.") >= 0) {
   document.write('<link rel=stylesheet type="text/css" href="/home/css/index_ie.css">');
} else if(browser == netscape && os == mac) {
   document.write('<link rel=stylesheet type="text/css" href="/home/css/index_macn.css">');
} else if(browser == ie && os == mac) {
   document.write('<link rel=stylesheet type="text/css" href="/home/css/index_macie.css">');
} else {
   document.write('<link rel=stylesheet type="text/css" href="/home/css/index_ie.css">');
}

//Child Window
function pWindow(pPage) {
childWindow = window.open(pPage,'childWindow','status=no,toolbar=no,location=no,menu=no,resizable=yes,scrollbars=yes,width=600,height=330');
childWindow.focus();
}
function formHandler(form)
{
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}

// Frame-buster
if (window != top) top.location.href = location.href;

//AZCentral Meida Player
function openWindow(theURL,winname,params) {
  window.open(theURL,winname,params);
}

function open_MediaPlayer(theURL,winName,features)
{
var myWindow = window.open(theURL,winName,features);
}

var newWin=null;
function openWin(showName) {
   if(newWin!=null) {
      if(!(navigator.appName=='Netscape' && parseInt(navigator.appVersion)>=5) && !(newWin.closed)) {
         newWin.close();
      }
   }
   newUrl='http://www.azcentral.com/php-bin/slideshow.php?slideshow_name='+showName+'&slide_nbr=1';
   newWin = window.open([newUrl],'slideshow','scrollbars,width=550,height=500');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//Gannett Weather Script
function jSlink (elink) {
document.location = document.affils.cgiurl.value + "weatherwrapper.pl?URL=http://www.gannettonline.com/external/weathernews/" + elink + "&AFFIL=" + document.affils.affil.value 
}

//Pull Down Menu
function formHomes(form1){
var URL = document.form1.site1.options[document.form1.site1.selectedIndex].value;
window.location.href = URL;
}
function formClassifieds(form2){
var URL = document.form2.site2.options[document.form2.site2.selectedIndex].value;
window.location.href = URL;
}
function formEmployment(form3){
var URL = document.form3.site3.options[document.form3.site3.selectedIndex].value;
window.location.href = URL;
}
function formSectionLinks(form4){
var URL = document.form4.site4.options[document.form4.site4.selectedIndex].value;
window.location.href = URL;
}

//Popup Ad
function popwin(){
window.open('http://news.theolympian.com/popup/index.html','Subscribe','width=300,height=200,left=300,top=400');
}
function intlpopwin(){
window.open('http://news.theolympian.com/popup/index.html','Subscribe','width=300,height=200,left=300,top=400');
}
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break; }
return null;
}
function SetCookie (name,value,expires,path,domain,secure) {
document.cookie = name + "=" + escape (value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
function DeleteCookie (name,path,domain) {
if (GetCookie(name)) {
document.cookie = name + "=" +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
var exp = new Date();
exp.setTime(exp.getTime() + (12*60*60*1000));
function popWinC() {
var popval = GetCookie('seenpop');
if (popval == null) {
popval=1;
SetCookie('seenpop', popval, exp, "/");
var test = GetCookie('seenpop');
if (test != null) {
popwin();
}
} }