function toggleAll(cb,inputName,formName){var val=cb.checked;var frm=document.forms[formName];var len=frm.elements.length;var i=0;for(i=0;i<len;i++){if(frm.elements[i].name==inputName){frm.elements[i].checked=val;}}}
function show_hide(laCase,leCalk)
{if(laCase.checked)
{document.getElementById(leCalk).style.visibility="visible";}
else
{document.getElementById(leCalk).style.visibility="hidden";}}
function changeStatus(divId)
{document.getElementById('editUser').className="hiddeDiv";document.getElementById('addressBook').className="hiddeDiv";document.getElementById('password').className="hiddeDiv";var e=document.getElementById(divId);if(e)
{if(e.className=="hiddeDiv"){e.className="";}else{e.className="hiddeDiv";}}}
function changeStatusOrder(divId)
{var e=document.getElementById(divId);if(e)
{if(e.className=="hiddeDiv"){e.className="";}else{e.className="hiddeDiv";}}}
function submitForm(form,action){document.forms[form].sendForm.value=action;document.forms[form].submit();}
function transfertDate(date,form,field)
{window.opener.document.forms[form].elements[field].value=date;window.close();}
function sendData(arg1){if(arg1!='')alert(arg1);}
function limite(zone,max){if(zone.value.length>=max){zone.value=zone.value.substring(0,max);}}
function ouvrirpop(page,width,height){var left=(screen.width/2)-width/2;var top=(screen.height/2)-height/2;var styleFen='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;window.open('script.inc/'+page,'Impression',styleFen);}
function newFen(larg,haut,lien){var width=larg,height=haut;var left=(screen.width/2)-width/2;var top=(screen.height/2)-height/2;var styleFen='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;window.open(lien,'',styleFen);}
function afficherResultats(obj){var tabResult=obj.responseXML.getElementsByTagName('resultat');document.getElementById('zoneResultats').innerHTML='';if(tabResult.length>0){var hauteur=tabResult.length*15;with(document.getElementById('zoneResultats').style){visibility='visible';height=hauteur+'px';};for(var i=0;i<tabResult.length;i++){resultat=tabResult.item(i);var egt=document.createElement('li');var lnk=document.createElement('a');var texte=document.createTextNode(resultat.getAttribute('libelle'));var url=null;url=resultat.getAttribute('url');if(url!=null){while(url.indexOf('@')!=-1){url=url.replace('@','&');}}
lnk.appendChild(texte);lnk.setAttribute('href',url);lnk.setAttribute('onclick',resultat.getAttribute('onclick'));lnk.setAttribute('title',resultat.getAttribute('title'));egt.appendChild(lnk);document.getElementById('zoneResultats').appendChild(egt);}}
else{document.getElementById('zoneResultats').style.visibility='hidden';}}
function loadData(){var XHR=new XHRConnection();XHR.appendData("foo",document.getElementById('foo').value);XHR.appendData("table",document.getElementById('table').value);XHR.appendData("url",document.getElementById('url').value);XHR.appendData("title",document.getElementById('title').value);XHR.appendData("param",document.getElementById('param').value);XHR.sendAndLoad("script.inc/xml.recherche.php","POST",afficherResultats);}
function afficherResultatsMember(obj){var tabResult=obj.responseXML.getElementsByTagName('resultat');document.getElementById('showMembers').innerHTML='';if(tabResult.length>0){with(document.getElementById('showMembers').style){visibility='visible';};for(var i=0;i<tabResult.length;i++){resultat=tabResult.item(i);var egt=document.createElement('li');var lnk=document.createElement('a');var nom=document.createTextNode(resultat.getAttribute('nom'));var sexe=document.createTextNode(resultat.getAttribute('sexe'));var datenaiss=document.createTextNode(resultat.getAttribute('datenaiss'));var poids=document.createTextNode(resultat.getAttribute('poids'));var tel1=document.createTextNode(resultat.getAttribute('tel1'));var tel2=document.createTextNode(resultat.getAttribute('tel2'));var tel3=document.createTextNode(resultat.getAttribute('tel3'));var url=null;url=resultat.getAttribute('url');if(url!=null){while(url.indexOf('@')!=-1){url=url.replace('@','&');}}
var ul=document.createElement('ul');var li=document.createElement('li');var img=document.createElement('img');img.setAttribute('src',resultat.getAttribute('photo'));img.style.width=resultat.getAttribute('photo_w')+'px';img.style.height=resultat.getAttribute('photo_h')+'px';li.appendChild(img);ul.appendChild(li);var li=document.createElement('li');li.appendChild(nom);ul.appendChild(li);var li=document.createElement('li');li.appendChild(datenaiss);ul.appendChild(li);var li=document.createElement('li');li.appendChild(poids);ul.appendChild(li);var li=document.createElement('li');li.appendChild(tel1);if(resultat.getAttribute('tel1_private')=='1')
{li.style.color='red';}
ul.appendChild(li);var li=document.createElement('li');li.appendChild(tel2);if(resultat.getAttribute('tel2_private')=='1')
{li.style.color='red';}
ul.appendChild(li);lnk.appendChild(ul);lnk.setAttribute('href',url);lnk.setAttribute('onclick',resultat.getAttribute('onclick'));lnk.setAttribute('title',resultat.getAttribute('title'));egt.appendChild(lnk);document.getElementById('showMembers').appendChild(egt);}}
else{document.getElementById('showMembers').style.visibility='hidden';}}
function loadDataMember(){var XHR=new XHRConnection();XHR.appendData("foo",document.getElementById('foo').value);XHR.appendData("url",document.getElementById('url').value);XHR.appendData("title",document.getElementById('title').value);XHR.appendData("param",document.getElementById('param').value);XHR.sendAndLoad("script.inc/xml.recherche.member.php","POST",afficherResultatsMember);}
function DivStatus(nom,numero)
{var divID=nom+numero;if(document.getElementById&&document.getElementById(divID))
{Pdiv=document.getElementById(divID);PcH=true;}
else if(document.all&&document.all[divID])
{Pdiv=document.all[divID];PcH=true;}
else if(document.layers&&document.layers[divID])
{Pdiv=document.layers[divID];PcH=true;}
else
{PcH=false;}
if(PcH)
{Pdiv.className=(Pdiv.className=='cachediv')?'':'cachediv';}}
function highlight(e,o)
{if(o)
e.className='rowHover';else
e.className='row';}
function showMenuItem(item)
{var subMenu=new Array();subMenu=document.getElementsByName('subMenu');for(i=0;i<subMenu.length;i++)
{subMenu[i].style.display='none';subMenu[i].style.visibility='hidden';}
var e=document.getElementById(item);if(e){e.style.display='block';e.style.visibility='visible';}}
function hideMenuItem(item)
{var e=document.getElementById(item);if(e){e.style.display='none';}}
function checkitem(item)
{var e=document.getElementById(item);if(e.style.display=='block'){e.style.display='none';e.style.visibility='hidden';}
else{e.style.display='block';e.style.visibility='visible';}}
function showImg(dirMedium,dirHeight,img,imgDescription,init)
{var e=document.getElementById('zImg');if(e.lastChild)
e.removeChild(e.lastChild);if(e)
{var lnk=document.createElement('a');lnk.setAttribute("href",dirHeight+img);lnk.setAttribute("title",imgDescription);var image=document.createElement('img');image.setAttribute("src",dirMedium+img);image.setAttribute("alt",imgDescription);lnk.appendChild(image);e.appendChild(lnk);}}
function buildInputFile(items)
{if(items)
{var request=items;var e=document.getElementById('net');if(e)
{var len=e.childNodes.length;if(len>request)
{for(k=len;k>request;k--)
{var u=k-1;e.removeChild(e.childNodes[u]);}}
var diff=request-len;for(i=0;i<diff;i++)
{var para=document.createElement('p');var field=document.createElement('input');field.setAttribute('type','file');field.setAttribute('name','picture[]');field.setAttribute('value','');para.appendChild(field);e.appendChild(para);}}}}