/***********************************************************************************************************************
NOTE: Because of a bug in jQuery with IE8 we had to add an IE stylesheet hack to get the system to work in all browsers. I hate hacks but had no choice :(.
************************************************************************************************************************/
$(document).ready(function() {
						   
	 
	//ACCORDION BUTTON ACTION (ON CLICK DO THE FOLLOWING)
	$('.accordionButton').click(function() {

		//REMOVE THE ON CLASS FROM ALL BUTTONS
		$('.accordionButton').removeClass('accordionButtonSelected');
		
		
				  
		//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
	 	$('.accordionContent').slideUp('normal');
   
		//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('accordionButtonSelected');
			$(this).removeClass('over');
			$('.accordionBtn').show();
			$(this).children('.accordionBtn').hide();
			$('.accordionSocial').hide();
			$(this).children('.accordionSocial').show();
			//OPEN THE SLIDE
			$(this).next().slideDown('normal');
					
		 } else {
			
			$(this).children('.accordionSocial').hide();
					
		 } 
		  
	 });
	  
	
	/*** REMOVE IF MOUSEOVER IS NOT REQUIRED ***/
	
	//ADDS THE .OVER CLASS FROM THE STYLESHEET ON MOUSEOVER 

	
	$('.accordionButton').mouseover(function() {
		if($(this).next().is(':hidden') == true) {									 
	$(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();
	$('.accordionSocial').hide();
	
	$('#job1').trigger('click');

});

