// - dependencies: 
// - 	interstitial is declared as a global level variable it can be initially set to either true or false
//-   	sectionName is a global level variable set to "sports" or any other sectionName


	function ckSet(n,v){
		document.cookie = n + "=" + v;
		return(true);
	}
	
	function ckVal(n){
		re = new RegExp(n+"=([^;]+)")
		if(re.test(document.cookie)){
			return(unescape(re.exec(document.cookie)[1]))
		}
		else{return(false)}
	}	
	
//--     above functions:      get and set values in the cookie	
	
	function ckNewPath(){
		ckSet('sitePath','true');
		ckSet('a','false');
		ckSet('b','false');
		ckSet('c','false');
		ckSet('d','false');
	}
	
	function ckInit(){
		if(ckVal('sitePath')!='true'){
			ckNewPath()
		}
	}
	
	function checkForVisit(){
		if(ckVal(sectionName)=="true"){
			interstitial = false;
		}
		else{
			ckSet(sectionName,'true');
		}
	}
	
	function isOldNS(){
		match = false;
		for(i=1; i<6;i++){
			var strMatch = "4.0" + i
			if(navigator.appVersion.indexOf(strMatch)!=-1){
				match = true
			}
		}
		return(match);
	}

	ckInit();
	checkForVisit();
	if(navigator.platform.indexOf("Win")==-1){interstitial=false}
	if(document.layers && isOldNS()){interstitial=false}
	if(interstitial){
		
		flashPiece =  "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0\" ID=Zaaz WIDTH=800 HEIGHT=800><PARAM NAME=movie VALUE=\"flash/**sectionName**\"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src=\"flash/**sectionName**\" quality=high WIDTH=800 HEIGHT=800 NAME=Zaaz swLiveConnect=true TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></EMBED></OBJECT>"
		if (interstitialFilename=="") 
		{
		//flashPiece = flashPiece.replace(/\*\*sectionName\*\*/g, marketName + "_" + sectionName + ".swf");
		flashPiece = flashPiece.replace(/\*\*sectionName\*\*/g, "blank.swf");
		}
		else
		{
		flashPiece = flashPiece.replace(/\*\*sectionName\*\*/g, interstitialFilename);
		}
		
		pageClass = "Off";
	}		
	else{
		flashPiece = ""
		pageClass = "On"
	}
		// StyleSheetBuilder

		if(interstitial){vis = "hidden"}
		else{vis = "visible"}
		theStyleSheet = "<style type='text/css'>"
		theStyleSheet +=".pageDivInt{visibility:" + vis + ";}"
		theStyleSheet += "</style>"
		
		document.write(theStyleSheet)
