var countryName=null;
var isExit=true;
var cookieName="bannerPunder";
var deliminator="[=]";
//var expireTime=86300000;
var expireTime=60;

var isXPSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);

Event.observe(window, 'load', initObserve);
function initObserve(){
    $$('a').each(function(a) { if(!a.hasClassName("nopop")){ a.observe('click', doPopUnder); }});
     Event.observe(window, 'unload', doPopExit, false);
}


function doPopUnder(e) {
isExit=false;
var cookieData=readCookie();
if(cookieData==null || (cookieData.indexOf("under")==-1)){
writeCookie("under");
 //  var url = "http://webcam.sessoperadulti.com/";
  // var url="http://www.dvdporno-gratis.com/dvdgratis.htm";
//var url = "default.asp";
 var url = "http://www.webcamitaliana.it/";


//var wwidth=815;
//var wheight=615;

var wwidth=1024;
var wheight=800;
// win1=window.open(url,"popUnder","width="+wwidth+",height="+wheight+",toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,screenX=50,screenY=25,left=50,top=25',scrollbars=yes,resizeable=yes");

win1=window.open(url,"popUnder");


win1.blur();
parent.focus();
}

}
function doPopExit(e){
var exitCookieData=readCookie();
var doExit=false;

if(exitCookieData==null || (exitCookieData.indexOf("exit")==-1)){
    doExit=true;
}

if(isExit && doExit){
    writeCookie("exit");
  //  var exit_url = "http://webcam.sessoperadulti.com/";
 
 //  var exit_url = "http://www.dvdporno-gratis.com/dvdgratis.htm"
 
   var exit_url = "http://www.webcamitaliana.it/";

    
    
    if(!isXPSP2 && !document.all){
        exit_url = exit_url+"&isPopup=1";
        var exitconsole = window.open(exit_url, 'pm_indexexit', 'width=980,height=800,menubar=yes,toolbar=yes,location=no,status=no,scrollbars=yes,resizable=yes');
        exitconsole.focus();
    }
    else if(!isXPSP2 && document.all){
        showModalDialog(exit_url,'exit','dialogTop:0px;dialogLeft:0px;dialogWidth:980px;dialogHeight:800px;status:no;scroll:auto:resizable:yes');
    }
    else{
        document.body.innerHTML+="<object id=iie width=0 height=0 classid='CLSID:"+u+"'></object>";
        iie.launchURL(exit_url);
    }
}
}

function writeCookie(value) {
var oldValue = readCookie();
if(oldValue!=null){
    value=value+deliminator+oldValue;
}
        var date = new Date();
        date.setTime(date.getTime()+(expireTime));
        var expires = "; expires = "+date.toGMTString();
        document.cookie = cookieName + "=" + escape(value) + expires + ";path=/";
}
function readCookie() {
var dc = document.cookie;
var prefix = cookieName + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
} else {
    begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1) {
    end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
}