// --------------------------------------------------- 	
// CHECK REGISTRATION FORM  	
// --------------------------------------------------- 	
	function Form_Booking_Step1(theForm,mode) {	
		
		if ( mode == 'submit' ) {
			if ( theForm.elements['conditions_accepted'].checked == false ) { 
				alert("ATTENZIONE!\n\nPer procedere all'invio delle informazioni è necessario aver letto ed approvato le condizioni contrattuali.");
				theForm.elements['conditions_accepted'].focus();
				return (false);
			}
		}
		if ( theForm.elements['regionid'].value == 0 ) {
			alert( "Selezionare la REGIONE" );
			theForm.elements['regionid'].focus();
			return (false);
		}
		if ( theForm.elements['countyid'].value == 0 ) {
			alert( "Selezionare la LOCALITA'" );
			theForm.elements['countyid'].focus();
			return (false);
		}
		if ( theForm.elements['schoolid'].value == 0 ) {
			alert( "Selezionare la SCUOLA" );
			theForm.elements['schoolid'].focus();
			return (false);
		}
		if ( theForm.elements['disciplineid'].value == 0 ) {
			alert( "Selezionare la DISCIPLINA" );
			theForm.elements['disciplineid'].focus();
			return (false);
		}
		if ( theForm.elements['lessonid'].value == 0 ) {
			alert( "Selezionare il TIPO DI LEZIONE" );
			theForm.elements['lessonid'].focus();
			return (false);
		}
		if ( theForm.elements['new_date'].value == '' || ( theForm.elements['new_date'].value.search("_") != -1 ) ) { // ( theForm.elements['new_date'].value == '__/__/____' )
			alert( "Selezionare la DATA" );
			theForm.elements['new_date'].focus();
			return (false);
		}
		var giorni = theForm.elements['new_date'].value.substring(0, 2); 
		var mese = theForm.elements['new_date'].value.substring(3, 5); 
		var anno = theForm.elements['new_date'].value.substring(6, 10);
		var dataDigitato = new Date(anno,mese-1,giorni);
		
		var currentTime = new Date();
		//Devo considerare tre giorni in più, ma aggiungo 2 perchè tengo conto anche delle ore dell'orario attuale
		currentTime.setDate(currentTime.getDate() + 2);		
		
		if ( (currentTime - dataDigitato)>0){
			alert( "Selezionare una DATA successiva ai prossimi 3 giorni" );
			theForm.elements['new_date'].focus();
			return (false);
		}

		
		theForm.okForm.value = true;
		return (true);
	}
	
	
	function Form_Booking_Step2(theForm) {	
		if ( theForm.elements['firstname'].value == '' ) {
			alert( "NOME mancante" );
			theForm.elements['firstname'].focus();
			return (false);
		}
		if ( theForm.elements['lastname'].value == '' ) {
			alert( "COGNOME mancante" );
			theForm.elements['lastname'].focus();
			return (false);
		}
		if ((!(theForm.elements['email'].value.search(/^\w+((\+\w+)|(-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.([A-Za-z0-9])([A-Za-z0-9]?)([A-Za-z0-9]?)$/)!= -1)) || (theForm.elements['email'].value=="")) {  
			alert( "EMAIL non valida o mancante" );
			theForm.elements['email'].focus();
			return (false);
		}
		//if ( theForm.elements['telephone'].value == '' ) {
		if ( ( theForm.elements['telephone'].value == '' ) || theForm.elements['telephone'].value.search( /[^0-9]+/ ) != -1 ) {
			alert( "Si prega di utilizzare solo numeri per il RECAPITO TELEFONICO" );
			theForm.elements['telephone'].focus();
			return (false);
		}
		if ( theForm.elements['address'].value == '' ) {
			alert( "INDIRIZZO mancante" );
			theForm.elements['address'].focus();
			return (false);
		}
		if ( theForm.elements['zipcode'].value == '' ) {
			alert( "CAP mancante o errato" );
			theForm.elements['zipcode'].focus();
			return (false);
		}
		if ( theForm.elements['city'].value == '' ) {
			alert( "CITTA' non indicata" );
			theForm.elements['city'].focus();
			return (false);
		}
		if ( theForm.elements['privacy_accepted'].checked == false ) { 
			alert("ATTENZIONE!\n\nPer procedere all'invio delle informazioni è necessario aver letto ed approvato l'informativa sulla privacy.");
			theForm.elements['privacy_accepted'].focus();
			return (false);
		}

		theForm.okForm.value = true;
		return (true);
	}
	
	
	function Form_Booking_Step3(theForm) {	
		if ( theForm.elements['details_accepted'].checked == false ) { 
			alert("ATTENZIONE!\n\nPer procedere all'invio delle informazioni è necessario aver controllato che i dati inseriti siano corretti.");
			theForm.elements['details_accepted'].focus();
			return (false);
		}
		return (true);
	}
// --------------------------------------------------- 	
// --------------------------------------------------- 	


// **************************************************************** 	
// **************************************************************** 	
// FUNZIONI plug-in jQuery  	
// **************************************************************** 	
// **************************************************************** 	

// ===============================
// Cambio numero partecipanti //
// ===============================
$.fn.ChangeNumber = function ( id_school, id_discipline, id_lesson, id_mode, URL ) {

	$("div#bookStepsNumber").prepend( '<div id="loadingSelect"> loading... </div>' );

	$("div#bookStepsNumber").load( 'inc_select-5_Number.php?schoolid=' + id_school + '&disciplineid=' + id_discipline + '&lessonid=' + id_lesson + '&m=' + id_mode, 
		function() {
			//alert('schoolid=' + id_school + '&disciplineid=' + id_discipline + '&lessonid=' + id_lesson + '&m=' + id_mode );
			$("div#bookStepsLesson").append( '<div ID="butInfo"><a class="inline" href="popUpInfo.php?schoolid=' + id_school + '&disciplineid=' + id_discipline + '&lessonid=' + id_lesson + '"><img src="' + URL + '/graphics/info.png" /></a></div>' );
			$("div#loadingSelect").remove();
			
			// Attiva pulsante '?' per info //
				$("a.inline").fancybox({
						'hideOnContentClick': false,
						'frameHeight': 200
				});
			// .........................
	
		});
	// End {"load Number"}

}
// End {"plugin"}
// ===============================

// ===============================
// Cambio disciplina e reset numero partecipanti //
// ===============================
$.fn.ChangeDiscipline = function ( id_school, id_discipline, id_lesson, id_mode, URL ) {

	$("div#bookStepsLesson").prepend( '<div id="loadingSelect"> loading... </div>' );
	
	$("div#bookStepsLesson").load( 'inc_select-4_Lesson.php?schoolid=' + id_school + '&disciplineid=' + id_discipline + '&m=' + id_mode, 
		function() {
			
			$("div#loadingSelect").remove();
			//$("a.inline").remove();
			$( "div#butInfo" ).remove();
			
			$( "#edit-lesson" ).change( 
				function() {
					$( this ).ChangeNumber( id_school, id_discipline, $( "#edit-lesson option:selected" ).val(), 'new', URL );
				});
			// End {"load Lesson"}
		});
	// End {"change Lesson"}
	
}
// End {"plugin"}
// ===============================

// ===============================
// Cambio disciplina e reset numero partecipanti //
// ===============================
$.fn.SubmitFormStep2 = function () {

	if ( Form_Booking_Step2( document.Form_step2 ) ) {
																	
		$("div#bookMessageBox").show( 100, 
			function(){
				$("div#bookMessageBox").append( '<!-- <div id="loadingSelect"> --> <b>Elaborazione in corso, attendere prego.</b> <!-- </div> -->' );
		
				$.ajax({
					url: "inc_step-3_cc.php",
					type: "POST", 
					scriptCharset: "iso-8859-1", 
					//scriptCharset: "iso-8859-1", 
					data:  $("#Form_step2").serialize(),
					contentType: "application/x-www-form-urlencoded;charset=ISO-8859-1",
					dataType: "html",
					success:
						function( html ){

							$("div#bookMessageBox").hide( 100,
								function(){
									
									$("div#bookBoxSteps").hide( 100, 
										function(){
											$("div#bookBoxSteps").empty().append( html ).show( 100, 
												function(){
													
													// Qui dovrebbero starci le operazioni Riepilogo //
													$("div#bookBoxSteps a#order_details").click( 
														function() {
															$("div#bookInfo").empty().load( 'inc_display-order.php', 
																function() {
																	$("div#bookInfo").fadeIn( 200, 
																		function() {
																			$("#bookInfo a#order_details_close, #bookInfo a#order_details_confirm").click( 
																				function() {
																					
																					if ( this.id == 'order_details_confirm' ) {
																						// se si conferma si spunta il checkbox automaticamente 
																						$("form#Form_step3 input:checkbox").attr('checked', true);
																					}
																					$("div#bookInfo").empty().fadeOut( 200 );
																				});	
																				// End {"fadeOut Details"}	
																		});
																		// End {"fadeIn Details"}
																});
																// End {"fadeIn Details"}
														});
														// End {"click Details"}
												});
												// End {"Show Step 3"}
										});
										// End {"Hide Step 2"}
									});
								// End {"Hide Attendere"}
						}
						// End {"Ajax success 2"}
				});
				// End {"Ajax 2"}
			});
		// End {"Show Attendere"}
	}
	// End IF( Form 2 ok ) 
	
	return (false);
	
}
// End {"plugin"}
// ===============================

// **************************************************************** 	
// **************************************************************** 	

	
	
	
// ----------------------------------------------------------------------------- 
// ----------------------------------------------------------------------------- 
// BOOKING SCRIPTS 
// ----------------------------------------------------------------------------- 
// ----------------------------------------------------------------------------- 
	
	$(document).ready( 
		function() {
						
			// ----------------------------------------------------------------------------- 
			// BOOKING BOX 
			// ----------------------------------------------------------------------------- 
						
			
			// --------------------------------------
			// Set Opacity Regioni
			// --------------------------------------
			var aHrefId = 'rgID-' + regionID;
			$("div#bookBoxMap img.mapRegion").animate( {opacity: "0"}, 1, 
				function() {
					$( "div#bookBoxMap a#" + aHrefId + " img.mapRegion" ).animate( {opacity: "1"}, 1, 
						function() {
							var imgID = this.id;
							
							// ::::::::::::::::::::::::::::::::::
							// MouseOver Regioni 
							// ::::::::::::::::::::::::::::::::::
							$("div#bookBoxMap img.mapRegion").hover( 
								function() {
									if ( this.id != imgID ) {
										$( this ).animate( {opacity: "1"}, 10 );
									}
								},
								function() {
									if ( this.id != imgID ) {
										$( this ).animate( {opacity: "0"}, 10 );
									}
								});
								// End {"hover"}
							// ::::::::::::::::::::::::::::::::::
												
						});					
						// End {"set opacity on"}			
				});
				// End {"set opacity off"}
			

			
			// --------------------------------------
			// Caricamento BOX Booking
			// --------------------------------------
			if ( mode != 'user' ) {
			
				$("div#bookBoxSteps").load( 'inc_step-1_where.php?regionid=' + regionID + '&m=' + mode, 
					function() {
						
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						// Attivazione pulsante CHECK PRICE //
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						$("#price_go").click( 
							function() {
								
								if ( Form_Booking_Step1( document.Form_step1, 'check' ) ) {
									$.ajax({
										url: "inc_display-price.php",
										type: "POST", 
										scriptCharset: "iso-8859-1", 
										data:  $("#Form_step1").serialize(),
										dataType: "html",
										success:
											function( html ){
												$("div#bookPriceTot").hide( 100, 
													function(){
														$("div#bookPriceTot").empty().append( html ).show( 100, 
															function(){
																$("div#bookPriceTot").click( 
																	function() {
																		$("div#bookPriceTot").empty().hide( 100 );
																	});
																	// End {"Click close"}
															});
															// End {"Show price"}
															
													});
													// End {"Hide price"}
											}
											// End {"Ajax success price"}
									});
									// End {"Ajax price"}
								}
								// End IF( Form 2 ok ) 
								return (false);
							
							});
							// End {"click submit check price}
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						// Attivazione pulsante CONDIZIONI VENDITA //
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						$("#conditions_go").click( 
							function() {
								$("div#bookInfo").empty().load( 'inc_display-conditions.php', 
									function() {
										$("div#bookInfo").fadeIn( 200, 
											function() {
												$("#bookInfo a#order_details_close").click( 
													function() {
														$("div#bookInfo").empty().fadeOut( 200 );
														return (false);
													});	
													// End {"fadeOut Details"}	
											});
											// End {"fadeIn Details"}
									});
									// End {"fadeIn Details"}
								
								return (false);
							});					
						// End {"click conditions"}		
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						
						
						
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						// lettura step-1 
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						$("#edit-region").change( 
							function() {
								location.href  = 'schools_list.php?regionid=' + $( "#edit-region option:selected" ).val();
							});
							// End {"onChange region"}
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						
						
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						// settaggio Province 
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						$("div#bookStepsCounty").load( 'inc_select-1_County.php?regionid=' + regionID + '&countyid=' + countyID + '&locationEnc=' + schoolLocationEnc + '&m=' + mode, 
							function() {
								$("#edit-county").change( 
									function() {
										//alert('schools_list.php?regionid=' + regionID + '&countyid=' + $( "#edit-county option:selected" ).val() + '');
										location.href  = 'schools_list.php?regionid=' + regionID + '&' + $( "#edit-county option:selected" ).val() + '';//#anchor
									});
									// End {"change county"}
							});
						// End {"load"}
						// :::::::::::::::::::::::::::
						
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						// Settaggio Scuole 
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						if ( countyID != 0 ) {
							
							$("div#bookStepsSchools").load( 'inc_select-2_Schools.php?schoolid=' + schoolID + '&regionid=' + regionID + '&countyid=' + countyID + '&locationEnc=' + schoolLocationEnc + '&m=' + mode,
								function() {
									// Seleziono scuola => cambia select disciplina 
									// - Da qui la pagina non si ricarica più....
									// TOGLIE all'inizio '?' per info //
									$("a.inline").remove();
						
									// .........................
									$("#edit-school").change( 
										function() {
											
											$("div#bookStepsDiscipline").prepend( '<div id="loadingSelect"> loading... </div>' );
									
											// Azzero anche il tipo di lezione
											if ( mode != 'edit' ) {
												$("div#bookStepsLesson").load( 'inc_select-4_Lesson.php?schoolid=0&disciplineid=0' );	      
											}	
											
											$("div#bookStepsDiscipline").load( 'inc_select-3_Discipline.php?schoolid=' + $( "#edit-school option:selected" ).val(), 
												function() {
															
													$("div#loadingSelect").remove();
														
													// Seleziono disciplina => cambia select tipo lezione 
													$("#edit-discipline").change( 
														function() {
																		
															$("div#bookStepsLesson").prepend( '<div id="loadingSelect"> loading... </div>' );
																		
															$("div#bookStepsLesson").load( 'inc_select-4_Lesson.php?schoolid=' + $( "#edit-school option:selected" ).val() + '&disciplineid=' + $( "#edit-discipline option:selected" ).val(), 
																function() {
																				
																	$("div#loadingSelect").remove();
																	//$("a.inline").remove();
																	$( "div#butInfo" ).remove();
																	
																	$( "#edit-lesson" ).change( 
																		function() {
																			$( "#edit-lesson" ).ChangeNumber( $( "#edit-school option:selected" ).val(), $( "#edit-discipline option:selected" ).val(), $( "#edit-lesson option:selected" ).val(), 'new', site_url );
																		});
																	// End {"change Lesson"}
											
																});
															// End {"load Lesson"}
																	
														});
													// End {"change Discipline"}
																
												}); 
											// End {"load Discipline"}
		
											
											if ( mode == 'edit' ) {
												
												$("div#bookStepsLesson").load( 'inc_select-4_Lesson.php?schoolid=0&disciplineid=0&m=new', 
													function() {
														$( "#edit-lesson" ).ChangeNumber( 0, 0, 0, 'new', site_url );
													});
												// End {"load Lesson"}
											}
											
											//alert ('bookStepsDeposit');
											$("div#bookStepsDeposit").load( 'inc_select-6_Deposit.php?schoolid=' + $( "#edit-school option:selected" ).val())
										});
									// End {"change Schools"}

									if (parseInt(schoolID) > 0) {
										$("#edit-school").trigger('change');

									}
									
									
									// :-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:
									// :-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:
									// Settaggio Scuole 
									// :-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:
									// :-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:
									if ( mode == 'edit' ) {
										
										$("div#bookStepsDiscipline").load( 'inc_select-3_Discipline.php?schoolid=' + $( "#edit-school option:selected" ).val() + '&m=' + mode, 
											function() {
												$("div#bookStepsLesson").load( 'inc_select-4_Lesson.php?schoolid=' + $( "#edit-school option:selected" ).val() + '&disciplineid=' + $( "#edit-discipline option:selected" ).val() + '&m=' + mode, 
													function() {
														$("div#bookStepsNumber").load( 'inc_select-5_Number.php?schoolid=' + $( "#edit-school option:selected" ).val() + '&disciplineid=' + $( "#edit-discipline option:selected" ).val() + '&lessonid=' + $( "#edit-lesson option:selected" ).val() + '&m=' + mode, 
															function() {
													
																
																// #############################################################
																// CAMBIO  DISCIPLINA
																// Reset: > lezione > numero > OK
																
																$("#edit-discipline").change( 
																	function() {
																		$( this ).ChangeDiscipline( $( "#edit-school option:selected" ).val(), $( "#edit-discipline option:selected" ).val(), $( "#edit-lesson option:selected" ).val(), 'edit', site_url );
																	});
																// End {"change discipline"}		
														
																// #############################################################
																// CAMBIO  LEZIONE
																// Reset: > numero > OK
																$( "#edit-lesson" ).change( 
																	function() {
																		$( this ).ChangeNumber( $( "#edit-school option:selected" ).val(), $( "#edit-discipline option:selected" ).val(), $( "#edit-lesson option:selected" ).val(), 'new', site_url );
																	});
																// End {"change Lesson"}
																
																// #############################################################
																// CAMBIO  NUMERO
																// Reset: > none > OK
																// End {"change Number"}
														
														
															});
														// End {"load number"}													
													});
												// End {"load Lesson"}
											});
										// End {"load Discipline"}
	
									}
									// :-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:
									// :-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:
	
							
								});
								// End {"load Schools"}
						}
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						
						
						
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						// SUBMIT STEP 1 
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						$("#step1_go").click( 
							function() {
								
								if ( Form_Booking_Step1( document.Form_step1, 'submit' ) ) {
									$.ajax({
										url: "inc_step-2_who.php",
										type: "POST",
										scriptCharset: "iso-8859-1", 
										data:  $("#Form_step1").serialize(),
										dataType: "html",
										success:
											function( html ){
												// Tolgo dalle balle il prezzo
												$("div#bookPriceTot").empty().hide();
												
												$("div#bookBoxSteps").hide( 100, 
													function(){
														$("div#bookBoxSteps").empty().append( html ).show( 100, 
															function(){
																
																$("#edit-zipcode").mask("99999");
																
																// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
																// SUBMIT STEP 2 
																// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
																$("#step2_go").click( 
																	function() {
																		
																		$("#step2_go").SubmitFormStep2();
																		/*if ( Form_Booking_Step2( document.Form_step2 ) ) {
																			
																			$("div#bookMessageBox").show( 100, 
																				function(){
																					$("div#bookMessageBox").append( '<!-- <div id="loadingSelect"> --> <b>Elaborazione in corso, attendere prego.</b> <!-- </div> -->' );
																			
																					$.ajax({
																						url: "inc_step-3_cc.php",
																						type: "POST", 
																						scriptCharset: "iso-8859-1", 
																						//scriptCharset: "iso-8859-1", 
																						data:  $("#Form_step2").serialize(),
																						contentType: "application/x-www-form-urlencoded;charset=ISO-8859-1",
																						dataType: "html",
																						success:
																							function( html ){
																								
																								$("div#bookMessageBox").hide( 100,
																									function(){
																										
																										$("div#bookBoxSteps").hide( 100, 
																											function(){
																												$("div#bookBoxSteps").empty().append( html ).show( 100, 
																													function(){
																														
																														// Qui dovrebbero starci le operazioni Riepilogo //
																														$("div#bookBoxSteps a#order_details").click( 
																															function() {
																																$("div#bookInfo").empty().load( 'inc_display-order.php', 
																																	function() {
																																		$("div#bookInfo").fadeIn( 200, 
																																			function() {
																																				$("#bookInfo a#order_details_close, #bookInfo a#order_details_confirm").click( 
																																					function() {
																																						
																																						if ( this.id == 'order_details_confirm' ) {
																																							// se si conferma si spunta il checkbox automaticamente 
																																							$("form#Form_step3 input:checkbox").attr('checked', true);
																																						}
																																						$("div#bookInfo").empty().fadeOut( 200 );
																																					});	
																																					// End {"fadeOut Details"}	
																																			});
																																			// End {"fadeIn Details"}
																																	});
																																	// End {"fadeIn Details"}
																															});
																															// End {"click Details"}
																													});
																													// End {"Show Step 3"}
																											});
																											// End {"Hide Step 2"}
																										});
																									// End {"Hide Attendere"}
																							}
																							// End {"Ajax success 2"}
																					});
																					// End {"Ajax 2"}
																				});
																			// End {"Show Attendere"}
																		}
																		// End IF( Form 2 ok ) */
																		return (false);
																	
																	});
																	// End {"click submit Step 2"}
		
															});
															// End {"Show Step 2"}
														
													});
													// End {"Hide Step 1"}
											}
											// End {"Ajax success 1"}
									});
									// End {"Ajax 1"}
								
								}
								// End IF( Form 1 ok ) 
								
								return (false);
							});
							// End {"click submit Step 1"}
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						
						
						// INPUT Mask   
						jQuery(
							function($){
								// Date //
								$.mask.definitions['d'] = '[0-3]';
								$.mask.definitions['m'] = '[0-1]';
								$.mask.definitions['y'] = '[1-2]';
								$.mask.definitions['h'] = '[0-2]';
								$("#edit-date").mask("d9/m9/y999");
								//$("#dateInput").mask("99/99/9999");
								
								// Time //
								//$.mask.definitions['n'] = '[0-6]';
								//$("#timeInput").mask("h9:n9");
							});
							// End {"Mask"}
						
						
						//Form_step1.elements['new_date'].text = '12/02/2010';
	
					});
				// End {"load"}
			
			} else {
			
				$("div#bookBoxSteps").load( 'inc_step-2_who.php?m=' + mode, 
					function() {
						
						$("#edit-zipcode").mask("99999");
																
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						// SUBMIT STEP 2 
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						$("#step2_go").click( 
							function() {
								$("#step2_go").SubmitFormStep2();
								return (false);										
							});
						// End {"click submit Step 2"}
						// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
						
					});
				// End {"load"}
			
			}
			// --------------------------------------

			// ----------------------------------------------------------------------------- 


			// ----------------------------------------------------------------------------- 
			// LIST SCRIPTS 
			// ----------------------------------------------------------------------------- 
		
			// --------------------------------------
			// Set Opacity Regioni
			// --------------------------------------
			$("#school_list div.schoolsListingBox").quickpaginate({ perpage: 6, showcounter: true, pager : $("#booking_list_counter") });
			// --------------------------------------
			
			// --------------------------------------
			// Menu Slide 
			// --------------------------------------
			var blockOpen_id = '';
			
			$("div#school_list a.openBlock").click(
				function () {
					
					var slideTime = 400;
					var myDiv = this.name;
					
					// ::::::::::::::::::::::::::::::::::::::::::::::::::
					// chiude quello aperto //
					// ::::::::::::::::::::::::::::::::::::::::::::::::::
					if ( blockOpen_id && ( blockOpen_id != myDiv ) ) {
						$( "div#" + blockOpen_id ).slideUp( slideTime, 
							function () {
								$( "img#but-" + blockOpen_id ).attr( "src", site_url + '/graphics/open.png' );
								//blockOpen_id = myDiv;
								blockOpen_id = '';
							});
							// End {"slideUp"}
					}
					// End IF( uno era aperto )
					// ::::::::::::::::::::::::::::::::::::::::::::::::::
					
					
					// ::::::::::::::::::::::::::::::::::::::::::::::::::
					// apre/chiude selezionato //
					// ::::::::::::::::::::::::::::::::::::::::::::::::::
					if ( myDiv == blockOpen_id  ) {
						// :::: chiude //
						$( "div#" + myDiv ).slideUp( slideTime, 
							function () {
								$( "img#but-" + myDiv ).attr( "src", site_url + '/graphics/open.png' );
								blockOpen_id = '';
							});
							// End {"slideUp"}
					} else {
						// :::: apre //
						$( "div#" + myDiv ).slideDown( slideTime, 
							function () {
								$( "img#but-" + myDiv ).attr( "src", site_url + '/graphics/close.png' );
								blockOpen_id = myDiv;
							});
							// End {"slideUp"}

					}
					// End IF( selezionato )
					// ::::::::::::::::::::::::::::::::::::::::::::::::::
					
					
					return false;
				});
				// End {"click"}
		
			// ----------------------------------------------------------------------------- 

		
		});
		// End {"ready"}
		
		
// ----------------------------------------------------------------------------- 		
// ----------------------------------------------------------------------------- 
