jQuery( document ).ready( function($) {

	// Match content height to sponsors sidebar height?
	if ( ( $("#content").height() + 50 ) < $( "#partners-side" ).height() ) {
		$( "#content" ).height( $( "#partners-side" ).height() + 50 );
	}

	/* Quote rotation */
	setInterval( 'slt_quotescollection_refresh( 0, 0, 0, 0, "", 500 )', 4000 );
	
	/* Navigation */
	if ( !$.browser.msie ) {
		var slidingUp;
		$( '#nav li.dynamic' ).hover (
			function () {
				clearTimeout( slidingUp );
				if ( $(this).children("ul").length ) $(this).children("ul").slideDown( "fast" );
			},
			function () {
				slidingUp = setTimeout( function() {
					$( "#nav .subnav" ).slideUp( "fast" );
				}, 150 );
			}
		);
	}
	
});  

/* Function adapted to exlcude error alert */
function slt_quotescollection_refresh( instance, exclude, show_author, show_source, filter_tags, char_limit ) {
	jQuery("#quotescollection_nextquote-"+instance).html(quotcoll_loading);
	jQuery.ajax({
		type: "POST",
		url: quotcoll_requrl,
		data: "refresh="+instance+"&exclude="+exclude+"&show_author="+show_author+"&show_source="+show_source+"&char_limit="+char_limit+"&tags="+filter_tags,
		success: function(response) {
			jQuery("#quotescollection_randomquote-"+instance).hide();
			jQuery("#quotescollection_randomquote-"+instance).html( response );
			jQuery("#quotescollection_randomquote-"+instance).fadeIn("slow");	
		},
		error: function() {
			//alert("There was an error getting quote.");
			jQuery("#quotescollection_nextquote-"+instance).html(quotcoll_nextquote);
		}	
	});
}

