$(document).ready(function() {

	$("#tourney_button").click(function(){
		var cl = $("#tourney_button").attr("class");
		if (cl == 'tourney_button_collapse') {
			$("#tour").hide();
	    	$("#tourney_info").animate({
				width: "0px"
			}, 160 );
	    	$(".tourney_button_collapse").animate({
				left: "-=700"
			}, 160, function() {
				$("#tourney_button").attr("class", "tourney_button_expand");
			});
			$("#text_request").html(textAnnounceTourney);
		} else {
			$("#tour").show();
	    	$("#tourney_info").animate({
				width: "700px"
			}, 160);
	    	$(".tourney_button_expand").animate({
				left: "+=700"
			}, 160, function() {
				$("#tourney_button").attr("class", "tourney_button_collapse");
			});
			$("#text_request").html('<a href="'+ tourneyUrl +'">' + tourneyUrlText + '</a>');
		}
	});	

	$("#btp_button").click(function(){
		var cl = $("#btp_button").attr("class");
		if (cl == 'btp_button_collapse') {
			$("#btp").hide();
	    	$("#btp_info").animate({
				width: "0px"
			}, 160 );
	    	$(".btp_button_collapse").animate({
				left: "-=700"
			}, 160, function() {
				$("#btp_button").attr("class", "btp_button_expand");
			});
			$("#text_winners").html(textAnnounceBtp);
		} else {
			$("#btp").show();
	    	$("#btp_info").animate({
				width: "700px"
			}, 160);
	    	$(".btp_button_expand").animate({
				left: "+=700"
			}, 160, function() {
				$("#btp_button").attr("class", "btp_button_collapse");
			});
			$("#text_winners").html('<a href="'+ btpUrl +'">' + btpUrlText + '</a>');
		}
	});	


	//$('#newsbar').jScrollPane();
	$('#newsbar').jScrollPane({scrollbarWidth: 8});
	
	$(".jspDrag").hover(
		function () {
			$(".jspDragTop").attr("class", "jspDragTop_hover");
			$(".jspDragBottom").attr("class", "jspDragBottom_hover");
		}, 
		function () {
			$(".jspDragTop_hover").attr("class", "jspDragTop");
			$(".jspDragBottom_hover").attr("class", "jspDragBottom");
		}
	);

});
