// JavaScript (JQuery) Document

$("document").ready(function(){

	$('marquee').marquee();
		
// Submit a form when btn_submit clicked
	$(".btn_submit").click(function(event){
		event.preventDefault();	
		$(this).parents("form").submit();
	});
	
// Show Specific Dropdown || ID Assigned to <li> || Class assigned to dropdown <div>

        $("div#navigation a.tab").hover(function(){
		$("div.dropdown").hide();
		var id = $(this).attr("id");
		$("div.dropdown." + id).show();
	});

	$("div.dropdown").hover(function(){

	},function() {
		$(this).hide();
	});
	
// Hide all dropdowns when mouse leaves navigation area	
	
        //$("#partners_content p:last")
	//scrollPartners();

	$("img#history_img").hide();
	$("p#history_blurb").html(historyslides[curhslide][0]);
	$("a#history_link").attr("href", historyslides[curhslide][1]);
	$("#sponsors img").load(function(){
	  $("img#history_img").fadeIn(500);
	}).attr("src", historyslides[curhslide][2]);

	if (maxhslide != 0) {
	  setInterval("next_hslide()", 6500);
	}
	

});

	historyslides = Array();
	historyslides[0] = Array("Find out how it all began in our history page.","index.php?page=history", "images/index/history.jpg");
	historyslides[1] = Array("Remember the legend. Read through the tribute to Robert Holden.","index.php?page=robholden", "images/index/robholdentribute.jpg");
	historyslides[2] = Array("See how far we've come. Check out the Cemetery Circuit Top 20","index.php?page=top20", "images/index/top20.jpg");
	var curhslide = 0;
	var maxhslide = 2;
		
	function next_hslide() {

		 if (curhslide < maxhslide) {
		  curhslide++;
		 }
		 else {
		  curhslide = 0;
		 }

		 $("img#history_img").hide();
		 $("p#history_blurb").html(historyslides[curhslide][0]);
		 $("a#history_link").attr("href", historyslides[curhslide][1]);
		 $("img#history_img").load(function(){
		  $(this).fadeIn(500);
		 }).attr("src", historyslides[curhslide][2]);
	}


