/**/ /**/ function js_openWindow(url,ancho,alto,nombre){ if (ancho=='') ancho=500; if (alto=='') alto=500; var left=(screen.width - ancho)/2; var top=(screen.height - alto)/2; opciones='width='+ancho+',height='+alto+',left='+left+',top='+top+',location=no,toolbar=no,status=no,menubar=no,directories=no,resizable=yes,scrollbars=yes,copyhistory=no'; window.open(url,nombre,opciones); } function js_print(url){ //Imprime la parte central del cuerpo de la pagina js_openWindow(url,500,500); } /**/ function js_download(idFichero){ document.location.href='/componentes/ficheros/download.php?idFichero=' + idFichero; } /**/ function js_zoomText(elemento, accion, fontSizeDefault, elementoPadre){ var midaDefault=80; var midaMax=130; var midaMin=50; //inicializaciones obj=document.getElementById(elemento); if (obj.style.fontSize==""){ obj.style.fontSize = fontSizeDefault + "%"; } if (elementoPadre!='null') { objPadre=window.opener.document.getElementById(elementoPadre); if (objPadre.style.fontSize==""){ objPadre.style.fontSize = fontSizeDefault + "%"; } } //valor actual del tamaño del texto actual = parseInt(obj.style.fontSize.replace(/%/g, '')); // el valor del incremento o decremento en el tamaño incremento=10; //accion sobre el texto if(accion=="RESTAURAR"){ valor=midaDefault; } else if(accion=="AUMENTAR" && actualmidaMin){ valor=actual-incremento; } obj.style.fontSize=valor+"%"; if (elementoPadre!='null') { objPadre.style.fontSize=valor+"%"; } // Actualizamos el tamaño de letra en sesión mediante ajax var url = '/componentes/font_size/actualizar.php'; var parametros = 'p_fontSize='+valor; var ajaxUpdate = new Ajax.Updater('div_updateFontSize', url, {method:'post', asynchronous:true, parameters:parametros, onComplete:function (){$('indicador_updateFontSize').style.display='none';}}); return false; } /**/ var nav4 = window.Event ? true : false; function js_acceptNum(evt) { // Nota: Backspace = 8, Enter = 13, '0' = 48, '9' = 57 var key = nav4 ? evt.which : evt.keyCode; return (key <= 13 || (key >= 48 && key <= 57)); } /**/ function showPaginacio(paginaActual,numPagines,top){ for (i=1; i<=numPagines; i++) { if ( i != paginaActual ) { vdiv = "paginacio_" + i; document.getElementById(vdiv).style.display = 'none'; } } vdiv = "paginacio_" + paginaActual; document.getElementById(vdiv).style.display = ''; shtml = ''; shtml = shtml + ""; shtml = shtml + ""; // shtml = shtml + ""; // shtml = shtml + ""; shtml = shtml + "
"; if ( paginaActual > 1 ) { anterior = paginaActual - 1; if ( top == 1 ) { shtml = shtml + "Anterior "; } else { shtml = shtml + "Anterior "; } } /// shtml = shtml + " "; for (i=1; i<=numPagines; i++) { if ( i == paginaActual ) { shtml = shtml + "" + i + ""; } else { if ( top == 1 ) { shtml = shtml + "" + i + ""; } else { shtml = shtml + "" + i + ""; } } shtml = shtml + " "; } // shtml = shtml + " "; if ( paginaActual < numPagines ) { var seguent = paginaActual; seguent ++; if ( top == 1 ) { shtml = shtml + "Següent"; } else { shtml = shtml + "Següent"; } } shtml = shtml + "
"; if ( numPagines > 1 ) { if ( document.getElementById("paginacio") != null ) { document.getElementById("paginacio").innerHTML = shtml; } if ( document.getElementById("paginacioBottom") != null ) { document.getElementById("paginacioBottom").innerHTML = shtml; } } } /**/ function showPaginacioTopBottom(paginaActual,numPagines){ divPaginacio = "paginacio_"; for (i=1; i<=numPagines; i++) { if ( i != paginaActual ) { vdiv = divPaginacio + i; document.getElementById(vdiv).style.display = 'none'; } } vdiv = divPaginacio + paginaActual; document.getElementById(vdiv).style.display = ''; // document.getElementById(vdiv).style.borderTop = '1px solid red'; // document.getElementById(vdiv).style.borderBottom = '1px solid red'; shtml = ''; // shtml = shtml + ""; // shtml = shtml + ""; setEspai = 0; for (i=1; i<=numPagines; i++) { setPagina = 0; if ( i == paginaActual ) { shtml = shtml + "" + i + ""; setPagina = 1; } else { if ( i >= 1 && i <= 2 ) { shtml = shtml + "" + i + ""; setPagina = 1; setEspai = 0; } if ( setPagina == 0 ) { if ( i==numPagines|| i==(numPagines-1)) { shtml = shtml + "" + i + ""; setPagina = 1; setEspai = 0; } } if ( setPagina == 0 ) { if ( ( paginaActual-i ) > 0 && ( paginaActual-i ) <= 3 ) { shtml = shtml + "" + i + ""; setPagina = 1; setEspai = 0; } } if ( setPagina == 0 ) { if ( ( i-paginaActual ) > 0 && ( i-paginaActual ) <= 2 ) { setPagina = 1; shtml = shtml + "" + i + ""; setEspai = 0; } } } if ( setPagina == 0 ) { if ( setEspai == 0 ) { setEspai = 1; shtml = shtml + "   "; shtml = shtml + " "; } } else { shtml = shtml + " "; } /* */ } if ( paginaActual < numPagines ) { var seguent = paginaActual; seguent ++; shtml = shtml + "Següent"; } // shtml = shtml + ""; // shtml = shtml + "
"; if ( paginaActual > 1 ) { anterior = paginaActual - 1; shtml = shtml + "Anterior "; } // shtml = shtml + " 
"; if ( numPagines > 1 ) { divTop = "paginacioTop"; document.getElementById(divTop).innerHTML = "
"+shtml+" "; divBottom = "paginacioBottom"; document.getElementById(divBottom).innerHTML = "
"+shtml+" "; } } /**/ function showPaginacioTopBottomDiv(paginaActual,numPagines,divPaginacio, divTop, divBottom){ if ( divPaginacio == null ) { divPaginacio = "paginacio_"; } for (i=1; i<=numPagines; i++) { if ( i != paginaActual ) { vdiv = divPaginacio + i; document.getElementById(vdiv).style.display = 'none'; } } vdiv = divPaginacio + paginaActual; document.getElementById(vdiv).style.display = ''; // document.getElementById(vdiv).style.borderTop = '1px solid red'; // document.getElementById(vdiv).style.borderBottom = '1px solid red'; shtml = ''; // shtml = shtml + ""; // shtml = shtml + ""; setEspai = 0; for (i=1; i<=numPagines; i++) { setPagina = 0; if ( i == paginaActual ) { shtml = shtml + "" + i + ""; setPagina = 1; } else { if ( i >= 1 && i <= 2 ) { shtml = shtml + "" + i + ""; setPagina = 1; setEspai = 0; } if ( setPagina == 0 ) { if ( i==numPagines|| i==(numPagines-1)) { shtml = shtml + "" + i + ""; setPagina = 1; setEspai = 0; } } if ( setPagina == 0 ) { if ( ( paginaActual-i ) > 0 && ( paginaActual-i ) <= 3 ) { shtml = shtml + "" + i + ""; setPagina = 1; setEspai = 0; } } if ( setPagina == 0 ) { if ( ( i-paginaActual ) > 0 && ( i-paginaActual ) <= 2 ) { setPagina = 1; shtml = shtml + "" + i + ""; setEspai = 0; } } } if ( setPagina == 0 ) { if ( setEspai == 0 ) { setEspai = 1; shtml = shtml + "   "; shtml = shtml + " "; } } else { shtml = shtml + " "; } /* */ } if ( paginaActual < numPagines ) { var seguent = paginaActual; seguent ++; shtml = shtml + "Següent"; } // shtml = shtml + ""; // shtml = shtml + "
"; if ( paginaActual > 1 ) { anterior = paginaActual - 1; shtml = shtml + "Anterior "; } // shtml = shtml + " 
"; if ( numPagines > 1 ) { if ( divTop == null ) { divTop = "paginacioTop"; } document.getElementById(divTop).innerHTML = "
"+shtml+" "; if ( divBottom == null ) { divBottom = "paginacioBottom"; } document.getElementById(divBottom).innerHTML = "
"+shtml+" "; } } /**/ function showHide(elementid){ vdiv = "div" + elementid; vimg = "img" + elementid; if (document.getElementById(vdiv).style.display == 'none') { document.getElementById(vdiv).style.display = ''; document.getElementById(vimg).src = '/pfw_files/tpl/sites/general/ico_menys.gif'; } else { document.getElementById(vdiv).style.display = 'none'; document.getElementById(vimg).src = '/pfw_files/tpl/sites/general/ico_mes.gif'; } } /**/ function showHideDiv(elementid){ vdiv = "div" + elementid; vimg = "img" + elementid; if (document.getElementById(vdiv).style.display == 'none') { document.getElementById(vdiv).style.display = ''; } else { document.getElementById(vdiv).style.display = 'none'; } } /**/ function copy_to_clipboard(s) { s = "http://www.mutuaterrassa.com" + s; if (window.clipboardData && clipboardData.setData) { window.clipboardData.setData("Text", s); } } /**/ function goUrl(sUrl) { if (sUrl != "") { window.location.href = sUrl; } }