// JavaScript Document
(function($){
$.fn.extend({
        Scroll:function(opt,callback){
                //参数初始化
                if(!opt) var opt={};
                var _btnUp = $("#"+ opt.up);//Shawphy:向上按钮
                var _btnDown = $("#"+ opt.down);//Shawphy:向下按钮
                var timerID;
                var _this=this.eq(0).find("ul:first");
                var     lineH=_this.find("li:first").height(), //获取行高
                        line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10), //每次滚动的行数，默认为一屏，即父容器高度
                        speed=opt.speed?parseInt(opt.speed,10):500; //卷动速度，数值越大，速度越慢（毫秒）
                        timer=opt.timer //?parseInt(opt.timer,10):3000; //滚动的时间间隔（毫秒）
                if(line==0) line=1;
                var upHeight=0-line*lineH;
                //滚动函数
                var scrollUp=function(){
                        _btnUp.unbind("click",scrollUp); //Shawphy:取消向上按钮的函数绑定
                        _this.animate({
                                marginTop:upHeight
                        },speed,function(){
                                for(i=1;i<=line;i++){
                                        _this.find("li:first").appendTo(_this);
                                }
                                _this.css({marginTop:0});
                                _btnUp.bind("click",scrollUp); //Shawphy:绑定向上按钮的点击事件
                        });

                }
                //Shawphy:向下翻页函数
                var scrollDown=function(){
                        _btnDown.unbind("click",scrollDown);
                        for(i=1;i<=line;i++){
                                _this.find("li:last").show().prependTo(_this);
                        }
                        _this.css({marginTop:upHeight});
                        _this.animate({
                                marginTop:0
                        },speed,function(){
                                _btnDown.bind("click",scrollDown);
                        });
                }
               //Shawphy:自动播放
                var autoPlay = function(){
                        if(timer)timerID = window.setInterval(scrollUp,timer);
                };
                var autoStop = function(){
                        if(timer)window.clearInterval(timerID);
                };
                 //鼠标事件绑定
                _this.hover(autoStop,autoPlay).mouseout();
                _btnUp.css("cursor","pointer").click( scrollUp ).hover(autoStop,autoPlay);//Shawphy:向上向下鼠标事件绑定
                _btnDown.css("cursor","pointer").click( scrollDown ).hover(autoStop,autoPlay);

        }       
})
})(jQuery);

$(document).ready(function(){
        $("#latestreleasecontenctdown").Scroll({line:1,speed:200,timer:4000,up:"btn1",down:"btn2"});
		$("#nzcpbj1028").Scroll({line:1,speed:200,timer:3000,up:"btn1",down:"btn2"});
		$("#latestreleasecontenctdown2").Scroll({line:1,speed:200,timer:4000,up:"btn1",down:"btn2"});
		$("#zh_contentadv").Scroll({line:2,speed:300,timer:7000,up:"btn1",down:"btn2"});
		$("#newadd").Scroll({line:2,speed:300,timer:4000,up:"btn1",down:"btn2"});
		$("#qytj").Scroll({line:1,speed:300,timer:4000,up:"btn1",down:"btn2"});
});
function switch_tab_two(d,num,menu,obj)
{

   var index=parseInt(d);
   if(index < 0 && index > num-1)
   {
      index = 0;
   }
   
   for(var ti=0;ti<num;ti++)
   {
       if(index==ti){
			document.getElementById(menu+ti).className = "products_daogou";   //让标签显示为“当前样式”
			document.getElementById(obj+ti).style.display = "block";     
       }else{
	   		document.getElementById(menu+ti).className = "";   //这里让其它标签显示为“非当前样式”
			document.getElementById(obj+ti).style.display = "none";
       }
   }
   
}
var isPollTwo = true;
var pollVarTwo = Math.floor(Math.random()*100)%6 + 1;   //产生随机默认标签序号


function setPollTwo(v)       //用true和false控制自动轮换
{
isPollTwo=v;
}

function pollPlayTwo()
{
if (isPollTwo)
{
   pollVarTwo=pollVarTwo%6; 
   switch_tab_two(pollVarTwo,6,'areanumlabel','numpanel');
   pollVarTwo++;
}

setTimeout("pollPlayTwo()", 8000);   //自动轮换的间隔时间
}
function showTab(name,num,id){
  for(i=1;i<(num+1);i++){
    document.getElementById(name+"t"+i).className="";
    document.getElementById(name+i).style.display="none";
  }
  document.getElementById(name+"t"+id).className="mouse_over";
  document.getElementById(name+id).style.display="block";
}

function showTabBigclass(name,num,id){
  for(i=1;i<(num+1);i++){
    document.getElementById(name+"t"+i).className="";
    document.getElementById(name+i).style.display="none";
	document.getElementById("big_class"+i).style.display="none";
  }
  document.getElementById(name+"t"+id).className="mouse_over";
  document.getElementById(name+id).style.display="block";
  document.getElementById("big_class"+id).style.display="block";
  for(n=1;n<36;n++){
  document.getElementById("small_class"+n).style.display="none"; 
  }
  /*document.getElementById("small_class1").style.display="none";
	document.getElementById("small_class2").style.display="none";
	document.getElementById("small_class3").style.display="none";
	document.getElementById("small_class4").style.display="none";
	document.getElementById("small_class5").style.display="none";
	document.getElementById("small_class6").style.display="none";
	document.getElementById("small_class7").style.display="none";
	document.getElementById("small_class8").style.display="none";
	document.getElementById("small_class9").style.display="none";
	document.getElementById("small_class10").style.display="none";
	document.getElementById("small_class11").style.display="none";
	document.getElementById("small_class12").style.display="none";
	document.getElementById("small_class13").style.display="none";
	document.getElementById("small_class14").style.display="none";
	document.getElementById("small_class15").style.display="none";
	document.getElementById("small_class16").style.display="none";
	document.getElementById("small_class17").style.display="none";
	document.getElementById("small_class18").style.display="none";
	document.getElementById("small_class19").style.display="none";
	document.getElementById("small_class20").style.display="none";
	document.getElementById("small_class21").style.display="none";
	document.getElementById("small_class22").style.display="none";
	document.getElementById("small_class23").style.display="none";
	document.getElementById("small_class24").style.display="none";
	document.getElementById("small_class25").style.display="none";
	document.getElementById("small_class26").style.display="none";
	document.getElementById("small_class27").style.display="none";
	document.getElementById("small_class28").style.display="none";
	document.getElementById("small_class29").style.display="none";
	document.getElementById("small_class30").style.display="none";
	document.getElementById("small_class31").style.display="none";
	document.getElementById("small_class32").style.display="none";
	document.getElementById("small_class33").style.display="none";
	document.getElementById("small_class34").style.display="none";
	document.getElementById("small_class35").style.display="none";
*/
}

function showTabSmallclass(name,num,id){
	document.getElementById("big_class1").style.display="none";
	document.getElementById("big_class2").style.display="none";
	document.getElementById("big_class3").style.display="none";
	document.getElementById("big_class4").style.display="none";
	document.getElementById("big_class5").style.display="none";
	document.getElementById("big_class6").style.display="none";
  for(i=1;i<(num+1);i++){
    document.getElementById(name+"t"+i).className="";
    document.getElementById(name+i).style.display="none";
	document.getElementById("small_class"+i).style.display="none";
  }
  document.getElementById(name+"t"+id).className="mouse_over";
  document.getElementById(name+id).style.display="block";
  document.getElementById("small_class"+id).style.display="block";
}
/*
function checkfrom(t)
{
 switch(t){
	 case 1:
		 if(form1.hc_b.value==''){
		 alert("请选择搜索的类别！");
	   form1.hc_b.focus();
	    return false;
	 }
	 case  2:
		 if(form1.hc_b.value==''){
		 alert("请选择搜索的类别！");
	   form1.hc_b.focus();
	    return false;
	 }
	 case  3:
		 if(form1.nature.value==''){
		 alert("请选择公司类型！");
	   form1.nature.focus();
	    return false;
	 }
	 case  4:
		 if(form1.keyword2.value==''){
		 alert("请选择信息类别！");
	   form1.keyword2.focus();
	    return false;
	 }
	 case  5:
		 if(myforms.hc_b.value==''){
		 alert("请选择搜索的类别！");
	   myforms.hc_b.focus();
	    return false;
	 }
	 case  6:
		 if(seach_form_talent.keyword.value==''){
		 alert("请输入岗位名称！");
	   seach_form_talent.keyword.focus();
	    return false;
	 }
	 case  7:
		 if(myforms.keyword1.value==''){
		 alert("请输入关键字！");
	   myforms.keyword1.focus();
	    return false;
	 }
	 case 10:
		 if(myforms.keyword2.value=='0'){
		 alert("请选信息类别！");
	   myforms.keyword2.focus();
	    return false;
	 }
	 
	 break;
 }
}
function checkptname()
{
  if(myform.title.value=='')
  {
    alert("请输入名称！");
	myform.title.focus();
	return false;
  }
}

*/
function form_check(){
	if (myforms.hc_b.value=="") { 
	alert("请选择类别！");
	document.getElementById("hc_b").focus();
	return false; 
    }
}
function form_check2(){
	if (form1.nature.value=="") { 
	alert("请选择公司类型！");
	document.getElementById("nature").focus();
	return false; 
    }
}

function form_check3(){
	if (myforms.keyword1.value=="") { 
	alert("请输入关键字！");
	document.getElementById("keyword1").focus();
	return false; 
    }
	if (myforms.keyword2.value=="") { 
	alert("请选择信息类别！");
	document.getElementById("keyword2").focus();
	return false; 
    }
}

