<!--
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).hide();
}
function affiche(id) {
        thisId	= '#'+id;
	$(thisId).show();
}
function switchAffichage(id) {
        thisId	= '#'+id;
        $(thisId).toggle();
}
function switch_affichage(id) {
        switchAffichage(id);
}
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, msg) {
	message	= "Would definitly delete this element ?";
	if (msg != '' && typeof msg != 'undefined') {
		message = message + "\n" + msg;
	}
	if (confirm(message)) {
		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 = "ecolodge" ;
	oFCKeditor1.Height = size;
	oFCKeditor1.ReplaceTextarea();
}
function loading2(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', '-',
		    'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock', '-',
		    'Link','Unlink', '-',
		    'Image','Flash' ]
		],
		width : 500,
		resize_minWidth : 500,
		resize_maxWidth : 650,
		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 menuOver(element) {
	thisId	= '#'+element.id;
	$(thisId).attr('class', 'over');
}
function menuOut(element) {
	thisId	= '#'+element.id;
	$(thisId).attr('class', 'nothing');
}
function hideNiveauxTrois() {
	$('table.i2').hide();
	$('table.i3').hide();
	$('table.t2').hide();
	$('table.t3').hide();
	$('table.i2_big').hide();
	$('table.i3_big').hide();
	$('table.t2_big').hide();
	$('table.t3_big').hide();
	$('div.sub_rub_niv_2').hide();
	$('div#overflow').hide();
	$("a.rub_active").attr('class', 'rub2');
}
function showNiveau3(rubId) {
	if ($('#sub_rub_'+rubId).css('display') == 'none') {
		hideNiveauxTrois();
		$('a.i1_over').attr('class', 'i1');
		$('a.t1_over').attr('class', 't1');
		$("li#rub_"+rubId+" a.rub2").attr('class', 'rub_active');
		affiche('sub_rub_'+rubId);
		$('div#overflow').show();
	}
}
function LoginSubmit() {
	oldHtml	= $('#login_submit').html();
	$('#echec').hide()
	brlogin		= $('#br_login').val();
	brpasswd	= $('#br_passwd').val();
	brlang		= $('#pro_lang').val();
	$('#login_submit').html('<img src="../images/ajax-loader.gif" alt="" />');
	$.ajax({
		type: "POST",
		url: "../pro/log_perform.php",
		data: "connect=1&login="+brlogin+'&passwd='+brpasswd,
		success: function(msg){
			if (msg == 1) {
				document.location.href	= '/pro/home.php?lang='+brlang;
			}
			else {
				window.setTimeout("$('#echec').show()", 2000);
				window.setTimeout("$('#login_submit').html(oldHtml)", 2000);
			}
		}
	});
	
	return false;
}
function showForgot() {
	if ($('#content_forgot').css('display') == 'none') {
		$('#content_login').hide('slide', {direction: "up"}, 1000, function() {
			$('#content_forgot').show('slide', {direction: "up"}, 1000);
		});
	}
}
function ForgotSubmit() {
	oldHtml	= $('#forgot_submit').html();
	$('#success_forgot').hide();
	$('#echec_forgot').hide();
	bremail		= $('#br_forgot_email').val();
	brlang		= $('#pro_lang').val();
	$('#forgot_submit').html('<img src="../images/ajax-loader.gif" alt="" />');
	$.ajax({
		type: "POST",
		url: "../pro/forgot_perform.php",
		data: "forgot=1&email="+bremail,
		success: function(msg){
			if (msg == 1) {
				window.setTimeout("$('#success_forgot').show()", 2000);
				window.setTimeout("$('#forgot_submit').html(oldHtml)", 2000);
			}
			else {
				window.setTimeout("$('#echec_forgot').show()", 2000);
				window.setTimeout("$('#forgot_submit').html(oldHtml)", 2000);
			}
		}
	});
	
	return false;
}
function rubLeftTexteOver(id, cssBorder, type) {
	thisId	= '#texte_'+id;
	
	// fleche
	element = $(thisId).prev('a');
	image	= element.children('img.arrow');
	image.attr('class', 'arrow');
	// savoir plus
	image	= element.children('div.savoir_plus');
	image.attr('class', 'savoir_plus');

	// texte
	$('#save_left_texte').html($('#rub_left_text').html());
	$('#rub_left_text').html($(thisId).html());
	$('#rub_left_text').attr('class', 'rub_desc_'+type+' '+cssBorder+'_'+type);
}
function rubLeftTexteOut(id, type) {
	thisId	= '#texte_'+id;
	
	// fleche
	element = $(thisId).prev('a');
	image	= element.children('img.arrow');
	image.attr('class', 'vhidden arrow');
	// savoir plus
	image	= element.children('div.savoir_plus');
	image.attr('class', 'vhidden savoir_plus');

	// texte
	$('#rub_left_text').html($('#save_left_texte').html());
	$('#rub_left_text').attr('class', 'rub_desc_'+type+' topborder_'+type);
}
function rubLeftTexteOver2(id, cssBorder, type) {
	thisId	= '#texte_'+id;
	
	// fleche
	element = $(thisId).prev('a');
	image	= element.children('img.arrow');
	image.attr('class', 'arrow');
	// savoir plus
	image	= element.children('div.savoir_plus');
	image.attr('class', 'savoir_plus');
}
function rubLeftTexteOut2(id, type) {
	thisId	= '#texte_'+id;
	
	// fleche
	element = $(thisId).prev('a');
	image	= element.children('img.arrow');
	image.attr('class', 'vhidden arrow');
	// savoir plus
	image	= element.children('div.savoir_plus');
	image.attr('class', 'vhidden savoir_plus');
}
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 valideContact() {
	if ($('#contact_nom').val() == "") {
		oldbackground	= $('#contact_nom').css('background');
		oldcolor	= $('#contact_nom').css('color');
		$('#contact_nom').css('background', 'red');
		$('#contact_nom').css('color', 'white');
		window.setTimeout("$('#contact_nom').css('background', '"+oldbackground+"')", 1600);
		window.setTimeout("$('#contact_nom').css('color', '"+oldcolor+"')", 1600);
		$('#contact_nom').focus();
		
		return false;
	}
	if ($('#contact_tel').val() == "") {
		oldbackground	= $('#contact_tel').css('background');
		oldcolor	= $('#contact_tel').css('color');
		$('#contact_tel').css('background', 'red');
		$('#contact_tel').css('color', 'white');
		window.setTimeout("$('#contact_tel').css('background', '"+oldbackground+"')", 1600);
		window.setTimeout("$('#contact_tel').css('color', '"+oldcolor+"')", 1600);
		$('#contact_tel').focus();
		
		return false;
	}
	if ($('#contact_email').val() == "" || VerifEmail($('#contact_email').val()) == false) {
		oldbackground	= $('#contact_email').css('background');
		oldcolor	= $('#contact_email').css('color');
		$('#contact_email').css('background', 'red');
		$('#contact_email').css('color', 'white');
		window.setTimeout("$('#contact_email').css('background', '"+oldbackground+"')", 1600);
		window.setTimeout("$('#contact_email').css('color', '"+oldcolor+"')", 1600);
		$('#contact_email').focus();
		
		return false;
	}
	if ($('#contact_commentaire').val() == "") {
		oldbackground	= $('#contact_commentaire').css('background');
		oldcolor	= $('#contact_commentaire').css('color');
		$('#contact_commentaire').css('background', 'red');
		$('#contact_commentaire').css('color', 'white');
		window.setTimeout("$('#contact_commentaire').css('background', '"+oldbackground+"')", 1600);
		window.setTimeout("$('#contact_commentaire').css('color', '"+oldcolor+"')", 1600);
		$('#contact_commentaire').focus();
		
		return false;
	}
	if ($('#code').val() == "") {
		oldbackground	= $('#code').css('background');
		oldcolor	= $('#code').css('color');
		$('#code').css('background', 'red');
		$('#code').css('color', 'white');
		window.setTimeout("$('#code').css('background', '"+oldbackground+"')", 1600);
		window.setTimeout("$('#code').css('color', '"+oldcolor+"')", 1600);
		$('#code').focus();
		
		return false;
	}
}
function hidePageIntro() {
	$('#page_intro').fadeOut('medium', function() {
		$('#pag_content').fadeIn('medium');
	});
}
/**
* Item html creation helper.
*/
function mycarousel_getItemHTML(item) {
	if (typeof item != "null")
		return item.html;
	else	return '';
}

function mycarousel_initCallback(carousel) {
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
}
function openChannel(url) {
   var ns4=document.layers;
   var ie4=document.all;
   var ns6=document.getElementById&&!document.all;
   var xMax, yMax, xOffset, yOffset;

    if (ie4) {
		window.open(url,"","fullscreen=yes,location=yes");
    } else if (ns6 || ns4) {
		window.open(url,"","fullscreen=yes,toolbar=yes,location=yes");
    } else {
		window.open(url,"","fullscreen=yes,location=yes");
    }
}
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;
}
//-->
