var mPrefix = "Bisogna che tu inserisca un valore per il campo " var mSuffix = ". E' obbligatorio; inseriscilo, vai!" // whitespace characters var whitespace = " \t\n\r"; var defaultEmptyOK = false //avvisa quando un campo ?vuoto function warnEmpty (theField, s) {theField.focus() alert(mPrefix + s + mSuffix) return false} //jump del menu' a cascata function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0;} //serve a aprire una finestra popup function openWin(theURL,winName,features) { window.open(theURL,winName,features);} // Check whether string s is empty. function isEmpty(s) {return ((s == null) || (s.length == 0)) } function tooLong(s,l) {return (s.length > l) } // Returns true if string s is empty or // whitespace characters only. function isURL(some_text) {var the_first_seven = some_text.substring(0,7); the_first_seven = the_first_seven.toLowerCase(); if ((the_first_seven != 'http://') || (some_text == the_first_seven)) { return false;} else { return true; }} function isWhitespace(s) {var i; // Is s empty? if (isEmpty(s)) return true; // Search through string's characters one by one // until we find a non-whitespace character. // When we do, return false; if we don't, return true. for (i = 0; i < s.length; i++) {// Check that current character isn't whitespace. var c = s.charAt(i); if (whitespace.indexOf(c) == -1) return false; } // All characters are whitespace. return true;} // Check whether radio is empty. function isEmptyRadio(radio) {for (i=0;i= 1 character before @, so we // start looking at character position 1 // (i.e. second character) var i = 1; var sLength = s.length; // look for @ while ((i < sLength) && (s.charAt(i) != "@")) { i++} if ((i >= sLength) || (s.charAt(i) != "@")) return false; else i += 2; // look for . while ((i < sLength) && (s.charAt(i) != ".")) { i++ } // there must be at least one character after the . if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false; else return true; } function troppolungo(s, lunghezza) {if (s.length > lunghezza) return true; return false;} function okdata(data, str) { if ((!isEmpty('gg_' + data)) && (!isEmpty('mm_' + data)) && (!isEmpty('aa_' + data))) return true; if (str==1) return false; if ((isEmpty('gg_' + data)) && (isEmpty('mm_' + data)) && (isEmpty('aa_' + data))) return true; return false; }