
 function afterLoadTab(){
    // bind mouseover and mouseout for slider controlnav
    $('a.nivo-control').bind('mouseover',function(){
        var index = $(this).attr('rel');
        $('#nivoslider img').each(function(i,item){
            if(i == index){
                roImagePath = $(item).attr('rev');
            }
        });
        $('img', this).attr('src', roImagePath); 
    });
    $('a.nivo-control').bind('mouseout',function(event){
        var index = $(this).attr('rel');
        $('#nivoslider img').each(function(i,item){
            if(i == index){
                noImagePath = $(item).attr('rel');
            }
        });
        $('img', this).attr('src', noImagePath);
    }); 
    
    //  init first tab
    
    
 }
 
 function getActiveElementImage(type, activeElement){
    var activeIndex = activeElement.attr('rel');
    var imagePath = null;
    $('#nivoslider img').each(function(i,item){
        if(i == activeIndex){
            imagePath = $(item).attr(type);
        }
    });
    return imagePath;
 }
 
 function beforeChangeTab(){
    // console.log('beforeChange event fired');
            
    var activeElement = $('.nivo-controlNav a.active');
    var noImagePath = getActiveElementImage('rel',activeElement);
    
    $('img', activeElement).attr('src', noImagePath);
 }
 
 function afterChangeTab(){
    // console.log('afterChangeTab');

    var activeElement = $('.nivo-controlNav a.active');
    var roImagePath = getActiveElementImage('rev', activeElement);
    
    $('img', activeElement).attr('src', roImagePath);
 }
 

 
 
