function getPageSize() {
	        
     var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	
	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}

	return [pageWidth,pageHeight];
}

function posaOverlaypubli(dInterior) {
	if($('overPU')){
		$('overPU').show();
		//new Effect.Appear('over', { duration: 1.0, from: 0.0, to: 0.8 });
	}else{
		if (window.innerHeight){


			//navegadores basados en mozilla

			var esp = window.innerHeight;
			var hor=window.innerWidth;
			}else{

			//Navegadores basados en IExplorer, es que no tengo innerheight

			var esp = document.body.clientHeight;
			var hor=document.body.clientWidth;
			}
			
			var  marLeft=parseInt(hor)/2;
			marLeft=parseInt(marLeft)-248;
	
		
		
		
		dInterior.style.marginLeft=marLeft+"px";
		
		var arrPageSize=getPageSize();
		var objBody = $$('body')[0];
		//var over=new Element('div',{'id':'overlay2','style':'width:'+arrPageSize[0]+'px; height:'+arrPageSize[1]+'px; background-color:#000000; z-index:999; border:0px; position:absolute; top:0; left:0;','onclick':'amagaOverlay()'});
		var over=new Element('div',{'id':'overPU','style':'display:none; width:'+arrPageSize[0]+'px; height:'+arrPageSize[1]+'px; z-index:999; border:0px; position:absolute; top:0; left:0;'}).update("<div id='overlaypublimus' alt='click para cerrar' title='click para cerrar' style='background-color:black;  margin: 0px; width: 100%; height: 100%; filter: Alpha(Opacity=70); opacity: 0.5; ' onclick='amagaOverlayPU()'></div>");
		objBody.appendChild(over);
		$('overPU').appendChild(dInterior);
		
		 
		//dInterior.show();
		
		new Effect.Appear('overPU', { duration: 1.0, from: 0.0, to: 1.0 });
		new Effect.Appear(dInterior, { duration: 1.0, from: 0.0, to: 1 });
		//$('overPU').show();
	}
	
}

function amagaOverlayPU() {
	$('overPU').style.display="none";
	//new Effect.Fade('over', { duration: 0.5, from: 0.8, to: 0 });
}
