function quoteReplace(inputBox) {	inputBox.value = inputBox.value.replace(/'/g,"`");	return;}function trim(strText) {     // this will get rid of leading spaces     while (strText.substring(0,1) == ' ')         strText = strText.substring(1, strText.length);    // this will get rid of trailing spaces     while (strText.substring(strText.length-1,strText.length) == ' ')        strText = strText.substring(0, strText.length-1);   return strText;}function isEmailAddr(email){  var result = false;  var theStr = new String(email);  var index = theStr.indexOf("@");  if (index > 0)  {    var pindex = theStr.indexOf(".",index);    if ((pindex > index+1) && (theStr.length > pindex+1))  result = true;  }  return result;}function validEmail(formField){  var result = true;    if (result && ((formField.value.length < 3) || !isEmailAddr(document.form1.email.value)) )  {    alert("Inserire un indirizzo E-Mail valido");    formField.focus();    result = false;  }     return result;}function ISdata(stringa) {   var data = stringa;   if (data.length > 0) {     var ok = true;     var first = false;     var second = false;     var g = 0;     var m = 0;     var giorno;     var mese;     var anno;     for(i=0;i<data.length;i++) {       if (data.charAt(i) != '/' && (data.charAt(i) < '0') || (data.charAt(i) > '9')) ok = false;     }     if (!ok){		//alert("Inserire una data corretta in formato gg/mm/aaaa");      return false;    }    for(i=0;i<data.length;i++) {       if (data.charAt(i) == '/' && !first) {;         first = true;        g = i;      }       else if (data.charAt(i) == '/' && first) {         second = true;        m = i;      }     }     if (!first || !second) ok = false;     if (!ok){		//alert("Inserire una data corretta in formato gg/mm/aaaa");      return false;    }    giorno = data.substring(0,g);     mese   = data.substring(g+1,m);     anno   = data.substring(m+1,data.length);     if (anno < 1000) ok = false;         if (mese < 1 || mese > 12) ok = false;         if (giorno < 1 || giorno > 31) ok = false;     if (giorno > 30 && mese == 4) ok = false;     if (giorno > 30 && mese == 6) ok = false;     if (giorno > 30 && mese == 9) ok = false;     if (giorno > 30 && mese == 11) ok = false;     if (giorno > 29 && mese == 2) ok = false;     if (giorno == 29 && mese == 2) {      if (anno % 4 == 0) {        if (anno % 100 == 0) {           if (anno % 400 != 0) ok = false;         }      }      else ok = false;    }     if (!ok){		//alert("Inserire una data corretta in formato gg/mm/aaaa");      return false;    }  }  return true;} function easyDate (inputBox) {	if (inputBox.value.length > 10) {		inputBox.value = inputBox.value.substring(0, 10)	} else if ((inputBox.value.length == 2) || (inputBox.value.length == 5)) {		inputBox.value += "/"	}}function radio_button_checker(radio_field) {	var radio_choice = 0;	// Loop from zero to the one minus the number of radio button selections	for (counter = 0;  counter < radio_field.length; counter++) {		// If a radio button has been selected it will return true		// (If not it will return false)		if (radio_field[counter].checked) {			var radio_choice = 1;		}	}	if (radio_choice == 0) { return false;	}	else {return true;}}function check_email(str) {	var email=str;	if (email.indexOf(' ')== -1 && 0 < email.indexOf('@') && email.indexOf('@')+1 < email.length) 		return true;	else 		alert ('Invalid email address!')	return false;}function MM_openBrWindow(theURL,winName,features) { //v2.0  window.open(theURL,winName,features);}var bookmarkurl="http://indirizzo del tuo sito qui"var bookmarktitle="Descrizione del tui sito qui"function addbookmark(){if (document.all)window.external.AddFavorite(bookmarkurl,bookmarktitle)}
