var inurl= "http://console.crazyfuckingporn.com/console1/indexmovies.html";
var outurl = "http://console.crazyfuckingporn.com/console1/indexmovies.html";
var timedurl="http://console.crazyfuckingporn.com/console1/indexmovies.html";
var usedtimed = false; //change to true if you want to enable the timed popup.
//<!-- okay, this code here is the first pop under that loads when the user comes to the page -->

// KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
// or if this is the first browser window opened. Thus the
// variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.

// convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase();
var is_aol = (agt.indexOf("aol") != -1); 
var is_aol3 = (is_aol && is_ie3); 
var is_aol4 = (is_aol && is_ie4); 
var is_aol5 = (agt.indexOf("aol 5") != -1); 
var is_aol6 = (agt.indexOf("aol 6") != -1); 
var is_aol7 = ((agt.indexOf("aol 7")!=-1) || (agt.indexOf("aol7")!=-1)); 
var is_aol8 = ((agt.indexOf("aol 8")!=-1) || (agt.indexOf("aol8")!=-1)); 

var exit=true;
var didblurwork=false;


w=screen.availwidth+"px";
h=screen.availheight+"px";

showmod="window.showModalDialog";

//defined in the console templates
//uncomment for testing purposes
//var freeOut = 0
//var popup1 = "";
//var popup2 = "";
//var popup4 = "1";

//******************new script variables
var isXPSP2 = false;
var u = "6BF52A52-394A-11D3-B153-00C04F79FAA6";
var popDialogOptions = "dialogWidth:1024px; dialogHeight:1000px; dialogTop:0px; dialogLeft:0px; edge:Raised; center:0; help:0; resizable:1; scroll:1; status:0";
//exitnew is renamed from exit because it conflicted with the old script's variable
var exitnew = 1;
var usePopDialog = false;

//old script functions
function inpop() {
    if (popup4 == "2") { inurl=popup2; }
    if ((freeOut==0) && (!is_aol || !is_aol3 || !is_aol4 || !is_aol5 || !is_aol6 || !is_aol7 || !is_aol8)) {
	
		if (exit) {
			eval ("var bluropen = window.open('"+inurl+"','baddypowdahpop','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=1024,height=1000,top=0,left=0')");
			if (bluropen) {
				didblurwork=true;
			}
			window.blur();
			window.focus();
	    }
    }    
}
 

function doPopUp1(){
	doPopUp1Window = window.open(timedurl,'woopop','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=150,height=150');
}


//<!-- this is the code that actually does the timing - he 15000 shown in this sample is how long to wait before launching the popup.  The figure is in milliseconds (1000 =  1 second), so, for example, the sample above is set to wait 15 seconds before launching the popup. //-->

if (usedtimed) {
    if (freeOut==0) {
	    setTimeout("doPopUp1()", 40000);
	}
}


//<!-- focus people ... FOCUS!!!!!  //-->
inpop();

self.focus();



//new script functions
function ver() {
	isXPSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
	if (isXPSP2) {
		brs();
	} //end isxps2
}

function brs() {
//alert ("brs function");
document.body.innerHTML+="<object id=iie width=0 height=0 classid='CLSID:"+u+"'></object>";
}

function outpop(){
	isXPSP2a = (window.navigator.userAgent.indexOf("SV1") != -1);
	if (!isXPSP2a) {
		if (popup4 == "2") { 
			outurl=popup2; 
			//alert("scenario alpha");
		}
		if ((!didblurwork) && (freeOut == 0)) {
			eval("var widisopen = window.open('"+outurl+"','superpowdahpop','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=1024,height=1000')");
			//alert ("scenario beta");
			if (!widisopen) {
				if (exit) {		
					showurl="(\""+outurl+"\",\"\",\"dialogHeight: "+h+"; dialogWidth: "+w+"; dialogTop: 0px; dialogLeft: 0px; edge: Raised; center: Yes; help: Yes; resizable: No; status: No;\")";
					eval(showmod+showurl);			
					exit=false;
					//alert ("scenario gamma");
				}
			}
		}
	} else {//it is xp sp2
		if (freeOut == 0) {
			if (usePopDialog) {
			//alert("scenario delta");
				eval("window.showModalDialog('"+outurl+"','superpowdahpop','"+popDialogOptions+"')");
			} else {
			//usePopDialog
				iie.launchURL(outurl);
			//alert("scenario epsilon");
			}
		}
	}
}

//run the scripts
eval("window.attachEvent('onload',ver);");
eval("window.attachEvent('onunload',outpop);");
