// JavaScript Document

$(document).ready(function(){
	//activate the spuerfish menu
	 $("ul.sf-menu").supersubs({ 
        minWidth:    15.6,   // minimum width of sub-menus in em units 
        maxWidth:    27,   // maximum width of sub-menus in em units 
        extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                           // due to slight rounding differences and font-family 
    }).superfish();  // call supersubs first, then superfish, so that subs are 
                     // not display:none when measuring. Call before initialising 
                     // containing tabs for same reason. 

/*
	//find the height for content column
	var leftColHeight = $("#sidebar_left").height();
	var centerColHeight = $("#content").height();
	var rightColHeight = $("#sidebar_right").height();
		
	//set the tallestCol to the center col as a default
	var tallestCol = centerColHeight;
	
	//check to see if one of the other columns is taller, if so, reset the tallestCol variable
	if (leftColHeight > tallestCol) {
		tallestCol = leftColHeight;
	} else if (rightColHeight > tallestCol) {
		tallestCol = rightColHeight;
	}
		
	//apply the tallestCol size to all three columns
	$("#sidebar_left").height(tallestCol);
	//$("#sidebar_left").css('height',tallestCol);
	//$("#content").height(tallestCol);
	$("#sidebar_right").height(tallestCol);
*/	
	
	/*animate the reveal of the title*/
	//reposition the hover div on inital load if JS is enabled	
	$('.img-147x152_wrapper div').css('top','0').hide();
	$('.img-292x460_wrapper div').css('bottom','0').hide();
	
	function fadeInTitle() {
		$(this).find('div').stop(true, true).fadeIn(500);
	}
	function fadeOutTitle() {
		$(this).find('div').stop(true, true).fadeOut(250);
	}
	//apply effects on hoverIn and hoverOut
	$('.caption').hoverIntent(fadeInTitle,fadeOutTitle);
	
/*	//apply effects on hoverIn and hoverOut
	$('.caption').hoverIntent(
			function(){
				//$('.caption div').css("background-color","red");//.fadeIn(3000);
				//$(this).find('div').stop(true, true).delay(250).fadeIn(500);
				//$(this).find('div').stop(true, true).fadeIn(500);
				
			},
			function(){
				//$('.caption div').css("background-color","red");//.fadeIn(3000);
				//$(this).find('div').stop(true, true).delay(500).fadeOut(250);
				//$(this).find('div').stop(true, true).fadeOut(250);
			}
		);		
*/		
	//Open External Link in New Window
	$('.external').attr('target', '_blank');
		

});//end jquery
