// JavaScript Document
$(document).ready(function () {
    //$('#accord1').accordion({ autoheight: false });
	$('#accord1').accordion({header:'cite'});
	
	$('#slideShow2Column').cycle({
		fx: 'fade',
		speed: 500,
		timout: 2000
	});
	
	// Functions for main nav dropdown
	$.fn.delay = function( time, name ) {
		return this.queue( ( name || "fx" ), function() {
			var self = this;
			setTimeout(function() { $.dequeue(self); } , time );
		});
	};
	
	onLoadFunctions = function() {
		$('#sv-mainNav .lvl1').bind("mouseenter",function(){
			$(this).addClass('over');
		}).bind("mouseleave",function(){
			$(this).removeClass('over');
		});
	}
	window.onload=onLoadFunctions;
	
	function checkDropdown() {
		if (!$(this).parent().hasClass('over')) {
			$(this).hide();
		}
	}
	
	// handle dropdown fade in
	$('#sv-mainNav .lvl1').mouseenter(function() {
		$('.dropdown').hide();
		$('.dropdown', this).show(1, checkDropdown);
	});
	$('#sv-mainNav .lvl1').mouseleave(function() {
		$('.dropdown').hide();
	});
	$('.over .dropdown').mouseover(function() {
		$(this).show();
	});
});

