function resizeBody(){
	var wh = $(window).height(), ph = 0, fw = $(".footer").width();
	if(wh <= 610) ph = 610;
	if(wh > 610 && wh < 700) ph = wh;
	if(wh >= 700) ph = 700;
	if (window.location.pathname == "/collections/" || window.location.pathname.substr(0, 8) == "/source/") ph = $(document).height() + 100 + $(".footer").height();
	$(".page").css("height", ph + "px");
	$("body").css("overflow-y", "hidden");
	$(".footer").css({
		"top": ph + "px",
		"margin-left": -(fw / 2)
	}).slideDown("slow", function(){
		$("body").css("overflow-y", "auto");
	});
	$(".phone, .email").fadeIn("slow");
	delete wh; delete ph;
}

$(function(){
	setTimeout(function(){
		resizeBody();
	}, 1000);
	$(window).resize(function(){
		resizeBody();
	});
	$(".menu a[href='/partnership/']").parent().css("margin", "-3px 0px 2px 0px");
	$(".menu a[class!='active']").hover(function(){
		$(this).children("img").attr("src", $(this).children("img").attr("src").replace("menu_", "over_menu_"));
	}, function(){
		$(this).children("img").attr("src", $(this).children("img").attr("src").replace("over_", ""));
	})
	$(".address > div:first").show();
	$(".towns").change(function(){
		$(".address > div").slideUp("slow").parent().children("div[id='address_" + $(this).val() + "']").slideDown("slow");
	});
	$(".new h4 a, .collection > a:has(img)").fancybox({
		"overlayShow": false
	});
})
