$(document).ready(function(){
	
	
	
	 //set the starting bigestHeight variable  
     var biggestHeight = 0;  
     //check each of them  
     $('.equal_height').each(function(){  
         //if the height of the current element is  
         //bigger then the current biggestHeight value  
         if($(this).height() > biggestHeight){  
             //update the biggestHeight with the  
             //height of the current elements  
             biggestHeight = $(this).height();  
         }  
     });  
     //when checking for biggestHeight is done set that  
     //height to all the elements  
     $('.equal_height').height(biggestHeight);  
	
	 
	 var biggestHeight2 = 0;  
     //check each of them  
     $('.equal_height2').each(function(){  
         //if the height of the current element is  
         //bigger then the current biggestHeight value  
         if($(this).height() > biggestHeight2){  
             //update the biggestHeight with the  
             //height of the current elements  
             biggestHeight2 = $(this).height();  
         }  
     });  
     //when checking for biggestHeight is done set that  
     //height to all the elements  
     $('.equal_height2').height(biggestHeight2);  
	
	// hide all faq when load
	$('.subHead').next().hide();
		$('.faqBody .content').height('');
		$('.faqBody .lSidebar').height('');
		$('.faqBody .main').height('');
		$('.faqBody .rSidebar').height('');
		$('.faqBody .lSidebar').height($('.faqBody .content').height());
	
	
	$('.faqSection .expCol span').each(function() {
		
			$(this).click(function () {
			 	if ($(this).hasClass('exp')) {
					$(this).parent().parent().children('.faqCont').show();
				}
				if ($(this).hasClass('col')) {
					$(this).parent().parent().children('.faqCont').hide();		
				}
			});
			
			
		
	});





// sitemap tree
	$('.parentPage').next().hide();
		$('.faqBody .content').height('');
		$('.faqBody .lSidebar').height('');
		$('.faqBody .main').height('');
		$('.faqBody .rSidebar').height('');
		$('.faqBody .lSidebar').height($('.faqBody .content').height());
		
	//add exp collapse toggler	
	
	
	$('.parentPage').each(function() {
		//add toggle to those who has child						   
		if ($(this).next('.subPage').children().length) {
			$(this).append('<span class="toggler"></span>');
		}
	});

	$('.parentPage span').each(function() {
		$(this).click(function () { 
				$(this).toggleClass('exp')								  	
				$(this).parent().next().toggle();
				$('.faqBody .lSidebar').height($('.faqBody .content').height());
			});
	});
	
	
	
   	$('.expCol .exp').click(function () {
      $('.subPage').show();
	  $('.toggler').addClass('exp');
	  $('.faqBody .lSidebar').height($('.faqBody .content').height());
    });
	
	$('.expCol .col').click(function () {
      $('.subPage').hide();
	  $('.toggler').removeClass('exp');
	  $('.faqBody .lSidebar').height($('.faqBody .content').height());
    });

});
