function Inserisce_tra_Documenti(parentElnum, descDoc, insTesto, Attr_Str, descPuls, Attr_Puls, hrefPuls, SwWin) { // parentElnum 6 per inserire tra elenco documenti // parentElnum 4 documento di fdocumenti inserito in "Cosa serve" di un servizio // parentElnum 1 per siti esterni // il carattere § alla fine di descDoc elimina il link del documento o inserisce attributi al parentElnun (es id='' style='') // il carattere § in insTesto permette di inserire qualunque testo e/o html dopo il pulsante // il carattere § per primo in hrefPuls permette di inserire qualunque funzione(''); o istruzioni jscript; al posto di window.open (SwWin non usato) if (Attr_Str === undefined) {Attr_Str = "";} else {Attr_Str = " " + Attr_Str;} if (descPuls === undefined) {descPuls = "";} if (Attr_Puls === undefined) {Attr_Puls = "";} else {Attr_Puls = " " + Attr_Puls;} if (hrefPuls === undefined) {hrefPuls = "";} if (SwWin === undefined) {SwWin = "_blank";} var chrFind = String.fromCharCode(167); var swDelEl = false; var attrPar = ""; var posDel = descDoc.search(chrFind); if (posDel > 0) { swDelEl = true; if (posDel + 1 < descDoc.length) { attrPar = descDoc.substring(posDel + 1); } descDoc = descDoc.substring(0, posDel); } var fineTesto = ""; var posSepT = insTesto.search(chrFind); if (posSepT > 0) { fineTesto = insTesto.substring(posSepT + 1) insTesto = insTesto.substring(0, posSepT) } var All = document.getElementsByTagName("a"); for (var i = 0; i < All.length; i++) { var eltxt = All[i].innerHTML; var elhref = All[i].href; if ((eltxt.search(descDoc) >= 0) && (elhref.search("javascript:") < 0)) { // alert(eltxt); var preEl = All[i] for (var npar = 0; npar < parentElnum; npar++) { preEl = preEl.parentElement; } if (hrefPuls > "") {elhref = hrefPuls;} if (descPuls == "") { var creaPuls = ""; } else { var descTitle = " title = '" + elhref + "'"; if (Attr_Puls.toUpperCase().search("TITLE") >= 0) {descTitle = "";} if (elhref.substring(0, 1) == chrFind) { var creaPuls = " '; } else { var creaPuls = " '; } } if (swDelEl) { if (attrPar == "") { preEl.innerHTML = "" + insTesto + creaPuls + fineTesto + ""; // "