$(document).ready(function(){

    $("#tooltip_01").mopTip({'w':150, 'h':20, 'style':"overOut", 'get':"#vizitor_01"});
    
    $("#tooltip_02").mopTip({'w':150, 'h':20, 'style':"overOut", 'get':"#vizitor_02"});
    
    var hide = function(i) {
        tabs = this
        tabs.getTabs().each(function (el) {
           $(el).find('a').removeClass('red')
        })
        tabs.getTabs().eq(i).find('a').addClass('red')
        tabs.getPanes().fadeOut()
        $("div.panes").animate(
            { 'height' : tabs.getPanes().eq(i).height() + 'px' },
            1000,
            function() {
        	  tabs.getPanes().fadeOut().eq(i).fadeIn(); 
            }
        )
        if (i) {
           $.cookie('tab_state', i, { expires: 31 })
        }
    }
  
    
    $.tools.addTabEffect('hide', hide)
    $("ul.roleUser").tabs("div.panes > div.tab", { tabs : 'li'  ,  effect : 'hide', initialIndex : $.cookie('tab_state')});
    
    
    $('.roleUser li').each(function() {
    	$(this).mouseover(function(e) {
    		if (!$(this).hasClass('current'))
        	   $(this).find('a').addClass('red')
        })
        $(this).mouseout(function(e) {
        	if (!$(this).hasClass('current'))
                $(this).find('a').removeClass('red')
        })
    })
    
     $('#my-dropdown, #my-dropdown2').sSelect();
   

});
