function initFocus(){
		var obj = $('username');
		obj.focus(); //定位
		//obj.select(); //预选定
}

function ClickLogin(evt)
 {
 if (evt.keyCode == 13)
 {
 return doSubmit();
 }
}

function NotNumberString (InString,RefString){
	if(InString.length==0){
		return false;
	}
	for (Count=0; Count < InString.length; Count++){
		TempChar= InString.substring (Count, Count+1);
		if (RefString.indexOf (TempChar, 0)!=-1){
			return true;
		}
	}
	return false;
}

function RefreshCode()
{
		var imgCode=$('ImgVCode');
		imgCode.src="/DV_getcode.asp?rnd="+Math.random();
}

function doSubmit()
{
if ($('username').value.replace(/\s/g,"").replace("　","") == "")
        {
        alert("请输入通行证账号！");
		$('username').focus();
        return (false);
        }
if ($('password').value.replace(/\s/g,"").replace("　","") == "")
        {
        alert("请输入通行证密码！");
		$('password').focus();
        return (false);
        }
document.myform.submit()
}

function dosearch()
{
if($('word').value.length==0 || $('word').value == "<请输入要检索的关键字>")
	{
	//alert("请输入通行证账号！");
	$('word').value = "<请输入要检索的关键字>";
	//$('word').focus();
	return (false);
	}
if(NotNumberString($('word').value,"'&<>?%,;:()`~!@#$^*{}[]|+-=")==1)
	{
	$('word').value = "<输入的关键字不能包含非法字符>";
	return (false);
	}
if($('word').value.length<2)
	{
	$('word').value = "<输入的关键字不能少于两个字>";
	return (false);
	}
document.sform.submit()
}


function Login()
{
document.writeln("<table width=\"960\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("      <tr>");
document.writeln("        <td height=\"30\" background=\"/images/menu01.gif\" class=\"biankuan\"><table width=\"940\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
if (GetCookie("my0579") != null) {
document.writeln("            <tr>");
document.writeln("              <td width=\"20\"><\/td>");
document.writeln("              <td width=\"350\">欢迎您:" + GetCookieName("my0579","UserName") + "&nbsp;&nbsp; 您当前为[免费会员]<\/td>");
document.writeln("              <td width=\"100\"><a href=\"http://my.0579.com/\" target=\"_blank\">会员中心<\/a><\/td>");
document.writeln("              <td width=\"100\"><a href=\"http://passport.0579.com/\" target=\"_blank\">通行证首页<\/a><\/td>");
document.writeln("              <td width=\"100\"><a href=\"http://passport.0579.com/login.asp?act=logout&referer="+encodeURIComponent(document.URL)+"\" style=\"color:#0000FF;\">退出登录<\/a><\/td>");
document.writeln("              <td align=\"right\"><a href=\"javascript:;\" onclick=\"window.external.addFavorite(window.location.href,'金华信息港');\">加入收藏<\/a> |<a href=\"javascript:;\" onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage(window.location.href);\">设为首页<\/a><\/td>");
document.writeln("            <\/tr>");
	}
	else {
document.writeln("            <form name=\"myform\" method=\"post\" id=\"myform\" action=\"http://passport.0579.com/login.asp\" OnSubmit=\"return clsChkLogin.CheckForm ()\" ><tr>");
document.writeln("              <td width=\"50\" align=\"center\">通行证:<\/td>");
document.writeln("              <td width=\"110\"><input type=\"text\" name=\"username\" id=\"username\" style=\"width: 100px\" onkeypress=\"return ClickLogin(event);\"><\/td>");
document.writeln("              <td width=\"50\" align=\"center\">密　码:<\/td>");
document.writeln("              <td width=\"110\"><input type=\"password\" name=\"password\" id=\"password\" style=\"width: 100px\" onkeypress=\"return ClickLogin(event);\"><\/td>");
document.writeln("              <td width=\"90\" align=\"center\"><select id=\"select\"><option>分类信息<\/option><\/select><\/td>");
document.writeln("              <input name=\"referer\" value=\"http://my.0579.com\" type=\"hidden\">");
document.writeln("              <input name=\"act\" value=\"login\" type=\"hidden\">");
document.writeln("              <td width=\"60\"><img src=\"/images/login01.gif\" onclick=\"doSubmit()\" style=\"cursor : pointer;\"><\/td>");
document.writeln("              <td width=\"100\"><a href=\"http://passport.0579.com/getpsw.asp\" target=\"_blank\">忘记密码？<\/a><\/td>");
document.writeln("              <td width=\"100\"><a href=\"http://passport.0579.com\" target=\"_blank\" style=\"color:#FF0000;\">快速注册<\/a><\/td>");
document.writeln("              <td align=\"right\"><a href=\"javascript:;\" onclick=\"window.external.addFavorite(window.location.href,'金华信息港');\">加入收藏<\/a> |<a href=\"javascript:;\" onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage(window.location.href);\">设为首页<\/a><\/td>");
document.writeln("            <\/tr><\/form>");
}
document.writeln("			<\/table><\/td>");
document.writeln("      <\/tr>");
document.writeln("<\/table>");
}