
String.prototype.Trim = function(){return this.replace(/^\s+|\s+$/g,"");} 

function isEmail(s)
 {  var n,i,ErrorChar ,j;
	ErrorChar=" ~!`#$%^&*()+=?<>,{}[]\\/|'\"";
	n=s.length;
	if(n<5) return(false);
	for(i=0;i<n;i++)
	for(j=0;j<ErrorChar.length;j++)
	if(s.indexOf(ErrorChar.charAt(j))>=0) return(0);
	if(s.indexOf(".")<0||s.indexOf("@")<0 || s.charAt(0)=="@" || s.charAt(n-1)==".")
	return(false);
	else
	return(true);
 }
 function isDigital(s)
 { 
    var i,c;
    n=s.length;
    for(i=0;i<n;i++)
        { c=s.charAt(i);
        if(c<"0" || c>"9") 
	        return false;
        }
    if(n>=1) 
        return true;
    else 
        return false;
}

