

var oPop2 = null;
var oEvt2 = null;
var oImg2 = null;

function intClosePreview2()
{
	if( oPop2 )
		oPop2.hide();
	oPop2 = null;
	oEvt2 = null;
	oImg2 = null;
}

function intOnLoadImg()
{
	if( oPop2 == null )
		return;
	var oObj2 = oPop2.document.images.item(0);
	var w = oObj2.width;
	var h = oObj2.height;
	if( w > 450  ||  h > 300 )
	{
		ratio = h / w;
		w = 450;
		h = w * ratio;
	}
	else if( h > 300 )
	{
		ratio = w / h;
		h = 300;
		w = h * ratio;
	}
	oObj2.width = w;
	oObj2.height = h;
	oImg2.attachEvent( "onmouseout", intClosePreview2 );
	oPop2.show( oEvt2.offsetWidth,oEvt2.offsetHeight/2, w,h, oEvt2 );
}


function DoFotoPreview2( filename )
{
	if( oPop2 )
		return;
	oEvt2 = window.event.toElement;

	oPop2 = window.createPopup();
	oPop2.document.body.innerHTML = "<IMG border='0' name='theImg' src=\"http://www.tantemaniper.org/public/"+filename+"\">";
	oPop2.show( 1,1,1,1 );
	oImg2 = oPop2.document.all.item("theImg");
	oImg2.attachEvent( "onload", intOnLoadImg );
}


function CloseFotoPreview2()
{
	var oObj2 = window.event.toElement;
	if( oObj2 != null  &&  oObj2 != oEvt2 )
	{
		if( oPop2 )
		{
			oPop2.hide();
			oPop2 = null;
			oImg2 = null;
		}
		oEvt2 = null;
	}
}
