<!--

function checkform()
{
   
   if (!CheckValue(document.login.username.value)) 
      MsgError(document.login.username, "對不起，帳號格式錯誤!，\n不允許標點符號以及空白。");
     
   else if (!CheckValue(document.login.password.value))
      MsgError(document.login.password, "對不起，密碼格式錯誤!，\n不允許標點符號以及空白。");
     
   else
      document.login.submit();
}

	function CheckValue(item) {                      
	                                                 
	   if (item.indexOf ('%') !=-1 ) return false;   //-->
	   if (item.indexOf ('\'') != -1) return false;  
	   if (item.indexOf ('\"') != -1) return false;  
	   if (item.charAt (0) == " ") return false;     
	   if (item.length == 0) return false;           
                                                         
	   return true;                                  
	                                                 
	}                                                
                                                         
	function MsgError(elem, text) {                  
	                                                 
	   window.alert(text);                           
	   elem.value="";                                
	   elem.select();                                
	   elem.focus();                                 
	                                                 
	}                                                
