<!-- //
	function videoPlayer (in_path) {
		
		var v1Dimensions = "height=630, width=917";
		var v2Dimensions = "height=662, width=991";
		var playerDimensions = v2Dimensions; // default
		
		//if the file matches the kids player v1 path then use the v1 dimensions
//	if 	((in_path.indexOf('/video/player/animals.html') == 0)||
//			(in_path.indexOf('/video/player/environment.html') == 0)||
//			(in_path.indexOf('/video/player/featured-videos.html') == 0)||
//			(in_path.indexOf('/video/player/kids.html') == 0)||
//			(in_path.indexOf('/video/player/people-and-places.html') == 0)||
//			(in_path.indexOf('/video/player/world-music.html') == 0)){
	
		//if (in_path.indexOf('/video/player/kids.html')>-1){
		//	playerDimensions = v1Dimensions;
		//}
		
		var ngvideoplayer = window.open (	in_path, 
																			'ngvideoplayer', 
																			playerDimensions + ', toolbar=no, location=no, ' + 
																			'directories=no, status=yes, menubar=no, resizable=yes, scrollbars=no');

		if (ngvideoplayer)
			var popUpsBlocked = false
		else
			var popUpsBlocked = true
	
		if (popUpsBlocked)
			alert('In order to display the video player, please adjust your browser settings\nto allow for pop-up windows from nationalgeographic.com.');

		if (window.focus) { ngvideoplayer.focus() }
	}

// code added in support of WEBDEV-411

function embedSingleTitlePlayer(vid, siteid, adtag, videoWidth, videoHeight, autoplay, playerdivid){
	if(videoWidth == undefined) var videoWidth = 486;
	if(videoHeight == undefined) var videoHeight = 412;
	if(autoplay == undefined) var autoplay = false;
	if(adtag == undefined) var adtag = "http://ad.doubleclick.net/pfadx/ng.videoplayer/default;sz=400x300;tile=1";
	if(playerdivid == undefined) playerdivid = "single_title_player";
	
	var srcURL = "http://video.nationalgeographic.com/video/player/flash/single-title/cdn-player/single-title-player.swf";
	if(siteid == "singletitlekids" || siteid == "blogskids"){
		srcURL = "http://video.nationalgeographic.com/video/player/flash/single-title/cdn-player/single-title-player-kids.swf";
		videoHeight = Number(videoHeight)+66;
	}
	else if(siteid == "greeneffectmain"){
		srcURL = "http://ngm.nationalgeographic.com/greenguide/swf/green-effect-player.swf";
	}

	ngsEmbed.flash({ 	
	src: srcURL, 
	width: videoWidth,
	height: videoHeight,
	scale: "noscale",
	flashvars:"vid="+vid+"&siteid="+siteid+"&autoplay="+autoplay+"&adtag="+adtag,
	version:"9",
	wmode:"opaque"
	}, playerdivid);
}

//NGS embed code

if(window.NGS==undefined){
var NGS={};
// } //jgo 090205
var ngsEmbed={version:"1.0.0",embed:"",flash:function(_262,_263,_264){
this.embed=new NGS.Flash(_262);
this.embed.write(_263,_264);
},quicktime:function(_265,_266){
this.embed=new NGS.Quicktime(_265);
this.embed.write(_266);
}};
NGS.AbstractPlugin=function(){
return true;
};
NGS.AbstractPlugin.prototype={embedObject:"",config:"",cName:"undefined",targetDiv:"null",write:function(d,cl){
this.cName=cl;
if(!this.embedObject){
this.embedObject=this.getEmbed();
}
this.embedObject.write(this.config,d);
if(this.cName!=undefined&&this.cName!="undefined"){
this.targetDiv=d;
NGS.onload(Delegate.create(this,this.changeClass));
}
},getEmbed:function(){
NGS.ErrorMsg("'getEmbed' method must be overriden");
},detect:function(){
NGS.ErrorMsg("'detect' method must be overriden");
},getConfig:function(){
return this.config;
},changeClass:function(){
NGS.changeStyleClass(this.cName,this.targetDiv);
}};
NGS.Flash=function(c){
this.config=c;
return true;
};
NGS.Flash.prototype=new NGS.AbstractPlugin();
NGS.Flash.prototype.getEmbed=function(){
return new NGS.UfoWrapper();
};
NGS.Flash.prototype.detect=function(){
};
NGS.ErrorMsg=function(msg){
throw ("NGS ERROR: "+msg);
};
NGS.AbstractFlash=function(){
return true;
};
NGS.AbstractFlash.prototype={_required:["src","width","height","version","build"],_optional:["id","name","align","swliveconnect","play","loop","menu","quality","scale","salign","wmode","bgcolor","base","flashvars","devicefont","allowscriptaccess","seamlesstabbing","allowfullscreen","expressInstall"],initRequired:function(c){
var _26c=this._required.length;
for(var i=0;i<_26c;i++){
if(typeof c[this._required[i]]=="undefined"){
if(this._required[i]=="build"){
c[this._required[i]]="0";
}else{
NGS.ErrorMsg("Required parameter '"+this._required[i]+"' not found");
}
}
}
return c;
},initOptional:function(c){
if(typeof c["allowfullscreen"]=="undefined"){
c["allowfullscreen"]="true";
}
return c;
},write:function(){
NGS.ErrorMsg("'write' method must be overriden");
},detect:function(){
NGS.ErrorMsg("'detect' method must be overriden");
},optional:function(){
return this._optional;
},required:function(){
return this._required;
}};
NGS.UfoWrapper=function(){
this.typename="ufo wrapper";
return true;
};
NGS.UfoWrapper.prototype=new NGS.AbstractFlash();
NGS.UfoWrapper.prototype.write=function(_26f,div){
_26f=this.initRequired(_26f);
_26f=this.initOptional(_26f);
var FO={movie:_26f.src,width:_26f.width,height:_26f.height,majorversion:_26f.version,build:_26f.build};
var _272=this.optional();
var _273=_272.length;
for(var i=0;i<_273;i++){
if(typeof _26f[_272[i]]!="undefined"){
FO[_272[i]]=_26f[_272[i]];
}
}
UFO.create(FO,div);
};
/*********************************************************/
				

/*	Unobtrusive Flash Objects (UFO) v3.12 <http://www.bobbyvandersluis.com/ufo/>
	Copyright 2005, 2006 Bobby van der Sluis
	This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/

var UFO={requiredAttrParams:["movie","width","height","majorversion","build"],optionalAttrEmb:["name","swliveconnect","align"],optionalAttrObj:["id","align"],optionalAttrParams:["play","loop","menu","quality","scale","salign","wmode","bgcolor","base","flashvars","devicefont","allowscriptaccess","seamlesstabbing","allowfullscreen"],ximovie:"ufo.swf",xiwidth:"215",xiheight:"138",is_w3cdom:(typeof document.getElementById!="undefined"&&typeof document.getElementsByTagName!="undefined"&&(typeof document.createElement!="undefined"||typeof document.createElementNS!="undefined")),is_ie:(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1),is_safari:(navigator.userAgent.toLowerCase().indexOf("safari")!=-1),is_win:(navigator.userAgent.toLowerCase().indexOf("win")!=-1),is_mac:(navigator.userAgent.toLowerCase().indexOf("mac")!=-1),is_XML:(typeof document.contentType!="undefined"&&document.contentType.indexOf("xml")>-1),foList:[],create:function(FO,id){
if(!UFO.is_w3cdom){
return;
}
UFO.foList[id]=UFO.updateFO(FO);
UFO.createStyleRule("#"+id,"visibility:hidden;");
UFO.domLoad(id);
},updateFO:function(FO){
if(typeof FO.xi!="undefined"&&FO.xi=="true"){
if(typeof FO.ximovie=="undefined"){
FO.ximovie=UFO.ximovie;
}
if(typeof FO.xiwidth=="undefined"){
FO.xiwidth=UFO.xiwidth;
}
if(typeof FO.xiheight=="undefined"){
FO.xiheight=UFO.xiheight;
}
}else{
FO.xi=false;
}
FO.domLoaded=false;
return FO;
},domLoad:function(id){
var _279=setInterval(function(){
if((document.getElementsByTagName("body")[0]!=null||document.body!=null)&&document.getElementById(id)!=null){
UFO.main(id);
clearInterval(_279);
}
},250);
if(typeof document.addEventListener!="undefined"){
document.addEventListener("DOMContentLoaded",function(){
UFO.main(id);
clearInterval(_279);
},null);
}
},main:function(id){
if(document.getElementById(id)){
var FO=UFO.foList[id];
if(FO.domLoaded){
return;
}
UFO.foList[id].domLoaded=true;
document.getElementById(id).style.visibility="hidden";
if(UFO.hasRequiredAttrParams(id)){
if(UFO.hasFlashVersion(FO.majorversion,FO.build)){
if(typeof FO.setcontainercss!="undefined"&&FO.setcontainercss=="true"){
UFO.setContainerCSS(id);
}
UFO.writeFlashObject(id);
}else{
if(FO.xi&&UFO.hasFlashVersion("6","65")){
UFO.createModalDialog(id);
}
}
}
document.getElementById(id).style.visibility="visible";
}
},createStyleRule:function(_27c,_27d){
if(UFO.is_ie&&UFO.is_mac){
return;
}
var head=document.getElementsByTagName("head")[0];
var _27f=UFO.createElement("style");
if(!(UFO.is_ie&&UFO.is_win)){
var _280=document.createTextNode(_27c+" {"+_27d+"}");
_27f.appendChild(_280);
}
_27f.setAttribute("type","text/css");
_27f.setAttribute("media","screen");
head.appendChild(_27f);
if(UFO.is_safari&&UFO.is_XML){
head.innerHTML+="";
}
if(UFO.is_ie&&UFO.is_win&&document.styleSheets&&document.styleSheets.length>0){
var _281=document.styleSheets[document.styleSheets.length-1];
if(typeof _281.addRule=="object"){
_281.addRule(_27c,_27d);
}
}
},setContainerCSS:function(id){
var FO=UFO.foList[id];
var _284=(FO.width.indexOf("%")==-1)?"px":"";
var _285=(FO.height.indexOf("%")==-1)?"px":"";
UFO.createStyleRule("#"+id,"width:"+FO.width+_284+"; height:"+FO.height+_285+";");
if(FO.width=="100%"){
UFO.createStyleRule("body","margin-left:0; margin-right:0; padding-left:0; padding-right:0;");
}
if(FO.height=="100%"){
UFO.createStyleRule("html","height:100%; overflow:hidden;");
UFO.createStyleRule("body","margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; height:100%;");
}
},createElement:function(el){
return (typeof document.createElementNS!="undefined")?document.createElementNS("http://www.w3.org/1999/xhtml",el):document.createElement(el);
},hasRequiredAttrParams:function(id){
var FO=UFO.foList[id];
for(var i=0;i<UFO.requiredAttrParams.length;i++){
if(typeof FO[UFO.requiredAttrParams[i]]=="undefined"){
return false;
}
}
return true;
},hasFlashVersion:function(_28a,_28b){
var _28c=parseFloat(_28a+"."+_28b);
if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){
var desc=navigator.plugins["Shockwave Flash"].description;
if(desc){
var _28e=desc.replace(/^.*\s+(\S+\s+\S+$)/,"$1");
var _28f=parseInt(_28e.replace(/^(.*)\..*$/,"$1"));
var _290=(_28e.indexOf("r")==-1)?0:parseInt(_28e.replace(/^.*r(.*)$/,"$1"));
var _291=parseFloat(_28f+"."+_290);
}
}else{
if(window.ActiveXObject){
try{
var _292=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
var desc=_292.GetVariable("$version");
if(desc){
var _293=desc.replace(/^\S+\s+(.*)$/,"$1").split(",");
var _28f=parseInt(_293[0]);
var _290=parseInt(_293[2]);
var _291=parseFloat(_28f+"."+_290);
}
}
catch(e){
}
}
}
if(typeof _291!="undefined"){
return (_291>=_28c?true:false);
}
return false;
},writeFlashObject:function(id){
var el=document.getElementById(id);
if(typeof el.innerHTML=="undefined"){
return;
}
var FO=UFO.foList[id];
if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){
try{
el.innerHTML="ufo-test";
}
catch(e){
}
if(el.innerHTML!="ufo-test"){
while(el.hasChildNodes()){
el.removeChild(el.firstChild);
}
var _297=UFO.createElement("embed");
_297.setAttribute("type","application/x-shockwave-flash");
_297.setAttribute("pluginspage","http://www.macromedia.com/go/getflashplayer");
_297.setAttribute("src",FO.movie);
_297.setAttribute("width",FO.width);
_297.setAttribute("height",FO.height);
for(var i=0;i<UFO.optionalAttrEmb.length;i++){
if(typeof FO[UFO.optionalAttrEmb[i]]!="undefined"){
_297.setAttribute(UFO.optionalAttrEmb[i],FO[UFO.optionalAttrEmb[i]]);
}
}
for(var i=0;i<UFO.optionalAttrParams.length;i++){
if(typeof FO[UFO.optionalAttrParams[i]]!="undefined"){
_297.setAttribute(UFO.optionalAttrParams[i],FO[UFO.optionalAttrParams[i]]);
}
}
el.appendChild(_297);
}else{
var _299="";
for(var i=0;i<UFO.optionalAttrEmb.length;i++){
if(typeof FO[UFO.optionalAttrEmb[i]]!="undefined"){
_299+=" "+UFO.optionalAttrEmb[i]+"=\""+FO[UFO.optionalAttrEmb[i]]+"\"";
}
}
for(var i=0;i<UFO.optionalAttrParams.length;i++){
if(typeof FO[UFO.optionalAttrParams[i]]!="undefined"){
_299+=" "+UFO.optionalAttrParams[i]+"=\""+FO[UFO.optionalAttrParams[i]]+"\"";
}
}
el.innerHTML="<embed type=\"application/x-shockwave-flash\" src=\""+FO.movie+"\" width=\""+FO.width+"\" height=\""+FO.height+"\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\""+_299+"></embed>";
}
}else{
var _29a="";
for(var i=0;i<UFO.optionalAttrObj.length;i++){
if(typeof FO[UFO.optionalAttrObj[i]]!="undefined"){
_29a+=" "+UFO.optionalAttrObj[i]+"=\""+FO[UFO.optionalAttrObj[i]]+"\"";
}
}
var _29b="";
for(var i=0;i<UFO.optionalAttrParams.length;i++){
if(typeof FO[UFO.optionalAttrParams[i]]!="undefined"){
_29b+="<param name=\""+UFO.optionalAttrParams[i]+"\" value=\""+FO[UFO.optionalAttrParams[i]]+"\" />";
}
}
var _29c=(window.location.protocol=="https:"?"https:":"http:");
el.innerHTML="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\""+_29a+" width=\""+FO.width+"\" height=\""+FO.height+"\" codebase=\""+_29c+"//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+FO.majorversion+",0,"+FO.build+",0\"><param name=\"movie\" value=\""+FO.movie+"\" />"+_29b+"</object>";
}
},cleanupIELeaks:function(){
var _29d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_29d.length;i++){
for(var x in _29d[i]){
if(typeof _29d[i][x]=="function"){
_29d[i][x]=null;
}
}
}
},createModalDialog:function(id){
var FO=UFO.foList[id];
UFO.createStyleRule("html","height:100%; overflow:hidden;");
UFO.createStyleRule("body","height:100%; overflow:hidden;");
UFO.createStyleRule("#xi-con","position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#333; filter:alpha(opacity:50); -khtml-opacity:0.5; -moz-opacity:0.5; opacity:0.5;");
UFO.createStyleRule("#xi-mod","position:absolute; left:50%; top:50%; margin-left: -"+(parseInt(FO.xiwidth)/2)+"px; margin-top: -"+(parseInt(FO.xiheight)/2)+"px; width:"+FO.xiwidth+"px; height:"+FO.xiheight+"px;");
var body=document.getElementsByTagName("body")[0];
var _2a3=UFO.createElement("div");
_2a3.setAttribute("id","xi-con");
var _2a4=UFO.createElement("div");
_2a4.setAttribute("id","xi-mod");
_2a3.appendChild(_2a4);
body.appendChild(_2a3);
var _2a5=window.location;
document.title=document.title.slice(0,47)+" - Flash Player Installation";
var _2a6=document.title;
var _2a7=(UFO.is_ie&&UFO.is_win)?"ActiveX":"PlugIn";
var _2a8=(typeof FO.xiurlcancel!="undefined")?"&xiUrlCancel="+FO.xiurlcancel:"";
var _2a9=(typeof FO.xiurlfailed!="undefined")?"&xiUrlFailed="+FO.xiurlfailed:"";
UFO.foList["xi-mod"]={movie:FO.ximovie,width:FO.xiwidth,height:FO.xiheight,majorversion:"6",build:"65",flashvars:"MMredirectURL="+_2a5+"&MMplayerType="+_2a7+"&MMdoctitle="+_2a6+_2a8+_2a9};
UFO.writeFlashObject("xi-mod");
},expressInstallCallback:function(){
var body=document.getElementsByTagName("body")[0];
var _2ab=document.getElementById("xi-con");
body.removeChild(_2ab);
UFO.createStyleRule("body","height:auto; overflow:auto;");
UFO.createStyleRule("html","height:auto; overflow:auto;");
}};
if(typeof window.attachEvent!="undefined"&&UFO.is_ie&&UFO.is_win){
window.attachEvent("onunload",UFO.cleanupIELeaks);
}
NGS.changeStyleClass=function(_2ac,_2ad){
var _2ae=document.getElementById(_2ad);
if(_2ae){
_2ae.className=_2ac;
}
};
NGS.onload=function(func){
if(document.getElementById){
if(typeof window.onload!="function"){
window.onload=func;
}else{
window.onload=Delegate.create(this,NGS.windowLoaded,func,window.onload);
}
}
};
NGS.windowLoaded=function(obj,func,_2b2){
if(_2b2){
_2b2();
func();
}
};
function Delegate(){
}
Delegate.create=function(o,f){
var a=new Array();
var l=arguments.length;
for(var i=2;i<l;i++){
a[i-2]=arguments[i];
}
return function(){
var aP=[].concat(arguments,a);
f.apply(o,aP);
};
};


// end WEBDEV-411 code

} // end if(window.NGS==undefined){ jgo 090205

// -->