
//FUNCAO EXCLUI REGISTRO
function exclui(sim_nao) {
	Msg = confirm("Deseja realmente EXCLUIR este item?")
		if (Msg !=0) 
			{ 
			location = "del_dados_ok.asp?" + sim_nao
		}
	}
//FUNCAO EXCLUI JOGO
function excluiJogo(sim_nao) {
	Msg = confirm("Deseja realmente EXCLUIR este JOGO?")
		if (Msg !=0) 
			{ 
			location = "del_dados_ok.asp?modo=excluiJogo&" + sim_nao
		}
	}
//FUNCAO PUBLICA REGISTRO
function publica (sim_nao) {
	Msg = confirm("Deseja realmente PUBLICAR este item?")
		if (Msg !=0)
			{ 
			location = "publica.asp?" + sim_nao 
		}
	}
//FUNCAO "DESPUBLICA" REGISTRO
function despublica (sim_nao) {
	Msg = confirm("Deseja RETIRAR esta informação do site?")
		if (Msg !=0)
			{ 
		location = "publica.asp?" + sim_nao 
  	}
}
//FUNCAO DELETA ARQUIVO
function remove_arquivo (sim_nao) {
	Msg = confirm("Deseja REMOVER O ARQUIVO vinculado a esta informação?")
		if (Msg !=0)
			{ 
		location = "del_dados_ok.asp?modo=removerArquivo&" + sim_nao 
		}
}
//FUNCAO AUMENTA TEXTO
var tam = 13;
function mudaFonte(tipo){
		if (tipo=="mais") {
			if(tam < 18) tam+=2;
			createCookie('fonte',tam,365);
		} else {
			if(tam > 11) tam-=2;
			createCookie('fonte',tam,365);
		}
		document.getElementById('mostratexto').style.fontSize = tam+'px';
	}
//FUNCAO IMPRIME (PÁGINA DE IMPRESSÃO)
	function imprimir() {
		window.print();
	}
//FUNCAO AUMENTA TEXTO	
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;}}}
function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
  }
  
//FUNCAO AUMENTA TEXTO	
function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
  }
//FUNCAO AUMENTA TEXTO	
function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
  }
//FUNCAO AUMENTA TEXTO	
function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
  }
window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}
window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

//FUNCAO MASKARA
function formatar(src, mask)
{
  var i = src.value.length;
  var saida = mask.substring(0,1);
  var texto = mask.substring(i)
if (texto.substring(0,1) != saida)
  {
        src.value += texto.substring(0,1);
  }
}
//FUNCAO ABRIR JANELA (NATIVA DREAMWEAVER)
	function MM_openBrWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
}
//FUNCAO ABRIR POPUP CENTRALIZADA
function AbJn(Url,NomeJanela,width,height,extras) {
    var largura = width;
    var altura = height;
    var adicionais = extras;
    var topo = (screen.height-altura)/2;
    var esquerda = (screen.width-largura)/2;
    novaJanela = window.open(''+ Url + '',''+ NomeJanela + '','width=' + largura + ',height=' + altura + ',top=' + topo + ',left=' + esquerda + ',features=' + adicionais + '');
    novaJanela.focus();
}
//FUNCAO DO MENU(ESQUERDA)
function visivel(obj){
    if (document.getElementById(obj).className == 'off') {
        document.getElementById(obj).className = 'ulmenu';
    } else if (document.getElementById(obj).className == 'ulmenu') {
        document.getElementById(obj).className = 'off';
    }
}
//FUNCAO VERIFICA DATA
function isDate(strData){
	if (strData=='') return false
	var P=strData.split("/")
	if (P.length!=3) return false
	var Day=P[0];
	var Month=P[1];
	var Year=P[2];
	
	if (Year.length!=4 && Year.length!=2) return false;
	if (Year>100 && Year <1900) return false;
	if (Year>2500) return false;
	if (Day <=0 || Day >31) return false;
	if (Month <=0 || Month >12) return false;
	if (Day==29 && Month==2) return isBissexto(Year);
	if (Day>29 && Month==2) return false
	if (Day==31){
		if(Month==1||Month==3||Month==5||Month==7||Month==8||Month==10||Month==12)
			return true
		else
			return false
	}
	if (Day >=1 && Day<31) return true
	return false
}

function isBissexto(Year){
	if ((Year % 4)==0)
		return true
	else
		return false
}
function valida_data(controle) {
	if (!isDate(controle.value)) {
	controle.value = "";
	window.alert("Data Inválida. Digite uma Data Válida");
	document.getElementById('data').focus();
	return false;
	}}
//FUNCAO ABRIR POPUP CENTRALIZADA
function AbJn(Url,NomeJanela,width,height,extras) {
    var largura = width;
    var altura = height;
    var adicionais = extras;
    var topo = (screen.height-altura)/2;
    var esquerda = (screen.width-largura)/2;
    novaJanela = window.open(''+ Url + '',''+ NomeJanela + '','width=' + largura + ',height=' + altura + ',top=' + topo + ',left=' + esquerda + ',features=' + adicionais + '');
    novaJanela.focus();
}
//FUNCAO ESCONDE CAMADA
     function camada( sId ) {
       var sDiv = document.getElementById( sId );
       if( sDiv.style.display == "none" ) {
         sDiv.style.display = "block";
       } else {
         sDiv.style.display = "none";
       }
     }
