
	function newImage(arg) {
		if (document.images) {
			rslt = new Image();
			rslt.src = arg;
			return rslt;
		}
	}
	
	function changeImages() {
		if (document.images && (preloadFlag == true)) {
			for (var i=0; i<changeImages.arguments.length; i+=2) {
				document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
			}
		}
	}

	var ventana;
	
	function abreVentana(ruta,ancho,alto) {
		var top=parseInt(screen.availHeight/2) - (alto/2);
		var left=parseInt(screen.availWidth/2) - (ancho/2);
		ventana=window.open(ruta,'','top='+top+',left='+left+',height='+alto+',width='+ancho+',scrollbars=no,sresizable=no,status=no,personal=no');
	}
	
	function abreNota(ruta,ancho,alto) {
		var top=parseInt(screen.availHeight/2) - (alto/2);
		var left=parseInt(screen.availWidth/2) - (ancho/2);
		ventana=window.open(ruta,'','top='+top+',left='+left+',height='+alto+',width='+ancho+',scrollbars=yes,sresizable=no,status=no,personal=no');
	}
	

	function verFoto(foto,ancho,alto){
		
		if (ventana) {ventana.close();}
		abreVentana(foto,ancho,alto);
	}
	
	function mover_derecha(combo_izquierda, combo_derecha){
		// Esta función coge el elemento seleccionado del combo de la izquierda y lo añade al combo de la derecha

		var combo_izquierda = document.getElementById(combo_izquierda);
		var combo_derecha   = document.getElementById(combo_derecha);
		var pos             = combo_izquierda.selectedIndex;
		var repetido;
		
		for (i=0;i<combo_izquierda.length;i++){
	
			if (combo_izquierda[i].selected){
				var option = new Option(combo_izquierda[i].text,combo_izquierda[i].value);
				
				for (j=0;j<combo_derecha.length;j++){
					if (combo_derecha.options[j].text==option.text) repetido=true;
				}
				if (!repetido) combo_derecha.options[combo_derecha.length]=option;
				//combo_izquierda.options[i]=null;
				//i=0;
				
			}
			repetido=false;
		}
	}

	function mover_izquierda(combo_izquierda, combo_derecha){
		// Esta función coge el elemento seleccionado del combo de la derecha y lo devuelve al combo de la izquierda
	
		var combo_izquierda = document.getElementById(combo_izquierda);
		var combo_derecha   = document.getElementById(combo_derecha);
		var pos             = combo_izquierda.selectedIndex;
	
		for (i=0;i<combo_derecha.length;i++){
			if (combo_derecha[i].selected){
				var option = new Option(combo_derecha[i].text,combo_derecha[i].value);
				combo_derecha.options[i]=null;
				i=i-1;
			}
		}
	}
	
	function mueve_arriba(){
		if (document.all&&test2.style.pixelLeft>(menuwidth-actualwidth))
		test2.style.pixelLeft-=parseInt(document.all.fotoAmp.width*0.01);
		else if (document.layers&&ns_scroll.left>(menuwidth-actualwidth))
		ns_scroll.left-=scrollspeed
		lefttime=setTimeout("moveleft()",1)
	} 

	function mueve_abajo(capa,contenedor){
		var contenedor= document.getElementById(contenedor);
		var capa= document.getElementById(capa);
		alert  (contenedor.style.height);
		alert  (capa.style.height);
		if (capa.style.pixelTop+contenedor.height<capa.style.height) capa.style.pixelTop+=3;
		//righttime=setTimeout("mueve_abajo()",1)
	}
	
	function seleccionaTodos()
	{
		var marcados=true;
		for (i=0;i<document.form.elements.length;i++)
		{
			if (document.form.elements[i].name.indexOf("chk")==0)
			{
				if (document.form.elements[i].checked==false) marcados=false;
			}
		}
		if (marcados==false)
		{
			for (i=0;i<document.form.elements.length;i++)
			{
				if (document.form.elements[i].name.indexOf("chk")==0)
				{
					document.form.elements[i].checked=true;
				}
			}
		}
		else
		{
			for (i=0;i<document.form.elements.length;i++)
			{
				if (document.form.elements[i].name.indexOf("chk")==0)
				{
					document.form.elements[i].checked=false;
				}
			}
		}
	}

