function RafraichirBandeau(headerFN,id) { if (parent.frames[1]) { if (parent.frames[1].document.forms[0]) { if (parent.frames[1].document.forms[0].Query_String.value != 'ReadForm&AutoFramed&img=' + headerFN + '&docID=' + id) { parent.frames[1].location.href = '/LesRochers/wwwcontent.nsf/pageTop?ReadForm&AutoFramed&img=' + headerFN + '&docID=' + id; } } } } function delDoc() { if (confirm('Souhaitez-vous supprimer le document ?')) { ID=document.forms[0].IDDoc.value; document.forms[0].strUnLoad.value=''; suite=document.forms[0].Return.value; window.location.href='/LesRochers/wwwcontent.nsf/(DeleteDoc)?OpenAgent&docID='+ID+'&return='+suite; } else { return false; } } function delAttachment(id,access) { if ((access=='Anonymous') || (0==1)) { window.open('/LesRochers/wwwcontent.nsf/frmAttachmentDel?Openform&docID=' + id , 'AttachmentDelete' , 'location=no,toolbar=no,directories=no,menubar=no,resizable=no,scrollbars=no,status=no,top=50,left=50,width=300,height=50'); } else { alert('Message E102'); return false; } } function replace(string,text,by) { // Replaces text with by in string var strLength = string.length, txtLength = text.length; if ((strLength == 0) || (txtLength == 0)) return string; var i = string.indexOf(text); if ((!i) && (text != string.substring(0,txtLength))) return string; if (i == -1) return string; var newstr = string.substring(0,i) + by; if (i+txtLength < strLength) newstr += replace(string.substring(i+txtLength,strLength),text,by); return newstr; } isLoad=0; function cacheLayer(id) { if (document.getElementById(id)) { document.getElementById(id).style.display='none'; } } function afficheLayer(id) { if (document.getElementById(id)) { document.getElementById(id).style.display='block'; } } function afficheLayer2(id) { if (document.getElementById(id)) { document.getElementById(id).style.display='inline-block'; } } function afficheSSCat(id) { if (document.getElementById(id)) { if (document.getElementById(id).style.display=='inline-block' || document.getElementById(id).style.display=='block') { cacheLayer(id); } else if (document.getElementById(id).style.display='none') { afficheLayer(id); afficheLayer2(id); } else if (document.getElementById(id).innerHTML!='') { afficheLayer(id); afficheLayer2(id); } } } function CheckUnique() { if (document.forms[0].Code.value!='') { popup = window.open('/'+document.forms[0].dbPath.value+'/frmUnique?openform&Code='+document.forms[0].Code.value+'~~'+document.forms[0].Lien_1.options[document.forms[0].Lien_1.options.selectedIndex].value+'','','height=100,width=300'); // popup = //window.open('/'+document.forms[0].dbPath.value+'/frmUnique?openform&Code='+document.forms[0].Code.value+'~~'+do//cument.forms[0].LienPrincipal.value+'','','height=100,width=300'); } return false; } function CheckUniqueKeyword() { if (document.forms[0].Code.value!='') { popup = window.open('/'+document.forms[0].dbPath.value+'/frmUnique?openform&Code='+document.forms[0].Code.value+'~~'+document.forms[0].Keyword.options[document.forms[0].Keyword.options.selectedIndex].value+'','','height=100,width=300'); } return false; } function reloadFrame(frameName, url) { if (window.top.frames[frameName]) { window.top.frames[frameName].location.href=url; } } function changeField(object,txt) { object.value=txt; } function resizeFrame(frameName) { var fs = window.top.document.getElementById(frameName); if (fs) { if (fs.cols=='0,11,1*') { n=1; } else { n=0; } switch(n) { case 0: fs.cols = '0,11,1*'; break; case 1: fs.cols = '287,11,1*'; break; } } } function loadImage(elem, baseUrl) { elem.well = new Array(); i=0; elem.well[i] = new Image(); elem.well[i].src = baseUrl; } function loadImages() { elem = new Array(); for (i=0; i<5; i++) { elem[i] = new Image(); } var dbPath = '/' + document.forms[0].dbPath.value + '/'; elem[0].src = dbPath + 'ongletAD.gif'; elem[1].src = dbPath + 'ongletA.gif'; elem[2].src = dbPath + 'ongletAbis.gif'; elem[3].src = dbPath + 'onglet.gif'; elem[4].src = dbPath + 'ongletbis.gif'; } function afficheonglet(nbonglet) { if (isLoad==0) {return false;} var nbd=0; var nbf=4; try { if (nbonglet!=0) {ContentHTML_ewin.blur();} if (nbonglet!=0) { ContentHTML_focus(); } else { ContentHTML_blur(); } } catch (e) { } for (i=nbd; i<=nbf; i++) { if (i==nbonglet) { if (document.getElementById('tab'+i)) {document.getElementById('tab'+i).style.backgroundColor='#DDDDDD';} if (i==nbf) { if (document.getElementById('tabA'+i)) {document.getElementById('tabA'+i).style.backgroundImage='url('+elem[2].src+')';} } else { if (document.getElementById('tabA'+i)) {document.getElementById('tabA'+i).style.backgroundImage='url('+elem[1].src+')';} } afficheLayer('onglet'+i); } else { if (document.getElementById('tab'+i)) {document.getElementById('tab'+i).style.backgroundColor='#EEEEEE';} if (i+1==nbonglet) { if (document.getElementById('tabA'+i)) {document.getElementById('tabA'+i).style.backgroundImage='url('+elem[0].src+')';} } else if (i==nbf) { if (document.getElementById('tabA'+i)) {document.getElementById('tabA'+i).style.backgroundImage='url('+elem[4].src+')';} } else { if (document.getElementById('tabA'+i)) {document.getElementById('tabA'+i).style.backgroundImage='url('+elem[3].src+')';} } cacheLayer('onglet'+i); } } } function changeStatut(stcode, stlib) { var f = document.forms[0]; if (validate()) { if (f.BoutonStatut.value=='1') { f.Statut.value=stcode; f.ChangementStatut.value=stlib; document.links[0].onclick(); } else { alert('Action non autorisée.'); } } } function insertDoc(onglet, type) { var f=document.forms[0]; var dbPath=f.dbPath.value; var ID=f.IDDoc.value; if (f.isNewDoc.value=='1') { alert('Veuillez préalablement enregistrer votre document.'); return false; } else { if (type==1) { f.attachmentWork.value='1'; } else { f.imagesWork.value='1'; } window.open('/'+dbPath+'/frmAttachment?Openform&RefdocID='+ID+'&onglet='+onglet+'&type='+type,'Attachment','location=no,toolbar=no,directories=no,menubar=no,resizable=no,scrollbars=no,status=no,top=50,left=50,width=750,height=160'); } } function selectTypologie(current) { var f=document.forms[0]; var dbPath=f.dbPath.value; var ID=f.IDDoc.value; // if (f.isNewDoc.value=='1') { // alert('Veuillez préalablement enregistrer votre document.'); // return false; // } else { window.open('/'+dbPath+'/frmTypologie?Openform&RefdocID='+ID+'¤t='+current,'Typologie','location=no,toolbar=no,directories=no,menubar=no,resizable=no,scrollbars=no,status=no,top=50,left=50,width=735,height=380'); // } } function CopyToClipboard() { CopiedTxt = document.forms[0].PageNum.value; alert(CopiedTxt); CopiedTxt.execCommand("Copy"); } function PasteFromClipboard() { document.Form1.txtArea.focus(); PastedText = document.Form1.txtArea.createTextRange(); PastedText.execCommand("Paste"); }