// JavaScript Document
//para los blindUp,  blindDown
var bloqueado = false;
function mostrar_div(div)
{
	//alert(div);
	opcion = document.getElementById(div);
		
	if (bloqueado == false) 
	{
		bloqueado = true;
		if (opcion.style.display == "none") 
		{
			Effect.BlindDown(opcion, {duration:0.5});
			window.setTimeout("desBloquear()", 550);
			opcion.style.height = "100%";
		} 
		else 
		{
			Effect.BlindUp(opcion, {duration:0.5});
			window.setTimeout("desBloquear()", 550);
			opcion.style.height = "";
		}
		
	}
}

function desBloquear()
{
	
	bloqueado = false;
}			

function cambiar_div(div1,div2) 
{
	//alert(div);
	opcion1 = document.getElementById(div1);
	opcion2 = document.getElementById(div2);
	
	mostrar_div(div1);
	
	window.setTimeout("mostrar_div('"+div2+"')", 600);
}


//ELAD usa este
var div_anterior = null;
var subdiv_anterior = null;
function verDiv(id_div)
{
	if(div_anterior != id_div) {
		sepname_div = id_div+"_sep";
		sep_div = document.getElementById(sepname_div);
		sep_div.style.display = "none";
		
		if(div_anterior!=null) {
			sepnameanterior_div = div_anterior+"_sep";
			sepanterior_div = document.getElementById(sepnameanterior_div);
			sepanterior_div.style.display = "";
		}
	}
	
	if(div_anterior==null)
	{
		mostrar_div(id_div);
	}
	else
	{
		if(div_anterior!=id_div)
			cambiar_div(id_div,div_anterior);
	}
	
	div_anterior = id_div;
	
	div1 = document.getElementById(id_div);
	div2 = document.getElementById(div_anterior);
	div1.onMouseOver = function(){
		alert("WORKING?");
	}
	
	div1.onMouseOut = function(){
		alert("WORKING?");
	}
	
	div1.onClick = function(){
		alert("WORKING?");
	}
}

function verSubDiv(id_div)
{
	if(subdiv_anterior==null)
	{
		mostrar_div(id_div);
	}
	else
	{
		if(subdiv_anterior!=id_div)
			cambiar_div(id_div,subdiv_anterior);
	}
	
	subdiv_anterior = id_div;
}

function changeColor(idA_div,clr) { //pastillas sub sub menu
	objA = document.getElementById(idA_div);
	if(objA!=null)
		objA.style.color = clr;
		
}


function changeColorBoton(id_div,idA_div,clr,idname,path) { //pastillas principales
	objA = document.getElementById(idA_div);
	if(objA!=null)
		objA.style.color = clr;
	
	obj = document.getElementById(id_div);
	obj.style.backgroundImage = "url('"+path+"skin/"+idname+".jpg')";
	obj.style.cursor = "pointer";	
}

function changeColorSubBoton(id_div,idA_div,clr) { //pastillas submenu
	
	
	obj = document.getElementById(id_div);
	obj.style.cursor = "pointer";
	
	if(clr == '#333333') {
		obj.style.backgroundColor = '';
		clrA = '#333333';
	}
	else {
		obj.style.backgroundColor = clr;	
		clrA = '#FFFFFF';
	}
	
	objA = document.getElementById(idA_div);
	objA.style.color = clrA;
}

	var video_actual='video_0';
	function ver_video(div_id)
	{
		if(video_actual==null)
		{
			document.getElementById(div_id).style.display='';
		}
		else
		{
			document.getElementById(video_actual).style.display='none';
			document.getElementById(div_id).style.display='';
		}
		video_actual=div_id;
	}
	
	
			
function mi_replace(texto,s1,s2)
{
	return texto.split(s1).join(s2);
}