<!--
	// Check whether string s is empty.
	function isEmpty(s) {
	    return ((s == null) || (s.length == 0));
	}


	// Returns true if string s is empty or 
	// whitespace characters only.
	function isWhitespace (s) {
		var whitespace = " \t\n\r";

		// Is s empty?
		if (isEmpty(s)) return true;

		// Search through string's characters one by one
		// until we find a non-whitespace character.
		// When we do, return false; if we don't, return true.
		var i;		
		for (i = 0; i < s.length; i++)
		{   
			// Check that current character isn't whitespace.
			var c = s.charAt(i);

			if (whitespace.indexOf(c) != -1) 
			   continue;
			else
			  return false;
		}

		// All characters are whitespace.
		return true;
	}
	
	function isEmail(s) {
		// there must be >= 1 character before @, so we
		// start looking at character position 1
		// (i.e. second character)
		var i = 1;
		var sLength = s.length;

		// look for @
		while ((i < sLength) && (s.charAt(i) != "@"))
		{ 
			i++;
		}

		if ((i >= sLength) || (s.charAt(i) != "@")) return false;
		else i += 2;

		// look for .
		while ((i < sLength) && (s.charAt(i) != "."))
		{ 
			i++;
		}

		// there must be at least one character after the .
		if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
		else return true;
	}

	function warnEmpty (theField, s)
	{ 	alert(s);
	    theField.focus();
		return false;
	}

	function warnInvalid (theField, s)
	{	alert(s);
	    theField.focus();
		theField.select();
		return false;
	}

	function checkString (theField,s)
	{   // Make sure the field exists before completing the test
		if (theField == null) return true;
		if (isWhitespace(theField.value))
		   return warnEmpty (theField, s);
		else return true;
	}

	function checkEmail (theField,s)
	{
		if (!isEmail(theField.value))
		   return warnInvalid (theField, s);
		else return true;
	}

	function isNumber(s)
	{
		var digits = "0123456789";
		var i = 0;
		var sLength = s.length;

		while ((i < sLength))
		{ 
			var c = s.charAt(i);
			if (digits.indexOf(c) == -1) return false; 
			i++;
		}
		
		return true;
	}

	function checkSelect(theSelect,s)
	{
		if (theSelect.options[theSelect.selectedIndex].value != "")	return true;
		else
		{
			theSelect.focus();
			warnEmpty(theSelect,s);
			return false;
		}
	} 

	function checkNumber (theField,s)
	{
		if (!isNumber(theField.value)) return false;
		if (isWhitespace(theField.value))
		   return warnEmpty (theField, s);
		else return true;	
	}


	function checkzip (theField,s)
	{
		var ss=theField.value;
		var digits = "0123456789";
		var i = 0;
		var sLength = ss.length;
		
		if(sLength<6)
		    return warnInvalid (theField, s);
		    
		while ((i < sLength))
		{ 
			var c = ss.charAt(i);
			if (digits.indexOf(c) == -1) 
					return warnInvalid (theField, s);

			i++;		
		}
		
		return true;
	}

	function checkPhone(theField,s)
	{
		var ss=theField.value;
		var digits = "0123456789-,";
		var i = 0;
		var sLength = ss.length;

		while ((i < sLength))
		{ 
			var c = ss.charAt(i);
			if (digits.indexOf(c) == -1) 
				return warnInvalid (theField, s);

			i++;
		}

		c = "--";
		if (ss.indexOf(c) != -1) 
			return warnInvalid (theField, s);

		return true;
	}

	function checkPassWord(theField)
	{
		if (theField.value.length < 4)
		{
			alert("ÃÜÂë³¤¶ÈÐ¡ÓÚ4");
			theField.focus();	
			return false;
		}
		else return true;		
	}
	
	function checkFigure (theField,s)
	{
		var vv,ww,xx;
		vv=theField.value;
		var iPos=vv.indexOf(".");
		if(iPos==0) vv="0"+vv;
		if(iPos==(vv.length - 1))  vv=vv+"0";

  		xx=parseFloat(vv);
  		ww=xx.toString(10);
  		var i=vv.length - ww.length;
  		var j=0;
  		if(i>0)	{
  			iPos=ww.indexOf(".");
  			if(iPos==-1){ ww=ww+".";  		 
  			              i=i-1;}
  			for(j=0;j<i;j++)
  				ww=ww+"0";
  		}

  		if(ww!=vv) 
  		    return warnInvalid (theField, s);
  		 
  		return true;  		
	}
-->