<!--
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 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://www.oktiva.com.br"+src_captcha+"\" alt=\"Imagem de verifica&#231;&#227;o\" id=\"ImagemCaptcha\" /><input type=\"text\" id=\"CaptchaCode\" name=\"captcha_code\" value=\"XXXX\" onfocus=\"clearDefault(this)\" />";
					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";
		}
	}
}
//-->

