日期:2014-05-16 浏览次数:20492 次
<%@ page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %> <head> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> <title></title> <link href="./pages/ipic/css/main.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="./pages/ipic/scripts/login.js"></script> <style type="text/css"> <!-- body { margin: 0px auto; background-image: url(./pages/ipic/images/bg.jpg); text-align: center; background-repeat: repeat-x; background-color: #FFF;} .foot { color: #666;} --> </style> <script type="text/javascript"> function onLoginLoaded(){ if(isPostBack == "False") { GetLastUser(); } } function GetLastUser() { var id = "49BAC005-7D5B-4231-8CEA-16939BEACD67"; var usr = GetCookie(id); if(usr != null) { document.getElementById('username').value = usr; }else { document.getElementById('username').value = "001"; } GetPwdAndChk(); } function SetPwdAndChk() { var usr = document.getElementById('username').value; SetLastUser(usr); if(document.getElementById('chkRememberPwd').checked == true) { var pwd = document.getElementById('password').value; var expdate = new Date(); expdate.setTime(expdate.getTime() + 14 * (24 * 60 * 60 * 1000)); SetCookie(usr,pwd, expdate); }else{ ResetCookie(); } } function SetLastUser(usr) { var id = "49BAC005-7D5B-4231-8CEA-16939BEACD67"; var expdate = new Date(); expdate.setTime(expdate.getTime() + 14 * (24 * 60 * 60 * 1000)); SetCookie(id, usr, expdate); } function GetPwdAndChk() { var usr = document.getElementById('username').value; var pwd = GetCookie(usr); if(pwd != null) { document.getElementById('chkRememberPwd').checked = true; document.getElementById('password').value = pwd; } else { document.getElementById('chkRememberPwd').checked = false; document.getElementById('password').value = ""; } } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; //alert(j); if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } var isPostBack = "true"; function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function SetCookie(name, value, expires) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : (";