    //http://www.developingskills.com/ds.php?article=jstrim&page=1
    
    function strltrim() {
        return this.replace(/^\s+/,'');
    }

    function strrtrim() {
        return this.replace(/\s+$/,'');
    }
    function strtrim() {
        return this.replace(/^\s+/,'').replace(/\s+$/,'');
    }

    String.prototype.ltrim = strltrim;
    String.prototype.rtrim = strrtrim;
    String.prototype.trim = strtrim;

	function chkfld(elm, name) {
		var strval = elm.value;
		strval = strval.trim();
		if (strval == "")
		{
			alert("Please input " + name + " field!");
			elm.focus();
			return false;
		}
		return true;
	}

	function chkemail(elm, name) {
		var string1 = elm.value;
		if (string1.indexOf("@") == -1)
		{
			alert("Please input a valid email address!");
			elm.focus();
			return false;
		} else {
			return true;
		}
	}

