(function($){ $(function(){ $('.uhg-link').each(function() { // links which are not in use if($(this).hasClass('notActive')) {return void(0);} var NODE_STAGE_ID_PREFIX = 'stage'; var id = $(this).attr('id'); var ordinal = parseInt( id.substring(id.length-1) ); $(this).bind('click', function(e) { // reset $('.stage').hide(); // reset $('.divColRight').show(); // reset $('.uhg-link a').removeClass('active'); // add class to the anchor tag to identify its in view $(this).find('a').addClass('active'); // show the corresponding left-side div block $('#' + NODE_STAGE_ID_PREFIX + (ordinal-1)).show(); // About SharecareNow tab clicked on if(ordinal === 2) { $('#divColRight0').hide(); } // About Read more link clicked on (activate about SharecareNow tab) if(ordinal === 22) { $('#divColRight0').hide(); } // Video tab clicked on if(ordinal === 3) { $('#divColRight1').hide(); } // Video link clicked on (activate Video tab) if(ordinal === 33) { $('#divColRight1').hide(); } }); }); // End $(.uhg-link).each() // add active state to tab when link is clicked $("#uhg-link33").click(function() { $('a.videoTab').addClass("active"); }); $("#uhg-link22").click(function() { $('a.aboutTab').addClass("active"); }); }); })(jQuery);