resize_header_width = false;
max_h = 725;
function fit_height(){

	var h = $(window).height();
		if(h<290) h=290;
		if(h>max_h) h=max_h;

	var ratio = (h/max_h);
	var mtop = 155*ratio;

		img_h = h-mtop-35;

	var section_w = (ratio)*317;

		$("#main_wrapper").css("marginTop",mtop+"px");

		$(".section").width(section_w);

		$(".section .catalog_image").each(function(){
			$(this).height(img_h);
			var w = (ratio)*317;
			$(this).css("marginLeft",section_w/2 - w/2);
		});

		$(".intro_slide").each(function(){
			$(this).height(img_h);
		});

	
	var mov_w = (ratio)*1090;
	$("#intro").width(mov_w);
	$("#intro").height(img_h);
	$("#movie").height(img_h);

	if($("#intro").length > 0)$("body").width((section_w+90) * $(".section").length +mov_w);
	if(resize_header_width) $('#header').width($("body").width()); 

}

$(function(){
	
	$(".fb a").click(function(){
		t = "Derishow Sonbahar Kış 2011";
		window.open('http://www.facebook.com/sharer.php?u='+$(this).attr("index")+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
		return false;

	});
	
	$(".section").hover(function(){
		//$(".social-box").hide();
		$(this).find(".social-box").slideDown();
	
	},
	function(){
		//$(".social-box").hide();
	});
	
	$(".social-box a, #nav a, .nav a, .Mimarca").hover(function(){
		$img = $(this).find("img");
		$img.attr("def_src",$img.attr("src"));
		$img.attr("src",$img.attr("hover_src"));
	},
	function(){
		$img = $(this).find("img");
		$img.attr("hover_src",$img.attr("src"));
		$img.attr("src",$img.attr("def_src"));
	
	});

	header_left_margin = navigator.platform.indexOf("iPhone") == -1 ? 90 : 10;

	fit_height();
	$(window).resize(function(){
		fit_height();
	});
	
});


