
<!--

//DESIGN VARIABLES
var cp47438 = 'http://cdn.eyewonder.com/100125//adWdrDemos/47438/';
var ew_adFile_Proxy = cp47438+"exp_TestAndShow.html";

var ew_isIFrame = false;	// iframe detection turned off for this site
var ew_interimFile = "";
	

//TRACKING VARIABLES
// From include/tracking.xslt
// HTML for impressions tracking
var impressionTracker47438 = '<div style="position:absolute;top:0x;left:0px;z-index:0"><img src="'+cp47438+'ewtrack.gif?noCache='+new Date().getTime()+'" border=0 width=1 height=1></div>';
// HTML for tracking when the flash shows and there is no failover)
var flashTracker47438 = '<div style="position:absolute;top:0px;left:0px;z-index:0"><img src="'+cp47438+'ewtrack_v.gif?noCache='+new Date().getTime()+'" border="0" width="1" height="1"></div>';
// HTML for tracking when failing over to flash
var flashfailoverTracker47438 = '<div style="position:absolute;top:0px;left:0px;z-index:0"><img src="'+cp47438+'ewtrack_ff.gif?noCache='+new Date().getTime()+'" border="0" width="1" height="1"></div>';
// HTML for tracking when failing over to an image
var failoverTracker47438 = '<div style="position:absolute;top:0px;left:0px;z-index:0"><img src="'+cp47438+'ewtrack_f.gif?noCache='+new Date().getTime()+'" border="0" width="1" height="1"></div>';
// HTML for failover reason being the browser
var failoverReasonBrowserTracker47438 = '<div style="position:absolute;top:0px;left:0px;z-index:0"><img src="'+cp47438+'ewtrack_rb.gif?noCache='+new Date().getTime()+'" border="0" width="1" height="1"></div>';
// HTML for failover reason being flash
var failoverReasonFlashTracker47438 = '<div style="position:absolute;top:0px;left:0px;z-index:0"><img src="'+cp47438+'ewtrack_rf.gif?noCache='+new Date().getTime()+'" border="0" width="1" height="1"></div>';
// Expiration count versions of the _f, _ff, and _v trackers for AIM and ICQ cookie versions
function flashTrackerCache47438(expCount) {
	return '<div style="position:absolute;top:0x;left:0px;z-index:0"><img src="'+cp47438+'ewtrack_v'+expCount+'.gif?noCache='+new Date().getTime()+'" border=0 width=1 height=1></div>';
}
function flashfailoverTrackerCache47438(expCount) {
	return '<div style="position:absolute;top:0x;left:0px;z-index:0"><img src="'+cp47438+'ewtrack_ff'+expCount+'.gif?noCache='+new Date().getTime()+'" border=0 width=1 height=1></div>';
}
function failoverTrackerCache47438(expCount) {
	return '<div style="position:absolute;top:0x;left:0px;z-index:0"><img src="'+cp47438+'ewtrack_f'+expCount+'.gif?noCache='+new Date().getTime()+'" border=0 width=1 height=1></div>';
}
// For AOL Chat
function secondExposureTrackerCache47438(expCount) {
	return '<div style="position:absolute;top:0x;left:0px;z-index:0"><img src="'+cp47438+'ewtrack_s'+expCount+'.gif?noCache='+new Date().getTime()+'" border=0 width=1 height=1></div>';
}

// Send out the current location
function ew_urlTracker()
{
	var currentURL;
	if (typeof(ew_isIFrame) != "undefined" && ew_isIFrame==true)
		currentURL = escape(document.referrer);
	else
		currentURL = escape(window.location.toString());
	
	return  '<div style="position:absolute;top:0px;left:0px;z-index:0"><img src="'+cp47438+'ewtrack_url.gif?noCache='+new Date().getTime()+'&id=47438&url='+currentURL+'" border="0" width="1" height="1"></div>';
}

	

// Log the URL for troubleshooting purposes
document.writeln(ew_urlTracker());

document.write(impressionTracker47438);


if (ew_isIFrame)
{
	var ew_containsHTTP = (( ew_interimFile.indexOf("http://") > -1 ) || 
				( ew_interimFile.indexOf("https://") > -1 ));
	if (!ew_containsHTTP)
	{	
		var ref = document.referrer;
		var host='';
		if(ref == '') {
			host = 'http://'+document.domain; 
		}
		else {
			var pos1 = ref.indexOf("://");
			if (pos1 != -1) {
				pos2 = ref.indexOf("/", pos1+3);
				host = ref.substring(0, pos2);
			}
		}
	
		if(ew_interimFile.indexOf('/')==0) {
			ew_interimFile = host+ew_interimFile; 
		}
		else {
			ew_interimFile = host+'/'+ew_interimFile;
		}

	}
}

//AUTHENTICATION
// From include/authentication.xslt
var ua = ' ' + navigator.userAgent.toLowerCase();
var isIe = (ua.indexOf('msie') >= 0);
var isNav4 = ((ua.indexOf('mozilla') >= 0) && (ua.indexOf('compatible') == -1) && (parseInt(navigator.appVersion) < 5));
var isWin = (ua.indexOf('win') >= 0);
var isMac = (ua.indexOf('mac') >= 0);
//Opera
var isOpera = (ua.indexOf('opera') > 0);
if (isOpera)	// Opera's string is almost identical to IE's
	isIe = false;
//KHTML browsers
var isSafari = (ua.indexOf('applewebkit') > 0);
var isKonqueror = (ua.indexOf('konqueror')>0);
// GECKO(Mozilla) browsers
// isGecko will also include Netscape 6+, Epiphany, Galeon, Camino, K-Meleon, etc
// safari says (like gecko) in it's UA string, but safari uses KHTML engine
var isGecko = (ua.indexOf('gecko/') > 0);	
	
// Check how old the gecko version is for the part following "gecko/" in the UA string
var geckoDate;
var geckoRevisionString;
var geckoRevision;
var geckoRevisionMajor;
var geckoRevisionMinor;
if (isGecko)
{
	function ew_getGeckoRevisionString(ua)	// Keep temp variables from being placed into window object
	{
		var tempStr = ua.split("rv:");
		return tempStr[1].split(")")[0];
	}

	geckoRevisionString = ew_getGeckoRevisionString(ua);
	geckoRevision = parseFloat(geckoRevisionString);
	geckoRevisionMajor=parseFloat(geckoRevisionString.split(".")[0] )
	geckoRevisionMinor=parseFloat(geckoRevisionString.split(".")[1]+ "." + geckoRevisionString.split(".")[2])
	geckoDate = parseInt(ua.substr(ua.indexOf('gecko/')+6,8));
}
var ieVersion;
if (isIe)
{
	ieVersion = ua.substr(ua.indexOf('msie')+5,4);
	if (ieVersion.indexOf(';') > 0)
		ieVersion = ieVersion.substr(0,3);
}
var operaVersion
if (isOpera)
{
	operaVersion = ua.substr(ua.indexOf('opera')+6,4);
}
var weSupport = false;
var failReason = "browser";	// Reason we failed over

var plugin = false;	// Flash 7 or up
var isFlash8up = false;
var isFlashFailover = false;	// Flash 6

// Check Flash info

if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])
	plugin = (navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin);

if (plugin)
{
	plugin = navigator.plugins["Shockwave Flash"];
	var ver = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1));
	isFlash8up = (ver>=8);
	plugin = (ver>=7);
	isFlashFailover = (ver>=6);
}
else if(isIe && isWin)
{
	document.writeln('<SCR'+'IPT LANGUAGE="VBScript"\>'); // Hide this from IE4.5 Mac by splitting the tag
	document.writeln('On Error Resume Next');
	document.writeln('isFlash8up=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))');
	document.writeln('plugin=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))');
	document.writeln('isFlashFailover=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))');
	document.writeln('</SCR'+'IPT\>');
	
	if (isFlash8up){
		var swf = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.8").GetVariable("$version");
		var ver = parseInt(swf.substring(swf.indexOf(",")-1));
		isFlash8up = (ver>=8);
	}

}
else
	plugin = false;

	
	
// Do a an exclusive check for support to protect page contents for rare and untested browsers
if(isGecko || isSafari || (isIe && isWin && ieVersion >= 5.5) || (isOpera && operaVersion >= 7)) 
{
	// Support Mozilla-based browsers (i.e. Firefox), Safari Mac, 
	// and IE browsers (IE 5.5+/Win and AOL Explorer), and Opera > 7
	failReason = "none";
	weSupport = true;

	// Do we support Flash 7?
	if (!plugin)
	{
		weSupport = false;
		failReason = "flash";
	}
}
else
{
	// Still attempt a flash failover if browser isn't supported
	failReason = "browser"
	weSupport = false;
}

// Authentication information - Use javascript:alert(ew_AuthInfo())
function ew_AuthInfo()
{
	var newline = "\r\n";
	var ew_AuthInfo = "Browser authentication info:" + newline
	+"ua=" + ua + newline
	+"isIe=" + isIe + newline
	+"isNav4=" + isNav4 + newline
	+"isWin=" + isWin + newline
	+"isMac=" + isMac + newline
	+"isOpera=" + isOpera + newline
	+"isSafari=" + isSafari + newline
	+"isKonqueror=" + isKonqueror + newline
	+"isGecko=" + isGecko + newline
	+"geckoDate=" + geckoDate + newline
	+"geckoRevision=" + geckoRevision + newline
	+"geckoRevisionMajor=" + geckoRevisionMajor + newline
	+"geckoRevisionMinor=" + geckoRevisionMinor + newline
	+"ieVersion=" + ieVersion + newline
	+"operaVersion=" + operaVersion + newline
	+"isFlashFailover=" + isFlashFailover + newline
	+"plugin=" + plugin  + newline
	+"isFlash8up=" + isFlash8up + newline
	+"weSupport=" + weSupport + newline
	+"failReason=" + failReason + newline;
	
	return ew_AuthInfo;
}

// Tracking to determine Flash 8 market penetration (remove when Flash 8+ has a > 95% penetration)
if (isFlash8up)
	document.write('<div style="position:absolute;top:0px;left:0px;z-index:0"><img src="'+cp47438+'ewtrack_8.gif?noCache='+new Date().getTime()+'" border="0" width="1" height="1"></div>');

	
// We support expandables in Opera 8+ for JS ads & Opera 9+ for Iframe Ads
if (isOpera)
{
	failReason = "browser";
	weSupport = false;
	if ((operaVersion >= 8 && !ew_isIFrame) || (operaVersion >= 9))
	{
		weSupport = true;
		failReason = "none";
	}
}

//CUSTOM FUNCTIONS


// FLASH8
var ew47438_flvNames = "Amityville_homesweethome,Amityville_somethingevil,Amityville_getout";
var ew47438_creativeName = "amityville336x280userAudio.swf";
var ew47438_swfVersion = 7;




//FLASH VARS
var ewflashvars47438 = 'ewbase='+cp47438
	+ '&bwfile=bwtest.swf'
	+ '&creative=' + ew47438_creativeName
	+ '&vLength=,,'
	+ '&bw=56,90,135,300,450,600'
	+ '&buf=5,4,3,2,2,2'
	+ '&flv=' + ew47438_flvNames
	+ '&flvId=0'
	+ '&aInit=user'
	+ '&vInit=host'
	+ '&adId=47438'
	+ '&adMode=prog'
	+ '&trkUrl=http://cdn.eyewonder.com/100125/'
	+ '&swfVersion=' + ew47438_swfVersion
	+ '&clickTag1='+escape(clickTag1)
	+ '&clickTag2='+escape(clickTag2)
	+'';

//EXPAND FUNCTIONS
var ew47438_isOverflowHidden = false;

var ew_maxZIndex = 2147483647;	
var ew47438_minZIndex = 10000; // All z-indexes for the ad need to be above this for the site placement
var ew47438_saveZIndex;

function ew_checkOverflowHidden47438() 
{
 		
 	var tempNode = document.getElementById("ew_BannerDiv47438").parentNode;
	
	while (tempNode!=null && (tempNode.tagName != "BODY"))
	{
		var computedOverflow;
		if (isIe)
			computedOverflow = tempNode.currentStyle.overflow;
		else
			computedOverflow = document.defaultView.getComputedStyle(tempNode,"").getPropertyValue("overflow");
		if (computedOverflow == "hidden")
			return true;
		 tempNode = tempNode.parentNode;
	}
	
	return false;
}



function ew_modifyOverflow47438()
{
	   
	var tempNode = document.getElementById("ew_BannerDiv47438").parentNode;
	   
	if (isGecko)	// This workaround doesn't work yet in IE 5.5 and Safari 1.3
	{
		while (tempNode!=null && (tempNode.tagName != "BODY"))
		{
			var computedDisplay;
			if (isIe)
				computedDisplay = tempNode.currentStyle.display;
			else
				computedDisplay = document.defaultView.getComputedStyle(tempNode,"").getPropertyValue("display");
			if ((computedDisplay == "block") || (computedDisplay == "table-cell"))
			{
				var computedOverflow;
				if (isIe)
					computedOverflow = tempNode.currentStyle.overflow;
				else
					computedOverflow = document.defaultView.getComputedStyle(tempNode,"").getPropertyValue("overflow");
				if (computedOverflow == "hidden")
				{
					// Change overflow
					tempNode.style.overflow="visible";
				}
			}
			tempNode=tempNode.parentNode;
   		}
	}
}


function ew_modifyZIndex47438()
{
	
    if (isIe)
    {
		var count = 0;
		var tempElement = document.getElementById("ew_BannerDiv47438").parentElement; 
		// Safari also handles parentElement DOM object, unfortunately
		if (tempElement!=null) 
		{
		      // ew47438_saveZIndex is used to save the z-indexes before they are changed
			ew47438_saveZIndex = new Array();
			while (tempElement!=null && tempElement.tagName != "BODY")
			{
				computedDisplay = tempElement.currentStyle.display;
				if ((computedDisplay == "block") || (computedDisplay == "table-cell"))
				{
					if (tempElement.currentStyle.zIndex==0)
					{
						// Save the z-index here
						var tempPair=new Array(2);
						tempPair[0] = tempElement;
						tempPair[1] = tempElement.currentStyle.zIndex;
						ew47438_saveZIndex[count] = tempPair;
						count++;
						// Now change it
						tempElement.style.zIndex=1;
					}
				}
				tempElement=tempElement.parentElement;
			}
		}

	}
}

function ew_restoreZIndex47438()
{

	// IE6/5.5 restore the values saved in ew_expand
	if (ew47438_saveZIndex != null)
	{
		// restore the backed up zIndex values
		for (i = 0; i < ew47438_saveZIndex.length; i++)
		{
			var tempPair = ew47438_saveZIndex[i];
			var tempElement = tempPair[0];
			var tempZIndex = tempPair[1];
			//alert("resetting z-index to " + tempZIndex);
			if (tempElement != null)	// Is the element still on the page?
			{
				tempElement.style.zIndex = tempZIndex;
			}
		}

		ew47438_saveZIndex = null;	// delete the array
	}
}

function ew_contract47438()
{
	
		
	if (isIe)
		ew_restoreZIndex47438();
				
	if(isIe)
		document.getElementById('ew_shim47438').style.clip = "rect(0px 480px 280px 144px)";
	document.getElementById('ew_FlashDiv47438').style.clip = "rect(0px 480px 280px 144px)";
}

function ew_expand47438()
{
	
	
	if (isIe)
		ew_modifyZIndex47438();

	if(isIe)
		document.getElementById('ew_shim47438').style.clip = "rect(0px 480px 280px 0px)";	
	document.getElementById('ew_FlashDiv47438').style.clip = "rect(0px 480px 280px 0px)";
	document.getElementById('trackingImage47438').src = cp47438+'ewtrack_m.gif?noCache='+new Date().getTime();
}




var flashHTML47438='<div id="ew_BannerDiv47438" style="visibility: visible; position: relative; width:336px; height:280px; z-index: ' + ew47438_minZIndex + '">'

	+'</div>';

//EYEWONDER FLASH OBJECT
var flashHTMLonLoad47438='<div id="ew_FlashDiv47438"  style="visibility: visible; position: absolute; top: -0px; left: -144px; width:480px; height:280px; clip: rect(0px 480px 280px 144px); z-index: ' + (ew47438_minZIndex+2) + '">'
	+'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="480" height="280" id="ewad47438" align="middle">'
	+'<param name="allowScriptAccess" value="always">'
	+'<param name="movie" value="'+cp47438+ew47438_creativeName+'">'
	+'<param name="quality" value="high">'
	+'<param name="bgcolor" value="#FFFFFF">'
	+'<param name="base" value="'+cp47438+'">'
	+'<param name="wmode" value="transparent">'
	+'<param name="FlashVars" value="'+ewflashvars47438+'" >'
	+'<embed src="'+cp47438+ew47438_creativeName+'" base="'+cp47438+'" wmode="transparent" quality="high" bgcolor="#FFFFFF" width="480" height="280" name="ewad47438" FlashVars="'+ewflashvars47438+'" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'
	+'</object>'
	+'</div>'
	+'<div style="position:absolute;top:0px;left:0px;z-index:0"><img src="'+cp47438+'dot.gif" id="trackingImage47438" width="1" height="1" border="0"></div>';

if(isIe)
	flashHTMLonLoad47438 +='<iframe id="ew_shim47438" src="about:blank" noresize="true" scrolling="no" display="none" frameborder=0 marginheight=0 marginwidth=0 style="filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);visibility: visible;position:absolute;top: -0px; left: -144px; width:480px; height:280px;clip: rect(0px 480px 280px 144px);z-index: ' + ew47438_minZIndex + '"></iframe>';


//EYEWONDER FLASH FAILOVER OBJECT
var flashfailoverHTML47438 ='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" width="336" height="280" id="ewfailad47438" align="middle">'
	+'<param name="allowScriptAccess" value="always">'
	+'<param name="movie" value="'+cp47438+'">'
	+'<param name="quality" value="high">'
	+'<param name="bgcolor" value="#FFFFFF">'
	+'<param name="FlashVars" value="clickTag='+escape(failclickTag)+'" >'
	+'<embed src="'+cp47438+'" quality="high" bgcolor="#FFFFFF" width="336" height="280" name="ewfaildesign" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" base="'+cp47438+'" pluginspage="http://www.macromedia.com/go/getflashplayer">'
	+'</object>';

//EYEWONDER FAILOVER
var failoverHTML47438 = '<a href="http://www.eyewonderlabs.com/ct.cfm?noCache=0&file=http://cdn.eyewonder.com/100125//adWdrDemos/47438/failover.jpg&eid=47438&name=Clickthru-failover&num=1&time=0&diff=0&click='+escape(failclickTag)+'" target="_blank"><img src="'+cp47438+'failover.jpg" border="0"></a>';

//IFRAME HTML (if ad served in IFrame)
if(ew_isIFrame) { 
	var iframeHTML47438 = '<iframe id="ew_expAd" border="0" width="336" height="280" noresize style="position: absolute; top: 0px; left: 0px;" '
	+ 'scrolling=No frameborder=0 marginheight=0 marginwidth=0 src="'
	+ ew_interimFile+'?url='+cp47438+'exp_Inc.js'
	+ '?interim='+escape(ew_interimFile)
	+ '&clickTag1='+escape(clickTag1)
	+ '&clickTag2='+escape(clickTag2)
	+ '&failclickTag='+escape(failclickTag)
	+ '&iframeURL='+escape(document.URL)
	+ '&cp='+escape(cp47438)
	+ '"></iframe>';
}

// CODE FOR HANDLING OVERFLOW:HIDDEN

//appends flash ad div to the banner div (called on page load)
function ew_onLoad47438() {
	if (isGecko && geckoRevisionMajor < 1)	// ew_CheckOverflowHidden doesn't work in Mozilla < 1.0
	{
		failReason = "browser"
		weSupport = false;
	}
	/* document.write is asynchronous, so the div has to be written before we can do
		document.getElementById in ew_checkOverflowHidden#### */
	if (weSupport)
		ew47438_isOverflowHidden = ew_checkOverflowHidden47438();
	// We don't support expandables when overflow:hidden is set on anything but Gecko
	// browsers (Mozilla >= 1.0 and Firefox, etc) and IE >= 6.0
	if (ew47438_isOverflowHidden && !(isGecko  || (isIe && (ieVersion >= 6.0)) || (isOpera && (operaVersion >= 8))))
	{
		failReason = "browser"
		weSupport = false;
	}
	if (weSupport)	// Do we still support the expandable?
	{
		if (ew47438_isOverflowHidden == true)	
			ew_modifyOverflow47438();
		// Note: Don't do two innerHTML statements or IE will give an error when hovering
		document.getElementById('ew_BannerDiv47438').innerHTML+=flashHTMLonLoad47438;
	}
	else
	{
		var failReasonTracker = "";
		// Reason for failover
		if (failReason == "browser")
			failReasonTracker = failoverReasonBrowserTracker47438;
		else if (failReason == "flash")
			failReasonTracker = failoverReasonFlashTracker47438;
		// Replace, don't append innerHTML (innerHTML= not innerHTML+=) to write out failovers because they are inline content
		if(isFlashFailover&&false) 
		{
			document.getElementById('ew_BannerDiv47438').innerHTML=flashfailoverHTML47438+flashfailoverTracker47438+failReasonTracker;
		}
		else 
		{
			document.getElementById('ew_BannerDiv47438').innerHTML=failoverHTML47438+failoverTracker47438+failReasonTracker;
		}
	}		
}
	
//SERVE THE APPROPRIATE FILE
if (weSupport) {
	if(ew_isIFrame) { 
		//serve the IFrame ad
		document.write(flashHTML47438);
		document.write(iframeHTML47438);
	}
	else {
		if (window.addEventListener) window.addEventListener("load",ew_onLoad47438,false);
		else if (window.attachEvent) window.attachEvent("onload",ew_onLoad47438);
		document.write(flashHTML47438);
		document.write(flashTracker47438);
	}
}
else { //serve failover
	
	if(isFlashFailover&&false) {
		document.write(flashfailoverHTML47438);
		document.write(flashfailoverTracker47438);
	}
	else {
		document.write(failoverHTML47438);
		document.write(failoverTracker47438);
	}
	// Reason for failover
	if (failReason == "browser")
		document.write(failoverReasonBrowserTracker47438);
	else if (failReason == "flash")
		document.write(failoverReasonFlashTracker47438);
}
//-->


