$(document).ready(function(){
	$(".subNav").fadeTo(1, 0.8);
	key_=$("#key").val();
	events_home=0;
	events_home_max=3;
	$("#Mainnav #nav a").mouseover(function(e){
		$(".subNav").hide();
		$("#"+$(this).attr("name")).show();		
	});
	
	$("#banner,#banner_home,.clubSnapTop,#logo,#phone,#wel").mouseover(function(e){
		$(".subNav").hide();
		$(".tab_wrap").hide(); 
	});
		
	$("#key").focus(function(e){
		if ($(this).val()==key_){$(this).val("");}
	});
	
	$(".events_home .up").click(function(e){
		if (events_home>0){
			events_home--;
			//alert($(".events_home .text:eq(" + events_home + ")").html());
			//$(".events_home ul").animate({left:'-=190'},1500);
			$(".events_home li:eq(" + events_home + ")").animate({ opacity: 'toggle'}, { duration: 500 });			

		}
	});
	$(".events_home .down").click(function(e){
		if (events_home<events_home_max){
			//alert($(".events_home .text:eq(" + events_home + ")").html());
			//$(".events_home ul").animate({left:'+=190'},1500);
			$(".events_home li:eq(" + events_home + ")").animate({ opacity:'toggle'}, { duration: 500 });			
			events_home++;
		}
	});
	
	$("#tab").click(function(e){
		$(".tab_wrap").slideToggle("fast"); 
	});
	//$("#banner,#banner_home,.clubSnapTop,#logo,#phone,#wel").mouseover(function(e){
		//$(".tab_wrap").hide(); 
	//});
	
		

		/*
		temp = 1;
		setInterval(function(){
				temp++;
                if (temp == 4) {temp=5;}
				if (temp > 6) {temp=1;}
				//alert(temp);
				flashbanner(temp);
		 },5000); 
		  */
});

function flashbanner(x){
		$.ajax({
		  url: "flashbanner"+x+".html",
		  cache: false,
		  success: function(html){
			$("#flash_wrap").html(html);
			$("#flash_banner_btn a").removeClass("sed");
            if(x==5) --x;
			$("#flash_banner_btn a:eq("+ --x +")").addClass("sed"); 
            if(x==3) ++x;
			temp = ++x;
					  }
		}); 
}