var nbChampVerifie;

function getVersionIE() {
	if (!(navigator.appName == 'Microsoft Internet Explorer'))return 999;
	else{
		var ua = navigator.userAgent;
		var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
		if (re.exec(ua) != null) {
			return parseFloat( RegExp.$1 );
		}	
	}	
	return 999;
} 

function include(fileName,typeBaliseToAdd,nomFoncToCheck,foncQdLoaded) {
	var objToAdd;
	if (!typeBaliseToAdd)typeBaliseToAdd="head";
	if (document.getElementsByTagName)objToAdd = document.getElementsByTagName(typeBaliseToAdd);
	else if (document.$$)objToAdd = $$(typeBaliseToAdd);
 	if (objToAdd) {
		var script = document.createElement("script");
		script.type = "text/javascript";
		script.src = fileName;
 		objToAdd[0].appendChild(script);
 	}
 	if (nomFoncToCheck){
 		eval("var ok=window."+nomFoncToCheck);
 		if (ok)window.foncQdLoaded();
 		else{
 			window.optsForInclude={};
 			window.optsForInclude.fileName=fileName;
 			window.optsForInclude.foncQdLoaded=foncQdLoaded;
 			window.optsForInclude.nomFoncToCheck=nomFoncToCheck;
 			window.optsForInclude.intervForInclude=setInterval(function(){
 				eval("var ok=window."+window.optsForInclude.nomFoncToCheck);
 				if (ok){
 					clearInterval(window.optsForInclude.intervForInclude);
 					window.optsForInclude.foncQdLoaded();
 				}
 			},500);
 		}
 	}
}

function addfavoris(url,title){
	if(!url){
		if(document.documentURI)url=document.documentURI;
		else url=document.location;//pour ie
	}
	if (!title)title=document.title;
	if (navigator.userAgent.indexOf('Safari') != -1){
		if(navigator.appVersion.indexOf("Mac",0)>0)alertAMalibu("Utilisez POMME + D \n pour ajouter " + title + " dans vos favoris");
		else alertAMalibu("Utilisez CTRL + D \n pour ajouter " + title + " dans vos favoris");
	}
	if(getVersionIE() <9 && window.external)window.external.AddFavorite(url, title);
	else if (window.sidebar.addPanel)window.sidebar.addPanel(title,url,"");

	//else if (window.opera && window.print) alert("Utilisez CTRL + T \n pour ajouter " + title + " dans vos favoris."); //Opera
}

function printContentObj(obj){
	obj=$(obj);
	var ident=obj.id;
	
	var links="";
	var objLinks=document.getElementsByTagName('link');
	for (var i=0;i<objLinks.length;i++){
		links+="<link rel='stylesheet' media='"+objLinks[i].getAttribute("media")+"' href='"+objLinks[i].getAttribute("href")+"' />";
	}
	var contentFrame="<html><head>"+links+"</head><body>"+obj.innerHTML+"</body></html>";
	/*
	top.windowToPrint=window.open("","windowToPrint");
	top.windowToPrint.document.writeln(contentFrame);
	//top.windowToPrint.document.close();
	if(getVersionIE()<9) top.print();
	else top.windowToPrint.print();
	top.windowToPrint.close();
	*/
	
	var windowToPrint=window.open("","windowToPrint");
	windowToPrint.document.open();
	windowToPrint.document.write(contentFrame);
	windowToPrint.document.close();
	windowToPrint.print();
	windowToPrint.close();
}

function reloadJs(){
	var i,a,s; 
	a=document.getElementsByTagName('script');
	for(i=0;i<a.length;i++){
		s=a[i];
		if(s.type.toLowerCase().indexOf('text/javascript')>=0&&s.src){
			var h=s.src.replace(/(&|%5C?)reload=\d+/,'');
			s.src=h+(h.indexOf('?')>=0?'&':'?')+'reload='+getUniqueId();
		}
	}
}


function gaTrack(url){
	if (window.pageTracker)window.pageTracker._trackPageview(url);
	if (window.pageTrackerItea)window.pageTrackerItea._trackPageview(url);
}

function gTracking_addTrans(numero_resa,affiliation,prix_total,prix_taxes,prix_expedition,ville,region,pays){
	if (window.pageTracker)
		window.pageTracker._addTrans(numero_resa,affiliation,prix_total,prix_taxes,prix_expedition,ville,region,pays);
}

function gTracking_addItem(numero_resa,code_prod,nom_prod,categorie_prod,prix_unit,quantite){
  	if (window.pageTracker)
		window.pageTracker._addItem(numero_resa,code_prod,nom_prod,categorie_prod,prix_unit,quantite);
}

function gTracking_trackTrans(){
  	if (window.pageTracker) window.pageTracker._trackTrans();
}

function gTracking_conversionPage(id,langue,format,color,label,mntTotal){

	if(id){
		var google_conversion_id = id;
		var google_conversion_language = langue;
		var google_conversion_format = format;
		var google_conversion_color = color;
		var google_conversion_label = label;
		if (mntTotal){
			var google_conversion_value = mntTotal;
		}
		include("http://www.googleadservices.com/pagead/conversion.js","body");
	}	
}

function initSiteWeb(){
	checkPageForDivDynamique();
	checksForListe();
	checkPageSiDivForChargeNavig();
	//initAllCalendrierItea();
	setForNavigPage();
	/*Enlevé pour la fiche 130880 car ça fait une double initialisation
	 *if ($("lst_fiche_photos_suppl")
		&& !$("div_fiche_photoPrincEtSuppl")
		&& window.initAlbumPhoto)initAlbumPhoto();	*/
		
	if (window.oninit)oninit();
	if (window.oninit1)oninit1();
	if (window.oninit2)oninit2();
	if (window.oninit3)oninit3();

	traiteInformationByAncre();
    verifNavigateur();
	setInterval("checkLinkHttps()",2000);
}

function checkLinkHttps(){
	if ($("divNomHttpHostSiteInit")){
		var dom=$("divNomHttpHostSiteInit").innerHTML;
		var premiersChar;
		var addr;
		//pour les liens
		$$('a').each(function(obj){
			if((obj.readAttribute("href")!=null)&&(obj.readAttribute("href").length>0)&&(!obj.hasClassName("sslLink"))){
				premiersChar = (obj.readAttribute("href")).substr(0,5);
				if((premiersChar != "http:")&&(premiersChar.substr(0,1)!="#")&&(premiersChar!="https")){
					addr ="http://"+dom+obj.readAttribute("href");
					obj.writeAttribute("href",addr);
				}
			}
		});
		//pour les images
		$$('img').each(function(obj){
			if((obj.readAttribute("src")!=null)&&(!obj.hasClassName("sslLink"))){
				premiersChar = (obj.readAttribute("src")).substr(0,5);
				if((premiersChar != "http:")&&(premiersChar!="https")){
					addr ="http://"+dom+obj.readAttribute("src");
					obj.writeAttribute("src",addr);
				}
			}
		});
	}
}

function traiteInformationByAncre(){
	var ancre=getAncreInQuery();
	if (ancre.substr(0,3)=="js:"){
		var infos=ancre.split(":");
		var infosAExec=infos[1];
		eval(infosAExec);
	}
}


function checkPageForDivDynamique(){
	refreshPanier();
	checkForListeDivDynamique();
	checkForBlocDivDynamique();
}

function checkForBlocDivDynamique(){
	$$(".iteaV4Bloc").each(function(obj){
		var url="/media2.php";
		var vars="file=/bloc/"+obj.getAttribute("bloc");
		var foncQdFini=null;
		//var url="/page_web.php";
		//var vars="page=/bloc/"+obj.getAttribute("bloc");
		var params=obj.getAttribute("params");
		if (params)vars+="&"+params;
		if(obj.getAttribute("foncQdFini")) foncQdFini = eval(obj.getAttribute("foncQdFini"));
		if (!obj.id)obj.setAttribute("id","id-"+getUniqueId())
		affUrlInDiv(obj.id,url,vars,"aucun",foncQdFini);
	})
}

function checkPageSiDivForChargeNavig(){
	$$(".itea_divNavigFiche").each(function(obj){
		var url="/lib/ajax/contenuFenetre.php";
		var identFicheCurr=obj.getAttribute("ident");
		var vars="element=objProd_v2&typeInfo=navigInFiche-"+identFicheCurr+getInfoSession("PHPSESSID");
		vars+="&CGISSUR="+getQueryString();
		affUrlInDiv(obj.id,url,vars,"aucun");
	});
	$$(".itea_divNavigFiche_fngf").each(function(obj){
		var url="/lib/ajax/contenuFenetre.php";
		var identFicheCurr=obj.getAttribute("ident");
		var vars="element=objProd_v2&typeInfo=navigInFicheFngf-"+identFicheCurr+getInfoSession("PHPSESSID");
		vars+="&CGISSUR="+getQueryString();
		affUrlInDiv(obj.id,url,vars,"aucun");
	});
}


function boomEffectSite(){
	var objs=document.getElementsByTagName("DIV");
	for (var i=0;i<objs.length;i++){
		if (objs[i].childNodes && objs[i].childNodes.length<3){
			var x,y,duree,multiplicateur;
			if (i%2==0)multiplicateur=-1;
			else multiplicateur=1
			x=Math.random()*500*multiplicateur;
			y=Math.random()*500*multiplicateur;
			duree=Math.random()*3;
			objs[i].setAttribute("x_move",x);
			objs[i].setAttribute("y_move",y);
			
			new Effect.Move(objs[i], {x: x,y: y, duration: duree, mode: 'relative'});
		}
	
	}
	
}
function deboomEffectSite(){
	var objs=document.getElementsByTagName("DIV");
	for (var i=0;i<objs.length;i++){
		if (objs[i].childNodes && objs[i].childNodes.length<3){
			var x,y,duree,multiplicateur;
			x=objs[i].getAttribute("x_move")*-1;
			y=objs[i].getAttribute("y_move")*-1;
			duree=Math.random()*3;
			objs[i].setAttribute("x_move","");
			objs[i].setAttribute("y_move","");
			new Effect.Move(objs[i], {x: x,y: y, duration: duree, mode: 'relative'});
		}
	}
}



function getUniqueId(max){
	var deb;

	if (!max)deb=0;
	else deb=(18-max);
	
	return ((new Date()).getTime() + "" + Math.floor(Math.random() * 1000000)).substr(deb, 18)
}

function afficheNbRepInDivByForm(nomFrm,nomDiv){

	var objFrm=document.getElementById(nomFrm);
	if (!objFrm)return;
	var tabChp=getTabChmpForm(objFrm);
	
	for (var i=0;i<tabChp.length;i++){
		tabChp[i].onchange=function(evt){
			var url="/lib/ajax/traiteRequete.php";
			var vars="getNbInListCurr=ok";
			
			for (var i=0;i<tabChp.length;i++){
				vars+="&"+tabChp[i].name+"="+tabChp[i].value;
			}
			affUrlInDiv(nomDiv,url,vars);
		}
	}

	var url="/lib/ajax/traiteRequete.php";
	var vars="getNbInListCurr=ok";
	for (var i=0;i<tabChp.length;i++){
		vars+="&"+tabChp[i].name+"="+tabChp[i].value;
	}
	affUrlInDiv(nomDiv,url,vars);

}


function encodeHTML(html){
   	 var encodedHtml = escape(html);
   	 encodedHtml = encodedHtml.replace(/\//g,"%2F");
   	 encodedHtml = encodedHtml.replace(/\?/g,"%3F");
   	 encodedHtml = encodedHtml.replace(/=/g,"%3D");
   	 encodedHtml = encodedHtml.replace(/&/g,"%26");
  	 encodedHtml = encodedHtml.replace(/@/g,"%40");
   	 return encodedHtml;
}


function getInfoSession(nomvar){
	var vars="";

	if (!nomvar)nomvar="SESSID";
	var sess=getQueryStringVal("PHPSESSID");
	tabSess = sess.split("#");
	sess = tabSess[0];
	if (sess)vars+="&"+nomvar+"="+sess;
	else{
		vars="";
		var info=document.cookie;	
	}
	return vars;
}

function setVarEnSessionAjx(tag,val){
	var adr="/lib/ajax/miseEnSession.php";
	var xhr_local=creeObjHttpRequest();
	
	var sending=getInfoSession()+"&tag="+tag+"&val="+val		
	xhr_local.onreadystatechange = function(){
		if(xhr_local && xhr_local.readyState == 4){
			reponse = xhr_local.responseText;
		}
	}
	xhr_local.open("POST",adr,true);
	xhr_local.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	xhr_local.send(sending);
}	


function setClassForObj(obj,classe){
	if (obj){
		obj.setAttribute("class",classe);
		obj.setAttribute("className",classe);
	}
}
function setClassForObj_uniqClass(obj,classe){
	if (obj){
		
		var classAvant=obj.getAttribute("class");
		var objs=document.getElementsByClassName(classe);
		/*** On transforme les autres objet ayant la meme classe ***/
		for (var i=0;i<objs.length;i++)setClassForObj(objs[i],classAvant);
		setClassForObj(obj,classe);
	}
}


function getHtmlMessageFromForm(formToTransform){
	var form=formToTransform.cloneNode(true);
	form=transformChmpFormToSpan(form);
	return form.innerHTML;
}


function envoiMailByAjaxByForm(nomIdForm,nomIdRetourMsg,transformFormulaire){
	var adr="/lib/ajax/envoiMail.php";
	var xhr_local=creeObjHttpRequest();
  	var sending="";
  	var message="";
  	
  	var form=document.getElementById(nomIdForm);
  	
  	
  	if (form){
  		if (form.destinataire)sending+="&destinataire="+escape(form.destinataire.value);
  		if (form.expediteur)sending+="&expediteur="+escape(form.expediteur.value);
  		if (form.sujet)sending+="&sujet="+escape(form.sujet.value);
  		if (form.enteteMessage)sending+="&enteteMessage="+escape(form.enteteMessage.value);
  		if (form.piedMessage)sending+="&piedMessage="+escape(form.piedMessage.value);
  		
  		if (form.msgEnvoiOK)sending+="&msgEnvoiOK="+escape(form.msgEnvoiOK.value);
  		if (form.msgEnvoiKO)sending+="&msgEnvoiKO="+escape(form.msgEnvoiKO.value);
 
 		sending+="&urlCurr="+document.location;
 
   		if (transformFormulaire){
  			message=getHtmlMessageFromForm(form);
  		}else{
	  		if (form.message)message=form.message.value;
	  		if (form.messages){
	  			for (var i=0;i<form.messages.length;i++){
	   				message+=form.messages[i].value;
	  			}
	  		}
	  	}
	  	sending+="&message="+escape(message);
  	}else return;
  	  	
	var html="<div id=divMsgEnvoiRetour><img src='/config_v3/imgs_defaut/roue_grise.gif' /></div>";

  	xhr_local.onreadystatechange = function(){
		if(xhr_local.readyState == 4 && xhr_local.status == 200){
			var reponse = xhr_local.responseText;
			var divReponse=document.getElementById("divMsgEnvoiRetour");
			divReponse.innerHTML=unescape(reponse);
		}
	}
	var divMsg=document.getElementById(nomIdRetourMsg);
	if (divMsg)divMsg.innerHTML=html;
	else form.innerHTML=html;
	
	
	xhr_local.open("POST",adr,true);
 	xhr_local.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	xhr_local.send(sending);
	
}

function envoiMailByAjax(dest,exp,cc,sujet,body,nomIdRetourMsg,msgEnvoiOK,msgEnvoiKO,sessid){
	var adr="/lib/ajax/envoiMail.php";
	var xhr_local=creeObjHttpRequest();
  	var sending="";
  	
	if (dest)sending+="&destinataire="+escape(dest);
	if (cc)sending+="&copie="+escape(cc);
	if (exp)sending+="&expediteur="+escape(exp);
	if (sujet)sending+="&sujet="+escape(sujet);
	if (body)sending+="&message="+escape(body);
   		
	if (msgEnvoiOK)sending+="&msgEnvoiOK="+escape(msgEnvoiOK);
	if (msgEnvoiKO)sending+="&msgEnvoiKO="+escape(msgEnvoiKO);
	if (sessid) sending+=sessid;
  	
	var html="<div id=divMsgEnvoiRetour><img src='/config_v3/imgs_defaut/roue_grise.gif' /></div>";

	var divMsg=document.getElementById(nomIdRetourMsg);
  	if (divMsg)divMsg.innerHTML=html;
  	
  	xhr_local.onreadystatechange = function(){
		if(xhr_local.readyState == 4 && xhr_local.status == 200){
			var reponse = xhr_local.responseText;
			var divReponse=document.getElementById("divMsgEnvoiRetour");
			divReponse.innerHTML=unescape(reponse);
		}
	}
		
	xhr_local.open("POST",adr,true);
 	xhr_local.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	xhr_local.send(sending);
	
}


function setCookie (name,value,expires,path,domain,secure) {
    document.cookie = name + '=' + escape (value) +
	((expires) ? '; expires=' + expires.toGMTString() : '') +
    ((path) ? '; path=' + path : '') +	((domain) ? '; domain=' + domain : '') + ((secure) ? '; secure' : '');
}

function getCookie(name){
	if (document.cookie.length>0){
		deb=document.cookie.indexOf(name + '=');
		if (deb!=-1) { 
	   		deb=deb + name.length+1; 
	  		fin=document.cookie.indexOf(';',deb);
	   		if (fin==-1) fin=document.cookie.length;
	   		return unescape(document.cookie.substring(deb,fin));
	   	} 
  	}
	return '';
}
function getQueryString(){
	var lDoc=String(document.location);
	var n1 = lDoc.indexOf("?");
	if (n1<=0)return "";
	var n2 = lDoc.indexOf("#");
	if (n2<=0)n2=lDoc.length;
	var qs= lDoc.substring(n1+1,n2);
	
	return qs;	
}
function getAncreInQuery(){
	var lDoc=String(document.location);
	var n2 = lDoc.indexOf("#")+1;

	var ancre= lDoc.substring(n2);
	
	return ancre;	
}
function getQueryStringVal(lQuery){

	var lDoc=String(document.location);
	var lSignet = "";
	var n1 = lDoc.indexOf("?");

	if (n1 > 0) {
		var n2 = lDoc.indexOf("?" + lQuery + "=",n1);
		if (n2 < n1)
			n2 = lDoc.indexOf("&" + lQuery + "=",n1);
 		if (n2 >= n1){
 			n2 = n2 + ("?" + lQuery + "=").length;
 			var n3 = lDoc.indexOf("&",n2+1);
 			if (n3 > n2)
 				lSignet = lDoc.substring(n2, n3);
 			else
 				lSignet = lDoc.substring(n2);
 		}
 	}
	return lSignet;
} 

function getTabValInQueryString(){
	var loc=String(document.location);
	var n1 = loc.indexOf("?");
	
	var tabOut=new Array();
	if (n1<0)return tabOut;

	var qs=loc.substring(n1+1);
	var vars=qs.split("&");
	
	
	for (var i=0;i<vars.length;i++){
		tabOut.push(vars[i].split("="));
	}
	return tabOut;		
}

function getQueryStringByForm(form){
	var sending="";
	
	if (form){
		var elts=form.elements;
		
		for (var i=0;i<elts.length;i++){
			var elt=elts[i];
			var param=new String(elt.name).toLowerCase();
			if (param.length>0 && elt && elt.value && elt.value.length>0){
				switch (elt.type){
				case "radio":
				case "checkbox":
					if (elt.checked)sending+="&"+param+"="+escape(elt.value);
					break;
				default:
				case "select":
					sending+="&"+param+"="+escape(elt.value);
					break;
				}		
			}
		}
	}
	return sending;
}
function desactiveForm(form){
	var suff=form.id;
	if(!suff)suff=form.name;
	affMsgAttenteParDessusInDiv(form,suff);
	if (form){
		var objForm=$(form);
		var elts=objForm.elements;
		for (var i=0;i<elts.length;i++)elts[i].disabled=true;
	}	
	
}
function reactiveForm(form){
	var suff=form.id;
	if(!suff)suff=form.name;
	effaceMsgAttenteParDessus(suff);
	if (form){
		var objForm=$(form);
		var elts=objForm.elements;
		for (var i=0;i<elts.length;i++)elts[i].disabled=false;
	}	
}
 

function scrollToAncre(nomAncre){
	self.location.hash="#"+nomAncre;
	/*
	var url=document.location.href;
	var parts=url.split("#");
	document.location.href=parts[0]+"#divers"+getUniqueId();
	document.location.href=parts[0]+="#"+nomAncre;
	*/
}


function bloqueTouche(e) {
	var DisableCtrlKeys = Array(67,86);
	var ie = window.event;
	if (ie){
		e = window.event;
	}
	if(e.ctrlKey) { //Touche Ctrl enfoncée
		for (i=0;i<DisableCtrlKeys.length;i++) {
			if(e.keyCode == DisableCtrlKeys[i]) {
				if ((ie && e.srcElement.id=='eMailConfirm')||(e.target && e.target.id=='eMailConfirm')) {
					if (ie) {
						e.keyCode=0;
						e.returnValue = false;
					}
					return false;
				}
			}
		}
	}
			
	/* Si un jour on veut bloquer des touches sans CTRL */
	/*for (i=0;i<DisableKeys.length;i++){
		if (e.keyCode == DisableKeys[i]) {
			if (ie) {
				e.keyCode=0;
				e.returnValue = false;
			}
			return false;
		}
	}*/
			
}
document.onkeydown=bloqueTouche;

function getValueById(id){
	return document.getElementById(id).value;
}

function setHTMLById(id,html){
	if(id){
		var obj = document.getElementById(id); 
		if(obj) obj.innerHTML = html;
		else var stop=1;
	}
}


function controleSaisiePaiementCptCli(form,msgPasNumeroCB,msgPasMoisCB,msgPasAnneeCB,msgPasCryptoCB,msgCarteNonValide){
	var aujourdhui = new Date();
	
	if ((isNaN(form.numero_cb.value))||(form.numero_cb.value=='')){
		alertAMalibu(msgPasNumeroCB);
		return false;
	}
	if ((isNaN(form.mois_cb.value))||(form.mois_cb.value<1)||(form.mois_cb.value>12)||((form.mois_cb.value<(aujourdhui.getMonth()+1)) && (form.annee_cb.value==aujourdhui.getFullYear()))){
		alertAMalibu(msgPasMoisCB);
		return false;
	}
	if ( (isNaN(form.annee_cb.value))||(form.annee_cb.value<aujourdhui.getFullYear())||(form.annee_cb.value>2020)){
		alertAMalibu(msgPasAnneeCB);
		return false;
	}
	if ((isNaN(form.crypto_cb.value))||(form.crypto_cb.value=='')||(form.crypto_cb.value.length!=3)){
		alertAMalibu(msgPasCryptoCB);
		return false;
	}
	verif = 0;
	numcb = form.numero_cb.value;
			
	for(i=0; i< numcb.length ; i=i+2)
	{
		nomb = numcb.substring(i, i+1) * 2;
		if(nomb > 9)
		{
			nomb = nomb - 9;
		}
		verif = verif + nomb;
	}
	
	for(i=1; i< (numcb.length +1); i=i+2)
	{
		nomb = eval(numcb.substring(i, i+1));
		verif = verif + nomb;
	}
	
	result=verif%10;
	if(result!=0)
	{
		alertAMalibu(msgCarteNonValide);
		return false;
	}
	
	form.submit();
	return true;
}
	

function jslog(txt){
	var nomDivLog="div_itea_log_javascript";
	var objLog=$(nomDivLog);
	if (!objLog){
		objLog=getNewDivToBody(nomDivLog,"logItea");
		objLog.style.position="fixed";
		objLog.style.overflow="auto";
		objLog.style.font="10px arial #000000";
		objLog.style.zIndex="100000";
		objLog.style.left="10px";
		objLog.style.top="10px";
		objLog.style.width="350px";
		objLog.style.height="180px";
		objLog.style.border="2px #000000 solid";
		objLog.style.backgroundColor="#FFFFFF";
		new Draggable($(objLog));
	}
	var content=objLog.innerHTML;
	content+="> "+txt+"<br>";
	objLog.innerHTML=content;
}


function setClassForCurr(obj,classname){
	$$("."+classname).each(function(elem){elem.removeClassName(classname);});
	$(obj).addClassName(classname);
}

function upload_addFileToList(objInptFile,ulLstFile){
	
	var e = new Element('li', {'class': 'liFileAUpload'});
	var elemNomfile=new Element('span', {'class': 'spanUploadListNomFile'}).update(objInptFile.value.split("/").pop());
	var elemForSuppr=new Element('span', {'class': 'spanUploadListSuppr'}).update("<img src=/config_v3/imgs_defaut/prop/deconnecter.gif width=10 height=10>");
	
	e.insert(elemNomfile,{postion:'bottom'});
	e.insert(elemForSuppr,{postion:'bottom'});
	$(ulLstFile).insert(e,{postion:'bottom'});
	
	elemForSuppr.observe("click",function(evt){
		objInptFile.value="";
		e.remove();
	});	
	
	//var newInpt=new Element("input",{"type":"file","value":objInptFile.value,"name":"inptUploadFile_"+getUniqueId(),"style":"display:none;","class":"inptUploadFile"});
	var newInpt=$(objInptFile).cloneNode(true);
	newInpt.name="inptUploadFile_"+getUniqueId();
	newInpt.style.display="none";
	setClassForCurr(newInpt,"inptUploadFile");
	if(navigator.userAgent.indexOf('Firefox') > -1) objInptFile.value="";
	
	$("divLst_inptsUpload").insert(newInpt);
}


function uploadGo(objForm){
	//alert('uploadGo : '+($$('.inptUploadFile').length));
	//if (!($$('li.liFileAUpload').length>=1))return;
	$(objForm).submit();
	
	$$('li.liFileAUpload').each(function(obj){obj.remove();});
	$$('input.inptUploadFile').each(function(obj){obj.remove();});
	
	
/*	$(objForm).select(".span_btUpload").each(function (obj){
		obj.update("<img src=/config_v3/rouegrise.gif> Téléchargement en cours");
	});*/
	
}

function uploadChoixFile(objForm){
	var objinptId=$(objForm).select('.inptFileUpload').last().id;
	document.getElementById(objinptId).select();
}

function ajoutMessageIE6(div){
    if(div){
        div.style.display = 'none';
        div.insert("<div id='avertissementTitre'>CONSEIL VISITEUR&nbsp;</div>\n");
        var div_croix_avertissement = new Element("div",{"id":"div_croix_avertissement"});
            var a_croix = new Element("a",{"href":"#"});
            Event.observe(a_croix,'click',function(){
                new Effect.BlindUp('div_avertissementIE6', 1);
            });
                var img = new Element("img",{"src":"/config_v3/imgs_defaut/ie6/close.png","class":"img_navigateur"});
            a_croix.insert(img);
        div_croix_avertissement.insert(a_croix);
        div.insert(div_croix_avertissement);
        div.insert("<div id='avertissementText'>vous utilisez une version obselète d’Internet Explorer. Au delà des risques de sécurité que votre ordinateur encourt, nous vous informons que notre site Internet n’est plus optimisé pour cette version. Nous vous invitons à mettre à jour au plus vite votre navigateur ou à utiliser ceux préconisées :</div>\n");
        var div_logoNavig = new Element ("div",{"id":"logoNavigateur"});
            var a_chrome = new Element("a",{"href":"http://www.google.fr/chrome","target":"_blank"});
                var img_chrome = new Element ("img",{"src":"/config_v3/imgs_defaut/ie6/chrome.jpg","class":"img_navigateur"});
            a_chrome.insert(img_chrome);
            div_logoNavig.insert(a_chrome);
            div_logoNavig.insert("&nbsp;");
            var a_firefox = new Element("a",{"href":"http://www.mozilla-europe.org/fr/firefox/","target":"_blank"});
                var img_firefox = new Element ("img",{"src":"/config_v3/imgs_defaut/ie6/ff.jpg","class":"img_navigateur"});
            a_firefox.insert(img_firefox);
            div_logoNavig.insert(a_firefox);
            div_logoNavig.insert("&nbsp;");
            var a_ie = new Element("a",{"href":"http://www.microsoft.com/france/windows/ie","target":"_blank"});
                var img_ie = new Element ("img",{"src":"/config_v3/imgs_defaut/ie6/ie.jpg","class":"img_navigateur"});
            a_ie.insert(img_ie);
            div_logoNavig.insert(a_ie);
        div.insert(div_logoNavig);
    }
}
function verifNavigateur(){
    if($('div_avertissementIE6')){
        if (getVersionIE()<7){
            ajoutMessageIE6($('div_avertissementIE6'));
            new Effect.BlindDown('div_avertissementIE6', 1);
        }
    }
}

function masquerAvertissement(){
    jslog("masque avertissement");
    new Effect.BlindUp('div_avertissementIE6', 1);
}