$(document).ready(function() {
    $("div#prenota").mouseout( 
        function() { 
	     $("td#headernav div#prend").attr("class","dx ");
	     $("td#headernav div#prens").attr("class","sx ");
	   //  $("td#headernav div#indd").attr("class","dx activedx");
	   //  $("td#headernav div#inds").attr("class","sx activesx");
	  //   $("td#headernav a#hom").attr("class","aactivea");
	     $("td#headernav a#idpreno").attr("class","a");
             $("div#info_a").hide();
             $("td#mainFormcontainer").css("background-image","url(/grafica/nuova/background.jpg)");
             $("div#preventivo").show();

          }).mouseover( 
         function() { 
	     $("td#headernav div#prend").attr("class","dx activedx");
	     $("td#headernav div#prens").attr("class","sx activesx");
	 //    $("td#headernav div#indd").attr("class","dx ");
	  //   $("td#headernav div#inds").attr("class","sx ");
	  //   $("td#headernav a#hom").attr("class","a");
	     $("td#headernav a#idpreno").attr("class","aactivea");
             $("div#preventivo").hide();
             $("div#info_a").show();
             $("td#mainFormcontainer").css("background-image","url(/grafica/nuova/background-a.jpg)");

    });
     

     
     
    
    $("div#preventivo").mouseout( 
        function() { 
	     $("td#headernav div#prevd").attr("class","dx ");
	     $("td#headernav div#prevs").attr("class","sx ");
	  //   $("td#headernav div#indd").attr("class","dx activedx");
	 //    $("td#headernav div#inds").attr("class","sx activesx");
	  //   $("td#headernav a#hom").attr("class","aactivea");
	     $("td#headernav a#idprevo").attr("class","a");
             $("div#info_b").hide();
             $("td#mainFormcontainer").css("background-image","url(/grafica/nuova/background.jpg)");
             $("div#prenota").show();
          }).mouseover( 
         function() { 
	     $("td#headernav div#prevd").attr("class","dx activedx");
	     $("td#headernav div#prevs").attr("class","sx activesx");
	 //    $("td#headernav div#indd").attr("class","dx ");
	 //    $("td#headernav div#inds").attr("class","sx ");
	 //    $("td#headernav a#hom").attr("class","a");
	     $("td#headernav a#idprevo").attr("class","aactivea");
             $("div#prenota").hide();
             $("div#info_b").show();
             $("td#mainFormcontainer").css("background-image","url(/grafica/nuova/background-b.jpg)");
    });
    
    
    $("area.Areg").mouseover( 
        function() {$("div#preventivo").mouseover();
          }); 
    
    $("td.schedario").live('click',function(){
        /*if($(this).attr('value')==2){
            $("form#mainForm").hide();
            $("img#main").css("margin-top","15px");
            $("img#main").hide();
            $("form#LTform").show();
            $("td#mainFormcontainer").css("background-image","url('/grafica/nuova/background7.jpg')");
        }else{
            $("form#LTform").hide();
            $("img#main").css("margin-top","-40px");
            $("form#mainForm").show();
            $("img#main").show();
            $("td#mainFormcontainer").css("background-image","url('/grafica/nuova/background.jpg')");
        }
        if(false && $(this).attr('value')==1 && $('input#setting').val()!="1"){
            alert("Questa funzione sarà attiva presto.");
            return false;
        }
                    
                
            return false;*/
        
    });

    //spagino
    //setTimeout("$('td.due').click()",500);
    //setTimeout("$('td.tre').click()",1000);

  /* $("select#categoriaLT").live('change',function(){
        var categoria=$("select#categoriaLT").val();
        $.ajax({
            type: "POST",
            url: "/lt3",
            data: {categoria: categoria},
            success: function(data, msg){
                $('select#marcaLT').html(data);
                $('select#modelloLT').html("<option>Tutti</option>");
            }
        });
    });

    $("select#marcaLT").live('change',function(){
        if($("select#marcaLT").val()==''){
            $("select#modelloLT").html("<option value=''>Tutti</option>");
        }else{
            var firma=$("select#marcaLT").val();
            $.ajax({
                type: "POST",
                url: "/lt2",
                data: {firma: firma},
                success: function(data, msg){
                    $('select#modelloLT').html(data);
                }
            });
        }
    });

    $("form#LTform2 select").live('change', function(event){
        var categoria=$("select#categoriaLT").val();
        var firma=$("select#marcaLT").val();
        var modello=$("select#modelloLT").val();
        $.ajax({
            type: "POST",
            url: "/lt",
            data: {categoria: categoria, firma: firma, modello: modello},
            success: function(data, msg){
                $('table#resulttable').html(data);
            }
        });
    });*/


});

