
/* AC_RunActiveContent.js */
var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion(){var version;var axo;var e;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");version=axo.GetVariable("$version")}catch(e){}if(!version){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version="WIN 6,0,21,0";axo.AllowScriptAccess="always";version=axo.GetVariable("$version")}catch(e){}}if(!version){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version=axo.GetVariable("$version")}catch(e){}}if(!version){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version="WIN 3,0,18,0"}catch(e){}}if(!version){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");version="WIN 2,0,0,11"}catch(e){version=-1}}return version}function GetSwfVer(){var flashVer=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var flashDescription=navigator.plugins["Shockwave Flash"+swVer2].description;var descArray=flashDescription.split(" ");var tempArrayMajor=descArray[2].split(".");var versionMajor=tempArrayMajor[0];var versionMinor=tempArrayMajor[1];var versionRevision=descArray[3];if(versionRevision==""){versionRevision=descArray[4]}if(versionRevision[0]=="d"){versionRevision=versionRevision.substring(1)}else if(versionRevision[0]=="r"){versionRevision=versionRevision.substring(1);if(versionRevision.indexOf("d")>0){versionRevision=versionRevision.substring(0,versionRevision.indexOf("d"))}}var flashVer=versionMajor+"."+versionMinor+"."+versionRevision}}else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)flashVer=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)flashVer=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=2;else if(isIE&&isWin&&!isOpera){flashVer=ControlVersion()}return flashVer}function DetectFlashVer(reqMajorVer,reqMinorVer,reqRevision){versionStr=GetSwfVer();if(versionStr==-1){return false}else if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var versionMajor=versionArray[0];var versionMinor=versionArray[1];var versionRevision=versionArray[2];if(versionMajor>parseFloat(reqMajorVer)){return true}else if(versionMajor==parseFloat(reqMajorVer)){if(versionMinor>parseFloat(reqMinorVer))return true;else if(versionMinor==parseFloat(reqMinorVer)){if(versionRevision>=parseFloat(reqRevision))return true}}return false}}function AC_AddExtension(src,ext){if(src.indexOf('?')!=-1)return src.replace(/\?/,ext+'?');else return src+ext}function AC_Generateobj(objAttrs,params,embedAttrs){var str='';if(isIE&&isWin&&!isOpera){str+='<object ';for(var i in objAttrs){str+=i+'="'+objAttrs[i]+'" '}str+='>';for(var i in params){str+='<param name="'+i+'" value="'+params[i]+'" /> '}str+='</object>'}else{str+='<embed ';for(var i in embedAttrs){str+=i+'="'+embedAttrs[i]+'" '}str+='> </embed>'}document.write(str)}function AC_FL_RunContent(){var ret=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs)}function AC_SW_RunContent(){var ret=AC_GetArgs(arguments,".dcr","src","clsid:166B1BCA-3F9C-11CF-8075-444553540000",null);AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs)}function AC_GetArgs(args,ext,srcParamName,classid,mimeType){var ret=new Object();ret.embedAttrs=new Object();ret.params=new Object();ret.objAttrs=new Object();for(var i=0;i<args.length;i=i+2){var currArg=args[i].toLowerCase();switch(currArg){case"classid":break;case"pluginspage":ret.embedAttrs[args[i]]=args[i+1];break;case"src":case"movie":args[i+1]=AC_AddExtension(args[i+1],ext);ret.embedAttrs["src"]=args[i+1];ret.params[srcParamName]=args[i+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblclick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":ret.objAttrs[args[i]]=args[i+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":ret.embedAttrs[args[i]]=ret.objAttrs[args[i]]=args[i+1];break;default:ret.embedAttrs[args[i]]=ret.params[args[i]]=args[i+1]}}ret.objAttrs["classid"]=classid;if(mimeType)ret.embedAttrs["type"]=mimeType;return ret}

/* Handler.js */
var Handler={};if(document.addEventListener){Handler.add=function(element,eventType,handler){element.addEventListener(eventType,handler,false);};Handler.remove=function(element,eventType,handler){element.removeEventListener(eventType,handler,false);};}
else if(document.attachEvent){Handler.add=function(element,eventType,handler){if(Handler._find(element,eventType,handler)!=-1)return;var wrappedHandler=function(e){if(!e)e=window.event;var event={_event:e,type:e.type,target:e.srcElement,currentTarget:element,relatedTarget:e.fromElement?e.fromElement:e.toElement,eventPhase:(e.srcElement==element)?2:3,clientX:e.clientX,clientY:e.clientY,screenX:e.screenX,screenY:e.screenY,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,charCode:e.keyCode,stopPropagation:function(){this._event.cancelBubble=true;},preventDefault:function(){this._event.returnValue=false;}}
if(Function.prototype.call)
handler.call(element,event);else{element._currentHandler=handler;element._currentHandler(event);element._currentHandler=null;}};element.attachEvent("on"+eventType,wrappedHandler);var h={element:element,eventType:eventType,handler:handler,wrappedHandler:wrappedHandler};var d=element.document||element;var w=d.parentWindow;var id=Handler._uid();if(!w._allHandlers)w._allHandlers={};w._allHandlers[id]=h;if(!element._handlers)element._handlers=[];element._handlers.push(id);if(!w._onunloadHandlerRegistered){w._onunloadHandlerRegistered=true;w.attachEvent("onunload",Handler._removeAllHandlers);}};Handler.remove=function(element,eventType,handler){var i=Handler._find(element,eventType,handler);if(i==-1)return;var d=element.document||element;var w=d.parentWindow;var handlerId=element._handlers[i];var h=w._allHandlers[handlerId];element.detachEvent("on"+eventType,h.wrappedHandler);element._handlers.splice(i,1);delete w._allHandlers[handlerId];};Handler._find=function(element,eventType,handler){var handlers=element._handlers;if(!handlers)return-1;var d=element.document||element;var w=d.parentWindow;for(var i=handlers.length-1;i>=0;i--){var handlerId=handlers[i];var h=w._allHandlers[handlerId];if(h.eventType==eventType&&h.handler==handler)
return i;}
return-1;};Handler._removeAllHandlers=function(){var w=this;for(id in w._allHandlers){var h=w._allHandlers[id];h.element.detachEvent("on"+h.eventType,h.wrappedHandler);delete w._allHandlers[id];}}
Handler._counter=0;Handler._uid=function(){return"h"+Handler._counter++;};}


// UTILITY TO RETURN FLASH OBJECT REFERENCE BASED ON BROWSER TYPE //
function getMovieName(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		if(ads_inFIF)
			return window.parent.document.getElementById(movieName);
		else
			return document.getElementById(movieName);
	} else {
		if(ads_inFIF)
			return window.parent.document[movieName]
		else		
			return document[movieName]
	}
}
// X,Y LOCATION DETECTION UTILITIES
function ads_getY(element){
	var y = 0;
	for (var e = element; e; e = e.offsetParent) // Iterate the offsetParents
		y += e.offsetTop;

	for (var e = element.parentNode; e && e !=document.body; e = e.parentNode) // Iterate the parent Nodes
		if (e.scrollTop) y -= e.scrollTop; 	// subtract scrollbar values

	//This is the Y coordinate with the doucment-internal scrolling accounted for.
	return y;
}
function ads_getX(element){
	var x = 0;
	for (var e = element; e; e = e.offsetParent) // Iterate the offsetParents
		x += e.offsetLeft;

	for (var e = element.parentNode; e && e !=document.body; e = e.parentNode) // Iterate the parent Nodes
		if (e.scrollLeft) x -= e.scrollLeft; 	// subtract scrollbar values

	//This is the Y coordinate with the doucment-internal scrolling accounted for.
	return x;
}

var frameEl = window.frameElement;
if (frameEl){
  frameEl.style.display = 'block';
  
 }

// IPAD TEST
function ipadTest(){
    return navigator.platform == "iPad";
}
var isIPad = ipadTest();

if (typeof(daoAPI) == "undefined"){
	daoAPI = {};
}

// COOKIE FUNCTIONALITY
		daoAPI.Cookie = function(name){
			this.$name = name;
			var allcookies = document.cookie;
			if (allcookies == "") return;
			if(allcookies.indexOf("; ") != -1)
				var cookies = allcookies.split('; ');
			else
				var cookies = allcookies.split(';');
			var cookie = null;
			for(var i = 0; i < cookies.length; i++) {		
				// Does this cookie string begin with the name we want?
				if (cookies[i].substring(0, name.length+1) == (name + "=")) {
					cookie = cookies[i];
					break;
				}
			}
		    if (cookie == null) return;
			var cookieval = cookie.substring(name.length+1);
			var a = cookieval.split('&'); // Break it into an array of name/value pairs
			for(var i=0; i < a.length; i++)  // Break each pair into an array
				a[i] = a[i].split(':');
			for(var i = 0; i < a.length; i++) {
				this[a[i][0]] = decodeURIComponent(a[i][1]);
			}
		}
				
		daoAPI.Cookie.prototype.store = function(daysToLive, path, domain, secure) {
			var cookieval = "";
			for(var prop in this) {
				// Ignore properties with names that begin with '$' and also methods
				if ((prop.charAt(0) == '$') || ((typeof this[prop]) == 'function')) 
					continue;
				if (cookieval != "") cookieval += '&';
				cookieval += prop + ':' + encodeURIComponent(this[prop]);
			}
			var cookie = this.$name + '=' + cookieval;
			if (daysToLive || daysToLive == 0) {
				var hours = 24 * daysToLive;				
				var nextday = new Date();
				//nextyear.setFullYear(nextyear.getFullYear() + 1);
				nextday.setHours(nextday.getHours() + hours);				
				cookie += "; max-age=" + (daysToLive*24*60*60);
				cookie += "; expires=" + nextday.toGMTString();
			}
			if (path) cookie += "; path=" + path;
			if (domain) cookie += "; domain=" + domain;
			if (secure) cookie += "; secure"
			document.cookie = cookie;
		}
		
		daoAPI.Cookie.prototype.remove = function(path, domain, secure) {
			// Delete the properties of the cookie
			for(var prop in this) {
				if (prop.charAt(0) != '$' && typeof this[prop] != 'function') 
				delete this[prop];
			}
			// Then, store the cookie with a lifetime of 0
			this.store(0, path, domain, secure);
		}
		
		daoAPI.Cookie.enabled = function() {
			// Use navigator.cookieEnabled if this browser defines it
			if (navigator.cookieEnabled != undefined) return navigator.cookieEnabled;
		
			// If we've already cached a value, use that value
			if (Cookie.enabled.cache != undefined) return Cookie.enabled.cache;
		
			// Otherwise, create a test cookie with a lifetime
			document.cookie = "testcookie=test; max-age=10000";  // Set cookie
		
			// Now see if that cookie was saved
			var cookies = document.cookie;
			if (cookies.indexOf("testcookie=test") == -1) {
				// The cookie was not saved
				return Cookie.enabled.cache = false;
			}
			else {
				// Cookie was saved, so we've got to delete it before returning
				document.cookie = "testcookie=test; max-age=0";  // Delete cookie
				return Cookie.enabled.cache = true;
			}
		}

daoAPI.launchPushdown = function(o){

	// DEFINE BLACKLIST PARAMETERS
	var blacklist = false;
	var needFlash = false;
	o.needFlash = false;
	var e = document.getElementById(o.id);
	
	// check for SWFs
	var swfPattern1 = /(\.swf)$/;	
	var swfPattern2 = /(\.SWF)$/;
	
	// If any assets are SWFS must serve default GIF to iPad
	if(o.baseAsset.match(swfPattern1) || o.baseAsset.match(swfPattern2)){
		needFlash = true;
		o.needFlash = true;
	}else if(o.autoExpandAsset.match(swfPattern1) || o.autoExpandAsset.match(swfPattern2)){
		needFlash = true;
		o.needFlash = true;	
	}else if(o.userExpandAsset.match(swfPattern1) || o.userExpandAsset.match(swfPattern2)){
		needFlash = true;
		o.needFlash = true;
	}
	if(needFlash && !blacklist){
		// Version check based upon the values entered above in "Globals"
		var hasReqestedVersion = DetectFlashVer(o.requiredMajorVersion, o.requiredMinorVersion, o.requiredRevision);
		if (hasReqestedVersion)
			daoAPI.buildPushdown(o);
		else
			e.innerHTML=o.defaultGIF;
	}else if(!blacklist){
		daoAPI.buildPushdown(o);
	}else{
		e.innerHTML=o.defaultGIF;	
	}
	
}

daoAPI.runPushdown = function(){
	if(daoAPI.pushArray.length!=0){
		for(x=0;x<daoAPI.pushArray.length;x++){
			daoAPI.launchPushdown(daoAPI.pushArray[x]);
		}
	}
}

daoAPI.buildCollapse = function(o){
	if(o.collapseLoad){
		o.collapseLoad = false;
	}
	
	// Kill Auto Collapse if called beforehand
	clearTimeout(daoAPI.pushAutoCollapseTimeout);	
	
	if(!o.collapseLoadBool){
		// reload tracking gif to track the expand action
		document.getElementById(o.imgTrackId).src=o.collapseImpTrack;
		if(o.thirdPartyCollapse)
			document.getElementById(o.thirdPartyImgTrackId).src=o.thirdPartyCollapse;
	}else{
		o.collapseLoadBool = false;
	}
	// Set the User Preference cookie if this is a 24/7 Expand and cookies are enabled
	if(o.twentyfourSevenExpand && navigator.cookieEnabled){
		// Create the cookie for 24/7 Expand
		var cookie = new daoAPI.Cookie("cbsPushdown"+o.objKey);
		// Find the Domain of the Current Site
		var dm = document.domain.split('.');
		var ckAttr = dm[dm.length-2]+'.'+dm[dm.length-1];
		// Set user preference to 0 = collapsed
		cookie.userPref = 0;
		// Store the cookie data
		cookie.store(1,"/",ckAttr);		
	}
	// Adjust FIF iframe and parent element to fix display problems with some sites
	if(daoAPI.inFIF){
		var fe = frameElement;
		var pe = fe.parentNode;
		fe.style.display="block";
		// ADD 10 PIXELS FOR AD OVERGIF
		var frameHeight = o.baseHeight + 10;
		fe.style.height=frameHeight+"px";
		pe.style.height=frameHeight+"px";
		fe.style.width=o.expandWidth+"px";
		pe.style.width=o.expandWidth+"px";
		pe.style.margin="auto";
	}			
	
	// Identify parent element
	var e = document.getElementById(o.id);
	// center parent element
	e.style.margin="auto";
	// fix height
	e.style.height=o.baseHeight+"px";
	
	// check for SWFs
	var swfPattern1 = /(\.swf)$/;	
	var swfPattern2 = /(\.SWF)$/;	
	
	if(o.baseAsset.match(swfPattern1) || o.baseAsset.match(swfPattern2)){
		// clear previous content in parent element
		e.innerHTML = "";
		// build HTML string for new content
		var objSwfHtml = "<object id='"+o.id+"SWF' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' height='" +o.baseHeight+"' width='"+o.baseWidth+"'>";
		objSwfHtml += "<param name='type' value='application/x-shockwave-flash' />";
		objSwfHtml += "<param name='name' value='"+o.id+"SWF' />";
		objSwfHtml += "<param name='allowScriptAccess' value='always' />";
		objSwfHtml += "<param name='quality' value='high' />";
		objSwfHtml += "<param name='movie' value='"+o.baseAsset+"' />";
		objSwfHtml += "<param name='wmode' value='"+o.wmode+"' />";
		objSwfHtml += "<param name='bgcolor' value='#ffffff' />";
		objSwfHtml += "<param name='flashvars' value='"+o.flashVarsBase+"' />";
		objSwfHtml += '<embed name="'+o.id+'SWF" src="'+o.baseAsset+'" wmode="'+o.wmode+'" quality="high" bgcolor="#ffffff" width="'+o.baseWidth+'" height="'+o.baseHeight+'" salign="tl" allowFullScreen="false" align="top" allowScriptAccess="always" FlashVars="'+o.flashVarsBase+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';	    
		objSwfHtml += "</object>";
		// build DIV element to hold and position HTML content
		var objSwfContainer = document.createElement("div");
		objSwfContainer.style.width=o.baseWidth+"px";
		objSwfContainer.style.height=o.baseHeight+"px";
		// set alignment
		if(o.baseAlign=="right"){
			objSwfContainer.style.cssFloat="right";
			objSwfContainer.style.styleFloat="right";			
			e.style.textAlign="right";
		}else if(o.baseAlign=="left"){
			objSwfContainer.style.cssFloat="left";
			objSwfContainer.style.styleFloat="left";			
			e.style.textAlign="left";
		}else{
			objSwfContainer.style.margin="auto";
		}
		objSwfContainer.id=o.id+"Container";
		objSwfContainer.innerHTML = objSwfHtml;
		e.appendChild(objSwfContainer);	
	}else{
		e.innerHTML = "";
		var tempHTML = '<a onClick="cbsiPushdownV3('+o.objKey+'); return false;" href="#"><img src="'+o.baseAsset+'" width="'+o.baseWidth+'" height="'+o.baseHeight+'" border=0></a>';
		var objJPGContainer = document.createElement("div");
		objJPGContainer.style.display="block";
		objJPGContainer.style.width=o.baseWidth+"px";
		objJPGContainer.style.height=o.baseHeight+"px";
		e.style.height=o.baseHeight+"px";	
		objJPGContainer.style.margin="auto";			
		e.appendChild(objJPGContainer);
		objJPGContainer.innerHTML = tempHTML;
	}
}

daoAPI.buildAuto = function(o){

	if(daoAPI.inFIF){
		var fe = frameElement;
		var pe = fe.parentNode;
		fe.style.display="block";			
		// ADD 10 PIXELS FOR AD OVERGIF
		var frameHeight = o.expandHeight + 10;
		fe.style.height=frameHeight+"px";			
		pe.style.height=frameHeight+"px";
		fe.style.width=o.expandWidth+"px";			
		pe.style.width=o.expandWidth+"px";
		pe.style.margin="auto";
	}

	// reload tracking gif to track the expand action
	document.getElementById(o.imgTrackId).src=o.autoExpandImpTrack;
	if(o.thirdPartyAutoExpand)
		document.getElementById(o.thirdPartyImgTrackId).src=o.thirdPartyAutoExpand;
		
	// Identify parent element
	var e = document.getElementById(o.id);
	// center parent element
	e.style.margin="auto";
	// fix height
	e.style.height=o.expandHeight+"px";
	
	// check for SWFs
	var swfPattern1 = /(\.swf)$/;	
	var swfPattern2 = /(\.SWF)$/;
	
	if(o.autoExpandAsset.match(swfPattern1) || o.autoExpandAsset.match(swfPattern2)){
			e.innerHTML = "";
            var objSwfHtml = "<object id='"+o.id+"SWF' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' height='" +o.expandHeight+"' width='"+o.baseWidth+"'>";
            objSwfHtml += "<param name='type' value='application/x-shockwave-flash' />";
            objSwfHtml += "<param name='name' value='"+o.id+"SWF' />";
            objSwfHtml += "<param name='allowScriptAccess' value='always' />";
            objSwfHtml += "<param name='quality' value='high' />";
            objSwfHtml += "<param name='movie' value='"+o.autoExpandAsset+"' />";
            objSwfHtml += "<param name='wmode' value='"+o.wmode+"' />";
            objSwfHtml += "<param name='bgcolor' value='#ffffff' />";
            objSwfHtml += "<param name='flashvars' value='"+ o.flashVarsAuto+"' />";
	    objSwfHtml += '<embed name="'+o.id+'SWF" src="'+o.autoExpandAsset+'" wmode="'+o.wmode+'" quality="high" bgcolor="#ffffff" width="'+o.baseWidth+'" height="'+o.expandHeight+'" salign="tl" allowFullScreen="false" align="top" allowScriptAccess="always" FlashVars="'+o.flashVarsAuto+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';	    
            objSwfHtml += "</object>";
            var objSwfContainer = document.createElement("div");
			objSwfContainer.style.display="block";
			objSwfContainer.style.width=o.baseWidth+"px";
			objSwfContainer.style.height=o.expandHeight+"px";
			objSwfContainer.style.margin="auto";
			objSwfContainer.style.align="center";			
            objSwfContainer.id=o.id+"Container";
            objSwfContainer.innerHTML = objSwfHtml;
            e.appendChild(objSwfContainer);
			e.style.height=o.expandHeight+"px";
	}else{
		e.innerHTML = "";		
		var tempHTML = '<img src="'+o.autoExpandAsset+'" width="'+o.baseWidth+'" height="'+o.expandHeight+'" border=0 usemap="#closeButton">';
		tempHTML += '<map name="closeButton"><area shape="rect" coords="910,0,970,30" href="#" alt="Close Ad" onClick="daoAPI.closePushdown();return false;" /><area shape="rect" coords="0,0,909,30" href="'+o.jpgAutoLink+'" alt="Click Here!"  target="_blank" /><area shape="rect" coords="0,31,970,418" href="'+o.jpgAutoLink+'" alt="Click Here!" target="_blank" /></map>';
		var objJPGContainer = document.createElement("div");
		objJPGContainer.style.display="block";
		objJPGContainer.style.width=o.baseWidth+"px";
		objJPGContainer.style.height=o.expandHeight+"px";
		e.style.height=o.expandHeight+"px";			
		objJPGContainer.style.margin="auto";			
		e.appendChild(objJPGContainer);
		objJPGContainer.innerHTML = tempHTML;
	}	
}

daoAPI.buildUser = function(o){

		if(daoAPI.inFIF){
			var fe = frameElement;
			var pe = fe.parentNode;
			fe.style.display="block";			
			// ADD 10 PIXELS FOR AD OVERGIF
			var frameHeight = o.expandHeight + 10;
			fe.style.height=frameHeight+"px";			
			pe.style.height=frameHeight+"px";
			fe.style.width=o.expandWidth+"px";			
			pe.style.width=o.expandWidth+"px";
			pe.style.margin="auto";
		}

	// Set the User Preference cookie if this is a 24/7 Expand and cookies are enabled
	if(o.twentyfourSevenExpand && navigator.cookieEnabled){
		// Create the cookie for 24/7 Expand
		var cookie = new daoAPI.Cookie("cbsPushdown"+o.objKey);
		// Find the Domain of the Current Site
		var dm = document.domain.split('.');
		var ckAttr = dm[dm.length-2]+'.'+dm[dm.length-1];
		// Set user preference to 0 = collapsed
		cookie.userPref = 1;
		// Store the cookie data
		cookie.store(1,"/",ckAttr);		
	}		
		
	// Identify parent element
	var e = document.getElementById(o.id);
	// center parent element
	e.style.margin="auto";
	// fix height
	e.style.height=o.expandHeight+"px";

	// reload tracking gif to track the expand action
	document.getElementById(o.imgTrackId).src=o.expandImpTrack;
	if(o.thirdPartyExpand)
		document.getElementById(o.thirdPartyImgTrackId).src=o.thirdPartyExpand;
		
	// check for SWFs
	var swfPattern1 = /(\.swf)$/;	
	var swfPattern2 = /(\.SWF)$/;		
	
	// JPG ASSET
	if(o.userExpandAsset.match(swfPattern1) || o.userExpandAsset.match(swfPattern2)){
		// clear previous content
		e.innerHTML = "";
		var objSwfHtml = "<object id='"+o.id+"SWF' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' height='" +o.expandHeight+"' width='"+o.expandWidth+"'>";
		objSwfHtml += "<param name='type' value='application/x-shockwave-flash' />";
		objSwfHtml += "<param name='name' value='"+o.id+"SWF' />";
		objSwfHtml += "<param name='allowScriptAccess' value='always' />";
		objSwfHtml += "<param name='quality' value='high' />";
		objSwfHtml += "<param name='movie' value='"+o.userExpandAsset+"' />";
		objSwfHtml += "<param name='wmode' value='"+o.wmode+"' />";
		objSwfHtml += "<param name='bgcolor' value='#ffffff' />";
		objSwfHtml += "<param name='flashvars' value='"+ o.flashVarsExpand+"' />";
	objSwfHtml += '<embed name="'+o.id+'SWF" src="'+o.userExpandAsset+'" wmode="'+o.wmode+'" quality="high" bgcolor="#ffffff" width="'+o.expandWidth+'" height="'+o.expandHeight+'" salign="tl" allowFullScreen="false" align="top" allowScriptAccess="always" FlashVars="'+o.flashVarsExpand+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		objSwfHtml += "</object>";
		var objSwfContainer = document.createElement("div");
		objSwfContainer.style.width=o.expandWidth+"px";
		objSwfContainer.style.height=o.expandHeight+"px";
		objSwfContainer.style.margin="auto";
		objSwfContainer.id=o.id+"Container";
		objSwfContainer.innerHTML = objSwfHtml;
		e.appendChild(objSwfContainer);
	// SWF ASSET
	}else{
		// CLEAR TARGET DIV CONTENT
		e.innerHTML = "";
		// BUILD INNER HTML
		var tempHTML = '<img src="'+o.userExpandAsset+'" width="'+o.baseWidth+'" height="'+o.expandHeight+'" border=0 usemap="#closeButton">';
		tempHTML += '<map name="closeButton"><area shape="rect" coords="910,0,970,30" href="#" alt="Close Ad" onClick="daoAPI.closePushdown();return false;" /><area shape="rect" coords="0,0,909,30" href="'+o.jpgUserLink+'" alt="Click Here!"  target="_blank" /><area shape="rect" coords="0,31,970,418" href="'+o.jpgUserLink+'" alt="Click Here!" target="_blank" /></map>';
		var objJPGContainer = document.createElement("div");
		objJPGContainer.style.display="block";
		objJPGContainer.style.width=o.baseWidth+"px";
		objJPGContainer.style.height=o.expandHeight+"px";
		e.style.height=o.expandHeight+"px";			
		objJPGContainer.style.margin="auto";			
		e.appendChild(objJPGContainer);
		objJPGContainer.innerHTML = tempHTML;
	}
}

daoAPI.buildPushdown = function(o){

	// Backdoor key to kill Auto Expand
	if(o.killAutoExpand==undefined)
		o.killAutoExpand=false;
	// Set Frequency Capping
	if(o.pdFreqCap==undefined)
		o.pdFreqCap = 1;		
	// Set Z-Index
	if(o.zIndex==undefined)
		o.zIndex = 10;
	if(o.wmode==undefined)
		o.wmode = "transparent";
	if(o.twentyfourSevenExpand==undefined)
		o.twentyfourSevenExpand = false;
	// Backwards compatability for Expand Width value
	if(o.expandWidth==undefined)
		o.expandWidth = o.baseWidth;	
	o.collapseLoad = false;	
	o.ads_serveUser = true;
	
	if(navigator.cookieEnabled && !o.killAutoExpand) {  // if cookies enabled and auto-expand enabled
	
		// IAB Billboard Package - 24/7 Expand
		if(o.twentyfourSevenExpand){
			// Create the cookie for 24/7 Expand
			var cookie = new daoAPI.Cookie("cbsPushdown"+o.objKey);
			// Find the Domain of the Current Site
			var dm = document.domain.split('.');
			var ckAttr = dm[dm.length-2]+'.'+dm[dm.length-1];
			// Check for existing cookied user preference
			// if none exist, creative one 
			if(!cookie.userPref){
				// 1 = expand, 0 = collapse
				cookie.userPref = 1;
				// Store the cookie data
				cookie.store(1,"/",ckAttr);
			}
			// If set to 0 = no expand
			if(cookie.userPref == 0){
				o.ads_serveUser = false;
				o.collapseLoad = true;
			// else expand
			}else{
				o.ads_serveUser = true;
			}		
		// Regular Pushdown Behavior
		}else{
			// Create the cookie for Pushdown Limiter
			var cookie = new daoAPI.Cookie("adsPDLimit"+o.objKey);
			// Find the Domain of the Current Site
			var dm = document.domain.split('.');
			var ckAttr = dm[dm.length-2]+'.'+dm[dm.length-1];
			// Check for existing cookie Timestamp
			if (!cookie.pdTimestamp){
				// if not, set one
				var ads_pdNow = new Date(); // Create an object holding the current date and time
				cookie.pdTimestamp = ads_pdNow.getTime();												
				cookie.pdVisits = 1;
				// Store the cookie data
				cookie.store(1,"/",ckAttr);
				// If this is an AutoPushdown, set the Takeover Variable for CBS Sports
				// Detect for cbsi global var
				if(typeof(cbsiadGlobal)=="undefined")
					cbsiadGlobal = {};
				// set Takeover var to 1
				cbsiadGlobal.has_takeover=1;
				o.collapseLoad = true;
			// If there is a Cookie set already
			}else{
				// Get the Current Timestamp
				var ads_pdNow = new Date(); // Create an object holding the current date and time				
				cookie.pdVisits++;
				// cookie is good for 24 hours
				if(((ads_pdNow.getTime() - cookie.pdTimestamp)/(1000*60*60))<24 && cookie.pdVisits>o.pdFreqCap){
					o.ads_serveUser = false;
					o.collapseLoad = true;
					// Or reset Timestamp, run pushdown
				} else {
					//Get Current Time
					cookie.pdTimestamp = ads_pdNow.getTime();
					// If this is an AutoPushdown, set the Takeover Variable for CBS Sports
					// Detect for cbsi global var
					if(typeof(cbsiadGlobal)=="undefined")
						cbsiadGlobal = {};
					// set Takeover var to 1
					cbsiadGlobal.has_takeover=1;					
				}
				// Store the cookie data
				cookie.store(1,"/",ckAttr);
			}
		}
	}else {  // no cookie support
			o.ads_serveUser = false;
			o.collapseLoad = true;
	}
			
	// FLASH IMPRESSION
	if(o.needFlash)
		document.getElementById(o.flashTrackId).src=o.flashImpTrack;

	// IAB Billboard Package - 24/7 Expand
	if(o.twentyfourSevenExpand){	
		if(o.ads_serveUser){
			daoAPI.buildUser(o);	
		}else{
			o.collapseLoadBool = true;	
			daoAPI.buildCollapse(o);
		}
	// Standard Pushdown
	}else{
		// AUTO EXPAND
		if(o.ads_serveUser){
			daoAPI.buildAuto(o);
			// AUTO COLLAPSE
			daoAPI.pushAutoCollapseTimeout=setTimeout(daoAPI.pushAutoCollapse,o.autoCollapseTimer);	
		// COLLAPSE
		}else{
			o.collapseLoadBool = true;	
			daoAPI.buildCollapse(o);
		}
	}
}

daoAPI.pushAutoCollapse = function(){
	for(x=0;x<daoAPI.pushArray.length;x++){
		var e = document.getElementById(daoAPI.pushArray[x].id);
		daoAPI.buildCollapse(daoAPI.pushArray[x]);	
	}
	// Kill Auto Collapse if called beforehand
	clearTimeout(daoAPI.pushAutoCollapseTimeout);	
}

function cbsiPushupV3(key){
	for(x=0;x<daoAPI.pushArray.length;x++){
		if(key){
			if(key==daoAPI.pushArray[x].objKey){
				var e = document.getElementById(daoAPI.pushArray[x].id);
				daoAPI.buildCollapse(daoAPI.pushArray[x]);
			}
		}else{
			var e = document.getElementById(daoAPI.pushArray[x].id);
			daoAPI.buildCollapse(daoAPI.pushArray[x]);		
		}
	}
}

function cbsiPushdownV3(key){

	// Kill Auto Collapse if called beforehand
	clearTimeout(daoAPI.pushAutoCollapseTimeout);

	for(x=0;x<daoAPI.pushArray.length;x++){
		if(key){
			if(key==daoAPI.pushArray[x].objKey){
				var e = document.getElementById(daoAPI.pushArray[x].id);
				daoAPI.buildUser(daoAPI.pushArray[x]);
			}
		}else{
			var e = document.getElementById(daoAPI.pushArray[x].id);
			daoAPI.buildUser(daoAPI.pushArray[x]);		
		}
	}
}

function cbsiStopCollapse(key){
	daoAPI.stopCollapse();
}

daoAPI.stopCollapse= function(){
	// Kill Auto Collapse if called beforehand
	clearTimeout(daoAPI.pushAutoCollapseTimeout);
}

daoAPI.closePushdown = function(){
	for(x=0;x<daoAPI.pushArray.length;x++){
		var e = document.getElementById(daoAPI.pushArray[x].id);
		daoAPI.buildCollapse(daoAPI.pushArray[x]);		
	}
	// Kill Auto Collapse if called beforehand
	clearTimeout(daoAPI.pushAutoCollapseTimeout);
}

// RUNTIME CODE
// Check to see if this is an Ajax Friendly IFrame Environment
daoAPI.inFIF = false;

if ( typeof(inDapIF) == "undefined" && typeof(inFIF) == "undefined" ) {
    // Action to take if variableName is not defined - NO ACTION
} else {
	// Action to take if variableName *is* defined
	daoAPI.inFIF = true;
}

if(!daoAPI.pushArraySetTimeout)
	daoAPI.pushArraySetTimeout=setTimeout(daoAPI.runPushdown,0);
	

