	$(document).ready(function() {

	// Avoid conflicts with Prototype
	var $j = jQuery.noConflict();

		// Navigation rollovers
		$("#nav a").mouseover(function(){
			imgsrc = $(this).children("img").attr("src");
			if (imgsrc) {
				matches = imgsrc.match(/_over.gif/);
				// don't do the rollover if state is already ON
				if (!matches) {
					imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif"); // strip off .jpg
					$(this).children("img").attr("src", imgsrcON);
				}
			}
		});
		$("#nav a").mouseout(function(){
			imgsrc = $(this).children("img").attr("src");
			if (imgsrc) {
				matches = imgsrc.match(/_over.gif/);
				// only replace the image if the state is ON
				if (matches) {
					imgsrcOFF = imgsrc.replace(/_over.gif$/ig,".gif"); // strip off .jpg
					$(this).children("img").attr("src", imgsrcOFF);
				}
			}
		});

		// rollover for #find_summit
		$("#find_summit img, #home_find_summit img").mouseover(function() {
			$(this).attr("src","/lib/images/find_summit_over.gif");
		});
		$("#find_summit img, #home_find_summit img").mouseout(function() {
			$(this).attr("src","/lib/images/find_summit.gif");
		});

		// get rid of the superfluous bottom border on level three nav
		$(".subnav_level3 li:last").css("border-bottom","none");
		
		$('a').each(function() {
		if ($(this).attr("href")) {
			var matches = $(this).attr("href").match(/^http/i);
				if (matches) {
					$(this).addClass('external');
				}
		}
		});


	// Quote rotator  -----------------------------------------------/

	// how many quote images are available?
	qcount = 5;

	// fade in the first image that already exists on the page
	$j("#header_quote img").fadeIn();

	setInterval(quote_rotate,5000); //time in milliseconds

	// set the initial starting number
	curquote = 2;

	function quote_rotate() {
		if (curquote <= qcount) {
		// fade the image out, then swap the img src and fade it back in
		$j("#header_quote img").fadeOut(function() {
				$j(this).hide();
				newsrc = "/lib/images/quote"+ curquote +".gif";
				$j("#header_quote img").attr("src",newsrc);
				$j("#header_quote img").fadeIn();
				curquote++;
		});
		} else {
			// reset to start loop again
			//curquote = 1;
		}

	}


	});