// JavaScript Document

var submenuMostrado = null;

function mostrar2(capa) {
	submenuMostrado = capa;
	document.getElementById(capa).style.display = 'block';
}

function ocultar2() {
	if (submenuMostrado != null)
	{
		document.getElementById(submenuMostrado).style.display = 'none';
		submenuMostrado = null;
	}
}

function mostrar3(e, capa) {
	var targ;
	if (e.target)
  {
		targ=e.target;
  }
	else if (e.srcElement)
  {
		targ=e.srcElement;
  }
  
	if (targ.nodeType==3) // defeat Safari bug
  {
		targ = targ.parentNode;
  }

	objCapa = document.getElementById(capa);
	objCapa.style.display = 'block';
	objCapa.style.margin = '';
	var desplazamientoArriba = targ.offsetParent.offsetTop + targ.offsetParent.offsetHeight - objCapa.offsetTop - 10;
	var desplazamientoIzqda = targ.offsetParent.offsetLeft - objCapa.offsetLeft + 20;
	objCapa.style.margin = desplazamientoArriba + 'px 0px 0px ' + desplazamientoIzqda + 'px';
}

function ocultar3(capa) {
	objCapa = document.getElementById(capa);
	objCapa.style.display = 'none';
	objCapa.style.margin = '';
}


//function mostrar4(e, capa) {
//	var targ;
//	if (e.target)
//  {
//		targ=e.target;
//  }
//	else if (e.srcElement)
//  {
//		targ=e.srcElement;
//  }
//  
//	if (targ.nodeType==3) // defeat Safari bug
//  {
//		targ = targ.parentNode;
//  }

//	objCapa = document.getElementById(capa);
//	objCapa.style.display = 'block';
//	objCapa.style.margin = '';
//	var desplazamientoArriba = targ.offsetParent.offsetTop + targ.offsetParent.offsetHeight - objCapa.offsetTop + 205;
//	var desplazamientoIzqda = targ.offsetParent.offsetLeft - objCapa.offsetLeft + 400;
//	objCapa.style.margin = desplazamientoArriba + 'px 0px 0px ' + desplazamientoIzqda + 'px';
//}



//function mostrar3(e, capa) {
//	objCapa = document.getElementById(capa);
//	objCapa.style.display = 'block';
//	objCapa.style.margin = '';
//	var desplazamientoArriba = e.fromElement.offsetTop + e.fromElement.offsetHeight - objCapa.offsetTop - 10;
//	var desplazamientoIzqda = e.fromElement.offsetLeft - objCapa.offsetLeft + 20;
//	objCapa.style.margin = desplazamientoArriba + 'px 0px 0px ' + desplazamientoIzqda + 'px';
//}


function mostrar(capa) {
	document.getElementById(capa).style.display = 'block';
}

function ocultar(capa) {
	document.getElementById(capa).style.display = 'none';
}

function activo(capa) {
	document.getElementById(capa).style.background = 'url(/i/left/btn02.gif) no-repeat left top;';
}
function desactivo(capa) {
	document.getElementById(capa).style.background = 'url(/i/left/btn01.gif) no-repeat left top;';
}
function activo2(capa) {
	document.getElementById(capa).style.background = 'url(/i/left/subBtn02.gif) no-repeat top left;';
}
function desactivo2(capa) {
	document.getElementById(capa).style.background = 'url(/i/left/subBtn01.gif) no-repeat top left;';
}

function activoEventos(capa) {
	document.getElementById(capa).style.background = 'url(/i/center/eventosBasket02.gif) no-repeat 0px 0px;';
}
function desactivoEventos(capa) {
	document.getElementById(capa).style.background = 'url(/i/center/eventosBasket01.gif) no-repeat 0px 0px;';
}


function if_ToObject(id) {
	if(document.layers){
		return (document.layers[id])?eval(document.layers[id]):null;
		}
		else if(document.all && !document.getElementById){
				return (eval("window."+id))?eval("window."+id):null;
				}
				else if(document.getElementById && document.body.style) {
					return (document.getElementById(id))?eval(document.getElementById(id)):null;
					}
            }

function if_FlashWrite(string){
	document.write(string);
}

function if_FlashInnerHTML(htmlElementId,code){
	var x=if_ToObject(htmlElementId);
	if(x){
	if(document.getElementById||document.all){
		x.innerHTML='';
		x.innerHTML=code;
	}
	else if(document.layers){
		x.document.open();
		x.document.write(code);
		x.document.close();
    	}
	}
}

function MoverCapa(capaId)
{
	if (document.getElementById(capaId).style.display!='none')
	{
		Effect.BlindUp(capaId,{queue:{scope:'myscope', position:'end'}}); 
	}
	else
	{
		Effect.BlindDown(capaId,{queue:{scope:'myscope', position:'end'}})
	}
}
function photoOn(capa) {
	document.getElementById(capa).style.display = 'block';
}
function photoOff(capa) {
	document.getElementById(capa).style.display = 'none';
}
