browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3) version = "n3";
else version = "x";
if ( browserName == "Microsoft Internet Explorer" && browserVer>=4) version="IE4";

var selectOn;
var selectOf;

function initIcones(){
	var nom = '';
	if (typeof(arguments[0]) != 'undefined') {nom = arguments[0];}
	if (typeof(LangueABREVIATION)=="undefined") {LangueABREVIATION=""}
	
	if (((version == "n3") || (version == "IE4"))) {
		if (nom == '') {
			selectOn= new Image();
			selectOn.src="/images/icones/EnleveCaddie"+LangueABREVIATION+".gif";
			selectOf= new Image();
			selectOf.src="/images/icones/AjouteCaddie"+LangueABREVIATION+".gif";
		} else {
			eval('select'+nom+'On= new Image();');
			eval('selectvisionOn.src="/images/icones/Enleve'+nom+LangueABREVIATION+'.gif";');
			eval('select'+nom+'Of= new Image();');
			eval('selectvisionOf.src="/images/icones/Ajoute'+nom+LangueABREVIATION+'.gif";');
		}
	}	
}



function EtatIcone(valeur){	//V2001-06-12
	if (!valeur){return;}
	if (valeur<=0){return;}
	
	// POUR LA GESTION DE LA VISIONNEUSE SUR BIOS
	var nom = '';
	var nomImage = '';
	if (typeof(arguments[1]) != 'undefined') {nom = arguments[1];}
	if (nom == '') {nom="product";}
	if (nom != 'product') {nomImage=nom;}
	
	n=CookieListePosition(nom,valeur);
	etatSelection=(n!=-1)?"select"+nomImage+"On.src":"select"+nomImage+"Of.src";
	(eval("var tempo=document.selection_"+valeur) )
	if (tempo) {
		eval("document.selection"+nomImage+"_"+valeur+".src="+etatSelection);
	}
}

function AjoutEnleve(valeur){	//V2001-06-12
	
	// POUR LA GESTION DE LA VISIONNEUSE SUR BIOS
	var nom = '';
	if (typeof(arguments[1]) != 'undefined') {nom = arguments[1];}
	TabVal = splitage(valeur,",");

	for (i in TabVal) {
		if (nom == '') {nom="product";}
		//alert(GetCookie (nom));
		n=CookieListePosition(nom,TabVal[i]);
		( n!=-1 )?CookieEnleveListe(nom,TabVal[i]):CookieAjouteListe(nom,TabVal[i]);
		//alert(n)
		var nomPageASP="panier" + "." + "a" + "s" + "p"
		
	
		tempo=document.location+""
		if (tempo.indexOf(nomPageASP)>0){
			document.location=document.location
			if (parent && parent.parent && parent.parent.principalFrame && parent.parent.principalFrame.EtatIcone){
				parent.parent.principalFrame.EtatIcone(TabVal[i],nom)
			}
		}
		if (parent && parent.ongletsFrameSet && parent.ongletsFrameSet.frame_1){
			tempo=(parent.ongletsFrameSet.frame_1.location)+""
			if (tempo.indexOf(nomPageASP)>0){
				//parent.ongletsFrameSet.frame_1.location.reload()
				parent.ongletsFrameSet.frame_1.location=parent.ongletsFrameSet.frame_1.location
			}
		}
		if (parent && parent.ongletsFrameSet && parent.ongletsFrameSet.frame_4){
			tempo=(parent.ongletsFrameSet.frame_4.location)+""
			if (tempo.indexOf(nomPageASP)>0){
				//parent.ongletsFrameSet.frame_4.location.reload()
				parent.ongletsFrameSet.frame_4.location=parent.ongletsFrameSet.frame_4.location
			}
		}
		
		if (parent && parent.frame_4){
			tempo=(parent.frame_4.location)+""
			if (tempo.indexOf(nomPageASP)>0){
				//parent.ongletsFrameSet.frame_4.location.reload()
				parent.frame_4.location=parent.frame_4.location
			}
		}
	
		if (parent && parent.Site){
			tempo=(parent.Site.location)+""
			//if (tempo.indexOf(nomPageASP)>0){
				//parent.ongletsFrameSet.frame_4.location.reload()
				parent.Site.location=parent.Site.location
			//}
		}
	
		//EtatIconeAllFrames(parent.document , TabVal[i])
		EtatIcone(TabVal[i],nom);
		EtatIconeAllFrames(top , TabVal[i],nom)
		window.onerror=erreurGestionIcones;
		if (window.opener){EtatIconeAllFrames(window.opener.top , TabVal[i],nom)}
		window.onerror=erreurGestionIcones;
		if ((window.cart)&&(window.cart.EtatIcone)) { window.cart.EtatIcone(TabVal[i],nom) }
		window.onerror=erreurGestionIcones;
		if ((window.ImgSel) && (window.ImgSel.EtatIcone)) {window.ImgSel.EtatIcone(TabVal[i],nom)}
		window.onerror=erreurGestionIcones;
		
		if (false) {
			//Code utilisé si chromless
			if (top && top.opener && top.opener.window&&top.opener.window.top){
				EtatIconeAllFrames(top.opener.window.top , TabVal[i],nom)
		
			}
		}
		//this.blur()
	}
	
}


function erreurGestionIcones() {
	return true 
}

function EtatIconeAllFrames(Objet , valeur){
	var obj
	
	// POUR LA GESTION DE LA VISIONNEUSE SUR BIOS
	var nom = '';
	if (typeof(arguments[2]) != 'undefined') {nom = arguments[2];}
	if (nom == '') {nom="product";}
	
	for (var i=0; i<Objet.frames.length;i++){
		if (Objet.frames[i].EtatIcone){Objet.frames[i].EtatIcone(valeur,nom);}
		EtatIconeAllFrames(Objet.frames[i] , valeur,nom)
	}
	return false
}


function CheckIfAllChecked()	//V2001-06-12
{
	var TotalBoxes = 0;
	var TotalOn = 0;
	if (document.FormRecherche && document.FormRecherche.checkAllBox){
		for (var i=0;i<document.FormRecherche.elements.length;i++)
		{
			var e = document.FormRecherche.elements[i];
			if ((e.name != 'checkAllBox') && (e.type=='checkbox'))
			{
				TotalBoxes++;
			if (e.checked)
			{
				TotalOn++;
			}
			}
		}
	
		if (TotalBoxes==TotalOn)
		{document.FormRecherche.checkAllBox.checked=true;}
		else
		{document.FormRecherche.checkAllBox.checked=false;}
	}
}

function AjouterCaddieAll(NbFchierReponse){	//V2002-02-04
	if (document.FormRecherche) {
		form=document.FormRecherche;
		
		Liste=splitage (CookieGet('product'),",")
		
		if ((Liste.length + NbFchierReponse) > 400) {
			alert("Vous ne pouvez mettre la totalité de cette recherche dans votre panier\ncar votre panier contiendrai alors plus de 400 éléments !");
		} else {
			if (confirm("Etes vous sûr de vouloir INSERER DANS VOTRE PANIER TOUS les fichiers correspondants à cette recherche ?")){
				/*
				URLTempo = "?TypeRecherche="+document.FormRecherche.TypeRecherche.value;
				URLTempo += "&MotRecherche="+document.FormRecherche.MotRecherche.value;
				URLTempo += "&ListeAnd="+document.FormRecherche.ListeAnd.value;
				URLTempo += "&ListeNot="+document.FormRecherche.ListeNot.value;
				URLTempo += "&ListeOr="+document.FormRecherche.ListeOr.value;
				URLTempo += "&ID="+document.FormRecherche.ID.value;
				*/
				
				var URLTempo=""
				for (var i=0;i<form.elements.length;i++){ 
					if((form.elements[i].type!='select-one')){
						if (form.elements[i].name && form.elements[i].value){
							//alert("form.elements[i]="+form.elements[i].name+"  -*-> "+form.elements[i] +"="+ form.elements[i].value )
							if (URLTempo!="" ) URLTempo+="&"
							URLTempo+= form.elements[i].name + "=" + escape(form.elements[i].value)
						}
					}
				
				}
				
				cart = window.open("/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Consulter" + "/" + "ToolBar_AjoutRecherchePanier" + "." + "a" + "s" + "p" + "?"+URLTempo ,"AjoutPanier", "resizable=yes,status=yes,scrollbars=yes,width=100,height=100"); 
				cart.focus();
			}
		}
	}
}

function AjouterCaddieAllBDD(){	//V2002-02-04
	if (document.FormRecherche) {
		form=document.FormRecherche;
		if (confirm("Etes vous sûr de vouloir INSERER DANS VOTRE SELECTION BDD TOUS les fichiers correspondants à cette recherche ?")){
			form.method='post';
			form.action='/CommunsGen/Phototheque/Administrer/Panier_GestionSpecial.asp';
			form.target='_blank';
			form.submit();
			form.action='/Consulter/apercu.asp';
			form.method='get';
			form.target='';
			/*
			URLTempo = "?TypeRecherche="+document.FormRecherche.TypeRecherche.value;
			URLTempo += "&MotRecherche="+document.FormRecherche.MotRecherche.value;
			URLTempo += "&ListeAnd="+document.FormRecherche.ListeAnd.value;
			URLTempo += "&ListeNot="+document.FormRecherche.ListeNot.value;
			URLTempo += "&ListeOr="+document.FormRecherche.ListeOr.value;
			URLTempo += "&ID="+document.FormRecherche.ID.value;
			*/
			/*
			var URLTempo=""
			for (var i=0;i<form.elements.length;i++){ 
				if((form.elements[i].type!='select-one')){
					if (form.elements[i].name && form.elements[i].value){
						//alert("form.elements[i]="+form.elements[i].name+"  -*-> "+form.elements[i] +"="+ form.elements[i].value )
						if (URLTempo!="") URLTempo+="&"
						URLTempo+= form.elements[i].name + "=" + escape(form.elements[i].value)
					}
				}
			
			}
			
			cart = window.open("/CommunsGen/Phototheque/Administrer/" + "Panier_GestionSpecial" + "." + "a" + "s" + "p" + "?"+URLTempo ,"AjoutPanier", "resizable=yes,status=yes,scrollbars=yes,width=500,height=400"); 
			cart.focus();
			*/
		}
	}
}

function AjouterCaddieAllSel(){	//V2002-02-04
	ID=""
	for (var i=0;i<document.FormRecherche.elements.length;i++)
	{
		var e = document.FormRecherche.elements[i];
		if ((e.name != 'checkAllBox') && (e.type=='checkbox') && (e.checked) && (e.name.substr(0,6) == "check_")){
			if (ID!=""){ID+=","}
			ID+=e.name.substr("check_".length,e.name.length)
			CookieAjouteListe('product',e.name.substr("check_".length,e.name.length))
			EtatIcone(e.name.substr("check_".length,e.name.length))
		}
	}
	if (ID == ""){alert("Désolé, pas de fichier sélectionné ou alors qui ont pas de prix défini !")}
}

function EnleveCaddieAllSel(){	//V2002-02-04
	ID=""
	for (var i=0;i<document.FormRecherche.elements.length;i++)
	{
		var e = document.FormRecherche.elements[i];
		if ((e.name != 'checkAllBox') && (e.type=='checkbox') && (e.checked) && (e.name.substr(0,6) == "check_")){
			if (ID!=""){ID+=","}
			ID+=e.name.substr("check_".length,e.name.length)
			CookieEnleveListe('product',e.name.substr("check_".length,e.name.length))
			EtatIcone(e.name.substr("check_".length,e.name.length))
		}
	}
	if (ID == ""){alert("Désolé, pas de fichier sélectionné !")}
}

function EnleveCaddieAll() {
	CookieAjouter("product","");
	if ((document.FormRecherche) && (document.FormRecherche.elements)) {
		for (var i=0;i<document.FormRecherche.elements.length;i++)
		{
			status="EnleveCaddieAll if "+i
			var e = document.FormRecherche.elements[i];
			if ((e.name != 'checkAllBox') && (e.type=='checkbox') ){			
				var e = document.FormRecherche.elements[i];
				EtatIcone(e.name.substr("check_".length,e.name.length))
		}
	}
		
	}
	var tempoLoc=(document.location +"").toLowerCase()
		
	tempo1= (tempoLoc+"." + "as" + "p" + "").toLowerCase().indexOf("." + "a" + "s" + "p" ) 
	tempo2=0
	if (tempo1>0) {
		tempoLoc=tempoLoc.substring(0,tempo1)
		tempo2= (tempoLoc).toLowerCase().indexOf("/caddie/" ) 
	}
	if (tempo2 >0   ){
		document.location=document.location +""
		//document.location.reload();
	}
	alert("Votre panier a été vidé !");
}

function SelectAllBox(ValueChecked)	//V2001-06-12
{
	if ((document.FormRecherche) && (document.FormRecherche.elements)) {
		for (var i=0;i<document.FormRecherche.elements.length;i++)
		{
			var e = document.FormRecherche.elements[i];
			//(e.name != 'checkAllBox')
			if ((e.type=='checkbox')) {
				e.checked = ValueChecked;
				//e.checked = document.FormRecherche.checkAllBox.checked;
			}
		}
	} else {
		alert("Vous ne pouvez executer cette fonctionnalité ici !");
	}
}

function SelectBox_Inverse(ValueChecked)	//V2001-06-12
{
	if ((document.FormRecherche) && (document.FormRecherche.elements)) {
		for (var i=0;i<document.FormRecherche.elements.length;i++)
		{
			var e = document.FormRecherche.elements[i];
			//(e.name != 'checkAllBox')
			if ((e.type=='checkbox') && (e.name != 'checkAllBox')) {
				e.checked = !e.checked;
				//e.checked = document.FormRecherche.checkAllBox.checked;
			}
		}
	} else {
		alert("Vous ne pouvez executer cette fonctionnalité ici !");
	}
}

function ModifPermAllSel(){	//V2001-06-12
	ID=""
	n=0
	for (var i=0;i<document.FormRecherche.elements.length;i++)
	{
		var e = document.FormRecherche.elements[i];
		if ((e.name != 'checkAllBox') && (e.type=='checkbox') && (e.checked) && (e.name.substr(0,6) == "check_")){
			if (ID!=""){ID+=","}
			ID+=e.name.substr(e.name.lastIndexOf("_")+1)
			//ID+=e.name.substr("check_".length,e.name.length)
			n++
		}
	}
	if (ID != ""){
		ModifPerm(ID,n+" fichiers")
	}else{
		// pas de fichier sélectionné !
		var tempoLoc=(document.location +"").toLowerCase()
		
		tempo1= (tempoLoc+"." + "a" + "s" + "p").toLowerCase().indexOf("." + "a" + "s" + "p" ) 
		tempo2=0
		if (tempo1>0) {
			tempoLoc=tempoLoc.substring(0,tempo1)
			tempo2= (tempoLoc).toLowerCase().indexOf("/caddie/" ) 
		}
		if (tempo2 >0   ){
			if (confirm("Etes vous sûr de vouloir MODIFIER LES PERMISSIONS de TOUS les fichiers du PANIER ?")){
				
				var URLtempo2="/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Administrer" + "/" + "Permissions" + "/" + "PermCeFichier" + "." + "asp" + "" + "?" + "ID="+escape( CookieGet ("product") )
				cart = window.open(URLtempo2 ,"Permissions", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
				cart.focus();
			}
			
			
		}else{
			if (confirm("Etes vous sûr de vouloir MODIFIER LES PERMISSIONS de TOUS les fichiers correspondants à cette recherche ?")){
				form=document.FormRecherche
				if (form.ID) form.ID.value="";
				if (form.RechercheCach) form.RechercheCach.value="";
				var URLTempo=""
				for (var i=0;i<form.elements.length;i++){ 
					if((form.elements[i].type!='select-one')){
						if (form.elements[i].name && form.elements[i].value){
							//alert("form.elements[i]="+form.elements[i].name+"  -*-> "+form.elements[i] +"="+ form.elements[i].value )
							if (URLTempo!="" ) URLTempo+="&"
							URLTempo+= form.elements[i].name + "=" + escape(form.elements[i].value)
						}
					}
				}
				var URLtempo2="/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Administrer" + "/" + "Permissions" + "/" + "PermCeFichier" + "." + "asp"
				cart = window.open(URLtempo2+"?"+URLTempo ,"Permissions", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
				cart.focus();
			}
		}

	}
}

function RecalculeAllSel(){	//V2001-07-17
	ID=""
	n=0
	for (var i=0;i<document.FormRecherche.elements.length;i++)
	{
		var e = document.FormRecherche.elements[i];
		if ((e.name != 'checkAllBox') && (e.type=='checkbox') && (e.checked) && (e.name.substr(0,6) == "check_")){
			if (ID!=""){ID+=","}
			ID+=e.name.substr(e.name.lastIndexOf("_")+1)
			//ID+=e.name.substr("check_".length,e.name.length)
			n++
		}
	}
	if (ID != ""){
		var cart =open("/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Remplir" + "/" + "RecalculeImage" + "." + "asp" + "?" + "ListeImages="+escape(ID) , "_RecalculeImage" , "resizable=yes,status=yes,scrollbars=yes,width=500,height=400"); 
		cart.focus();
	}
	else{
		// pas de fichier sélectionné !
		var tempoLoc=(document.location +"").toLowerCase()
		
		tempo1= (tempoLoc+"." + "a" + "s" + "p").toLowerCase().indexOf("." + "a" + "s" + "p" ) 
		tempo2=0
		if (tempo1>0) {
			tempoLoc=tempoLoc.substring(0,tempo1)
			tempo2= (tempoLoc).toLowerCase().indexOf("/caddie/" ) 
		}
		if (tempo2 >0   ){
			if (confirm("Etes vous sûr de vouloir RECALCULER les vignettes de TOUS les fichiers du PANIER ?")){
				
				var URLtempo2="/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Remplir" + "/" + "RecalculeImage" + "." + "as" + "p" + "?" + "ListeImages="+escape( CookieGet ("product") )
				cart = window.open(URLtempo2 ,"_RecalculeImage", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
				cart.focus();
			}
			
			
		}else{
			if (confirm("Etes vous sûr de vouloir RECALCULER les vignettes de TOUS les fichiers correspondants à cette recherche ?")){
				form=document.FormRecherche
				if (form.ID) form.ID.value="";
				if (form.RechercheCach) form.RechercheCach.value="";
				var URLTempo=""
				for (var i=0;i<form.elements.length;i++){ 
					if((form.elements[i].type!='select-one')){
						if (form.elements[i].name && form.elements[i].value){
							//alert("form.elements[i]="+form.elements[i].name+"  -*-> "+form.elements[i] +"="+ form.elements[i].value )
							if (URLTempo!="" ) URLTempo+="&"
							URLTempo+= form.elements[i].name + "=" + escape(form.elements[i].value)
						}
					}
				}
				var URLtempo2="/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Remplir" + "/" + "RecalculeImage" + "." + "a" + "s" + "p"
				cart = window.open(URLtempo2+"?"+URLTempo ,"_RecalculeImage", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
				cart.focus();
			}
		}
	}
}

function ModifPerm(ID,nom){	//V2001-06-12
	if (document.FormRecherche) {
		var cart =open("/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Administrer" + "/" + "Permissions" + "/" + "PermCeFichier" + "." + "a" + "s" + "p" + "?" + "GalerieID="+document.FormRecherche.GalerieID.value+"&ID="+ID+"&ListeAnd="+escape(document.FormRecherche.ListeAnd.value)+"&ListeOr="+escape(document.FormRecherche.ListeOr.value)+"&ListeNot="+escape(document.FormRecherche.ListeNot.value)+"&MotRecherche="+escape(document.FormRecherche.MotRecherche.value)+"&TypeRecherche="+escape(document.FormRecherche.TypeRecherche.value)	+"&name="+escape(nom) , "Changer" , "resizable=yes,status=yes,scrollbars=yes,width=500,height=400"); 
	} else {
		var cart =open("/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Administrer" + "/" + "Permissions" + "/" + "PermCeFichier" + "." + "a" + "s" + "p" + "?" + "ID="+ID+"&name="+escape(nom) , "Changer" , "resizable=yes,status=yes,scrollbars=yes,width=500,height=400"); 
	}
}

function DestroyAllSel(){	//V2001-06-12
	ID=""
	n=0
	for (var i=0;i<document.FormRecherche.elements.length;i++)
	{
		var e = document.FormRecherche.elements[i];
		if ((e.name != 'checkAllBox') && (e.type=='checkbox') && (e.checked) && (e.name.substr(0,6) == "check_")){
			if (ID!=""){ID+=","}
			ID+=e.name.substr(e.name.lastIndexOf("_")+1)
			//ID+=e.name.substr("check_".length,e.name.length)
			n++
		}
	}

	if (ID != ""){
		if (confirm('Etes vous sûr de vouloir détruire DEFINITIVEMENT les fichiers sélectionnés ??')){
			document.FormRecherche.DeleteFile.value=ID
			document.FormRecherche.submit()
		}
	}
	else{
		alert("Désolé, pas de fichier sélectionné !")
	}
}
function Destroy(ID){	//V2001-06-12
		if (confirm('Etes vous sûr de vouloir détruire DEFINITIVEMENT CE fichier ??')){
			if ( (document.FormRecherche) && (document.FormRecherche.DeleteFile) ){
				document.FormRecherche.DeleteFile.value=ID
				document.FormRecherche.submit()
			}
			else {
				if ( (document.PermNouveauFichier) && (document.PermNouveauFichier.DeleteFile) ){
					document.PermNouveauFichier.DeleteFile.value=ID
					document.PermNouveauFichier.submit()
				}
			}
		}
}
function Modifier(ID){	//V2001-06-12
	cart = window.open("/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Remplir" + "/" + "Modification" + "." + "a" + "s" + "p" + "?" + "ID="+escape(ID) ,"Modifier", "resizable=yes,status=yes,scrollbars=yes,width=700,height=600"); 
}

function ModifinfosAllSel(){	//V2001-06-12
	ID=""
	n=0
	for (var i=0;i<document.FormRecherche.elements.length;i++)
	{
		var e = document.FormRecherche.elements[i];
		if ((e.name != 'checkAllBox') && (e.type=='checkbox') && (e.checked) && (e.name.substr(0,6) == "check_")){
			if (ID!=""){ID+=","}
			ID+=e.name.substr(e.name.lastIndexOf("_")+1)
			//ID+=e.name.substr("check_".length,e.name.length)
			n++
		}
	}

	if (ID != ""){
		Modifier(ID)
	}
	else{
		// pas de fichier sélectionné !
		var tempoLoc=(document.location +"").toLowerCase()
		
		tempo1= (tempoLoc+"." + "a" + "s" + "p").toLowerCase().indexOf("." + "a" + "s" + "p" ) 
		tempo2=0
		if (tempo1>0) {
			tempoLoc=tempoLoc.substring(0,tempo1)
			tempo2= (tempoLoc).toLowerCase().indexOf("/caddie/" ) 
		}
		if (tempo2 >0   ){
			if (confirm("Etes vous sûr de vouloir MODIFIER LES INFOS sur TOUS les fichiers du PANIER ?")){
				
				//var URLtempo2="/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Remplir" + "/" + "Modification" + "." + "a" + "s" + "p" + "?" + "ID="+escape( CookieGet ("product") )
				var URLtempo2="/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Remplir" + "/" + "Modification" + "." + "a" + "s" + "p" + "?" + "ByPanier=1"
				cart = window.open(URLtempo2 ,"Modifier", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
			}
			
			
		}else{
			if (confirm("Etes vous sûr de vouloir MODIFIER LES INFOS sur TOUS les fichiers correspondants à cette recherche ?")){
				form=document.FormRecherche
				if (form.ID) form.ID.value="";
				if (form.RechercheCach) form.RechercheCach.value="";
				var URLTempo=""
				for (var i=0;i<form.elements.length;i++){ 
					if((form.elements[i].type!='select-one')){
						if (form.elements[i].name && form.elements[i].value){
							//alert("form.elements[i]="+form.elements[i].name+"  -*-> "+form.elements[i] +"="+ form.elements[i].value )
							if (URLTempo!="" ) URLTempo+="&"
							URLTempo+= form.elements[i].name + "=" + escape(form.elements[i].value)
						}
					}
				}
				var URLtempo2="/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Remplir" + "/" + "Modification" + "." + "a" + "s" + "p"
				cart = window.open(URLtempo2+"?"+URLTempo ,"Modifier", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
			}
		}
	}
}

function ChargeExcelAllSel() {
	ID=""
	n=0
	for (var i=0;i<document.FormRecherche.elements.length;i++)
	{
		var e = document.FormRecherche.elements[i];
		if ((e.name != 'checkAllBox') && (e.type=='checkbox') && (e.checked) && (e.name.substr(0,6) == "check_")){
			if (ID!=""){ID+=","}
			ID+=e.name.substr(e.name.lastIndexOf("_")+1)
			//ID+=e.name.substr("check_".length,e.name.length)
			n++
		}
	}

	if (ID != ""){
		cart = window.open("/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Administrer" + "/" + "MotsClesExcel" + "." + "a" + "s" + "p" + "?" + "ID" + "="+escape(ID) ,"ChargerExcel", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
		cart.focus();
	}
	else{
		var tempoLoc=(document.location +"").toLowerCase()
		
		tempo1= (tempoLoc+"." + "a" + "s" + "p").toLowerCase().indexOf(".asp" ) 
		tempo2=0
		if (tempo1>0) {
			tempoLoc=tempoLoc.substring(0,tempo1)
			tempo2= (tempoLoc).toLowerCase().indexOf("/caddie/" ) 
		}
		if (tempo2 >0   ){
			if (confirm("Etes vous sûr de vouloir CHARGER LES INFOS sur TOUS les fichiers du PANIER ?")){
				
				var URLtempo2="/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Administrer" + "/" + "MotsClesExcel" + "." + "a" + "s" + "p" + "?ID="+escape( CookieGet ("product") )
				cart = window.open(URLtempo2 ,"ChargerExcel", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
				cart.focus();
			}
			
			
		}else{
			if (confirm("Etes vous sûr de vouloir CHARGER LES INFOS sur TOUS les fichiers correspondants à cette recherche ?")){
				form=document.FormRecherche
				if (form.ID) form.ID.value="";
				if (form.RechercheCach) form.RechercheCach.value="";
				var URLTempo=""
				for (var i=0;i<form.elements.length;i++){ 
					if((form.elements[i].type!='select-one')){
						if (form.elements[i].name && form.elements[i].value){
							//alert("form.elements[i]="+form.elements[i].name+"  -*-> "+form.elements[i] +"="+ form.elements[i].value )
							if (URLTempo!="" ) URLTempo+="&"
							URLTempo+= form.elements[i].name + "=" + escape(form.elements[i].value)
						}
					}
				
				}
				
				var URLtempo2="/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Administrer" + "/" + "MotsClesExcel" + "." + "a" + "s" + "p"
				cart = window.open(URLtempo2+"?"+URLTempo ,"ChargerExcel", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
				cart.focus();
			}
		}
	}
}

function ReindexeAllSel() {
	ID=""
	n=0
	for (var i=0;i<document.FormRecherche.elements.length;i++)
	{
		var e = document.FormRecherche.elements[i];
		if ((e.name != 'checkAllBox') && (e.type=='checkbox') && (e.checked) && (e.name.substr(0,6) == "check_")){
			if (ID!=""){ID+=","}
			ID+=e.name.substr(e.name.lastIndexOf("_")+1)
			//ID+=e.name.substr("check_".length,e.name.length)
			n++
		}
	}

	if (ID != ""){
		cart = window.open("/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Remplir" + "/" + "MAJRechercheIndexIntro" + "." + "a" + "s" + "p" + "?" + "ID" + "="+escape(ID) ,"ChargerExcel", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
		cart.focus();
	}
	else{
		var tempoLoc=(document.location +"").toLowerCase()
		
		tempo1= (tempoLoc+"." + "a" + "s" + "p").toLowerCase().indexOf(".asp" ) 
		tempo2=0
		if (tempo1>0) {
			tempoLoc=tempoLoc.substring(0,tempo1)
			tempo2= (tempoLoc).toLowerCase().indexOf("/caddie/" ) 
		}
		if (tempo2 >0   ){
			if (confirm("Etes vous sûr de vouloir REINDEXER TOUS les fichiers du PANIER ?")){
				
				var URLtempo2="/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Remplir" + "/" + "MAJRechercheIndexIntro" + "." + "a" + "s" + "p" + "?ID="+escape( CookieGet ("product") )
				cart = window.open(URLtempo2 ,"Reindexe", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
				cart.focus();
			}
			
			
		}else{
			if (confirm("Etes vous sûr de vouloir REINDEXER TOUS les fichiers correspondants à cette recherche ?")){
				form=document.FormRecherche
				if (form.ID) form.ID.value="";
				if (form.RechercheCach) form.RechercheCach.value="";
				var URLTempo=""
				for (var i=0;i<form.elements.length;i++){ 
					if((form.elements[i].type!='select-one')){
						if (form.elements[i].name && form.elements[i].value){
							//alert("form.elements[i]="+form.elements[i].name+"  -*-> "+form.elements[i] +"="+ form.elements[i].value )
							if (URLTempo!="" ) URLTempo+="&"
							URLTempo+= form.elements[i].name + "=" + escape(form.elements[i].value)
						}
					}
				
				}
				
				var URLtempo2="/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Remplir" + "/" + "MAJRechercheIndexIntro" + "." + "a" + "s" + "p"
				cart = window.open(URLtempo2+"?"+URLTempo ,"Reindexe", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
				cart.focus();
			}
		}
	}
}

function RSS(){	//V2001-06-12
	ID=""
	n=0
	for (var i=0;i<document.FormRecherche.elements.length;i++)
	{
		var e = document.FormRecherche.elements[i];
		if ((e.name != 'checkAllBox') && (e.type=='checkbox') && (e.checked) && (e.name.substr(0,6) == "check_")){
			if (ID!=""){ID+=","}
			ID+=e.name.substr(e.name.lastIndexOf("_")+1)
			//ID+=e.name.substr("check_".length,e.name.length)
			n++
		}
	}

	if (ID != ""){
		var URLtempo2="/CommunsGen" + "/" + "Phototheque" + "/" + "Administrer" + "/" + "FichiersRSS" + "." + "a" + "s" + "p" + "?" + "ID="+ID;
		cart = window.open(URLtempo2 ,"RSS", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
		cart.focus();
	}
	else{
		// pas de fichier sélectionné !
		var tempoLoc=(document.location +"").toLowerCase()
		
		tempo1= (tempoLoc+".asp").toLowerCase().indexOf(".asp" ) 
		tempo2=0
		if (tempo1>0) {
			tempoLoc=tempoLoc.substring(0,tempo1)
			tempo2= (tempoLoc).toLowerCase().indexOf("/caddie/" ) 
		}
		if (tempo2 >0   ){
			if (confirm("Etes vous sûr de vouloir GENERER UN FLUX RSS pour TOUS les fichiers du PANIER ?")){
				
				var URLtempo2="/CommunsGen" + "/" + "Phototheque" + "/" + "Administrer" + "/" + "FichiersRSS" + "." + "a" + "s" + "p" + "?" + "ID="+escape( CookieGet ("product") )
				cart = window.open(URLtempo2 ,"RSS", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
				cart.focus();
			}
			
			
		}else{
			if (confirm("Etes vous sûr de vouloir GENERER UN FLUX RSS pour TOUS les fichiers correspondants à cette recherche ?")){
				form=document.FormRecherche
				if (form.ID) form.ID.value="";
				if (form.RechercheCach) form.RechercheCach.value="";
				var URLTempo=""
				for (var i=0;i<form.elements.length;i++){ 
					if((form.elements[i].type!='select-one')){
						if (form.elements[i].name && form.elements[i].value){
							//alert("form.elements[i]="+form.elements[i].name+"  -*-> "+form.elements[i] +"="+ form.elements[i].value )
							if (URLTempo!="" ) URLTempo+="&"
							URLTempo+= form.elements[i].name + "=" + escape(form.elements[i].value)
						}
					}
				}
				var URLtempo2="/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Administrer" + "/" + "FichiersRSS" + "." + "a" + "s" + "p"
				cart = window.open(URLtempo2+"?"+URLTempo ,"RSS", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
				cart.focus();
			}
		}
	}
}

function EnvoiPanierMail() {
	ID=""
	n=0
	for (var i=0;i<document.FormRecherche.elements.length;i++)
	{
		var e = document.FormRecherche.elements[i];
		if ((e.name != 'checkAllBox') && (e.type=='checkbox') && (e.checked) && (e.name.substr(0,6) == "check_")){
			if (ID!=""){ID+=","}
			ID+=e.name.substr(e.name.lastIndexOf("_")+1)
			//ID+=e.name.substr("check_".length,e.name.length)
			n++
		}
	}
	
	if (ID != ""){
		cart = window.open("/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Administrer" + "/" + "EnvoiPanierMail" + "." + "a" + "s" + "p" + "?" + "ID="+escape(ID),"EnvoiPanierMail", "resizable=yes,status=yes,scrollbars=yes,width=750,height=750"); 
	}
	else{
		//if (confirm("Etes vous sûr de vouloir CHARGER LES INFOS sur TOUS les fichiers correspondants à cette recherche ?")){
			form=document.FormRecherche
			if (form.ID) form.ID.value="";
			if (form.RechercheCach) form.RechercheCach.value="";
			var URLTempo=""
			for (var i=0;i<form.elements.length;i++){ 
				if((form.elements[i].type!='select-one')){
					if (form.elements[i].name && form.elements[i].value){
						//alert("form.elements[i]="+form.elements[i].name+"  -*-> "+form.elements[i] +"="+ form.elements[i].value )
						if (URLTempo!="" ) URLTempo+="&"
						URLTempo+= form.elements[i].name + "=" + escape(form.elements[i].value)
					}
				}
			
		}
			cart = window.open("/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Administrer" + "/" + "EnvoiPanierMail" + "." + "a" + "s" + "p" + "?"+URLTempo,"EnvoiPanierMail", "resizable=yes,status=yes,scrollbars=yes,width=750,height=750"); 
			cart.focus();
		//}
	}
	
}

function RemoveFromNewsAllSel(){	//V2001-06-12
	ID=""
	n=0
	for (var i=0;i<document.FormRecherche.elements.length;i++)
	{
		var e = document.FormRecherche.elements[i];
		if ((e.name != 'checkAllBox') && (e.type=='checkbox') && (e.checked) && (e.name.substr(0,6) == "check_")){
			if (ID!=""){ID+=","}
			ID+=e.name.substr("check_".length,e.name.length)
			n++
		}
	}

	if (ID != ""){
		RemoveFromNews(ID)
	}
	else{
		alert("Désolé, pas de fichier sélectionné !")
	}	
}
function RemoveFromNews(ID){	//V2001-06-12
	var cart =open("/" + "CommunsGen" + "/" + "Phototheque" + "/" + "Remplir" + "/" + "RemoveFromNews" + "." + "a" + "s" + "p" + "?" + "ID="+escape(ID) ,"", "resizable=yes,status=yes,scrollbars=yes,width=500,height=600"); 
}




NS4 = (document.layers)? true:false
IE4 = (document.all)? true:false
VER4 = (IE4 || NS4) ? 1 : 0;
var tvX = tvY = 0;
tvDocTipsSize=200
whichEl = null;


if (navigator.appName.substring(0,3) == "Net")
{
	document.captureEvents(Event.MOUSEMOVE)
	document.onmousemove = moveToAll;
}


function ShowTips(ID) 
{
	
	eval("var tvDocTips = document.getElementById('doctips_"+ID+"');")
	if (tvDocTips) {
		eval("var tvDocTips = tvDocTips.style;")
		if (navigator.appName.substring(0,3) == "Net") {
			document.captureEvents(Event.MOUSEMOVE);
			document.onmousemove = moveToAll;
		} else {
			tvX = event.clientX+document.body.scrollLeft; 
			tvY = event.clientY+document.body.scrollTop;
		}
		
		tvDocTips.left = tvX+10;
		tvDocTips.top = tvY+5;
		tvDocTips.visibility='visible';
		
		
		/*
		Bok=false
		if (NS4) 
		{
			eval("var tvDocTips = document.doctips_"+ID+";")
			if (tvDocTips){
				var lvLayer = tvDocTips.document;
				tvInnerWidth = window.innerWidth;
				Bok=true
			}
	                	
		}
		if (IE4) 
		{
			if (this.document.all['doctips_'+ID]){
				tvDocTips = this.document.all['doctips_'+ID].style;
				tvInnerWidth = document.body.clientWidth;
		  		tvInnerHeight = document.body.clientHeight;		
				tvX=event.clientX+document.body.scrollLeft; 
				tvY=event.clientY+document.body.scrollTop;
				Bok=true
			}
			
		}
		
		if (Bok){
			if ((tvX+tvDocTipsSize)>tvInnerWidth)
			{
				tvX = tvX + 10 - (tvDocTipsSize/2);
			}
			// Y Coord
				
					
			//tvDocTipsSize = size;
			DisplayTips(ID);
			moveTo(tvDocTips,tvX,tvY);
		}
		*/
	}
}


function ShowTip(objName, ID) 
{
	tvDocTips=document.getElementById("doctips_"+objName)
	if (tvDocTips && document.getElementById("doctips_"+ID) ) {
		if (navigator.appName.substring(0,3) == "Net") {
			document.captureEvents(Event.MOUSEMOVE);
			document.onmousemove = moveToAll;
		} else {
			tvX = event.clientX+document.body.scrollLeft; 
			tvY = event.clientY+document.body.scrollTop;
		}
		tvDocTips.innerHTML=document.getElementById("doctips_"+ID).innerHTML
		tvDocTips.style.left = tvX+10;
		tvDocTips.style.top = tvY+5;
		tvDocTips.style.visibility='visible';
	}
}


function moveToAll(e) 
{
      tvX = e.pageX;
      tvY = e.pageY;
}

function moveTo(pObj,pX,pY) 
{
      pObj.left = pX;
      pObj.top = pY;
}

function HideTips(ID) 
{
	//eval("var tvDocTips = document.getElementById('doctips_"+ID+"');")
	
	tvDocTips=document.getElementById("doctips_"+ID)
	
	if (tvDocTips) {
		tvDocTips.style.visibility='hidden';
		
		/*
		if (NS4) 
		{
			eval("var lvLayer = document.doctips_"+ID+";")
			if (lvLayer){
				lvLayer.visibility="hide";
			}
		}
		if (IE4) 
		{
			if (this.document.all['doctips_'+ID]){
				this.document.all['doctips_'+ID].style.visibility="hidden";
			}	
		}
		*/
	}
}

function DisplayTips(ID) 
{
	if (NS4) 
	{
		eval("var lvLayer = document.doctips_"+ID+";")
		if (lvLayer){
			lvLayer.visibility="hide";
		}
	}
		
	if (IE4) 
	{
		if (this.document.all['doctips_'+ID]){
			tvDocTips = this.document.all['doctips_'+ID].style;
			tvDocTips.visibility="visible";
		}
	}	
}

// GESTION DE L'AFFICHAGE LORS DE L'AJOUT DANS UN PANIER
var MousePosWidth = 0;
var MousePosHeight = 0;

function MousePos(e) {
      MousePosWidth = e.pageX;
      MousePosHeight = e.pageY;
}

function RecupWidth() {
	if (document.documentElement) {
		return document.documentElement.clientWidth;
	} else {
		if (document.body) {
			return document.body.clientWidth;
		} else {
			return window.innerWidth;
		}
	}
}

function RecupHeight() {
	if (document.documentElement) {
		return document.documentElement.clientHeight;
	} else {
		if (document.body) {
			return document.body.clientHeight;
		} else {
			return window.innerHeight;
		}
	}
}

function RecupWidthScroll() {
	var WidthScroll = 0;
	if (document.body) {
		WidthScroll = document.body.scrollLeft;
	}
	if (WidthScroll == 0) {
		if (document.documentElement) {
			WidthScroll = document.documentElement.scrollLeft;
		} else {
			WidthScroll = window.pageYOffset;
		}
	}
	return WidthScroll;
}

function RecupHeightScroll() {
	var HeightScroll = 0;
	if (document.body) {
		HeightScroll = document.body.scrollTop;
	}
	if (HeightScroll == 0) {
		if (document.documentElement) {
			HeightScroll = document.documentElement.scrollTop;
		} else {
			HeightScroll = window.pageYOffset;
		}
	}
	return HeightScroll;
}

function ShowElmt(ElmtNom){
	var Elmt = document.getElementById(ElmtNom);
	Elmt.style.visibility = 'visible';
	
	var WS = 0;
	var HS = 0;
	
	if (navigator.appName.substring(0,3) == "Net") {
		document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = MousePos;
	} else {
		MousePosWidth = event.clientX;
		MousePosHeight = event.clientY;
		WS = RecupWidthScroll();
		HS = RecupHeightScroll();
	}
	var W = MousePosWidth;
	var H = MousePosHeight;
	
	Elmt.style.left = (W+WS+10)+'px';
	Elmt.style.top = (H+HS+10)+'px';
}

function HideElmt(ElmtNom){
	var Elmt = document.getElementById(ElmtNom);
	Elmt.style.visibility = 'hidden';
}






