<!--

var rand      = false; // default method is cookie counter
var bannercnt = 0 ;    // start with first banner
var choice    = 0 ;    // start with first banner
var yomama    = 3 ;    // total number of banners

////// array of links and images
var chngPic = new Array();

// links
chngPic[1] = new Array();
chngPic[1][0] = "http://www.hamiltonhoteldc.com/specials.html";
chngPic[1][1] = "http://www.hamiltonhoteldc.com/meetings.html";
chngPic[1][2] = "http://www.hamiltonhoteldc.com/specials.html";

// images
chngPic[2] = new Array();
chngPic[2][0] = "http://www.hamiltonhoteldc.com/images/specials.gif";
chngPic[2][1] = "http://www.hamiltonhoteldc.com/images/meetings.gif";
chngPic[2][2] = "http://www.hamiltonhoteldc.com/images/specials.gif";

////// check for cookies
//set expiration date 1 Hour ahead
var expires = new Date();
expires.setTime(expires.getTime() + (60 * 60 * 1000));

function checkCookie() {
cookie = getCookie('bannercnt');
if (cookie == null)
	{
	setCookie('bannercnt', 0, expires, '/');
	newcookie = getCookie('bannercnt');
	if (newcookie == null)
		{
		rand = true;
		}		
	}
}

////// cookie image
function pickCookie(range) {
bannercnt = getCookie('bannercnt');
bannercnt++;
if (bannercnt == range) { bannercnt = 0; }
setCookie('bannercnt', bannercnt, expires, '/');
return bannercnt;
}

////// random image
function pickRandom(range) {
if (Math.random)
	{
	return Math.round(Math.random() * (range-1));
	} else {
	var now = new Date();
	return (now.getTime() / 1000) % range;
	}
}

function getBanner() {
checkCookie(); // check for cookies or random
if (rand)      // choose banner
	{
	choice = pickRandom(yomama);
	} else {
	choice = pickCookie(yomama);
	}
//document.write('<a href="'+chngPic[1][choice]+'"><img src="'+chngPic[2][choice]+'" alt="" width="328" height="72" border="0" name="top"></a>');
}
//-->