$(document).ready(function(){
	//Block Panel Switching
	var resTabs = $('.resource-panel-nav ul li a');
	resTabs.click(function() {
		var resSectionID = $(this).attr('rel');
		//Toggle the tabs class and active state
		$('.current').removeClass('current');
		$(this).removeClass('hide').addClass('current');
		//Hide the associated resource
		$('.active-resource').hide().removeClass('active-resource').addClass('inactive-resource');
		//Display the associated resource
		$(resSectionID).fadeIn(1000);
		var resSectionHeight = $(resSectionID).height();
		
		$(resSectionID).removeClass('inactive-resource').addClass('active-resource');
		
		//makesure the panels are the same height again
   		//equalHeight($(".equal-panel"));		
		//curvyCorners.redraw();
		return false;
	});	
	//fade transition for header image
	//if having problems displaying the fade
	//makesure that the content-header-image surrounding
	//div is a id and not a class
    $('#content-header-image').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		speed: 5000
	});
	//form selection rows
	$('form fieldset div input').focus(function()	{
		$(this).parent().css({'background-color':'#e9f0f4'});
	});
	
	$('form fieldset div input').focusout(function()	{
		$(this).parent().css({'background-color':'#f0f5f7'});
	});
	//Clear default input value on focus
	$('input[type=text], textarea').focus(function()	{
		$(this).val('');
	});

	//Equalheights
   equalHeight($(".equal-panel"));
});
//equal heights function call
function equalHeight(group) {
   tallest = 0;
   group.each(function() {
      thisHeight = $(this).height();
      if(thisHeight > tallest) {
         tallest = thisHeight;
      }
   });
   group.height(tallest);
}

