function checkMy(){   
	xmlhttp = createXMLHTTP(); 
	xmlhttp.open('get','qtinfo/checkMy.action',true); 
	xmlhttp.onreadystatechange = processResponse; 
	xmlhttp.send(null);
}
function processResponse(){ 
	if(xmlhttp.readyState == 4){    
		if(xmlhttp.status == 200){ 
			var mes = xmlhttp.responseText ; 
			if(mes.length==2){ 
				document.forms["toMyM"].action = "qtinfo/toMyMentor.action";
			    document.forms["toMyM"].submit();
			}else{ 
				 show(null,'cMDiv','cMTitle',400); 
				 document.getElementById('changeNeed').innerHTML = mes; 
			}
		} else{
			alert("数据获取时出错！请刷新页面重试。");
		}
	}
}

function setTab(name,cursel,n){ //Tab选项
	HotPlay.current = 0;
	HotPlay.clickflag = 0;
	for(i = 0; i < 3;i++){
		if(i == 0){
			$(HotPlay.a+i).className='currA';	
		}else{
			$(HotPlay.a+i).className='';	
		}
	}
	if(cursel == 1){
		HotPlay.div = 'div_hp_content';
		HotPlay.ul = 'ul_hp';
		$(HotPlay.div).style.marginLeft = 0;
	}else if(cursel == 2){
		HotPlay.div = 'div_hp2_content';
		HotPlay.ul = 'ul_hp2';
		$(HotPlay.div).style.marginLeft = 0;
	}
	for(i=1;i<=n;i++){
		var menu=document.getElementById(name+i);
		var con=document.getElementById("con_"+name+"_"+i);
		menu.className=i==cursel?"hhover":"hdefault";
		con.style.display=i==cursel?"block":"none";
	}
}
function display(){ //隐藏菜单
document.getElementById("hidebox").style.display='block'; 
}
function disappear(){
document.getElementById("hidebox").style.display='none'; 
}
  
sfHover = function() { //IE6 hover伪类
var sfEls = document.getElementById("xyanav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) 
window.attachEvent("onload", sfHover); 

//向左滚动
function $(item){
	return document.getElementById(item);
}
ScrollCrossLeft={interval:0,count:0,duration:0,step:0,srcObj:null,callback:null};
ScrollCrossLeft.doit=function(obj,b,c,d){
	var s=ScrollCrossLeft;
	obj.style.marginLeft=cpu(s.count,b,c,d)+'px';
	s.count++;
	if(s.count==d){
		clearInterval(s.interval);
		s.count=0;
		obj.style.marginLeft=b+c+'px';
		s.callback();
	}
	function cpu(t,b,c,d) {return c*((t=t/d-1)*t*t+1)+b;};
}
ScrollCrossLeft.scroll=function(obj,step,span,beign,callback,duration){
	var s=ScrollCrossLeft;
	s.duration=duration;
	s.callback=callback;
	s.interval=setInterval(function(){s.doit(obj,beign,step*span,duration)},10);
}

var HotPlay={current:0,step:720,a:'a_hp_',div:'div_hp_content',ul:'ul_hp',clickflag:0}
var Hott={current:0,step:230,a:'a_ht_',div:'div_ht_content',ul:'ul_ht',clickflag:0}
var Turn={}//字面量写法 等同于var Turn = new Object;
Turn.pre=function(obj){
	if(obj.current==0){
		return;
	}else{
		Turn.go(obj,obj.current-1);
	}
}

Turn.next=function(obj){
	if(obj.current==2){
		return;
	}else{
		Turn.go(obj,obj.current+1);
	}
}

Turn.go=function(obj,index){
	if(obj.current==index){return;}
	var span=-index+obj.current;
	if(obj.clickflag > 0){return;}
	obj.clickflag=1;
	if(obj.step>0){
		if(obj.a == 'a_hp_'){
			ScrollCrossLeft.scroll($(obj.div),obj.step,span,parseInt($(obj.div).style.marginLeft)||0,cb,10);	
		}else if(obj.a == 'a_ht_'){
			ScrollCrossLeft.scroll($(obj.div),obj.step,span,parseInt($(obj.div).style.marginLeft)||0,bc,10);
		}
	}else{
		displayNOrY();
		cb();	
	}
	function imgSrc(index,id){
		var arr_img=$(id+'_'+index).getElementsByTagName('img');
		for(var i=0;i<6;i++){
			arr_img[i].src=obj.imgs[index-1][i];
		}
	}
	function cb(){
		obj.current=index;
		obj.clickflag=0;
		for(var i=0;i<3;i++){
			$(obj.a+i).className='';
		}
		$(obj.a+index).className='currA';
	}
	function bc(){
		obj.current=index;
		obj.clickflag=0;
		for(var i=0;i<3;i++){
			$(obj.a+i).className='';
		}
		$(obj.a+index).className='currA';
	}
	function displayNOrY(){
		obj.current=index;
		for(var i=0;i<3;i++){
			if(i==index)
				$(obj.ul+'_'+i).style.display='block';
			else
				$(obj.ul+'_'+i).style.display='none';
		}
	}
}
function checkName(){ 
	if(document.getElementById("name").value==''||document.getElementById("name").value=="请输入导师的姓名"){  
        alert("请填写导师姓名进行查询！");
        return  false;
    }  
    return true;
} 
function checkInPut(){  
   if(document.getElementById("ky_university_name1").value=="") {
       	alert("选择一个大学，将使导师查询结果更加精确！");
       	return  false;
    }  
    if(document.getElementById("flage").value==1){  
    	if(document.getElementById("ky_college_id1").value=="-1") {
    		alert("选择一个学院，将使导师查询结果更加精确！");
        	return  false;
    	}
    } 
    return true;
}
