$(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);  
	
/*   	
if ($('.accMenu').length > 0){
	$('.accMenu').find('a:not(ul li li a)').addClass('accordionButton').attr('href', '#').click(function() { return false; });
	$('.accMenu').find('li:not(ul li li)').addClass('parent');
	$('.accMenu').find('.children').addClass('accordionContent');
	$('.accMenu').find('.children').find('a').prepend('&gt; ');
}
	
	//ACCORDION BUTTON ACTION (ON CLICK DO THE FOLLOWING)
	$('.accordionButton').click(function() {

		//REMOVE THE ON CLASS FROM ALL BUTTONS
		$('.accordionButton').removeClass('on');
		  
		//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
	 	//$('.accordionContent').slideUp('fast');
		$('.leftSb').find('.textwidget').slideUp('fast');
   
		//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
		if($(this).next().is(':hidden') == true) {
			
			//ADD THE ON CLASS TO THE BUTTON
			$(this).addClass('on');
			  
			//OPEN THE SLIDE
			$(this).next().slideDown('fast');
		 } 
		  
	 });
	  
	
	/*** REMOVE IF MOUSEOVER IS NOT REQUIRED ***/
if ($('.accMenu').length > 0){
	$('.accMenu').find('a:not(ul li li a)').addClass('accordionButton');
	$('.accMenu').find('li:not(ul li li)').addClass('parent');
	//$('.accMenu').find('.children').addClass('accordionContent');
	$('.accMenu').find('.children').find('a').prepend('&gt; ');
}
	
	//ACCORDION BUTTON ACTION (ON CLICK DO THE FOLLOWING)
	$('.accordionButton').click(function() {

		//REMOVE THE ON CLASS FROM ALL BUTTONS
		$('.accordionButton').removeClass('on');
		  
		//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
	 	//$('.accordionContent').slideUp('fast');
		$('.leftSb').find('.textwidget').slideUp('fast');
   
		//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
		if($(this).next().is(':hidden') == true) {
			
			//ADD THE ON CLASS TO THE BUTTON
			$(this).addClass('on');
			  
			//OPEN THE SLIDE
			$(this).next().slideDown('fast');
		 } 
		  
	 });
	  
	
	//ADDS THE .OVER CLASS FROM THE STYLESHEET ON MOUSEOVER 
	$('.accordionButton').mouseover(function() {
		$(this).addClass('over');
		
	//ON MOUSEOUT REMOVE THE OVER CLASS
	}).mouseout(function() {
		$(this).removeClass('over');										
	});
	
	/*** END REMOVE IF MOUSEOVER IS NOT REQUIRED ***/
	
	
	/********************************************************************************************************************
	CLOSES ALL S ON PAGE LOAD
	********************************************************************************************************************/	
	$('.accordionContent').hide();
	
 	$('#slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});

	
	$('.imgOverlay').hover(function() {
		$(this).find('.desc').slideDown(300);
		
	//ON MOUSEOUT REMOVE THE OVER CLASS
	}, function() {
		$(this).find('.desc').slideUp(300);										
	});

});
