////////////////////////////////////////// DATE INPUT //////////////////////////////////////

// the italian localization
$.tools.dateinput.localize("it",  {
   months:        'Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,' +
                  'Agosto,Settembre,Ottobre,Novembre,Dicembre',
   shortMonths:   'Gen,Feb,Mar,Apr,Mag,Giu,Lug,Ago,Set,Ott,Nov,Dic',
   days:          'Domenica,Luned&igrave,Marted&igrave,Mercoled&igrave,Gioved&igrave,Venerd&igrave,Sabato',
   shortDays:     'Dom,Lun,Mar,Mer,Gio,Ven,Sab'
});

// the french localization
$.tools.dateinput.localize("fr",  {
   months:        'janvier,f&eacute;vrier,mars,avril,mai,juin,juillet,ao&ucirc;t,' +
                   	'septembre,octobre,novembre,d&eacute;cembre',
   shortMonths:   'jan,f&eacute;v,mar,avr,mai,jun,jul,ao&ucirc;,sep,oct,nov,d&eacute;c',
   days:          'dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi',
   shortDays:     'dim,lun,mar,mer,jeu,ven,sam'
});

$(":date").dateinput({
	format: 'ddd dd mmm yyyy',	  // the format displayed for the user
	selectors: false,             // whether month/year dropdowns are shown
	min: -1,                      // min selectable day (100 days backwards)
	max: 366,                    	// max selectable day (100 days onwards)
	speed: 'fast',               	// calendar reveal speed
	firstDay: 1                  	// which day starts a week. 0 = sunday, 1 = monday etc..
}); 
 
// use the same callback for two different events. possible with bind
$(":date").bind("onShow onHide", function()  {
	$(this).parent().toggleClass("active"); 
}); 
// when first date input is changed
$(":date:first").data("dateinput").change(function() {		
	// we use it's value for the seconds input min option
	$(":date:last").data("dateinput").setMin(this.getValue(), true);
});

