

/* =Expand More (for profile and fact box)
-----------------------------------------------------------------------------*/

// document.write('<scr' + 'ipt type="text/javascript" language="JavaScript1.2" src="http://www.nationalgeographic.com/global/js/xpander.js"><\/scr' + 'ipt>');
// embed the xpander js file; is currently handled in XSL so we're ok

if (typeof(Xpander) != "undefined") {


	Xpander.Utils.addEvent(window,'load', function() {
		
		/* Animals Profile text */
		
		if (document.getElementById("fact-text") != null && document.getElementById("profile-text") != null) {
			// check to make sure we're on a profile page

			// Pass in height of Fastfacts box
		var ffHeight = document.getElementById('fact-text').offsetHeight;
		var ffHeightCompare = document.getElementById('profile-text').offsetHeight;

		// detect and fix height for IE6
		var appVer = navigator.appVersion.toLowerCase();
		var iePos = appVer.indexOf('msie');
		if (iePos !=-1) {
			is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
			is_major = parseInt(is_minor);
		}
		var is_ie = ((iePos!=-1));
		if ( is_ie && is_major == 6) { ffHeight = ffHeight + 12 }

//		document.getElementById('global-header-logo').innerHTML = ffHeightCompare + ":" + ffHeight;
		if (ffHeightCompare > ffHeight) { // If fact-text box is larger than profile-text box
			new Xpander('profile-text', ffHeight, 500, 'http://www.nationalgeographic.com/global/images/icon_collapse.gif', 'http://www.nationalgeographic.com/global/images/icon_expand.gif');
			// these images should be pulled from VCM eventually
		} else {
			document.getElementById('profile-text').style.height = ffHeight + "px ! important;";
		}

		}
		
		
		/* Animals wallpaper instructions */
		
		if (document.getElementById("instructions") != null) {
			new Xpander('instructions', 300, 500, 'http://www.nationalgeographic.com/global/images/icon_collapse.gif', 'http://www.nationalgeographic.com/global/images/icon_expand.gif');
		}
		
		
	});

}


/* =Printable Page Popup
-----------------------------------------------------------------------------*/

function PrintablePage(slug) {
	window.open ("/animals/printable/" + slug + ".html",  null, "menubar=1,resizable=1,scrollbars=1,width=685,height=550");
}

