$(document).ready( function(){ 
/*---------------------------------------------------------------------------------------
   ACCORDION
---------------------------------------------------------------------------------------*/
/* Set Default State */
	$('.accordion').addClass('activated');
	$('.accordion .detail_section').hide().prev('.border_shadow').show();
	$('.accordion .heading').css({'cursor':'pointer'});
	$('.accordion .heading:first').addClass('active');
	$('.accordion .detail_section:first').show().prev('.border_shadow').hide();
/* Functionality */
	$('.accordion .heading').click (function(){
		if ($(this).hasClass('active')){
			$('.detail_section').slideUp('fast').prev('.border_shadow:hidden').show();
			$(this).removeClass('active');
		} else {
			$('.accordion .heading').removeClass('active');
			$('.detail_section').slideUp('fast').prev('.border_shadow:hidden').show();		
			$(this).addClass('active').next('.border_shadow').hide().next('.detail_section').slideDown('fast');
		}
	});

/*---------------------------------------------------------------------------------------
   MAINNAV
---------------------------------------------------------------------------------------*/
	$("#menu ul").supersubs({ 
 	    minWidth: 0, 
 	    maxWidth: 18, 
 	    extraWidth: 0 
     })
     .superfish({ 
	     delay: 850,
	     speed: 'fast',
	     autoArrows: true,
	     animation: {height:'show'},
	     dropShadows: false
     }); 

	$("#menuRight ul").supersubs({ 
 	    minWidth: 0, 
 	    maxWidth: 18, 
 	    extraWidth: 0 
     })
     .superfish({ 
	     delay: 850,
	     speed: 'fast',
	     autoArrows: true,
	     animation: {height:'show'},
	     dropShadows: false 
     }); 

	$('a.nolink').click(function(e){e.preventDefault();});

/*---------------------------------------------------------------------------------------
   Form Labels
---------------------------------------------------------------------------------------*/
	$("div.search_box input, div.form_section input, div.form_section textarea, div.newsletter input, div.newslettersub .input").labelify();

/*---------------------------------------------------------------------------------------
   WHEEL
---------------------------------------------------------------------------------------*/
	$('ul#graph li div').prepend('<a class="close">X</a>')
	$('ul#graph li a.close').click(function(){
		$(this).parent('div').fadeOut();
		$('.graph_banner ul').attr('class', '');
	});
	$('ul#graph li span').click(function(){
		$('ul#graph').attr('class','');
		$('ul#graph div:visible').fadeOut();								 
		var item = $(this).parents().attr('class');
		$(this).parents('ul').addClass(item);
		$(this).next('div').fadeIn('fast');
	});

/*---------------------------------------------------------------------------------------
   Careers
---------------------------------------------------------------------------------------*/

$('.expandcontent p').expander({
	slicePoint: "220",
	expandEffect: "show",
    beforeExpand: function($thisElement) {
      $thisElement.parent().find('.form_section').fadeIn();
    },
    onCollapse: function($thisElement) {
        $thisElement.parent().find('.form_section').hide();
      }
  });




});
