function GetCookieValue(cookieToTest) { deb = document.cookie.indexOf(cookieToTest + "="); if (deb >= 0) { deb += cookieToTest.length + 1; fin = document.cookie.indexOf(";",deb); if (fin < 0) fin = document.cookie.length; return unescape(document.cookie.substring(deb,fin)); } } function SetCookieValue() { var dateJ=new Date(); var maDate=new Date(dateJ.getFullYear(),dateJ.getMonth(),dateJ.getDate(),23,59,59); document.cookie="TrkSessionId=VERN-8947LE-VERN-8947LF;expires=" +maDate.toUTCString(); } function ClearCookie() { document.cookie="TrkSessionId="; } function doTrkActivity(what) { var SessId=""; SessId=GetCookieValue('TrkSessionId'); if (!SessId || SessId=="") { // if ($('trkUser').value.toLowerCase()=="anonymous") { SetCookieValue(); SessId=GetCookieValue('TrkSessionId'); // } else { // SessId=""; // } // } else { // if ($('trkUser').value.toLowerCase()!="anonymous") { // ClearCookie(); // } } var loc = location.pathname.toLowerCase(); var dbCurrent = loc.substr(0, loc.indexOf('.nsf')+4); new Ajax.Request(dbCurrent + '/TBATrkActivity?OpenAgent&what=' + what + '&user=' + $('trkUser').value + '&roles=' + $('trkUserRoles').value + '&sess=' + SessId); }