updateClock = function(el){
    var currentTime = new Date ( );
    hours = (currentTime.getHours( ) < 10) ? '0' + currentTime.getHours( ) : currentTime.getHours( )
    minutes = (currentTime.getMinutes( ) < 10) ? '0' + currentTime.getMinutes( ) : currentTime.getMinutes( )
    time = hours+"."+minutes;
    el.html(time);
    ts = setTimeout(function() { updateClock($time) }, 10000);
}
$(document).ready(function(){
    
    // $time = $('#js-time');
    // if ($time.length){
    //     updateClock($time);
    // }
    //      
    $('div.portlet-tab div.box').css('display', 'none');
    $("div.portlet-tab ul.boxLinks").tabs(".boxes > div.box", {
        'current': 'selected',
        onBeforeClick: function(event, tabIndex) {
            current_tab = this.getCurrentTab();
            next_tab = this.getTabs().eq(tabIndex);
            
            current_tab.closest('li').removeClass('selected');
            next_tab.closest('li').addClass('selected');
            this.getPanes().hide().eq(tabIndex).show();
            if (next_tab.hasClass('redirect')){
                $(window.location).attr('href', next_tab.attr('href'));
            }
        }
    });

});
