//wwl 2008-05-10 添加收藏夹
function addBookmark(url,title)
{
	if (window.sidebar) {
	window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
	window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
	return true;
	}
}
function HomePage(obj, url)//设为主页
{
if (document.all){
	obj.setHomePage(url);
}else{
	if(window.netscape)
	{
	try { 
	netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
	} 
	catch (e) 
	{ 
	alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'"); 
	}
	}
	var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
	prefs.setCharPref('browser.startup.homepage',url);
}
}
function lanmu_show(p_,ii,n,classname_){
	if (n==null){
		n=2;
	}
	if (classname_==null){
		classname_="left_content_bottom";
	}
	for (i=1;i<=n ;i++ ){
		$(p_+"_"+i).style.display="none";
		$(p_+"_header_"+i).className=classname_+"_old";
	}
		$(p_+"_"+ii).style.display="";
		$(p_+"_header_"+ii).className=classname_+"_now";
}

function $(v)
{
	return document.getElementById(v);
}
//邮箱登陆
if (top.location !== self.location) {
top.location=self.location;
}
function window_onload() {
	var S = document.getElementById("usernameshow");
	S.focus();
}
function gook() {
	var S;
	S = document.getElementById("usernameshow");
	if (S.value == "")
	{
		alert("用户名不能为空!");
		S.focus();
		return ;
	}
	S = document.getElementById("pwshow");
	if (S.value == "")
	{
		alert("密码不能为空");
		S.focus();
		return ;
	}
       S = document.getElementById("usernameshow");
	if(document.getElementById("AdminLogin").checked==false)
{
	document.f1.username.value = usernameshow.value+from.value;
	}
	else{
		document.f1.username.value = S.value
	}
        	S = document.getElementById("showsaveUser");
	document.f1.saveUser.value = S.checked;

	S = document.getElementById("showSecEx");
	document.f1.SecEx.value = S.checked;

	S = document.getElementById("pwshow");
	document.f1.pwhidden.value = encode(S.value, parseInt(document.f1.picnum.value));

	document.f1.submit();
}
function encode(datastr, bassnum) {
	var tempstr;
	var tchar;
	var newdata = "";
	for (var i = 0; i < datastr.length; i++)
	{
		tchar = 65535 + bassnum - datastr.charCodeAt(i);
		tchar = tchar.toString();
		while(tchar.length < 5)
		{
			tchar = "0" + tchar;
		}
		newdata = newdata + tchar;
	}
	return newdata;
}

