/** 检测登录 **/

function resubmit(obj) {
	var usn = document.getElementById('UsernameGet');       		
    var psw = document.getElementById( 'PasswordGet');
    if (usn.value=="") {
		alert("请填写会员名");
	    usn.onmouseover = function(){usn.focus();};
        usn.onfocus = function(){usn.select();};
		return false;
	}
    if (psw.value=="") {
       alert("请填写密码");
	   psw.onmouseover = function(){psw.focus();};
       psw.onfocus = function(){psw.select();};
	   return false;
	}
	Lalert("正在验证登录 ……");
	obj.sbt.disabled = true;
	return true;
}

/** 截取空格 **/

 function trim(inputString) {
   
	if (typeof inputString != "string") { return inputString; }
	var retValue = inputString;
	var ch = retValue.substring(0, 1);
	while (ch == " ") { 
	//检查字符串开始部分的空格
		retValue = retValue.substring(1, retValue.length);
		ch = retValue.substring(0, 1);
	}
	ch = retValue.substring(retValue.length-1, retValue.length);
	while (ch == " ") {
	//检查字符串结束部分的空格
		retValue = retValue.substring(0, retValue.length-1);
		ch = retValue.substring(retValue.length-1, retValue.length);
	}
	while (retValue.indexOf("  ") != -1) { 
	//将文字中间多个相连的空格变为一个空格
		retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
	}
	return retValue;
 } 

/** 通知信息 **/
function Lalert(str)
{
	var $layer = document.createElement("div");
	$layer.id = "message";
	$layer.style.position	= "absolute";
	$layer.style.zIndex	= "9";
	$layer.style.color	= "#000000";
	$layer.style.background	= "#FFFFFF";
	$layer.style.border	= "solid 1px #CED2D9";
	$layer.style.padding	= "8px 20px 8px 20px";
	$layer.style.textAlign	= "center";
	$layer.style.font	= "normal 12px Verdana, Arial, Helvetica, sans-serif";
	$layer.style.filter	= "progid:DXImageTransform.Microsoft.Shadow(color=#000000, Direction=135, Strength=2) alpha(Opacity=85)" +
					(document.bgColor == "#000000" ? " Xray()" : "");
	$layer.innerHTML	= '<span>' + str + '</span><br />' +
				  '<span><img src="http://www.sdbiz.net/manage/ico/loader.gif" /></span>';

	document.body.appendChild($layer);
	$layer.style.top	= document.body.scrollTop + (document.body.clientHeight - $layer.offsetHeight) / 2 + "px";
	$layer.style.left	= document.body.scrollLeft +  (document.body.clientWidth - $layer.offsetWidth) / 2 + "px";
	setTimeout('document.getElementById("message").style.display="none"', '3000');
}

    function dosubmit(){
    if (document.searchform1.skey.value=="")
    {
        alert("请输入搜索关键字");
        document.searchform1.skey.focus();
        return false;
    }
}