// JavaScriptDocument


// Mis funciones de creación de página
function my_onLoad()
{
	// Centrar ventana
	var screen_wide = window.screen.availWidth;
	var screen_high = window.screen.availHeight;
	var xfactor = 0.85;
	var yfactor = 0.85;
	
	var wide = xfactor * screen_wide;
	var high = yfactor * screen_high;
	
	var screenX = 0.5 * (screen_wide - wide);
	var screenY = 0.5 * (screen_high - high);

	window.resizeTo( wide , high );
	window.moveTo( screenX, screenY );
}
	
function my_onUnLoad()
{
	// Script
	window.close();
}

function open_url(URL)
{
	// Centrar ventana
	var screen_wide = window.screen.availWidth;
	var screen_high = window.screen.availHeight;
	var xfactor = 0.85;
	var yfactor = 0.85;
	
	var wide = xfactor * screen_wide;
	var high = yfactor * screen_high;
	var screenX = 0.5 * (screen_wide - wide);
	var screenY = 0.5 * (screen_high - high);
	
	var properties =
				"toolbar		= " + 0 + "," +
				"directories	= " + 0 + "," +
				"status			= " + 0 + "," +
				"menubar		= " + 0 + "," +
				"scrollbars		= " + 0 + "," +
				"resizable		= " + 0 + "," +
				"screenX		= " + screenX + "," +
				"screenY		= " + screenY + "," +
				"width			= " + wide + "," +
				"height			= " + high;

	window.open(URL,'',properties);
}

/*
* Codigo JavaScript para scrolear una capa arriba y abajo
* @Autor   Luciano Moreno  ( morenocerro2@terra.es )
*/

/*
* variables globales de asignacion de navegador
*/    
var ie=(document.all) ? 1:0;
var n4=(document.layers) ? 1:0;
var n6=(document.getElementById) ? 1:0;  
var paso=0;
var valor;
var tiempo;
var altura=-50;
var Y;
var activo=false; 
var capa="texto";
var tiempo;

/*
* funcion para inicializar valores generales en la interfaz
*/
function iniciaValores()
{
	Y=50;
	paso=0;        
	
	if(ie)
	{      
		document.all[capa].style.top=Y;
		document.all[capa].style.height=280;
		document.all[capa].style.clip="rect(0px,270px,280px,0px)"; 
	}
	else if(n4)
	{
		 document.layers[capa].top=Y;
		 document.layers[capa].height=280;
	 }
	if(n6)
	{            
		document.getElementById(capa).style.top=Y;
		document.getElementById(capa).style.height=280;
		document.getElementById(capa).style.clip="rect(0px,270px,280px,0px)";
	}
}

/*
* funcion para scrolear la capa de textos
*/
function recorta(donde)
{
	if(ie)
	{
		clearTimeout(tiempo);
		Y=parseInt(document.all[capa].style.top);
		var H=parseInt(document.all[capa].style.height);
		if((Y>altura)&&(donde==0))
		{
			activo=true;
			valor=2;     
			paso+=valor;
			document.all[capa].style.top = Y-valor;
			document.all[capa].style.height = H+valor;
			eval("document.all['"+capa+"'].style.clip='rect("+paso+",300,"+(H+valor)+",0)'");
			tiempo=setTimeout("recorta(0)",50);
		}
		else if((Y<=50) && (donde==1) && (activo==true))
		{         
			valor=-2;
			paso+=valor;
			document.all[capa].style.top = Y-valor;
			document.all[capa].style.height = H+valor;
			eval("document.all['"+capa+"'].style.clip='rect("+paso+",300,"+(H+valor)+",0)'");
			tiempo=setTimeout("recorta(1)",50);
		}
	}
	else if( n4)
	{
		Y=document.layers[capa].top;
		var H=document.layers[capa].height;
		if((Y>altura)&&(donde==0))
		{
			activo=true;
			valor=2;     
			paso+=valor;
			document.layers[capa].top = Y-valor;
			document.layers[capa].height = H+valor;
			document.layers[capa].clip.top=paso;
			document.layers[capa].clip.bottom=(H+valor);
			tiempo=setTimeout("recorta(0)",50);
		}
		else if((Y<=120)&&(donde==1) && (activo==true))
		{         
			valor=-2;
			paso+=valor;
			document.layers[capa].top = Y-valor;
			document.layers[capa].height = H+valor;
			document.layers[capa].clip.top=paso;
			document.layers[capa].clip.bottom=(H+valor);
			tiempo=setTimeout("recorta(1)",50);
		}
	}
	else if(n6)
	{
		Y=parseInt(document.getElementById(capa).style.top);
		var H=parseInt(document.getElementById(capa).style.height);
		if((Y>altura)&&(donde==0))
		{
			activo=true;
			valor=5;     
			paso+=valor;
			document.getElementById(capa).style.top = Y-valor;
			document.getElementById(capa).style.height = H+valor;
			eval("document.getElementById('"+capa+"').style.clip='rect("+paso+",300,"+(H+valor)+",0)'");
			tiempo=setTimeout("recorta(0)",50);
		}
		else if((Y<=120)&&(donde==1) && (activo==true))
		{         
			valor=-5;
			paso+=valor;
			document.getElementById(capa).style.top = Y-valor;
			document.getElementById(capa).style.height = H+valor;
			eval("document.getElementById('"+capa+"').style.clip='rect("+paso+",300,"+(H+valor)+",0)'");
			tiempo=setTimeout("recorta(1)",50);
		}
	}
}
