/*replace left&right white space*/

String.prototype.trim=trim;

function trim() {

        re = /^[ ]+|[ ]+$/g;

        return this.replace(re, "");

}



/*check input text value is number or not*/

function checkNum(val){ 

   if(isNaN(val.trim())){

      return false;

    }

}



/*check email format*/

function checkMail(val){

    regularExpression = /^[^\s]+@[^\s]+\.[^\s]{2,3}$/;

    if (!regularExpression.test(val)) {

      return false;

    }

}







