////////////////////////////////////////////////////////////////////////////////
//
//  ISITE DESIGN INC
//  Copyright 2009 ISITE Design, Inc.
//  All Rights Reserved.
//
//  <em>Hands on Banking</em> | El futuro en tus manos
//
////////////////////////////////////////////////////////////////////////////////

//--------------------------------------
//  Embed CSS
//--------------------------------------


//--------------------------------------------------------------------------
//
//  Properties
//
//--------------------------------------------------------------------------
	
/**
 *	Enable debugging output -- set to false for production NOTE: if debug == true, hitting refresh in IE will cause an error
 */
var debug = false;

/**
 *	RSH initialized
 */
var initialized = false;

/**
 *	window onload called
 */
var loaded = false;

/**
 *	begin method called from flash
 */
var fready = false;

/**
 *	base URL
 */
var baseURL = window.location.protocol+"//"+window.location.hostname+"/"; // must have trailing slash
/**
 *  link element
 */
var oLink = document.createElement("link")
oLink.href = baseURL+"_resources/css/hob_html.css";
oLink.rel = "stylesheet";
oLink.type = "text/css";
document.getElementsByTagName("head")[0].appendChild(oLink);
/**
 *	id of div to replace with Flash content
 */
var swfDiv = "flashcontent";
var quotesDiv = "flashMessages"

/**
 *	id of Flash content
 */
var flashID = "myMovie";

/**
 *	reference to Flash content
 */
var fl;


//--------------------------------------------------------------------------
//
//  JS Libs
//
//--------------------------------------------------------------------------

//--------------------------------------
//  JSON 2007 | License: Public Domain | required by RSH | compressed with javascriptcompressor.com
//--------------------------------------
if(!Object.prototype.toJSONString) { Array.prototype.toJSONString = function(w) { var a = [], i, l = this.length, v; for (i = 0; i < l; i += 1) { v = this[i]; switch(typeof v) { case'object':if (v) { if (typeof v.toJSONString === 'function') { a.push(v.toJSONString(w)) }} else { a.push('null') } break; case'string':case'number':case'boolean':a.push(v.toJSONString()) }} return'[' + a.join(',') + ']' }; Boolean.prototype.toJSONString = function() { return String(this) }; Date.prototype.toJSONString = function() { function f(n) { return n < 10?'0' + n:n } return'"' + this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z"' }; Number.prototype.toJSONString = function() { return isFinite(this)?String(this):'null' }; Object.prototype.toJSONString = function(w) { var a = [], k, i, v; if (w) { for (i = 0; i < w.length; i += 1) { k = w[i]; if (typeof k === 'string') { v = this[k]; switch(typeof v) { case'object':if (v) { if (typeof v.toJSONString === 'function') { a.push(k.toJSONString() + ':' + v.toJSONString(w)) }} else { a.push(k.toJSONString() + ':null') } break; case'string':case'number':case'boolean':a.push(k.toJSONString() + ':' + v.toJSONString()) }}}} else { for (k in this) { if (typeof k === 'string' && Object.prototype.hasOwnProperty.apply(this, [k])) { v = this[k]; switch(typeof v) { case'object':if (v) { if (typeof v.toJSONString === 'function') { a.push(k.toJSONString() + ':' + v.toJSONString()) }} else { a.push(k.toJSONString() + ':null') } break; case'string':case'number':case'boolean':a.push(k.toJSONString() + ':' + v.toJSONString()) }}}} return'{' + a.join(',') + '}' }; (function(s) { var m = { '\b':'\\b', '\t':'\\t', '\n':'\\n', '\f':'\\f', '\r':'\\r', '"':'\\"', '\\':'\\\\' }; s.parseJSON = function(filter) { var j; function walk(k, v) { var i; if (v && typeof v === 'object') { for (i in v) { if (Object.prototype.hasOwnProperty.apply(v, [i])) { v[i] = walk(i, v[i]) }}} return filter(k, v) } if (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''))) { j = eval('(' + this + ')'); return typeof filter === 'function'?walk('', j):j } throw new SyntaxError('parseJSON'); }; s.toJSONString = function() { if (/["\\\x00-\x1f]/.test(this)) { return'"' + this.replace(/[\x00-\x1f\\"]/g, function(a) { var c = m[a]; if (c) { return c } c = a.charCodeAt(); return'\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16) } ) + '"' } return'"' + this + '"' }} )(String.prototype) }

//--------------------------------------
//  RSH (Really Simple History) v0.6 | modified to support Safari 3.1.2 and later | http://code.google.com/p/reallysimplehistory/
//--------------------------------------
window.dhtmlHistory={isIE:false,isOpera:false,isSafari:false,isKonquerer:false,isGecko:false,isSupported:false,create:function(_1){var _2=this;var UA=navigator.userAgent.toLowerCase();var _4=navigator.platform.toLowerCase();var _5=navigator.vendor||"";if(_5==="KDE"){this.isKonqueror=true;this.isSupported=false;}else{if(typeof window.opera!=="undefined"){this.isOpera=true;this.isSupported=true;}else{if(typeof document.all!=="undefined"){this.isIE=true;this.isSupported=true;}else{if(_5.indexOf("Apple Computer, Inc.")>-1){this.isSafari=true;this.isSupported=(_4.indexOf("mac")>-1);}else{if(UA.indexOf("gecko")!=-1){this.isGecko=true;this.isSupported=true;}}}}}window.historyStorage.setup(_1);if(this.isSafari){this.createSafari();}else{if(this.isOpera){this.createOpera();}}var _6=this.getCurrentLocation();this.currentLocation=_6;if(this.isIE){this.createIE(_6);}var _7=function(){_2.firstLoad=null;};this.addEventListener(window,"unload",_7);if(this.isIE){this.ignoreLocationChange=true;}else{if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.ignoreLocationChange=true;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true);}else{this.ignoreLocationChange=false;this.fireOnNewListener=true;}}var _8=function(){_2.checkLocation();};setInterval(_8,100);},initialize:function(){if(this.isIE){if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.fireOnNewListener=false;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true);}else{this.fireOnNewListener=true;this.firstLoad=false;}}},addListener:function(_9){this.listener=_9;if(this.fireOnNewListener){this.fireHistoryEvent(this.currentLocation);this.fireOnNewListener=false;}},addEventListener:function(o,e,l){if(o.addEventListener){o.addEventListener(e,l,false);}else{if(o.attachEvent){o.attachEvent("on"+e,function(){l(window.event);});}}},add:function(_d,_e){if(this.isSafari){_d=this.removeHash(_d);historyStorage.put(_d,_e);this.currentLocation=_d;window.location.hash=_d;this.putSafariState(_d);}else{var _f=this;var _10=function(){if(_f.currentWaitTime>0){_f.currentWaitTime=_f.currentWaitTime-_f.waitTime;}_d=_f.removeHash(_d);if(document.getElementById(_d)&&_f.debugMode){var e="Exception: History locations can not have the same value as _any_ IDs that might be in the document,"+" due to a bug in IE; please ask the developer to choose a history location that does not match any HTML"+" IDs in this document. The following ID is already taken and cannot be a location: "+_d;throw new Error(e);}historyStorage.put(_d,_e);_f.ignoreLocationChange=true;_f.ieAtomicLocationChange=true;_f.currentLocation=_d;window.location.hash=_d;if(_f.isIE){_f.iframe.src="/_resources/js/blank.html?"+_d;}_f.ieAtomicLocationChange=false;};window.setTimeout(_10,this.currentWaitTime);this.currentWaitTime=this.currentWaitTime+this.waitTime;}},isFirstLoad:function(){return this.firstLoad;},getVersion:function(){return "0.6";},getCurrentLocation:function(){var r=(/*this.isSafari*/false?this.getSafariState():this.getCurrentHash());return r;},getCurrentHash:function(){var r=window.location.href;var i=r.indexOf("#");return (i>=0?r.substr(i+1):"");},PAGELOADEDSTRING:"DhtmlHistory_pageLoaded",listener:null,waitTime:200,currentWaitTime:0,currentLocation:null,iframe:null,safariHistoryStartPoint:null,safariStack:null,safariLength:null,ignoreLocationChange:null,fireOnNewListener:null,firstLoad:null,ieAtomicLocationChange:null,createIE:function(_15){this.waitTime=400;var _16=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var _17="rshHistoryFrame";var _18="<iframe frameborder=\"0\" id=\""+_17+"\" style=\""+_16+"\" src=\"/_resources/js/blank.html?"+_15+"\"></iframe>";document.write(_18);this.iframe=document.getElementById(_17);},createOpera:function(){this.waitTime=400;var _19="<img src=\"javascript:location.href='javascript:dhtmlHistory.checkLocation();';\" style=\""+historyStorage.hideStyles+"\" />";document.write(_19);},createSafari:function(){var _1a="rshSafariForm";var _1b="rshSafariStack";var _1c="rshSafariLength";var _1d=historyStorage.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var _1e=(historyStorage.debugMode?"width:800px;height:20px;border:1px solid black;margin:0;padding:0;":historyStorage.hideStyles);var _1f="<form id=\""+_1a+"\" style=\""+_1d+"\">"+"<input type=\"text\" style=\""+_1e+"\" id=\""+_1b+"\" value=\"[]\"/>"+"<input type=\"text\" style=\""+_1e+"\" id=\""+_1c+"\" value=\"\"/>"+"</form>";document.write(_1f);this.safariStack=document.getElementById(_1b);this.safariLength=document.getElementById(_1c);if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.safariHistoryStartPoint=history.length;if(this.safariLength)this.safariLength.value=(this.safariHistoryStartPoint)?this.safariHistoryStartPoint:null;}else{this.safariHistoryStartPoint=this.safariLength.value;}},getSafariStack:function(){var r=(this.safariStack)?this.safariStack.value:null;return historyStorage.fromJSON(r);},getSafariState:function(){var _21=this.getSafariStack();var _22=_21[history.length-this.safariHistoryStartPoint-1];return _22;},putSafariState:function(_23){var _24=this.getSafariStack();_24[history.length-this.safariHistoryStartPoint]=_23;this.safariStack.value=historyStorage.toJSON(_24);},fireHistoryEvent:function(_25){var _26=historyStorage.get(_25);this.listener.call(null,_25,_26);},checkLocation:function(){if(!this.isIE&&this.ignoreLocationChange){this.ignoreLocationChange=false;return;}if(!this.isIE&&this.ieAtomicLocationChange){return;}var _27=this.getCurrentLocation();if(_27==this.currentLocation){return;}this.ieAtomicLocationChange=true;if(this.isIE&&this.getIframeHash()!=_27){this.iframe.src="/_resources/js/blank.html?"+_27;}else{if(this.isIE){return;}}this.currentLocation=_27;this.ieAtomicLocationChange=false;this.fireHistoryEvent(_27);},getIframeHash:function(){var doc=this.iframe.contentWindow.document;var _29=String(doc.location.search);if(_29.length==1&&_29.charAt(0)=="?"){_29="";}else{if(_29.length>=2&&_29.charAt(0)=="?"){_29=_29.substring(1);}}return _29;},removeHash:function(_2a){var r;if(_2a===null||_2a===undefined){r=null;}else{if(_2a===""){r="";}else{if(_2a.length==1&&_2a.charAt(0)=="#"){r="";}else{if(_2a.length>1&&_2a.charAt(0)=="#"){r=_2a.substring(1);}else{r=_2a;}}}}return r;},iframeLoaded:function(_2c){if(this.ignoreLocationChange){this.ignoreLocationChange=false;return;}var _2d=String(_2c.search);if(_2d.length==1&&_2d.charAt(0)=="?"){_2d="";}else{if(_2d.length>=2&&_2d.charAt(0)=="?"){_2d=_2d.substring(1);}}window.location.hash=_2d;this.fireHistoryEvent(_2d);}};window.historyStorage={setup:function(_2e){if(typeof _2e!=="undefined"){if(_2e.debugMode){this.debugMode=_2e.debugMode;}if(_2e.toJSON){this.toJSON=_2e.toJSON;}if(_2e.fromJSON){this.fromJSON=_2e.fromJSON;}}var _2f="rshStorageForm";var _30="rshStorageField";var _31=this.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var _32=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var _33="<form id=\""+_2f+"\" style=\""+_31+"\">"+"<textarea id=\""+_30+"\" style=\""+_32+"\"></textarea>"+"</form>";document.write(_33);this.storageField=document.getElementById(_30);if(typeof window.opera!=="undefined"){this.storageField.focus();}},put:function(key,_35){this.assertValidKey(key);if(this.hasKey(key)){this.remove(key);}this.storageHash[key]=_35;this.saveHashTable();},get:function(key){this.assertValidKey(key);this.loadHashTable();var _37=this.storageHash[key];if(_37===undefined){_37=null;}return _37;},remove:function(key){this.assertValidKey(key);this.loadHashTable();delete this.storageHash[key];this.saveHashTable();},reset:function(){this.storageField.value="";this.storageHash={};},hasKey:function(key){this.assertValidKey(key);this.loadHashTable();return (typeof this.storageHash[key]!=="undefined");},isValidKey:function(key){return (typeof key==="string");},showStyles:"border:0;margin:0;padding:0;",hideStyles:"left:-1000px;top:-1000px;width:1px;height:1px;border:0;position:absolute;",debugMode:false,storageHash:{},hashLoaded:false,storageField:null,assertValidKey:function(key){var _3c=this.isValidKey(key);if(!_3c&&this.debugMode){throw new Error("Please provide a valid key for window.historyStorage. Invalid key = "+key+".");}},loadHashTable:function(){if(!this.hashLoaded){var _3d=(this.storageField)?this.storageField.value:null;if(_3d!==""&&_3d!==null){this.storageHash=this.fromJSON(_3d);this.hashLoaded=true;}}},saveHashTable:function(){this.loadHashTable();var _3e=this.toJSON(this.storageHash);if(this.storageField)this.storageField.value=_3e;},toJSON:function(o){return o.toJSONString();},fromJSON:function(s){if(s&&s.parseJSON)return s.parseJSON();}};

//--------------------------------------
//	SWFObject v1.5: | Licesnse: MIT | Note: v1.5 must be used as later versions conflict with RSH | http://blog.deconcept.com/swfobject/
//--------------------------------------
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(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.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=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!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 _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=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 _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,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");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[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(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[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;


//--------------------------------------------------------------------------
//
//  Initialization
//
//--------------------------------------------------------------------------



//--------------------------------------
//  write Flash to page
//--------------------------------------
/**
 *	SWFObject instance
 */
var contentloaded = false;
var mainOnStage = false;
function hobContentLoaded()
{
	//alert("contentLoaded");
	contentloaded = true;
}

function hideMessages()
{
	//alert("hideMessages");	
	if (contentloaded) 
	{	
		var div2 = document.getElementById("flashMessages");
		//div2.style.visibility = 'hidden';
		
		document.body.removeChild(div2);
		var div = document.getElementById("flashcontent");				
		div.style.top = '0px';
		//alert(document.body);
	}
}

function messagesLoaded ()
{
//alert("messagesLoaded");
		var div = document.getElementById("flashcontent");		
		div.style.visibility = 'visible';	
	var so = new SWFObject(baseURL+"flash/Main.swf", flashID, "960", "620", "8", "#DDDDDD");
	so.write(swfDiv);
}

var lang = window.location.pathname.split("/");
var which_quotes = lang[3]+"_quotes_"+lang[2]+".swf"

var so = new SWFObject(baseURL+"flash/"+which_quotes, "quotes", "100%", "100%", "8", "#DDDDDD");
//so.addParam("wmode", "transparent");
so.addParam("salign", "tl");
so.addParam("align", "tl");
so.addParam("scaleMode", "noScale");
so.write("flashMessages");


//--------------------------------------
//  include analytics JS | if IE write script tag, otherwise use DOM methods
//--------------------------------------
/**
 *	path to analytics JS file
 */
var analyticsJS = baseURL+"_resources/js/analytics.js";
if (navigator.userAgent.indexOf("MSIE") > -1)
{
	document.write('<script type="text/javascript" src="'+analyticsJS+'"></script>');
}
else
{
	var s = document.createElement("script");
	s.src = analyticsJS;
	document.getElementsByTagName("head")[0].appendChild(oLink);
}

//--------------------------------------
//  create RSH components and add onload handler
//--------------------------------------
window.dhtmlHistory.create();
window.onload = init;


//--------------------------------------------------------------------------
//
//  Private Methods
//
//--------------------------------------------------------------------------

/**
 *	Called from Flash during initialization.
 */
function begin()
{
	
	//log("begin()");
	fl = window[flashID] || document[flashID];
	var path;
	if (window.location.hash.length > 1 && 
		window.location.hash.indexOf("glossary.html") == -1 &&
		window.location.hash.indexOf("library.html") == -1)
	{
		path = "/htdocs"+window.location.hash.slice(1);
	}
	else
	{
		if (window.location.hash.length > 1)
		{
			path = "/htdocs" + window.location.hash.slice(1, 7);
		}
		else
		{
			path = window.location.pathname;
		}
	}
	var openResource = null;
	if (window.location.hash.indexOf("glossary.html") != -1)
	{
		openResource = "glossary";
	}
	else if (window.location.hash.indexOf("library.html") != -1)
	{
		openResource = "library";
	}
	fl.init(baseURL, path, openResource);
	fl.enable();
	fready = true;
	checkLoadState();
}

/**
 *	Called when page has fully loaded.
 */
function init()
{	
	//log("init()");
	loaded = true;
	checkLoadState();
}

/**
 *	Check to see if page has fully loaded and course initialized. If both are true, then initialize RSH.
 */
function checkLoadState()
{
	//log("checkLoadState()");
	if (loaded && fready && !initialized)
		initHistory();
}

/**
 *	Initialize RSH. Should only be called once page has fully loaded, and course initialized.
 */
function initHistory()
{
	if (initialized) return;
//log("initHistory()");
	dhtmlHistory.initialize();
	dhtmlHistory.addListener(historyEvent);
	initialized = true;
}

/**
 * 	Adds an entry to the browser's history. Called from Flash when navigation occurs.
 * 
 * 	@param	location	String		The current location
 *	@param	data		Object		Data to associate with the current location
 */
function addHistory(location, data)
{
//	log("addHistory("+location+", "+data+")");
	dhtmlHistory.add(location, data);
}

/**
 *	 Listener for history changes.
 * 
 * 	@param	location	String		The new location 
 * 	@param	data		Object		Data associated with the new location
 */
function historyEvent(location, data)
{
//	log("historyEvent("+location+", "+data+")");
	fl.historyEvent(location, data);
}

/**
 * 	Adds a message to the log if debugging is enabled.
 * 
 * 	@param	msg			String		The message to log
 */
function log(msg)
{
	//console.log(msg);
	// if (!debug) return;
	// var dp = document.getElementById("debugpanel");
	// if (!dp)
	// {
	// 	dp = document.createElement("textarea");
	// 	dp.id = "debugpanel";
	// 	dp.rows = 10;
	// 	dp.cols = 110;
	// 	document.body.appendChild(dp);
	// }
	// var t = msg + "\n" + dp.innerHTML;
	// dp.innerHTML = t;
}




