var today = new Date();
var expires = new Date();
expires.setTime(today.getTime());
var valRand = getCookie('CookieV');
var valRand1 = Math.random();

if (valRand == null || valRand.length == 0){
	setCookie("CookieV", valRand1, expires, "");
	valRand = valRand1;
}

function setCookie(name, value, expires, path, domain, secure) {
	document.cookie = name + "=" + escape (value) 
	 + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) 
	 + ((path == null) ? "" : ("; path=" + path)) 
	 + ((domain == null) ? "" : ("; domain=" + domain)) 
	 + ((secure == true) ? "; secure" : "")
	 ;
}


function getCookie(Name) {
	var search = Name + "=";
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search)
		if (offset != -1) {
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1)
				end = document.cookie.length;
			return unescape(document.cookie.substring(offset, end));
		}
		else return "";
	}
	else return null;
}


