function mudaAno() {

	document.frm_noticias.goto.value = 'noticias';

	document.frm_noticias.submit();

}



function mudaAno2() {

	document.frm_galeria.goto.value = 'galeria';

	document.frm_galeria.submit();

}



function mudaPagina (ano, mes, pag) {

	location.href("index.php?goto=noticias&ano="+ano+"&mes="+mes+"&pagina="+pag);

}



function carregaNoticia (cod) {

	

	ajax = ajaxInit();

			

	if(ajax)

	{	

		ajax.open("GET","noticias_view.php?cod="+cod, true);

		ajax.setRequestHeader("Cache-Control","no-cache");

		ajax.onreadystatechange = function()

		{

			if(ajax.readyState == 4)

			{

				if(ajax.status == 200)

				{

					//alert(ajax.responseText);

					document.getElementById('layer_padrao').innerHTML = ajax.responseText;

					document.getElementById('layer_padrao').style.display = '';

					if(document.getElementById('ano'))

						document.getElementById('ano').style.display = 'none';

					arrangeLayer();

					//eval(ajax.responseText);

				} else	{

					alert(ajax.statusText);

				}

			}

		}

		ajax.send(null);

	}

}



function fechaLayer(){

	document.getElementById('layer_padrao').innerHTML = '';

	document.getElementById('layer_padrao').style.display = 'none';

	if(document.getElementById('ano'))

		document.getElementById('ano').style.display = '';

}



function mostraOpcoes(){

	document.getElementById('envia_amigo').style.display = '';

}



function escondeOpcoes(){

	document.getElementById('envia_amigo').style.display = 'none';

}



function enviarNoticia(){

	if(document.frm_noticias.seu_nome.value == 'seu nome' || document.frm_noticias.seu_nome.value == ''){

		alert('Preencha o campo Seu Nome.');

		document.frm_noticias.seu_nome.focus();

	} else if (document.frm_noticias.seu_email.value == 'seu email' || document.frm_noticias.seu_email.value == ''){

		alert('Preencha o campo Seu E-mail.');

		document.frm_noticias.seu_email.focus();

	} else if (document.frm_noticias.amigo_nome.value == 'nome do seu amigo' || document.frm_noticias.amigo_nome.value == ''){

		alert('Preencha o campo Nome do Seu Amigo.');

		document.frm_noticias.amigo_nome.focus();

	} else if (document.frm_noticias.amigo_email.value == 'email do seu amigo' || document.frm_noticias.amigo_email.value == ''){

		alert('Preencha o campo E-mail do Seu Amigo.');

		document.frm_noticias.amigo_email.focus();

	} else{

		document.frm_noticias.goto.value = 'noticias';

		document.getElementById('envio').value = '1';

		document.frm_noticias.submit();

	}

}



function carregaCadastro(){

	

	ajax2 = ajaxInit();

			

	if(ajax2)

	{	

		ajax2.open("GET","cadastro_informativo.php", true);

		ajax2.setRequestHeader("Cache-Control","no-cache");

		ajax2.onreadystatechange = function()

		{

			if(ajax2.readyState == 4)

			{

				if(ajax2.status == 200)

				{

					//alert(ajax2.responseText);

					document.getElementById('layer_informativo').innerHTML = ajax2.responseText;

					document.getElementById('layer_informativo').style.display = '';

					if(document.getElementById('ano'))

						document.getElementById('ano').style.display = 'none';

					//eval(ajax.responseText);

				} else	{

					alert(ajax2.statusText);

				}

			}

		}

		ajax2.send(null);

	}

}



function fechaLayerInformativo(){

	document.getElementById('layer_informativo').innerHTML = '';

	document.getElementById('layer_informativo').style.display = 'none';

	if(document.getElementById('ano'))

		document.getElementById('ano').style.display = '';

}



function enviarInformativo(destino){

	if (document.frm_noticias.informativo_nome.value == 'seu nome' || document.frm_noticias.informativo_nome.value == '') {

		alert('Preencha o campo Seu Nome.');

		document.frm_noticias.informativo_nome.focus();

	} else if (document.frm_noticias.informativo_email.value == 'seu email' || document.frm_noticias.informativo_email.value == '') {

		alert('Preencha o campo Seu E-mail.');

		document.frm_noticias.informativo_email.focus();

	} else {

		document.frm_noticias.goto.value = destino;

		document.getElementById('informativo').value = '1';

		document.frm_noticias.submit();

	}

}



function enviarContato(){

	if(document.frm_contato.seu_nome.value == 'seu nome' || document.frm_contato.seu_nome.value == ''){

		alert('Preencha o campo Seu Nome.');

		document.frm_contato.seu_nome.focus();

	} else if (document.frm_contato.seu_email.value == 'seu email' || document.frm_contato.seu_email.value == '') {

		alert('Preencha o campo Seu E-mail.');

		document.frm_contato.seu_email.focus();

	} else if (document.frm_contato.descricao.value == 'digite sua mensagem' || document.frm_contato.descricao.value == '') {

		alert('Preencha o campo da mensagem.');

		document.frm_contato.seu_email.focus();

	} else {

		document.frm_contato.goto.value = 'contato';

		document.getElementById('envio').value = '1';

		document.frm_contato.submit();

	}

}



function enviarSolicitacao(){

	if(document.frm_solicitacao.nome.value == 'seu nome' || document.frm_solicitacao.nome.value == ''){

		alert('Preencha o campo Seu Nome.');

		document.frm_solicitacao.nome.focus();

	} else if (document.frm_solicitacao.telefone.value == 'telefone' || document.frm_solicitacao.telefone.value == 'fone') {

		alert('Preencha o campo Telefone.');

		document.frm_solicitacao.telefone.focus();

	} else if (document.frm_solicitacao.empresa.value == 'empresa' || document.frm_solicitacao.empresa.value == '') {

		alert('Preencha o campo Empresa.');

		document.frm_solicitacao.empresa.focus();

	}

	  else if (document.frm_solicitacao.hora_comeco.value == '07:59' || document.frm_solicitacao.hora_comeco.value == '') {

		alert('Preencha o campo de Horário.');

		document.frm_solicitacao.hora_comeco.focus();

	}

	  else if (document.frm_solicitacao.hora_fim.value == '23:59' || document.frm_solicitacao.hora_fim.value == '') {

		alert('Preencha o campo de Horário.');

		document.frm_solicitacao.hora_fim.focus();

	}

	  else {

		document.frm_solicitacao.goto.value = 'convenios';

		document.getElementById('envio').value = '1';

		document.frm_solicitacao.submit();

	}

}



function carregaFotos (cod,ini) {

	//alert(ini);

	ajax3 = ajaxInit();

			

	if(ajax3)

	{

		document.getElementById('layer_padrao').innerHTML = '';	

		ajax3.open("GET","galeria_view.php?cod="+cod+"&regini="+ini, true);

		ajax3.setRequestHeader("Cache-Control","no-cache");

		ajax3.onreadystatechange = function()

		{

			if(ajax3.readyState == 4)

			{

				if(ajax3.status == 200)

				{

					//alert(ajax3.responseText);

					document.getElementById('layer_padrao').innerHTML = ajax3.responseText;

					document.getElementById('layer_padrao').style.display = '';

					if(document.getElementById('ano'))

						document.getElementById('ano').style.display = 'none';

					if(document.getElementById('pagina'))

						document.getElementById('pagina').style.display = 'none';

					//eval(ajax.responseText);

				} else	{

					alert(ajax3.statusText);

				}

			}

		}

		ajax3.send(null);

	}

}


function carregaFotos2 (cod) {

	//alert(ini);

	ajax3 = ajaxInit();

			

	if(ajax3)

	{

		document.getElementById('layer_padrao').innerHTML = '';	

		ajax3.open("GET",cod, true);

		ajax3.setRequestHeader("Cache-Control","no-cache");

		ajax3.onreadystatechange = function()

		{

			if(ajax3.readyState == 4)

			{

				if(ajax3.status == 200)

				{

					//alert(ajax3.responseText);

					document.getElementById('layer_padrao').innerHTML = ajax3.responseText;

					document.getElementById('layer_padrao').style.display = '';

					if(document.getElementById('ano'))

						document.getElementById('ano').style.display = 'none';

					if(document.getElementById('pagina'))

						document.getElementById('pagina').style.display = 'none';

					//eval(ajax.responseText);

				} else	{

					alert(ajax3.statusText);

				}

			}

		}

		ajax3.send(null);

	}

}



function fechaLayer2(){

	document.getElementById('layer_padrao').innerHTML = '';

	document.getElementById('layer_padrao').style.display = 'none';

	if(document.getElementById('ano'))	

		document.getElementById('ano').style.display = '';

	if(document.getElementById('pagina'))

		document.getElementById('pagina').style.display = '';

}



function carregaGrande(nome){

	document.getElementById('foto_grande').style.background = "url(scripts/upfotos/max/"+nome+")  no-repeat center center";

}