var matchNavigationButtons = 1;


/* don't edit anything below here unless you're very certain of what you're doing */


function triBackHome() {

	pos = $('#navigation ul li a.current').position();
	
	if(pos) {
		$("#triSlideContainer img").stop().animate({marginLeft:(pos.left+(widest/2+10))+"px"}, 1000);
	} else {
		$("#triSlideContainer img").css("display", "none");
	}
	
}

$(window).load(function () {
  	
  	triBackHome();
  	
  	

	$('#drop').click(function(){toggledrop()});
	

	
	pos = $('#navigation ul li a.current').position();
	
	if(!pos) {
		$("#triSlideContainer img").css("display", "none");
	}
	
	


	$('#dropContainer').css('display', 'none');
	$('#dropContainer').css('visibility', 'visible');
   	
	$('#navigation ul li a').bind("mouseenter", function(e){
					
		//we'll move the little yellow triangle to the button over which the mouse
		//is hovering
				
		pos = $(this).position();
								
		$("#triSlideContainer img").stop().animate({marginLeft:(pos.left+(widest/2+10))+"px"}, 1000, "swing");
		
	});
	
	$('#navigation ul li a').bind("mouseleave", function(e){
		
		triBackHome();
			
	});
	
})

function toggledrop() {
	
	$('#dropContainer').toggle('slide', {direction:"up"}, 1000, function(){
				
		if($('#down').css("display") == 'inline') {
		
			$('#down').css("display", "none");
			$('#up').css("display", "inline");
			
			$('#dropContainer').css('zIndex', 100);
		
		} else {
		
			$('#down').css("display", "inline");
			$('#up').css("display", "none");
		
		}
		
	});
}


