/**
 * @section   : Global JavaScript functions
 * @project   : Damen Romijn.tv
 * @comment   : Original code for damenromijn.nl by Boye Oomens <boye@e-sites.nl>
 * @author    : John van Hulsen <john@e-sites.nl>
 * @version   : 1.0
 */

/**
 * Tabfunction in navigation by jQuery 
 * @author: John van Hulsen <john@e-sites.nl>
 * @required: jQuery (1.3.2)
 * @usage: call initTabs() on DOM ready
 */
var initTabs = function(){

    if($('#tabs li.active').length<1) {
        $('#tabs li:first-child').addClass('active');
        var activeTab =  $('#tabs li:first-child').find('a').attr('href');
    } else {
        var activeTab = $('#tabs li.active').find('a').attr('href');
    }
    $(activeTab).show();
    	
    $('#tabs a').not('.disabled').click(function(){
		$('#tabs .active').attr('class','');
		$(this).parent('li').addClass('active');
		var currentTab = $(this).attr('href');
		$('.tabContent').hide();
		$(currentTab).show();
		return false;
	});
	
	$('#gotoArchief').click(function(){
		$('#tabs .active').attr('class','');
		$('#tabs .right').parent('li').addClass('active');
		var currentTab = $('#tabs .right').attr('href');
		$('.tabContent').hide();
		$(currentTab).show();
		return false;
	});
};
