$(function() {
	$(".sf-menu").superfish().find('ul').bgIframe({opacity:false});
	
	$(".home-menu-hider").show();
	$(".home-menu").each(function(i) {
		$(this).css({marginTop:-($(this).height()+20)});
		$(this).data('storedHeight', -($(this).height()+20));
	});
	
	$(".home-menu-holder").hover(
		function(e) {
			$(".home-menu",this).stop();
			$(".home-menu",this).animate({marginTop:0},500);
		}, 
		function(e) {
			$(".home-menu",this).stop();
			$(".home-menu",this).animate({marginTop:$(".home-menu",this).data('storedHeight')},500);
		}
	);
	
	/*if($("#sidebar").height()>$("#content").height()) {
		$("#content").css({height:$("#sidebar").height()-65});
	} else {
		$("#sidebar").css({height:$("#content").height()+65});
	}*/
	$("#content img:not('.nozoom')").each(function(i) {
		var newImg = unescape($(this).attr('src').replace('small/',''));
		newImg = newImg.replace(/^images\//i, "");
		$(this).attr('border','0').wrap('<a class="image_link" href="images/'+newImg+'" target="_blank" rel="group" title="'+$(this).attr('alt')+'"></a>');
	});
	
	$('a.image_link').fancybox();

});
