function afficher_image(img,copyright) {
	NewWindow("/afficher_image.php?id=" + img + "&cp=" + copyright, "", 450, 520, 0, "center");
	
}

function affichefestival(img,copyright) {
	NewWindow("/afficher_image.php?id=" + img + "&cp=" + copyright, "", 500, 700, 0, "center");
}

function FenetreVideo(url) {
	NewWindow(url, "fenetrevideo", 400, 400, 0, "center");
}

function PopVideo(cmedia,langue) {
	NewWindow("popvideo.php?cmedia=" + cmedia + "&mycodelanguedico=" + langue, "video", 600, 250, 0, "center");
}

function FenetrePopUp(url) {
	NewWindow(url, "fenetre", 550, 500, 1, "center");
}

function FenetreVideoLive(url) {
	NewWindow(url, "fenetrelive", 300, 120, 0, "center");
}

function popup(page, name, largeur, hauteur, options) {
	window.open(page, name, 'width=' + largeur + ',height=' + hauteur + ',resizable=yes,alwaysraised=yes,toolbar=no,locationbar=no,titlebar=no,menubar=no,statusbar=no,scrollbars=yes');
}

function check_rech(langue) {
	lg1 = document.recherche.rech.value.length;
	if (lg1 > 2) {
		return true;
	} else { 
		if (langue == 6002) {
		alert("Please enter 3 characters at least.");
	} else {
		alert("Veuillez saisir au moins 3 caractères");
		}
		return false; }
}

function ColOn(imgName,coul, racine) {
        if (document.images) { 
            document[imgName].src = racine + "/img/" + coul + "/rollfleche.gif";
		}
}

function ColOff(imgName, racine) {
        if (document.images) {
            document[imgName].src = racine + "/img/vide.gif";}}


function Col_On(imgName,coul, racine) {
	if (document.images) { 
		document[imgName].src = racine + "/" + coul + "/rollfleche.gif";
	}
}

function Col_Off(imgName, racine) {
	if (document.images) {
		document[imgName].src = racine + "/vide.gif";
	}
}

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos) {
	if(pos == "random") {
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}

	if(pos == "center") {
		LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
	} else if ((pos != "center" && pos != "random") || pos==null) {
		LeftPosition=0;
		TopPosition=20;
	}
	settings = 'width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
	win = window.open (mypage,myname,settings);
} 



function affiche_popup(lg){
	window.open ("/popup.php?langue=" + lg,'mapopup','width=500,height=500') ;
}

function affiche_popupCharte(lg){
	window.open ("/pratique/charte.php?langue=" + lg,'mapopup','width=850,height=600,menubar=yes,scrollbars=yes,toolbar=yes') ;
}

function popupWindow(url, height, width){
	oWindow = window.open( url, 'popup' + height + '_' + width, 'width=' + width + ',height=' + height + ',scrollbars=no,screenX=400,screenY=400' );
}

function popupWindow2(url, height, width){
	oWindow = window.open( url, 'popup2' + height + '_' + width, 'width=' + width + ',height=' + height + ',scrollbars=no' );
}

function popupWindow3(url, height, width){
	oWindow = window.open( url, 'popup' + height + '_' + width, 'width=' + width + ',height=' + height + ',scrollbars=yes,screenX=100,screenY=100' );
}


//-----------------------------------------
// DETECTION NAVIGATEUR ET PLATEFORME
//-----------------------------------------
var temp;

var n = navigator;
var ua = ' ' + n.userAgent.toLowerCase();
var pl = n.platform.toLowerCase(); // not supported in NS3.0
var an = n.appName.toLowerCase();

// browser version
var version = n.appVersion;

var is_nn = ua.indexOf('mozilla') > 0;
var is_nn6 = ua.indexOf('netscape6') > 0;

// 'compatible' versions of "mozilla" aren't navigator
if(ua.indexOf('compatible') > 0) {
	is_nn = false;
}
var is_ie = ua.indexOf('msie') > 0;
//platforms
var is_mac = ua.indexOf('mac') > 0;
var is_win = ua.indexOf('win') > 0;

// - IE5/Mac reports itself as version 4.0

if(is_ie && is_mac) {
	if(ua.indexOf("msie 5")) {
		is_major = 5;
		var actual_index = ua.indexOf("msie 5");
		var actual_major = ua.substring(actual_index + 5, actual_index + 8);
		is_minor = parseFloat(actual_major);
	}
}


function add_boutons(i, nom, tag, chemin, burl, largeur, ssmenu, bouton_on) {
	boutons[i] = new Array(7);
	boutons[i][0] = nom;
	boutons[i][1] = tag;
	boutons[i][2] = chemin;
	boutons[i][3] = burl;
	boutons[i][4] = largeur;
	boutons[i][5] = new Array(ssmenu.length); 
	for(j = 0; j < ssmenu.length; j++) {
		boutons[i][5][j] = ssmenu[j];
	}		
	boutons[i][6] = bouton_on;
}


/* *** browser and os detection from http://developer.netscape.com/docs/examples/javascript/browser_type.html*/
    var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav5 = (is_nav && (is_major == 5));
    var is_nav5up = (is_nav && (is_major >= 5));
    var is_moz7 = (agt.indexOf('0.7')!=-1)
    var is_ie   = (agt.indexOf("msie") != -1);
    var is_ie3  = (is_ie && (is_major < 4));
    var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
    var is_ie4up  = (is_ie  && (is_major >= 4));
    var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);
    var is_opera = (agt.indexOf("opera") != -1);
    var is_opera5 = (is_opera && (is_major != 3) && (agt.indexOf("5.01") != -1));
    var is_webtv = (agt.indexOf("webtv") != -1);
    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    var is_mac    = (agt.indexOf("mac")!=-1);
//**********************************************************


// define browser type, platform and color depth variables 

// if client settings are not specific, treat as old browser (no script) on windows at 256 color
var bType = "old";
var os = "win";
var cd = "lo";

// if true look for colorDepth property (ie); if false look for pixelDepth property (ns);
var usec = true;	

// browser
if (is_ie3 == true) { bType = "ie3"; usec = true; }
if ((is_ie4up == true || is_ie5up == true || is_ie5 == true) && is_opera == false && is_webtv == false) { bType = "ie4"; usec = true; }
if (is_nav2 == true || is_nav3 == true) { bType = "ns3"; usec = false; }
if (is_nav4up == true && is_nav5up == false) { bType = "ns4"; usec = false; }
if (is_nav5up == true && is_moz7 == false) { bType = "ns6"; usec = false; }
if (is_nav5up == true && is_moz7 == true) { bType = "mz7"; usec = false; }
if (is_opera == true) {  bType = "op4"; usec = true; }
if (is_opera5 == true) {  bType = "op5"; usec = true; }
if (is_webtv == true) {  bType = "tv"; usec = true; }

// color depth
if (usec == true) { var cd = screen.colorDepth; } else { var cd = screen.pixelDepth; }
if (cd < 16) { cd = "lo"; }
if (cd >= 16) { cd = "hi"; }
// note: I don't think it's necessary to distinguish between 16 and 24 bit color, 
// even though full hex color definitions are 24 bit, because 16 bit color is not paletised - 
// the video card's guess is probably as good as we could get with the naked eye.

// platform
if (is_win == true) { os = "win"; }
if (is_mac == true) { os = "mac"; }

//create a set of handy variables

var ie3=false;var ie4=false;var ns3=false;var ns4=false;var ns6=false;
var mz7=false;var op4=false;var op5=false;var tv=false;var old=false;
var lo=false;var hi=false;
var win=false;var mac=false;

if (bType == "ie3") ie3 = true; if (bType == "ie4") ie4 = true; if (bType == "ns3") ns3 = true; 
if (bType == "ns4") ns4 = true; if (bType == "ns6") ns6 = true; if (bType == "mz7") mz7 = true; 
if (bType == "op4") op4 = true; if (bType == "op5") op5 = true; if (bType == "tv") tv = true; if (bType == "old") old = true; 

if (ie3 || ns3 || op4 || tv) { old = true; }

if (cd == "lo") lo = true; if (cd == "hi")  hi = true; 
if (os == "win") win = true; if (os == "mac") mac = true;

//------------------------------------------
// Rollovers pour boutons de la vidéo
//------------------------------------------

<!-- Rollover On -->
function vidOn(vidName) {
        if (document.images) {
            document[vidName].src = eval(vidName + "on.src");}}
<!-- Rollover Off -->
function vidOff(vidName) {
        if (document.images) {
            document[vidName].src = eval(vidName + "off.src");}}

//------------------------------------------

