var name;
$(document).ready(function() {
	$(".noReload").click(function() {
		$("#toRefresh").load($(this).attr("href")+" #toRefresh", {}, function(){
			bindPage();
		});
		var actualMenu = $("#actualMenu").text();
		$("#"+actualMenu).attr("src", "v3/titre_"+actualMenu+".png");
		title = $(this).children("img").attr("alt");
		name = $(this).children("img").attr("id");
		$(this).children("img").attr("src", "v3/titre_"+name+"_on.png");
		$("#actualMenu").text(name);
		document.title = "| Nilda Fernandez | "+title+" |";
		return false;
	});
	bindPage();
});
//------------------------------------------------------------------------
function bindPage(){
	$(".popup").click( function() {
		window.open($(this).attr("href"));
		return false;
	});
	//------------------------------------------------------------------------
	$(".thickbox").click(function(){
		openThickBox($(this).attr("href"));
		if($(this).hasClass("youTube")){
			document.getElementById("audioplayer1").SetVariable("closePlayer", 1);
		}
		return false;
	});
	//------------------------------------------------------------------------
	$(".noReloadNoMenu").click(function() {
		$("#toRefresh").load($(this).attr("href")+" #toRefresh", {}, function(){
			bindPage();
		});
		return false;
	});
	$("#newsletterbutton").click(function() {
		if($("#email").val()!=""){
			$.post($(this).parent().parent().attr("action"), {enr_ok:1, truc:1, email:$("#email").val()}, function(e){
				$("#newsletterForm").html(e);
			});
		}
		bindPage();
		return false;
	});
}
//------------------------------------------------------------------------
function openThickBox(url){
	tb_show('', url, null);
}

function ap_stopAll(num){}
