document.write('<style type="text/css">');
	document.write(".flash_replace {display: block !important;}");
document.write('</style>');

var flashPath = "/_resources/script/fdl/";

// Code to embed the flash file
var flash = '<div style="height: @height; width: @width; display: none" class="hide_print flash_replace">';
flash += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%">';
flash += '<param name="movie" value="@movie" />';
flash += '<param name="quality" value="high" />';
flash += '<param name="wmode" value="transparent">';
flash += '<param name=flashvars value="@flashvars" />';
flash += '<embed src="@movie" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100%" height="100%" wmode="transparent" flashvars="@flashvars"></embed>';
flash += '</object>';
flash += '</div>';

var fdlFlashIdCounter = 0;
										  
// Flash detection script
var MM_contentVersion = 8;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

function writeFlash(el, moviePath, w, h, flashVars) {

	var embedCode;
	var origHtml;
	
	if(MM_FlashCanPlay){
		origHtml = el.innerHTML;
		
		embedCode = flash.replace(/@flashvars/g, flashVars);
		embedCode = embedCode.replace(/@height/g, h + "px");
		embedCode = embedCode.replace(/@width/g, w + "px");
		embedCode = embedCode.replace(/@movie/g, flashPath + moviePath);

		el.innerHTML = embedCode + "<div class='hide'>" + origHtml + "</div>";
	}
	el.style.visibility = "visible";
	
}

function getInnerText(e){
  var strText = "";
  var node;
  for(var i=0; i<e.childNodes.length; i++ ) {
	  node = e.childNodes[i];
	  switch(node.nodeType) {
	    case 1: // elements
    		strText += getInnerText(node);
		    break;
	    case 3: // text
		    strText += node.nodeValue;
		    break;
	    default: // comments etc
		    break;
	  }
  }
	
	// Strip leading and trailing spaces.
  //var regEx = /^[ \t\r\n]+|[ \t\r\n]+$/g;
	var regEx = /[\r\n\t]+|[ ]{2}/g;
	strText = strText.replace(regEx, " ");
	
	var regEx = /[ ]+/g;
	strText = strText.replace(regEx, " ");
	
	// Force upper case if neccessary
	//if(forceUpperCase)strText = strText.toUpperCase();
	return strText;
}


function getInnerHtml(e){
	 var strText = "";
	 var node;
	 for(var i=0; i<e.childNodes.length; i++ )
	 {node = e.childNodes[i];
	  switch(node.nodeType)
	  {
	   case 1: // elements
			var atts = node.attributes;
			var ta = "";
			for (var k = 0; k < atts.length; k++)
			{
				var att = atts[k];
				if(att.specified)
					ta += att.nodeName.toLowerCase() + '="' + att.nodeValue + '" '; 
			}
			if(node.childNodes.length > 0)
				strText += "<" + node.nodeName.toLowerCase() + " " + ta + ">" + getInnerHtml(node) + "</" + node.nodeName.toLowerCase() + ">";
			else
				strText += "<" + node.nodeName.toLowerCase() + " " + ta + " />"
		break;
	   case 3: // text
		strText += node.nodeValue;
		break;
	   default: // comments etc
		break;
	  }
	 }
	 
	//Strip leading and trailing spaces.
    //var regEx = /^[ \t\r\n]+|[ \t\r\n]+$/g;
	var regEx = /[\r\n\t]+|[ ]{2}/g;
	strText = strText.replace(regEx, " ");
	
	var regEx = /[ ]+/g;
	strText = strText.replace(regEx, " ");
	
	//Force upper case if neccessary
	//if(forceUpperCase)strText = strText.toUpperCase();
	return strText;
}

/*
	Finds elements on page that match a given CSS selector rule. Some
	complicated rules are not compatible.
	Based on Simon Willison's excellent "getElementsBySelector" function.
	Original code (with comments and description):
	http://simon.incutio.com/archive/2003/03/25/getElementsBySelector
*/
function getElementsBySelector(selector)
{
	var tokens = selector.split(' ');
	var currentContext = new Array(document);
	for(var i=0;i<tokens.length;i++)
	{
		token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');
		if(token.indexOf('#') > -1)
		{
			var bits = token.split('#');
			var tagName = bits[0];
			var id = bits[1];
			var element = document.getElementById(id);
			if(tagName && element.nodeName.toLowerCase() != tagName)
				return new Array();
			currentContext = new Array(element);
			continue;
		}

		if(token.indexOf('.') > -1)
		{
			var bits = token.split('.');
			var tagName = bits[0];
			var className = bits[1];
			if(!tagName)
				tagName = '*';

			var found = new Array;
			var foundCount = 0;
			for(var h=0;h<currentContext.length;h++)
			{
				var elements;
				if(tagName == '*')
					elements = currentContext[h].all ? currentContext[h].all : currentContext[h].getElementsByTagName('*');
				else
					elements = currentContext[h].getElementsByTagName(tagName);

				for(var j=0;j<elements.length;j++)
					found[foundCount++] = elements[j];
			}

			currentContext = new Array;
			var currentContextIndex = 0;
			for(var k=0;k<found.length;k++)
			{
				if(found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b')))
					currentContext[currentContextIndex++] = found[k];
			}

			continue;
	    }

		if(token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/))
		{
			var tagName = RegExp.$1;
			var attrName = RegExp.$2;
			var attrOperator = RegExp.$3;
			var attrValue = RegExp.$4;
			if(!tagName)
				tagName = '*';

			var found = new Array;
			var foundCount = 0;
			for(var h=0;h<currentContext.length;h++)
			{
				var elements;
	        	if(tagName == '*')
					elements = currentContext[h].all ? currentContext[h].all : currentContext[h].getElementsByTagName('*');
				else
					elements = currentContext[h].getElementsByTagName(tagName);

				for(var j=0;j<elements.length;j++)
					found[foundCount++] = elements[j];
			}

			currentContext = new Array;
			var currentContextIndex = 0;
			var checkFunction;
			switch(attrOperator)
			{
				case '=':
					checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); };
					break;
				case '~':
					checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); };
					break;
				case '|':
					checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); };
					break;
				case '^':
					checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); };
					break;
				case '$':
					checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); };
					break;
				case '*':
					checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); };
					break;
				default :
					checkFunction = function(e) { return e.getAttribute(attrName); };
			}

			currentContext = new Array;
			var currentContextIndex = 0;
			for(var k=0;k<found.length;k++)
			{
				if(checkFunction(found[k]))
					currentContext[currentContextIndex++] = found[k];
			}

			continue;
		}

		tagName = token;
		var found = new Array;
		var foundCount = 0;
			for(var h=0;h<currentContext.length;h++)
			{
				//alert(currentContext[h]);
				if(currentContext[h]){
					var elements = currentContext[h].getElementsByTagName(tagName);
					for(var j=0;j<elements.length; j++)
						found[foundCount++] = elements[j];
				}
			}

		currentContext = found;
	}

	return currentContext;
}



/* @constructor */
function EventUtils() {
	throw 'RuntimeException: EventUtils is a static utility class ' +
		' and may not be instantiated';
}

/**
 *	@access static
 *	@param HTMLElement target
 *	@param string type
 *	@param Function callback
 *	@param boolean captures
 */
EventUtils.addEventListener = function (target,type,callback,captures) {
	if (target.addEventListener) {
			// EOMB
		target.addEventListener(type,callback,captures);
	} else if (target.attachEvent) {
		// IE
		target.attachEvent('on'+type,callback,captures);
	} else {
		// IE 5 Mac and some others
		target['on'+type] = callback;
	}
}

EventUtils.removeEventListener = function (target,type,callback,captures) {
	if (target.removeEventListener) {
			// EOMB
		target.removeEventListener(type,callback,captures);
	} else if (target.detachEvent) {
		// IE
		target.detachEvent('on'+type,callback);
	} else {
		// IE 5 Mac and some others
		target['on'+type] = null;
	}
}