function getCookie(name) { var prefix=name+"=" var start= document.cookie.indexOf(prefix) if (start==-1) return null var end= document.cookie.indexOf(";",start+prefix.length) if (end==-1) end=document.cookie.length var value=document.cookie.substring(start + prefix.length, end) return unescape(value) } function setCookie(name,value,expires, path, domain, secure) { //expires - в днях, нет expires - текущая кука, -1 - стереть var ctime=new Date(); tik=ctime.getTime() + 1000*60*60*24*expires; ctime.setTime(tik); var newCookie=name+"="+escape(value)+ ((expires)?";expires=" + ctime.toGMTString():"")+ ((path)?";path=" + path :"")+ ((domain)?";domain=" + domain :"")+ ((secure)?";secure=" :"") document.cookie = newCookie } //setCookie("usid",0,-5); // стерли куку var usid=getCookie("usid") if(!usid) { usid=379546;setCookie("usid",usid,60); } else { }; l=window.location.href; r=document.referrer; quer="loc="+l+"&ref="+r+"&uid="+usid; document.write("");