// JavaScript Document
if(navigator.userAgent.indexOf("MSIE")>=0) navegador=0; else navegador=1;

function InicializarInicio(){
	Maximizar();	
	generateCoverDiv('Bloqueador', '#49523a', 100, 0);
	CentrarDiv('TablaInicio');
}

function Maximizar(){
	try{
		window.moveTo(0,0);
		if (document.all) {
			top.window.resizeTo(screen.availWidth,screen.availHeight);
		}
		else if (document.layers||document.getElementById) {
			if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
			top.window.outerHeight = screen.availHeight;
			top.window.outerWidth = screen.availWidth;
			}
		}	
	}catch(e){}
}


function CentrarDiv(id)
{
	try{
		var element=document.getElementById(id);
		var divHeight=element.offsetHeight;
		var divWidth=element.offsetWidth;
		
		var screenHeight=document.documentElement.clientHeight;
		var screenWidth=document.documentElement.clientWidth;
		
		var scrollHeight=document.documentElement.scrollTop;
		var scrollWidth=document.documentElement.scrollLeft;
		
		var positionTop=Math.round((screenHeight/2)-(divHeight/2)+scrollHeight);
		var positionLeft=Math.round((screenWidth/2)-(divWidth/2)+scrollWidth);
		
		element.style.position='absolute';
		element.style.top=positionTop+'px';
		element.style.left=positionLeft+'px';
		element=null;
		divHeight=null;
		divWidth=null;
		screenHeight=null;
		screenWidth=null;
		scrollHeight=null;
		scrollWidth=null;
		positionTop=null;
		positionLeft=null;
	}catch(e){}
	
}

function generateCoverDiv(id, color, opacity, zIndex)
{
	var layer=document.createElement('div');
	layer.id=id;
	//layer.style.width=document.body.offsetWidth+'px';
	//layer.style.height=document.body.offsetHeight+'px';
	layer.style.width="100%";
	layer.style.height="100%";
	layer.style.backgroundColor=color;
	layer.style.position='absolute';
	layer.style.top=0;
	layer.style.left=0;
	layer.style.zIndex=zIndex;
	if(navegador==0) layer.style.filter='alpha(opacity='+opacity+')';
	else layer.style.opacity=opacity/100;
	
	document.body.appendChild(layer);
}