<!--
var test	= /[*+#$^\"\']|\bdumpfile\b|\boutfile\b/;
var continuerAnimation	= false;

function affiche_block(id) {
        thisId	= '#'+id;
	$(thisId).css('display', 'block');
}
function affiche_inline(id) {
        thisId	= '#'+id;
	$(thisId).css('display', 'inline');
}
function cache(id) {
        thisId	= '#'+id;
	$(thisId).css('display', 'none');
}
function switch_affichage(id) {
        thisId	= '#'+id;
        if ($(thisId).css('display') == "none")
                $(thisId).show();
        else	$(thisId).hide();
}
function switch_affichage_menu(id) {
        if (document.getElementById(id).style.display == "none") {
                affiche_block(id);
		cache('fleche_droite_'+id);
		affiche_inline('fleche_bas_'+id);
        }
        else if (document.getElementById(id).style.display == "inline" || document.getElementById(id).style.display == "block") {
                cache(id);
		cache('fleche_bas_'+id);
		affiche_inline('fleche_droite_'+id);
        }
}
function openWindow(URL, width, height) {
 	window.open (URL, 'theURL', 'width='+width+', height='+height);
}
function switchImgDroite (vidId, num, random) {
	if (num	== 1)
		nextNum	= 2;
	else	nextNum	= 1;
	
	var thisId	= '#img_'+vidId+'_'+num;
	var nextId	= '#img_'+vidId+'_'+nextNum;
	
	if (random == 0)
		random	= Math.random()*5000 + 4000;
	
	if ($(thisId).css('display') == "none") {
		$(nextId).fadeOut("slow", function() {
			$(thisId).fadeIn("slow");
		});
	}
	else {
		$(thisId).fadeOut("slow", function() {
			$(nextId).fadeIn("slow");
		});
	}
	if (continuerAnimation) {
		window.setTimeout("switchImgDroite('"+vidId+"', "+nextNum+", "+random+")", random);
	}
	
	return true;
}
function displayOthersImgDroite (vidId, num) {
	return window.setTimeout("switchOthersImg("+vidId+", "+num+", 'show', 'img_')", 1500);
}
function hideOthersImgDroite (vidId, num) {
	return window.setTimeout("switchOthersImg("+vidId+", "+num+", 'hide', 'img_')", 1500);
}
function displayOthersImgBig (vidId, num) {
	return window.setTimeout("switchOthersImg("+vidId+", "+num+", 'show', 'bigimg_')", 1500);
}
function hideOthersImgBig (vidId, num) {
	return window.setTimeout("switchOthersImg("+vidId+", "+num+", 'hide', 'bigimg_')", 1500);
}
function switchOthersImg (vidId, num, type, prev_id) {
	if (num	== 1)
		nextNum	= 2;
	else	nextNum	= 1;
	
	var thisId	= '#'+prev_id+vidId+'_'+num;
	var nextId	= '#'+prev_id+vidId+'_'+nextNum;
	
	if (type == 'show') {
		/*if ($(thisId).css('display') == "none") {
			$(nextId).fadeOut("slow", function() {
				$(thisId).fadeIn("slow");
			});
		}*/
		if ($(nextId).css('display') == "none") {
			$(thisId).fadeOut("slow", function() {
				$(nextId).fadeIn("slow");
			});
		}
	}
	else {
		if ($(thisId).css('display') == "none") {
			$(nextId).fadeOut("slow", function() {
				$(thisId).fadeIn("slow");
			});
		}
		for (i=0;i<10000;i++)
			test=1;
		/*else {
			$(thisId).fadeOut("slow", function() {
				$(nextId).fadeIn("slow");
			});
		}*/
	}
	return true;
}
function switchBigImg (vidId, num, random) {
	if (num	== 1)
		nextNum	= 2;
	else	nextNum	= 1;
	
	var thisId	= '#bigimg_'+vidId+'_'+num;
	var nextId	= '#bigimg_'+vidId+'_'+nextNum;
	
	if (random == 0)
		random	= Math.random()*6000 + 8000;
	
	if ($(thisId).css('display') == "none") {
		$(nextId).fadeOut("slow", function() {
			$(thisId).fadeIn("slow");
		});
	}
	else {
		$(thisId).fadeOut("slow", function() {
			$(nextId).fadeIn("slow");
		});
	}
	if (continuerAnimation) {
		window.setTimeout("switchBigImg('"+vidId+"', "+nextNum+", "+random+")", random);
	}
	
	return true;
}
function stopAnimation() {
	continuerAnimation = false;
}
function deleteDialog(url) {
	if (confirm("Souhaitez-vous supprimer cet élément et son contenu définitivement ?"))
		document.location.href = url;
}
function deleteDialogSubmit(formId, inputId, value) {
	if (confirm("Souhaitez-vous supprimer cet élément et son contenu définitivement ?")) {
		document.getElementById(inputId).value = value;
		document.getElementById(formId).submit();
	}
}
function gotoArticle(artId) {
	document.location.href='article.php?art_id='+artId;
}
function loading(id, size) {
	var oFCKeditor1 = new FCKeditor(id);
	oFCKeditor1.BasePath = "/include/fckeditor/";
	oFCKeditor1.ToolbarSet = "wifistop" ;
	oFCKeditor1.Height = size;
	oFCKeditor1.ReplaceTextarea();
}
function recalculeRestant() {
	max	= 166;
	calcul	= max - $('#sms_visu').val().length;
	
	if (calcul < 0) {
		$('#sms_visu').val($('#sms_visu').val().substring(0, 166));
		calcul = max - $('#sms_visu').val().length;
	}
	$('#sms_counter').html(calcul + ' caractères restant');
}
function menuOver(element) {
	thisId	= '#'+element.id;
	$(thisId).attr('class', 'over');
}
function menuOut(element) {
	thisId	= '#'+element.id;
	$(thisId).attr('class', 'nothing');
}
function showEvenement() {
	if ($('#evenements').css('display') == 'none') {
		$("#dynamic div.bloc_blanc").hide();
		if ($.browser.msie) {
			$('#evenements').show();
		}
		else {
			$('#evenements').fadeIn("medium");
		}
	}
}
function showTourisme(id) {
	thisId	= '#tourisme'+id;
	if ($(thisId).css('display') == 'none') {
		$("#dynamic div.bloc_blanc").hide();
		$('#evenements').hide();
		if ($.browser.msie) {
			$(thisId).show();
		}
		else {
			$(thisId).fadeIn("medium");
		}
	}
}
function VerifEmail(email) {
	var verif = /[_\.0-9a-z-]+@([0-9a-z][0-9a-z.-]+\.)+[a-z]{2,4}$/
	if (verif.exec(email) == null) 
		return false;
	else	return true;
}
function GeneratePassword() {

    if (parseInt(navigator.appVersion) <= 3) {
        alert("Sorry this only works in 4.0+ browsers");
        return true;
    }

    var length=8;
    var sPassword = "";

    var noPunction = true;
    var randomLength = false;

    if (randomLength) {
        length = Math.random();

        length = parseInt(length * 100);
        length = (length % 7) + 6
    }


    for (i=0; i < length; i++) {

        numI = getRandomNum();
        if (noPunction) { while (checkPunc(numI)) { numI = getRandomNum(); } }

        sPassword = sPassword + String.fromCharCode(numI);
    }

    return sPassword;
}

function getRandomNum() {

    // between 0 - 1
    var rndNum = Math.random()

    // rndNum from 0 - 1000
    rndNum = parseInt(rndNum * 1000);

    // rndNum from 33 - 127
    rndNum = (rndNum % 94) + 33;

    return rndNum;
}

function checkPunc(num) {

    if ((num >=33) && (num <=47)) { return true; }
    if ((num >=58) && (num <=64)) { return true; }
    if ((num >=91) && (num <=96)) { return true; }
    if ((num >=123) && (num <=126)) { return true; }

    return false;
}

function showConnexionMsg(msg) {
	$('#etat').html(msg);
	oldColor	= $('#etat').css('color');
	$('#etat').css('color', 'red');
	window.setTimeout("$('#etat').css('color', '"+oldColor+"')", 2000);
}
//-->
