function add_to_lightbox (un_codi,reload_frame){	laimatge = document.getElementById ("img_" + un_codi);	if (laimatge.src.indexOf ("posar.gif") > -1){		laimatge.src = "imagenes/treure.gif";		laimatge.title = "Remove from lightbox";	} else {		laimatge.src = "imagenes/posar.gif";		laimatge.title = "Add to lightbox";	}	if (reload_frame){		codiphp.document.location = "add_image_lightbox.php?quina_imatge=" + un_codi;	}	return false;}function obre_imatge (urlimatge,codiimatge,nomimatge) {	la_url = 'pagina_imatge.php?url_imatge=' + urlimatge + "&codi_imatge=" + codiimatge + "&nom_imatge=" + nomimatge;	finestra = window.open (la_url,'AS02','width=462,height=550,scrollbars=yes,resizable=yes');	finestra.focus();}function canviarcontgeneric (dades){	dades_separat = dades.split ('|');	nomscapa = dades_separat[0];	contingut = dades_separat[1];	arraynomscapes = (typeof (nomscapa) == 'string')? new Array (nomscapa) : nomscapa;	arraycontingutcapes = (typeof (contingut) == 'string')? new Array (contingut) : contingut;	for (a = 0;a < arraynomscapes.length;a++){		if (arraynomscapes.length != arraycontingutcapes.length){			alert ('Nombre de noms i capes diferent!');			break		}		if (document.all){			onomplir = eval ('document.all.' + arraynomscapes[a]);			onomplir.innerHTML = arraycontingutcapes[a];		} else if (document.layers){			document.carretns4.document.carretns4.document.write(contingut);			document.carretns4.document.carretns4.document.close();		} else if (document.getElementById){			el = document.getElementById(arraynomscapes[a]);			if (el.innerHTML){				el.innerHTML = arraycontingutcapes[a];			} else {				rng = document.createRange();				rng.setStartBefore(el);				htmlFrag = rng.createContextualFragment(arraycontingutcapes[a]);				while (el.hasChildNodes()){					el.removeChild(el.lastChild);					el.appendChild(htmlFrag);				}			}		}	}}function canvia_url_opener (quina_url){	opener.location.href = quina_url;}
