$(document).ready(function() {

  $('li.submenu').each(function(){
    width_li = $(this).css('width');
    width_ul = $(this).children("ul:first").css('width');
    
    if(parseInt(width_li) > parseInt(width_ul))
	{
	//	$(this).children("ul:first").css('width',width_li);
	}
    else
    {
     if($.browser.msie)
      $(this).children("ul:first").css('width','150px');
    }
  });

	$("li.submenu ul").hide(); 

	$("li.submenu").hover(
        function () {
        
      $(this).parent("li:first").css('background','url(uploads/images_decometa/topnav_hover_submenu.jpg) top center no-repeat');    
      $(this).parent("li:first").css('height','55px');    
      $(this).children("ul").show();
    
        },function(){
		$(this).children("ul").hide();
    
	});//hover
  
  $("li.submenu ul").hover(function(){      
    $(this).parent("li:first").css('background','url(uploads/images_decometa/topnav_hover_submenu.jpg) top center no-repeat');    
    $(this).parent("li:first").css('height','55px');    
  },function(){
    $(this).parent("li:first").css('background',"");    
    }  
  );
  

  
  function mycarousel_initCallback(carousel) {
   jQuery('#jcarousel-control .img_btn').bind('click', function() {
      carousel.scroll(jQuery.jcarousel.intval(jQuery(this).attr("title")));
    return false;
   }); 
   };
   
   function mycarousel_visibleoutcallback(carousel,li,index,state){
    $('#img_' + index).attr("src","uploads/images_decometa/passive_header_btn.png");
    $('#text_' + index).hide();
   };
   
   function mycarousel_visibleincallback(carousel,li,index,state){
    $('#img_' + index).attr("src","uploads/images_decometa/active_header_btn.png");
    $('#text_' + index).show();
   };
  
  jQuery('#mycarousel').jcarousel({
      vertical: true,
      initCallback: mycarousel_initCallback,
      scroll: 1,
      visible: 1,
      auto: 4,
      wrap: "both",
	  animation: 0,
      buttonNextHTML: null,
      buttonPrevHTML: null,
      itemVisibleOutCallback: {
        onBeforeAnimation: mycarousel_visibleoutcallback
      },
      itemVisibleInCallback: {
        onBeforeAnimation: mycarousel_visibleincallback
      }
    });

});// document ready
