// JavaScript Document
function startmenu() {
	$('#menu ul').hide();
	$('#menu ul#expanded').show(0);
			for (i=0; i<=11; i++){
				whichone='#top' + i
				$(whichone).addClass('arrow');
			}		
	var showing = $('#menu ul#expanded').parent().children('.arrow');
	showing.removeClass('arrow');
	//alert(showing);
	showing.addClass('arrowdown');		
	$('#menu li a').click(
		function() {
			$('.arrowdown').removeClass('arrowdown');
			for (i=0; i<=11; i++){
				whichone='#top' + i
				$(whichone).addClass('arrow');
			}			
			var checkElement = $(this).next();
			if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				//$('#menu ul:visible').addClass('arrow');
				$('#menu ul:visible').slideUp('fast');
				$(this).removeClass('arrowdown');
				$(this).addClass('arrow');
				//return false;
			}
			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
			
				$('#menu ul:visible').slideUp('fast');
				checkElement.slideDown('fast');
				$(this).removeClass('arrow');
				$(this).addClass('arrowdown');
				return false;
			}
		}
	);

}
$(document).ready(function() {startmenu();});
