
////////////////////////////////////////// SCROLLABLE  //////////////////////////////////////

$(".scroll").scrollable({ circular: true }).click(function() {
	$(this).data("scrollable").next();		
});

// enable circular scrollables with a click handler
$("#chained").scrollable({ circular: true }).click(function() {
	$(this).data("scrollable").next();		
});

////////////////////////////////////////// VALIDATOR //////////////////////////////////////
$.tools.validator.localize("it", {
	'*'					: 'valore non valido',
	':email'  	: 'email non valida',
	':number'  	: 'numero non valido',
	':url'	  	: 'url non valida',
	'[max]'	 		: 'massimo consentito $1',
	'[min]'	 		: 'minimo consentito $1',
	'[required]': 'campo obbligatorio'
});

$("#myform").validator({lang: 'it'});

// $("#myform").validator({lang: 'it'; position: 'top center'});

/*

////////////////////////////////////////// VALIDATOR //////////////////////////////////////

// adds an effect called "wall" to the validator
$.tools.validator.addEffect("wall", function(errors, event) {
 
	// get the message wall
	var wall = $(this.getConf().container).fadeIn();
	
	// remove all existing messages
	wall.find("p").remove();
	
	// add new ones
	$.each(errors, function(index, error) {
		wall.append(
			"<p><strong>" +error.input.attr("name")+ "</strong> " +error.messages[0]+ "</p>"
		);		
	});
	
// the effect does nothing when all inputs are valid	
}, function(inputs)  {
	
});
 
 
// initialize validator with the new effect
$("#myform").validator({
   effect: 'wall', 
   container: '#errors',
   
   // do not validate inputs when they are edited
   errorInputEvent: null
   
// custom form submission logic  
}).submit(function(e)  { 
   
   // when data is valid 
   if (!e.isDefaultPrevented()) {
      
      // tell user that everything is OK
      $("#errors").html("<h2>Richiesta Inviata</h2>");
      
      // prevent the form data being submitted to the server
      e.preventDefault();
   } 
   
});

*/

