/*
Exit Popup
*/

var noPopFlag = false;
var monitorPage = "/exitpop/exitPopMonitor.html";

// Google|Partner safe - no popup if pathname includes "partner"
var partnerURIpath = location.pathname;
var partnerURI1 = partnerURIpath.indexOf("partner");
var partnerURI2 = partnerURIpath.indexOf("jspa");
              
var allcookies = document.cookie;
var stopFlag = allcookies.indexOf("exitpop=");

if (stopFlag == -1 && ((partnerURI1 == -1) || (partnerURI2 == -1))){
	onunload = launchMonitor;
}


function launchMonitor(){
if (!noPopFlag){var ext = "";
ext = window.open(monitorPage,"ext","toolbar=no,menubar=no,status=no,directories=no,location=no,scrollbars=no,resizable=no,width=1,height=1,left=10000,top=10000,screenX=100,screenY=100");
self.focus(); 
}
}

function condenet_noPop(value){ 
noPopFlag = value;
}

//DO NOT REMOVE THIS CODE 
	//values below are written into JavaScript variables by JSP when html template is rendered.
	//these values are passed to the DART-enabled Flash object
	
	bw = new checkBrowser();

function checkBrowser(){
	this.ver=navigator.appVersion;
	this.dom= (document.getElementById)? 1 : 0;
	this.ie5=((this.ver.indexOf("MSIE 5") >= 0) && this.dom)? 1 : 0;
	this.ie4=(document.all && !this.dom)? 1 : 0;
    this.ns6=(this.dom && parseInt(this.ver) >= 6)? 1 : 0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5)? 1 : 0;
	this.ns4=(document.layers && !this.dom)? 1 : 0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5);
	
	this.editBody = function(rootName, code) {
		if (this.dom) {
			document.getElementById(rootName).innerHTML = code;
		} else if (this.ie4) {
			document.all[rootName].innerHTML = code;
		} else if (this.ns4) {
			document.layers[rootName].document.open();
			document.layers[rootName].document.write(code);
			document.layers[rootName].document.close();
		} 
	}
	this.getRef = function(rootName) {
		if (this.dom) {
			return  document.getElementById(rootName)
		} else if (this.ie4) {
			return document.all[rootName]
		} else if (this.ns4) {
			return document.layers[rootName];
		} 
	}
	
}

function styleFlash_DoFSCommand(command, args) {
	var tileNum = parseInt(args), div, script;
	//alert(args.substr(args.indexOf("|") + 1));
	
	if (command == "updateAd") {
		bw.editBody("dartLayer" + tileNum, args.substr(args.indexOf("|") + 1));
		
		//alert(document.all["dartLayer" + tileNum].innerHTML);
	}
}

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('Sub styleFlash_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call styleFlash_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write("</SCRIPT\> \n");
} 

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
	
