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 thisName = name + "=";
        var thisNameLen = thisName.length;
        var cookieLen = document.cookie.length;
        var i = 0;

        while(i < cookieLen) {
                var j = i + thisNameLen;
                if(document.cookie.substring(i, j) == thisName) {
                        return getCookieVal(j);
                }

                i = document.cookie.indexOf(" ", i) + 1;
                if(i == 0)
                        break;
        }
        return null;
}
document.writeln('');


var UniqueCookie = getCookie("WEBTRENDS_ID");

if (UniqueCookie == null) {
        var random=Math.round((Math.random()*9999999999)+1000000000);
	var time = new Date();
        var cookie = "WEBTRENDS_ID=" + time.getYear() + (time.getMonth()+1) + time.getDate() + time.getHours() +  time.getMinutes() + time.getSeconds()  + random + "; expires=Fri, 31-Dec-2004 23:59:59 GMT";
	document.cookie = cookie;
}  
