function showContent()
{
	jQuery(this).addClass("selected");
	
	if(jQuery("#mainNav .nav-content:visible").length)
	{
		jQuery("#mainNav .nav-content").hide();
		jQuery(this).children(".nav-content").show("fast");
	}
	else
	{
		jQuery(this).children(".nav-content").show("fast");
	}
}

function hideContent()
{
	jQuery(this).removeClass("selected");
	jQuery("#mainNav .nav-content").hide();
		
	if (jQuery("#mainNav .nav-content.current").length) 
	{ 
		jQuery("#mainNav .nav-content.current").show();
	}	
}

function standard_on_load()
{
	jQuery("#mainNav li.main_nav_sec").hover(
		function()
		{
			jQuery(this).addClass("selected");
				if(jQuery("#mainNav .nav-content:visible").length)
				{
					jQuery("#mainNav .nav-content").hide();
				}
			jQuery(this).children(".nav-content").show(); 
		},
		function()
		{
			jQuery(this).removeClass("selected");
			jQuery("#mainNav .nav-content").hide();
		}
	);
}




jQuery(document).ready(function(){
	
	// ------- defaults
	jQuery('a[href^="http://"]').attr({ target: "_blank" });
	jQuery('div.page-bits img, div.box-bits img, div.news-bits img, div.eq33_cols img, div.eq33l img').wrap(jQuery("<span class='bitChopa'>"));
	jQuery('div.main-guts img').wrap(jQuery("<span class='gutChopa'>"));
	jQuery("div.eq33_cols img").wrap(jQuery("<span class='bitChopa'>"));
	
	
	// ------- nav-main
	standard_on_load();
	
	jQuery("#topnav_in").hover( function() {}, function() { 
		if (jQuery("#mainNav .nav-content.current").length) 
		{ jQuery("#mainNav .nav-content.current").show(); }
	});
	 
	// ------- equal height
  	var maxHeight = 0;
	jQuery("div.equalized").each(function(){
	   if (jQuery(this).height() > maxHeight) { maxHeight = jQuery(this).height(); }
	});
	
	jQuery("div.equalized").height(maxHeight);

});
