// This script is used by us to see how visitors on our site walk through the pages on our site and this helps us to improve the content.
// Absolutely no personal information is sent from your PC to us.
// You are assinged a random visitor number cookie to identify you among other concurrent visitors.

function Get_Cookie(name) { 
   var start = document.cookie.indexOf(name+"="); 
   var len = start+name.length+1; 
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null; 
   if (start == -1) return null; 
   var end = document.cookie.indexOf(";",len); 
   if (end == -1) end = document.cookie.length; 
   return unescape(document.cookie.substring(len,end)); 
} 

function Set_Cookie(name,value,expires,path,domain,secure) { 
    var cookieString = name + "=" +escape(value) + 
       ( (expires) ? ";expires=" + expires.toGMTString() : "") + 
       ( (path) ? ";path=" + path : "") + 
       ( (domain) ? ";domain=" + domain : "") + 
       ( (secure) ? ";secure" : ""); 
    document.cookie = cookieString; 
} 

function Delete_Cookie(name,path,domain) { 
   if (Get_Cookie(name)) document.cookie = name + "=" + 
      ( (path) ? ";path=" + path : "") + 
      ( (domain) ? ";domain=" + domain : "") + 
      ";expires=Thu, 01-Jan-70 00:00:01 GMT"; 
} 

var visit_today = new Date(); 
var visit_zero_date = new Date(0,0,0); 
visit_today.setTime(visit_today.getTime() - visit_zero_date.getTime()); 
var visit_cookie_expire_date = new Date(visit_today.getTime() + (8 * 7 * 86400000)); 

function setVisitorID() { 
   if (Get_Cookie('PBVisitorID')) { 
       var PBVisitorID = Get_Cookie('PBVisitorID'); 
   }else{ 
       Set_Cookie('PBVisitorID',Math.random(),visit_cookie_expire_date); 
   } 
} 

function setSessionID() { 
   if (!Get_Cookie('PBSessionID')) 
       Set_Cookie('PBSessionID',Math.random()); 
} 

setVisitorID();
setSessionID();
