function viewLogin()
{
	var div = document.getElementById("logindiv");
	var di = document.createElement("div");
	di.style.position="absolute";
	di.style.zIndex=10;
	di.style.width=1004;
	di.style.height=613;
	di.style.filter='alpha(opacity=65)';
	di.style.backgroundColor="#D9DADA";
	div.style.display="block";

	html = "<div style='position:absolute;z-index:20;display:block;left:350;top:200;width:300;height:180;'>";
	html += "<table cellpadding='0' cellspacing='0' border='0' width='300' height='159'>";
	html += "<tr><td height='32' colspan='3'><img src='images/login1.jpg'/></td></tr>";
	html += "<tr><td width='18' height='95'><img src='images/login2.jpg'/></td>";
	html +="<td width='271' bgcolor='#FFFFFF' valign='top'><table cellpadding='0' cellspacing='0' border='0' width='100%' height='91%'>";
	html +="<tr> <td width='25%' height='30'>登录名：</td><td width='75%'><input id='txtVendorName' type='text' runat='server' size='20'/></td><td align='left'><span id='hname' style='color:red;display:none;width:10;'>*</span></td></tr>";
	html +="<tr><td height='30'>密码：</td><td><input id='txtPassword' type='password' runat='server' size='20'/></td><td align='left'><span id='hpassword' style='color:red;display:none;width:10;'>*</span></td></tr>";
	html +="<tr><td>验证码：</td><td><input id='txtValidCode' runat='server' type='text' size='8'/>&nbsp;&nbsp;<input type='text' id='txtCheckCode' size='4' disabled runat='server'/>&nbsp;&nbsp;&nbsp;&nbsp;<a href='fuwu.html' target='_blank'>新用户注册</a></td></tr>";
	//html +="<tr><td colspan='3'align='right' valign='bottom'></td></tr>";
	html +="<tr><td height='29' colspan='3' align='center'><img src='images/login.jpg' border='0' onclick='tijiao()' style='cursor:hand'/>&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/quxiao.jpg' border='0' onclick='cancel()' style='cursor:hand'/></td>";
	html +="</tr></table></td><td width='11' align='right'><img src='images/login22.jpg'/></td></tr>";
	html +="<tr><td height='32' colspan='3' valign='top'><img src='images/login3.jpg'/></td></tr>";
	html += "</table></div>";
	div.innerHTML=html;
	div.appendChild(di);
	initvalue();
}

function cancel()
{
	var div = document.getElementById("logindiv");
	div.style.display="none";
}

function tijiao()
{
	if(document.all("txtVendorName").value=="")
	{
		alert("请输入用户名!");
		return;
	}
	if(document.all("txtPassword").value=="")
	{
		alert("请输入密码!");
		return;
	}
	if(document.all("txtValidCode").value!=document.all("txtCheckCode").value)
	{
		window.alert("验证码不正确，请重新输入！");
		return;
	}
	username = document.all("txtVendorName").value;
	password = document.all("txtPassword").value;
	CardActiveHomePage.index.login(username,password,callback);
}

function callback(res)
{
	result=res.value;
	if(result=="1")
	{
		window.location.href="QueryPoint.aspx";
	}
	else if(result=="2")
	{
		window.location.href="shopManage.aspx";
	}
	else
	{
		
		alert(result);
		initvalue();
		document.all("hname").style.display="block";
		document.all("hpassword").style.display="block";
		return;
	}
}

function initvalue()
{
	snd = Math.random() + "";
	strSnd=snd.substr(2,4);
	document.all("txtCheckCode").value =strSnd
	document.all("txtVendorName").focus();
}