/* stop IE6 flicker */try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {}// Return true if browser is Internet Explorer and version 6 or earlier$.IE6Below = function() {	if ($.browser.msie) {		try {			if (ScriptEngineMajorVersion() <= 5 && ScriptEngineMinorVersion() < 7) { // ie 6- only				return true;			}		} catch(err) { return false; };		return false;	} else {		return false;	};};// Return true if browser is Safari 2.0 or earlier$.Safari2Below = function() {	if ($.browser.safari) {		var kitName = "applewebkit/";		var tempStr = navigator.userAgent.toLowerCase();		var pos		  = tempStr.indexOf(kitName);		var isAppleWebkit = (pos != -1);		var kitVersion = 0				var kitVersion = tempStr.substring(pos + kitName.length,tempStr.length);				kitVersion = kitVersion.substring(0,kitVersion.indexOf(" "));				kitVersion = kitVersion.substring(0,3);		return (kitVersion < 420) ? true : false;	};};// ** Changes search field to actual "search" element **// **                                                 **$(function(){ // (executes when the dom is ready)	if ($.browser.safari) {		$("#search-query").each(function(i){			$(this).attr("value","");			$(this).attr("type","search");			$(this).attr("autosave","com.hrc.search");			$(this).attr("results","10");			$(this).attr("placeholder","Search website");			//$(this).css({'color':'#000000','font-size':'10px','width':'110px'}); <- moved to stylesheet		});		if ($.Safari2Below()) {			$("#search-query").addClass("safari2");		};	};});// ** Add default text functionality to input fields **// **                                                **$(function(){ // (executes when the dom is ready)	$('input[@type=text].input-default-text').each(function(i) {		var defaultValue = $(this).attr('value');		$(this).focus(function () { if (this.value == defaultValue) this.value = ''; this.style.color = '#333333' });		$(this).blur(function () { if (this.value == '') { this.value = defaultValue; this.style.color = '#666666' }});	});});// ** Convert any links with rel="external" to open in new windows **// **                                                              **$(function(){ // (executes when the dom is ready)	$("a[@rel$='external']").click(function(){		this.target = "_blank";	});});// ** Do navigation related things **// **                              **$(function(){ // (executes when the dom is ready)	// add some neccessary classes	$("#navigation li:first-child").addClass("first");	$("#navigation li:last-child, .links-colored li:last-child, .links-plain li:last-child").addClass("last");	$("#altnavigation li:first-child").addClass("last");	$("#altnavigation li:last-child").addClass("first");		// search for nav-something or snav-something in the body tag	// this tells us if a link should be active by default	// (this is because each of our nav links uses an id, e.g. nav-home, so we define	//  active links by simply declaring this id in the body tag of each page as a class name)	$("body[@class*=nav-]").each(function(i) {		var bodyClasses = $(this).attr("class").split(" ");		var regex1 = /\bnav-\b/;		var regex2 = /\bsnav-\b/;		$.each(bodyClasses, function(i, n) {			if (regex1.test(n) || regex2.test(n)) {				// add class "active" to the first link in the li#nav-something or li#snav-something				$('#'+n+'>a').addClass("active");				// see if we're dealing with a sub nav, if so set its parent's parent's first link to active as well				if (regex2.test(n)) {					$($('#'+n).parent().parent().children("a")[0]).addClass("active");				};			};		 });	});		// variables for our mouseouts and mouseactions	var hasOrginalActiveNav = false;	var originalActiveNav;	var originalActiveNavLink;	var cuedOverEffect;	var cuedOutEffect;	var cuedRestoreEffect;	var rolloverDelay = 50; // 350 if you need a delay for sloppy mouse movement		// functions which carryout the over/out effects	$.navMouseOver = function(hoveredElement) {		var hoveredElementID;		clearTimeout(cuedRestoreEffect);		// grab the id of the elment		$("#navigation>li").each(function(i) {			if (hoveredElement == this) hoveredElementID = i;		});		if ($(hoveredElement).is('.hover')) {			clearTimeout(cuedOverEffect);			clearTimeout(cuedOutEffect);		} else {			cuedOverEffect = setTimeout('$.navMouseOverEffect("' + hoveredElementID + '")',rolloverDelay);		};	};	$.navMouseOut = function(hoveredElement) {				clearTimeout(cuedRestoreEffect);		clearTimeout(cuedOverEffect);		clearTimeout(cuedOutEffect);		// only cue the mouse out effect if this element is not our original nav element		// (or we'd just turn it off only to turn it on again when we call our restore effect)		// NOTE: commented out since we don't want any "always on" states in our nav		/*if (!$(originalActiveNav).is(".hover")) {*/			cuedOutEffect = setTimeout('$.navMouseOutEffect()',rolloverDelay);		/*};*/	};	$.navMouseOverEffect = function(hoveredElementID) {		var hoveredElement = $("#navigation>li")[hoveredElementID];		$(hoveredElement).addClass("hover");		if (hasOrginalActiveNav) $(originalActiveNavLink).removeClass("active");		$("#navigation>li").not(hoveredElement).each(function(i) {			$(this).removeClass("hover");			$(this).removeClass("active");		});	};	$.navMouseOutEffect = function() {		$("#navigation>li").removeClass("hover");		if (hasOrginalActiveNav) cuedRestoreEffect = setTimeout('$.navRestoreOriginalState()',20);	};	$.navRestoreOriginalState = function() {		var restore = true;		// make sure no other navs are on the "hover" state before we restore		$("#navigation>li.hover").each(function(i) { restore = false; });		if (restore) {			$(originalActiveNav).addClass("active");			$(originalActiveNavLink).addClass("active");		};			};		// if a navigation link has the class of "active" then set it's parent LI to "active" as well	// we also keep a reference of the link and parent LI so we can turn on/off the "active" state	// while we mouseover other links in the navigation	$("#navigation>li>a.active").each(function(i) {		hasOrginalActiveNav = true;		$(this).parent().addClass("active");		originalActiveNavLink = $(this);				originalActiveNav = $(this).parent();	});		// finally, add mouseover/out functions to each nav element	$("#navigation>li").each(function(i){		$(this).mouseover(function() {			$.navMouseOver(this);		});		$(this).mouseout(function() {			$.navMouseOut(this);		});	});			});// ** Pop Up Video **// **              **$(function(){ // (executes when the dom is ready)	$("a[@rel$='popup']").click(function(){		window.open(this.href, '', 'menubar=0, toolbar=0, scrollbars=0, resizable=0, width=775, height=560');		return false;	});	$("#close, #pop-header h1 a").click(function(){		self.close();	}).css("cursor","pointer");});// ** Add OS/Browser specific things **// **                                **$(function(){ // (executes when the dom is ready)	});// ** Pop Up Video **// **              **$(function(){ // (executes when the dom is ready)	$("a[@rel$='popup2']").click(function(){		window.open(this.href, '', 'menubar=0, toolbar=0, scrollbars=0, resizable=0, width=775, height=450');		return false;	});	$("#close, #pop-header h1 a").click(function(){		self.close();	}).css("cursor","pointer");});// ** Pop Up HD2 Video **// **              **$(function(){ // (executes when the dom is ready)	$("a[@rel$='popup_video_hd2']").click(function(){		window.open(this.href, '', 'menubar=0, toolbar=0, scrollbars=0, resizable=0, width=780, height=480');		return false;	});});// ** Pop Up HD Video **// **              **$(function(){ // (executes when the dom is ready)	$("a[@rel$='popup_video_hd']").click(function(){		window.open(this.href, '', 'menubar=0, toolbar=0, scrollbars=0, resizable=0, width=790, height=506');		return false;	});});// ** Pop Up Screencast Video **// **              **$(function(){ // (executes when the dom is ready)	$("a[@rel$='popup_video_screencast_ecomma']").click(function(){		window.open(this.href, '', 'menubar=0, toolbar=0, scrollbars=0, resizable=0, width=830, height=520');		return false;	});});// ** Pop Up RVR Video **// **              **$(function(){ // (executes when the dom is ready)	$("a[@rel$='popup_video']").click(function(){		window.open(this.href, '', 'menubar=0, toolbar=0, scrollbars=0, resizable=0, width=680, height=560');		return false;	});});// ** Pop Up Audio **// **              **$(function(){ // (executes when the dom is ready)	$("a[@rel$='popup_audio']").click(function(){		window.open(this.href, '', 'menubar=0, toolbar=0, scrollbars=0, resizable=0, width=735, height=130');		return false;	});});