<!--
// JavaScript Document
/*
#######################################################
###													###
###		FUNCIONES PARA EL USO DE PANTALLAS			###
###		INFORMATIVAS CON CONTENIDO AJAX				###
###		----------------------------------			###
###													###
###		Desarrolladas por Wallace Solution			###
###		www.ws.com.ve								###
###		Valerio Piselli / Rodrigo Velásquez			###
###		22/AGO/2007 - v1.0							###
###													###
###		______________________________________		###
###		En caso de necesitar información sobre		###
###		derechos, sugerencias, preguntas o 			###
###		comentearios. Escribir a: info@ws.com.ve	###
###													###
#######################################################
*/

/********************************************************/
/* CARGO LAS VARIABLES NECESARIAS Y CREO LOS EVENTOS	*/
/********************************************************/
//
// Para evitar errores, declaro la variable
var timeoutID;



/********************************************************/
/* OBTIENE LAS POSICIONES DEL CURSOR EN X y Y			*/
/********************************************************/
/* 
V1.0
NOTA: Esta funcion calcula el tamano del la ventana y devuelve
el tamano tanto en X como en Y.
*/
function ventana_calcular()
{
	if (parseInt(navigator.appVersion)>3)
	{
		if (navigator.appName=="Netscape")
		{
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1)
		{
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}
	
	return winH;
}



/********************************************************/
/* ABRE LA PANTALLA EN LA POSICION DEL PUNTERO			*/
/********************************************************/
/* 
V1.0
NOTA:
*/
function pantalla_abrir(pantalla)
{
	recursion	=	ventana_calcular();
	valor_fin	=	recursion - 135;
	
	document.getElementById(pantalla).style.overflow	=	'visible';
	document.getElementById(pantalla).style.visibility	=	'visible';
	document.getElementById(pantalla).style.left		=	'5px';
	document.getElementById(pantalla).style.top			=	recursion;
	
	//LLAMO AL PRIMER INTERVALO QUE HACE QUE APAREZCA LA VENTANIDA
	intervalMO	=	setInterval("pantalla_deslizar('"+pantalla+"')", 50);
	
}


/********************************************************/
/* CIERRA LA PANTALLA Y DETIENE EL TIMEOUT Y INTERVAL	*/
/********************************************************/
/* 
V1.0
NOTA:
*/
function pantalla_cerrar(pantalla)
{
	document.getElementById(pantalla).style.overflow	=	'hidden';
	document.getElementById(pantalla).style.visibility	=	'hidden';
	
	//DETENGO LA FUNCION QUE CORRE CADA 100 MILESIMAS DE SEGUNDO
	clearInterval(intervalID);
	clearTimeout(timeoutID);
}



/********************************************************/
/* CREA EL TIMEOUT QUE CIERRA LA PANTALLA			*/
/********************************************************/
/* 
V1.0
NOTA:
*/
function pantalla_crear_timeout(pantalla)
{
	timeoutID	=	setTimeout("pantalla_cerrar('"+pantalla+"')", 200000);
}



/********************************************************/
/* ELIMINA EL TIMEOUT QUE CIERRA LA PANTALLA			*/
/********************************************************/
/* 
V1.0
NOTA:
*/
function pantalla_eliminar_timeout()
{
	clearTimeout(timeoutID);
}



/********************************************************/
/* MUEVE LA PANTALLA CUANDO SE HACE SCROLL				*/
/********************************************************/
/* 
V1.0
NOTA:
*/
function pantalla_scroll(pantalla)
{
	if (document.body.scrollTop!=0)
		var topY	=	document.body.scrollTop;
	else
		var topY	=	document.documentElement.scrollTop;

	
	//CALCULO LA PARTE MAS BAJA DE LA VENTANA
	botY		=	ventana_calcular();
	posY		=	(topY + botY) - 138;
	var posY	=	posY+"px";

	document.getElementById(pantalla).style.top		=	posY;
}






function pantalla_deslizar(pantalla)
{
	if (recursion>=valor_fin)
	{
		recursion	=	recursion-10;
		var topY	=	recursion+"px";
		document.getElementById(pantalla).style.top		=	topY;
		//alert(topY);
	}
	else
	{
		clearInterval(intervalMO);
		
		//LLAMO A LA FUNCION QUE MUEVE EL DIV POR TODA LA PAGINA CUANDO SE HACE SCROLL
		intervalID	=	setInterval("pantalla_scroll('"+pantalla+"')", 100);
		//LLAMO A LA FUNCION QUE CREA EL TIME OUT PARA QUE LA PANTALLA SE DESAPARESCA
		pantalla_crear_timeout(pantalla);
		//LLAMO A LA FUNCION QUE CARGA EL AJAX
	}
}

/*
EJEMPLO DE UN DIV QUE USA ESTA FUNCION
--------------------------------------

<a href="javascript:void(0);" onMouseOver="pantalla_abrir('mensaje_div'); pantalla_eliminar_timeout(); cargar_contenido();" onMouseOut="pantalla_crear_timeout('mensaje_div');">
MouseOver aqui para que aparezca la pantalla
</a>

<div onMouseOver="pantalla_eliminar_timeout();" onMouseOut="pantalla_crear_timeout('mensaje_div');" id="mensaje_div">
	<div id="mensaje_contenedor">
	Donde se cargara el contenido dinamicamente con AJAX
	</div>
</div>

*/
//-->