swfobject.embedSWF("lib/swf/countdown.swf", "countdown", "300", "71", "9.0.0",null, null, {wmode:"transparent"},null);
$(function() {
	genererFeed();
	$("h2,.toggle").click(function() {
		if(!$(this).parent().hasClass("notoggle")) {
			if($(this).parent().hasClass("close")) {
				$(this).parent().removeClass("close")
				$(this).parent().find(".content").slideDown();
				$(this).parent().find("img.toggle").attr("src", "lib/img/close.png");
			} else {
				$(this).parent().addClass("close")
				$(this).parent().find(".content").slideUp();
				$(this).parent().find("img.toggle").attr("src", "lib/img/open.png");
			}
		}
	})
})

function feedRequest() {

	if($("#feed").val() == "http://") {
		alert("Veuillez entrer une adresse valide.");
	} else {
		$.post("submit_feed.php", { feed:$("#feed").val() },
		  function(data){
			$("#feedback").slideDown();
			setTimeout('closeFeedRequest();', 3000)
		  });
	}
}
function closeFeedRequest() {
	$("#form").slideUp("normal", function() {
		$("#feed").val("http://");
		$("#feedback").hide();
	});
}

function genererFeed()
{
	for(var i=1;i<=2;i++)
	{
		//Se rafraichit chaque 5 secondes
		$('ul.colonne-'+i).empty().liveTwitter('#webcamp #qc',{start:(i-1)*5,limit:5, rate: 10000});
	}
}
