	//============================================================================
	//-                      Copyright © 2006 Maxxcom Sas                        -
	//-                           All rights reserved.                           -
	//-                                                                          -
	//-    Questo codice sorgente è protetto da copyright in base alle leggi e   -
	//-    ai trattati internazionali. L'uso non autorizzato, la riproduzione    -
	//-    parziale o totale, l'alterazione, la distribuzione di questo codice   -
	//-    sorgente saranno perseguite in sede penale e civile in ottemperanza   -
	//-    alle leggi esistenti. Sono soggette alle rispettive licenze freeware, -
	//-    GPL, LGPL o di altro tipo, le parti di codice sorgente acquisite da   -
	//-    terze parte anche senza il consenso scritto. In tal caso i nomi degli -
	//-    autori sono riportati a monte delle procedure utilizzate e/o incluse. -
	//-    Eventuali omissioni o errori potranno essere comunicati all'indirizzo -
	//-    email info@maxxcom.it per una pronta correzione e/o integrazione.     -
	//-                                                                          -
	//-    www.maxxcom.it                                                        -
	//============================================================================

	function submitFormChange() {
	  var $dialog= CreateAlertBox();
	
		var l = getObject('CodicePNR');
		var v = l.value;
		if (v == "") {
		$dialog.html("You must enter a booking code!");
			$dialog.dialog('open');
		    $dialog.dialog( "option", "buttons", { "Ok": function() { $(this).dialog("close"); l.focus(); } } );
		
			return false;
		}
		if (v.length != 6) {
		$dialog.html("The booking code must contain 6 characters!");
			$dialog.dialog('open');
		    $dialog.dialog( "option", "buttons", { "Ok": function() { $(this).dialog("close"); l.focus(); } } );
		
			return false;
		}	
		if (!isText(v)) {
			$dialog.html("The specified user code contains invalid characters!");
			$dialog.dialog('open');
		    $dialog.dialog( "option", "buttons", { "Ok": function() { $(this).dialog("close"); l.focus(); } } );
			
			return false;
		}
		var l = getObject('EmailCambio');
		var v = l.value;
		if (v == "") {
		$dialog.html("You must enter an email address to change booking");
			$dialog.dialog('open');
		    $dialog.dialog( "option", "buttons", { "Ok": function() { $(this).dialog("close"); l.focus(); } } );
			
		
			return false;
		}
		if (!isEmail(v)) {
		$dialog.html("You must enter a valid email address!");
			$dialog.dialog('open');
		    $dialog.dialog( "option", "buttons", { "Ok": function() { $(this).dialog("close"); l.focus(); } } );
			
			return false;
		}

		img = getObject('Cambio');
		if (img != null) {
			if (img.name.toLowerCase() != "conferma") {
				$dialog.html("The information has already been sent. \n\n Please wait…");
				$dialog.dialog('open');
				$dialog.dialog( "option", "buttons", { "Ok": function() { $(this).dialog("close"); l.focus(); } } );
			
				return false;
			}
			img.name = 'submitted';
		}
		return true;
	}
