function cerrar(){
	 window.close()
}

function abrirFichero(nomFichero, titulo, w, h){

	switch(screen.width){
		case 800:
			if (w > 600){
				w = 600;
				h = 400;
			}
			break;
		case 1024:
			if (w > 800){
				w = 800;
				h = 600;
			}
			break;
		case 1280:
			if (w > 1024){
				w = 1024;
				h = 768;
			}
			break;
	}
	
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
	
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+'toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,resizable=yes'
	
	window.open(nomFichero, titulo, winprops);

//	window.open(nomFichero, 'Fichero', 'toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,resizable=yes');
}

var win=null;

function resize(){

	myleft=(screen.width)?(screen.width-580)/2:100;
	mytop=(screen.height)?(screen.height-440)/2:100;

	window.resizeTo(580,440);
	window.moveTo(mytop,myleft);
} 

function JSFX_FloatTopLeft()
{
	var startX = 10, startY = 10;
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	var d = document;
	var px = document.layers ? "" : "px";
	function ml(id)
	{
		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.right=x+px;this.style.top=y+px;};
		el.x = startX; el.y = startY;
		return el;
	}
	window.stayTopLeft=function()
	{
		var pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 40);
	}
	ftlObj = ml("cerrar");
	stayTopLeft();
}

function JSFX_FloatBottomLeft()
{
	var startX = 10, startY = 30;
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	var d = document;
	function ml(id)
	{
		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.right=x+"px";this.style.top=y+"px";};
		el.x = startX; 
		el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
		el.y -= startY;
		return el;
	}
	window.stayBottomLeft=function()
	{
		var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
		fblObj.y += (pY - startY - fblObj.y)/8;
		fblObj.sP(fblObj.x, fblObj.y);
		setTimeout("stayBottomLeft()", 40);
	}
	fblObj = ml("cerrar");
	stayBottomLeft();
}

