<!--
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) {
 	pop=window.open(URL, 'theURL', 'width='+width+', height='+height+', resizable=yes, scrollbars=yes');
}
function popupPage(URL) {
 	openWindow(URL, 1022, 500);
}
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 loading(id, size) {
	/*var oFCKeditor1 = new FCKeditor(id);
	oFCKeditor1.BasePath = "/include/fckeditor/";
	oFCKeditor1.ToolbarSet = "wifistop" ;
	oFCKeditor1.Height = size;
	oFCKeditor1.ReplaceTextarea();*/
	CKEDITOR.replace(id,
	{
		toolbar : [
		    [ 'Source', '-', 'Bold', 'Italic', 'Underline', '-', 'Link','Unlink', '-', 'Image','Flash' ]
		],
		width : 400,
		resize_maxWidth : 400,
		height : size,
		language : 'fr',
		filebrowserBrowseUrl : '../include/ckfinder/ckfinder.html',
		filebrowserImageBrowseUrl : '../include/ckfinder/ckfinder.html?Type=Images',
		filebrowserFlashBrowseUrl : '../include/ckfinder/ckfinder.html?Type=Flash',
		filebrowserUploadUrl : '../include/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
		filebrowserImageUploadUrl : '../include/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
		filebrowserFlashUploadUrl : '../include/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
	});
}
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 recalculeCaracteres(id, max) {
	thisId	= '#'+id;
	counterId	= '#'+id+'_counter';
	calcul	= $(thisId).val().length;
	
	$(counterId).html(calcul + ' caractères');
}
function menuOver(element) {
	thisId	= '#'+element.id;
	$(thisId).attr('class', 'over');
}
function menuOut(element) {
	thisId	= '#'+element.id;
	$(thisId).attr('class', 'nothing');
}
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 VerifNumeric(value) {
  var verif = /([0-9]+)$/
  if (verif.exec(value) == null) 
	return false;
  else 
	return true;
}
function VerifCPfr(value) {
  var verif = /^[0-9]{5}$/
  if (verif.exec(value) == null) 
	return false;
  else 
	return true;
}
function VerifTelfr(value) {
  var verif = /^[0-9]{10}$/
  if (verif.exec(value) == null) 
	return false;
  else 
	return true;
}
function VerifTVA(value) {
  var verif = /^[a-zA-Z]{2}[0-9]{11}$/
  if (verif.exec(value) == 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);
}
// recup from adherent
function chargement_Form(form) {
	var lesInput = document.getElementsByTagName("input");
	//alert(lesInput.length);
	for(i=0;i<lesInput.length;i++) {
		lesInput[i].className = "";
	}
	var lesInput = document.getElementsByTagName("textarea");
	//alert(lesInput.length);
	for(i=0;i<lesInput.length;i++) {
		lesInput[i].className = "";
	}
}

function champFocus(id) {
	chargement_Form($(id).form);
	$(id).className = "focus";
} 
function voirFAQ(num) {
	showId	= '#faq'+num;
	var mustwait	= false;
	
	$('#faq p[id^="faq"]').each(function() {
		if (!$(this).hasClass('dnone')) {
			$(this).hide('slide', {direction: 'up'}, 200, function() {
				$(this).addClass('dnone');
				
				if ($(showId).hasClass('dnone')) {
					$(showId).show('slide', {direction: 'up'}, 400, function() {
						$(this).removeClass('dnone');
					});
				}
			});
			mustwait = true;
		}
	});
	
	if (!mustwait && $(showId).hasClass('dnone')) {
		$(showId).show('slide', {direction: 'up'}, 400, function() {
			$(this).removeClass('dnone');
		});
	}
}
//-->
