/* jQuery specific functions ------------------------------- */

	// Avoid conflicts with Prototype
	var $j = jQuery.noConflict();

	// Awards 101 opener/closer
	curaward = '';
	$j(document).ready(function(){
		$j("#leftcol a").click(function() {
			awardid = $j(this).parent().attr('id');

			if (curaward != '') {
			$j("#"+curaward+"_text").slideUp();
			}
			if (awardid != curaward) {
			$j("#"+awardid+"_text").slideDown();
			curaward = awardid;
			} else {
			curaward = '';
			}

		});

	$j(".close").click(function() {
		if (curaward != '') {
			$j("#"+curaward+"_text").slideUp();
			}
		});

	//$j.getScript('/js/pause.js');

	// Quote rotator for Awards page ------------------------/

	// how many quote images are available?
	qcount = 7;

	// fade in the first image that already exists on the page
	$j("#quote").fadeIn();

	setInterval(quote_rotate,10000); //time in milliseconds

	// set the initial starting number - actually should be the first one you want to refresh too - the starting quote is set in awards.php
	curquote = 7;

	function quote_rotate() {
		if (curquote <= qcount) {
		// fade the image out, then swap the img src and fade it back in
		$j("#quote").fadeOut(function() {
				$j(this).hide();
				newsrc = "/images/awards/quotes/quote"+ curquote +".gif";
				$j("#quote").attr("src",newsrc);
				$j("#quote").fadeIn();
				curquote++;
		});
		} else {
			// reset to start loop again
			curquote = 1;
		}

	}

});
