$(function() {
	
	
	/* Agrandissement des textareas */
	$("textarea").growfield();
	
	
	/* Afficahge des textes tronqués */
	$("a").filter("[@id^=ShowText]").click(function() {
		var LinkId = $(this).attr("id");
		Id = LinkId.replace("ShowText", "");

		$("div#TexteCoupe"+Id).hide(function() {
			$("div#TexteOriginal"+Id).show("slow");
		});
	});
	
	$("a").filter("[@id^=HideText]").click(function() {
		var LinkId = "div."+$(this).attr("id");
		Id = LinkId.replace("div.HideText", "");
		
		$("div#TexteOriginal"+Id).hide(function() {
			$("div#TexteCoupe"+Id).show("slow");			
		});
	});
	
});

$.fn.check = function(mode) {
        var mode = mode || 'on'; // si mode non défini, défaut: 'on'
        return this.each(function() {
                switch(mode) {
					case 'on':
						this.checked = true;
						break;
					case 'off':
						this.checked = false;
						break;
					case 'toggle':
						this.checked = !this.checked;
						break;
				}
        });
};




function cacher_album(intCptTexteCoupe)
{
	document.getElementById('HideText'+intCptTexteCoupe).style.display = "none";
	document.getElementById('ShowText'+intCptTexteCoupe).style.display = "block";
	return false;
}

function afficher_album(intCptTexteCoupe)
{
	document.getElementById('HideText'+intCptTexteCoupe).style.display = "block";
	document.getElementById('ShowText'+intCptTexteCoupe).style.display = "none";
	return false;
}

/*
function OuvrirExplicationsAllradio() {
	$('div#TexteOriginal'+Id).show('slow');
	$('div#TexteOriginal'+Id).addClass('Open');
	$('p#OuvrirExplicationAllradio').html('- Fermer les explications');
};

function FermerExplicationsAllradio() {
	$('div#TexteCoupe'+Id).hide('slow');
	$('div#Allradio').removeClass('Open');
	$('p#OuvrirExplicationAll
	  radio').html('+ Explications détaillées');
};*/