<%@page contentType="text/html;charset=GBK" %>
<jsp:useBean id="fguserForm" class="com.keyshop.shop.user.controller.UserForm" scope="request"/>
<script>	
	//Function trim a string
	function trim(Str , Flag)
	{
	
		Str	= ""+Str;
		if( Flag == "l" || Flag == "L" )/*trim left side only*/
		{
			RegularExp	= /^\s+/gi;
			return Str.replace( RegularExp,"" );
		}
		else if( Flag == "r" || Flag == "R" )/*trim right side only*/
		{
			RegularExp	= /\s+$/gi;
			return Str.replace( RegularExp,"" );
		}
		else/*defautly, trim both left and right side*/
		{
			RegularExp	= /^\s+|\s+$/gi;
			return Str.replace( RegularExp,"" );
		}
	}
	function submitFormReg(){
   window.location="userreg.do?actionType=regsetp1";
	}
	
	function submitForm() {
		if(trim(document.all['bean.id'].value) == "") {
			alert("请输入用户名");
			document.all['bean.id'].focus();
			return;
		}
		if(trim(document.all['bean.password'].value) == "") {
			alert("请输入密码");
			document.all['bean.password'].focus();
			return;
		}
		
		document.fguserForm.submit();
	}
	
	function clearForm() {
		document.all['bean.id'].value ="";
		document.all['bean.password'].value="";
	}
</script>

<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10" height="10"><img src="<%=CONTEXT%>/img/QQ/i01.gif" width="10" height="10"></td>
    <td  background="<%=CONTEXT%>/img/QQ/i03.gif"></td>
    <td width="10" height="10"><img src="<%=CONTEXT%>/img/QQ/i02.gif" width="10" height="10"></td>
  </tr>
  <tr>
    <td background="<%=CONTEXT%>/img/QQ/i04.gif">&nbsp;</td>
    <td>
    	<!--主题内容开始-->
			<html:form  method="post" action="/fg/user/user">
			<html:hidden property="channelId" value="<%=currentChannel.getId()%>"/>
			<input type="hidden" name="actionType" value="login"/> 
			<html:hidden property="requestPageUrl"/> 
			<table width="531" border="0" align="center" cellspacing="0" cellpadding="0">
			  <tr>
			    <td valign="top">
			    	<table width="565" border="0" cellpadding="0" cellspacing="0" class="Process01_product_navimg01">
			        <tr>
			          <td align="center" class="Process01_product_navtext">用户登录</td>
			        </tr>
			      </table>
			      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="Process01_product_navimg02">
			  			<tr>
			          <td valign="top"><br>
			          	<table width="300" border="0" cellspacing="2" cellpadding="2">
			              <%
			            		String loginError = (String)request.getAttribute("login_error");
			            		if(!StringUtil.isEmpty(loginError)) {
			            	%>
			            	<tr> 
			            		<td align="center">无效的用户名或密码</td>
			              </tr>
			            	<%
			            		}
			            	%>
			              <tr> 
			                <td align="right" class="Process01_product_navtext02">用户名：</td>
			                <td height="25" align="left">
			                	<html:text styleClass="i03" property="bean.id"  value="" size="18" maxlength="32"/>
			        
			                </td>
			              </tr>
			              <tr> 
			                <td align="right" class="Process01_product_navtext02">密　码：</td>
			                <td height="25" align="left">
			                	<html:password styleClass="i03" property="bean.password" value="" size="18" maxlength="32"/></td>
			              </tr>
			              <tr> 
			              	<td align="right">&nbsp;</td>
			                <td align="center">
			                	<input type="button"  onclick="javascript:submitForm()" value="登录">
			                  <input type="button"  onclick="javascript:submitFormReg()" value="注册">
			                </td>
			              </tr>
			              <tr> 
			                <td align="right">&nbsp;</td>
			                <td height="40" align="center" valign="bottom">
			                	<a href="<%=GETPASSWORD%>" class="Process01_product_pname01">忘记密码？</a>
			                </td>
			              </tr>
			            </table>
			          </td>
			        </tr>
			      </table>
			      <table width="565" border="0" cellpadding="0" cellspacing="0" class="Process01_product_navimg03">
			        <tr>
			          <td>
			          </td>
			        </tr>
			      </table>
			      </td>
			  </tr>
			</table>
			</html:form>
    	<!--主体内容结束-->
    </td>
    <td background="<%=CONTEXT%>/img/QQ/i05.gif"></td>
  </tr>
  <tr>
    <td width="10" height="10"><img src="<%=CONTEXT%>/img/QQ/i06.gif" width="10" height="10"></td>
    <td background="<%=CONTEXT%>/img/QQ/i08.gif"></td>
    <td width="10" height="10"><img src="<%=CONTEXT%>/img/QQ/i07.gif" width="10" height="10"></td>
  </tr>
</table>
