$(document).ready(function(){
	var t = setInterval( "slideLeft()", 8000 );

	$(".right").click( function(e) {
		e.preventDefault();
		window.clearInterval(t);
		slideLeft();
		t = setInterval( "slideLeft()", 8000 );
	});

	$(".left").click( function(e) {
		e.preventDefault();
		window.clearInterval(t);
		var img, p;
		$(".image").animate({"left": "+=520px"}, "slow", function() {
			img = $("img:last", this).detach();
			$("img:first", this).before(img);
			$(this).css("left", "-520px");
		});
		$(".text").animate({"left": "+=520px"}, "slow", function() {
			p = $("p:last", this).detach();
			$("p:first", this).before(p);
			$(this).css("left", "-520px");
		});
		t = setInterval( "slideLeft()", 8000 );
	});
	
	$(".events div").hover(
		function() {
			$(".newstitle a", this).addClass("blue");
			$(".detail", this).addClass("blue");
			$(".more", this).removeClass("blue");
		},
		function() {
			$(".newstitle a", this).removeClass("blue");
			$(".detail", this).removeClass("blue");
			$(".more", this).addClass("blue");
		}
	);
	
	$(".concern a").click( function(e) {
		e.preventDefault();
		$(".cshhpbc").slideToggle("slow");
	});
});

function slideLeft() {
	var img, p;
	$(".image").animate({"left": "-=520px"}, "slow", function() {
		img = $("img:first", this).detach();
		$("img:last", this).after(img);
		$(this).css("left", "-520px");
	});
	$(".text").animate({"left": "-=520px"}, "slow", function() {
		p = $("p:first", this).detach();
		$("p:last", this).after(p);
		$(this).css("left", "-520px");
	});
}


