var iWidth = 0;
var iHeight = 0;
var ntimes = -1;
var maxntimes = 10;
var NS = (navigator.appName.indexOf("Explorer")>-1)?false:true

function getElement (name) {
	return (NS ? document.getElementById(name) : window.document.all(name));
}

function FitPic(tiene_pie) {
	altura_pie=(tiene_pie==true)? 30:0
	iWidth = (NS)?(window.innerWidth):document.body.clientWidth
	iHeight = (NS)?(window.innerHeight):document.body.clientHeight 

	if(document.images[0]){	
		iWidth = (document.images[0].width - iWidth)
		iHeight = (document.images[0].height - iHeight)+altura_pie
	}
	else{//es un flash
		iWidth = (getElement('fflash').width - iWidth)
		iHeight = (getElement('fflash').height - iHeight)+altura_pie
	}
	
	ntimes = maxntimes

	ResizePic()
}

function ResizePic() {
	var incx = iWidth/maxntimes
	var incy = iHeight/maxntimes
	   
	window.moveBy(-incx/2, -incy/2)
	window.resizeBy(incx, incy)
	
	ntimes--;
	   
	if (ntimes>0) {
	   window.setTimeout('ResizePic()', 20)
	}
	else {
	   self.focus()
	}
}

function cerrar() {
	window.close();
}

