var expdate=new Date(); expdate.setTime (expdate.getTime() + (4*24 * 60 * 60 * 1000)); // 4 месяца function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } 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,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function nvote(tema,answer) { if(!navigator.cookieEnabled){ alert("Ваш броузер не подерживает Cookies.\nВы не сможете принять участие в опросе.") }else{ if (GetCookie("vote"+tema)==1){ alert("Вы уже отвечали на этот вопрос") }else{ SetCookie("vote"+tema,"1",expdate,"/"); vote.etema.value=tema; vote.eanswer.value=answer; vote.submit(); } } } function init() { var clientPC = navigator.userAgent.toLowerCase(); // Get client info var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1)); var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1) && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1) && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1)); if(is_nav){ head=133; menu=28; footer=30; h=document.body.clientHeight-(head+menu+footer+20); dspace.style.height=h; dspace.style.width=571; document.getElementById("mleft").style.height=h; } fpop = true; if(navigator.cookieEnabled){ if (GetCookie("b1511")==1){ fpop = false; } } if(fpop){ openWindow("page_popup.phtml?1511", 600, 450); } } function openWindow(url, width, height){ var resx=screen.availWidth, resy=screen.availHeight; var tp=Math.floor((resy-height-20)/2);tp=(tp<0)?0:tp; var lt=Math.floor((resx-width-10)/2);lt=(lt<0)?0:lt; if(height>resx || width>resx){ height=resy-80 width=resx-60; } pw=window.open(url,"_blank","scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no,width="+width+",height="+height+",top="+tp+",left="+lt+""); return false; }