var Main = {
top: function() {
$("#m" + m).addClass("on");
Search.one("#TOPBTN", "TOPKEY", "", "鍏抽敭璇嶄笉鑳戒负绌猴紒", "杈撳叆鐨勫叧閿瘝瀛楁暟涓嶈杩囧锛?, "鎮ㄨ緭鍏ョ殑鍐呭瀛樺湪鐗规畩瀛楃锛?, searchpath)
//鍒ゆ柇鏄惁鏈変笅鎷
var _li=$("menu li")
_li.each(function(){
var n=$(this).find("dd").length
if(n>=1){
$(this).addClass("has-sub");
$(this).find('.quia').after('');
}else{
$(this).find('.qui-submenu').remove();
}
//鏀瑰彉閫変腑 榧犳爣缁忚繃鍘绘帀褰撳墠鏍忕洰閫変腑
$(this).hover(function(){
$(this).addClass("on").siblings().removeClass("on");
},function(){
$(this).removeClass("on");
$("#m"+m).addClass("on");
});
});
$('.qui-top-nav .ULLIST>li .quiaa').click(function(event) {
$(this).parents('li').toggleClass('wapon');
$(this).next('.quiwapnav').slideToggle('fast').parents('li').siblings('li').find('.quiwapnav').hide();
});
},
bottom: function() {
Main.top();
//鏈€澶ч珮搴
$(".MAXBOX").each(function(i,item){
var maxheight = 0;
for(var i = 0;i<$(this).find('.MAXLI').length;i++){
if(maxheight <= $(this).find('.MAXLI').eq(i).find('.MAXLI2').innerHeight()){
maxheight = $(this).find('.MAXLI').eq(i).find('.MAXLI2').innerHeight();
}
}
$(this).find('.MAXLI2').css('height',parseInt(maxheight)+'px');
});
//鏁寸珯鏃犲浘澶勭悊
setTimeout(function(){
$.each($("img"), function(i, n) {
$(n).on('error', function() {
n.src = nopicpath;
});
n.src = n.src;
});
$(".Ispic").each(function(){
var img=$(this).css("background-image")
var nop='url("'+ location.protocol +'//'+ location.hostname +''+picpath+'")'
if(img==nop){
$(this).css("background-image","url("+nopicpath+")")
}
})
},500)
//杩斿洖椤堕儴
$(window).scroll(function() {
var stop = $(document).scrollTop()
if (stop > 150) {
$(".qui-gotop22").css('opacity', '1');
} else {
$(".qui-gotop22").css('opacity', '0');
}
});
$(".qui-gotop").click(function() {
$('body,html').animate({
scrollTop: 0
}, 300)
});
var LocalHref=encodeURIComponent(window.location.href);
var WebTt = $('title').html();
//鍒嗕韩鏂版氮寰崥
$(".qui-share-sina").attr("href","//service.weibo.com/share/share.php?url="+LocalHref+"&title="+ WebTt +'&searchPic=false');
//鍒嗕韩QQ
$(".qui-share-qq").attr("href","//connect.qq.com/widget/shareqq/index.html?url="+LocalHref+"&title="+ WebTt);
//tab鍒囨崲
$(".qui-tab-box .qui-tab-ll").hide();
$(".qui-tab-box .qui-tab-tt .quia").each(function(i,item){
$(this).click(function(){
$(this).addClass("on").siblings().removeClass("on");
$(".qui-tab-box .qui-tab-ll").eq(i).stop().fadeIn('fast').siblings(".qui-tab-ll").hide();
})
})
$(".qui-tab-box").each(function(i,item){
$(this).find('.qui-tab-ll').eq(0).show();
$(this).find('.quia').eq(0).addClass("on");
});
},
keyword:function(){
var str=$("#keyword").text()
var regExp = new RegExp(str, 'g');
$(".news-list .item").each(function(){
var html = $(this).find(".tit").html();
var newHtml = html.replace(regExp, "" + str + ''); //灏嗘壘鍒扮殑鍏抽敭瀛楁浛鎹紝鍔犱笂highlight灞炴€э紱
$(this).find(".tit").html(newHtml); //鏇存柊鏂囩珷锛
})
},
}
var Search = {
one: function(btn, kid, txt, txt1, txt2, txt3, url) {
$(btn).jqSearch({
TxtVal: txt,
KeyTxt1: txt1,
KeyTxt2: txt2,
KeyTxt3: txt3,
KeyId: kid, //杈撳叆妗唅d
KeyUrl: url, //璺宠浆閾炬帴
KeyHref: "key", //閾炬帴浼犲€
Static: false //鏄惁闈欐€佺珯
});
}
}
//