(function(){function e(){var e=$("#cover");$(".cover-middle",e).fadeIn(1e3,function(){$(".cover-bottom",e).fadeIn(1e3),$(".light",e).fadeIn(1e3,function(){$(".cover-middle img:first",e).fadeIn(1e3)})})}function t(e){var t=$(this);if(t.hasClass("selected"))return!1;$(".selected").removeClass("selected"),$(".show").css("display","none").removeClass("show");var n=t.addClass("selected").attr("relation"),i=$(".container");n=="cover"?i.addClass("coverbg"):i.removeClass("coverbg"),$("#"+n).fadeIn(500).addClass("show"),$("html,body").animate({scrollTop:0},300),n=="news"&&r(),e.preventDefault()}function n(e){var t=$(this),n=t.parents(".newsitem"),r=$(".newsmore",n),i=r.hasClass("isopen"),s=$(".newsdesc",n),o=0;$.each(s.children(),function(){o+=$(this).outerHeight(!0)}),o=i?120:o,$("html,body").animate({scrollTop:n.offset().top-100},300,function(){s.animate({height:o+"px"},300)}),i?r.removeClass("isopen"):r.addClass("isopen"),e.preventDefault()}function r(){var e=0,t=$(".newsitem:first"),n=t.find(".newsdesc");$.each(n.children(),function(){e+=$(this).outerHeight(!0)}),n.css("height",e+"px"),t.children(".newsmore").addClass("isopen")}function i(){$.each($("[hover]"),function(){var e=$(this),t=e.attr("hover");e.on("mouseenter",function(){!e.hasClass(t)&&e.addClass(t)}).on("mouseleave",function(){e.hasClass(t)&&e.removeClass(t)})})}$(document).ready(function(){e(),i(),$(".h-inner a").on("mouseenter",function(){var e=$(this);if(e.hasClass("current"))return;e.addClass("cur");var t=$(".h-inner .current"),n=e.offset().left-e.prevAll(".xylogo").offset().left+"px";t.hasClass("curunshow")?(t.css("left",n),t.removeClass("curunshow")):t.stop().animate({left:n},300)}).on("mouseleave",function(){var e=$(this);if(e.hasClass("current"))return;e.removeClass("cur"),setInterval(function(){$(".h-inner .cur").length==0&&$(".h-inner .current").addClass("curunshow")},100)}).on("click",t),$("#news .newsmore").on("click",n),$("#news .newsitem").on("mouseenter",function(){$(".squer",$(this)).stop().animate({width:"15px"},200)}).on("mouseleave",function(){$(".squer",$(this)).stop().animate({width:"0"},200)}),$("#news .newstitle").on("click",function(){var e=$(this).parents(".newsitem");e.hasClass("needmore")&&e.children(".newsmore").click()})})})(window.jquery);