﻿jQuery(document).ready(function(){
      
	// Add the click event handler on the list item with sub list
	jQuery('li.slide:has(ul)').click(function(event) {
		if (this == event.target) {
			jQuery(this).children().animate({opacity:'toggle',height:'toggle'},'slow'); 
		}
		return true;
	} );

		// Change the cursor.
	jQuery('li.slide:has(ul)').css({cursor:'pointer'})
	   // Hide all the nested lists (on the first time only).
	jQuery('li.slide:has(ul)').children().hide();
	jQuery('li.active ul').show();

	jQuery('#tabs .tab1').click(function(event) {
		jQuery('#tabs_content .tab1').show('slow');
		jQuery('#tabs_content .tab2').hide('slow');
		jQuery('#tabs_content .tab3').hide('slow');
		jQuery('#tabs .tab1').removeClass('tab1_on_off_off');
		jQuery('#tabs .tab1').removeClass('tab1_off_on_off');
		jQuery('#tabs .tab1').removeClass('tab1_off_off_on');
		jQuery('#tabs .tab1').addClass('tab1_on_off_off');
		jQuery('#tabs .tab2').removeClass('tab2_on_off_off');
		jQuery('#tabs .tab2').removeClass('tab2_off_on_off');
		jQuery('#tabs .tab2').removeClass('tab2_off_off_on');
		jQuery('#tabs .tab2').addClass('tab2_on_off_off');
		jQuery('#tabs .tab3').removeClass('tab3_on_off_off');
		jQuery('#tabs .tab3').removeClass('tab3_off_on_off');
		jQuery('#tabs .tab3').removeClass('tab3_off_off_on');
		jQuery('#tabs .tab3').addClass('tab3_on_off_off');
		jQuery('#tabs_content').removeClass('tabs_content_on_off_off');
		jQuery('#tabs_content').removeClass('tabs_content_off_on_off');
		jQuery('#tabs_content').removeClass('tabs_content_off_off_on');
		jQuery('#tabs_content').addClass('tabs_content_on_off_off');
	} );
	jQuery('#tabs .tab2').click(function(event) {
		jQuery('#tabs_content .tab1').hide('slow');
		jQuery('#tabs_content .tab2').show('slow');
		jQuery('#tabs_content .tab3').hide('slow');
		jQuery('#tabs .tab1').removeClass('tab1_on_off_off');
		jQuery('#tabs .tab1').removeClass('tab1_off_on_off');
		jQuery('#tabs .tab1').removeClass('tab1_off_off_on');
		jQuery('#tabs .tab1').addClass('tab1_off_on_off');
		jQuery('#tabs .tab2').removeClass('tab2_on_off_off');
		jQuery('#tabs .tab2').removeClass('tab2_off_on_off');
		jQuery('#tabs .tab2').removeClass('tab2_off_off_on');
		jQuery('#tabs .tab2').addClass('tab2_off_on_off');
		jQuery('#tabs .tab3').removeClass('tab3_on_off_off');
		jQuery('#tabs .tab3').removeClass('tab3_off_on_off');
		jQuery('#tabs .tab3').removeClass('tab3_off_off_on');
		jQuery('#tabs .tab3').addClass('tab3_off_on_off');
		jQuery('#tabs_content').removeClass('tabs_content_on_off_off');
		jQuery('#tabs_content').removeClass('tabs_content_off_on_off');
		jQuery('#tabs_content').removeClass('tabs_content_off_off_on');
		jQuery('#tabs_content').addClass('tabs_content_off_on_off');
	} );
	jQuery('#tabs .tab3').click(function(event) {
		jQuery('#tabs_content .tab1').hide('slow');
		jQuery('#tabs_content .tab2').hide('slow');
		jQuery('#tabs_content .tab3').show('slow');
		jQuery('#tabs .tab1').removeClass('tab1_on_off_off');
		jQuery('#tabs .tab1').removeClass('tab1_off_on_off');
		jQuery('#tabs .tab1').removeClass('tab1_off_off_on');
		jQuery('#tabs .tab1').addClass('tab1_off_off_on');
		jQuery('#tabs .tab2').removeClass('tab2_on_off_off');
		jQuery('#tabs .tab2').removeClass('tab2_off_on_off');
		jQuery('#tabs .tab2').removeClass('tab2_off_off_on');
		jQuery('#tabs .tab2').addClass('tab2_off_off_on');
		jQuery('#tabs .tab3').removeClass('tab3_on_off_off');
		jQuery('#tabs .tab3').removeClass('tab3_off_on_off');
		jQuery('#tabs .tab3').removeClass('tab3_off_off_on');
		jQuery('#tabs .tab3').addClass('tab3_off_off_on');
		jQuery('#tabs_content').removeClass('tabs_content_on_off_off');
		jQuery('#tabs_content').removeClass('tabs_content_off_on_off');
		jQuery('#tabs_content').removeClass('tabs_content_off_off_on');
		jQuery('#tabs_content').addClass('tabs_content_off_off_on');
	} );

	jQuery('#tabs .tab1').css({cursor:'pointer'})
	jQuery('#tabs .tab2').css({cursor:'pointer'})
	jQuery('#tabs .tab3').css({cursor:'pointer'})

	jQuery('#tabs_content .tab2').hide();
	jQuery('#tabs_content .tab3').hide();

} );
    
