//邮件登录口
function navLogin(frm) { 
	var email = frm.LoginName.value;
	if (email=="") {
		alert("请输入帐户");
		frm.LoginName.focus();
		return false;
	}
	if (frm.passwd.value=="") {
		alert("请输入密码");
		frm.passwd.focus();
		return false;
	}
	
	var domainName = frm.DomainName.value;
	if (email.lastIndexOf("@")==-1) {
		email = email + "@" + domainName;
	}
	else
		domainName = email.substring(email.lastIndexOf("@")+1);
	frm.UserName.value = email;

	if(domainName=="21cn.net"){
		frm.action="http://hermes.webmail.21cn.net/webmail/business_router.jsp";
	}
	else{
		frm.action="http://passport.21cn.com/maillogin.jsp";
	}
	setTimeout('document.frmmail.passwd.value=""',500);
}

//114登录
var ids114={
	www:506,	news:507,	et:508,		auto:510,	she:511,	life:512,
	health:513,	house:514,	sports:515,	it:519,		travel:520,	finance:523,
	game:524,	m2:508,		food:512,	"2008":515,	"512":507,	t:509,
	vgo:509,	photo:509,	pod:509,	free:509,	ok:509,		blog:509,
	mail:509,	picture:507
};
var chids114={
	www:"news",		news:"news",	et:"et",			auto:"auto",	she:"news",		life:"life",
	health:"life",	house:"news",	sports:"sports",	it:"news",		travel:"news",	finance:"news",
	game:"game",	m2:"et",		food:"life",		"2008":"sports","512":"news",	t:"news",
	vgo:"news",	photo:"news",	pod:"news",		free:"news",	ok:"news",	blog:"news",
	t:"news",	mail:"news",	picture:"news", m2:"et", golf:"sports", lottery:"sports"
};

//取出频道名
var sChannel = "";
var arr = document.location.host.split(".");
if( arr.length<=3)
	sChannel = arr[0];
else
	sChannel = arr[arr.length-3];
sChannel = sChannel.toLowerCase();
couterid = "506";
if( ids114[sChannel]) couterid = ids114[sChannel];
chid = "news";
if(chids114[sChannel])chid = chids114[sChannel];
sKeywordUrl= "http://"+chid+".21cn.com/so/srhHotPage.html";
window.document.search21cnfrm1.chid.value=chid;
//alert(sChannel + ":" +couterid+ ":" +chid);

function getPosition(o){
	var p={x:0,y:0};
	p.w=o.offsetWidth;
	p.h=o.offsetHeight;
	while(!!o){
		p.x+=o.offsetLeft;
		p.y+=o.offsetTop;
		o=o.offsetParent;
	}
	return p;
}

function onClickSrhHot(obj){
	p=getPosition(obj)
	obj = document.getElementById("srhHotList");
	obj.style.top=(p.y+19)+"px";
	obj.style.left=(p.x-201)+"px";
	obj.style.visibility="visible";
}

function colseSrhHot(){
	document.getElementById("srhHotList").style.visibility="hidden";
}

function navSearch(frm){
	if (frm.keyword.value == ""){
		alert("请输入要搜索的关键字");
		return false;
	}
	return true;
}

//hot keyword
document.write('<div id="srhHotList" style="position:absolute;left:0px;top:0px; width:250px; height:67px; visibility:hidden; z-index:999">');
document.write(' <div style="width:250px; height:40px; border:1px solid #AAAAAA; background-color:#F0F0F0">');
document.write('  <div style="height:30px; margin:3px 3px 5px 4px; padding:5px; background-color:#FFFFFF;font-size:12px; line-height:150%; text-align:left;" class="srhHot">');
document.write('   <iframe src="'+sKeywordUrl+'" scrolling="no" width="230" height="37" frameborder="0"></iframe>');
document.write('  </div>');
document.write(' </div>');
document.write(' <div align="right"><img src="http://img04.21cn.com/search/btn/btnClose.gif" style="cursor:pointer" onClick="colseSrhHot();"></div>');
document.write('</div>');