function createCookie(name,value,interval) { if (interval) { var date = new Date(); date.setTime(date.getTime()+(interval*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } popup = { created: false, win: null, id: "popup", type: 1, width: 300, height: 250, left: 0, top: 0, url: null, settings: "scrollbars=yes,location=yes,directories=no,status=yes,menubar=yes,toolbar=yes,resizable=yes", init: function(url, width, height, type) { popup.url = url; popup.width = (typeof width == "undefined") ? popup.width : width; popup.height = (typeof height == "undefined") ? popup.height : height; popup.type = (typeof type == "undefined") ? popup.type : type; popup.left = (screen.width-popup.width)/2; popup.top = (screen.height-popup.height)/2; // popup.create(); document.onclick = popup.observe; window.onunload = popup.observe; }, create: function() { if (readCookie('puCreatedNew')==1) popup.created = true; if (!popup.created) { var result = window.open(popup.url, popup.id, "width="+popup.width+",height="+popup.height+",top="+popup.top+",left="+popup.left+","+popup.settings); if (result!=null && typeof result!="undefined") { popup.created = true; popup.win = result; if (popup.type==2) popup.win.blur(); createCookie('puCreatedNew',1,24*3600); } } }, observe: function() { popup.create(); } } var nnn_href = document.location.href; var nnn_showAdp = true; var nnn_adpId = 6183; if (nnn_href.indexOf('?adp_id')<0 && nnn_href.indexOf('nnn.novoteka.ru')<0) { // alert(nnn_adpId); nnn_showAdp = false; popup.init("http://beta.novoteka.ru/100/?adp_id="+nnn_adpId, 900, 600, 2); } /* */