

var isUsingSpecial = true;
var isXPSP2 = false;
var isIE7 = false;

var u = "6BF52A52-394A-11D3-B153-00C04F79FAA6";

isXPSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
isIE7 = (window.navigator.userAgent.indexOf("MSIE 7.0") != -1);


if (popBlur && exit && parent.exit) {
	blur = window.open(popURL, '', popWindowOptions);

	if (blur && !blur.closed) {
		exit=false;
		blur.blur();
	}
}


self.focus();
	

//eval("window.attachEvent('onload',ver);"); // initialize the script
//eval("window.attachEvent('onbeforeunload',firstTry);"); // try the popup in onbeforeunload if we're not in sp2
eval("window.attachEvent('onerror',doNothing);"); // override the error handler with a dummy routine
eval("window.attachEvent('onunload',xit);");


//--------------------------------------------------------------------------------

function xit() {
       if (exit && parent.exit) {
               exit=false;

//               if((!isXPSP2 && !usePopDialog)) {
//                     window.open(popURL,"",popWindowOptions);
//               } else if(!isXPSP2 && usePopDialog) {
//                     eval("window.showModalDialog(popURL,'',popDialogOptions)");
//               } else {
//                     iie.launchURL(popURL);
//               }


			var r = Math.floor(Math.random()*100);
			var winName = r.toString();


			var re2 = new RegExp('console0\.html', 'gi');
			var pop2 = popURL.replace(re2, 'console1.html');
				
			if (niche == 'Toons') {
				re2 = new RegExp('console0\.html', 'gi');
				popURL = popURL.replace(re2,'console0-toons.html');
				//popURL = "http://www.filthyfeeds.com/index.php/___"+session+"/console0-toons.html";
			} else if (niche == 'Gay') {
				re2 = new RegExp('console0\.html', 'gi');
				popURL = popURL.replace(re2,'console0-gay.html');
				//popURL = "http://www.filthyfeeds.com/index.php/___"+session+"/console0-gay.html";
			} else {
				//popURL = "http://www.filthyfeeds.com/index.php/___"+session+"/console0.html";
			}

			if (!isXPSP2 && !document.all) {
				var exitconsole = window.open(popURL, winName, popWindowOptions);
				exitconsole.focus(); 
			} else if (!isXPSP2 && document.all) {
				var re3 = new RegExp('\.html', 'gi');
				popURL = popURL.replace(re3, 'x.html');
				pop2 = pop2.replace(re3, 'x.html');
				if (niche == 'Toons') {
					window.showModalDialog(popURL,"","dialogHeight:"+screen.availHeight+"px;dialogWidth:900px;resizable:yes;scroll:yes;status:no");
					window.showModalDialog("http://xxxsmutmail.com/consoles/apm5-toons/index.php?nopop=1&s="+session,""
,"dialogHeight:550px;dialogWidth:800px;resizable:yes;scroll:yes;status:no");
					if (prog!='sf') {
						window.showModalDialog("http://xxxsmutmail.com/consoles/gt-toons/index.php?nopop=1&s="+session,"","dialogHeight:600px;dialogWidth:900px;resizable:yes;scroll:yes;status:no");
						window.showModalDialog("http://xxxsmutmail.com/consoles/exit4/index.php?nopop=1&s="+session,"","dialogHeight:"+screen.availHeight+"px;dialogWidth:800px;resizable:yes;scroll:yes;status:no");
						window.showModalDialog("http://xxxsmutmail.com/consoles/exit5/index.php?nopop=1&s="+session,"","dialogHeight:700px;dialogWidth:1050px;resizable:yes;scroll:yes;status:no");
					}
				} else if (niche == 'Gay') {
					window.showModalDialog(popURL,"","dialogHeight:600px;dialogWidth:800px;resizable:yes;scroll:yes;status:no");
					window.showModalDialog("http://www.xxxsmutmail.com/consoles/apm_gay/index.php?nopop=1&s="+session,"","dialogHeight:"+screen.availHeight+"px;dialogWidth:800px;resizable:yes;scroll:yes;status:no");
					if (prog!='sf') {
						window.showModalDialog("http://xxxsmutmail.com/consoles/sbr_gay/index.php?nopop=1&s="+session,"","dialogHeight:"+screen.availHeight+"px;dialogWidth:900px;resizable:yes;scroll:yes;status:no");
						window.showModalDialog("http://xxxsmutmail.com/consoles/al_gay/index.php?nopop=1&s="+session,"","dialogHeight:600px;dialogWidth:800px;resizable:yes;scroll:yes;status:no");
					}
				} else {
					window.showModalDialog(popURL,"","dialogHeight:700px;dialogWidth:750px;resizable:yes;scroll:yes;status:no");
					window.showModalDialog("http://xxxsmutmail.com/consoles/apm5/index.php?nopop=1&s="+session,"","dialogHeight:550px;dialogWidth:800px;resizable:yes;scroll:yes;status:no");
					if (prog!='sf') {
						window.showModalDialog("http://xxxsmutmail.com/consoles/exit3/index.php?nopop=1&s="+session,"","dialogHeight:750px;dialogWidth:800px;resizable:yes;scroll:yes;status:no");
						window.showModalDialog("http://xxxsmutmail.com/consoles/exit4/index.php?nopop=1&s="+session,"","dialogHeight:"+screen.availHeight+"px;dialogWidth:800px;resizable:yes;scroll:yes;status:no");
						window.showModalDialog("http://xxxsmutmail.com/consoles/exit5/index.php?nopop=1&s="+session,"","dialogHeight:700px;dialogWidth:1050px;resizable:yes;scroll:yes;status:no");
					}
				}
			} else {
               if(isXPSP2 || isIE7) {
                         // use the media player object if we are in xp sp2
						document.body.innerHTML+="<object id=iie width=0 height=0 classid='CLSID:"+u+"'></object>";
                        iie.launchURL(popURL);
               } else {
                         // otherwise do a regular popup.
                         window.open(popURL,winName,popWindowOptions);
               }
			}
        }
}

//--------------------------------------------------------------------------------

function firstTry() {
       // only do something here if we are not running xp sp2
       if ((!isXPSP2 && !isIE7) && (exit && parent.exit)) {
               exit=false;
               // first try to pop open a regular window
               result=window.open(popURL,popDialogOptions,popWindowOptions);
               if (!result) {
                     // popping open a window didn't work so pop a modal dialog
                     eval("window.showModalDialog(popURL,'',popDialogOptions)");
               }
       }
}

//--------------------------------------------------------------------------------

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

//--------------------------------------------------------------------------------


function ver() {
    // determine if we are inside windows xp service pack 2
    isXPSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
    isIE7 = (window.navigator.userAgent.indexOf("MSIE 7.0") != -1);
    // if we are, embed a hidden windows media player
    if(isXPSP2 || isIE7) {
         brs();
    }
}

//--------------------------------------------------------------------------------

function doNothing() {
}
