$(function () {
if ($(".pages").length > 0) {
var length = $("#totalcount").text();
var cur = $(".a_cur").text();
var html = "";
for (var i = 1; i <= length; i++) {
if (i == cur) {
html += "";
} else {
html += "";
}
}
$(".p_jump select").html(html);
}
$("a").focus(function () { this.blur(); });
$(".foldmenu .select").click(function () {
$(".menulist").slidetoggle();
});
$(".ewm .btn").click(function () {
$(".ewm ul").slidetoggle();
});
$(".share .wx").click(function(){
$(".wxbox").fadein();
});
$(".wxbox .close").click(function(){
$(".wxbox").fadeout();
});
//
$(".history li").each(function (i, item) {
if (number(i + 1) % 2 == 0) {
$(this).addclass("next");
}
});
//
$(".culturebox li .item a").hover(
function () {
$(this).children(".mast").stop().fadeto(400, 1);
},
function () {
$(this).children(".mast").stop().fadeto(400, 0);
}
);//
/*$(".newsscroll li .imgbox a").hover(
function () {
$(this).children(".mast").stop().fadeto(400, 1);
},
function () {
$(this).children(".mast").stop().fadeto(400, 0);
}
);*///
$(".listbox li").first().addclass("on");
$(".hrlist li").first().addclass("current");
})
$(".hrlist li").each(function () {
var btn = $(this).find(".jobtitle");
btn.click(function () {
var statis = $(this).parents("li").find(".txtcont").css("display");
if (statis == "none") {
$(this).parents("li").siblings().removeclass("current");
$(this).parents("li").siblings().find(".txtcont").hide(500);
$(this).parents("li").addclass("current");
$(this).parents("li").find(".txtcont").show(500);
}
else {
$(this).parents("li").find(".txtcont").hide(500);
$(this).parents("li").removeclass("current");
}
});
});
jquery(".mainnav li").bind("mouseover", function () {
jquery(this).find(".subnav").stop(true, true).fadein();
jquery(this).addclass("onnav");
})
jquery(".mainnav li").bind("mouseleave", function () {
jquery(this).find(".subnav").stop(true, true).fadeout();
jquery(this).removeclass("onnav");
})
//pic 导航下拉
$(document).ready(function () {
$("#mobilenav h2").toggle(function () {
$(this).next(".sub").animate({ height: 'toggle', opacity: 'toggle' }, "fast");
$(".bg").animate({ opacity: 'toggle' });
$("this").addclass("stuck-nav");
$("#mobilenav h2").addclass("on");
}, function () {
$(this).next(".sub").animate({ height: 'toggle', opacity: 'toggle' }, "fast");
$(".bg").animate({ opacity: 'toggle' });
$("#mobilenav h2").removeclass("on");
});
$("li>span", "#mobilenav").bind("click", function () {
var li = $(this).parent();
if (li.hasclass("fold")) {
li.removeclass("fold");
$(this).find("b").removeclass("ui-jia").addclass("ui-jian");
li.find(".foldcontent").slidedown();
} else {
li.addclass("fold");
$(this).find("b").removeclass("ui-jian").addclass("ui-jia");
li.find(".foldcontent").slideup();
}
});
});//mobile导航下拉
//图库
function photo() {
$('#mainpic,.culturephoto').bind("selectstart", function () { return false; });
function g(s) {
return document.getelementbyid(s);
}
function getstyle(obj, attr) {
if (obj.currentstyle) {
return obj.currentstyle[attr];
} else {
return getcomputedstyle(obj, false)[attr];
}
}
function animate(obj, json) {
if (obj.timer) {
clearinterval(obj.timer);
}
obj.timer = setinterval(function () {
for (var attr in json) {
var icur = parseint(getstyle(obj, attr));
icur = icur ? icur : 0;
var ispeed = (json[attr] - icur) / 6;
ispeed = ispeed > 0 ? math.ceil(ispeed) : math.floor(ispeed);
obj.style[attr] = icur + ispeed + 'px';
if (icur == json[attr]) {
clearinterval(obj.timer);
}
}
}, 30);
}
var opic = g("picbox");
var olist = g("listbox");
var oprev = g("prev");
var onext = g("next");
var oprevtop = g("prevtop");
var onexttop = g("nexttop");
var opicli = opic.getelementsbytagname("li");
var olistli = olist.getelementsbytagname("li");
var len1 = opicli.length;
var len2 = olistli.length;
var opicul = opic.getelementsbytagname("ul")[0];
var olistul = olist.getelementsbytagname("ul")[0];
var w1 = opicli[0].offsetwidth;
var w2 = olistli[0].offsetwidth;
opicul.style.width = w1 * len1 + "px";
olistul.style.width = w2 * len2 + "px";
var index = 0;
var num = 6;
var num2 =6;
initimg();
function initimg(){
var curimg=$("#listbox ul li:eq("+index+")").find("img");
$("#mainpic").find("img").attr("src",curimg.attr("src")).next().text(curimg.attr("alt"));
}
function change(isclick) {
if(isclick==undefined){
isclick=false;
}
initimg();
//animate(opicul, { left: -index * w1 });
if (index < num2&&!isclick) {
animate(olistul, { left: 0 });
} else if (index + num2 <= len2&&!isclick) {
animate(olistul, { left: -(index - num2 + 1) * w2 });
}
else if(!isclick){
animate(olistul, { left: -(len2 - num) * w2 });
}
for (var i = 0; i < len2; i++) {
olistli[i].classname = "";
if (i == index) {
olistli[i].classname = "on";
}
}
}
onexttop.onclick = onext.onclick = function () {
index++;
if(index == len2){index--;return;}
index = index == len2 ? 0 : index;
change();
return false;
}
oprevtop.onclick = oprev.onclick = function () {
index--;
if( index == -1){index++;return;}
index = index == -1 ? len2 - 1 : index;
change();
return false;
}
for (var i = 0; i < len2; i++) {
olistli[i].index = i;
olistli[i].onclick = function () {
index = this.index;
change(true);
}
}
}
jquery(".othernav1").slide({ maincell: "ul", autoplay:false, vis: 1, scroll: 1, autopage: true, pnloop: true});