$.extend(mx, {

   setStartMenu: function(n) {  
        $("div.TopL li a:eq(" + n + ")").each(function(){window.selM=this; $(this).css("color","#fff")}).each(function(){mx.gt(this, 0)});
   },

   siteReadyCode: function(){
        // Freccia
        $("div.TopL").append('<img id="CurrentP" src="' + SiteFolder + '/images/master/current.gif" style="position:absolute;bottom:6px;left:4px;display:none" />');      
        $("div.TopL li a").hover(function(){mx.gt(this)},function(){mx.gt(window.selM)}); 
   },
    
   gt: function(el, v){  
        if(v==undefined) v=800;
        var s = $("#CurrentP").show();    
        var p = $(el).parents("li:first");     
        if (p.length <=0) return        
        var lf = p[0].offsetLeft + p[0].offsetWidth/2 - 8; 
             
        s.stop().animate({left: lf }, v, 'backout');
   }, 
   
    
   // Add To cart
   beginRequest_PanelCart:function(sender,args,el){   
                  
   },    
   endRequest_PanelCart:function(sender,args,el){    
       var t =  $("div[id*=PanelCart]:first");
       var ts = t.offset(); 
       $("div.Mover").css({top: ts.top, left: ts.left, width:t.outerWidth(), height:t.outerHeight()}).animate({opacity: 0 }, 600, undefined, function(){$("div.Mover").remove()});     
   },  
   
   openImage:function(o){    
        var imm = $(o).find("img").attr("src");
        if(!imm) return;
        if(imm.lastIndexOf("&width")>0) imm = imm.substr(0, imm.lastIndexOf("&width"))
        Shadowbox.open({ 
                         player: 'img', 
                         title: 'Anteprima',
                         content: imm
                       });        
   
   }
     
});
