<!--
popup_ok = 1;
window_name = window.name; // popup name - set in the opener
grigore = 0;
switch (window.name)
{
    case 'xxxback': // name of the site from which this window was open
        popup_link = "http://proofs.reecemarketing.com/xxxstudio.com/proof/sales/signup.html";
        popup_name = "xxxstudiopop";
        grigore =1;
		break;
    case 'xxxstudio': // name of the site from which this window was open
        popup_link = "exit-console.html";
        popup_name = "xxxstudiopop";
        break;
    default: // if this is the first site (not a popup)
        popup_link = "exit-console.html";
        popup_name = "xxxstudiopop";
        break;
}

function bucatar(cok){  
writeCookie('myCounter', cok, 1);
}


function writeCookie(name, value, days){    if(days){        (time = new Date()).setTime(new Date().getTime()+days*24*60*60*1000);        var exp = '; expires='+time.toGMTString();    }else{        var exp='';    }    document.cookie=name+"="+value+exp+"; path=/";}function readCookie(name){    var cookies = document.cookie.split(';');    for(var i=0; i<cookies.length; i++){        var cookie=cookies[i].replace(/^\s+/, '');        if (cookie.indexOf(name+'=')==0) return cookie.substring(name.length+1);    }    return null;}function eraseCookie(name){    writeCookie(name, "", -1);}



function open_href(link)
{
    popup_ok = 0;
	window.location = link;
	return false;
}

function popup_onunload(deactivate)
{


  var top=self.screenTop;
    
	night = 1;
	if (top>9000) night= 0;

if  (window.navigator.appName != 'Microsoft Internet Explorer'){
a = readCookie('myCounter')
if (a !='')
{
bucatar('');
}else{
	night=0;
}
}
	if (night=='0')
	{

	if (typeof(deactivate) == 'undefined') deactivate = 0;
    if (deactivate) popup_ok = 0;
    if (popup_ok){
		
if (grigore ==0)	window.open(popup_link, popup_name, "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=400");
if (grigore ==1)	window.open(popup_link, popup_name);
	}
	}
    return false;
}
// -->
