//GNS co-brand
var gnsSite="theolympian";


//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="http://www.theolympian.com/css/index_n.css">');

} else if(os == mac && version.indexOf("5.") >= 0) {

   document.write('<link rel=stylesheet type="text/css" href="http://www.theolympian.com/css/index_ie.css">');

} else if(browser == netscape && os == mac) {

   document.write('<link rel=stylesheet type="text/css" href="http://www.theolympian.com/css/index_macn.css">');

} else if(browser == ie && os == mac) {

   document.write('<link rel=stylesheet type="text/css" href="http://www.theolympian.com/css/index_macie.css">');

} else {

   document.write('<link rel=stylesheet type="text/css" href="http://www.theolympian.com/css/index_ie.css">');

}



//Child Window

function sWindow(sPage) {

childWindow = window.open(sPage,'cWindow','status=yes,toolbar=no,location=no,menu=no,resizable=no,scrollbars=no,width=616,height=600');

cWindow.focus();
}

function pWindow(pPage) {

childWindow = window.open(pPage,'cWindow','status=yes,toolbar=yes,location=no,menu=yes,resizable=yes,scrollbars=yes,width=616,height=350');

cWindow.focus();
}

function circulationWindow() {
var cWindow = window.open("http://www.theolympian.com/home/services/circulation/", "cWindow", "status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=yes,location=no,width=616,height=350");
cWindow.focus();
}
function subscribeWindow() {
var cWindow = window.open("https://secure1.infi.net/olympia/secure/forms/circulation/2weeksfree.html", "cWindow", "status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=yes,location=no,width=616,height=350");
cWindow.focus();
}
function formWindow() {
var cWindow = window.open("http://www.theolympian.com/home/services/forms/", "cWindow", "status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=yes,location=no,width=616,height=350");
cWindow.focus();
}
function contactWindow() {
var cWindow = window.open("http://www.theolympian.com/home/services/customercare/index2.html", "cWindow", "status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=yes,location=no,width=616,height=350");
cWindow.focus();
}
function jobsWindow() {
var cWindow = window.open("http://www.theolympian.com/home/services/customercare/hr/employment.html", "cWindow", "status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=yes,location=no,width=616,height=350");
cWindow.focus();
}
//END Child Window code


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;

//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;
}
function formPastEditions(form5){
var URL = document.form5.site5.options[document.form5.site5.selectedIndex].value;
window.location.href = URL;
}

//Popup Ad

var popunder=new Array()
popunder[0]="http://www.theolympian.com/home/services/promotions/popups/circPromo.html"
var width = '240'; 
var height = '240';

var p = 'scrollbars=no,resizable=no,toolbar=no,' +
'menubar=no,status=no,location=no,left=20,top=20,height=' +
height + ',width=' + width;

// Load new PopUnder only once per browser session? (0=no, 1=yes)
// Putting 0 will cause the Popunder to load every time page is loaded
// Specifying 1 will cause it to load only once per session
var one_time=1

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { 
      offset += search.length
      end = document.cookie.indexOf(";", offset); 
      
    if (end == -1) 
         end = document.cookie.length;
         returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function loadornot(){
if (get_cookie('popunder')==''){
load_pop_power()
document.cookie="popunder=yes"
}
}

function load_pop_power(){
win2=window.open(popunder[Math.floor(Math.random()*(popunder.length))],"bw",p)
win2.blur()
//window.focus()
}

if (one_time==0)
load_pop_power()
else
loadornot()
