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 saveReferrerCookie() {
todayDate = new Date; id = todayDate; id = todayDate.getTime(); ref = "" + document.referrer; se = "" + document.location.search; agt = "" + document.agent; url = "" + document.URL;
if(top.document.location==document.referrer || (document.referrer == '' && top.document.location != '')) {
ref=""+top.document.referrer;se=""+top.document.location.search;agt=""+top.document.agent;url=""+top.document.URL;}
s = "ref=" + ref; s += "&id=" + id; s += "&agt=" + agt; s += "&url=" + url; expireDate = new Date; expireDate.setMonth(expireDate.getMonth() + 1); var id2 = GetCookie('SurfDetails');
if (id2 == null) {document.cookie = "SurfDetails="+s+";expires=" + expireDate.toGMTString();} else {if (url != "") {if ((url.indexOf("zztype") > 0)) {document.cookie = "SurfDetails="+s+";expires=" + expireDate.toGMTString();}}}}
