//// Requires 'cookies.js' script file

var splashpage={
// Splash Page Script Activation (1=enabled, 0=completely disabled!)
splashenabled: 0,

//1) URL to file on your server to display as the splashpage
splashpageurl: "http://thebizoppnetwork.com/z/8453/CD4162/&subid1=interstitial",

//2) Maximum number of pages to show between splash page ads
maxPageViews: 5,

//3) HTML for the header bar portion of the Splash Page
// Make sure to create a link that calls "javascript:splashpage.closeit()")
// An IE bug means you should not right align any image within the bar, 
//   but instead use "position:absolute" and the "right" attribute

defineheader: '<div style="padding: 5px; color: black; font: normal 12px trebuchet ms; background: #003366;"><a style="position:absolute; top: 20px; right: 17px; color:gold;" href="javascript:splashpage.closeit()" title="Skip to Content">Skip Ad--&gt;</a><img src=http://www.blacknews.com/images/gradient.gif vspace=10 ><div style="text-align:center;color:#FFFFFF;font-size:14;font-family:arial;"><b>SUPPORT BLACKNEWS.COM By Viewing The Offer Below:</b></div></div>',

//4) Auto hide Splash Page after x seconds (Integer value, 0=no)?
autohidetimer: 0,

////No need to edit beyond here//////////////////////////////////

launch:false,
//current browser detect string to limit the script to be run in (Opera9 and other "modern" browsers)
browserdetectstr: (window.opera&&window.getSelection) || (!window.opera && window.XMLHttpRequest), 

output:function(){
	document.write('<div id="slashpage" style="position: absolute; z-index: 100; color: white; background-color:white">') //Main splashpage container
	document.write(this.defineheader) //header portion of splashpage
	document.write('<iframe name="splashpage-iframe" src="about:blank" style="margin:0; padding:0; width:100%; height: 100%"></iframe>') //iframe
	document.write('<br />&nbsp;</div>')
	this.splashpageref=document.getElementById("slashpage")
	this.splashiframeref=window.frames["splashpage-iframe"]
	this.splashiframeref.location.replace(this.splashpageurl) //Load desired URL into splashpage iframe
	this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	if (!/safari/i.test(navigator.userAgent)) //if not Safari, disable document scrollbars
	this.standardbody.style.overflow="hidden"
	this.splashpageref.style.left=0
	this.splashpageref.style.top=0
	this.splashpageref.style.width="100%"
	this.splashpageref.style.height="100%"
	this.moveuptimer=setInterval("window.scrollTo(0,0)", 50)
},

closeit:function(){
	clearInterval(this.moveuptimer)
	this.splashpageref.style.display="none"
	this.splashiframeref.location.replace("about:blank")
	this.standardbody.style.overflow="auto"
	//// call set banners function 
	pause_banners=0
	set_banners()
},

init:function(){
  var allowedPages = new Array("add=1","/contact_us.cgi","not_found","error","/advertise.shtml","/invite.cgi","/enter.cgi","/members.cgi");

	//// By default dont pause the banners loading up
	//// Need to come up with another solution as this global variable crap causes dependencies
	pause_banners=0

        //// Count Public Page Views
        if (getCookie('pageViews')) {
                pageViews = parseInt(getCookie('pageViews'));
                count = pageViews + 1;
        } else { count=1; }

        if (count>=this.maxPageViews) {
                setCookie('pageViews',0,1);
        } else {
                setCookie('pageViews',count,1);
        }

	//alert('Page View: '+count);
	if (count==this.maxPageViews) {
		pause_banners=1
		this.launch=true
	}

	//// If on an allowed page, exit this function
	for (i in allowedPages) {
          if (document.URL.indexOf(allowedPages[i]) >= 0) {
            this.launch=false;
	    pause_banners=0;
	    count=count-1;
            setCookie('pageViews',count,1);
          }
	}

	
	//// ORIGINAL CODE
	if (this.launch){
		this.output()
		if (parseInt(this.autohidetimer)>0)
			setTimeout("splashpage.closeit()", parseInt(this.autohidetimer)*1000)
	}
}


}

if (splashpage.browserdetectstr && splashpage.splashenabled==1)
	splashpage.init()
