$(function() {
	/* set up menus  */
	$('#menu li').hover(function() {   
		$(this).addClass('arrow-hover');
	}, function() {
	   $(this).removeClass('arrow-hover');
	});
		
	/* set up Fancy Box Gallery */
	$(".fancybox").fancybox({ 
		'hideOnContentClick': true,
		'overlayShow': true 
	}); 
	
	/* set up home page flash */
	$('#homepagesplash').cycle({ 
		fx: 'turnLeft'
	});
	
	var test = $("#pagefooter");
	var position = test.offset();
	var newposition = position.top - 318;
	/*alert('test:' + newposition);*/
	$("#footerspacer").css({'height' : newposition, 'overflow' : 'hidden' });
	
	/*about us accordian */
	
	//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked
	$("#accordian .menu_body").hide();
	$("#accordian h3.menu_head").click(function()
	{
    $(this).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
	});
	
	// rel external js
	function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
	var anchor = anchors[i];
	if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
		anchor.target = "_blank";
	}
	}
	window.onload = externalLinks;
	
});
