$(document).ready( function(){

  if( jQuery("#accordion").length != 0 ){
    
  	$('#accordion li h3[rel]').click(function () {
  
  		//slideup or hide all the Submenu
  		$('#accordion li').children('div').slideUp('fast');	
      //
      if( $(this).hasClass('Over') ){
        $(this).removeClass('Over');
        return;
      }
  		//remove all the "Over" class, so that the arrow reset to default
  		$('#accordion li > h3').each(function () {
  			if ($(this).attr('rel')!='') {
  				$(this).removeClass('Over');	
  			}
  		});
  		
  		//show the selected submenu
  		$(this).parent().children('div').slideDown('fast');
  		
  		//add "Over" class, so that the arrow pointing down
  		$(this).addClass('Over');			
  
  	});    
    
  };

})
