var $j = jQuery.noConflict(); 

$j(document).ready(function(){  
		$j("body").addClass("has-js")
    	$j('div.products-row').equalizeChildHeights();
		$j("div#header ul li.dropdown .flyout .content" ).equalizeChildHeights();
		$j("div.client-objectives-detailed div.objectives-row").equalizeChildHeights();
    	$j('div.current-openings table tr:even').addClass('even')  
        
		// IE 6 specific scripts
		if($j.browser.msie && $j.browser.version<=7){  
			$j("div#header ul li.dropdown").ie6Hover(); 
			$j("div#header ul li a.menu").ie6Hover();   
		  
			try {
			      document.execCommand('BackgroundImageCache', false, true);
			    } catch(err) {}
		}
		
		//prevent main navi element from clicking
		$j("#header ul li.dropdown a:first").click(function() {
			return false;
		});
})


/*	ie6Hover
	--------
	This function loops through a result set and for each result,
	it applies the class "hover" onmouseover and removes it on
	mouseout.  Pull in via conditional comments.
*/
jQuery.fn.ie6Hover = function(){ 
	jQuery(this).hover(function(){
		jQuery(this).addClass("hover");
	},function(){
		jQuery(this).removeClass("hover");
	});
}


/*	Equalize Child Heights
	----------------------
	This function loops through the result set and for each result,
	it loops through immediate children, finds the largest height,
	and applies it to the others.
*/


$j.fn.equalizeChildHeights = function(){
	var result = $j(this);  
	if ($j.browser.msie && $j.browser.version == '6.0') {
		result.children().css("height", "auto");
	}
	else {
		result.children().css("min-height", "0px");
	}
	result.each(function(){
		var childs = $j(this).children();
		var tallest = 0;
		childs.each(function(){ 
			if (!$j(this).hasClass("hidden")){
				var height = $j(this).outerHeight();
				if (height > tallest) tallest = height; 
			}
		});
		childs.each(function(){
			var elem = $j(this);
			if (!elem.hasClass("hidden")) {
				var remainder = elem.outerHeight() - elem.height();
				var new_height = tallest - remainder;
				if ($j.browser.msie && $j.browser.version == '6.0') {
					elem.css("height", new_height + "px");
				}
				else {
					elem.css("min-height", new_height + "px");
				}    
			}
		});
	});
};
     
//png fix
/*
$j(document).ready(function() {
	if($j.browser.msie && parseInt($j.browser.version) <= 6) {
		$j("span.png-fix > img").pngfix();
	}
});
*/


