<!--
function AbrirPopup(url,titulo,parametros) {
	window.open(url,titulo,parametros);
}
function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}
function getStyle(el,styleProp) {
	var x = document.getElementById(el);
	if (x.currentStyle)
		var y = x.currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	return y;
}
function aumentarFonte() {
	var increment = 1;
	var el = "Body";
	var styleProp = "font-size";
	if (navigator.appName == "Microsoft Internet Explorer" && styleProp == "font-size") {
		styleProp = "fontSize";
	}
	var result = getStyle(el,styleProp);
	var sizeOfBaseFont = result.substring(0,result.length-2);
	sizeOfBaseFont = (parseInt(sizeOfBaseFont) + parseInt(increment));
	document.getElementById(el).style.fontSize = sizeOfBaseFont+"px";
}
function diminuirFonte() {
	var increment = 1;
	var el = "Body";
	var styleProp = "font-size";
	if (navigator.appName == "Microsoft Internet Explorer" && styleProp == "font-size") {
		styleProp = "fontSize";
	}
	var result = getStyle(el,styleProp);
	var sizeOfBaseFont = result.substring(0,result.length-2);
	sizeOfBaseFont = (parseInt(sizeOfBaseFont) - parseInt(increment));
	document.getElementById(el).style.fontSize = sizeOfBaseFont+"px";
}
function tamanhoPadrao() {
	var el = "Body";
	document.getElementById(el).style.fontSize = "10px";
}
function CapaVerGaleria() {
	document.getElementById("idCategoria").value = 0;
	document.getElementById("acaoNavGalerias").value = "exibir";
	document.getElementById("FormularioDeNavegacaoGalerias").submit();
}
function CategoriaVerGaleria() {
	document.getElementById("idCategoria").value = 0;
	document.getElementById("acaoNavGalerias").value = "exibir_galeria";
	document.getElementById("FormularioDeNavegacaoGalerias").submit();
}
function ExibicaoVerGaleria() {
	document.getElementById("idCategoria").value = 0;
	document.getElementById("acaoNavGalerias").value = "exibir_galeria";
	document.getElementById("FormularioDeNavegacaoGalerias").submit();
}
function CapaVerCategoria() {
	if (document.getElementById("idCategoria").value != "0") {
		document.getElementById("acaoNavGalerias").value = "exibir_categoria";
		document.getElementById("FormularioDeNavegacaoGalerias").submit();
	} else {
		window.alert("Por favor selecione uma categoria.");
	}
}
function CategoriaVerCategoria() {
	if (document.getElementById("idCategoria").value != "0") {
	document.getElementById("acaoNavGalerias").value = "exibir";
	document.getElementById("FormularioDeNavegacaoGalerias").submit();
	} else {
		window.alert("Por favor selecione uma categoria.");
	}
}

function ExibicaoVerCategoria() {
	if (document.getElementById("idCategoria").value != "0") {
	document.getElementById("acaoNavGalerias").value = "exibir_categoria";
	document.getElementById("FormularioDeNavegacaoGalerias").submit();
	} else {
		window.alert("Por favor selecione uma categoria.");
	}
}
function ComentarFoto() {
	var emailValido = document.getElementById("Email").value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	if (emailValido) {
		var alerta = 0;
		if (document.getElementById("Nome").value=="") { alerta=1 } else {''}
		if (document.getElementById("Comentario").value=="") { alerta=1 } else {''}
		if (alerta==1) {
			window.alert("Por favor preencha todos os campos.");
		} else {
			document.getElementById("FormularioDeComentarioFoto").submit();
		}
	} else {
		window.alert("Por favor forneça um endereço de e-mail válido.");
	}
}
function VerResultadoEnquete(idWebSite) {
	window.open('/oktiva.net/'+idWebSite+'/pagOrigem/pagEnquete/acao/mostrarResultado/iframe/','','location=no,scrollbars=no,menubar=no,resizable=no,status=no,toolbar=no,width=240,height=280','');
}
function Votar() {
	window.open('','pagResultadoEnquete','location=no,scrollbars=no,menubar=no,resizable=no,status=no,toolbar=no,width=240,height=280','');
	document.getElementById("FormularioEnquete").submit();
}

function pedido(acao) {
	if (acao == "exibir") {
		document.getElementById("pagOrigemFormularioDePedido").value = "pag_ver_pedido";
	} else {
		document.getElementById("pagOrigemFormularioDePedido").value = "pag_ver_foto_galeria";
	}
	document.getElementById("acaoFormularioDePedido").value = acao;
	document.getElementById("FormularioDePedido").submit();
}

function alterar_pedido(acao,idItem) {
	if (acao == 'remover_item') {
		document.getElementById("idItemFormularioDePedido").value = idItem;
	}
	document.getElementById("acaoFormularioDePedido").value = acao;
	if (document.getElementById("acaoFormularioDePedido").value == 'enviar_pedido') {
		$alerta = 0;
		if (document.getElementById("Nome").value=="") { $alerta = 1; }
		if (document.getElementById("Email").value=="") { $alerta = 1; }
		if (document.getElementById("Telefone").value=="") { $alerta = 1; }
		if ($alerta == 1) {
			window.alert("Os campos \"Nome\", \"Email\" e \"Telefone\" devem ser preenchidos.");
		} else {
			document.getElementById("FormularioDePedido").submit(); 
		}
	} else {
		document.getElementById("FormularioDePedido").submit(); 
	}
}

var ajax;
function ajaxInit () {
	var xmlhttp ;
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (ee) {
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	}
	return xmlhttp ;
}
function carregar_imagem () {
        //Instancia o objeto xmlhttp
        ajax = ajaxInit();
        if (ajax) {
                window.document.getElementById("ContainerCaptcha").innerHTML = "Carregando a imagem de verifica&#231;&#227;o...";
                var url = "http://"+location.hostname+"/sispub/cgi-bin/retornar_imagem_captcha.fcgi?rand="+Math.random()*1000;
                ajax.open("GET", url, true);
                ajax.onreadystatechange = exibir_imagem;
                ajax.send(null);
        } else {
                alert("N&#227;o foi possivel criar o objeto xmlhttp")
        }
}

function exibir_imagem () {
        if (ajax.readyState == 4) {
                if (ajax.status == 200) {
                        var xmldocument = ajax.responseXML;
                        if (xmldocument) {
                                var src_captcha = xmldocument.getElementsByTagName('src_captcha')[0].firstChild.data;
                                var md5sum = xmldocument.getElementsByTagName('md5sum')[0].firstChild.data;
                                if (src_captcha) {
                                        //Alterando o campo hidden "md5sum"
                                        window.document.getElementById("md5sum").value = md5sum;
                                        var html = "<img src=\"http://"+location.hostname+"/"+src_captcha+"\" alt=\"Imagem de verifica&#231;&#227;o\" id=\"ImagemCaptcha\" /><input id=\"CaptchaCode\" name=\"captcha_code\" value=\"XXXX\" onfocus=\"clearDefault(this)\" type=\"text\" />";
                                        window.document.getElementById("ContainerCaptcha").innerHTML = html;
                                } else {
                                         window.document.getElementById("ContainerCaptcha").innerHTML = "Não foi possível carregar a imagem de verifica&#231;&#227;o";
                                }
                        }
                } else {
                         window.document.getElementById("ContainerCaptcha").innerHTML = "Não foi possível carregar a imagem de verifica&#231;&#227;o";
                }
        }
}

// function carregar_tags (idWebSite) {
//         //Instancia o objeto xmlhttp
//         ajax = ajaxInit();
//         if (ajax) {
//                 window.document.getElementById("ContainerTags").innerHTML = "Carregando os termos mais buscado ...";
//                 var url = "http://10.0.0.47/sispub/cgi-bin/ajax.fcgi?acao=buscar_tags&idWebSite="+idWebSite+"&rand="+Math.random()*1000;
//                 ajax.open("GET", url, true);
//                 ajax.onreadystatechange = exibir_tags;
//                 ajax.send(null);
//         } else {
//                 alert("N&#227;o foi possivel criar o objeto xmlhttp")
//         }
// }
// 
// function exibir_tags () {
//         if (ajax.readyState == 4) {
//                 if (ajax.status == 200) {
//                         var xmldocument = ajax.responseXML;
//                         if (xmldocument) {
// 				var idWebSite = xmldocument.getElementsByTagName('tags')[0].getAttribute('idWebSite');
//                                 var tags = xmldocument.getElementsByTagName('tag');
//                                 var html="", tag, nome, class;
// 				for (var i=0; i < tags.length; i++) {
// 					tag = tags[i];
// 					nome = tag.getElementsByTagName('nome')[0].firstChild.data;
// 					class = tag.getElementsByTagName('class')[0].firstChild.data
// 					html += "<a href=\"/oktiva.net/"+idWebSite+"/?pagOrigem=pagBusca&acao=buscar_notas_por_tag&tag="+nome+"\" class=\""+class+"\">"+nome+"</a>  ";
// 				}
// 				window.document.getElementById("ContainerTags").innerHTML = html;                              
//                         }
//                 } else {
//                          window.document.getElementById("ContainerTags").innerHTML = "Não foi possível carregar os termos mais buscados ...";
//                 }
//         }
// }

//-->