﻿function switchCSS() {
if (window.screen.availWidth < 1024) {
var myLink = document.getElementsByTagName('link')[0];
if (myLink) myLink.setAttribute('href', 'CSS/Css800.css', 0);
}
else if(window.screen.availWidth > 1024){
var myLink = document.getElementsByTagName('link')[0];
if (myLink) myLink.setAttribute('href', 'CSS/Css1280.css', 0);
}
checkSize();
}
 function DetectarBloqueador()
{
    var blnBloqueado;
    var ventana = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
    if(ventana)
        blnBloqueado = false
    else
        blnBloqueado = true
    ventana.close()
    
    if(blnBloqueado == true)
    {  
          alert("Atenção!\nDesabilite o Bloqueador de Popup's e Logue-se novamente para poder visualizar os Relatórios!");
    }
    return blnBloqueado;
}

function testaBloqueador() {
    switchCSS();
   if(DetectarBloqueador()==true) {
      alert("Atenção! Desabilite o Bloqueador De Popup's para melhor desemprenho da aplicação");
  }
}

function popup(){
if (window.open('nomedapagina.html','popup','width=200,height=100,scrolling=auto,top=0,left=0')){
  window.close();
}
else
{
  alert("Atenção!\nDesabilite o Bloqueador de Popup's e Logue-se novamente para poder visualizar os Relatórios!");
}
}

var ie = /msie/i.test(navigator.userAgent); 
var ieBox = ie && (document.compatMode == null || document.compatMode == "BackCompat"); 

function checkSize() 
{ 
    if (window.screen.availWidth <= 1024) {
        var canvasEl = ieBox ? document.body : document.documentElement; 
        var w = window.innerWidth || canvasEl.clientWidth;  
        var h = window.innerHeight || canvasEl.clientHeight;
        document.getElementById("menuL").style.height = (Math.max(0, h) + 30) + "px";
        document.getElementById("menuC").style.height = (Math.max(0, h) + 30) + "px";
        document.getElementById("lateral").style.height = (Math.max(0, h) + 30) + "px";
        document.getElementById("demo_content").style.height = (Math.max(0, h) + 30) + "px"; 
    }
    else if(window.screen.availWidth > 1024)
    {
        var canvasEl = ieBox ? document.body : document.documentElement; 
        var w = window.innerWidth || canvasEl.clientWidth;  
        var h = window.innerHeight || canvasEl.clientHeight;
        document.getElementById("menuL").style.height = (Math.max(0, h) - 91) + "px";
        document.getElementById("menuC").style.height = (Math.max(0, h) - 91) + "px";
        document.getElementById("lateral").style.height = (Math.max(0, h) - 91) + "px";
        document.getElementById("demo_content").style.height = (Math.max(0, h) - 91) + "px"; 
    } 
}