// V1.11
// 21/08/02
<!--
parent.document.title = document.title;

function sniffer() {
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4b = (this.ns && (this.minor < 4.04));
    this.ns4 = (this.ns && (this.major == 4));
    this.ns6 = (this.ns && (this.major >= 5));
    this.ie   = (agent.indexOf("msie") != -1);
    this.ie3  = (this.ie && (this.major == 2));
    this.ie5  = (this.ie && (this.major >= 4) && (document.getElementById) ) ? true : false ;
    this.ie6  = (this.ie5 && (agent.indexOf('msie 6')!=-1) ) ? true : false ;
    this.ie4  = (this.ie && (this.major >= 4) && !(this.ie5));
    this.op3 = (agent.indexOf("opera") != -1);
    this.win   = (agent.indexOf("win")!=-1);
    this.mac   = (agent.indexOf("mac")!=-1);
    this.unix  = (agent.indexOf("x11")!=-1);
    this.dom = (this.ns6 || this.ie5 );
}

var clientIs = new sniffer();

/********************************************************************
*                   Ajout des feuilles de styles                    *
********************************************************************/
//document.open();

document.close();

function openWin(URL,w,h,resize,scroll)
{
lAttributes = '';
lAttributes += 'toolbar=0,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=0,';
lAttributes += 'scrollbars='+scroll+',';
lAttributes += 'resizable='+resize+',';
lAttributes += 'width='+w+',';
lAttributes += 'left='+((screen.width - w) / 2)+',';
lAttributes += 'height='+h+',';
lAttributes += 'top='+((screen.height - h) / 2)+'';

winId = window.open(URL,"_blank",lAttributes, false);
}

function openWin2(URL,title,w,h,resize,scroll)
{
lAttributes = '';
lAttributes += 'toolbar=0,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=0,';
lAttributes += 'scrollbars='+scroll+',';
lAttributes += 'resizable='+resize+',';
lAttributes += 'width='+w+',';
lAttributes += 'left='+((screen.width - w) / 2)+',';
lAttributes += 'height='+h+',';
lAttributes += 'top='+((screen.height - h) / 2)+'';

winId = window.open(URL,title,lAttributes);
}

function openWin3(URL,title,w,h,resize,scroll)
{
lAttributes = '';
lAttributes += 'toolbar=0,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=0,';
lAttributes += 'scrollbars='+scroll+',';
lAttributes += 'resizable='+resize+',';
lAttributes += 'width='+w+',';
lAttributes += 'left='+(((screen.width - w) / 2)+ 20)+',';
lAttributes += 'height='+h+',';
lAttributes += 'top='+(((screen.height - h) / 2)+ 20)+'';

winId = window.open(URL,title,lAttributes);
}


function openPrint(URL,w,h,resize,scroll)
{
lAttributes = '';
lAttributes += 'toolbar=1,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=1,';
lAttributes += 'scrollbars='+scroll+',';
lAttributes += 'resizable='+resize+',';
lAttributes += 'width='+w+',';
lAttributes += 'height='+h+'';

winId = window.open(URL,"",lAttributes);
}



function getLanguage()
{
var url = document.location.href;
if (url.indexOf("/fr/")!=-1) return "fr";
if (url.indexOf("/en/")!=-1) return "en";
if (url.indexOf("/es/")!=-1) return "es";
}
function switchLanguage(increment)
{
	for(i=0;i<top.frames.length;i++)
	{
		var pagepath = top.frames[i].document.location.href;


		index = pagepath.lastIndexOf("/");
		pagefilename = pagepath.substring(index+1,pagepath.length);
	
		tmppath = pagepath.substring(0,index);
		index = tmppath.lastIndexOf("/");
		language = tmppath.substring(index+1,tmppath.length);


		nextpath = tmppath.substring(0,index);

		/*
*/
		if (language=='fr')
		{
			if(increment==1)
				language= '/es/' ;
			else
				language= '/en/';
		}
		else if(language=='en')
		{
			if(increment==1)
				language= '/fr/' ;
			else
				language= '/es/';
		}
		else 
		{
			if(increment==1)
				language= '/en/' ;
			else
				language= '/fr/';
		}


	top.frames[i].document.location.href = nextpath + language + pagefilename;

	//top.frames[i].document.location.reload();
	}

}
function directAccess(URL)
{
	var pageNameIndex = URL.lastIndexOf("/");
	pageName = URL.substring(pageNameIndex+1,URL.length);

	if(pageName=="index.php")
	{
		parent.location.href = URL;
	}
	else
	{
		location.href = URL;
	}
}

/******************** fonctions ow fiche technique et zoom *************/
function fiche(newurl, type)
{
	openWin(newurl,605,497,0,0);
}
function zoom(newurl, direction)
{
	openWin(newurl,605,597,0,0);
}

function retouralaRecherche()
{
history.back();
}
/******************************************************************************
*                   Gestion du resize et des styles sous NS4                  *
******************************************************************************/
function onloadGlobalHandler()
{
	handleWindowResize();
}

function handleWindowResize()
{
	var clientIs = new sniffer();
	if(!clientIs.ns4) return;

	setTimeout("top.onresize=redo",1000);
}
function redo()
{
	for(i=0;i<top.frames.length;i++)
	{
		top.frames[i].document.location.reload();
	}


}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

/******************************************************************************
*                   action clic pour chutier                                  *
******************************************************************************/
function actChutier(enreg, classeur, doc, objCheck, cote)
{
	document.chutier.cmd.value = (objCheck.checked?"add":"del");
	document.chutier.enreg.value = enreg;
	document.chutier.classeur.value = classeur;
	document.chutier.doc.value = doc;
	document.chutier.cote.value = cote;
	document.chutier.submit();
}
function actChutier2(enreg, classeur, doc, objCheck, cote)
{
	document.chutier.cmd.value = "del";
	document.chutier.enreg.value = enreg;
	document.chutier.classeur.value = classeur;
	document.chutier.doc.value = doc;
	document.chutier.cote.value = cote;
	document.chutier.submit();
	document.location.href='sel_mosa.asp';
	opener.document.location.href=opener.document.location.href;
}


/******************************************************************************
*                   action clic pour listes d'index / vocab                   *
******************************************************************************/
function validListe(noChamp, strValue, validAuto, from, multiVal, separateur)
/* noChamp:entier ; strValue:chaine ; validAuto:booleen ; from:chaine ; multival:booleen */
{
	if (!window.opener) window.close();

	if (from == '') {
		
	if (!window.opener.document.recherche)
	{
		 window.close();
	}
	else
	{
		var obj_valeur;

		// CAS DE LA RECHERCHE PAR EQUATION
		if (window.opener.document.recherche._Champ)
		{
			var obj_champ;
			obj_champ = window.opener.document.recherche._Champ;
			obj_valeur = window.opener.document.recherche._Valeur;
			
			if (document.formIndex.champ.options[document.formIndex.champ.selectedIndex].value!=obj_champ.options[obj_champ.selectedIndex].value){
				if (obj_valeur.value!='') window.opener.fAjouter(window.opener.document.recherche);
				var i
				for (i=0; i< obj_champ.options.length; i++){
					if (obj_champ.options[i].value == document.formIndex.champ.options[document.formIndex.champ.selectedIndex].value){
						obj_champ.selectedIndex = i;
					}
				}
				obj_valeur.value='';
			}

		}
		// CAS DE FORMULAIRES
		else if (window.opener.document.recherche)
		{
			obj_valeur = eval('window.opener.document.recherche.CH' + noChamp);
		}
		
		if (!multiVal) obj_valeur.value = '';
		
		var re = new RegExp( "(^" + strValue + "$|^" + strValue + "[" + separateur + "]|[" + separateur + "]" + strValue + "$|[" + separateur + "]" + strValue + "[" + separateur + "])" );
		var doublon = (obj_valeur.value.search(re)>=0);
		if (!doublon)
		{
			if (obj_valeur.value != '')
			{
				obj_valeur.value = obj_valeur.value + separateur;
				// Si multivalué on change le comparateur de l'équation
				if (window.opener.document.recherche._Champ) if (window.opener.document.recherche._Comparateur.value!="&=") window.opener.document.recherche._Comparateur.value = "|=";
			}
			obj_valeur.value = obj_valeur.value + strValue;
		}
		
		// CAS DE LA RECHERCHE PAR EQUATION
		if (window.opener.document.recherche._Champ)
		{
			if (window.opener.newCriteria==false) window.opener.newCriteria = true;
		}
		
		window.opener.nb_reponses();
	}
	
	}
	else {
		a = eval('top.parent.document.' + from);
		if (!multiVal) a.value = '';
		if (a.value != '') a.value = a.value + separateur;
		a.value = a.value + strValue;
		actuDiv = parent.document.getElementById('CH'+noChamp);
		actuDiv.innerHTML = a.value;
		parent.nb_reponses();
	}
}

function vider_valeur(noChamp)
{
	parent.document.getElementById('CH' + noChamp).innerHTML='<img src=images/recherche/trait_point.gif>'
	eval('parent.document.recherche.CH' + noChamp + '.value=""')
	nb_reponses()
}

function rien()
{
} 

function VerifyLogin()
{
	dojo.io.bind({url: 'login_verif.asp', handler: LoginUser, formNode: dojo.byId('login')});
}

function LoginUser(type, data, evt)
{
		if (data == "OK")
		{
			dlg0.setContent("<table width='300' height='75'><tr><td valign='middle' align='center' class='zoom'>Connexion en cours ...</td></tr></table>");
			dlg0.show();
			document.login.action="connect.asp";
			document.login.submit();
		}
		else
		{
			
			dlg0.setContent("<table width='300' height='75'><tr><td valign='middle' align='center' class='zoom'>" + data + "<br><br><button dojoType='Button' widgetId='okButton' onclick='dlg0.hide();'>ok</button></td></tr></table>");
			dlg0.show();
			
		}
}

function nb_reponses_thematique()
{
	dojo.require("dojo.event.*");
	dojo.require("dojo.widget.*");

	document.getElementById('textedirigeants').innerHTML = '<span class="referenceblanc">En cours ...</span>';
	document.getElementById('textelogo').innerHTML = '<span class="referenceblanc">En cours ...</span>';
	document.getElementById('texteclients').innerHTML = '<span class="referenceblanc">En cours ...</span>';
	document.getElementById('textehistorique').innerHTML = '<span class="referenceblanc">En cours ...</span>';
	document.getElementById('texteproduits').innerHTML = '<span class="referenceblanc">En cours ...</span>';
	document.getElementById('texteevenements').innerHTML = '<span class="referenceblanc">En cours ...</span>';
	document.getElementById('textemagasins').innerHTML = '<span class="referenceblanc">En cours ...</span>';
	document.getElementById('textevideo').innerHTML = '<span class="referenceblanc">En cours ...</span>';
	document.getElementById('textefondation').innerHTML = '<span class="referenceblanc">En cours ...</span>';
	document.getElementById('textedevelopmt').innerHTML = '<span class="referenceblanc">En cours ...</span>';
	
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep1, formNode: dojo.byId('R1')});
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep2, formNode: dojo.byId('R2')});
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep3, formNode: dojo.byId('R3')});
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep4, formNode: dojo.byId('R4')});
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep5, formNode: dojo.byId('R5')});
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep6, formNode: dojo.byId('R6')});
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep7, formNode: dojo.byId('R7')});
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep8, formNode: dojo.byId('R8')});
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep9, formNode: dojo.byId('R9')});
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep10, formNode: dojo.byId('R10')});
}

function nb_reponses_activite()
{
	dojo.require("dojo.event.*");
	dojo.require("dojo.widget.*");
	document.getElementById('Layer1').innerHTML = '<div align="right"><span class="infothemes"></span></div>';
	document.getElementById('Layer2').innerHTML = '<div align="right"><span class="infothemes"></span></div>';
	document.getElementById('Layer3').innerHTML = '<div align="right"><span class="infothemes"></span></div>';
	document.getElementById('Layer4').innerHTML = '<div align="right"><span class="infothemes"></span></div>';
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep1, formNode: dojo.byId('rechercheLayer1')});
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep2, formNode: dojo.byId('rechercheLayer2')});
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep3, formNode: dojo.byId('rechercheLayer3')});
	dojo.io.bind({url: 'ajx_nbrep.asp', handler: AfficheRep4, formNode: dojo.byId('rechercheLayer4')});
}

function AfficheRep1(type, data, evt)
{
		document.getElementById('textedirigeants').innerHTML = '<span class="referenceblanc">' + unescape(data) + ' photos</span>';
}
function AfficheRep2(type, data, evt)
{
		document.getElementById('textelogo').innerHTML = '<span class="referenceblanc">' + unescape(data) + ' photos</span>';
}
function AfficheRep3(type, data, evt)
{
		document.getElementById('texteclients').innerHTML = '<span class="referenceblanc">' + unescape(data) + ' photos</span>';
}
function AfficheRep4(type, data, evt)
{
		document.getElementById('textehistorique').innerHTML = '<span class="referenceblanc">' + unescape(data) + ' photos</span>';
}
function AfficheRep5(type, data, evt)
{
		document.getElementById('texteproduits').innerHTML = '<span class="referenceblanc">' + unescape(data) + ' photos</span>';
}
function AfficheRep6(type, data, evt)
{
		document.getElementById('texteevenements').innerHTML = '<span class="referenceblanc">' + unescape(data) + ' photos</span>';
}
function AfficheRep7(type, data, evt)
{
		document.getElementById('textemagasins').innerHTML = '<span class="referenceblanc">' + unescape(data) + ' photos</span>';
}
function AfficheRep8(type, data, evt)
{
		document.getElementById('textevideo').innerHTML = '<span class="referenceblanc">' + unescape(data) + ' vid&eacute;os</span>';
}
function AfficheRep9(type, data, evt)
{
		document.getElementById('textefondation').innerHTML = '<span class="referenceblanc">' + unescape(data) + ' photos</span>';
}
function AfficheRep10(type, data, evt)
{
		document.getElementById('textedevelopmt').innerHTML = '<span class="referenceblanc">' + unescape(data) + ' photos</span>';
}

function add_panier(enreg, classeur, doc)
{
	dojo.io.bind({
                       url: 'ajx_chutier.asp',
                       handler: actualise_panier,
                       content: {
						   	enreg: enreg,
							classeur: classeur,
							doc: doc,
							cmd: 'ADD'
						}
                    });
}

function add_panier2(enreg, classeur, doc)
{
	dojo.io.bind({
                       url: 'ajx_chutier.asp',
                       handler: actualise_panier,
                       content: {
						   	enreg: enreg,
							classeur: classeur,
							doc: doc,
							cmd: 'ADD'
						}
                    });
    alert('Document ajouté à votre sélection');                
}

function add_sel(id)
{
	dojo.io.bind({
                       url: 'ajx_chutier.asp',
                       handler: actualise_panier,
                       content: {
						   	id: id,
							cmd: 'ADDSEL'
						}
                    });
    alert('les images ont été ajoutés à vos sélections');                 
}

function del_panier(enreg, classeur, doc)
{
	dojo.io.bind({
                       url: 'ajx_chutier.asp',
                       handler: actualise_panier_del,
                       content: {
						   	enreg: enreg,
							classeur: classeur,
							doc: doc,
							cmd: 'DEL'
						}
                    });
}

function actualise_panier(type, data, evt)
{
	s = document.location.href;
	if (s.indexOf("archivesdetail-corps.asp") <= 0)
	{
		if (s.indexOf("listearchives-corps.asp") > 0)
		{
			alert('Votre sélection a été ajoutée au panier');
		}
		else
		{
			if (parent.chutier)
			{
				parent.chutier.document.location.reload();
			}
			else if (top.opener.parent.chutier.document)
			{
				top.opener.parent.chutier.document.location.reload();
			}
			
			if (s.indexOf("selection-corps.asp") > 0)
			{
				document.location.reload();
			}
		}
	}
	else
	{
		alert('Votre image a été ajoutée au panier');
	}
}

function actualise_panier_del(type, data, evt)
{
	s = document.location.href;
	if (s.indexOf("selection-corps.asp") > 0) document.location.reload();
	
	if (parent.chutier)
	{
		parent.chutier.document.location.reload();
	}
	else if (top.opener.parent.chutier.document)
	{
		top.opener.parent.chutier.document.location.reload();
	}
	
}

function vider_panier()
{
	dojo.io.bind({
                       url: 'ajx_chutier.asp',
                       handler: actualise_panier_del,
                       content: {
						   	cmd: 'VIDER'
						}
                    });
}

function reload_panier(type, data, evt)
{
	s = document.location.href;
	if (s.indexOf("resultat-chutier.asp",0)>0)
	{
		document.location.href = "resultat-chutier.asp";
	}
	else
	{
		document.location.reload();
	}
//	document.location.href = document.location.href;
	if (opener.top.document) opener.document.location.reload();
}

function get_index(champ, from, filtre, page, liste)
{
	dojo.io.bind({
                       url: 'ajx_listeindex.asp',
                       handler: affiche_liste,
                       content: {
						   	champ: champ, 
							from: from,
							filtre: filtre,
							page:page,
							liste:liste
						}
                    });
}


function affiche_liste(type, data, evt)
{
		el = document.getElementById('bloc-recherche-pro');
		el.innerHTML = unescape(data); 
}

//-->