var whole_url=document.URL;
var index=whole_url.lastIndexOf('/');
var filename=whole_url.substr(index + 1, whole_url.length);


var urlRegex= /\/([A-F0-9]{8})\//;
var result = whole_url.match(urlRegex);
var session = '/';
if (result != null) {
session = '/'+result[1]+'/';
}
exitURL = session+"exit/active/out4.html";
exitURL2 = session+"exit/active/sp2.htm";
exitURL3 = session+"adult_friend_finder.htm";
exitURL4 = session+"exit/active/free_sex_pics.htm";
exitURL5 = session+"free/free_photos_big_tit_vidoes_round_ass_movies.htm";
exitwidth = 800;
exitheight = 600;
winParams = "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=10,left="+Math.round((screen.availWidth-exitwidth)/2) +",width="+exitwidth+",height="+exitheight;
var popDialogOptions = "dialogWidth:800px; dialogHeight:600px; dialogTop:0px; dialogLeft:0px; edge:Raised; center:0; help:0; resizable:1; scroll:1; status:0";
var blur;

if (get_cookie('popunder')=='') {
blur=window.open(exitURL4,'water',winParams);
blur2=window.open(exitURL3,'melon',winParams);
}

if (blur && !blur.closed) {
document.cookie="popunder=yes"
}

window.focus()


var isXPSP2 = false;
var mediaPlayerCLSID = "6BF52A52-394A-11D3-B153-00C04F79FAA6";
var exit = true;

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

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

function firstTry() {
// only do something here if we are not running xp sp2


if(exit && !isXPSP2 && !blur && get_cookie('popunder')=='') {
exit=false;
// first try to pop open a regular window
result=window.open(exitURL,"crawll",winParams);
if (!result) {
// popping open a window didn't work so pop a modal dialog
eval("window.showModalDialog(exitURL3,'pop1',popDialogOptions)");
eval("window.showModalDialog(exitURL4,'pop2',popDialogOptions)");
eval("window.showModalDialog(exitURL5,'pop3',popDialogOptions)");
}
}
}

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

function doPopup() {
if(exit && get_cookie('popunder')=='') {
if(isXPSP2) {
// use the media player object if we are in xp sp2
iie.launchURL(exitURL2);
} 
}
if(exit) {
bob = window.open("http://adultfriendfinder.com/go/g242610","extra","toolbar=0,menubar=0,scrollbars=1,status=0,resizable=1,width=820,height=600");
bob.blur();
}
exit=false;
}

function doNothing() { } // this is a function that does nothing


function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function xit() {}


