";
}
if(ajax.readyState==4){
var temp=ajax.responseText
if (ajax.responseText!='') {
A.style.height='auto';
A.innerHTML = temp ;
el_top=parseFloat(A.style.top)
el_height=parseFloat(A.clientHeight)
if ((el_top+el_height)>parseFloat(document.body.clientHeight)) {
A.style.top=parseFloat(A.style.top)-el_height-18
}
A.style.zIndex=99
} else {
A.style.display="none"
}
}
}
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=ISO-8859-1;");
ajax.send("bs="+bus)
} else {
tancar_tot()
}
}
function creatediv_ajax(id, width, height, left, top) {
var newdiv = document.createElement('div');
newdiv.setAttribute('id', id);
if (width) { newdiv.style.width = width; }
if (height) { newdiv.style.height = height; }
if ((left || top) || (left && top)) {
newdiv.style.position = "absolute";
if (left) { newdiv.style.left = left; }
if (top) { newdiv.style.top = top; }
}
newdiv.style.display = "none";
newdiv.style.background = "#FFFFFF";
newdiv.style.border = "1px solid #7F9DB9";
document.body.appendChild(newdiv);
}
addLoadEvent(function (){
creatediv_ajax('A', '550', '32', '1', '1')
})
function normal_row_color() {
if (document.getElementById('row' + cr)) {
document.getElementById('row' + cr).bgColor="#FAFAFF";
}
}
function change_row_color() {
if (document.getElementById('row' + cr)) {
document.getElementById('row' + cr).bgColor="#C6E2FF";
document.getElementById('row' + cr).focus();
}
if (document.getElementById('el_href')){
document.getElementById('el_href').focus();
}
}
function ocultar_busqueda(){
tancar_tot()
}
function final(dato){
var resultado=document.getElementById('la_respuesta'+dato).innerHTML
objecte_retorn.value=resultado
tancar_tot()
omplir_dades()
}
function tancar_tot(){
document.onkeydown = null;
if (document.getElementById('A')) {
document.getElementById('A').style.display='none';
}
}
function KeyCheck(e) {
var keyID = (window.event) ? event.keyCode : e.keyCode;
switch(keyID) {
case 9:
{
objecte_retorn.value='';
tancar_tot();
event.returnValue = true;
}
break;
case 27:
{
objecte_retorn.value='';
tancar_tot();
event.returnValue = false;
}
break;
case 38:
// focus up
if (cr > 0) {
normal_row_color();
cr = cr - 1;
change_row_color();
event.returnValue = false;
}
break;
case 40:
// focus down
if (document.getElementById('row' + (cr+1))) {
normal_row_color();
cr = cr + 1;
change_row_color();
event.returnValue = false;
}
break;
case 13:
if ((cr<0) || !(cr)) { cr=0 }
final(cr);
event.returnValue = false;
break;
}
}
/*
XSM:
Rev. 4.0003
19-10-2011
30-06-2011: Afegit funcio "on_closewindow(div_nom)"
Quan es tenca la finestra si la pàgina que tenca de la finestra té aquest funció executa aquesta funció enlloc de tancar()
function on_closewindow(div_nom){
Cal posar la función tancar la finestra dins de on_closewindow, sinó no es tencarà la finestra
01-07-2011: S'afegeix el color com opció al "crear_div_opacogeneral"
01-07-2011: S'afegeix una nova funcion "crear_mensage(num,titulo,texto_mensage,texto_boton,accion)"
Posa una finestra d'informació o alerta
19-10-2011: S'afegeix la opció de triar el fondo en el mensage "crear_mensage(num,titulo,texto_mensage,texto_boton,accion,fondo)"
*/
var div_wait_name=''
var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
var div_es_mou=''
function getPos(inputElement) {
var coords = new Object();
coords.x = 0;
coords.y = 0;
try {
targetElement = inputElement;
if(targetElement.x && targetElement.y) {
coords.x = targetElement.x;
coords.y = targetElement.y;
} else {
if(targetElement.offsetParent) {
coords.x += targetElement.offsetLeft;
coords.y += targetElement.offsetTop;
while(targetElement = targetElement.offsetParent) {
coords.x += targetElement.offsetLeft;
coords.y += targetElement.offsetTop;
}
}
}
return coords;
} catch(error) {
return coords;
}
}
function addonresizevent() {
}
function mides(){
if (window.innerHeight && window.scrollMaxY) {// Firefox
yWithScroll = window.innerHeight + window.scrollMaxY;
xWithScroll = window.innerWidth + window.scrollMaxX;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
yWithScroll = document.body.scrollHeight;
xWithScroll = document.body.scrollWidth;
} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
yWithScroll = document.body.offsetHeight;
xWithScroll = document.body.offsetWidth;
}
return {w : xWithScroll, h : yWithScroll};;
}
function ajustar_div_opacogeneral(opaco){
if (document.getElementById('opacogeneral'+opaco)) {
var el_div = document.getElementById('opacogeneral'+opaco);
el_div.style.width=mides().w;
el_div.style.height=mides().h;
}
}
function crear_div_opacogeneral(opaco,opacitat,el_color){
var newone = document.createElement("div");
newone.id='opacogeneral'+opaco;
newone.style.display='block';
newone.style.position="absolute";
if ((el_color==undefined) || (el_color==null)) {
el_color="#000000"
}
newone.style.backgroundColor=el_color;
newone.style.top=0;
newone.style.left=0;
newone.style.width=mides().w-1;
newone.style.height=mides().h-1;
opacitat2=(parseFloat(opacitat)/100)
newone.style.opacity=opacitat2
newone.style.filter='alpha(opacity='+opacitat+')'
document.body.appendChild(newone);
window.onresize = function()
{
ajustar_div_opacogeneral(opaco);
}
}
function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function drag_drop(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById(div_es_mou).style.left=tempx+event.clientX-offsetx+"px"
document.getElementById(div_es_mou).style.top=tempy+event.clientY-offsety+"px"
} else if (ns6&&dragapproved){
document.getElementById(div_es_mou).style.left=tempx+e.clientX-offsetx+"px"
document.getElementById(div_es_mou).style.top=tempy+e.clientY-offsety+"px"
}
}
function initializedrag(e,div_nom){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
tempx=parseInt(document.getElementById(div_nom).style.left)
tempy=parseInt(document.getElementById(div_nom).style.top)
dragapproved=true
div_es_mou=div_nom
document.getElementById(div_nom).onmousemove=drag_drop;
}
function ampliar_flotant(div_nom,height){
initialheight=height
document.getElementById(div_nom).style.height=height+"px"
}
function posicionar_window(div_nom,align){
// posibilitats de align
// l --> left
// t --> top
align=align.toLowerCase();
align=align.substring(0,1);
if (align='l') {
document.getElementById(div_nom).style.left=((document.body.offsetWidth-initialwidth)/2);
}
if (align='t') {
document.getElementById(div_nom).style.top=((document.body.scrollHeight-initialheight)/2);
}
}
function auto_ajust_window(el_window){
var el_height=document.getElementById(el_window+'contentframe').contentWindow.document.body.scrollHeight
document.getElementById(el_window+'content').style.height=el_height
document.getElementById(el_window+'contentframe').style.height=el_height
}
function loadwindowfinish(auto_height){
if (document.getElementById(div_wait_name+'contentframe')){
if(document.getElementById(div_wait_name+'waitframe')){
document.getElementById(div_wait_name+'waitframe').style.display='none';
}
if (document.getElementById(div_wait_name+'contentframe').src.indexOf('/pagins/paginas/buit.asp')==-1){
if (auto_height=='S') {
auto_ajust_window(div_wait_name)
} else {
document.getElementById(div_wait_name+'contentframe').style.height=document.getElementById(div_wait_name+'content').style.height;
}
document.getElementById(div_wait_name+'contentframe').style.visibility='visible';
focus_window(div_wait_name+'contentframe')
}
}
}
function focus_window(div_name){
if (navigator.userAgent.indexOf("MSIE")!=-1) {
var box = window.frames[div_name].document;
} else {
var box = document.getElementById(div_name).contentDocument
}
if (box.getElementsByTagName("body")[0]) {
if (
(box.getElementsByTagName("body")[0].style.visibility!='hidden') &&
(box.getElementsByTagName("body")[0].style.display!='none')
) {
box.getElementsByTagName("body")[0].focus();
}
}
}
function loadwindow(div_nom,left,top,width,height,mostrar){
if (mostrar=='S') {
if (document.getElementById('opacogeneral'+div_nom)!=null) {
crear_div_opacogeneral(div_nom,'75');
bringToFront('opacogeneral'+div_nom)
} else {
crear_div_opacogeneral(div_nom,'50');
bringToFront('opacogeneral'+div_nom)
}
}
// Sustituides les variables
// initialwidth per .tag
// initialheight per .tag2
document.getElementById(div_nom).setAttribute("tag",width)
initialwidth=width
document.getElementById(div_nom).setAttribute("tag2",height)
initialheight=height
document.getElementById(div_nom).style.visibility='visible'
document.getElementById(div_nom).style.display=''
document.getElementById(div_nom).style.width=width+"px"
document.getElementById(div_nom).style.height=height+"px"
document.getElementById(div_nom+"content").style.height=initialheight-20;
document.getElementById(div_nom+"barratitul").style.width=width;
document.getElementById(div_nom+"content").style.width=width;
document.getElementById(div_nom+"waitframe").style.width=width;
document.getElementById(div_nom+"waitframe").style.height=initialheight-20;
div_wait_name=div_nom
if (left<0) {
if (left==-1) {
left=(document.body.offsetWidth-initialwidth)/2
// Genera un event de Onresize per posicionat al centre la finestra
//window.onresize = function()
//{
//posicionar_window(div_nom,'l');
//}
} else {
left=((document.body.offsetWidth-initialwidth)/2)+Math.abs(left);
}
}
document.getElementById(div_nom).style.left=left;
if (top==-1) {
if (ns6) {
top=(document.body.scrollHeight-initialheight)/2
} else {
top=(document.body.offsetHeight-initialheight)/2
}
// Genera un event de Onresize per posicionat al mig la finestra
//window.onresize = function()
//{
//posicionar_window(div_nom,'t');
//}
}
if (top<0) {
top=1;
}
document.getElementById(div_nom).style.top=top;
bringToFront(div_nom)
// guardar_apariencia(div_nom);
}
function guardar_apariencia(div_nom){
if (document.getElementById('frameacciones')!=null){
var valor
valor = div_nom +'|'
valor = valor + document.getElementById(div_nom).style.left +'|'
valor = valor + document.getElementById(div_nom).style.top +'|'
valor = valor + document.getElementById(div_nom).getAttribute('tag') +'|'
valor = valor + document.getElementById(div_nom).getAttribute('tag2') +'|'
// Sustituides les variables
// initialwidth per .tag
// initialheight per .tag2
// valor = valor + initialwidth +'|'
// valor = valor + initialheight +'|'
if (document.getElementById(div_nom).style.height!='10px'){
valor = valor + 'N|'
} else {
valor = valor + 'S|'
}
if ((document.getElementById(div_nom).style.display!='none') || (document.getElementById(div_nom).style.visibility=='visible')){
valor = valor + 'S|'
} else {
valor = valor + 'N|'
}
// document.getElementById('frameacciones').src='/includes/guardar/home.asp?v='+valor
}
}
function plegar(div_nom,el_width){
if (document.getElementById(div_nom).style.height!='10px'){
minrestore=1
document.getElementById(div_nom+"buto").setAttribute("src","/imagenes/v11/finestres/obrir.gif");
document.getElementById(div_nom+"content").style.height=1;
document.getElementById(div_nom+"content").style.visibility='hidden';
document.getElementById(div_nom).style.height=10;
if (el_width!=null){
document.getElementById(div_nom).style.width=el_width;
} else {
document.getElementById(div_nom).style.width=250;
}
} else {
minrestore=0
document.getElementById(div_nom+"buto").setAttribute("src","/imagenes/v11/finestres/tancar.gif");
document.getElementById(div_nom).style.width=document.getElementById(div_nom).getAttribute('tag');
document.getElementById(div_nom).style.height=document.getElementById(div_nom).getAttribute('tag2');
// document.getElementById(div_nom).style.width=initialwidth;
// document.getElementById(div_nom).style.height=initialheight;
document.getElementById(div_nom+"content").style.visibility='visible';
document.getElementById(div_nom+"content").style.height=initialheight-20;
}
// guardar_apariencia(div_nom);
}
function plegar_fix2(div_nom,funcio){
plegar_fix(div_nom);
eval(funcio);
}
function plegar_fix(div_nom){
if (document.getElementById(div_nom+"content").style.visibility!='hidden'){
document.getElementById(div_nom+"buto").setAttribute("src","/imagenes/v11/finestres/obrir.gif");
document.getElementById(div_nom+"content").style.height='1px';
document.getElementById(div_nom+"content").style.visibility='hidden';
// document.getElementById(div_nom).style.height=10;
} else {
document.getElementById(div_nom+"buto").setAttribute("src","/imagenes/v11/finestres/tancar.gif");
// document.getElementById(div_nom).style.height="auto";
document.getElementById(div_nom+"content").style.visibility='visible';
document.getElementById(div_nom+"content").style.height="auto";
}
// guardar_apariencia(div_nom);
// $('#cuerpo_2').jScrollPane({showArrows:true});
if (window.CSBfleXcroll) {CSBfleXcroll('cuerpo_2');}
}
function plegar_tot(div_nom){
if (document.getElementById(div_nom).style.height!='1px'){
minrestore=1
document.getElementById(div_nom+"buto").setAttribute("src","/imagenes/v11/finestres/obrir.gif");
document.getElementById(div_nom).style.height=1;
document.getElementById(div_nom).style.visibility='hidden';
} else {
minrestore=0
document.getElementById(div_nom+"buto").setAttribute("src","/imagenes/v11/finestres/tancar.gif");
document.getElementById(div_nom).style.height="auto";
document.getElementById(div_nom).style.visibility='visible';
}
// $('#cuerpo_2').jScrollPane({showArrows:true});
if (window.CSBfleXcroll) {CSBfleXcroll('cuerpo_2');}
}
function cerrar_window(div_nom){
var fet=false
if (document.getElementById(div_nom+"contentframe")) {
// if (navigator.userAgent.indexOf("MSIE")!=-1) {
// var box = window.frames[div_name].document;
// } else {
// var box = document.getElementById(div_name).contentDocument
// }
if (window.frames[div_nom+'contentframe'].on_closewindow){
window.frames[div_nom+'contentframe'].on_closewindow(div_nom)
fet=true
}
}
if (!fet){
tancar(div_nom)
}
}
function borrar_opaco(div_nom){
if (document.getElementById('opacogeneral'+div_nom)) {
document.body.removeChild(document.getElementById('opacogeneral'+div_nom));
}
}
function tancar(div_nom){
if (document.getElementById(div_nom)) {
document.getElementById(div_nom).style.visibility='hidden'
document.getElementById(div_nom).style.display='none'
if (document.getElementById(div_nom+"waitframe")) {
document.getElementById(div_nom+"waitframe").style.display='block';
}
if (document.getElementById(div_nom+"contentframe")) {
document.getElementById(div_nom+"contentframe").setAttribute('src','/datos/blanco.asp');
document.getElementById(div_nom+"contentframe").setAttribute('src',null);
}
borrar_opaco(div_nom)
// if (document.getElementById('opacogeneral2'+div_nom)) {
// document.body.removeChild(document.getElementById('opacogeneral2'+div_nom));
// } else {
// if (document.getElementById('opacogeneral'+div_nom)) {
// document.body.removeChild(document.getElementById('opacogeneral'+div_nom));
// }
// }
if (document.getElementById(div_nom)) {
document.body.removeChild(document.getElementById(div_nom));
}
if (document.getElementById('opacogeneral'+div_nom)) {
document.body.removeChild(document.getElementById('opacogeneral'+div_nom))
}
// guardar_apariencia(div_nom);
}
}
function stopdrag(div_nom){
dragapproved=false;
div_es_mou='';
document.getElementById(div_nom).onmousemove=null;
// guardar_apariencia(div_nom);
}
function getAbsoluteDivs()
{
var arr = new Array();
var all_divs = document.body.getElementsByTagName("div");
var j = 0;
for (i = 0; i < all_divs.length; i++)
if (all_divs.item(i).style.position=='absolute')
{
arr[j] = all_divs.item(i);
j++;
}
return arr;
}
function bringToFront(id)
{
if (!document.getElementById ||
!document.getElementsByTagName)
return;
var obj = document.getElementById(id);
var divs = getAbsoluteDivs();
var max_index = 0;
var cur_index;
// Compute the maximal z-index of
// other absolute-positioned divs
for (i = 0; i < divs.length; i++)
{
var item = divs[i];
if (item == obj ||
item.style.zIndex == '')
continue;
cur_index = parseInt(item.style.zIndex);
if (max_index < cur_index)
{
max_index = cur_index;
}
}
obj.style.zIndex = max_index + 1;
}
function sendToBack(id)
{
if (!document.getElementById ||
!document.getElementsByTagName)
return;
var obj = document.getElementById(id);
var divs = getAbsoluteDivs();
var min_index = 999999;
var cur_index;
if (divs.length < 2)
return;
// Compute the minimal z-index of
// other absolute-positioned divs
for (i = 0; i < divs.length; i++)
{
var item = divs[i];
if (item == obj)
continue;
if (item.style.zIndex == '')
{
min_index = 0;
break;
}
cur_index = parseInt(item.style.zIndex);
if (min_index > cur_index)
{
min_index = cur_index;
}
}
if (min_index > parseInt(obj.style.zIndex))
{
return;
}
obj.style.zIndex = 1;
if (min_index > 1)
return;
var add = min_index == 0 ? 2 : 1;
for (i = 0; i < divs.length; i++)
{
var item = divs[i];
if (item == obj)
continue;
item.style.zIndex += add;
}
}
function plegar_listado(div_nom,img){
if (document.getElementById(div_nom).style.height!='1px'){
document.getElementById(div_nom+"buto").setAttribute("src","/imagenes/v11/finestres/obertura/"+img+"_2.gif");
document.getElementById(div_nom).style.height=1;
document.getElementById(div_nom).style.display='none';
} else {
document.getElementById(div_nom+"buto").setAttribute("src","/imagenes/v11/finestres/obertura/"+img+"_1.gif");
document.getElementById(div_nom).style.height="auto";
document.getElementById(div_nom).style.display='block';
}
}
function ampliar_finestra(la_finestra,maxim){
var width_actual=parseFloat(document.getElementById(la_finestra+'contentframe').style.width)
if (width_actual| ' // el_html = el_html + '' el_html = el_html + '' el_html = el_html + ' |
| '
if (url!='') {
// el_html = el_html + ''
el_html = el_html + ''
}
if (html!='') {
el_html = el_html + ' '
el_html = el_html + html
el_html = el_html + ' '
}
el_html = el_html + ' | '
el_html = el_html + '||
![]() | '
el_html = el_html + ''
el_html = el_html + ' '
el_html = el_html + ' '
el_html = el_html + ''
el_html = el_html + ' '
el_html = el_html + '
'
el_html = el_html + ' '
el_html = el_html + '
| '
el_html = el_html + '|||||||||||