var containerAds=new Object;containerAds={alter:function(containerId,height,overflow){document.getElementById(containerId).style.overflow=overflow;document.getElementById(containerId).style.height=height+"px";window.scrollBy(0,0)}};function setCookie(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+path:"/")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie}function getCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0){return null}}else{begin+=2}var end=document.cookie.indexOf(";",begin);if(end==-1){end=dc.length}return unescape(dc.substring(begin+prefix.length,end))}function deleteCookie(name,path,domain){if(getCookie(name)){document.cookie=name+"="+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}}function getIP(){var ip='<!--#echo var="REMOTE_ADDR"-->';return ip}function swfGetCookie(flashId,flashVarName,cookieName){document.getElementById(flashId).SetVariable(flashVarName,readCookie(cookieName))}function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString()}else{var expires=""}document.cookie=name+"="+value+expires+"; path=/"}function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" "){c=c.substring(1,c.length)}if(c.indexOf(nameEQ)==0){return c.substring(nameEQ.length,c.length)}}return null}function eraseCookie(name){createCookie(name,"",-1)}var lcID;function msgAlert(strOutput){alert(strOutput)}function getMain_lcID(){lcID=Math.random();return lcID}function rsMain_lcID(){return lcID}function getLocation(){return document.location}var END_OF_INPUT=-1;var base64Chars=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"),reverseBase64Chars=new Array();for(var i=0;i<base64Chars.length;i++){reverseBase64Chars[base64Chars[i]]=i}var base64Str;var base64Count;function setBase64Str(str){base64Str=str;base64Count=0}function readBase64(){if(!base64Str){return END_OF_INPUT}if(base64Count>=base64Str.length){return END_OF_INPUT}var c=base64Str.charCodeAt(base64Count)&255;base64Count++;return c}function readReverseBase64(){if(!base64Str){return END_OF_INPUT}while(true){if(base64Count>=base64Str.length){return END_OF_INPUT}var nextCharacter=base64Str.charAt(base64Count);base64Count++;if(reverseBase64Chars[nextCharacter]){return reverseBase64Chars[nextCharacter]}if(nextCharacter=="A"){return 0}}return END_OF_INPUT}function ntos(n){n=n.toString(16);if(n.length==1){n="0"+n}n="%"+n;return unescape(n)}function encodeBase64(str){setBase64Str(str);var result="";var inBuffer=new Array(3);var lineCount=0;var done=false;while(!done&&(inBuffer[0]=readBase64())!=END_OF_INPUT){inBuffer[1]=readBase64();inBuffer[2]=readBase64();result+=(base64Chars[inBuffer[0]>>2]);if(inBuffer[1]!=END_OF_INPUT){result+=(base64Chars[((inBuffer[0]<<4)&48)|(inBuffer[1]>>4)]);if(inBuffer[2]!=END_OF_INPUT){result+=(base64Chars[((inBuffer[1]<<2)&60)|(inBuffer[2]>>6)]);result+=(base64Chars[inBuffer[2]&63])}else{result+=(base64Chars[((inBuffer[1]<<2)&60)]);result+=("=");done=true}}else{result+=(base64Chars[((inBuffer[0]<<4)&48)]);result+=("=");result+=("=");done=true}lineCount+=4;if(lineCount>=76){result+=("\n");lineCount=0}}return result}function decodeBase64(str){setBase64Str(str);var result="";var inBuffer=new Array(4);var done=false;while(!done&&(inBuffer[0]=readReverseBase64())!=END_OF_INPUT&&(inBuffer[1]=readReverseBase64())!=END_OF_INPUT){inBuffer[2]=readReverseBase64();inBuffer[3]=readReverseBase64();result+=ntos((((inBuffer[0]<<2)&255)|inBuffer[1]>>4));if(inBuffer[2]!=END_OF_INPUT){result+=ntos((((inBuffer[1]<<4)&255)|inBuffer[2]>>2));if(inBuffer[3]!=END_OF_INPUT){result+=ntos((((inBuffer[2]<<6)&255)|inBuffer[3]))}else{done=true}}else{done=true}}return result}var digitArray=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");function toHex(n){var result="";var start=true;for(var i=32;i>0;){i-=4;var digit=(n>>i)&15;if(!start||digit!=0){start=false;result+=digitArray[digit]}}return(result==""?"0":result)}function pad(str,len,pad){var result=str;for(var i=str.length;i<len;i++){result=pad+result}return result}function encodeHex(str){var result="";for(var i=0;i<str.length;i++){result+=pad(toHex(str.charCodeAt(i)&255),2,"0")}return result}function decodeHex(str){str=str.replace(new RegExp("s/[^0-9a-zA-Z]//g"));var result="";var nextchar="";for(var i=0;i<str.length;i++){nextchar+=str.charAt(i);if(nextchar.length==2){result+=ntos(eval("0x"+nextchar));nextchar=""}}return result}function divStyle(s,w,h,d,v,o,p,t,l){if(w!=-1){var containerWidth=w+"px";document.getElementById(s).style.width=containerWidth}if(h!=-1){var containerHeight=h+"px";document.getElementById(s).style.height=containerHeight}if(d!=0){document.getElementById(s).style.display=d}if(v!=0){document.getElementById(s).style.visibility=v}if(o!=0){document.getElementById(s).style.overflow=o}if(p!=0){document.getElementById(s).style.position=p}if(t){var containerTop=t+"px";document.getElementById(s).style.top=containerTop}if(l){var containerLeft=l+"px";document.getElementById(s).style.left=containerLeft}}function getMetaTagsData(attributeNameValue){var metas=document.getElementsByTagName("meta"),attributeContentValue="";for(var i=0;i<metas.length;i++){if(metas[i].getAttribute("name")==attributeNameValue){attributeContentValue=metas[i].getAttribute("content");break}}return attributeContentValue}function getMetaLaunchDate(){var pageHREFSplit=(window.location.href).split("/"),rootDirectory=pageHREFSplit[3],metaTagValue=getMetaTagsData("launchDate"),metaDateValue=metaTagValue.split("/");return metaDateValue[2]+metaDateValue[0]+metaDateValue[1]}function getMetaPageType(){var metaTypeValue=getMetaTagsData("type"),metaCategoryValue=getMetaTagsData("category"),legacyPageTemplate=metaTypeValue+"/"+metaCategoryValue,legacyTemplates=new Array(["framework/article","Article"],["framework/flashembed","Interactives"],["framework/flashembed-fullwidth","Interactives"],["framework/flashembed-xhtml","Interactives"],["framework/open","Interactives"],["framework/indices","Topic"],["framework/knowledge-site-lite","Topic"],["framework/photogallery","Interactives"],["framework_APL/homepage","Homepage"],["framework_APL/petplanet","Topic"],["framework_APL/screeningroom","Video Hub Legacy"],["framework_APL/screeningroom-feature","Video Hub Legacy"],["framework_DHC/center","Topic"],["framework_DHC/homepage","Homepage"],["framework_DSC/homepage","Homepage"],["framework_DSC/news-index","News"],["framework_DSC/news-subject","News"],["framework_DSC/news-article","News"],["framework_IDS/homepage","Homepage"],["framework_MIL/homepage","Homepage"],["framework_SCI/homepage","Homepage"],["framework_TLC/homepage","Homepage"],["framework_TUR/collection","Topic"],["framework_TUR/homepage","Homepage"],["news/brief","News"],["splash/marketing","Marketing"],["sweepstakes/doorway","Sweepstakes"],["sweepstakes/form","Sweepstakes"],["tests_CME/exam","Interactives"],["utilities/about","About"],["video/inpageplayer","Video Hub Legacy"],["video/gallery","Video Hub Legacy"]),legacyAssetType="";for(var i=0;i<legacyTemplates.length;i++){if(legacyPageTemplate==legacyTemplates[i][0]){legacyAssetType=legacyTemplates[i][1];break}}return legacyAssetType}function interactiveReload(){if(window.adbanner){window.adbanner.location.reload()}if(window.adtile){window.adtile.location.reload()}if(window.adtower){window.adtower.location.reload()}}var nav_click_count=0,rotate_count=1;function onShowNewFocus(id,oldFocus,newFocus){nav_click_count++;if(nav_click_count==rotate_count){nav_click_count=0;interactiveReload();OmniView("Ad_Refresh")}}function imageHoverHandler(imageId){var currentImage=document.getElementById(imageId);currentImage.src=currentImage.src.replace(/(\.[a-z0-9]+)$/i,"-on$1")}function imageNormalizeHandler(imageId){var currentImage=document.getElementById(imageId);currentImage.src=currentImage.src.replace(/-on(\.[a-z0-9]+)$/i,"$1")}function normalizeXHTMLData(object,encode){if(typeof object=="string"){object=document.getElementById(object)}var open="";var content="";var close="";var tagname=object.nodeName.toLowerCase();var emptytag=(object.nodeName.match(/area|base|basefont|br|col|frame|hr|img|input|isindex|link|meta|param/i))?true:false;open="<"+tagname;for(var i=0;i<object.attributes.length;i++){if(object.attributes[i].specified&&"null"!=object.attributes[i].value){open+=" "+object.attributes[i].name.toLowerCase()+'="'+object.attributes[i].value+'"'}}open+=(emptytag)?" />":">";if(!emptytag){for(var i=0;i<object.childNodes.length;i++){var node=object.childNodes[i];if(3==node.nodeType){content+=node.data}else{if(1==node.nodeType){content+=normalizeXHTMLData(object.childNodes[i],false)}else{content+=" "}}}close="</"+tagname+">"}return("undefined"==typeof(encode)||true==encode)?encodeURIComponent(open+content+close):open+content+close}function navigateTo(s,type){var url=s.options[s.selectedIndex].value;if((type)&&(type=="new")){window.open(url)}else{window.top.location.href=url}return false}function getParam(paramName,pos){var startPos=(pos)?pos:0;var url,paramBegin,paramEnd,valueBegin,paramValue;url=window.location.search;paramBegin=url.indexOf(paramName,startPos);if(paramBegin==-1){return false}paramEnd=paramBegin+paramName.length;param=url.substring(paramBegin,paramEnd);var valBegin=url.indexOf("=",paramEnd);var nextParam=url.indexOf("&",paramEnd);var valLen=(nextParam==-1)?(url.length-(valBegin)):(nextParam-valBegin);var valEnd=(nextParam==-1)?valBegin+valLen:nextParam;valueBegin=paramEnd+1;paramValue=url.substring(valueBegin,valEnd);if((nextParam!=-1)&&(valBegin>nextParam)){return getParam(param,paramEnd)}else{for(i=0;i<paramValue.length;i++){paramValue=paramValue.replace("+"," ");paramValue=paramValue.replace("%20"," ");paramValue=paramValue.replace("%26","&");paramValue=paramValue.replace("%27","'");paramValue=paramValue.replace("%28","(");paramValue=paramValue.replace("%29",")")}return paramValue}}var socialSharing=new Object;socialSharing={toggleme:function(utilityButton,container){var itemCount=2,utilityId="active-utility-toggle",swapElement;for(var i=1;i<=itemCount;i++){if(document.getElementById("share-menu-"+i+"-open")){var activeButton=document.getElementById(utilityId),activeMenu=document.getElementById("share-menu-"+i+"-open");swapElement=document.getElementById("share-menu-"+i+"-open").id;activeMenu.setAttribute("id","share-menu-"+i);activeButton.className=activeButton.className.replace("-open","");activeButton.setAttribute("id","");utilityButton.className=utilityButton.className.replace("-open","");utilityButton.style.display=""}}if((container+"-open")!=swapElement){document.getElementById(container).setAttribute("id",container+"-open");utilityButton.setAttribute("id",utilityId);utilityButton.className=utilityButton.className+"-open"}},stafPing:function(formObject,pingImage,submitButtonId,displayMessageToElementId){if(""!=formObject.toName.value&&""!=formObject.toAddress.value&&""!=formObject.fromName.value&&""!=formObject.fromAddress.value){var stafPingImage=new Image(1,1);stafPingImage.src="http://appsnew.discovery.com/webapps/staf/staf.jsp?subject="+formObject.subject.value+"&header1="+formObject.header1.value+"&header2=&header3=&format=standard&thanksFile="+encodeURIComponent(formObject.thanksFile.value)+"&refPage="+encodeURIComponent(formObject.refPage.value)+"&toName="+formObject.toName.value+"&toAddress="+formObject.toAddress.value+"&fromName="+formObject.fromName.value+"&fromAddress="+formObject.fromAddress.value+"&userMessage="+encodeURIComponent(formObject.userMessage.value);document.getElementById(submitButtonId).style.display="none";document.getElementById(displayMessageToElementId).innerHTML="<strong>Message Sent!</strong>";document.getElementById(pingImage).src=stafPingImage.src;document.getElementById("reset-email").style.display="block"}else{alert("Please provide your friend's name, their email address, your name and your email address.")}return false},countCharacters:function(formObject,pingImage,submitButtonId,displayMessageToElementId){var currentCount=field.value.length,characterLeft=maxCharacters-currentCount;document.getElementById(displayCountToElementId).value="characters left = "+characterLeft;if(field.value.length>maxCharacters){field.value=field.value.substring(0,maxCharacters)}else{displayCountToElementId.value=maxCharacters-field.value.length}},resetForm:function(){document.getElementById("toName").value="";document.getElementById("toAddress").value="";document.getElementById("fromName").value="";document.getElementById("fromAddress").value="";document.getElementById("userMessage").value="";document.getElementById("character-count").value="characters left = 100";document.getElementById("post-email-message").innerHTML="";document.getElementById("reset-email-over").style.display="none";document.getElementById("post-email").style.display="block"},closeEmail:function(){document.getElementById("email-overlay").style.display="none"},emailPanel:function(){document.getElementById("email-overlay").style.display="block";document.getElementById("character-count").value="characters left = 100";document.getElementById("post-email-message").innerHTML=""}};function placeEcommImagesToPage(ecommerceImageArray){for(var i=0;i<ecommerceImageArray.length;i++){ecommImage=new Image();ecommImage.src=ecommerceImageArray[i][0];var image=document.createElement("img");image.setAttribute("src",ecommImage.src);image.setAttribute("width",scaleEcommImageToSize(ecommImage,"width"));image.setAttribute("height",scaleEcommImageToSize(ecommImage,"height"));image.setAttribute("alt",ecommerceImageArray[i][1]);document.getElementById(ecommerceImageArray[i][2]).appendChild(image)}}function scaleEcommImageToSize(image,dimension){var maxWidth=80;var maxHeight=95;var scale=0;var scaledWidth=0;var scaledHeight=0;if((image.width>=maxWidth)&&(image.height>=maxHeight)){if((image.width-maxWidth)>=(image.height-maxHeight)){scaledWidth=maxWidth;scale=scaledWidth/image.width;scaledHeight=image.height*Math.floor(scale)}else{scaledHeight=maxHeight;scale=scaledHeight/image.height;scaledWidth=image.width*Math.floor(scale)}}if("width"==dimension){return scaledWidth}else{return scaledHeight}}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(swf,id,w,h,ver,c,quality,xiRedirectUrl,redirectUrl,detectKey){if(!document.getElementById){return}this.DETECT_KEY=detectKey?detectKey:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(swf){this.setAttribute("swf",swf)}if(id){this.setAttribute("id",id)}if(w){this.setAttribute("width",w)}if(h){this.setAttribute("height",h)}if(ver){this.setAttribute("version",new deconcept.PlayerVersion(ver.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(c){this.addParam("bgcolor",c)}var q=quality?quality:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var xir=(xiRedirectUrl)?xiRedirectUrl:window.location;this.setAttribute("xiRedirectUrl",xir);this.setAttribute("redirectUrl","");if(redirectUrl){this.setAttribute("redirectUrl",redirectUrl)}};deconcept.SWFObject.prototype={useExpressInstall:function(path){this.xiSWFPath=!path?"expressinstall.swf":path;this.setAttribute("useExpressInstall",true)},setAttribute:function(name,value){this.attributes[name]=value},getAttribute:function(name){return this.attributes[name]},addParam:function(name,value){this.params[name]=value},getParams:function(){return this.params},addVariable:function(name,value){this.variables[name]=value},getVariable:function(name){return this.variables[name]},getVariables:function(){return this.variables},getVariablePairs:function(){var variablePairs=new Array();var key;var variables=this.getVariables();for(key in variables){variablePairs[variablePairs.length]=key+"="+variables[key]}return variablePairs},getSWFHTML:function(){var swfNode="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}swfNode='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';swfNode+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var params=this.getParams();for(var key in params){swfNode+=[key]+'="'+params[key]+'" '}var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='flashvars="'+pairs+'"'}swfNode+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}swfNode='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';swfNode+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var params=this.getParams();for(var key in params){swfNode+='<param name="'+key+'" value="'+params[key]+'" />'}var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='<param name="flashvars" value="'+pairs+'" />'}swfNode+="</object>"}return swfNode},write:function(elementId){if(this.getAttribute("useExpressInstall")){var expressInstallReqVer=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(expressInstallReqVer)&&!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 elementId=="string")?document.getElementById(elementId):elementId;n.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var PlayerVersion=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){PlayerVersion=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var counter=3;while(axo){try{counter++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+counter);PlayerVersion=new deconcept.PlayerVersion([counter,0,0])}catch(e){axo=null}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");PlayerVersion=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always"}catch(e){if(PlayerVersion.major==6){return PlayerVersion}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}if(axo!=null){PlayerVersion=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","))}}}return PlayerVersion};deconcept.PlayerVersion=function(arrVersion){this.major=arrVersion[0]!=null?parseInt(arrVersion[0]):0;this.minor=arrVersion[1]!=null?parseInt(arrVersion[1]):0;this.rev=arrVersion[2]!=null?parseInt(arrVersion[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(param){var q=document.location.search||document.location.hash;if(param==null){return q}if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return pairs[i].substring((pairs[i].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var objects=document.getElementsByTagName("OBJECT");for(var i=objects.length-1;i>=0;i--){objects[i].style.display="none";for(var x in objects[i]){if(typeof objects[i][x]=="function"){objects[i][x]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;function windowOpen(url,name,width,height,scroll,resize){if(scroll==""){scroll="0"}if(resize==""){resize="0"}var options="width="+width+",height="+height+",status=0,toolbar=0,menubar=0,location=0,scrollbars="+scroll+",resizable="+resize;window.open(url,name,options);return false}function toParent(url){opener.location.href=url;window.close()};