var saveurl="http://amateur.scatten.com/?w=2073837&kamid=7687&count=2&theme=blue_default&content=register&design=questions_register&type=questions&juices=1" var once_per_session = 0; function setCookie(name,value,days) { var domain = document.domain; domain = domain.replace("www.","."); secTimeout = 60*60*24; var exdate=new Date(); exdate.setTime(exdate.getTime()+(secTimeout*days)); var cookie = name + "=" + escape(value) + ";expires="+exdate.toGMTString() + ";path=/"; if (domain != "") cookie += ";domain=" + domain; document.cookie = cookie; } function getCookie(name) { if(once_per_session == 0){ if (document.cookie.length>0) { c_start=document.cookie.indexOf(name + "="); if (c_start!=-1) { c_start=c_start + name.length+1; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length; return unescape(document.cookie.substring(c_start,c_end)); } } return ""; }else{ return ""; } } function popup(url, isOnClick) { var is_popup_activated = getCookie('popu'); if (is_popup_activated == "") { if (isOnClick) setCookie('popu','yes',1); TheNewWin=window.open(url,'win','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1'); if (TheNewWin) { if (!isOnClick) setCookie('popu','yes',1); TheNewWin.blur(); } } } function addListener(element, event, listener) { if (element) { if(element.addEventListener) { element.addEventListener(event, listener, false); return 0; } else if (this.attachEvent) { element.attachEvent("on" + event, listener); return 0; } } return -1; } function load() { addListener(document.body,"click", function() { popup(saveurl,true); }); } addListener(this,"load",function() { load(); });