//////////////////////////////////////////////////////
//
//	The purpose of this file is to
//	apply a hover class on mouseover
//	on the <li> elements in the nav.
//	This is because IE doesn't put
//	the pseudo class :hover on <li> elements
//
//	This is code that uses the
//	jquery javascript library (http://jquery.com/)
//
//////////////////////////////////////////////////////

function inTweakCms()
{
	if( window.location.hostname.indexOf("cms") < 0)
		return false;
	else 
		return true;
}

$(function() { 
// setup ul.tabs to work as tabs for each div directly under div.panes 
	if($("ul.tabs").length > 0) {
		$("ul.tabs").tabs("div.panels > div"); 
	}
	
	$("input.emptytext").focus(function() {
		if ( $(this).val() == $(this)[0].defaultValue ) {
			$(this).val("");
		}
	});

	// put default text back in on blur
	$("input.emptytext").blur(function() {
		if ( $(this).val() == "" ) {
			$(this).val( $(this)[0].defaultValue );
		}
	});
	
});

$(window).load(function() {
	
	if (document.all&&document.getElementById) {
		// this is needed for the IE 6 pseudo hover class bug
		$(".navtop > li").hover(function() {
			$(this).addClass("hover");
		},
		function () {
			$(this).removeClass("hover");
		});
		// this adds flyout support for IE 6
		$(".navtop > li li ").hover(function () {
			$(this).addClass("hover");
		},
		function () {
			$(this).removeClass("hover");
		});
		
	} else {
		// this is need for safari when nav covers flash
		$(".navtop li ul").hover(function () {
			$(this).addClass("redraw");
		},
		function () {
			$(this).removeClass("redraw");
		});
	}
});
