
$(function() {

	$("a.fb_popup").click(function() {
		var tmpD = this.rel.split(",");
		$.fancybox(this.href, {
			type : tmpD[0],
			width : Number(tmpD[1]),
			height : Number(tmpD[2]),
			titlePosition : "outside",
			overlayColor : "#000",
			overlayOpacity : 0.6,
			transitionIn : "elastic",
			transitionOut : "elastic"
		});
		return false;
	});
	
	$("#header nav li a").hover(function() {
		if(!$(this).parent().hasClass("active")) {
			$(this).find(".n_arrow").stop().animate({top:"60px"}, 150);
		}
	}, function() {
		if(!$(this).parent().hasClass("active")) {
			$(this).find(".n_arrow").stop().animate({top:"82px"}, {duration:200, complete:function() { $(this).css({top:"82px"})}});
		}
	});
	
	$("#header nav a").click(function() {
		if(!$(this).parent().hasClass("active")) {
			$("#header nav .active").removeClass("active").find(".n_arrow").stop().animate({top:"82px"}, {duration:200, complete:function() { $(this).css({top:"82px"})}});
			$(this).parent().addClass("active");
			$(".n_er").css({display : "block"});
			$(this).parents("li").prev().find(".n_er").css({display : "none"});
		}
	});

});
