$j(document).ready(function() {
	
	// Home Slides
	
	var splashID = "home_slide2";
		
	var timer = setInterval(nextSplash, 5000);
	
	function nextSplash() {
		
		  
			
		  $j(".ui_splash_content").hide();
		  $j("#" + splashID + "_content").show();
		  $j(".ui_splash").removeClass("ui_splash_active");
		  $j("#" + splashID).addClass("ui_splash_active");
		  
		  if(splashID == "home_slide1") {
		  	splashID = "home_slide2";
		  } else if(splashID == "home_slide2") {
		  	splashID = "home_slide3";
		  } else if(splashID == "home_slide3") {
		  	splashID = "home_slide1";
		  }
		  
		  clearInterval(timer);
		  
		  timer = setInterval(nextSplash, 5000);
		  
	}
	
	
	$j(".ui_splash").click(function() {
		splashID = $j(this).attr("id");
		nextSplash();
	});
	
	$j('#home').cycle({ 
		fx:    'fade', 
		speed:  3000 
	 });
	
	// Club Pato
	
	$j("#club_pato_one button").click(function() {
		$j(".club_pato").removeClass("club_pato_active");
		$j("#club_pato_two").addClass("club_pato_active");
	});
	
	$j("#club_pato_two button").click(function() {
		$j(".club_pato").removeClass("club_pato_active");
		$j("#club_pato_three").addClass("club_pato_active");
	});
	
	$j(".club_pato_terms").click(function() {
		patoStep = $j(this).parents(".club_pato").attr("id");
		$j(".club_pato").removeClass("club_pato_active");
		$j("#club_pato_four").addClass("club_pato_active");
	});
	
	$j("#club_pato_four button").click(function() {
		$j(".club_pato").removeClass("club_pato_active");
		$j("#" + patoStep).addClass("club_pato_active");
	});
	
	$j("#club_pato_one img").click(function() {
		$j(".club_pato").removeClass("club_pato_active");
		$j("#club_pato_five").addClass("club_pato_active");
	});
	
	$j("#club_pato .club_pato_faq").click(function() {
		patoStep = $j(this).parents(".club_pato").attr("id");
		$j(".club_pato").removeClass("club_pato_active");
		$j("#club_pato_five").addClass("club_pato_active");
	});
	
	$j("#club_pato_five button").click(function() {
		$j(".club_pato").removeClass("club_pato_active");
		$j("#" + patoStep).addClass("club_pato_active");
	});
	
	// About Toggle
	
	aboutUs = 0;
							
	$j("#about_content a").click(function() {
		
		if(aboutUs == 0) {
	
			$j("#about_us").css("background","url('images/bg_about_us_video.jpg') no-repeat top left");
			aboutUs = 1;
		
		} else {
			
			$j("#about_us").css("background","url('images/bg_about_us.jpg') no-repeat top left");
			aboutUs = 0;
			
		}
		
	});
	
	// Form Counters
	
	$j('.headline_text').jqEasyCounter({
		'maxChars': 75,
		'maxCharsWarning': 70,
		'msgFontSize': '11px',
		'msgFontColor': '#000000',
		'msgFontFamily': 'Arial',
		'msgTextAlign': 'left',
		'msgWarningColor': '#F00',
		'msgAppendMethod': 'insertBefore'              
	});
	
	$j('.headline_text_small').jqEasyCounter({
		'maxChars': 40,
		'maxCharsWarning': 35,
		'msgFontSize': '11px',
		'msgFontColor': '#000000',
		'msgFontFamily': 'Arial',
		'msgTextAlign': 'left',
		'msgWarningColor': '#F00',
		'msgAppendMethod': 'insertBefore'              
	});
	
});
