 $(document).ready(function () {  
   
     /* Horizontal Menu */  
     $('#hor li a').hover(  
         function () {  
             //convert current height to negative value  
             height = $(this).height() * (-1);  
             $(this).stop().animate({'backgroundPosition':'(0 ' + height + ')'}, {duration:200});      
         },   
               
         function () {  
             //reset the top position  
             $(this).stop().animate({'backgroundPosition':'(0 0)'}, {duration:200});   
         }  
     );  
   
     /* Vertical Menu*/  
     $('#ver li a').hover(  
         function () {  
             //convert current width to negative value  
             width = $(this).width() * (-1);  
             $(this).stop().animate({'backgroundPosition':'(' + width + ' 0)'}, {duration:200});   
         },   
               
         function () {  
             //reset the left position  
             $(this).stop().animate({'backgroundPosition':'(0 0)'}, {duration:200});   
         }  
     );  
           
 });


