<!--
as_date = new Date();
as_pageid = as_date.getTime() + Math.floor(Math.random() * 1000);
function adcluster(id,type,expHours) {
	var adurl = "http://ads.ynot.com/adserver/";
  
	if (expHours == null || expHours == 0) 
		expHours = 24; // default 24 hours
	var cookie = readID(expHours);

	if(type == 'cid') {
		var bannerurl = adurl + "banner.php?cid=" + id + "&sessid=" + as_pageid + "&cookie=" + cookie;
		return bannerurl;
	}
	
	if(type == 'slot') {
		var bannerurl = adurl + "banner.php?slot=" + id + "&sessid=" + as_pageid + "&cookie=" + cookie;
	} else {
		var bannerurl = adurl + "banner.php?id=" + id + "&sessid=" + as_pageid + "&cookie=" + cookie;
	}

	return bannerurl;
}

function readID(expHours) {
	var expDate = new Date();
	expDate.setTime(expDate.getTime() +  (expHours * 60 * 60 * 1000)); 

	var id = GetCookie('sessid');

	if (id == null || id == "no sessid") {
		if (location.search.length > 1) id = location.search.substring(1, location.search.length);
		else id = as_pageid;
		if (id != GetCookie('sessid')) SetCookie('sessid', as_pageid, expDate);
	}

	return (id);
}
	
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 SetCookie (name, value) {  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  

	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
}
// -->
