<!-- Javascript-unaware browsers will ignore this code
// If we want to change the default survey that pops up, we should
// include a declaration similar to the following.
// var newNetRakerURL = "https://www.netraker.com";

var NRchildw = null;
var NRchild_created = 0;
var NRinSite = 1;
// Set size of popup
var NRwindowWidth = 255; // cannot be less than 100
var NRwindowHeight = 370; // cannot be less than 100
var NRbname = navigator.appName;
var NRbver = parseInt(navigator.appVersion);
var NRdefaulturl = "http://www.netraker.com/code/delivery.asp?action=IE&SID=470466&FID=1555943&qs1=A";
var popunderProtocol;
// var NRcookiename = "NetRakerRID1555943";
var NRcookiename = "NetRakerRID1555943";
var NRcookievalue = "1555943";
var WM_acceptsCookies = false;

// Set position of popup
var NRwindowX = 200;
var NRwindowY = 200;

// Set true to auto-center
var NRautocenter = true;
var NRbeIE=document.all?true:false;
if (NRbeIE) {
    NRwindowWidth += 25;
    NRwindowHeight += 40;
}
var NRs="width="+NRwindowWidth+",height="+NRwindowHeight;

function WM_readCookie(name) {
    if(document.cookie == '') { // there's no cookie, so go no further
        return false;
    } else { // there is a cookie
        var firstChar, lastChar;
        var theBigCookie = document.cookie;
        firstChar = theBigCookie.indexOf(name); // find the start of 'name'
        var NN2Hack = firstChar + name.length;
        if((firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) {
            // if you found the cookie
            firstChar += name.length + 1; // skip 'name' and '='
            // Find the end of the value string (i.e. the next ';').
            lastChar = theBigCookie.indexOf(';', firstChar);
            if(lastChar == -1) lastChar = theBigCookie.length;
            return unescape(theBigCookie.substring(firstChar, lastChar));
        } else { // If there was no cookie of that name, return false.
            return false;
        }
    }
} // WM_readCookie

function WM_setCookie (name, value, hours, path, domain, secure) {
    if (WM_acceptsCookies) { // Don't waste your time if the browser doesn't accept cookies.
        var not_NN2 = (navigator && navigator.appName
                       && (navigator.appName == 'Netscape')
                       && navigator.appVersion
                       && (parseInt(navigator.appVersion) == 2))?false:true;
	// Set hours to 1 month (31 days) = 744 hours
        if (!hours)
                hours = 744;

        if(hours && not_NN2) { // NN2 cannot handle Dates, so skip this part
            if ( (typeof(hours) == 'string') && Date.parse(hours) ) { // already a Date string
                var numHours = hours;
            } else if (typeof(hours) == 'number') { // calculate Date from number of hours
                var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
            }
        }
        // Set the cookie, adding any parameters that were specified.
        // the domain field should be changed for the site that is including this code.
        document.cookie = name + '=' + escape(value) +
            ((numHours)?(';expires=' + numHours):'') +
            ';domain=' + '.designofsites.com';
    } 
} // WM_setCookie

var docStr = "";

function setDocStr(secure) {
//  docStr += "<!doctype html public \"-//W3C//DTD HTML 4.0 Transitional//EN\">"
  docStr += "<html>"
  docStr += "<head>"
  docStr += "<title>Got an opinion?</title>"
  if (secure) {
    docStr += "<SCRIPT SRC=\"http://staging.netraker.com/code/customscripts/designofsites/exitpoller.js\"></SCRIPT>"
  } else {
    docStr += "<SCRIPT SRC=\"http://staging.netraker.com/code/customscripts/designofsites/exitpoller.js\"></SCRIPT>"
    // docStr += "<SCRIPT SRC=\"http://staging.netraker.com/code/customscripts/designofsites/exitpoller.js\"></SCRIPT>"
  }
  docStr += "</head>"
  docStr += "<body bgcolor=\"#f8f3df\" link=\"#003333\" vlink=\"#663399\">"
  docStr += "<table width=200 cellpadding=0 cellspacing=0 align=center border=0>"
  docStr += "<tr>"
  if (secure) {
    docStr += "<td><a href='' onClick=\"showSurvey()\";><img src=\"https://www.netraker.com/code/customscripts/designofsites/invite.jpg\" width=\"250\" height=\"310\" border=\"0\" alt=\"Tell us what you think about our site\"></a></td>"
  } else {
    docStr += "<td><a href='' onClick=\"showSurvey()\";><img src=\"http://www.netraker.com/code/customscripts/designofsites/invite.jpg\" width=\"250\" height=\"310\" border=\"0\" alt=\"Tell us what you think about our site\"></a></td>"
  }
  docStr += "</tr>"
  docStr += "</table>"
  docStr += "<p align=center><a href=\"javascript:window.close()\">Close Window</a></p>"
  if (secure) {
    docStr += "<SCRIPT SRC=\"https://staging.netraker.com/code/customscripts/designofsites/exitpollermain.js\"></SCRIPT>"
    // docStr += "<SCRIPT SRC=\"http://staging.netraker.com/code/customscripts/designofsites/exitpollermain.js\"></SCRIPT>"
  } else {
    docStr += "<SCRIPT SRC=\"http://staging.netraker.com/code/customscripts/designofsites/exitpollermain.js\"></SCRIPT>"
  }
  docStr += "</BODY>"
  docStr += "</html>"
}

function createChildWin() {
  if (!WM_readCookie(NRcookiename)) {
	// Create a child window only if one isn't created already.
	// By the time this function is called, the NRchild_created variable should have
	// been set by the child window if it exists.
	if (NRchild_created != 1) {
	    if (useHTTPS == true) {
	        NRchildw = window.open("https://staging.netraker.com/code/customscripts/designofsites/exitpoller-noakamai.html?x=" + NRwindowX + ",y=" + NRwindowY, "NRChildw", "scrollbars=no," + NRs);
	    } else {
	        NRchildw = window.open("http://staging.netraker.com/code/customscripts/designofsites/exitpoller-noakamai.html?x=" + NRwindowX + ",y=" + NRwindowY, "NRChildw", "scrollbars=no," + NRs);
	    }
	    if (!NRchildw.opener)
		NRchildw.opener = self;
	    NRchildw.blur();
	    WM_setCookie(NRcookiename, NRcookievalue);
	    window.focus();
	    NRchildw.resizeTo(NRwindowWidth, NRwindowHeight);
	    NRchildw.moveTo(NRwindowX, NRwindowY);
	}
  }
}

function setChildTimer() {
    if (!WM_readCookie(NRcookiename)) {
	// Create a child window only if one isn't created already.
	// By the time this function is called, the NRchild_created variable should have
	// been set by the child window if it exists.
	if (NRchild_created != 1) {
	    NRchildw = window.open("", "NRChildw", "scrollbars=no," + NRs);
	    NRchildw.document.open();
	    setDocStr(useHTTPS);
	    NRchildw.document.write(docStr);
	    NRchildw.document.close();
	    if (!NRchildw.opener)
		NRchildw.opener = self;
	    NRchildw.blur();
	    if (useHTTPS)
	      WM_setCookie(NRcookiename, "https");
	    else
	      WM_setCookie(NRcookiename, "http");
	    window.focus();
	    NRchildw.resizeTo(NRwindowWidth, NRwindowHeight);
	    NRchildw.moveTo(NRwindowX, NRwindowY);
	}
    }
}

function NRchildExists(cw) {
    NRchild_created = 1;
    NRchildw = cw;
}

// This next little bit of code tests whether the user accepts cookies.
if (document.cookie == '') {
    document.cookie = 'WM_acceptsCookies=yes'; // Try to set a cookie.
    if(document.cookie.indexOf('WM_acceptsCookies=yes') != -1) {
        WM_acceptsCookies = true; // If it succeeds, set variable
    }
} else { // there was already a cookie
    WM_acceptsCookies = true;
}

if(NRautocenter){
    NRwindowX = (window.screen.width-NRwindowWidth)/2;
    NRwindowY = (window.screen.height-NRwindowHeight)/2;
    if (NRbeIE) {
	NRs = NRs + ",top=NRwindowX,left=NRwindowY";
    } else {
	NRs = NRs + ",screenX=NRwindowX,screenY=NRwindowY";
    }
}

    // Set timer for 10 seconds
// if ((NRbname == "Netscape") && (NRbver >= 4)) {
//     if (!WM_readCookie(NRcookiename)) {
// 	setTimeout("createChildWin()", 10000);
//     }
// }
var NRnum = 100; /* One of of NRnum visitors will get popunder */
var NRrandom_num;
var useHTTPS = false;

NRrandom_num = Math.round(NRnum * Math.random());
// Comment out the following line after testing is completed.
NRrandom_num = 1;

// Find out whether this window is using http or https.
if (location.href.indexOf("https://") != 0)
    useHTTPS = false;
else
	useHTTPS = true;
	
// Check to see if a popunder window was created before.
if ((popunderProtocol = WM_readCookie(NRcookiename)) == false) {
    if ((NRrandom_num == 1) && (NRbname == "Microsoft Internet Explorer") && (NRbver >= 4)) {
	    setTimeout("setChildTimer()", 5000);
    }
} else {
    // A popunder was created before
    // Was it https?
    if (popunderProtocol.indexOf("https") != 0) {
        if (useHTTPS == false) {
            setTimeout("setChildTimer()", 5000);
        }
    } else {
        if (useHTTPS == true) {
            setTimeout("setChildTimer()", 5000);
        }
    }
}

// end of the ignored code -->

