$('a[data-toggle="formtab"]').click(function(){
    var targetId = $(this).attr('href');

    $('.tabs-panels').removeClass('active');
    $('a[data-toggle="formtab"]').removeClass('active');
    
    $(targetId).addClass('active');
	$('a[href="'+targetId+'"]').addClass('active');

});

$(document).ready(function(){
    var tabsLength = $('a[data-toggle="formtab"]');
   tabsLength.click(function(){
    var NewId = $(this).attr('href');

        if(NewId === '#miningRom')
        {
            $('.progress-bar').css('width','9%').html(9 + '%');
        } 
        else if(NewId === '#thirdParty')
        {
            $('.progress-bar').css('width','18%').html(18 + '%');
        }
        else if(NewId === '#romCrushing')
        {
            $('.progress-bar').css('width','27%').html(27 + '%');
        }
        else if(NewId === '#scrubber')
        {
            $('.progress-bar').css('width','36%').html(36 + '%');
        }
        else if(NewId === '#wetPlant')
        {
            $('.progress-bar').css('width','45%').html(45 + '%');
        }
        else if(NewId === '#dmsThree')
        {
            $('.progress-bar').css('width','54%').html(54 + '%');
        }
        else if(NewId === '#dmsTwo')
        {
            $('.progress-bar').css('width','63%').html(63 + '%');
        }
        else if(NewId === '#dmsOne')
        {
            $('.progress-bar').css('width','72%').html(72 + '%');
        }
        else if(NewId === '#jigNuberry')
        {
            $('.progress-bar').css('width','81%').html(81 + '%');
        }
        else if(NewId === '#jigRO')
        {
            $('.progress-bar').css('width','99%').html(99 + '%');
        }







   });

});
