var CurrentHotScreen = 0 ;

function $(id) {
	return document.getElementById(id);
}

function setHotQueryList(screen){
	var Vmotion = "forward" ;
	var MaxScreen = 7 ;
	if (screen >= MaxScreen) {
		screen = 0 ;
		Vmotion = "reverse" ;
	}
	if(null != hot_query_td.filters) {
		hot_query_td.filters[0].apply();
		hot_query_td.filters[0].motion = Vmotion;
	}
	for (i=0;i<MaxScreen;i++) {
		$("switch_"+i).style.display = "none" ;
	}
		$("switch_"+screen).style.display = "block" ;
	if(null!=hot_query_td.filters){
		hot_query_td.filters[0].play();
	}
	CurrentHotScreen = screen ;
}

function refreshHotQuery(){
	refreshHotQueryTimer = null;
	setHotQueryList(CurrentHotScreen+1);
	refreshHotQueryTimer = setTimeout('refreshHotQuery();', 5000);
}

function switchdiv(id1,id2,id3,id4){
	$("img"+id1).src = cm_url+"/img/"+id1+"h.png";
	$("img"+id2).src = cm_url+"/img/"+id2+"o.png";
	$("img"+id3).src = cm_url+"/img/"+id3+"o.png";
	$("img"+id4).src = cm_url+"/img/"+id4+"o.png";
	$("tab").className = "tab"+id1;
	$("a0"+id1).style.display = "";
	$("a0"+id2).style.display = "none";
	$("a0"+id3).style.display = "none";
	$("a0"+id4).style.display = "none";
}

function switchmodTag(modtag,modcontent,modk) {
	for(i=1; i <9; i++) {
		if (i==modk) {
			$(modtag+i).className="m_li_a";$(modcontent+i).style.display="block";
		} else {
			$(modtag+i).className="m_li";$(modcontent+i).style.display="none";
		}
	}
}

function switchmodTag2(modtag,modcontent,modk) {
	for(i=1; i <4; i++) {
		if (i==modk) {
			$(modtag+i).className="country_over";$(modcontent+i).style.display="block";
		} else {
			$(modtag+i).className="country_out";$(modcontent+i).style.display="none";
		}
	}
}

function switchmodTag3(modtag,modcontent,modk) {
	for(i=1; i <6; i++) {
		if (i==modk) {
			document.getElementById(modtag+i).className="tab_over";document.getElementById(modcontent+i).style.display="block";
		} else {
			document.getElementById(modtag+i).className="tab_out";document.getElementById(modcontent+i).style.display="none";
		}
	}
}

function headerurl(url) {
	window.location.href=url;
}

function selectstu()
{
	var stuname = document.getElementById("stu_name").value;
	if(checktag(stuname))
	{
		var passwd = document.getElementById("stu_passwd").value;
		oPenWin("学生查询结果", 500, 600, "http://m.aceleader.com/select.php?stuname="+encodeURI(stuname)+"&passwd="+passwd+"&url=http://www.edu-china.cn",true);
	}
}

function oPenWin(_sTitle, _sWidth, _sHeight, _sUrl, _bDialog, _open)
{
	xposition=0; yposition=0;
	if ((parseInt(navigator.appVersion) >= 4 )) {
		xposition = (screen.width - _sWidth) / 2;
		yposition = (screen.height - _sHeight) / 2;
	}
	if(_open) {
		window.open(_sUrl,"win","menubar=no,location=no,resizable=no,scrollbars=no,status=no,left="+xposition+",top="+yposition+",width="+_sWidth+",height="+_sHeight);
	} else {
		if(window.Event) {
			window.open(_sUrl,"win","menubar=no,location=no,resizable=no,scrollbars=no,status=no,left="+xposition+",top="+yposition+",innerWidth="+_sWidth+",innerHeight="+_sHeight);
		} else {
			if(_bDialog == true) {
				showModelessDialog(_sUrl, window, "dialogHeight:"+(_sHeight+20)+"px;dialogWidth:"+_sWidth+"px;status:no;help:no;resizable:yes;status:no;tustatus:no;");
			} else {
				showModalDialog(_sUrl, window, "dialogHeight:"+(_sHeight+20)+"px;dialogWidth:"+_sWidth+"px;status:no;help:no;resizable:yes;status:no;tustatus:no;");
			}
		}
	}
}

function checktag(Sting) {

	if(Sting.length < 2 || Sting.length > 10) {
		alert('用户名长度不符法');
		return false;
	}
	//常用的符号
	var compStr = "§№☆★○●◎◇◆□■△▲※→←↑↓〓＃＆＠＼︿＿￣〖〗【】（）〔〕｛｝．’‘”“》《〉〈〕〔‘’“”々～‖∶”’‘｜¨ˇˉ·－…！？：；，、。  ~!@#$%^&*()+={}|[]\\:;\"'<,>?/_";
    var length2 = Sting.length;
	for (var iIndex=0;iIndex<length2;iIndex++) {
		var temp1 = compStr.indexOf(Sting.charAt(iIndex));
		if(temp1>=0){
			alert('用户名中包含非法字符');
			return false;
		}
	}
	return true;
}