
function ocultarLoading(){
	setTimeout("ocultarLoadingInstant()",1);
}

function ocultarLoadingInstant(){
if (Menu_TipoLoading==0 || Menu_TipoLoading==1)
	if (document.getElementById("loading")!=null)
		document.getElementById("loading").style.visibility='hidden';
if (Menu_TipoLoading==0 || Menu_TipoLoading==2){
	if (document.getElementById("DIVloading")!=null)
		document.getElementById("DIVloading").style.display='none';
	if (document.getElementById("iframeloading")!=null)
		document.getElementById("iframeloading").style.display='none';		
}
}

function mostrarLoading(tipo){
    var de = document.documentElement;
    var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;

	if(Menu_TipoLoading!=1)	
		document.getElementById("Tableloading").style.height=h +'px';	
	if(Menu_TipoLoading==0){	
	if (document.getElementById("loading")!=null)
			document.getElementById("loading").style.visibility='visible';
	if (document.getElementById("DIVloading")!=null){
		 if(tipo!=1){
			if (document.all){
				document.getElementById("DIVloading").style.top=document.body.scrollTop; 		
				document.getElementById("DIVloading").style.height=h +'px';
			}else document.getElementById("DIVloading").style.position='fixed'; 		
		 	document.getElementById("DIVloading").style.display='block';	
		
		 	if (document.getElementById("iframeloading")!=null){
		 		if (document.all)
		 			document.getElementById("iframeloading").style.top=document.body.scrollTop;	
		 		else document.getElementById("iframeloading").style.position='fixed'; 		
				document.getElementById("iframeloading").style.display='block';		
			}
		}
	}
	
	}else{	
		if ((tipo!=1) && (document.getElementById("DIVloading")!=null)){
			if (document.all){
				document.getElementById("DIVloading").style.top=document.body.scrollTop; 		
				document.getElementById("DIVloading").style.height=h+'px';				
			}else document.getElementById("DIVloading").style.position='fixed'; 		
			document.getElementById("DIVloading").style.display='block';				
			if (document.getElementById("iframeloading")!=null){			
				if (document.all)
					document.getElementById("iframeloading").style.top=document.body.scrollTop;	
				else document.getElementById("iframeloading").style.position='fixed'; 	
				document.getElementById("iframeloading").style.display='block';	
				}
			}
		if ((tipo!=2) &&(document.getElementById("loading")!=null))
				document.getElementById("loading").style.visibility='visible';
	}
}

function mostrarLoadingTime(time,tipo){
	mostrarLoading(tipo);
	setTimeout("ocultarLoadingInstant()", time*1000);
}

function MostarLoading(){
	mostrarLoading();
}


Menu_Loading_OtherLoad = (window.onload) ? window.onload :  new Function;
  function Menu_Loading_Load(){
  	Menu_Loading_OtherLoad();
	ocultarLoadingInstant();

  }
window.onload  = function(){Menu_Loading_Load()};

