//----------------------------------------------------------------------
// © Mosquito -  contact@mosquitoweb.fr
// Fonctions communes
//----------------------------------------------------------------------

var fleche_d = 'pics/fleche-d.gif';
var fleche_g = 'pics/fleche-g.gif';
var fleche_h = 'pics/fleche-h.gif';
var invi = 'pics/invi.gif';

var gngp = "Galeries nationales du Grand Palais";
var guimet = "Mus&eacute;e national des Arts asiatiques-Guimet";

// Repertoire des images
//var repertImg ="img/";

var Rubrique = new Array();
Rubrique = [
    ["Nom rubrique", "Nom repertoire", "Ordre apparition"],
    ["Expositions", "01expositions", 1],
    ["Mus&eacute;es", "02musees", 2],
    ["Musique", "03musique", 3],
    ["Spectacles vivants", "04spectacles", 4],
    ["Cin&eacute;ma", "05cinema", 5],
    ["Litt&eacute;rature", "06litterature", 6],
    ["Institutions", "07institutions", 7],
    ["Autres", "08autres", 8]
  ];
  
//Expressions regulieres utilisees pour recup. des param. d'environnement (1 : valeurs alphaNum. 2 : valeurs num)
var regexp1=/[^&]+/,regexp2=/\d+/g;
  
function FZB_chgTemoin(NumImg,NomCapture) { //Permet de changer le temoin actif pour les differentes captures ecran
	fichier= chemin +invi;
	for (i=1; i<=MaxImg; i++) { //remise a zero des cellules
		document.getElementById('td'+i).className='bgRub';
		document.images['img'+i].src=fichier;
		
		//Changement du ALT et TITLE de l'image
		document.images['img'+i].alt = 'Cliquez pour voir la capture d\'ˇcran';
		document.images['img'+i].title = 'Cliquez pour voir la capture d\'ˇcran';
	}
	
	document.getElementById('td'+NumImg).className='bgGris'; // Chgmt bgColor actif
	
	fichier= chemin +fleche_h;
	document.images['img'+NumImg].src=fichier;	// Affichage temoin actif
	
	//Changement du ALT et TITLE de l'image
	document.images['img'+NumImg].alt = "Capture en cours";
	document.images['img'+NumImg].title = "Capture en cours";
	
	//Chgmt capture d'ecran
	document.capture.src=NomCapture.replace(/-[^-]*\.jpg/, "-" +NumImg +".jpg");
	
	if (document.getElementById && navigator.appName=='Microsoft Internet Explorer') {
		//Init Filtre IE de Pixelisation
		document.capture.style.filter='progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=50,Duration=1)';

		//Execution du filtre
		filtre=document.capture.filters.item('DXImageTransform.Microsoft.Pixelate');
		filtre.apply();
		filtre.play();
	}
}

function FZB_ActiveLink(NumLien) {  // Permet de changer le lien actif du menu gauche
	document.getElementById('lien0').className='menuG'; //Lien vers l'index de la rubrique- inactif
	for (i=1; i<=ssRub.length-1; i++) { //Tous les liens inactif
		document.getElementById('lien'+i).className='SSmenuG';
	}
	if(NumLien==0) {
		document.getElementById('lien0').className='menuGa'; // Chgmt Lien actif
	} else {
		document.getElementById('lien'+NumLien).className='SSmenuGa'; // Chgmt Lien actif
	}
}

function FZB_Imprime(doc) { //Impression des pages avec capture d'ecran
	Imprime=window.open(doc,'imprime','toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=490,height=500')
	Imprime.focus();
}

function FZB_ImprimePlan(doc) { //Impression du plan d'acces Mosquito
	Imprime=window.open(doc,'imprime','toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=595,height=510')
	Imprime.focus();
}
function FZB_EnvoyerPage(doc) { //envoie d'un lien
	EnvoyerPage=window.open(doc,'envoyer','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=490,height=250')
	EnvoyerPage.focus();
}

//Recuperation d'un nb aleatoire pour affichage d'une image
function alea(min, max) {
	var range = max - min + 1;
	return Math.floor(Math.random() * range) + min;
}

function FZB_openWindow2(theURL, haut, larg, NomFenetre) { //Ouverture de la fenetre principale
	fenetre2=window.open(theURL,NomFenetre,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+larg+',height='+haut);
	fenetre2.focus();
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

