$(document).ready(function(){
	$("a.lb").colorbox();
	$("a.info").colorbox({width:"650px", height:"600px", iframe:true});
	$(document).pngFix();
	
	$(".menu_2 li a").hover(
		function () { $(this).closest("li").addClass("over"); },
		function () { $(this).closest("li").removeClass("over");}
	);
	
	$(".t_ricerca_orari tr, .t_abbonamenti tr, .t_punti_vendita tr").hover(
		function () { $(this).addClass("hilite"); },
		function () { $(this).removeClass("hilite");}
	);
	
	
	$(".f_newsletter").validate({
		rules: {
        	email: {
				required: true,
				email: true
			}
		},
		messages: {
			email: ""
		}
	});
	
	$("#part").autocomplete(
        "/Ricerca_Autocomplete_Json.aspx",
    {matchSubset:false,cacheLength:1,minChars: 0,max:100,width: 310,matchContains: "word",autoFill: false,formatItem: function(row, i, max){return row[0];}});
    
    $("#dest").autocomplete(
        "/Ricerca_Autocomplete_Json.aspx",
    {matchSubset:false,cacheLength:1,minChars: 0,max:100,width: 310,matchContains: "word",autoFill: false,formatItem: function(row, i, max){return row[0];}});
	
	$(".f_viaggia").validate({
			rules:{
				part: "required",
				dest: "required",
				giorno: {
				    required: true,
				    range:[1, 31]
				},
				mese:{
				    required: true,
				    range:[1, 12]
				},
				anno:{
				    required: true,
				    range:[1900, 2999]
				},
				ora:{
            	    required: true,
				    range:[0, 24]
				},
				minuti:{
            	    required: true,
				    range:[0, 60]
    			}
			},
			messages: {
				part:"",
				dest:"",
				giorno:"",
				mese:"",
				anno:"",
				ora:"",
				minuti:""
				
			}
		});
});	