// JavaScript Document
// HOY CONFIG Declarar Variable de Panel para cada nuevo panel del menú vertical
/*var Panel0;*/
/*var Panel1;*/
var Panel2;
var Panel3;
var Panel4;
var Panel5;
var Panel6;
var Panel8;
var Panel9;




window.onload=function pulsar(){

ocultar_capas();

// HOY CONFIG Inicializar una Variable por cada nuevo panel del menú vertical

    /*Panel0 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel0", { contentIsOpen: false });*/
	/*Panel1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1", { contentIsOpen: false });*/
	/*Panel2 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel2", { contentIsOpen: false });*/
	Panel3 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel3", { contentIsOpen: false });
	/*Panel5 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel6", { contentIsOpen: false });*/
	/*Panel8 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel8", { contentIsOpen: false });*/
	// Panel = new Spry.Widget.CollapsiblePanel("CollapsiblePanel9", { contentIsOpen: false })
	
		
		
		
		
		
		MM_preloadImages('../../Documents and Settings/Usuario/Escritorio/CON VOZ/ConVoz/imagenes/botonderecha.png');
		MM_preloadImages('imagenes/botonderecha.png','../../Documents and Settings/Usuario/Escritorio/CON VOZ/ConVoz/imagenes/botonderecha.png');
		MM_preloadImages('imagenes/botonizquierdo.png');
		
    /*ENLAZAR BOTONES MENU VERTICAL CON CAPAS*/
	/*document.getElementById("opcion1").onclick=acciones;*/	
	/*document.getElementById("opcion2").onclick=acciones;*/




	document.getElementById("participan1").onclick=acciones;
	document.getElementById("participan2").onclick=acciones;
	document.getElementById("participan3").onclick=acciones;
	
	
	document.getElementById("botonsiguiente").onclick=acciones;
	document.getElementById("botonsiguiente0").onclick=acciones;
	document.getElementById("botonsiguiente1").onclick=acciones;
	document.getElementById("botonsiguiente2").onclick=acciones;
	
	document.getElementById("botonatras").onclick=acciones;
	document.getElementById("botonatras0").onclick=acciones;
	document.getElementById("botonatras1").onclick=acciones;
	document.getElementById("botonatras2").onclick=acciones;

/*HACER QUE LOS BOTONES QUE ACTUEN COMO CAPAS QUE MUESTRAN OTRA CAPA*/


	document.getElementById("CollapsiblePanel8").onclick=acciones;
	document.getElementById("CollapsiblePanel2").onclick=acciones;
	document.getElementById("CollapsiblePanel6").onclick=acciones;
	
/*ENLAZAR BOTONES DEL MENU HORIZONTAL CON CAPAS*/

	document.getElementById("quienes1").onclick=acciones;
	document.getElementById("quienes2").onclick=acciones;

	document.getElementById("vozpropia1").onclick=acciones;
	document.getElementById("vozpropia3").onclick=acciones;
	document.getElementById("vozpropia4").onclick=acciones;
	document.getElementById("vozpropia5").onclick=acciones;
	document.getElementById("vozpropia6").onclick=acciones;

	document.getElementById("participa1").onclick=acciones;
	document.getElementById("participa2").onclick=acciones;

	document.getElementById("soportes1").onclick=acciones;
	document.getElementById("soportes2").onclick=acciones;


	document.getElementById("audiovisiual1").onclick=acciones;
	document.getElementById("audiovisiual2").onclick=acciones;


	mostrar_capa("muneco");

/* CONFIG Añadir Div para el Cuerpo de la página */
//	document.getElementById("MenuObjetivo1").onclick=acciones;
}


function ea()
{
alert ("EAE222");
}


function acciones(){
	
	elemento=this;

// alert(elemento.id);

	switch(elemento.id){
		
		case "participan1":
		ocultar_capas();
		mostrar_capa("participanies");		
		break;
		
		
		case "participan2":
		ocultar_capas();
		mostrar_capa("participancolectivos");			
		break;
		
		case "participan3":
		ocultar_capas();
		mostrar_capa("particpanmarruecos");		
		break;
	
	
		
		
		/*ESTE PARTE ESTA ACTIVA AUN DE PRUBEA PARA PASAR DE UNA PAGINA A OTRA Y VOLVER*/
	
		/*FINALIZA SCRIPT*/
		
		case "CollapsiblePanel8":
		ocultar_capas();
		cierrapaneles();
		mostrar_capa("Galeria");
		break;
		
		case "CollapsiblePanel2":
		ocultar_capas();
		cierrapaneles();
		location.href="http://convozpropiamzc.wordpress.com/";
		break;
		
		case "CollapsiblePanel6":
		ocultar_capas();
		cierrapaneles();
		mostrar_capa("Documentos");
		break;
		
		/*PRUEBA MENU HORIZONTAL*/
		
		
		case "quienes1":
		ocultar_capas();
		mostrar_capa("quienesomos");
		break;
		
		case "quienes2":
		ocultar_capas();
		mostrar_capa("contacta");
		break;
	
		
		case "vozpropia1":
		ocultar_capas();
		mostrar_capa("descripcion");
		break;
	
		
		case "vozpropia3":
		ocultar_capas();
		mostrar_capa("objetivos");
		break;
		
		case "vozpropia4":
		ocultar_capas();
		mostrar_capa("metodologia");
		break;
				
		case "vozpropia5":
		ocultar_capas();
		mostrar_capa("actividades");
		break;
		
		case "vozpropia6":
		ocultar_capas();
		mostrar_capa("destinatarias");
		break;
		
		
		
		
		case "participa1":
		ocultar_capas();
		location.href="http://mzc.org.es/EducacionParaElDesarrollo/SolicitudTaller.html";
		break;
		

		
		case "participa2":
		ocultar_capas();
		mostrar_capa("partcolectivos");
		break;
		
		
		
		
		case "soportes1":
		ocultar_capas();
		mostrar_capa("guiacolectivos");
		break;
				
		case "soportes2":
		ocultar_capas();
		mostrar_capa("guiaies");
		break;
		
		
		
		
		case "audiovisiual1":
		ocultar_capas();
		mostrar_capa("video1");
		break;
				
		case "audiovisiual2":
		ocultar_capas();
		mostrar_capa("video2");
		break;
		
		
		
		
		
		
		
		
	
		case "botonsiguiente":
		ocultar_capas();
		mostrar_capa("participanies1");
		break;
		
		case "botonsiguiente0":
		ocultar_capas();
		mostrar_capa("participanies2");
		break;
		
		
		case "botonsiguiente1":
		ocultar_capas();
		mostrar_capa("participanies3");
		break;
		
		case "botonsiguiente2":
		ocultar_capas();
		mostrar_capa("participanies4");
		break;
		
		
		
		case "botonatras":
		ocultar_capas();
		mostrar_capa("participanies");
		break;

		case "botonatras0":
		ocultar_capas();
		mostrar_capa("participanies1");
		break;

		case "botonatras1":
		ocultar_capas();
		mostrar_capa("participanies2");
		break;
		
		case "botonatras2":
		ocultar_capas();
		mostrar_capa("participanies3");
		break;


/*
		case "formulario3":
		ocultar_capas();
		mostrar_capa("formulario3");
		break;
*/
		
		/*
		case "boton4":
		ocultar_capas();
		mostrar_capa("link");
		break;
		case "boton6":
		atrasFotos();
		intercambiaFotos()
		break;
		case "boton7":
		if(roll){
			pararFotos();
			elemento.style.background="url('../imagenes/botonesecundarios2.png')";
		}else{ 
		elemento.style.background="url('../imagenes/boton8.png')";
		crono2=setInterval(roll_fotos,INTERVALO_FOTOS);
		roll=true;
		}
		break;
		case "boton5":
		adelanteFotos();
		intercambiaFotos();
		break;
		default:
		alert("El boton pulsado no esta programado");
		break;*/
	}
}


function ocultar_capas()
{

//alert ("EAE");
	
	
	document.getElementById("participanies").style.visibility="hidden";
	document.getElementById("participanies1").style.visibility="hidden";
	document.getElementById("participanies2").style.visibility="hidden";
	document.getElementById("participanies3").style.visibility="hidden";
	document.getElementById("participanies4").style.visibility="hidden";
	document.getElementById("participancolectivos").style.visibility="hidden";
	document.getElementById("particpanmarruecos").style.visibility="hidden";
	
			
	document.getElementById("quienesomos").style.visibility="hidden";
	document.getElementById("contacta").style.visibility = "hidden";
	document.getElementById("muneco").style.visibility = "hidden";
	
	
	document.getElementById("descripcion").style.visibility="hidden";
	document.getElementById("objetivos").style.visibility="hidden";
	document.getElementById("metodologia").style.visibility="hidden";
	document.getElementById("actividades").style.visibility="hidden";
	document.getElementById("destinatarias").style.visibility="hidden";
	

	document.getElementById("partcolectivos").style.visibility="hidden";

	document.getElementById("guiacolectivos").style.visibility="hidden";
	document.getElementById("guiaies").style.visibility="hidden";
	
	
	
	document.getElementById("video1").style.visibility="hidden";
	document.getElementById("video2").style.visibility="hidden";
	document.getElementById("Galeria").style.visibility="hidden";
	document.getElementById("Documentos").style.visibility="hidden";
	

}


function mostrar_capa(capa)
{
//alert (capa);
document.getElementById(capa).style.visibility="visible";


	if ( capa == "participanies" )
	{

//document.getElementById("botonsiguiente").style.zIndex=100;
//alert ( document.getElementById("botonsiguiente").style.zIndex );

		/*
		document.getElementById("botonsiguiente").style.visibility="visible";
		document.getElementById("botonatras").style.visibility="visible";

		document.getElementById("botonsiguiente").style.top=200;
		document.getElementById("botonsiguiente").style.left=200;
		document.getElementById("botonsiguiente").style.width=40;
		document.getElementById("botonsiguiente").style.height=40;
	    */
	}
	else if ( capa == "actividadespropuestas1" )
	{
		/*
		document.getElementById("botonsiguiente").style.visibility="visible";
		document.getElementById("botonatras").style.visibility="visible";
		*/																																
	}
	else
	{
		/*
		document.getElementById("botonsiguiente").style.visibility="hidden";
		document.getElementById("botonatras").style.visibility="hidden";
		*/
	}

/* CONFIG Tamaño general de las Div de Contenidos. Si alguna tines posición o dimensiones distintas 
se pueden configurar aquí, p. ej. con if ( capa == "XXX" )entonces poner otras dimensiones*/

var CuerpoTop = 222;
var CuerpoLeft = 270;
var CuerpoWidth = 762;
var CuerpoHeight = 525;

	document.getElementById(capa).style.position='absolute';

	document.getElementById(capa).style.top=CuerpoTop;
	document.getElementById(capa).style.left=CuerpoLeft;
	document.getElementById(capa).style.width=CuerpoWidth;
	document.getElementById(capa).style.height=CuerpoHeight;
	
/* Atencion para que se pueda interactuar sobre la Div (Capa) su zIndex debe ser mayor que la imagen de fondo, pero menor que el menú horizontal*/
document.getElementById(capa).style.zIndex=10;

}



function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



	
/*
document.getElementById("boton2").onclick=pulsar;
document.getElementById("boton2").onmouseover=encima;
document.getElementById("boton2").onmouseout=fuera;		
*/

/*
var acordeon;


	window.onload=function(){
	acordeon=new Spry.Widget.Accordion("acordeon1",{defaultPanel: 0});
	document.getElementById("enlace").onclick=llevarpanel;
	document.getElementById("otroEnlace").onclick=segundopanel;
	}
		
		
	function llevarpanel(){
	acordeon.openFirstPanel();
	}
	function segundopanel(){
	acordeon.openNextPanel();
	}
*/
			

