var J = jQuery.noConflict();

J(document).ready(function(){
	
	var pic_height = J('.recent_album').height();
	
	J('.recent_album_deets').each(function(){
		var tab_height = J(this).height();
		var displace = pic_height - tab_height - 7;
		//alert(pic_height+tab_height+displace);
		J(this).css("top",displace);
	})
	
		
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
	//Full Caption Sliding (Hidden to Visible)
	J('.recent_album').hover(function(){
		J(".recent_album_deets", this).stop().animate({top:'200px'},{queue:false,duration:160});
	}, function() {
		var tab_height = J(this).find(".recent_album_deets").height();
		var pic_height = J('.recent_album').height();		
		var displace = (pic_height - tab_height - 7) + "px";
		J(".recent_album_deets", this).stop().animate({top: displace},{queue:false,duration:160});
	});

	var input_value = J(".focus_clear").val();

	J(".focus_clear").focus(function() {
		if (J(this).val() == input_value) {
			J(this).val('');
		}
	});


	// Menu //////////
	//////////////////
	
	
	//Hover
	
	active_menu = true;
	
	J("#menu li a").hover(function() {
		J("#menu li a").removeClass("hovered");
		J(this).addClass("hovered");
		
		
		var the_menu = "#" + J(this).attr('rel');
			if(active_menu !== the_menu && J(the_menu).is(':hidden')) {
				J('.submenu ul').hide();
				J(the_menu).fadeIn('fast');
				active_menu = the_menu;
			} else {
				if ( J(the_menu).length == 0 ) {
					J('.submenu ul').hide();
					active_menu = the_menu;				
				}
			}
		
		J("#menus").hover(function() {}, function() {
			J("#menu li a").removeClass("hovered");
			J('.submenu ul').hide();
			J(".current").show();
			active_menu = true;			
		});
	});
	
	
	//Search focus
	J(".search_box").focus(function() {
		if (J(this).val() == "Search") {
			J(this).val('');
		}
	});

});