 
function ad(content, expires, reqcookie, p3p, type, showonce) {
	this.content=content
	this.expires=expires
	this.reqcookie=reqcookie
	this.showonce=showonce
	this.p3p=p3p
	this.type=type
}

var bannercount = 5;
var banners = new Array(bannercount);
banners[1]=new ad("<SCR" + "IPT src=\"http://fan-sites.net/pops/newdefault.js\" type=\"text/javaSCR" + "IPT\" language=\"JavaSCR" + "IPT1.2\"></SCR" + "IPT>",12,false,false,"POP",true)
banners[2]=new ad("",24,false,false,"POP",false)
banners[3]=new ad("",24,false,false,"POP",false)
banners[4]=new ad("",24,false,false,"POP",false)
banners[5]=new ad("",24,false,false,"POP",false)
var p1pv = 1;
var p1m = 0;
var pm = 45;
var ppv = 40;
			
document.cookie = "ac=y"
var is_cookie = (document.cookie) ? "true" : "false"
var currentView = 1

function setCookie(name, value, expires) {  
	var expDate = new Date()
	expDate.setTime(expDate.getTime() + (expires*60*1000))
	document.cookie = name + "=" + escape(value) + "; expires=" + expDate.toGMTString()
}	

function incCookie(name, expires) {
	var cv=getCookie(name)
	if (cv == null) {
		setCookie(name,0,expires)
		cv=0;
	}	
	ncv=parseInt(cv)+1
	setCookie(name,ncv,expires)
	return ncv
}

function getCookie(name) { 
	cc=document.cookie;
	var i = cc.indexOf(name + "=")
	if (i == -1) return null
	i = cc.indexOf("=", i) + 1
	var endstr = cc.indexOf(";", i)
	if (endstr == -1) endstr = cc.length
	return unescape(cc.substring(i, endstr))
}

function popShow(cv,r) {
	for (var i=1; i<=bannercount; i++) {
		pc = 'ad_pop_' + i
		if (getCookie(pc) == null) {
			setCookie(pc, 1, banners[i].expires*60)
			document.write(banners[i].content);
			break;
		}
	}
	
	setCookie('ad_disp_pv',40 + cv,7200)
	setCookie('ad_disp_m',45,45)
	setCookie('ad_disp',1,7200)
		
}

ad_popup = getCookie('ad_popup')

if (ad_popup == null) {
	setCookie('ad_disp_pv',1,7200)
		
	ad_popup = 0
	setCookie('ad_popup', 0, 7200)		
}

currentView = incCookie('ad_pv', 7200)
if (getCookie('ad_disp_pv') <= currentView) popShow(currentView,'[Pageview]')
if (getCookie('ad_disp') == 1 && getCookie('ad_disp_m') == null) popShow(currentView,'[Time]')

