// JavaScript Document

$(document).ready(function () {
		
		$('#accordion li').click(function () {

			//slideup or hide all the Submenu
			$('#accordion li').children('ul').slideUp('fast');	
			
			
			//remove all the "Over" class, so that the arrow reset to default
			$('#accordion li > a').each(function () {
				if ($(this).attr('rel')!='') {
					$(this).removeClass($(this).attr('rel') + 'Over');	
				}
			});
			
			//show the selected submenu
			$(this).children('ul').slideDown('fast');
			
			//add "Over" class, so that the arrow pointing down
			$(this).children('a').addClass($(this).children('li a').attr('rel') + 'Over');			
			/*var $target = $(event.target);
			 if ( $target.is('ul li a') ) {
			 return true;
			 }else{
			 return false;
			 };*/
			 
		});
	
	});
