/* START ADOBE UTILITIES */
// Flash Player Version Detection - Rev 1.5
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
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;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	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];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
			var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		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;
	}
}
/* END ADOBE UTILITIES */


/* GLOBAL VARS FOR ALL EXPAND ADS */

// Boolean for all occurances of Expand. False is closed, True is open.
var ads_globalExpandState = false;

// Global Var to put all expand actions on hold until the current Expand Animation is done animating
var ads_globalOnHold = false;

// Boolean to put expand actions on hold while one expand is still active
var ads_globalRolloverActive = false;

// Remember the Node position of most recent expand
var ads_globalExpandObjNode;

// Remember the Node position for collapse
var ads_globalCollapseObjNode;

// Global for Delay Mouse Cursor - Most Recent Position
var ads_globalDelayRecentX;
var ads_globalDelayRecentY;

// Remember the key of most recent expand
var ads_globalCurrentKey;

// Remember the Rolloff key of most recent rollover expand
var ads_globalRolloffKey;

// Check to see if Expand Movie is available yet
var ads_globalExpandChecker = false;
var ads_globalExpandCheckerCount = 0;

// Global Timer Vars
var ads_globalTimerTimeout;
var ads_globalTimerInterval;
var ads_globalTimerReset;
var ads_globalCheckTimerInterval;
var ads_globalDelayTimerInterval;


/* END GLOBALS */

// UTILITY TO RETURN EXPAND OBJECT
function adsExpand_getObj(objKey){
	for (adsExpand_tempX = 0; adsExpand_tempX < ads_expObjArray.length; adsExpand_tempX++){
		if(ads_expObjArray[adsExpand_tempX].objKey == objKey)
			return ads_expObjArray[adsExpand_tempX];
	}
}
// UTILITY TO RETURN EXPAND ARRAY POSITION
function adsExpand_getObjNode(objKey){
	for (adsExpand_tempX = 0; adsExpand_tempX < ads_expObjArray.length; adsExpand_tempX++){
		if(ads_expObjArray[adsExpand_tempX].objKey == objKey)
			return adsExpand_tempX;
	}
}

// UTILITY TO RETURN FLASH OBJECT REFERENCE BASED ON BROWSER TYPE //
function getMovieName(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[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;
}


// EXPAND - REQUIRES EXPAND AS STRING AND KEY AS NUMBER
function cnetExpand(a, b) {

// New Component Tracking Class passes 1 variable - key
if(arguments.length==1){
	var key = a;
	var expand = null;
// Old Tracking Class passes expand and key
} else {
	var expand = a;
	var key = b;		
}

// Retrieve expand Obj to access all data
var expandObj = adsExpand_getObj(key);

if ( typeof(expandObj.adsExpand_expandType) == "undefined" ) {
	if(expand==null){
		expandObj.adsExpand_expandType = "click";
	} else {
		expandObj.adsExpand_expandType = expand;	
	}
}

if ( typeof(expandObj.adsExpand_collapseType) == "undefined" ) {
	if(expand==null){
		expandObj.adsExpand_collapseType = "click";
	} else if(expand=="rollover") {
		expandObj.adsExpand_collapseType = "rolloff";
	} else {
		expandObj.adsExpand_collapseType = "rolloff";
	}
}

// Do not initiate one expand until another has finished
// if (another expand ad is not animating its expand action) AND ((the expand type is rollover AND another expand is not open currently) OR (expand type is click))
if(!ads_globalOnHold && ((expandObj.adsExpand_expandType=="rollover" && (!ads_globalRolloverActive) || expandObj.adsExpand_expandType=="click"))){

	// if the expand ad is expanded do not expand
	if(!expandObj.expandState){
		
		// Global Var to put expand actions on hold till this expand has finished
		ads_globalOnHold = true;

		// Global Var to set most recent Expand
		ads_globalCurrentKey = key;

		// Retrieve Base Panel DIV Element to control it
		var baseDiv = document.getElementById(expandObj.adsExpand_parDiv);
		// Retrieve Expand Panel DIV Element to control it
		var expandDiv = document.getElementById(expandObj.adsExpand_childDiv);

		// find X position of base object
		expandObj.ads_hotspotXleft = ads_getX(baseDiv);
		// find y position of base object
		expandObj.ads_hotspotYtop = ads_getY(baseDiv);
		
		// DETERMINE BASE HOTSPOT COORDINATES
		// find left mouse position
			expandObj.ads_baseXleft = ads_getX(baseDiv);
		// find right mouse position by adding the base width to the left position 
			expandObj.ads_baseXright = expandObj.ads_baseXleft + expandObj.adsExpand_width;
		// find top mouse position by adding the top offset to the Base panel y position
			expandObj.ads_baseYtop = ads_getY(baseDiv);
		// find bottom mouse position by adding the expand height to the top position 
			expandObj.ads_baseYbottom = expandObj.ads_baseYtop + expandObj.adsExpand_height;	

		// DETERMINE EXPAND HOTSPOT COORDINATES
		// find left mouse position by adding the left offset to the Base panel x position
			expandObj.ads_expandXleft = expandObj.ads_baseXleft + expandObj.adsExpand_leftOffset;
		// find right mouse position by adding the Expand width to the left position 
			expandObj.ads_expandXright = expandObj.ads_expandXleft + expandObj.adsExpand_widthEx;			
		// find top mouse position by adding the top offset to the Base panel y position
			expandObj.ads_expandYtop = expandObj.ads_baseYtop + expandObj.adsExpand_topOffset;
		// find bottom mouse position by adding the expand height to the top position 
			expandObj.ads_expandYbottom = expandObj.ads_expandYtop + expandObj.adsExpand_heightEx;	

		// if the expand action is a mouse rollover, add 1 second delay
		if(expandObj.adsExpand_expandType=="rollover"){
			
			// Begin Auto-Detection for Delay
			ads_globalDelayRecentX = expandObj.ads_baseXleft;
			ads_globalDelayRecentY = expandObj.ads_baseYtop;
			ads_globalDelayTimerInterval=window.setInterval(ads_checkDelay, 100);

			ads_globalTimerTimeout=setTimeout(ads_checkDelayCoords, 1000);

		} else {
			ads_globalTimerTimeout=setTimeout(cnetExpandDelay, 0);
		}
	}
}
}

// EXPAND DELAY (the expand actions triggered after the initial delay)
function cnetExpandDelay(){

	// Detect Version of IE
	version = parseFloat(navigator.appVersion.split("MSIE")[1]);

	// Retrieve expand Obj to access all data
	var expandObj = adsExpand_getObj(ads_globalCurrentKey);

	// clear the one second delay routine if expand is a rollover
	if(expandObj.adsExpand_expandType=="rollover")
		window.clearInterval(ads_globalTimerInterval);

	// set global Expand state to open
	expandObj.expandState=true;	

	// Remove On Hold from global Var
	ads_globalOnHold = false;

	// IFrame Shim
	if ((version >= 5.5) && (version < 7) && (document.body.filters) && document.getElementsByTagName("select")) {	
		var shimName = expandObj.adsExpand_childDiv + "Shim";
		document.getElementById(shimName).style.display="block";
	}
	
	// IE requires special formatting for the clip property
	if(isIE && isWin && !isOpera){	
		// Unclip the Expand object so users can see and interact with it
		document.getElementById(expandObj.adsExpand_childDiv).style.clip="rect(0px "+expandObj.adsExpand_widthEx+"px "+expandObj.adsExpand_heightEx+"px 0px)";
	} else {
		// Unclip the Expand object so users can see and interact with it
		document.getElementById(expandObj.adsExpand_childDiv).style.clip="rect(0px,"+expandObj.adsExpand_widthEx+"px,"+expandObj.adsExpand_heightEx+"px,0px)";
	}

	
	// Set Expand DIV z-index to 9999 for proper layering
	document.getElementById(expandObj.adsExpand_parDiv).style.zIndex=4999;

	// get Base panel as an object and as a node position to determine its position on the page	
	var expandObj = adsExpand_getObj(ads_globalCurrentKey);
	
	ads_globalExpandObjNode = adsExpand_getObjNode(ads_globalCurrentKey);

	// SEND COMMAND TO EXPAND MOVIE
	// Create a fast Interval to look for the Expand Movie, if movie is found the expand command will be sent
	ads_globalCheckTimerInterval=window.setInterval(ads_checkExpand, 50);

	// reload tracking gif to track the expand action
	document.getElementById(expandObj.impTrack_name).src=expandObj.expandImpTrack;

	// If 3rd Party Expand Trackign supported
	if(expandObj.expandImpTrack3P){
		// reload tracking gif to track the expand action
		document.getElementById(expandObj.impTrack_name3P).src=expandObj.expandImpTrack3P;
	} 	
	
	// Initiate default mouse detection routine during expand
	if(expandObj.adsExpand_collapseType=="rolloff"){

		// Set a Rolloff Key for Auto-Collapse function
		ads_globalRolloffKey = ads_globalCurrentKey;

		// Set the Boolean to mark that Auto-Collapse is active
		ads_globalRolloverActive = true;

		// Begin Auto-Collapse
		ads_globalTimerInterval=window.setInterval(ads_checkMouse, 10);
	}
}

// COLLAPSE
function cnetCollapse(key) {

	// Detect Version of IE
	version = parseFloat(navigator.appVersion.split("MSIE")[1]);

	// get Base panel as an object and as a node position to determine its position on the page	
	var expandObj = adsExpand_getObj(key);
	var expandObjNode = adsExpand_getObjNode(key);
	
	// Set Global Vars for Timeout scope
	ads_globalCollapseObjNode = expandObjNode;
	
	if(expandObj.expandState){	
		// Stop the mouse detection routine
		if(expandObj.adsExpand_collapseType=="rolloff"){
			// Set the Boolean to mark that Auto-Collapse is not active
			ads_globalRolloverActive = false;
			// Clear Auto-Collapse function
			window.clearInterval(ads_globalTimerInterval);		
		}

   		// Send Expand Panel command to collapse
   		getMovieName(ads_expObjArray[ads_globalCollapseObjNode].adsExpand_expandName).callCnetCollapse();
 		
		if ((version >= 5.5) && (version < 7) && (document.body.filters) && document.getElementsByTagName("select")) {
			var shimName = expandObj.adsExpand_childDiv + "Shim";
			document.getElementById(shimName).style.display="none";
		}
		
		// IE needs special formatting for the clip property
		if(isIE && isWin && !isOpera){
			// Clip Expand DIV to hide it on screen		
			document.getElementById(expandObj.adsExpand_childDiv).style.clip="rect(0px 0px 0px 0px)";
		} else {
			// Clip Expand DIV to hide it on screen		
			document.getElementById(expandObj.adsExpand_childDiv).style.clip="rect(0px,0px,0px,0px)";
		}

		
		// Set Expand DIV z-index back to 0 for proper layering		
		document.getElementById(expandObj.adsExpand_parDiv).style.zIndex=0;

		// Set Global Expand state to "closed"
   		expandObj.expandState=false;

 		// Record Collapse impression
 		document.getElementById(expandObj.impTrack_name).src=expandObj.collapseImpTrack;

		// If 3rd Party Expand Trackign supported
		if(expandObj.collapseImpTrack3P){
			// reload tracking gif to track the expand action
			document.getElementById(expandObj.impTrack_name3P).src=expandObj.collapseImpTrack3P;
		} 				

	}
}

// AUTO-COLLAPSE FUNCTIONS //
// CHECK MOUSE (make sure the user hasn't left the hotspot while interacting with a rollover expand)
function ads_checkMouse(){
	Handler.add(window.document.body,"mousemove", ads_getCoords);
}

// CHECK DELAY (make sure the user hasn't left the hotspot within 1 second)
function ads_checkDelay(){
	Handler.remove(window.document.body, "mousemove", ads_getDelayCoords);
	Handler.add(window.document.body,"mousemove", ads_getDelayCoords);
}

// MOUSE DETECTION FUNCTIONS //
// GET COORDINATES FOR ROLLOVER AUTO-COLLAPSE
function ads_getCoords(e){
	// Remove any old handlers before adding new one
	Handler.remove(window.document.body, "mousemove", ads_getCoords);	
	// The event object holds the mouse position in window coordinates
	// Convert these to document coordinates using the Geometry module
	var x = e.clientX + Geometry.getHorizontalScroll();
	var y = e.clientY + Geometry.getVerticalScroll();
	ads_checkCoords(x,y);
}
// GET COORDINATES FOR ROLLOVER 1 SEC DELAY
function ads_getDelayCoords(e){
	// Remove any old handlers before adding new one
	Handler.remove(window.document.body, "mousemove", ads_getDelayCoords);
	// The event object holds the mouse position in window coordinates
	// Convert these to document coordinates using the Geometry module
	var x = e.clientX + Geometry.getHorizontalScroll();
	var y = e.clientY + Geometry.getVerticalScroll();
	// Set the Coords of current mouse position
	ads_globalDelayRecentX = x;
	ads_globalDelayRecentY = y;
}

// MOUSE X,Y COORDS CHECK FUNCTIONS
// CHECK COORDINATES FOR ROLLOVER AUTO-COLLAPSE
function ads_checkCoords(x,y){

	var collapseBase = false;
	var collapseExpand = false;

	// get expandObj to read its hotspot coordinates
	var expandObj = adsExpand_getObj(ads_globalCurrentKey);

	if(!((x >= expandObj.ads_baseXleft) && (x <= expandObj.ads_baseXright)) || !((y >= expandObj.ads_baseYtop) && (y <= expandObj.ads_baseYbottom)))
		collapseBase = true;
		
	if(!((x >= expandObj.ads_expandXleft) && (x <= expandObj.ads_expandXright)) || !((y >= expandObj.ads_expandYtop) && (y <= expandObj.ads_expandYbottom)))
		collapseExpand = true;	
				
	if(collapseBase && collapseExpand)	
		cnetCollapse(ads_globalRolloffKey);

}
// CHECK COORDINATES FOR ROLLOVER 1 SEC DELAY
function ads_checkDelayCoords(){
	// remove the timer checking mouse position
	window.clearInterval(ads_globalTimerInterval);
	
	// Rollover has finished after the 1 second delay
	ads_globalRolloverActive = false;
	
	// Global Var to put expand actions on hold till this expand has finished
	ads_globalOnHold = false;
		
	// get Base panel as an object to determine its position on the page	
	var expandObj = adsExpand_getObj(ads_globalCurrentKey);
	if(((ads_globalDelayRecentX >= expandObj.ads_baseXleft) && (ads_globalDelayRecentX <= expandObj.ads_baseXright)) && ((ads_globalDelayRecentY >= expandObj.ads_baseYtop) && (ads_globalDelayRecentY <= expandObj.ads_baseYbottom)))
		cnetExpandDelay();
}
// END AUTO-COLLAPSE AND MOUSE DETECTION SCRIPT //

//CHECK FOR EXPAND
function ads_checkExpand(){

	// Get the current expand object
	ads_globalExpandObjNode = adsExpand_getObjNode(ads_globalCurrentKey);
	
	
	// Put the expand action call in an error catching loops to avoid potential errors
	try{
		// send the Expand Panel Flash Object the command to Expand
	    getMovieName(ads_expObjArray[ads_globalExpandObjNode].adsExpand_expandName).callCnetExpand();
		ads_globalExpandChecker=true;	
	}
	catch(e){
		// If expand action call fails then set the checker to false and try again
		ads_globalExpandChecker=false;
	}
	finally{
		// increase count to restrict number of loops the interval will make
		ads_globalExpandCheckerCount++;	
	}

	//If expand action call was successful or the Interval has looped too many times kill the Interval loop
	if(ads_globalExpandCheckerCount>10 || ads_globalExpandChecker==true){
		window.clearInterval(ads_globalCheckTimerInterval);
		ads_globalExpandCheckerCount=0;
	}
}


function ads_createExpand(o) {

	// Detect Version of IE
	version = parseFloat(navigator.appVersion.split("MSIE")[1]);	
	
	if(o.adsExpand_srcBase.indexOf(".swf") == -1){
		o.adsExpand_srcBase = o.adsExpand_srcBase+".swf";
	}
	if(o.adsExpand_srcExpand.indexOf(".swf") == -1){
		o.adsExpand_srcExpand = o.adsExpand_srcExpand+".swf";
	}
	// List Defaults for 3rd Party tracking GIFs for backwards compatability
	if ( typeof(o.impTrack_name3P) == "undefined" ) {
		o.expandImpTrack3P=""; 
		o.collapseImpTrack3P=""; 
		o.flashImpTrack3P=""; 
		o.impTrack_name3P = "ads_impTrack3P7777";
	}
	
	if(isIE && isWin && !isOpera){
		document.write('<div align="center"><div align="center" id="'+o.adsExpand_parDiv+'" style="position:relative; width:'+o.adsExpand_width+'px; height:'+o.adsExpand_height+'px; text-align:center; margin:0 auto; z-index:0;">');
		document.write('	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+o.adsExpand_width+'" height="'+o.adsExpand_height+'" id="'+o.adsExpand_baseName+'" align="middle">');
		document.write('	<param name="allowScriptAccess" value="always" />');
		document.write('	<param name="FlashVars" value="'+o.adsExpand_flashVarsBase+'" />');
		document.write('	<param name="movie" value="'+o.adsExpand_srcBase+'" /><param name="quality" value="high" /><param name="wmode" value="'+o.adsExpand_wmodeBase+'" /><param name="bgcolor" value="'+o.adsExpand_bgcolorBase+'" /></object>');
		document.write('	<div id="'+o.adsExpand_childDiv+'" style="position:absolute;width:'+o.adsExpand_widthEx+'px;height:'+o.adsExpand_heightEx+'px;left:'+o.adsExpand_leftOffset+'px;top:'+o.adsExpand_topOffset+'px;clip: rect(0px 0px 0px 0px); z-index: 4999">');
		document.write('		<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+o.adsExpand_widthEx+'" height="'+o.adsExpand_heightEx+'" id="'+o.adsExpand_expandName+'" align="middle">');
		document.write('		<param name="allowScriptAccess" value="always" />');
		document.write('		<param name="FlashVars" value="'+o.adsExpand_flashVarsExpand+'" />');
		document.write('		<param name="movie" value="'+o.adsExpand_srcExpand+'" /><param name="quality" value="high" /><param name="wmode" value="'+o.adsExpand_wmodeExpand+'" /><param name="bgcolor" value="#ffffff" />');
		document.write('		</object>');		
		document.write('	</div>');
		if ((version >= 5.5) && (version < 7) && (document.body.filters) && document.getElementsByTagName("select")) {
			document.write('	<div id="'+o.adsExpand_childDiv+'Shim" style="position:absolute;width:'+o.adsExpand_widthEx+'px;height:'+o.adsExpand_heightEx+'px;left:'+o.adsExpand_leftOffset+'px;top:'+o.adsExpand_topOffset+'px; z-index: 4899; display:none"><IFRAME src="" frameBorder="0" scrolling="no" height="100%" width="100%"></IFRAME></div>');
		}
		document.write('<br /><img src="'+o.flashImpTrack+'" alt="impTrack" border="0" height="1" width="1" name="'+o.impTrack_name+'" id="'+o.impTrack_name+'" style="position:absolute; top:0px; left:0px" />');
		document.write('</div></div>');

		window[o.adsExpand_expandName] = document.getElementById(o.adsExpand_expandName);
		
	} else {
		document.write('<div align="center"><div align="center" id="'+o.adsExpand_parDiv+'" style="position:relative; width:'+o.adsExpand_width+'px; height:'+o.adsExpand_height+'px; text-align:center; margin:0 auto; z-index:0;">');
		document.write('	<embed src="'+o.adsExpand_srcBase+'" quality="high" wmode="'+o.adsExpand_wmodeBase+'" bgcolor="'+o.adsExpand_bgcolorBase+'" width="'+o.adsExpand_width+'" height="'+o.adsExpand_height+'" name="'+o.adsExpand_baseName+'" align="middle" allowScriptAccess="always" FlashVars="'+o.adsExpand_flashVarsBase+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		document.write('	<div id="'+o.adsExpand_childDiv+'" style="position:absolute;width:'+o.adsExpand_widthEx+'px;height:'+o.adsExpand_heightEx+'px;left:'+o.adsExpand_leftOffset+'px;top:'+o.adsExpand_topOffset+'px; clip: rect(0px,0px,0px,0px);z-index: 4999">');
		document.write('		<embed src="'+o.adsExpand_srcExpand+'" wmode="'+o.adsExpand_wmodeExpand+'" quality="high" bgcolor="'+o.adsExpand_bgcolorExpand+'" width="'+o.adsExpand_widthEx+'" height="'+o.adsExpand_heightEx+'" name="'+o.adsExpand_expandName+'" align="middle" allowScriptAccess="always" FlashVars="'+o.adsExpand_flashVarsExpand+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		document.write('	</div>');
		document.write('<br /><img src="'+ o.flashImpTrack +'" alt="impTrack" border="0" height="1" width="1" name="'+o.impTrack_name+'" id="'+o.impTrack_name+'" style="position:absolute; top:0px; left:0px" />');
		document.write('</div></div>');
	}

	// If Third Party Tracking GIF
	if(o.flashImpTrack3P!="" && o.expandImpTrack3P!=""){
		document.write('<br /><img src="'+ o.flashImpTrack3P +'" alt="impTrack" border="0" height="1" width="1" name="'+o.impTrack_name3P+'" id="'+o.impTrack_name3P+'" style="position:absolute; top:0px; left:0px" />');
	}	
	
}

// LAUNCH THE EXPAND AD WHEN CALLED
function ads_goAd(o){

	// Version check based upon the values entered above in "Globals"
	var hasReqestedVersion = DetectFlashVer(o.requiredMajorVersion, o.requiredMinorVersion, o.requiredRevision);

	// Check to see if the version meets the requirements for playback
	if (hasReqestedVersion && !ads_inFIF) {
		// if we've detected an acceptable version
		// embed the Flash Content SWF when all tests are passed	
		ads_createExpand(o);
	} else {
		document.write(o.defaultGIF);
	}
}



// RUNTIME CODE
// Check to see if this is an Ajax Friendly IFrame Environment
var ads_inFIF = false;

if ( typeof(inFIF) == "undefined" ) {
    // Action to take if variableName is not defined - NO ACTION
} else {
    // Action to take if variableName *is* defined
    ads_inFIF = true;
}

if(ads_globalCurExpand){
	// Get Expand Object from Global Array 'ads_expObjArray'
	for(x=0;x<ads_expObjArray.length;x++){
		if(ads_expObjArray[x].objKey==ads_globalCurExpand){
			ads_goAd(ads_expObjArray[x]);		
		}
	}
}
