
$(document).ready(function(){
	$(".sf-menu a img, a.menu_inspiration img").hover(
		function() {
			if(!$(this).hasClass("active")) {
				var myimg = $(this).attr("alt");
				$(this).attr("src", "images/" + myimg + "_over.jpg");			
			}
		},
		function() {
			if(!$(this).hasClass("active")) {
				var myimg = $(this).attr("alt");
				$(this).attr("src", "images/" + myimg + ".jpg");	
			}
		}
	);
	
	$(".btn_open, a.menu_inspiration").click(function() {
		var myimg = $(".btn_open img").attr("rel");
		if(myimg == "close") {
			$(".inspiration_overflow").css("height", "593px");
			$(".inspiration_overflow").css("top", "-593px");
			$(".inspiration").css("marginTop", "574px");
			$(".btn_open img").attr("src", "images/btn_close_inspiration.png");
			$(".btn_open img").attr("rel", "open");
			$(".inspiration").animate({marginTop: "0px"}, 700);
		}
		else {
			$(".btn_open img").attr("src", "images/btn_open_inspiration.png");
			$(".btn_open img").attr("rel", "close");
			$(".inspiration").animate({marginTop: "574px"}, 700, function() {
				$(".inspiration_overflow").css("height", "20px");
				$(".inspiration_overflow").css("top", "-20px");
				$(this).css("marginTop", "1px");
			});
		}
	});
	
	$(".hot_news").animate({marginTop: "0px"}, 400);
	$(".hot_news").attr("rel", "open");
	$(".btn_hot_news a").removeClass("active");
	$(".hot_news .news").addClass("active");

	
	$(".hot_news").click(function() {
		var status = $(".hot_news").attr("rel");
		if(status == "close") {
			$(".hot_news").animate({marginTop: "0px"}, 400);
			$(".hot_news").attr("rel", "open");
			$(".btn_hot_news a").removeClass("active");
			$(".hot_news .news").addClass("active");
			$("#zzz").show();
		}
		else {
			$("#zzz").show();
		}		
	});
	

	$(".hot_news_overflow").click(function() {
		var status = $(".hot_news").attr("rel");
		if(status == "close") {
			$(".hot_news").animate({marginTop: "0px"}, 400);
			$(".hot_news").attr("rel", "open");
			$(".btn_hot_news a").removeClass("active");
			$(".hot_news .news").addClass("active");
			$("#zzz").show();
			
		}
		else {
			$("#zzz").show();
		}		
	});	
	
	$(".flash_banner").click(function() {
			$(".hot_news").animate({marginTop: "113px"}, 400);
			$(".hot_news").attr("rel", "close");
			$(".btn_hot_news a").removeClass("active");
			$("#zzz").hide();
	});
	$(".footer").click(function() {
			$(".hot_news").animate({marginTop: "113px"}, 400);
			$(".hot_news").attr("rel", "close");
			$(".btn_hot_news a").removeClass("active");
			$("#zzz").hide();
	});	
		$("#zzz").click(function() {
			$(".hot_news").animate({marginTop: "113px"}, 400);
			$(".hot_news").attr("rel", "close");
			$(".btn_hot_news a").removeClass("active");
			$(this).hide();
			
	});	
	
	
	$(".news").click(function() {

		$("#zzz").show();
		$(".cnews").slideDown();
		$(".ser").slideUp();
		$(this).css('color','#3AB8ED');
		$(".service").css('color','#fff');
	});
	$(".service").click(function() {
		$("#zzz").show();
		$(".cnews").slideUp();
		$(".ser").slideDown();
		$(this).css('color','#3AB8ED');
		$(".news").css('color','#fff');
	});	
	
});
