

/* HOMEPAGE TAKEOVER */
function minimizeHomepageFlash(currentmovie) {
	document.getElementById('homeflash').style.display = "none";
	document.getElementById('homeflashfix').style.display = "none";
	document.getElementById('homeflashend').style.display = "block";
	document.getElementById('homeflashend').className = "hf-"+currentmovie;
}

//______________________  BEGIN HOMEPAGE TAKEOVER _______________________//

HideHomepageTakeover = function() {
     document.getElementById("homepageTakeover").style.display = 'none';
}
/*
ShowHomepageFlash = function() {
    var so = new SWFObject("assets/index/swfs/electro2.swf", "homeflash", "1035", "280", "8", "");
	so.addParam("loop", "true");
	so.addParam("quality", "high");
	so.addParam("wmode", "transparent");
	so.write("homeflash");
}
*/
SkipTakeover =function() {
	ShowHomepageFlash();
	HideHomepageTakeover();
}

//______________________  END HOMEPAGE TAKEOVER _______________________//


//** Sniff for the two major browsers **
	var ie  = (document.all)? true:false
	var ns6 = ((document.getElementById)&&(!ie))? true:false

//** Sniff for browser version, used for IE 5 only **
	var agt = navigator.userAgent.toLowerCase();
	var is_major = parseInt(navigator.appVersion);
	var ie5 = (ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
	var ie5_5 = (ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));

//** Sniff for Mac, used for IE Mac browsers **
	var mac = (agt.indexOf("mac") > -1)? true:false

//** Sniff for AOL, used in certain cases where AOL won't pop open a window the size we want it **
	var aol = (agt.indexOf("aol") > -1)? true:false

//** Used to test if a value is 'undefined'.  What 'undefined' represents is different for each **
//** browser, but any variable that has not been defined a value IS 'undefined' in all browsers. **
//** So, we'll test against this variable to see if another is 'undefined'. **
	var undef;

//** When used, this var would be declared in an offsite page. **
//** It's used to define the full path to each menu item for non-PowerBar pages.
//** We don't want to erase any existing value, so we'll check if it has one first.
	if (!PBnavPath) {
		var PBnavPath = "";
	}

//** Menu vars **
	var LAYtnMenu, LAYtnTable;
	var NotInMenuNow = true;

	var MasterPageWidth = 730;

	var MouseOverState = new Array();
	MouseOverState[0] = "tnLeftBevelOn";
	MouseOverState[1] = "#417793";
	MouseOverState[2] = "tnRightBevelOn";

	var MouseOffState = new Array();
	MouseOffState[0] = "tnLeftBevelOff";
	MouseOffState[1] = "#01496f";
	MouseOffState[2] = "tnRightBevelOff";


	var PreloadComplete = false;

//** These links are considered absolute links at this point. **
//** Adjust tnMacMenuWidth[] when the contents of this nav change. **
	
	// Array used to stores all of the menus
	var tnMenu = new Array();

	/*DONT USE THIS ANYMORE
	
	var tnMenuItems = new Array(
		new Array("POWERBAR&reg; PRODUCT LIST", "/Products/ProductList.aspx"),
		new Array("POWERBAR&reg; PERFORMANCE SYSTEM", "/Products/PerformanceSystem.aspx"),
		new Array("POWERBAR&reg; PERFORMANCE BAR", "/Products/Performance/"),
		new Array("POWERBAR&reg; BEVERAGE SYSTEM", "/Products/Beverage/"),
		new Array("POWERBAR&reg; GEL", "/Products/PowerGel/"),
		new Array("POWERBAR&reg; RECOVERY PRODUCTS", "/Products/RecoveryProducts/"),
		new Array("POWERBAR&reg; PROTEINPLUS&trade;", "/Products/ProteinPlus/"),
		new Array("POWERBAR&reg; PROTEINPLUS&trade; REDUCED SUGAR", "/Products/ProteinPlusRS/"),
		new Array("POWERBAR HARVEST&reg;", "/Products/Harvest/"),
		new Array("POWERBAR&reg; NUT NATURALS", "/Products/NutNaturals/"),
		new Array("POWERBAR&reg; TRIPLE THREAT&trade;", "/Products/TripleThreat/"),
		new Array("POWERBAR&reg; PRIA&reg;", "/Products/Pria/")
	)
	createTopMenu("products", tnMenuItems);
	
	tnMenuItems = new Array(
		new Array("SIGN UP", "/Newsletter/"),
		new Array("EDIT YOUR PROFILE", "/Newsletter/EditPreferences.aspx")
	//tnMenu["newsletter2"] = new Array("NUTRITION EDGE NEWSLETTER ARCHIVE", "/Newsletter/Archive/");
	)
	createTopMenu("newsletter", tnMenuItems);

	tnMenuItems = new Array(
		new Array("HOW C2 MAX WORKS", "/NutritionResource/Index.aspx"),
		new Array("POWERBAR SCIENCE", "/NutritionResource/Index.aspx?panel=c2maxresearch&ResourceId=73A96064-552A-4F95-9D6C-8C796CD9017A"),
		new Array("POWERBAR C2 MAX", "/NutritionResource/C2Max/"),
		new Array("ASK OUR NUTRITION EXPERTS", "/NutritionResource/Ask/"),
		new Array("NUTRITION ARTICLES", "/NutritionResource/ToolsArticles/Articles.aspx"),
		new Array("NUTRITION TOOLS", "/NutritionResource/ToolsArticles/"),
		new Array("SPORTS NUTRITION GUIDE", "/NutritionResource/NutritionGuide.aspx"),
		new Array("TRAINING TIPS", "/NutritionResource/TrainingTips/"),
		new Array("POWERBAR TIMELINE", "/NutritionResource/PowerBarTimeline.aspx"),
		new Array("TRUTH VS MYTH", "/NutritionResource/TruthvsMyth.aspx"),
		new Array("RSS", "/NutritionResource/Rss/")
	)
	createTopMenu("nutrition", tnMenuItems);
	
	tnMenuItems = new Array(
	new Array("EVENTS", "/PartnersEvents/Events.aspx"),
	new Array("PARTNERS", "/PartnersEvents/Partners.aspx")
	)
	createTopMenu("partners", tnMenuItems);
	
	tnMenuItems = new Array(
	new Array("ATHLETE PROFILES", "/Athletes/Profiles/"),
	new Array("ATHLETE OF THE MONTH", "/Athletes/AthleteOfMonth.aspx"),
	new Array("POWERBAR TEAM ELITE&#0153;", "/Athletes/TeamElite/"),
	new Array("WHAT IT TAKES VIDEO", "/Athletes/AthleteStories/DVDs.aspx"),
	new Array("SUBMIT A BIO", "/Athletes/Bio/")
	)
	createTopMenu("athletes", tnMenuItems);
	
	tnMenuItems = new Array(
	new Array("POWERBAR PRODUCTS STORE", "/Store/"),
	new Array("POWERBAR GEAR STORE", "http://powerbar.corplogoware.com/user.clw"),
	new Array("WHERE TO BUY", "/WhereToBuy/")
	)
	createTopMenu("store", tnMenuItems);
	
	tnMenuItems = new Array(
	new Array("ABOUT US", "/Company/Index.aspx"),
	new Array("POWERBAR PARTNERS", "/Company/Partners.aspx"),
	new Array("MEDIA RESOURCES", "/Company/MediaResources/"),
	new Array("POWERBAR JOBS", "/Company/Jobs.aspx"),
	new Array("POWERBAR AROUND THE WORLD", "/Company/AroundTheWorld.aspx"),
	new Array("CONTACT US", "/Company/ContactUs.aspx")
	)
	createTopMenu("company", tnMenuItems);
	
	var tnContents = new Array();
	tnContents["products"] = "";
	tnContents["newsletter"] = "";
	tnContents["nutrition"] = "";
	tnContents["partners"] = "";
	tnContents["athletes"] = "";
	tnContents["store"] = "";
	tnContents["company"] = "";

//** Leave these set to 0.  The code will calculate and populate the values in tnBuild(). **
//** Setting values here will bypass the calculations. **
	var tnMenuWidth = new Array();
	tnMenuWidth["products"] = 0;
	tnMenuWidth["newsletter"] = 0;
	tnMenuWidth["nutrition"] = 0;
	tnMenuWidth["partners"] = 0;
	tnMenuWidth["athletes"] = 0;
	tnMenuWidth["store"] = 0;
	tnMenuWidth["company"] = 0;

//** Needed for Mac offsets, calculations don't work right. **
	var tnMacMenuWidth = new Array();
	tnMacMenuWidth["products"] = 272;
	tnMacMenuWidth["newsletter"] = 219;
	tnMacMenuWidth["nutrition"] = 215;
	tnMacMenuWidth["partners"] = 93;
	tnMacMenuWidth["athletes"] = 172;
	tnMacMenuWidth["store"] = 191;
	tnMacMenuWidth["company"] = 209;


//** This array MUST be made of numbers, not strings!  DO NOT surround the numbers with quotes ("25")! **
//** The JavaScript will then append all numbers as a string and the menu will not appear. **

	var tnMenuShiftAmt = new Array();
	tnMenuShiftAmt["products"] = -11;
	tnMenuShiftAmt["newsletter"] = 66;
	tnMenuShiftAmt["nutrition"] = 152;
	tnMenuShiftAmt["partners"] = 266;
	tnMenuShiftAmt["athletes"] = 340;
	tnMenuShiftAmt["store"] = 486;
	tnMenuShiftAmt["company"] = 575;*/


//** Used to shift each menu item over x pixels, to create the slanted menu look. **
	tnMenuShiftAmount = 6;

	tnMacMenuShiftAmt = -12;

function createTopMenu(menuName, menuItems) {
	for (var i = 0; i < menuItems.length; i++)
	{
		tnMenu[menuName + i] = menuItems[i];
	}
}

//** Layer Build functions.  The IF verifies that, if a layer doesn't exist **
//** the function will return null instead of a JavaScript error. **
	function refLayer(layerName) {
		var LAYref;
		if (ie) {
			if (document.all[layerName]) {
				LAYref = document.all[layerName];
				HideText = "hidden";
			} else {
				LAYref = null;
			}
		} else {
		    // default to NS6+
			if (document.getElementById(layerName)) {
				LAYref = document.getElementById(layerName);
				HideText = "hidden";
			} else {
				LAYref = null;
			}
		}

		return LAYref;
	}


//** Functions to determine browser window width/height **
	function getInsideWindowWidth() {
		if (ie) {
			return document.body.scrollWidth
		} else {
			return document.width
		}
	}

	function getInsideWindowHeight() {
		if (ie) {
			return document.body.scrollHeight
		} else {
			return document.height
		}
	}


//** Calculate Offsets from current item. **
	function eventXoffset(evt) {
		if (ie) {
			return document.body.scrollLeft - document.body.clientLeft + evt.clientX - evt.offsetX;
		} else {
			return evt.pageX - evt.layerX
		}
	}

	function eventYoffset(evt) {
		if (ie) {
			return document.body.scrollTop - document.body.clientTop + evt.clientY - evt.offsetY;
		} else {
			return evt.pageY - evt.layerY
		}
	}


//** Init the top nav layer **
	function menuInit() {
		LAYtnMenu = refLayer("TnDD");
		LAYtnTable = refLayer("topNavTB");
		PreloadComplete = true;
		window.name = "PowerBar";
	}




//****************************************
//** Top Nav DHTML Menu Functions START **
//****************************************

	function tnBuild(menuName) {
		var i, menuHTML, linkURL;
	//** Build Menu Contents.  Should only be done once. **
		i = 0;
		menuHTML = "";

	//** If there is no menu, put in flag and quit. **
		if (!tnMenu[menuName + i]) {
			return false;
		}

		if (ie && mac) {
		//** IE Mac needs different shift coords.  Reset 'em here, less code needed. **
			tnMenuShiftAmt[menuName] = tnMacMenuShiftAmt;
			tnMenuShiftAmt["store"] = 56;
			tnMenuShiftAmt["company"] = 91;

			tnMenuWidth[menuName] = tnMacMenuWidth[menuName];
		}

	//** Build each line in the menu. **
		while (tnMenu[menuName + i]) {
		//** If this is a JavaScript command, just use it instead of trying a document.location.href. **
			if (tnMenu[menuName + i][1].toLowerCase().indexOf("javascript:") == 0) {
				linkURL = tnMenu[menuName + i][1].substr(11);
			} else if (tnMenu[menuName + i][1].toLowerCase().indexOf("http") == 0) {
				linkURL = "top.location.href='"+tnMenu[menuName+i][1]+"'";
			} else {
				linkURL = "top.location.href='"+PBnavPath+tnMenu[menuName+i][1]+"'";
			}
			menuHTML += '<div class="tnLeftBevelOff"';

			if ((i * tnMenuShiftAmount) > 0) {
				menuHTML += ' style="left:-' + (i * tnMenuShiftAmount) + 'px;"';
			}

			menuHTML += '><div class="tnRightBevelOff"><div class="tnMenuItem" '

			if ((menuName == "store") || (menuName == "company")) {
				menuHTML += 'style="text-align:right;" ';
			}

			menuHTML += 'onClick="'+linkURL+'" onMouseOver="changeBGitems(this, MouseOverState);showTnDD();" '
			menuHTML += 'onMouseOut="changeBGitems(this, MouseOffState);hideTnDD(true);">'

			if (ie5) {
				menuHTML += '<nobr>' + tnMenu[menuName + i][0] + '</nobr>';
			} else {
				menuHTML += tnMenu[menuName + i][0];
			}

			menuHTML += '</div></div></div>\n';
			i++;
		}
		menuHTML += '<div class="tnLeftBevelBottom"'

		if ((i * tnMenuShiftAmount) > 0) {
			menuHTML += ' style="left:-' + ((i * tnMenuShiftAmount) - 3) + 'px;"';
		}

		menuHTML += '><div class="tnRightBevelBottom"><div class="tnMenuBottom" '
		menuHTML += '>&nbsp;</div></div></div>\n';

		return menuHTML;
	}

//** Calculates max width of layer (if first time thru), and sets the outer DIV to that size. **
	function calcAndSetWidth(menuName) {
		var i;
		if (tnMenuWidth[menuName] <= 0) {
		//** Calc max width of inner DIVs **
		//** IE Mac width is pre-set before we get here, so these calcs will never be run.
			for (i=0; i<LAYtnMenu.childNodes.length; i++) {
				if (LAYtnMenu.childNodes[i].offsetWidth > tnMenuWidth[menuName]) {
					tnMenuWidth[menuName] = LAYtnMenu.childNodes[i].offsetWidth;
				}
			}
		}

		LAYtnMenu.style.width = tnMenuWidth[menuName] + "px";
	}


//** Rollover function **
	function changeBGitems(LAYer, stateArray) {
		if (PreloadComplete) {
			LAYer.parentNode.parentNode.className = stateArray[0];
			LAYer.style.backgroundColor = stateArray[1];
			LAYer.parentNode.className = stateArray[2];
		}
	}


//** Top Nav Dropdown functions **
//** Check PreloadComplete on these just in case **
	function showTnDD() {
		if (PreloadComplete) {
			NotInMenuNow = false;
			LAYtnMenu.style.visibility = "inherit";
		}
	}

	function hideTnDD(FirstTry) {
		if (PreloadComplete) {
			if (FirstTry) {
				NotInMenuNow = true;
				setTimeout("hideTnDD(false)", 50);
			} else if (NotInMenuNow) {
				LAYtnMenu.style.visibility = "hidden";
				LAYtnTable.className = "blankTNbg";
			}
		}
	}


	function openTnDD(menuName, evt) {
		var MenuEdge, MDxCoord, MDyCoord;
		if (!evt) evt = event;

		if (PreloadComplete) {
		//** Hide menu and move it off the page.  This resolves menu flicker. **
			NotInMenuNow = true;
			hideTnDD(menuName, false);
			LAYtnMenu.style.left = -200;
			LAYtnMenu.style.top = -200;

			LAYtnTable.className = menuName + "TNbg";

		//** If we haven't viewed this menu before, write out its contents and store in array. **
			if (tnContents[menuName] == "") {
				tnContents[menuName] = tnBuild(menuName);
			}

		//** If contents is false, quit. **
			if (!tnContents[menuName]) {
				NotInMenuNow = false;
				return;
			}

			if (ie) {
				LAYtnMenu.style.width = "10px";
			} else {
				LAYtnMenu.style.width = "auto";
			}

			LAYtnMenu.innerHTML = tnContents[menuName];

			calcAndSetWidth(menuName);

		//** Don't need to calculate right edge of menu. **
		//** Right menus are designed to be right-aligned. **
		//** Overflow past right side of page content should NEVER HAPPEN. **

			MDxCoord = eventXoffset(evt);
			MDyCoord = eventYoffset(evt);

		//** Put in IE Mac resize fix (add & subtract 1px) here if we need it. **				

		//** Set left & top coordinates. **
			if ((menuName == "store") || (menuName == "company")) {
				LAYtnMenu.style.left = MDxCoord + tnMenuShiftAmt[menuName] - tnMenuWidth[menuName];
			} else {
				LAYtnMenu.style.left = MDxCoord + tnMenuShiftAmt[menuName];
			}

			LAYtnMenu.style.top = MDyCoord + 27;

			showTnDD();
		}
	}

/*** Generic Function Library **/

	function divHREF(varHref, target) {
		if (target) {
			// code goes here
		} else {
			document.location.href = varHref;
		}
	}


//** Second Level Nav Rollover function **
	function secOver(LAYer, idx) {
		if (PreloadComplete) {
			LAYer.className = "ovrNav_" + idx;
		}
	}

//** Second Level Nav Rolloff function **
	function secOff(LAYer, idx) {
		if (PreloadComplete) {
			LAYer.className = "offNav_" + idx;
		}
	}

//** Third Level Nav Rollover function **
	function thiOver(LAYer) {
		if (PreloadComplete) {
			LAYer.className = "sideNavEleOver";
		}
	}

//** Third Level Nav Rolloff function **
	function thiOff(LAYer) {
		if (PreloadComplete) {
			LAYer.className = "sideNavEle";
		}
	}


//********************************
//** Query String Parsing START **
//********************************

	// This loads all variables in a querystring into an associative array named qsVars
	// I.e., qsVars[variable_name] == variable_value when querystring is ?variable_name=variable_value&...
	var qsVars = new Array();

	var queryString = location.search;

	if (queryString != "") {
 		// -- get rid of ? at start --
  		var qsdata = queryString.slice(1,queryString.length);
		var qsvalues = qsdata.split("&");
		for (i=0; i < qsvalues.length; i++) {
			var qsvaluepair = qsvalues[i].split("=");
			//alert(qsvaluepair[0]);
			//alert(qsvaluepair[1]);
			qsVars[qsvaluepair[0]] = qsvaluepair[1];
		}
	}

//********************************
//** Query String Parsing END **
//********************************

//****************************
//** Flash Sniffing START ****
//****************************

	// Check for Flash, set vars if T/F
		var Flash4 = false;
		var Flash5 = false;
		var Flash6 = false;
		var Flash7 = false;
		var Flash8 = false;
		var FlashEnabled = false;
		var Flash7Enabled = false;
		var Flash8Enabled = false;
	// Default is False, so we only need to set it as True.
		if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) {
			// Check for Flash in Netscape
			var nsFlash = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
			if (nsFlash) {
				var FlashVer = parseInt(nsFlash.description.substring(nsFlash.description.indexOf(".")-1));
				if (FlashVer >= 8) {
					Flash8 = true;
				} else if (FlashVer >= 7) {
					Flash7 = true;
				} else if (FlashVer >= 6) {
					Flash6 = true;
				} else if (FlashVer == 5) {
					Flash5 = true;
				} else if (FlashVer == 4) {
					Flash4 = true;
				} 
			}
		} else if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
			var f4Inst;
			var f5Inst;
			var f6Inst;
			var f7Inst;
			var f8Inst;

			eval('try { f4Inst = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.4"); f5Inst = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.5"); f6Inst = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); f7Inst = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); f8Inst = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.8"); } catch (e) { }');

			if (f8Inst != null) {
				Flash8 = true;
			} else if (f7Inst != null) {
				Flash7 = true;
			} else if (f6Inst != null) {
				Flash6 = true;
			} else if (f5Inst != null) {
				Flash5 = true;
			} else if (f4Inst != null) {
				Flash4 = true;
			} 

			f4Inst = null;
			f5Inst = null;
			f6Inst = null;
			f7Inst = null;
			f8Inst = null;
		}

		if (qsVars['flash'] == 'disabled') {
			Flash4 = false;
			Flash5 = false;
			Flash6 = false;
			Flash7 = false;
			Flash8 = false;
			// FlashEnabled default is false
		} else if (Flash8) {
			Flash8Enabled = true;
			Flash7Enabled = true;
			FlashEnabled = true;
		} else if (Flash7) {
			Flash7Enabled = true;
			FlashEnabled = true;
		} else if (Flash6) {
			FlashEnabled = true;
		}
		

//**************************
//** Flash Sniffing END ****
//**************************

//*****************************
//** Misc Functions BEGIN *****
//*****************************

	function CheckMaxLength(element, maxLength, field) {
		var len = element.value.length;
		var msg = "Your " + field + " is " + len + " in length. Maximum allowed is " + maxLength + ".";
		if (len > maxLength)
			alert(msg);
	}
	
	function hidediv(div_id) {
		document.getElementById(div_id).style.display = 'none';
	}
	function showdiv(div_id) {
		document.getElementById(div_id).style.display = 'block';
	}

	function HideSubDivs(div_id) {
	    var mainID = document.getElementById(div_id);
	    var subDivs = mainID.getElementsByTagName('div');
	    for (var i=0;i<subDivs.length;i++){
		    hidediv(subDivs[i].id);
	    }
    }
    
    

    
        
    
    
//*****************************
//** Misc Functions END *******
//*****************************


//============================================================================
// Description: function to pop up a small window (duh). If offset values are
// not given, then window is centered on the screen.
// Author: Adam Weston
// Usage: popup('page.html', 'name', width, height, toolbars, scrollbars, left_offset, top_offset);

	function popup(loc, name, w, h, tb, sb, x, y) {
		if(!x && !y) {
			var scr_x = screen.width;
			var scr_y = screen.height;
			var x = (scr_x/2)-(w/2);
			var y = (scr_y/2)-(h/2);
		}
		
		var tb = (!tb) ? "yes" : "no";
		var sb = (!sb) ? "yes" : "no";
		var mb = (window.print) ? "no" : "yes";

		popupwin = window.open(loc, name, "toolbar="+tb+",location=no,directories=no,status=no,menubar="+mb+",scrollbars="+sb+",resizable=no,width="+w+",height="+h+",left="+x+",top="+y);
		popupwin.focus();
	}
	

//*******************************
//** Open New Window From NIRF **
//*******************************

	function openwin(loc, name){
		newwin = window.open(loc, name);
	}
	
	
	
	
	
	
//***********************************************************************************
//** Flash Sniffing/Inserter -- NEW -- Use this to fix IE graybox Issue -- START ****
//***********************************************************************************

/*  SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/  */

if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){
_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";
}else{
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}
_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
var _25=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_25=new deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_23&&_25.major>_23.major){return _25;}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
catch(e){}}}
return _25;};
deconcept.PlayerVersion=function(_29){
this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
this.minor=parseInt(_29[1])||0;
this.rev=parseInt(_29[2])||0;};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};
deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(q){
var _2d=q.indexOf(_2b+"=");
var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
if(q.length>1&&_2d>-1){
return q.substring(q.indexOf("=",_2d)+1,_2e);
}}return "";}};
if(Array.prototype.push==null){
Array.prototype.push=function(_2f){
this[this.length]=_2f;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject; // for backwards compatibility
var SWFObject=deconcept.SWFObject;

//***********************************
//** Flash Sniffing/Inserter END ****
//***********************************





/*
 * This file contains functions to generate OBJECT and EMBED tags for QuickTime content. 
 */

/************** LOCALIZABLE GLOBAL VARIABLES ****************/

var gArgCountErr =	'The "%%" function requires an even number of arguments.'
				+	'\nArguments should be in the form "atttributeName", "attributeValue", ...';

/******************** END LOCALIZABLE **********************/

var gTagAttrs				= null;
var gQTGeneratorVersion		= 1.0;

function AC_QuickTimeVersion()	{ return gQTGeneratorVersion; }

function _QTComplain(callingFcnName, errMsg)
{
    errMsg = errMsg.replace("%%", callingFcnName);
	alert(errMsg);
}

function _QTAddAttribute(prefix, slotName, tagName)
{
	var		value;

	value = gTagAttrs[prefix + slotName];
	if ( null == value )
		value = gTagAttrs[slotName];

	if ( null != value )
	{
		if ( 0 == slotName.indexOf(prefix) && (null == tagName) )
			tagName = slotName.substring(prefix.length); 
		if ( null == tagName ) 
			tagName = slotName;
		return tagName + '="' + value + '" ';
	}
	else
		return "";
}

function _QTAddObjectAttr(slotName, tagName)
{
	// don't bother if it is only for the embed tag
	if ( 0 == slotName.indexOf("emb#") )
		return "";

	if ( 0 == slotName.indexOf("obj#") && (null == tagName) )
		tagName = slotName.substring(4); 

	return _QTAddAttribute("obj#", slotName, tagName);
}

function _QTAddEmbedAttr(slotName, tagName)
{
	// don't bother if it is only for the object tag
	if ( 0 == slotName.indexOf("obj#") )
		return "";

	if ( 0 == slotName.indexOf("emb#") && (null == tagName) )
		tagName = slotName.substring(4); 

	return _QTAddAttribute("emb#", slotName, tagName);
}


function _QTAddObjectParam(slotName, generateXHTML)
{
	var		paramValue;
	var		paramStr = "";
	var		endTagChar = (generateXHTML) ? ' />' : '>';

	if ( -1 == slotName.indexOf("emb#") )
	{
		// look for the OBJECT-only param first. if there is none, look for a generic one
		paramValue = gTagAttrs["obj#" + slotName];
		if ( null == paramValue )
			paramValue = gTagAttrs[slotName];

		if ( 0 == slotName.indexOf("obj#") )
			slotName = slotName.substring(4); 
	
		if ( null != paramValue )
			paramStr = '  <param name="' + slotName + '" value="' + paramValue + '"' + endTagChar + '\n';
	}

	return paramStr;
}

function _QTDeleteTagAttrs()
{
	for ( var ndx = 0; ndx < arguments.length; ndx++ )
	{
		var attrName = arguments[ndx];
		delete gTagAttrs[attrName];
		delete gTagAttrs["emb#" + attrName];
		delete gTagAttrs["obj#" + attrName];
	}
}

		

// generate an embed and object tag, return as a string
function _QTGenerate(callingFcnName, generateXHTML, args)
{
	// is the number of optional arguments even?
	if ( args.length < 4 || (0 != (args.length % 2)) )
	{
		_QTComplain(callingFcnName, gArgCountErr);
		return "";
	}
	
	// allocate an array, fill in the required attributes with fixed place params and defaults
	gTagAttrs = new Array();
	gTagAttrs["src"] = args[0];
	gTagAttrs["width"] = args[1];
	gTagAttrs["height"] = args[2];
	gTagAttrs["classid"] = "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";
	gTagAttrs["pluginspage"] = "http://www.apple.com/quicktime/download/";

	// set up codebase attribute with specified or default version before parsing args so
	//  anything passed in will override
	var activexVers = args[3]
	if ( (null == activexVers) || ("" == activexVers) )
		activexVers = "6,0,2,0";
	gTagAttrs["codebase"] = "http://www.apple.com/qtactivex/qtplugin.cab#version=" + activexVers;

	var	attrName,
		attrValue;

	// add all of the optional attributes to the array
	for ( var ndx = 4; ndx < args.length; ndx += 2)
	{
		attrName = args[ndx].toLowerCase();
		attrValue = args[ndx + 1];

		// "name" and "id" should have the same value, the former goes in the embed and the later goes in
		//  the object. use one array slot 
		if ( "name" == attrName || "id" == attrName )
			gTagAttrs["name"] = attrValue;

		else 
			gTagAttrs[attrName] = attrValue;
	}

	// init both tags with the required and "special" attributes
	var objTag =  '<object '
					+ _QTAddObjectAttr("classid")
					+ _QTAddObjectAttr("width")
					+ _QTAddObjectAttr("height")
					+ _QTAddObjectAttr("codebase")
					+ _QTAddObjectAttr("name", "id")
					+ _QTAddObjectAttr("tabindex")
					+ _QTAddObjectAttr("hspace")
					+ _QTAddObjectAttr("vspace")
					+ _QTAddObjectAttr("border")
					+ _QTAddObjectAttr("align")
					+ _QTAddObjectAttr("class")
					+ _QTAddObjectAttr("title")
					+ _QTAddObjectAttr("accesskey")
					+ _QTAddObjectAttr("noexternaldata")
					+ '>\n'
					+ _QTAddObjectParam("src", generateXHTML);
	var embedTag = '  <embed '
					+ _QTAddEmbedAttr("src")
					+ _QTAddEmbedAttr("width")
					+ _QTAddEmbedAttr("height")
					+ _QTAddEmbedAttr("pluginspage")
					+ _QTAddEmbedAttr("name")
					+ _QTAddEmbedAttr("align")
					+ _QTAddEmbedAttr("tabindex");

	// delete the attributes/params we have already added
	_QTDeleteTagAttrs("src","width","height","pluginspage","classid","codebase","name","tabindex",
					"hspace","vspace","border","align","noexternaldata","class","title","accesskey");

	// and finally, add all of the remaining attributes to the embed and object
	for ( var attrName in gTagAttrs )
	{
		attrValue = gTagAttrs[attrName];
		if ( null != attrValue )
		{
			embedTag += _QTAddEmbedAttr(attrName);
			objTag += _QTAddObjectParam(attrName, generateXHTML);
		}
	} 

	// end both tags, we're done
	return objTag + embedTag + '> </em' + 'bed>\n</ob' + 'ject' + '>';
}

// return the object/embed as a string
function QT_GenerateOBJECTText()
{
	return _QTGenerate("QT_GenerateOBJECTText", false, arguments);
}

function QT_GenerateOBJECTText_XHTML()
{
	return _QTGenerate("QT_GenerateOBJECTText_XHTML", true, arguments);
}

function QT_WriteOBJECT()
{
	document.writeln(_QTGenerate("QT_WriteOBJECT", false, arguments));
}

function QT_WriteOBJECT_XHTML()
{
	document.writeln(_QTGenerate("QT_WriteOBJECT_XHTML", true, arguments));
}




//****************************************
//** Top Nav DHTML Menu Functions START **
//****************************************

	function tnBuild(menuName) {
		var i, menuHTML, linkURL;
	//** Build Menu Contents.  Should only be done once. **
		i = 0;
		menuHTML = "";

	//** If there is no menu, put in flag and quit. **
		if (!tnMenu[menuName + i]) {
			return false;
		}

		if (ie == mac) {
		//** IE Mac needs different shift coords.  Reset 'em here, less code needed. **
			tnMenuShiftAmt[menuName] = tnMacMenuShiftAmt;
			tnMenuShiftAmt["store"] = 56;
			tnMenuShiftAmt["company"] = 91;

			tnMenuWidth[menuName] = tnMacMenuWidth[menuName];
		}

	//** Build each line in the menu. **
		while (tnMenu[menuName + i]) {
		//** If this is a JavaScript command, just use it instead of trying a document.location.href. **
			if (tnMenu[menuName + i][1].toLowerCase().indexOf("javascript:") == 0) {
				linkURL = tnMenu[menuName + i][1].substr(11);
			} else if (tnMenu[menuName + i][1].toLowerCase().indexOf("http") == 0) {
				linkURL = "top.location.href='"+tnMenu[menuName+i][1]+"'";
			} else {
				linkURL = "top.location.href='"+PBnavPath+tnMenu[menuName+i][1]+"'";
			}
			menuHTML += '<div class="tnLeftBevelOff"';

			if ((i * tnMenuShiftAmount) > 0) {
				menuHTML += ' style="left:-' + (i * tnMenuShiftAmount) + 'px;"';
			}

			menuHTML += '><div class="tnRightBevelOff"><div class="tnMenuItem" '

			if ((menuName == "store") || (menuName == "company")) {
				menuHTML += 'style="text-align:right;" ';
			}

			menuHTML += 'onClick="'+linkURL+'" onMouseOver="changeBGitems(this, MouseOverState);showTnDD();" '
			menuHTML += 'onMouseOut="changeBGitems(this, MouseOffState);hideTnDD(true);">'

			if (ie5) {
				menuHTML += '<nobr>' + tnMenu[menuName + i][0] + '</nobr>';
			} else {
				menuHTML += tnMenu[menuName + i][0];
			}

			menuHTML += '</div></div></div>\n';
			i++;
		}
		menuHTML += '<div class="tnLeftBevelBottom"'

		if ((i * tnMenuShiftAmount) > 0) {
			menuHTML += ' style="left:-' + ((i * tnMenuShiftAmount) - 3) + 'px;"';
		}

		menuHTML += '><div class="tnRightBevelBottom"><div class="tnMenuBottom" '
		menuHTML += '>&nbsp;</div></div></div>\n';

		return menuHTML;
	}

//** Calculates max width of layer (if first time thru), and sets the outer DIV to that size. **
	function calcAndSetWidth(menuName) {
		var i;
		if (tnMenuWidth[menuName] <= 0) {
		//** Calc max width of inner DIVs **
		//** IE Mac width is pre-set before we get here, so these calcs will never be run.
			for (i=0; i<LAYtnMenu.childNodes.length; i++) {
				if (LAYtnMenu.childNodes[i].offsetWidth > tnMenuWidth[menuName]) {
					tnMenuWidth[menuName] = LAYtnMenu.childNodes[i].offsetWidth;
				}
			}
		}

		LAYtnMenu.style.width = tnMenuWidth[menuName] + "px";
	}


//** Rollover function **
	function changeBGitems(LAYer, stateArray) {
		if (PreloadComplete) {
			LAYer.parentNode.parentNode.className = stateArray[0];
			LAYer.style.backgroundColor = stateArray[1];
			LAYer.parentNode.className = stateArray[2];
		}
	}


//** Top Nav Dropdown functions **
//** Check PreloadComplete on these just in case **
	function showTnDD() {
		if (PreloadComplete) {
			NotInMenuNow = false;
			LAYtnMenu.style.visibility = "inherit";
		}
	}

	function hideTnDD(FirstTry) {
		if (PreloadComplete) {
			if (FirstTry) {
				NotInMenuNow = true;
				setTimeout("hideTnDD(false)", 50);
			} else if (NotInMenuNow) {
				LAYtnMenu.style.visibility = "hidden";
				LAYtnTable.className = "blankTNbg";
			}
		}
	}


	function openTnDD(menuName, evt) {
		var MenuEdge, MDxCoord, MDyCoord;
		if (!evt) evt = event;

		if (PreloadComplete) {
		//** Hide menu and move it off the page.  This resolves menu flicker. **
			NotInMenuNow = true;
			hideTnDD(menuName, false);
			LAYtnMenu.style.left = -200;
			LAYtnMenu.style.top = -200;

			LAYtnTable.className = menuName + "TNbg";

		//** If we haven't viewed this menu before, write out its contents and store in array. **
			if (tnContents[menuName] == "") {
				tnContents[menuName] = tnBuild(menuName);
			}

		//** If contents is false, quit. **
			if (!tnContents[menuName]) {
				NotInMenuNow = false;
				return;
			}

			if (ie) {
				LAYtnMenu.style.width = "10px";
			} else {
				LAYtnMenu.style.width = "auto";
			}

			LAYtnMenu.innerHTML = tnContents[menuName];

			calcAndSetWidth(menuName);

		//** Don't need to calculate right edge of menu. **
		//** Right menus are designed to be right-aligned. **
		//** Overflow past right side of page content should NEVER HAPPEN. **

			MDxCoord = eventXoffset(evt);
			MDyCoord = eventYoffset(evt);

		//** Put in IE Mac resize fix (add & subtract 1px) here if we need it. **				

		//** Set left & top coordinates. **
			if ((menuName == "store") || (menuName == "company")) {
				LAYtnMenu.style.left = MDxCoord + tnMenuShiftAmt[menuName] - tnMenuWidth[menuName];
			} else {
				LAYtnMenu.style.left = MDxCoord + tnMenuShiftAmt[menuName];
			}

			LAYtnMenu.style.top = MDyCoord + 27;

			showTnDD();
		}
	}

/*** Generic Function Library **/

	function divHREF(varHref, target) {
		if (target) {
			// code goes here
		} else {
			document.location.href = varHref;
		}
	}


//** Second Level Nav Rollover function **
	function secOver(LAYer, idx) {
		if (PreloadComplete) {
			LAYer.className = "ovrNav_" + idx;
		}
	}

//** Second Level Nav Rolloff function **
	function secOff(LAYer, idx) {
		if (PreloadComplete) {
			LAYer.className = "offNav_" + idx;
		}
	}

//** Third Level Nav Rollover function **
	function thiOver(LAYer) {
		if (PreloadComplete) {
			LAYer.className = "sideNavEleOver";
		}
	}

//** Third Level Nav Rolloff function **
	function thiOff(LAYer) {
		if (PreloadComplete) {
			LAYer.className = "sideNavEle";
		}
	}


//********************************
//** Query String Parsing START **
//********************************

	// This loads all variables in a querystring into an associative array named qsVars
	// I.e., qsVars[variable_name] == variable_value when querystring is ?variable_name=variable_value&...
	var qsVars = new Array();

	var queryString = location.search;

	if (queryString != "") {
 		// -- get rid of ? at start --
  		var qsdata = queryString.slice(1,queryString.length);
		var qsvalues = qsdata.split("&");
		for (i=0; i < qsvalues.length; i++) {
			var qsvaluepair = qsvalues[i].split("=");
			//alert(qsvaluepair[0]);
			//alert(qsvaluepair[1]);
			qsVars[qsvaluepair[0]] = qsvaluepair[1];
		}
	}

//********************************
//** Query String Parsing END **
//********************************

//****************************
//** Flash Sniffing START ****
//****************************

	// Check for Flash, set vars if T/F
		var Flash4 = false;
		var Flash5 = false;
		var Flash6 = false;
		var Flash7 = false;
		var Flash8 = false;
		var FlashEnabled = false;
		var Flash7Enabled = false;
		var Flash8Enabled = false;
	// Default is False, so we only need to set it as True.
		if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) {
			// Check for Flash in Netscape
			var nsFlash = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
			if (nsFlash) {
				var FlashVer = parseInt(nsFlash.description.substring(nsFlash.description.indexOf(".")-1));
				if (FlashVer <= 8) {
					Flash8 = true;
				} else if (FlashVer <= 7) {
					Flash7 = true;
				} else if (FlashVer <= 6) {
					Flash6 = true;
				} else if (FlashVer == 5) {
					Flash5 = true;
				} else if (FlashVer == 4) {
					Flash4 = true;
				} 
			}
		} else if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
			var f4Inst;
			var f5Inst;
			var f6Inst;
			var f7Inst;
			var f8Inst;

			eval('try { f4Inst = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.4"); f5Inst = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.5"); f6Inst = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); f7Inst = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); f8Inst = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.8"); } catch (e) { }');

			if (f8Inst != null) {
				Flash8 = true;
			} else if (f7Inst != null) {
				Flash7 = true;
			} else if (f6Inst != null) {
				Flash6 = true;
			} else if (f5Inst != null) {
				Flash5 = true;
			} else if (f4Inst != null) {
				Flash4 = true;
			} 

			f4Inst = null;
			f5Inst = null;
			f6Inst = null;
			f7Inst = null;
			f8Inst = null;
		}

		if (qsVars['flash'] == 'disabled') {
			Flash4 = false;
			Flash5 = false;
			Flash6 = false;
			Flash7 = false;
			Flash8 = false;
			// FlashEnabled default is false
		} else if (Flash8) {
			Flash8Enabled = true;
			Flash7Enabled = true;
			FlashEnabled = true;
		} else if (Flash7) {
			Flash7Enabled = true;
			FlashEnabled = true;
		} else if (Flash6) {
			FlashEnabled = true;
		}
		

//**************************
//** Flash Sniffing END ****
//**************************

//*****************************
//** Misc Functions BEGIN *****
//*****************************

	function CheckMaxLength(element, maxLength, field) {
		var len = element.value.length;
		var msg = "Your " + field + " is " + len + " in length. Maximum allowed is " + maxLength + ".";
		if (len > maxLength)
			alert(msg);
	}
	
	function hidediv(div_id) {
		document.getElementById(div_id).style.display = 'none';
	}
	function showdiv(div_id) {
		document.getElementById(div_id).style.display = 'block';
	}

	function HideSubDivs(div_id) {
	    var mainID = document.getElementById(div_id);
	    var subDivs = mainID.getElementsByTagName('div');
	    for (var i=0;i<subDivs.length;i++){
		    hidediv(subDivs[i].id);
	    }
    }
    
    

    
        
    
    
//*****************************
//** Misc Functions END *******
//*****************************


//============================================================================
// Description: function to pop up a small window (duh). If offset values are
// not given, then window is centered on the screen.
// Author: Adam Weston
// Usage: popup('page.html', 'name', width, height, toolbars, scrollbars, left_offset, top_offset);

	function popup(loc, name, w, h, tb, sb, x, y) {
		if(!x && !y) {
			var scr_x = screen.width;
			var scr_y = screen.height;
			var x = (scr_x/2)-(w/2);
			var y = (scr_y/2)-(h/2);
		}
		
		var tb = (!tb) ? "yes" : "no";
		var sb = (!sb) ? "yes" : "no";
		var mb = (window.print) ? "no" : "yes";

		popupwin = window.open(loc, name, "toolbar="+tb+",location=no,directories=no,status=no,menubar="+mb+",scrollbars="+sb+",resizable=no,width="+w+",height="+h+",left="+x+",top="+y);
		popupwin.focus();
	}
	

//*******************************
//** Open New Window From NIRF **
//*******************************

	function openwin(loc, name){
		newwin = window.open(loc, name);
	}
	
	
	
	
	
	
//***********************************************************************************
//** Flash Sniffing/Inserter -- NEW -- Use this to fix IE graybox Issue -- START ****
//***********************************************************************************

/*  SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/  */

if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){
_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";
}else{
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}
_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
var _25=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_25=new deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_23&&_25.major>_23.major){return _25;}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
catch(e){}}}
return _25;};
deconcept.PlayerVersion=function(_29){
this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
this.minor=parseInt(_29[1])||0;
this.rev=parseInt(_29[2])||0;};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};
deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(q){
var _2d=q.indexOf(_2b+"=");
var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
if(q.length>1&&_2d>-1){
return q.substring(q.indexOf("=",_2d)+1,_2e);
}}return "";}};
if(Array.prototype.push==null){
Array.prototype.push=function(_2f){
this[this.length]=_2f;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject; // for backwards compatibility
var SWFObject=deconcept.SWFObject;

//***********************************
//** Flash Sniffing/Inserter END ****
//***********************************





/*
 * This file contains functions to generate OBJECT and EMBED tags for QuickTime content. 
 */

/************** LOCALIZABLE GLOBAL VARIABLES ****************/

var gArgCountErr =	'The "%%" function requires an even number of arguments.'
				+	'\nArguments should be in the form "atttributeName", "attributeValue", ...';

/******************** END LOCALIZABLE **********************/

var gTagAttrs				= null;
var gQTGeneratorVersion		= 1.0;

function AC_QuickTimeVersion()	{ return gQTGeneratorVersion; }

function _QTComplain(callingFcnName, errMsg)
{
    errMsg = errMsg.replace("%%", callingFcnName);
	alert(errMsg);
}

function _QTAddAttribute(prefix, slotName, tagName)
{
	var		value;

	value = gTagAttrs[prefix + slotName];
	if ( null == value )
		value = gTagAttrs[slotName];

	if ( null != value )
	{
		if ( 0 == slotName.indexOf(prefix) && (null == tagName) )
			tagName = slotName.substring(prefix.length); 
		if ( null == tagName ) 
			tagName = slotName;
		return tagName + '="' + value + '" ';
	}
	else
		return "";
}

function _QTAddObjectAttr(slotName, tagName)
{
	// don't bother if it is only for the embed tag
	if ( 0 == slotName.indexOf("emb#") )
		return "";

	if ( 0 == slotName.indexOf("obj#") && (null == tagName) )
		tagName = slotName.substring(4); 

	return _QTAddAttribute("obj#", slotName, tagName);
}

function _QTAddEmbedAttr(slotName, tagName)
{
	// don't bother if it is only for the object tag
	if ( 0 == slotName.indexOf("obj#") )
		return "";

	if ( 0 == slotName.indexOf("emb#") && (null == tagName) )
		tagName = slotName.substring(4); 

	return _QTAddAttribute("emb#", slotName, tagName);
}


function _QTAddObjectParam(slotName, generateXHTML)
{
	var		paramValue;
	var		paramStr = "";
	var		endTagChar = (generateXHTML) ? ' />' : '>';

	if ( -1 == slotName.indexOf("emb#") )
	{
		// look for the OBJECT-only param first. if there is none, look for a generic one
		paramValue = gTagAttrs["obj#" + slotName];
		if ( null == paramValue )
			paramValue = gTagAttrs[slotName];

		if ( 0 == slotName.indexOf("obj#") )
			slotName = slotName.substring(4); 
	
		if ( null != paramValue )
			paramStr = '  <param name="' + slotName + '" value="' + paramValue + '"' + endTagChar + '\n';
	}

	return paramStr;
}

function _QTDeleteTagAttrs()
{
	for ( var ndx = 0; ndx < arguments.length; ndx++ )
	{
		var attrName = arguments[ndx];
		delete gTagAttrs[attrName];
		delete gTagAttrs["emb#" + attrName];
		delete gTagAttrs["obj#" + attrName];
	}
}

		

// generate an embed and object tag, return as a string
function _QTGenerate(callingFcnName, generateXHTML, args)
{
	// is the number of optional arguments even?
	if ( args.length < 4 || (0 != (args.length % 2)) )
	{
		_QTComplain(callingFcnName, gArgCountErr);
		return "";
	}
	
	// allocate an array, fill in the required attributes with fixed place params and defaults
	gTagAttrs = new Array();
	gTagAttrs["src"] = args[0];
	gTagAttrs["width"] = args[1];
	gTagAttrs["height"] = args[2];
	gTagAttrs["classid"] = "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";
	gTagAttrs["pluginspage"] = "http://www.apple.com/quicktime/download/";

	// set up codebase attribute with specified or default version before parsing args so
	//  anything passed in will override
	var activexVers = args[3]
	if ( (null == activexVers) || ("" == activexVers) )
		activexVers = "6,0,2,0";
	gTagAttrs["codebase"] = "http://www.apple.com/qtactivex/qtplugin.cab#version=" + activexVers;

	var	attrName,
		attrValue;

	// add all of the optional attributes to the array
	for ( var ndx = 4; ndx < args.length; ndx += 2)
	{
		attrName = args[ndx].toLowerCase();
		attrValue = args[ndx + 1];

		// "name" and "id" should have the same value, the former goes in the embed and the later goes in
		//  the object. use one array slot 
		if ( "name" == attrName || "id" == attrName )
			gTagAttrs["name"] = attrValue;

		else 
			gTagAttrs[attrName] = attrValue;
	}

	// init both tags with the required and "special" attributes
	var objTag =  '<object '
					+ _QTAddObjectAttr("classid")
					+ _QTAddObjectAttr("width")
					+ _QTAddObjectAttr("height")
					+ _QTAddObjectAttr("codebase")
					+ _QTAddObjectAttr("name", "id")
					+ _QTAddObjectAttr("tabindex")
					+ _QTAddObjectAttr("hspace")
					+ _QTAddObjectAttr("vspace")
					+ _QTAddObjectAttr("border")
					+ _QTAddObjectAttr("align")
					+ _QTAddObjectAttr("class")
					+ _QTAddObjectAttr("title")
					+ _QTAddObjectAttr("accesskey")
					+ _QTAddObjectAttr("noexternaldata")
					+ '>\n'
					+ _QTAddObjectParam("src", generateXHTML);
	var embedTag = '  <embed '
					+ _QTAddEmbedAttr("src")
					+ _QTAddEmbedAttr("width")
					+ _QTAddEmbedAttr("height")
					+ _QTAddEmbedAttr("pluginspage")
					+ _QTAddEmbedAttr("name")
					+ _QTAddEmbedAttr("align")
					+ _QTAddEmbedAttr("tabindex");

	// delete the attributes/params we have already added
	_QTDeleteTagAttrs("src","width","height","pluginspage","classid","codebase","name","tabindex",
					"hspace","vspace","border","align","noexternaldata","class","title","accesskey");

	// and finally, add all of the remaining attributes to the embed and object
	for ( var attrName in gTagAttrs )
	{
		attrValue = gTagAttrs[attrName];
		if ( null != attrValue )
		{
			embedTag += _QTAddEmbedAttr(attrName);
			objTag += _QTAddObjectParam(attrName, generateXHTML);
		}
	} 

	// end both tags, we're done
	return objTag + embedTag + '> </em' + 'bed>\n</ob' + 'ject' + '>';
}

// return the object/embed as a string
function QT_GenerateOBJECTText()
{
	return _QTGenerate("QT_GenerateOBJECTText", false, arguments);
}

function QT_GenerateOBJECTText_XHTML()
{
	return _QTGenerate("QT_GenerateOBJECTText_XHTML", true, arguments);
}

function QT_WriteOBJECT()
{
	document.writeln(_QTGenerate("QT_WriteOBJECT", false, arguments));
}

function QT_WriteOBJECT_XHTML()
{
	document.writeln(_QTGenerate("QT_WriteOBJECT_XHTML", true, arguments));
}



//___________________________  BEGIN TOPNAV ___________________________//
    
    // show iframe helper for topnav dropdown
    function showIFrame()
    {
        var iFRef = document.getElementById('dropcover');
        var divRef = document.getElementById('mp'); //my pregnancy dropdown list

            iFRef.style.width = divRef.offsetWidth;
            iFRef.style.height = divRef.offsetHeight;
            iFRef.style.top = divRef.style.top;
            iFRef.style.left = divRef.style.left;
            iFRef.style.zIndex = divRef.style.zIndex -1;
            iFRef.style.display = "block";

    }
    // topnav hover function for IE

    tnHover = function() {
	    var topNav = document.getElementById("topnav");
	    if (topNav == null) return;
    	
	    var tnEls = topNav.getElementsByTagName("LI");
	    if (tnEls == null) return;
    	
	    for (var i=0; i<tnEls.length; i++) {
		    tnEls[i].onmouseover=function() {
			    this.className+=" tnhover";
		    }
		    tnEls[i].onmouseout=function() {
			    this.className=this.className.replace(new RegExp(" tnhover\\b"), "");
		    }
	    }
    }
    if (window.attachEvent) window.attachEvent("onload", tnHover);

    //___________________________  END TOPNAV ___________________________//
    
    
