// JavaScript Document
window.onload = function () {
  // only apply to IE
  if (!/*@cc_on!@*/0) return;

  // find every element to test
  var all = document.getElementsByTagName('*'), i = all.length;

  // fast reverse loop
  while (i--) {
    // if the scrollWidth (the real width) is greater than
    // the visible width, then apply style changes
    if (all[i].scrollWidth > all[i].offsetWidth) {
      all[i].style['paddingBottom'] = '20px';
      all[i].style['overflowY'] = 'hidden';
    }
  }
};

var div=null;
function abreCaixa(valor){div = document.getElementById(valor);if(div.style.display == 'none'){div.style.display = '';}else{div.style.display = 'none';}}
function enviarContato(){if(document.frmContato.nome.value == ''){alert('Preencha o campo NOME!');document.frmContato.nome.focus();}else if(document.frmContato.email.value == ''){alert('Preencha o campo E-MAIL!');document.frmContato.email.focus();}	else if(document.frmContato.mensagem.value == ''){alert('Preencha o campo MENSAGEM!');document.frmContato.mensagem.focus();}else{document.frmContato.submit();}}
function menuAbre(valor){div = document.getElementById(valor);div.style.display = '';}
function menuFecha(valor){div = document.getElementById(valor);div.style.display = 'none';}
function abreComposicao(valor){document.getElementById('composicao').style.display = 'none';document.getElementById('alvoImg').src = valor;}
function closeAll(valor){
    
    //document.getElementById(valor).style.display = 'none';
    /*divs=document.getElementsByTagName('ul');
    contDivs=[];
    for(var i=0;i<divs.length;i++){
        if(divs[i].className == 'subcategoriasLista'){
            divs[i].style.display='none';
        }
    }*/
}
function MCategoria(vlink,categoria){
    //var fecha = document.getEle
    //closeAll();
    var divlink = document.getElementById(vlink);
    var divcate = document.getElementById(categoria);
    if(divcate.style.display == 'none'){
        divcate.style.display='block';
    }
    else{
        divcate.style.display='none';
    }
}

function tipo(ano){
    Icombo = ano.selectedIndex
    location='agenda.php?ano='+document.agenda.ano.options[Icombo].value+'';
}

function tipo_mes(ano,mes)
{
    Icombo = ano.selectedIndex
    Icombo2 = mes.selectedIndex
    location='agenda.php?ano='+document.agenda.ano.options[Icombo].value+'&mes='+document.agenda.mes.options[Icombo2].value+'';
}
$(document).ready(function(){
    //CLIMA
    $('#clima').hide();
    $('.climaLink,.fechaClima').click(function(){
        $('#clima').show('slow');
    });
    $('.fechaClima').click(function(){
        $('#clima').hide('slow');
    });
});