var leaving = 0

window.onunload=X10Exit;




function X10Exit()
	{
	var intEmail = document.cookie.indexOf("email");
	var intGoogle = document.cookie.indexOf("google");
	var intOverture = document.cookie.indexOf("overture");
	
		if ((intEmail != -1) || (intGoogle != -1)|| (intOverture != -1)){
			leaving=1;
	
		}
		if (leaving==0)
			X10LeavingPop("http://ads.x10.com/?Z3gxT2ludGNlbGwuZGF0=",460,480);
	}
function X10LeavingPop(adCampaign,winWidth,winHeight)
	{
		var decache = new Date;
		if (parseFloat(navigator.appVersion) >= 4)
		{
		var move = ',top=50000,left=50000';
		}
		else
		{
		var move = '';
		}
	var launch=window.open;
	var pop=launch('about:blank','PopWin'+decache.getTime(), 'width='+winWidth+',height='+winHeight+',location=no,menubar=no,titlebar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes'+move,true);
	if(pop!=null)
		{
			pop.blur();
			pop.document.open();
			pop.document.writeln("<html><head></head>");
			pop.document.writeln("<script language=\"javascript1.3\">");
			pop.document.writeln("function errfn() { return true; }");
			pop.document.writeln("window.onerror=errfn;");
			pop.document.writeln("function siteExit(){");
			pop.document.writeln("var szTest;");
			pop.document.writeln("try{");
			pop.document.writeln("szTest=window.opener.document.location.pathname;");
			pop.document.writeln("window.close();");
			pop.document.writeln("}catch (e){");
			pop.document.writeln("if (parseFloat(navigator.appVersion) >= 4){");
			pop.document.writeln("self.blur();");
			//pop.document.writeln("var CookieIntPopName = \"intpop\";");
			//pop.document.writeln("var CookieIntPopString = document.cookie;");
			//pop.document.writeln("var CookieSet = CookieIntPopString.split (';');");
			//pop.document.writeln("var SetSize = CookieSet.length;");
			//pop.document.writeln("var CookiePieces");
			//pop.document.writeln("var CookieFind = \"\";");
			//pop.document.writeln("var x = 0;");
			//pop.document.writeln("for (x = 0; (x < SetSize); x++)");
			//pop.document.writeln("{");
			//pop.document.writeln("        CookiePieces = CookieSet[x].split ('=');");
			//pop.document.writeln("		  if (CookiePieces[0].substring (0,1) == ' ')");
			//pop.document.writeln("			{");
			//pop.document.writeln("				 CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);");
			//pop.document.writeln("			}");
			//pop.document.writeln("        if (CookiePieces[0] == CookieIntPopName)");
			//pop.document.writeln("			{");
			//pop.document.writeln("				CookieFind = CookiePieces[0];");
			//pop.document.writeln("			}");
			//pop.document.writeln("}");
			//pop.document.writeln("if (CookieFind == CookieIntPopName)");
			//pop.document.writeln("{");
			//pop.document.writeln("	window.close();");
			//pop.document.writeln("}");
			//pop.document.writeln("else {");
			//pop.document.writeln("	var today = new Date();");
			//pop.document.writeln("	var expires = new Date();");
			//pop.document.writeln("	expires.setTime(today.getTime() + 1000*60*60*24);");
			//pop.document.writeln("document.cookie = CookieIntPopName+\"=1\"+\"; expires=\"+expires+\"; path=/ ;\";");
			pop.document.writeln("var centerItY=(screen.height-"+winHeight+")/2 - 50;");
			pop.document.writeln("var centerItX=(screen.width-"+winWidth+")/2;");
			pop.document.writeln("self.moveTo(centerItX,centerItY);");
			//pop.document.writeln("}");
			pop.document.writeln("}");
			pop.document.writeln("window.location = '"+adCampaign+"';");
			pop.document.writeln("window.open('http://ads.x10.com/?Z3d0aHJjaGNrLmRhd=','titlewc', 'width=440, height=440, location=no, menubar=no, titlebar=no,status=no,toolbar=no,scrollbars=no,resizable=no',true);");
			pop.document.writeln("}}");
			pop.document.writeln("window.setTimeout('siteExit();',100);");
			pop.document.writeln("</s"+"cr"+"ipt>");
			pop.document.writeln("<body></body></html>");
			pop.document.close();
		}
	setTimeout('focus();',300);
	}

