function jsPrompt(Style,Title,Prompt,DefaultChoice,ChoiceList,FieldName) //Fet servir a Subformulari DadesInstP. Obre un ModalDialog. { path = location.pathname.toLowerCase(); dbpos = path.indexOf('.nsf')+4; hostURL = window.location.protocol + "//" + window.location.host; db = hostURL+"/"+path.substring(1,dbpos); if (ChoiceList) { if (Style.indexOf(":") > 0) { if (Style.indexOf("[NoSort]") < 0) { ChoiceArray = ChoiceList.split(","); ChoiceArray.sort(); ChoiceList = ChoiceArray.join(","); } Style = Style.substr(0,Style.indexOf(":")) } else { ChoiceArray = ChoiceList.split(","); ChoiceArray.sort(); ChoiceList = ChoiceArray.join(","); } } switch (Style) { case "[MostrarNiveles]": width = 23; result = window.showModalDialog( db + "/MostrarNiveles?OpenForm&Title="+Title,ChoiceList+";"+DefaultChoice,"status:no; help:no; dialogHeight:240px; dialogWidth:" + width); return result break } } function Trim(inputstringTrim) //Es fa servir a DibuixarLinks per obtindre el codi sense espais en blanc { fixedTrim = ""; lastCh = " "; for(x =0; x < inputstringTrim.length; x++) { ch = inputstringTrim.charAt(x); if ((ch != " ") || (lastCh != " ")) { fixedTrim += ch; } lastCh = ch; } if (fixedTrim.charAt(fixedTrim.length - 1) == " ") { fixedTrim = fixedTrim.substring(0, fixedTrim.length - 1); } return fixedTrim; } function DibuixaLinks_OLD(CodsW1, CodsW2, TemaW, divW, img) //Fet servir als Formularis Publicats via Web. Dibuixa els Links als Documents { var adr; var adrimg="/"+dbName+"/Link.gif?open"; var Cod=CodsW1.split(";"); var Cod2=CodsW2.split(";"); var Tema=TemaW.split(";"); var texte=""; if (Trim(Cod[0])!="") { if (Cod.length>10) {var max=10} else {var max=Cod.length} for (i=0; i   "+codi+"          "+tem+"
"; } if (Cod.length>10) {texte=texte+"      ..."} document.all[divW].innerHTML=texte; addImg(adrimg, max, img); } } function DibuixaLinks_OLD2(CodsW1, CodsW2, TemaW, divW, img) //Fet servir als Formularis Publicats via Web. Dibuixa els Links als Documents { var adr; var adrimg="/"+dbName+"/Link.gif?open"; var Cod=CodsW1.split(";"); var Cod2=CodsW2.split(";"); var Tema=TemaW.split(";"); var texte=""; var max=Cod.length if(max>0){ for (i=0; i  "+codi+"          "+tem+"
"; } else { texte= texte + "   "+codi+"          "+tem+"
"; } } } if(texte!=""){ document.all[divW].innerHTML=texte; addImgLnk(adrimg, max, img); } } } function DibuixaLinks(CodsW1, CodsW2, TemaW, divW, img){ //alert(CodsW1); //alert(CodsW2); //alert(TemaW); var adr; var adrimg="/"+dbName+"/Link.gif?open"; if(CodsW1!="") { var Cod=CodsW1.split(";"); var Cod2=CodsW2.split(";"); var Tema=TemaW.split(";"); var texte=""; var max=Cod.length if(max>0){ //Existen enlaces texte = "" for (i=0; i"; var codcode = codi; var temacode = tem; } else { var imgcode = ""; var codcode = codi; var temacode = tem; } texte = texte + ""; texte = texte + ""; texte = texte + ""; } } texte = texte + "
"+imgcode+""+codcode+""+temacode+"
" if(texte!=""){ document.all[divW].innerHTML=texte; addImgLnk(adrimg, max, img); } } } } function DibuixaLinks_IMP(CodsW1, CodsW2, TemaW, divW, img){ //alert(CodsW1); //alert(CodsW2); //alert(TemaW); var adr; var adrimg="/"+dbName+"/Link.gif?open"; if(CodsW1!="") { var Cod=CodsW1.split(";"); var Cod2=CodsW2.split(";"); var Tema=TemaW.split(";"); var texte=""; var max=Cod.length if(max>0){ //Existen enlaces texte = "" for (i=0; i"; var codcode = codi; var temacode = tem; } else { var imgcode = ""; var codcode = codi; var temacode = tem; } texte = texte + ""; texte = texte + ""; texte = texte + ""; } } texte = texte + "
"+imgcode+""+codcode+""+temacode+"
" if(texte!=""){ document.all[divW].innerHTML=texte; addImgLnk(adrimg, max, img); } } } } function DibuixaFAQLinks(CodsW1, CodsW2, TemaW, divW, img){ var adr; var adrimg="/"+dbName+"/Link.gif?open"; if(CodsW1!="") { var Cod=CodsW1.split(";"); var Cod2=CodsW2.split(";"); var Tema=TemaW.split(";"); var texte=""; var max=Cod.length if(max>0){ //Existen enlaces texte = "" for (i=0; i"; var codcode = codi; var temacode = tem; } else { var imgcode = ""; var codcode = codi; var temacode = tem; } texte = texte + ""; texte = texte + ""; texte = texte + ""; } } texte = texte + "
"+imgcode+""+temacode+"
" if(texte!=""){ document.all[divW].innerHTML=texte; addImgLnk(adrimg, max, img); } } } } function addImgLnk(adrimg,Numimag,nom) //Es posen després els src perque de la versió IE5 endavant, no carrega les imatges si no es així { for (i=0; i6) { var div = document.getElementById(ndiv); if ( div ) { var links = div.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { if (links[i].onclick == null) { links[i].onclick = function() { window.open(this.getAttribute("href"), "", "toolbar=no,top=100,left=20,height=470,width=660,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes"); return false; } } } } } }