window.onerror = null;
var alto=screen.height;
var ancho=screen.width;
var abrirnuevo = " ";
var msg = " ";
var bandera=0;
var goon=1;
var goon1=0;
var velocidad  = 0.08; //es el porcentaje del tamaño que cambiará al aumentar o reducir
var tablaWidth = 800;//Ancho máximo aceptable
var tablaHeight = 450;//Alto máximo aceptable
var realSizeWidth = 0; //Será usado para almacenar la anchura real de la imágen
var realSizeHeight = 0; //Será usado para almacenar la altura real de la imágen
var imgWidth = 0; //Será usado para almacenar la anchura cambiante de la imágen
var imgHeight = 0; //Será usado para almacenar la altura cambiante de la imágen
var topMargin = 2; //Distancia de separación de la capa y el Top de la página
var slideTime = 1200;
if (ancho<1024&&alto<768){tablaWidth = 350; tablaHeight = 290}
else if (ancho==1024&&alto==768){tablaWidth = 500; tablaHeight = 390}
else if (ancho>1024&&alto>768){tablaWidth = 700; tablaHeight = 590}
/*function layerObject(id,left)
{
        this.obj = document.all[id].style;
        this.obj.left = "10 px";
        return this.obj;
}
function layerSetup() 
{
    floatLyr = new layerObject('floatLayer', pageWidth * .5);
    window.setInterval("main()", 10)
}
function floatObject() 
{
        findHt = document.body.clientHeight;
} 
function main() 
{
    this.currentY = floatLayer.style.pixelTop;
    this.scrollTop = document.body.scrollTop;
    mainTrigger();
}
function mainTrigger() 
{
    var newTargetY = this.scrollTop + this.topMargin;
    if ( this.currentY != newTargetY ) 
    {
        if ( newTargetY != this.targetY ) 
        {
            this.targetY = newTargetY;
            floatStart();
        }
        animator();
    }
}
function floatStart() 
{
    var now = new Date();
    this.A = this.targetY - this.currentY;
    this.B = Math.PI / ( 2 * this.slideTime );
    this.C = now.getTime();
    if (Math.abs(this.A) > this.findHt) 
    {
        this.D = this.A > 0 ? this.targetY - this.findHt : this.targetY + this.findHt;
        this.A = this.A > 0 ? this.findHt : -this.findHt;
    }
    else 
    { 
        this.D = this.currentY;
    }
}
function animator() 
{
    var now = new Date();
    var newY = this.A * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D;
    newY = Math.round(newY);
    if (( this.A > 0 && newY > this.currentY ) || ( this.A < 0 && newY < this.currentY )) 
        document.all.floatLayer.style.pixelTop = newY;
}
function start() 
{
        pageWidth = document.body.clientWidth;
        pageHeight = document.body.clientHeight;
        layerSetup();
        floatObject();
}*/

var os;
if(document.layers)
 os = "n4";
else if(document.getElementById&&!document.all)
 os = "n6";
else if(document.all)
 os = "ie";
var top_pos;
var left_pos;

function scrollDetect(){
	if (navigator.appName == "Microsoft Internet Explorer")
	{
		pwidth = window.document.body.offsetWidth;
		pheight = window.document.body.offsetHeight;
		top_pos = document.body.scrollTop;
		left_pos = document.body.scrollLeft;
	}
	else{
		pwidth = window.innerWidth;
		pheight = window.innerHeight;
		top_pos = window.pageYOffset;
		left_pos = window.pageXOffset;
	}
	var dda = document.getElementById('floatLayer');
	var ddb = document.getElementById('foto');
	dda.style.top = (top_pos+15)+"px";
    //dda.style.left = (left_pos+15)+"px";  
    ddb.style.top = (top_pos+pheight-170)+"px";
    ddb.style.left = (left_pos+pwidth-150)+"px";  
}
setInterval('scrollDetect()',5);
document.onload = scrollDetect();