// MASQUE
function masque () {
	if ($('#masque').css('display') == 'block') {
		$('#masque').fadeOut('fast');
	}
	if ($('#masque').css('display') == 'none') {
		$('#masque').fadeIn('fast');
	}
}

// PREVISUALISATION FORMULAIRE
function form_preview_js () {
	document.getElementById('formulaire').preview.value = 'true';
	document.getElementById('formulaire').submit();
}

// VALIDATION SUPPRESSION
function popup_validation (message, lien) {
	if (confirm(message)) {
		window.location.href = lien;
	}
}

// PANNEAU
panneau_etat = 'off';
function panneau () {
	if (panneau_etat == 'off') {
		$('#menu_compte').addClass('on');
		$('#panneau').show('blind', 250, function () {panneau_etat = 'on';});
	} else if (panneau_etat == 'on') {
		$('#panneau').hide('blind', 250, function () {$('#menu_compte').removeClass('on'); panneau_etat = 'off';});
	}
}
function panneau_champ (champ, langue) {
	if ($(champ).val() == 'Adresse courriel' || $(champ).val() == 'Mot de passe' || $(champ).val() == 'Email' || $(champ).val() == 'Password') {
		$(champ).val('');
	} else
	if ($(champ).val() == '') {
		if (champ == '#panneau_courriel') {
			if (langue == 'fr') {
				$(champ).val('Adresse courriel');
			} else {
				$(champ).val('Email');
			}
		}
		if (champ == '#panneau_pass') {
			if (langue == 'fr') {
				$(champ).val('Mot de passe');
			} else {
				$(champ).val('Password');
			}
		}
	}
}

// CHOIX LANGUE MANUEL
function choix_langue (langue) {
	var date_expire = new Date();
	date_expire.setTime(date_expire.getTime() + (30 * 86400000));
	document.cookie = 'langue = ' + langue + ' ; expires = ' + date_expire;
}

// EDITORIAL
function editorial () {
	$('#editorial_plus').fadeOut(250);
	$('#editorial').slideDown(250);
}

// PLAN
function plan_outils (position) {
	$('#plan #script_position').val(position);
	masque();
	$('#plan #outils').show();
}
function plan_retour () {
	$('#plan #outils').hide();
	masque();
}
function plan_module (module) {
	position = $('#plan #script_position').val();
	$.post('Modules/Plan.php', {action: 'definir', position: position, module: module}, function (retour) {
			$('#feuille').html(retour);
	});
	$('#plan #outils').hide();
	masque();
}
function plan_deplacer (position1, position2) {
	$.post('Modules/Plan.php', {action: 'deplacer', position1: position1, position2: position2}, function (retour) {
			$('#feuille').html(retour);
	});
}
function plan_supprimer (position) {
	$.post('Modules/Plan.php', {action: 'supprimer', position: position}, function (retour) {
			$('#feuille').html(retour);
	});
}
function plan_rosace_etat () {
	
}
