// JavaScript Document
var ventanaEstado = 0;

function abrirVentana1(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen1").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana1()
	}
}
function abrirVentana2(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen2").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana2()
	}
}
function abrirVentana3(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen3").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana3()
	}
}
function abrirVentana4(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen4").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana4()
	}
}
function abrirVentana5(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen5").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana5()
	}
}
function abrirVentana6(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen6").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana6()
	}
}
function abrirVentana7(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen7").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana7()
	}
}
function abrirVentana8(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen8").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana8()
	}
}
function abrirVentana9(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen9").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana9()
	}
}
function abrirVentana10(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen10").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana10()
	}
}
function abrirVentana11(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen11").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana11()
	}
}
function abrirVentana12(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen12").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana12()
	}
}
function abrirVentana13(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen13").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana13()
	}
}
function abrirVentana14(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen14").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana14()
	}
}
function abrirVentana15(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen15").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana15()
	}
}
function abrirVentana16(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen16").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana16()
	}
}
function abrirVentana17(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen17").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana17()
	}
}
function abrirVentana18(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen18").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana18()
	}
}
function abrirVentana19(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen19").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana19()
	}
}
function abrirVentana20(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen20").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana20()
	}
}
function abrirVentana21(){  
	//loads popup only if it is disabled  
		if(ventanaEstado==0){
		$("#imagen21").fadeIn("slow");
		ventanaEstado = 1;  
	}else{
		cerrarVentana();
		abrirVentana21()
	}
}

function cerrarVentana(){
	
	if(ventanaEstado==1){
		$("#imagen1").fadeOut("fast");
		$("#imagen2").fadeOut("fast");
		$("#imagen3").fadeOut("fast");
		$("#imagen4").fadeOut("fast");
		$("#imagen5").fadeOut("fast");
		$("#imagen6").fadeOut("fast");
		$("#imagen7").fadeOut("fast");
		$("#imagen8").fadeOut("fast");
		$("#imagen9").fadeOut("fast");
		$("#imagen10").fadeOut("fast");
		$("#imagen11").fadeOut("fast");
		$("#imagen12").fadeOut("fast");
		$("#imagen13").fadeOut("fast");
		$("#imagen14").fadeOut("fast");
		$("#imagen15").fadeOut("fast");
		$("#imagen16").fadeOut("fast");
		$("#imagen17").fadeOut("fast");
		$("#imagen18").fadeOut("fast");
		$("#imagen19").fadeOut("fast");
		$("#imagen20").fadeOut("fast");
		$("#imagen21").fadeOut("fast");
		ventanaEstado = 0;
	}
}

$(document).ready(function(){
		
	$("#cerrar").click(function(){
		cerrarVentana();
	});
});

