
	/* INDEX */
	
	var news_bar_timer = null;
	var news_bar_action = "next";
	var news_bar_timeout = 5000;
	var news_bar_moving = false;
	
	$(document).ready(function() {
	
		// CREATE PASSWORD INPUT
		replace_password_input("cl_password");
		
		// SMALL TOUT EFFECTS
		$("ul#touts.small li").hover(function() {
			$(this).find("div").stop();
			$(this).find("div").animate({ height: "126px", marginTop: "-50px"}, 300, "easeInBack");												   
		},function() {
			$(this).find("div").stop();
			$(this).find("div").animate({ height: "61px", marginTop: "15px"}, 150);	
		});
		
		// SET UP NEWS BAR FOR CYCLING
		setup_news_bar();
		
		// NEWS BAR ACTIONS
		$("ul#news_bar li a").click(function() {
			clearInterval(news_bar_timer);
			news_bar_timer = null;
			news_bar_action = $(this).attr("title");
			toggle_news_bar(news_bar_action);
			return false;
		});
		
		// STOP NEWS BAR TIMER ON HOVER
		$("ul#news_bar").hover(function() {
			clearInterval(news_bar_timer);
			news_bar_timer = null;
		},function() {
			if(news_bar_timer == null) { news_bar_timer = setInterval("toggle_news_bar('"+news_bar_action+"')",news_bar_timeout); }
		});
		
		// STAY IN TOUCH
		$("input#sit_submit").click(function() {
			var email = $("input#sit_email").val();
			if(email.length > 0 && email != "email address") {
				$.ajax({
					url: "/ajax/stay_in_touch.php",
					data: "email="+email,
					success: function(response) {
						$("div#stay_in_touch div.stay_in_touch_text").html(response);
					}
				});					
			} else {
				$("div#stay_in_touch div.errors").remove();
				var errors = $("<div class=\"errors\">Please enter your email address</div>");
				$("div#stay_in_touch div.right").before(errors);
			}
		});
	
	});
