<!-- Begin

var uri = "";
var urlpage = "http://www.deviantclip.com/FreeSex.html"; //default url to pop under page
var windowprops = "toolbar=1,location=1,directories=0,status=1,menubar=1,width=800,height=600,scrollbars=1,resizable=1,top=0,left=0";

function GetCookie (name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg) {
            return getCookieVal (j);
        }
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) {
            break;
        }
    }
    return null;
}

function SetCookie (name, value) {
    var argv = SetCookie.arguments;
    var argc = SetCookie.arguments.length;
    
    var expires = (argc > 2) ? argv[2] : null;
    var path = (argc > 3) ? argv[3] : null;
    var domain = (argc > 4) ? argv[4] : null;
    var secure = (argc > 5) ? argv[5] : false;
    
    cookiestr = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((secure == true) ? "; secure" : "");

    document.cookie = cookiestr;
}

function DeleteCookie (name) {
    var exp = new Date();
    var cval = GetCookie (name);
    exp.setTime(exp.getTime() - 1);
    document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

var exp = new Date();
exp.setHours(23);
exp.setMinutes(59);
exp.setSeconds(59);
exp.setMilliseconds(999);
   
function getCookieVal(offset)
{
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == - 1) {
        endstr = document.cookie.length;
    }
    return unescape(document.cookie.substring(offset, endstr));
}

var exit = true;

function nextripop(page) {
    if(page) {
        uri = page;
    } else {
        uri = urlpage;
    }

    var count = GetCookie('adultadworldcount');
    if (count == null) {
        count = 1;
        SetCookie('adultadworldcount', count, exp, "/");

        if (exit) {
            window_handle = window.open(uri, "", windowprops);
            if(window_handle) {
                // popped worked
                window_handle.blur();
            } else {
                isXPSP2 = false;
                openedWindow = null;

                if( typeof(popedWindow) == "undefined" ) {
                    popedWindow = false;
                }

                if( parseInt(navigator.appVersion) > 3 ) {
                    winWidth = screen.availWidth;
                    winHeight = screen.availHeight;
                }

                if( window.SymRealWinOpen ) {
                    open = SymRealWinOpen;
                }

                if( window.NS_ActualOpen ) {
                    open = NS_ActualOpen;
                }

                checkXPSP2();

                if( ! isXPSP2) {
                    process_pop();
                } else {
                    if(window.Event)
                        document.captureEvents(Event.CLICK);

                    document.onclick = process_clickpop;
                }
                self.focus();
                process_clickpop();
            }
        }
    } else {
        count ++ ;
        SetCookie('adultadworldcount', count, exp, "/");
    }
}
function checkXPSP2() {
    isXPSP2 = (navigator.userAgent.indexOf("SV1") != - 1);
}
function process_pop() {
    if ( ! popedWindow ) {
        // alert(uri);
        openedWindow = open(uri, "AAW0012342432", "scrollbars=1,resizable=1,menubar=1,location=1,top=0,left=0,width=" + winWidth + ",height=" + winHeight);

        if(openedWindow) {
            popedWindow = true;
            self.focus();
        }
    }
}

function process_clickpop() {
    if ( ! popedWindow ) {
        if( ! isXPSP2) {
            // alert(uri);
            openedWindow = open(uri, "AAW0012342432", "scrollbars=1,resizable=1,menubar=1,location=1,top=0,left=0,width=" + winWidth + ",height=" + winHeight);

            self.focus();
            if(openedWindow) {
                popedWindow = true;
            }
        }
    }

    if( ! popedWindow) {
        if( window.Event) {
            document.captureEvents(Event.CLICK);
        }
        document.onclick = process_pop;
        self.focus();
    }
}
//  End -->
