function btnOver(id) {
	var img = document.images[(id)];
	img.origSrc =  _proxy_jslib_handle(img, 'src', '', 0, 0);
	var path =  _proxy_jslib_handle(img, 'src', '', 0, 0).substring(0,  _proxy_jslib_handle(img, 'src', '', 0, 0).lastIndexOf('.'));
	var ext =  _proxy_jslib_handle(img, 'src', '', 0, 0).substring( _proxy_jslib_handle(img, 'src', '', 0, 0).lastIndexOf('.'),  _proxy_jslib_handle(img, 'src', '', 0, 0).length);
	if (path.indexOf("_on") == -1){
		 _proxy_jslib_assign('', img, 'src', '=', ( path + "_on" + ext));
	}
}
function btnOut(id) {

	var img = document.images[(id)];
	if (img.origSrc != null) {
		 _proxy_jslib_assign('', img, 'src', '=', ( img.origSrc));
	}
}

function navOver(id) {
	var img = document.images[(id)];
	img.origSrc =  _proxy_jslib_handle(img, 'src', '', 0, 0);
	var path =  _proxy_jslib_handle(img, 'src', '', 0, 0).substring(0,  _proxy_jslib_handle(img, 'src', '', 0, 0).lastIndexOf('.'));
	var ext =  _proxy_jslib_handle(img, 'src', '', 0, 0).substring( _proxy_jslib_handle(img, 'src', '', 0, 0).lastIndexOf('.'),  _proxy_jslib_handle(img, 'src', '', 0, 0).length);
	if (path.indexOf("_over") == -1){
		 _proxy_jslib_assign('', img, 'src', '=', ( path + "_over" + ext));
	}
}
function navOut(id) {

	var img = document.images[(id)];
	if (img.origSrc != null) {
		 _proxy_jslib_assign('', img, 'src', '=', ( img.origSrc));
	}
}

//We'll use this to work some magic on the logo and utility navs when the page is resized.
// -Scott
//function PageResize()
//{
//	var helioLogo = document.getElementById("HelioLogo");
//	var utilNav = document.getElementById("UtilityNav");
//}

//window.onresize = PageResize;


// **************************************
// PopupBox

	var PopupBox_Timer = null;
	
	function PopupBox(boxId,varName) {
		// this is a js object these properties are default values for implementations of this object
		// only change these values if you want to change the properties for ALL PopupBoxes.
		// if you need to change a property for a single instance look for the place where
		// the PopupBox object is instantiated. For example: mynewpopup.Timeout = 3000;
		this.Elm =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(boxId);
		this.PopupId = boxId;
		this.Timeout = 5000;
		//this.HideDelay = 500;
		this.Mouseout = false;
		this.VarName = varName;
	}

	PopupBox.prototype.Show = PopupBox_Show;
	function PopupBox_Show(useHideTimer) {
		ToggleElement(this.Elm,true);
		
		if(useHideTimer)
			PopupBox_Timer =  _proxy_jslib_handle(null, 'setTimeout', setTimeout, 1, 0)(this.VarName + ".Hide(true)",this.Timeout);
	}

	PopupBox.prototype.Hide = PopupBox_Hide;
	function PopupBox_Hide(byTimer) {	
		if(byTimer)
			PopupBox_Timer = null;
	
		if(PopupBox_Timer == null)
			ToggleElement(this.Elm,false);	
	}

	PopupBox.prototype.ResetTimer = PopupBox_ResetTimer;
	function PopupBox_ResetTimer() {
		this.ClearTimer();
		this.Show(true);
	}
	
	PopupBox.prototype.ClearTimer = PopupBox_ClearTimer;
	function PopupBox_ClearTimer() {
		clearTimeout(PopupBox_Timer);
		PopupBox_Timer = null;
	}

	function ToggleElement(elm,show) {
		//alert("toggle");
		
		if(show)
			elm.style.display = "inline";
		else	
			elm.style.display = "none";
	}

// ******************************************

// shortcut to document.getElementById
function getE(id) {
    return  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id);
}


/**
* Set a cookie indicating a user has 'logged in' and
*/
function setLoggedIn() {
	
	var today = new (Date)();
	//expires in 60 days
	var expires = new (Date)(today.getTime() + (60 * 1000 * 60 * 60 * 24));
	
	setCookie("op_loggedin", 1, expires.toGMTString());
}


var defaultFeat;
var currFeat = defaultFeat;

function featureOver(id) {
	
	if (currFeat != null && currFeat != ""){
		btnOut("icon_"+currFeat);
		 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("detail_" +currFeat).style.display = "none";
	}
	btnOver("icon_"+id);
	 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("detail_" +id).style.display = "block";
	currFeat = id;
	
}

function featureOut() {
	if (currFeat != null && currFeat != ""){
		btnOut("icon_"+currFeat);
		 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("detail_" +currFeat).style.display = "none";
		
	}
	btnOver("icon_"+defaultFeat);
	 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("detail_" +defaultFeat).style.display = "block";
	currFeat = defaultFeat;
}


function showSubNav(id) {
	 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id).style.display = "block";
}

function hideSubNav(id) {
	 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id).style.display = "none";
}

/*
* Utility function for replacing characters before passing names
* to analytics tracking functions
*/
function removeSpecialChars(str) {
	var re = new (RegExp)("\\s", "g");
	var tmp =  _proxy_jslib_handle(str, 'replace', '', 1, 0)(re, "+");
	re = new (RegExp)(",", "g");
	tmp =  _proxy_jslib_handle(tmp, 'replace', '', 1, 0)(re, "");
	return escape(tmp);
}

function getCookie(name) {
	var str=""+ _proxy_jslib_handle(document, 'cookie', '', 0, 0);
	var index1=str.indexOf(name);
	if (index1==-1 || name=="") return ""; 
	var index2=str.indexOf(';',index1);
	if (index2==-1) index2=str.length; 
	return unescape(str.substring(index1+name.length+1,index2));
}

function setCookie(name, value, expires) {
	if (expires == null || expires == "")
	{
		 _proxy_jslib_assign('', document, 'cookie', '=', ( name + "=" + escape( _proxy_jslib_handle(null, 'value', value, 0, 0)) + ";"));
	} else {
		 _proxy_jslib_assign('', document, 'cookie', '=', ( name + "=" + escape( _proxy_jslib_handle(null, 'value', value, 0, 0)) + ";expires="+expires));
	}
}

function callFlood(catId) {

	var floodlightTag = "http://fls.doubleclick.net/activityi;src=1510676;type=helio765;cat=" + catId + ";ord="+Math.floor(Math.random()*100000000)+"?";
  	
  	if( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("DCLK_FLDiv")){
  		var flDiv =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("DCLK_FLDiv");
  	} else { 
  		var flDiv= _proxy_jslib_handle(document, 'body', '', 0, 0).appendChild(document.createElement("div"));
  		 _proxy_jslib_handle(flDiv, 'setAttribute', '', 1, 0)("id","DCLK_FLDiv");
  		flDiv.style.position = "absolute";
  		flDiv.style.visibility = "hidden";
  		 _proxy_jslib_assign('', flDiv.style, 'top', '=', ( "0px"));
  	}
  		
  	 _proxy_jslib_assign('', flDiv, 'innerHTML', '=', ( '<iframe id="DCLK_FLIframe" src="' + floodlightTag + '"></iframe>'));
}

/**
* Allows new functions to be added to existing 'onload' events
*/
function addLoadEvent(func) { 
	var oldonload = window.onload; 
	if (typeof window.onload != 'function') { 
		window.onload = func; 
	} else { 
		window.onload = function() { 
			if (oldonload) { 
				oldonload(); 
			} 
			func(); 
		} 
	} 
}
function addUnloadEvent(func) {
	var oldonload = window.onunload; 
	if (typeof window.onunload != 'function') { 
		window.onunload = func; 
	} else { 
		window.onunload = function() { 
			if (oldonload) { 
				oldonload(); 
			} 
			func(); 
		} 
	} 
}

function showEmbed() {
    var embed =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("embedtab");
    embed.style.display = 'block';
}

function hideEmbed() {
    var embed =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("embedtab");
    embed.style.display = 'none';
}


function onBrowserResize() {
	var browserHeight = YAHOO.util.Dom.getViewportHeight();
	var minFlashHeight = 610;
	
	try{
		var flashDiv =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("website");
		flashDiv.height = (browserHeight >= minFlashHeight) ? browserHeight : minFlashHeight;
	}
	catch(e)
	{
		//flash must be enabled and written to the page for the resize functionality to work
	}
}
 ;
_proxy_jslib_flush_write_buffers() ;