function ShowSubItemMenu(TDCSubItemID){
	document.getElementById(TDCSubItemID).style.visibility = "visible";
}

function HideSubItemMenu(TDCSubItemID){
	document.getElementById(TDCSubItemID).style.visibility = "hidden";
}

function VerImg(d){
	var vfile, vsrc
	vsrc = d.src;
	vfile = vsrc.substring(vsrc.lastIndexOf('/')+1, vsrc.lastIndexOf('.'));
	if (vfile != "FondoNoLamp" ){
		lyA.style.visibility = 'visible';
		IMG_A.src = d.src;

		vurl = d.src;
		vfile = vurl.substring(vurl.lastIndexOf('/')+1, vurl.lastIndexOf('.'));
		document.getElementById("txtNombre").value=vfile
	}
}

function OcultarIMG(){
	lyA.style.visibility = 'hidden';
}

function VerImg2(d){
	var vfile, vsrc
	var AnchoPantalla, AltoPantalla, AnchoImagen, AltoImagen, CambiarTamaņo, NuevoAncho, NuevoAlto
	vsrc = d.src;
	vfile = vsrc.substring(vsrc.lastIndexOf('/')+1, vsrc.lastIndexOf('.'));
	
	if (vfile != "FondoNoLamp" ){
		window.top.document.IMG_A.clearAttributes();
		window.top.document.getElementById('lyA').style.visibility = 'visible';
		window.top.document.getElementById('lyA').style.height = document.body.scrollHeight + document.body.clientHeight;
		/*lyA.style.visibility = 'visible';*/
		window.top.document.IMG_A.src = d.src;
		AnchoPantalla = window.screen.width;
		AltoPantalla = window.screen.height;
		AnchoImagen = window.top.document.IMG_A.width;
		AltoImagen = window.top.document.IMG_A.height;
		CambiarTamaņo = false;
		if (AnchoImagen > AnchoPantalla){
			CambiarTamaņo = true;
		}
		if (AltoImagen > AltoPantalla){
			CambiarTamaņo = true;
		}
		if (CambiarTamaņo == true){
			if (AnchoImagen > AltoImagen){
					NuevoAncho = AnchoImagen - (AnchoImagen - (AnchoPantalla - 300));
					NuevoAlto = AnchoImagen - (AnchoImagen - (AnchoPantalla - 300));
			}else{
					NuevoAncho = AltoImagen - (AltoImagen - (AltoPantalla  - 300));
					NuevoAlto = AltoImagen - (AltoImagen - (AltoPantalla  - 300));
			}
			window.top.document.IMG_A.width = NuevoAncho;
			window.top.document.IMG_A.height = NuevoAlto;
		}

		AnchoImagen = window.top.document.IMG_A.width;
		AltoImagen = window.top.document.IMG_A.height;
		if (CambiarTamaņo == true){
			if (AnchoImagen > AltoImagen){
					NuevoAncho = AnchoImagen - (AnchoImagen - (AnchoPantalla - 300));
					NuevoAlto = AnchoImagen - (AnchoImagen - (AnchoPantalla - 300));
			}else{
					NuevoAncho = AltoImagen - (AltoImagen - (AltoPantalla  - 300));
					NuevoAlto = AltoImagen - (AltoImagen - (AltoPantalla  - 300));
			}
			window.top.document.IMG_A.width = NuevoAncho;
			window.top.document.IMG_A.height = NuevoAlto;
		}

		vurl = d.src;
		vfile = vurl.substring(vurl.lastIndexOf('/')+1, vurl.lastIndexOf('.'));
		vfile = vfile.replace('%',' ');
		vfile = vfile.replace('%',' ');
		vfile = vfile.replace('%',' ');
		vfile = vfile.replace('%',' ');
		window.top.document.getElementById("txtNombre").value=vfile
	}
}

function VerImg3(d){
	var vfile, vsrc
	var AnchoPantalla, AltoPantalla, AnchoImagen, AltoImagen, CambiarTamaņo, NuevoAncho, NuevoAlto
	var PorcentajeAncho, PorcentajeAlto
	vsrc = d.src;
	vfile = vsrc.substring(vsrc.lastIndexOf('/')+1, vsrc.lastIndexOf('.'));
	
	if (vfile != "FondoNoLamp" ){
		window.top.document.imgContenedor.clearAttributes();
		window.top.document.imgContenedor.src = d.src;
		window.top.document.imgContenedor.style.visibility = "visible";
		AnchoPantalla = parseInt(window.top.document.getElementById("DivContenedor").style.width);
		AltoPantalla = parseInt(window.top.document.getElementById("DivContenedor").style.height);
		AnchoImagen = parseInt(window.top.document.imgContenedor.width) + 40;
		AltoImagen = parseInt(window.top.document.imgContenedor.height) + 40;
		CambiarTamaņo = false;
		if (AnchoImagen > AnchoPantalla){
			CambiarTamaņo = true;
		}
		if (AltoImagen > AltoPantalla){
			CambiarTamaņo = true;
		}
		if (CambiarTamaņo == true){
			NuevoAncho = AnchoImagen;
			NuevoAlto = AltoImagen;
			if (AnchoImagen > AnchoPantalla){
					NuevoAncho = AnchoPantalla - 40;
					PorcentajeAncho = parseInt(100 * (NuevoAncho / AnchoImagen));
					NuevoAlto = (AltoImagen / 100) * PorcentajeAncho
			}
			if (NuevoAlto > AltoPantalla) {
					NuevoAlto = AltoPantalla - 40;
					PorcentajeAlto = parseInt(100 * (NuevoAlto / AltoImagen));
					NuevoAncho = (AnchoImagen / 100) * PorcentajeAlto;
			}
			if (NuevoAncho != 0 ) {
				window.top.document.imgContenedor.width = NuevoAncho;
				window.top.document.imgContenedor.height = NuevoAlto;
			}
		}
		vurl = d.src;
		vfile = vurl.substring(vurl.lastIndexOf('/')+1, vurl.lastIndexOf('.'));
		vfile = vfile.replace('%',' ');
		vfile = vfile.replace('%',' ');
		vfile = vfile.replace('%',' ');
		vfile = vfile.replace('%',' ');
		window.top.document.getElementById("txtNombre").value=vfile
	}
}

function OcultarIMG2(){
	window.top.document.getElementById('lyA').style.visibility = 'hidden';
}
