// top搜索栏
/*function sr_onfocus() {
	document.getElementById('keyword').value = "";
}*/

function easyclick(searchtxt) {
	str = document.getElementById('keyy').value;
	if (str=='请输入您需要查找的名称') {
		alert("请输入关键字");
		return false;
	}
	return true;
}

// 登陆处理
function onLoadLogin() {
	checkUserLogin("load", "", "");
}
function login() {
	document.getElementById("loginmsg").innerHTML = "正在登陆，请稍等...";
	var username=document.getElementById("username").value;
	var password=document.getElementById("password").value;
	checkUserLogin("login", username, password);
}

function checkUserLogin(flag, username, password){
	var url = "../new_userlogin.asp?flag="+flag+"&username="+username+"&password="+password;
		
	var r = new AjaxRequest("post", url, false);
	//r.setParameter("TPL_NICK",obj.value);
	r.send(null);
	r.onresult = function(){
		showUserLogin(r.getText());
	}
}
function showUserLogin(str){
	if(str=="failure"){
		document.getElementById("password").value = "";
		document.getElementById("loginmsg").innerHTML = "登陆失败！请确认输入的信息。";
	} else {
		document.getElementById("usrLogin_main").innerHTML = str;
		document.getElementById("loginmsg").innerHTML = "";
	}
}

function ChangeSize(size) {
	var zoom = "";
	if(document.all)
	{
		zoom=document.all("fontzoom");
	}
	else
	{
		zoom=document.getElementById("fontzoom");
	}
	zoom.style.fontSize=size+'px'; 
}

function GetTime() { 
	var dt = new Date();
	var def = dt.getTimezoneOffset()/60;
	var gmt = (dt.getHours() + def);
	var ending = ":" + IfZero(dt.getMinutes());
	local= (IfZero(dt.getHours()) + ":" + IfZero(dt.getMinutes()));
	var azo =check24(((gmt + (24-1)) > 24) ? ((gmt + (24-1)) - 24) : (gmt + (24-1)));
	azo = (azo >= 24) ? azo - 24 : azo;
	azo = (IfZero(azo) + ending);
	var rome =check24(((gmt + 1) > 24) ? ((gmt + 1) - 24) : (gmt + 1));
	rome = (IfZero(rome) + ending);
	var east =check24(((gmt + (24-5)) > 24) ? ((gmt + (24-5)) - 24) : (gmt + (24-5)));
	east = (IfZero(east) + ending);
	var _GMT =check24(((gmt) > 24) ? ((gmt) - 24) : (gmt));
	_GMT = (IfZero(_GMT) + ":" + IfZero(dt.getMinutes()));
	var mag =check24(((gmt + 11) > 24) ? ((gmt + 11) - 24) : (gmt + 11));
	mag = (IfZero(mag) + ending);
	document.getElementById("globaltime").innerHTML="<dt>全球时间：</dt><dd> 中国香港："+local+"</dd><dd> 英国："+_GMT+"</dd><dd> 美国："+east+"</dd><dd> 法国："+rome+ "</dd><dd> 德国："+rome+"</dd><dd> 澳大利亚："+mag+"</dd>";
	//setTimeout("GetTime()", 1000);
}

function IfZero(num) {
	return ((num <= 9) ? ("0" + num) : num);
}
function check24(hour) {
	return (hour >= 24) ? hour - 24 : hour;
}

/*
	from index.html templets
	实现鼠标移动，产生滑动效果。
	Kevin 2008-12-02
*/
function g(o)
{
	return document.getElementById(o);
} 
function HoverLi(n)
{ 
	for(var i=1;i<=2;i++)
	{
		g('tb_'+i).className='normaltab';
		g('tbc_0'+i).className='undis';
	}
	g('tbc_0'+n).className='dis';
	g('tb_'+n).className='hovertab'; 
}