﻿
// JScript File
    upgradeBrowser('/us/includes/legal/legal_footer.asp');
	

	///<summary>Checks for a meta tag with name "emailToFriendURL" used to set a manual override of the url used for the Email to Friend link.</summary>
	function CheckUrlOverride() {
		var override = null;
		var foundMetas = false;
		var metaElements;
		
				// Get meta tags
		if (document.all) {
			metaElements = document.all.tags("meta");
		} else if (document.documentElement) {
			metaElements = document.getElementsByTagName("meta");
		}
		
				// If there are meta tags, search for the override
		if (metaElements != null) {
					// Loop all meta tags
			for (var i = 1; i <= metaElements.length; i++) {
				myMeta = metaElements.item(i - 1);
				
						// We have a winner, set return value, exit loop
				if (myMeta.name.indexOf('emailToFriendURL') == 0) {
					override = myMeta.content;
					i = metaElements.length;
				}
			}
		}
		
		return override;
	}
	
	function OpenEmailToFriend(){
		var sUrl = '%2Fus%2Fincludes%2Flegal%2Flegal%5Ffooter%2Easp%3Fguid%3D63%2E66%2E62%2E139200626110409840';
		
		var override = CheckUrlOverride();		// Check for a manual overrid of the url to use
		
				// Coming from aspx pages b/c they use a published version of the 
				// footer and the email url variable will always be 
				// /us/includes/legal/legal_footer.asp, need to manually create this value now.
		
		if (sUrl.indexOf('footer') != -1) {
					// Check for overriden url
			if (override != null) {
				sUrl = escape(override);
			} else if (document.location.search != "") {		// use search
				sUrl = "http://www.fisher-price.com/fp.aspx" + escape(document.location.search);
			} else {
						// document.taps_var is a variable written through a .NET user control
						// if available, append it to the controller page, else default to the site's homepage
				if (document.taps_vars != null)
					sUrl = "http://www.fisher-price.com/fp.aspx?" + escape(document.taps_vars);
				else
					sUrl = 'http://www.fisher-price.com/default.asp';
			}
			
		}

		var win = window.open('http://www.fisher-price.com/us/emailtofriend.asp?url=' + sUrl + '&type=page', 'emailWindow', 'left=150,top=50,screenX=200,screenY=100,resizable=yes,scrollbars=yes,toolbar=no,width=500,height=560');
	}