
	String.prototype.trim  = _trim;

	function _trim ( )
	{
	   return this.replace(/^\s+|\s+$/g, "");
	}

    function isEmpty(strfield) {
	  field = strfield.trim();
      if (field == "" || field == null){
          return true;
      } else {
          return false;
      }
    }

	function checkNumeric(str) { return(("0123456789.".indexOf(str.toUpperCase()))+1); }
	
	function isNumeric(str) {
		for(z=0; z<str.length;++z) {
			if(!checkNumeric(str.charAt(z))) {
				return false;
			}
		}
		return true;
	}

	function checkAlphaNumeric(str) { return(("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(str.toUpperCase()))+1); }
	
	function isAlphaNumeric(str) {
		for(z=0; z<str.length;++z) {
			if(!checkAlphaNumeric(str.charAt(z))) {
				return false;
			}
		}
		return true;
	}

	function checkPassword(str) { return(("!@#$%&*()-_+?<>,.:;|0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(str.toUpperCase()))+1); }
	
	function isPassword(str) {
		for(z=0; z<str.length;++z) {
			if(!checkPassword(str.charAt(z))) {
				return false;
			}
		}
		return true;
	}

    function isEmail(field) {
      var pattern = /^([a-zA-Z0-9_\.-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
      return pattern.test(field);
    }

function ChangeLang(fromlang,tolang)
{
	tempurl = window.location.href
	if (tempurl.search(fromlang) != -1)
	{
		tempurl = tempurl.replace(fromlang, tolang);
		//alert(tempurl);
		window.location.href = tempurl
	}
}


