// JavaScript Document
	function notBlank(str) {
		for (i = 0; i < str.length; i++) {
			if (str.charAt(i) != " ") return true;
		}
		return false
	}
	function isDigits(str){ 
		var myExp=/^[0-9]*$/;
		return myExp.test(str)
	}
	function isNumber(str){
		var myExp=/(^\d+$)|(^\d*\.\d+$)/
		return myExp.test(str)
	}
	function isPassword(str){
		var myExp=/^[A-Za-z0-9_]*$/i;
		if (!isInside(str,5,15)) return false;
		return myExp.test(str)
	}
	function isNickname(str){
		var myExp=/^[A-Za-z0-9_]*$/i;
		if (!isInside(str,5,10)) return false;
		return myExp.test(str)
	}
	function isLonger(str,maxLength) {
		if (str.length>maxLength)
			return true;
		return false
	}
	function isShorter(str,minLength) {
		if (str.length<minLength)
			return true;
		return false
	}
	function isEmail (sEmail){
	 var regEmail = /^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$/;
	 return regEmail.test (sEmail);
	}
	
	function isInside(str,minLength,maxLength) {
		if (!isShorter(str,minLength) && !isLonger(str,maxLength))
			return true;
		return false
	}
	function isRadioSelected(radio) {
		for (i=0 ; i< radio.length ; i++){
			if (radio[i].checked) return true;
		}
		return false
	}
	// ritorna true se nella stringa passata per argomento
	// sono contenuti 5 caratteri numerici 
	// Argomenti: str stringa
	function isCAP(str) {
		if (notNull(str)) {
			newstring = stripNonDigits(str)
			if (isSize(newstring,5)) 
				return true
		}
		return false
	}
	// ritorna l'argomento al quale sono stati tolti i
	// caratteri non numerici
	// Argomenti: str stringa
	function stripNonDigits(str) {
		return str.replace(/[^0-9]/g,"")
	}
	// ritorna true se il primo argomento è una stringa di 
	// lunghezza pari al valore del secondo argomento
	// Argomenti: str tipo stringa, size intero
	function isSize(str, size) {
		if (str.length == size) 
			return true
		else
			return false
	}
	// ritorna false se l'argomento ha lunghezza 0, true altrimenti
	// Argomenti: str tipo stringa
	function notNull(str) {
		if (str.length == 0 )
			return false
		else 
			return true
	}

	var numb = '0123456789';
	var lwr = 'abcdefghijklmnopqrstuvwxyz';
	var upr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
	 
	function isValid(parm,val) {
	  if (parm == "") return false;
	  for (i=0; i<parm.length; i++) {
		if (val.indexOf(parm.charAt(i),0) == -1) return false;
	  }
	  return true;
	}
	function isNum(parm) {return isValid(parm,numb);}
	function isLower(parm) {return isValid(parm,lwr);}
	function isUpper(parm) {return isValid(parm,upr);}
	function isAlpha(parm) {return isValid(parm,lwr+upr);}
	function isAlphanum(parm) {return isValid(parm,lwr+upr+numb);}
