if( document.addEventListener ) document.addEventListener( 'DOMContentLoaded', cmxform, false );function cmxform(){  // Hide forms  $( 'form.cmxform' ).hide().end();    // Processing  $( 'form.cmxform' ).find( 'li/label' ).not( '.nocmx' ).each( function( i ){    var labelContent = this.innerHTML;    var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' );    var labelSpan = document.createElement( 'span' );        labelSpan.style.display = 'block';        labelSpan.style.width = labelWidth;        labelSpan.innerHTML = labelContent;    this.style.display = '-moz-inline-box';    this.innerHTML = null;    this.appendChild( labelSpan );  } ).end();    // Show forms  $( 'form.cmxform' ).show().end();}//function to check empty fieldsfunction isEmpty() {strfield1 = document.forms.contact.cognome.value strfield2 = document.forms.contact.email.value    if (strfield1 == "" || strfield1 == null || !isNaN(strfield1) || strfield1.charAt(0) == ' ')    {    alert(er_surname)    document.forms.contact.cognome.focus();    return false;    }    if (strfield2 == "" || strfield2 == null || strfield2.charAt(0) == ' ')    {    alert(er_email)    document.forms.contact.email.focus();    return false;    }	    return true;}//function to check valid email addressfunction isValidEmail(){  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;  strEmail = document.forms.contact.email.value;   // search email text for regular exp matches    if (strEmail.search(validRegExp) == -1)    {      alert(er_valid_email);  	  document.forms.contact.email.focus();      return false;    }     return true; }//function that performs all functions, defined in the onsubmit event handlerfunction check(form){if (isEmpty(form.cognome)){		if (isValidEmail(form.email)){		  return true;		}	}	return false;}