// SINOPSIS
// abre y cierra pop up con efecto
// KNOWN BUGS
// BITACORA 
// GB Creacion en base a codigo exsitente en maps_google_user_2.js que introdujo AG
// KNOWN BUGS
// GB 28-2-2008 Comentar funciones


function setOpacity( value ) 
{
	document.getElementById("styled-popup").style.opacity = value / 10;
	document.getElementById("styled-popup").style.filter = 'alpha(opacity=' + value * 10 + ')';
}

function fadeInMyPopup() 
{
	for( var i = 0 ; i <= 100 ; i++ )
		setTimeout( 'setOpacity(' + (i / 10) + ')' , 8 * i );
}

function slowlyFadeInMyPopup() 
{
	for( var i = 0 ; i <= 350 ; i++ )
	{
		setTimeout( 'setOpacity(' + (i / 35) + ')' , 8 * i );
	}
}

function fadeOutMyPopup() 
{
	for( var i = 0 ; i <= 100 ; i++ ) 
	{
		setTimeout( 'setOpacity(' + (10 - i / 10) + ')' , 8 * i );
	}

	setTimeout('closeMyPopup()', 800 );
}

function closeMyPopup() 
{
	document.getElementById("styled-popup").style.display = "none"
}

// SINOPSIS
// Cambia el contenido del pop-up con un efecto de apagado y fade-in
// Antes de cambiar el contenido, baja la opacidad a cero y despues hace un fade in.
// BITACORA
// gb 28-2-2008 Creacion
function fireMyPopup( html ) 
{
	setOpacity( 0 );
	// GB 11-2-2009 Primero cambio el HTML y despues prendo - Parece OK
	// document.getElementById("styled-popup").style.display = "block";
	document.getElementById("styled-popup-content").innerHTML = html;	
	document.getElementById("styled-popup").style.display = "block";
	fadeInMyPopup();
}

// SINOPSIS
// Idem fireMyPopUp pero mas despacio
function slowlyFireMyPopup( html ) 
{
	setOpacity( 0 );
	// GB 11-2-2009 Primero cambio el HTML y despues prendo - Parece OK
	// document.getElementById("styled-popup").style.display = "block";
	document.getElementById("styled-popup-content").innerHTML = html;	
	document.getElementById("styled-popup").style.display = "block";
	// fadeInMyPopup();
	slowlyFadeInMyPopup();
}

function AbrirPopupFueraMapa(html, windowTitle)
{
 	// fireMyPopup('infowindow.html', 'popUpExterno', 480, 320, 'no', 'no', html)
 	fireMyPopup(html, windowTitle);
}

// SINOPSIS
// Funcion generica para abrir popups
// KNOWN BUGS
// pasar a un include
// AG 27/02/2008 16:06
// GB 28-2-2008 No esta en uso
/*
function openPopUp(url, name, width, height, resizable, scrollbar,html)
{
	var screenW = Math.min(width, screen.width);
	var screenH = Math.min(height, screen.height - 80);
	var windowLeft = (screen.width - screenW)/2;
	var windowTop = (screen.height - screenH)/2;
	width     = ('undefined'==typeof width  || !width )?'':',width='+width;
	height    = ('undefined'==typeof height || !height)?'':',height='+height;
	resizable = ('undefined'==typeof resizable  || !resizable ) ? 'no' : resizable ;
	scrollbar = ('undefined'==typeof scrollbar  || !scrollbar ) ? 'no' : scrollbar ;
	var win = window.open(url, name	, 'top='+ windowTop +',left=' + windowLeft + ',toolbar=no, scrollbars='+scrollbar+', resizable='+resizable + ' ' + width + height);
}
*/

