jQuery(document).ready(function(){
	showdata();
	DTScroll();
});
function showdata(){
var date = new Date(); //日期对象
var now = "";
now = date.getFullYear()+"年"; //读英文就行了
now = now + change((date.getMonth()+1))+"月";//取月的时候取的是当前月-1如果想取当前月+1就可以了
now = now +""+ change(date.getDate())+"日&nbsp;&nbsp;";
var xinqi="";
if(parseInt(date.getDay())==1)
{
  xinqi="一";
}
else if(parseInt(date.getDay())==2)
{
  xinqi="二";
}
else if(parseInt(date.getDay())==3)
{
  xinqi="三";
}
else if(parseInt(date.getDay())==4)
{
  xinqi="四";
}
else if(parseInt(date.getDay())==5)
{
  xinqi="五";
}
else if(parseInt(date.getDay())==6)
{
  xinqi="六";
}
else if(parseInt(date.getDay())==7)
{
  xinqi="日";
}

now = now + "星期"+xinqi+"&nbsp;&nbsp;";
now = now + change(date.getHours())+":";
now = now + change(date.getMinutes())+":";
now = now + change(date.getSeconds())+"";
document.getElementById("nowDiv").innerHTML ="今天是："+ now;
setTimeout("showdata()",1000); //设置过1000毫秒就是1秒，调用show方法
}

function change(num){
if(num<10) return "0"+num;
else return num;
}

function showindex(obj,count)
{
	for(i=0;i<=count;i++){
		if(i==obj){
			$("#s_"+obj).show();
		}else
		{
			$("#s_"+i).hide();	

		}
	}
	clickIndex=obj;
}

function setTab(obj)
{
	for(i=1;i<=3;i++){
		if(i==obj){
			$("#index_"+obj).attr("class","now");
			$("#indexs_"+obj).show();
		}else
		{
			$("#index_"+i).attr("class","");
			$("#indexs_"+i).hide();

		}
	}
}

function setTab2(obj)
{
	for(i=1;i<=2;i++){
		if(i==obj){
			$("#index2_"+obj).attr("class","now");
			$("#indexs2_"+obj).show();
		}else
		{
			$("#index2_"+i).attr("class","");
			$("#indexs2_"+i).hide();

		}
	}
}

/*下拉列表选择值改变后触发js*/
function MM_jumpMenu(targ, selObj, restore) {
    if (selObj.value != "0") {
        eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
        if (restore) selObj.selectedIndex = 0;
    }
}

/*搜索js*/
function chk() {
    var getValue = document.getElementById('txtsearch');
    var getValue2 = $('#selectclassid').val();
    if (getValue.value == '') {
        alert('请输入关键词');
        getValue.focus();
        return;
    }
    else if (getValue.value == '请输入关键词') {
        alert('请输入关键词');
        getValue.focus();
        return;
    }
    else {
        window.location.href = "/aspx/html/Search.aspx?classid="+getValue2+"&key=" + encodeURIComponent(getValue.value);
    }
}


 function jobsave() {

    if ($("#Postion").val() == "") {
        alert("请输入应聘职位！");
        $("#Postion").focus();
        return false;
    }

    if ($("#name").val() == "") {
        alert("请输入姓名！");
        $("#name").focus();
        return false;
    }
    $year = document.getElementById("year").value;
    if ($year == "年") {
        alert("请选择年份！");
        document.getElementById("year").focus();
        return false;
    }
    $month = document.getElementById("month").value;
    if ($month == "月") {
        alert("请选择月份！");
        document.getElementById("month").focus();
        return false;
    }
    $daty = document.getElementById("daty").value;
    if ($daty == "日") {
        alert("请选择那一天！");
        document.getElementById("daty").focus();
        return false;
    }
    if ($("#sfzId").val() == "") {
        alert("请输入身份证号码！");
        $("#sfzId").focus();
        return false;
    }
    if ($("#telephone").val() == "") {
        alert("请输入电话！");
        $("#telephone").focus();
        return false;
    }
    return true;
}

function ShowMessage(showobj,hideobj) {
            $("#" + hideobj).hide();
            $("#" + showobj).show(); 
}

function savemessage() {
    if ($("#txtzt").val() == "") {
        alert("请输入主题！");
        $("#txtzt").focus();
        return false;
    }
    if ($("#txtname").val() == "") {
        alert("请输入姓名！");
        $("#txtname").focus();
        return false;
    }
    if ($("#txttel").val() == "") {
        alert("请输入联系电话！");
        $("#txttel").focus();
        return false;
    }
    return true;
}


function ImgAuto(imgtitle,imgsrc,objwidth,objheight){
		var ImgYH      = objheight;
        var ImgYW      = objwidth;
        var OldImage     = new Image();
        OldImage.src     = imgsrc;
        var oldwidth     = OldImage.width;
        var oldheight    = OldImage.height;
        if((oldwidth > ImgYW)||(oldheight > ImgYH)){
            if(oldwidth > oldheight){
                var newwidth = ImgYW;
                var ratio = oldwidth / ImgYW;
                var newheight = oldheight / ratio;
                OldImage.height = newheight;
                OldImage.width= newwidth;
                if(newheight>ImgYH){
                    var newnewheight = ImgYH;
                    var newratio = newheight/ImgYH;
                    var newnewwidth =newwidth/newratio;
                    OldImage.width = newnewwidth;
                    OldImage.height= newnewheight;
                }
            }
            else{
                var newheight = ImgYH;
                var ratio = oldheight / ImgYH;
                var newwidth = oldwidth / ratio;
                OldImage.height = newheight;
                OldImage.width= newwidth;
                if(newwidth>ImgYW){
                    var newnewwidth = ImgYW;
                    var newratio = newwidth/ImgYW;
                    var newnewheight =newheight/newratio;
                    OldImage.height = newnewheight;
                    OldImage.width= newnewwidth;
                }
            }
        }
		if(objheight>OldImage.height)
		{
			document.write("<img src='"+imgsrc+"' width='"+OldImage.width+"px' height='"+OldImage.height+"px' alt='"+imgtitle+"' title='"+imgtitle+"' align='absmiddle' style='margin-top:"+(objheight-OldImage.height)/2+"px;margin-bottom:"+(objheight-OldImage.height)/2+"px;' />");
		}else{
		
		document.write("<img src='"+imgsrc+"' width='"+OldImage.width+"px' height='"+OldImage.height+"px' alt='"+imgtitle+"' title='"+imgtitle+"' align='absmiddle' />");
		}
}


function DTScroll(){ 
	var jay=document.getElementById('looou'),z=10; 
	var inner=document.getElementById("holder1"); 
	var len=inner.getElementsByTagName('LI').length; 
	var h=77; 
	inner.innerHTML+=inner.innerHTML; 
	(function (){ 
	if(jay.scrollTop==h*len) jay.scrollTop=0; 
	jay.scrollTop+=Math.ceil((h-jay.scrollTop%h)*0.15); 
	z=jay.scrollTop%h==0?2000:10; 
	setTimeout(arguments.callee,z); 
	})(); 
} 


function searcj(obj)
{
	 var getValue = document.getElementById('username');
    var getValue2 =  document.getElementById('userkaohao');
    if (getValue.value == '') {
        alert('请输入姓名');
        getValue.focus();
        return;
    }
    if (getValue2.value == '') {
        alert('请输入考号');
        getValue2.focus();
        return;
    }
    else {
        window.location.href = "/aspx/html/cjcx.aspx?classid="+obj+"&obj=" + getValue.value+"&obj1="+getValue2.value;
    }
}

/*
$(function(){ 
var _wrap=$('#demo1 ul');//定义滚动区域 
var _interval=1000;//定义滚动间隙时间 
var _moving;//需要清除的动画 
_wrap.hover(function(){ 
clearInterval(_moving);//当鼠标在滚动区域中时,停止滚动 
},function(){ 
_moving=setInterval(function(){ 
var _field=_wrap.find('li:first');//此变量不可放置于函数起始处,li:first取值是变化的 
var _h=_field.height();//取得每次滚动高度(多行滚动情况下,此变量不可置于开始处,否则会有间隔时长延时) 
_field.animate({marginTop:-_h+'px'},600,function(){//通过取负margin值,隐藏第一行 
_field.css('marginTop',0).appendTo(_wrap);//隐藏后,将该行的margin值置零,并插入到最后,实现无缝滚动 
}) 
},_interval)//滚动间隔时间取决于_interval 
}).trigger('mouseleave');//函数载入时,模拟执行mouseleave,即自动滚动 
}); 

$(function(){ 
var _wrap=$('#ydemo1 ul');//定义滚动区域 
var _interval=1000;//定义滚动间隙时间 
var _moving;//需要清除的动画 
_wrap.hover(function(){ 
clearInterval(_moving);//当鼠标在滚动区域中时,停止滚动 
},function(){ 
_moving=setInterval(function(){ 
var _field=_wrap.find('li:first');//此变量不可放置于函数起始处,li:first取值是变化的 
var _h=_field.height();//取得每次滚动高度(多行滚动情况下,此变量不可置于开始处,否则会有间隔时长延时) 
_field.animate({marginTop:-_h+'px'},600,function(){//通过取负margin值,隐藏第一行 
_field.css('marginTop',0).appendTo(_wrap);//隐藏后,将该行的margin值置零,并插入到最后,实现无缝滚动 
}) 
},_interval)//滚动间隔时间取决于_interval 
}).trigger('mouseleave');//函数载入时,模拟执行mouseleave,即自动滚动 
}); 


*/



