var numbanners=6;
var banners=[
  ['http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=912370-0000&PA=953066&BAN=1','under foot','http://www.underft.com/banners/UFBannerSmall.jpg'],
  ['http://rover.ebay.com/rover/1/711-1751-2978-328/1?aid=10366505&pid=2679769','Ebay','http://www.jayspix.com/bnr/ebay.gif'],
  ['http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=907794-0000&PA=953065&BAN=3','kinkvideo','http://www.kinkvideo.com/banners/KINKBannerFeetSmall.gif'],
  ['http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=927370-0000&PA=842415&BAN=0','Footfriends Foot Parties','http://www.footfriends.com/banners/banner1.gif'],
  ['http://click.linksynergy.com/fs-bin/click?id=13IP2nxxtfg&offerid=102327.10000029&type=4&subid=0','Tiger Direct Top 10 Deals','http://www.tigerdirect.com/images/Affiliate/banners/TopTenDeals468x60.gif'],
  ['http://www.kqzyfj.com/email-2679769-10462070','Gay.com','http://ads.pno.net/images/2008/09/TakeAPeek1moth5728x90.jpg']
];

function setCookie(name, value, expire ){
	c=name + "=" + escape(value);
	if (expire != null) c += ";expires=" + expire.toGMTString();
	c += ";path=/;";
	document.cookie = c;
}

function getExpireDate(){
	var expires = new Date();
	expires.setTime((new Date().getTime()) + 1000*60*60*24*365);
	return expires;
}

function GetCookie (name) {
	begin = document.cookie.indexOf(name+"="); 
	if (begin != -1) {
		begin += name.length+1; 
		end = document.cookie.indexOf(";", begin);
		if (end == -1) end = document.cookie.length;
		return unescape(document.cookie.substring(begin, end));
	}
	return null;
}

function delCookie (NameOfCookie) {
// The function simply checks to see if the cookie is set.
// If so, the expiration date is set to Jan. 1st 1970.
	if (GetCookie(NameOfCookie)) {
		document.cookie = NameOfCookie + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

function SwitchBanner(){
	setTimeout('SwitchBanner()', 6500);
	banner=GetCookie("FootPartySFBanner");
	banner=banner-1+2;
	if (banner >= numbanners || banner<0) banner=0;
	document.images['bannerimg'].alt=banners[banner][1];
	document.images['bannerimg'].src=banners[banner][2];
	setCookie("FootPartySFBanner", banner, getExpireDate());
}

function FollowLink(){
	document.location = banners[banner][0];
}

banner=GetCookie("FootPartySFBanner");
banner=banner-1;
delCookie("FootPartySFBanner");
delCookie("FootPartySFBanner");
setCookie("FootPartySFBanner", banner, getExpireDate());