//Ubicar el centro de la pagina
var myWidth = 0, myHeight = 0, barrita = 0;

browsername=navigator.appName;
if (browsername.indexOf("Microsoft")!=-1){
    barrita = 4;
   } 
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
//alert("myHeight " + myHeight + "myWidth " + myWidth);

//myWidth = myWidth + barrita
var ancho_MSIE = myWidth / 2 - 512
var largo = myHeight - 550 - 74
var ancho_cerrar = 300
var largo_cerrar = 5	

document.getElementById('advertisement').style.position = "absolute" ;
document.getElementById('advertisement').style.left = ancho_MSIE + "px" ;
document.getElementById('advertisement').style.top = largo + "px" ;

document.getElementById('div_cerrar').style.position = "relative" ;
document.getElementById('div_cerrar').style.left = 915 + "px" ;
document.getElementById('div_cerrar').style.top = 215 + "px" ;



function cerrar()
{
	document.getElementById('advertisement').style.display = "none" ;
	
	}
	
	
function posicion_publi(){
var h = document.documentElement.clientHeight;
var w = document.documentElement.clientWidth;

document.getElementById('advertisement').style.left = w / 2 - 512 + "px";
//document.getElementById('advertisement').style.top = h - 550 - 100 + "px";
reposicionaMenu();
}	
	
function reposicionaMenu(){
	//IE6 in non-quirks doesnt get document.body.scrollTop:
	var pos = (document.body.scrollTop)?document.body.scrollTop:document.documentElement.scrollTop;
	var h_pantalla = document.documentElement.clientHeight;
	var h = h_pantalla - 550 - 80 ;
	document.getElementById("advertisement").style.top = parseInt(pos + h ) + "px";
	//alert(pos)
}

onload = function(){
if(document.getElementById && !window.getComputedStyle){// DOM but not Mozilla
	//document.getElementById("advertisement").style.position = "absolute";
	window.onscroll = reposicionaMenu;
	
	}
}
	
	
	
	
	
	
	
	
	
	
//alert("myHeight " + ancho_MSIE + "myWidth " + largo);
