 // update ie ---------------------------------------------------------------------------
theObjects = document.getElementsByTagName("object");
for (var i = 0; i < theObjects.length; i++) {
theObjects[i].outerHTML = theObjects[i].outerHTML;
}
// --------------------------------------------------------------------------------------


// GERAL --------------------------------------------------------------------------------
function alt(D1,D2){
  scroll(0,0);
  if (D1!="") {
  document.getElementById(D1).style.display = "none"; } // some
  if (D2!="") {
  document.getElementById(D2).style.display = ""; } } // aparece

function mostra(TIPO,QD,ARQ,TEXT) {
   scroll(50,0);
   document.getElementById('fundocinza').style.visibility = "visible";
        document.getElementById(QD).style.display = "";
        amp(TIPO,ARQ,TEXT); }

function fecha(TIPO,QD,ARQ) {
   scroll(0,0);
   document.getElementById('fundocinza').style.visibility = "hidden";
        document.getElementById(QD).style.display = "none";
        amp('#'); }

function amp(TIPO,END,TEXT){
   if (TIPO=="video") {
      document.getElementById('image').innerHTML = "<center><EMBED SRC='"+END+"' type='video/x-ms-asf-plugin' pluginspage='http://www.microsoft.com/netshow/download/player.htm' AutoStart='false' TransparentAtStart='false' ShowStatusBar='true' AnimationAtStart='false' width='400' height='300' ShowControls='1' ShowPositionControls='0'><br><font size='1' face='verdana'>"+TEXT+"</font><br><br></center>"; }
   else {
        if (TIPO=="obrasexec") {
           document.getElementById('obrasex').src = "obrase.php?id="+END;
        } else if (TIPO=="produtos") {
                  document.getElementById('produts').src = "prods.php";
               } else if (TIPO=="maquetes") {
                         document.getElementById('maquets').src = "maqs.php";
                      } else if(TIPO=="constr") {
                                document.getElementById('constr').src= "constr.php";
                             } else {
                                    document.getElementById('image').innerHTML = "<center><img src='"+END+"' border='0'><br><font size='1' face='verdana'>"+TEXT+"</font><br><br></center>"; }
   }
}
  
function ajustar_tamanhos() {
    document.getElementById('fundocinza').style.height = document.body.scrollHeight;
    document.getElementById('fundocinza').style.width = document.body.scrollWidth;
   }
   
function amplia(END){
   document.getElementById('imag').innerHTML = "<a href='"+END+"' target='_blank' title='Zoom'><img src='imagemdim4.php?imagem="+END+"' border='0'></a>"; }
   
// --------------------------------------------------------------------------------------


// ADMIN: obrasexec.php -------------------------------------------------------------------------
function add_fotos(ID){
   alt('fotos','up_foto');
   document.getElementById('up_fotos').src = "upload.php?p_id="+ID; }

function voltar_fotos() {
   alt('up_foto','fotos');
   alt_prod.action = "?alt=TRUE&salvar=TRUE";
   alt_prod.submit(); }

function excl_fotos() {
   alt_prod.action = "?alt=TRUE&salvar=TRUE&excl=TRUE";
   alt_prod.submit(); }

function mk_fotos() {
   alt_prod.action = "?alt=TRUE&salvar=TRUE&mkf=TRUE";
   alt_prod.submit(); }

function exc_prod(ID) {
   if (confirm (" Tem certeza de que deseja excluir a OBRA EXECUTADA? ")) {
      document.location.href="?excluirr=TRUE&p_id="+ID; }
   else {
      document.location.href="?"; } }
// --------------------------------------------------------------------------------------


// ADMIN: unoeste.php --------------------------------------------------------------------------
function exc_not(ID) {
   if (confirm (" Tem certeza de que deseja excluir o acontecimento? ")) {
      document.location.href="?exc=TRUE&id="+ID; }
   else {
      document.location.href="?"; } }
      
function add_fotos_acont(ID){
   alt('fotos','up_foto');
   document.getElementById('up_fotos').src = "upload_acont.php?p_id="+ID; }

function exc_fotos_acont(ID){
   alt('fotos','up_foto');
   FORMU = "frm_"+ID;
   document.getElementById(FORMU).action = "?salvar=salvar&alter="+ID+"&exc_foto="+ID;
   document.getElementById(FORMU).submit();  }

function voltar_fotos_acont(ID) {
   alt('up_foto','fotos');
   FORMU = "frm_"+ID;
   document.getElementById(FORMU).action = "?salvar=salvar&alter="+ID;
   document.getElementById(FORMU).submit();  }
// --------------------------------------------------------------------------------------


// ADMIN: prod.php -------------------------------------------------------------------------
function add_fotos_prod(ID){
   alt('fotos','up_foto');
   document.getElementById('up_fotos').src = "upload_prod.php?p_id="+ID; }

function voltar_fotos_prod() {
   alt('up_foto','fotos');
   alt_prod.action = "?alt=TRUE&salvar=TRUE";
   alt_prod.submit(); }
   
function exc_prod_prod(ID) {
   if (confirm (" Tem certeza de que deseja excluir o PRODUTO? ")) {
      document.location.href="?excluirr=TRUE&p_id="+ID; }
   else {
      document.location.href="?"; } }
// --------------------------------------------------------------------------------------


// ADMIN: bambu.php -------------------------------------------------------------------------
function add_fotos_bamb(ID){
   alt('fotos','up_foto');
   document.getElementById('up_fotos').src = "upload_bamb.php?p_id="+ID; }

function voltar_fotos_bamb() {
   alt('up_foto','fotos');
   alt_prod.action = "?alt=TRUE&salvar=TRUE";
   alt_prod.submit(); }

function exc_prod_bamb(ID) {
   if (confirm (" Tem certeza de que deseja excluir a ESPÉCIE DE BAMBU? ")) {
      document.location.href="?excluirr=TRUE&p_id="+ID; }
   else {
      document.location.href="?"; } }
// --------------------------------------------------------------------------------------


// ADMIN: const.php -------------------------------------------------------------------------
function add_fotos_const(ID){
   alt('fotos','up_foto');
   document.getElementById('up_fotos').src = "upload_const.php?p_id="+ID; }

function voltar_fotos_const() {
   alt('up_foto','fotos');
   alt_prod.action = "?alt=TRUE&salvar=TRUE";
   alt_prod.submit(); }

function exc_prod_const(ID) {
   if (confirm (" Tem certeza de que deseja excluir a CONSTRUÇÃO? ")) {
      document.location.href="?excluirr=TRUE&p_id="+ID; }
   else {
      document.location.href="?"; } }
// --------------------------------------------------------------------------------------


// ADMIN: maquetes.php -------------------------------------------------------------------------
function add_fotos_maq(ID){
   alt('fotos','up_foto');
   document.getElementById('up_fotos').src = "upload_maq.php?p_id="+ID; }

function voltar_fotos_maq() {
   alt('up_foto','fotos');
   alt_prod.action = "?alt=TRUE&salvar=TRUE";
   alt_prod.submit(); }

function exc_prod_maq(ID) {
   if (confirm (" Tem certeza de que deseja excluir a MAQUETE? ")) {
      document.location.href="?excluirr=TRUE&p_id="+ID; }
   else {
      document.location.href="?"; } }
// --------------------------------------------------------------------------------------


// ADMIN: curs.php -------------------------------------------------------------------------
function add_fotos_curs(ID) {
   alt('fotos','up_foto');
   document.getElementById('up_fotos').src = "upload_curs.php?p_id="+ID; }

function voltar_fotos_curs() {
   alt('up_foto','fotos');
   alt_prod.action = "?alt=TRUE&salvar=TRUE";
   alt_prod.submit(); }
   
function add_anexo_curs(ID) {
   alt('anexo','up_anexo');
   document.getElementById('up_anexos').src = "upload_curs_a.php?p_id="+ID; }

function voltar_anexo_curs() {
   alt('up_anexo','anexo');
   alt_prod.action = "?alt=TRUE&salvar=TRUE";
   alt_prod.submit(); }

function exc_prod_curs(ID) {
   if (confirm (" Tem certeza de que deseja excluir o CURSO? ")) {
      document.location.href="?excluirr=TRUE&p_id="+ID; }
   else {
      document.location.href="?"; } }
// --------------------------------------------------------------------------------------


// ADMIN: palest.php -------------------------------------------------------------------------
function add_fotos_palest(ID) {
   alt('fotos','up_foto');
   document.getElementById('up_fotos').src = "upload_palest.php?p_id="+ID; }

function voltar_fotos_palest() {
   alt('up_foto','fotos');
   alt_prod.action = "?alt=TRUE&salvar=TRUE";
   alt_prod.submit(); }
   
function add_anexo_palest(ID) {
   alt('anexo','up_anexo');
   document.getElementById('up_anexos').src = "upload_palest_a.php?p_id="+ID; }

function voltar_anexo_palest() {
   alt('up_anexo','anexo');
   alt_prod.action = "?alt=TRUE&salvar=TRUE";
   alt_prod.submit(); }

function exc_prod_palest(ID) {
   if (confirm (" Tem certeza de que deseja excluir a PALESTRA? ")) {
      document.location.href="?excluirr=TRUE&p_id="+ID; }
   else {
      document.location.href="?"; } }
// --------------------------------------------------------------------------------------


// ADMIN: status.php --------------------------------------------------------------------------
function exc_status(ID,PROJ) {
   if (confirm (" Tem certeza de que deseja excluir? ")) {
      document.location.href="?exc=TRUE&p_id="+ID+"&proj="+PROJ; }
   else {
      document.location.href="?"; } }
// --------------------------------------------------------------------------------------


// contato.php ----------------------------------------------------------------------------
function valida_contato() {
    var nome = document.contato.nome;
    var email = document.contato.email;
    var tel = document.contato.tel;
    var assunto = document.contato.assunto;
    var descr = document.contato.descr;
	if (nome.value == "") {
		alert("Seu nome é necessário...");
		nome.focus();
		return false; }

	if (email.value == "") {
		alert("Informe seu e-mail.");
		email.focus();
		return false; }
    else {
		prim = email.value.indexOf("@")
		if(prim < 2) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("@",prim + 1) != -1) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf(".") < 1) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf(" ") != -1) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("zipmeil.com") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("gmail.com.br") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("hotmail.com.br") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("hotmial.com") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("hotmal.com") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("htmail.com") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("hotmeil.com") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf(".@") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("@.") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf(".com.br.") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("/") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("[") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("]") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("(") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf(")") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; }
		if(email.value.indexOf("..") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			return false; } }

	if (tel.value == "") {
		alert("Digite seu telefone...");
		tel.focus();
		return false; }

	if (assunto.value == "- - - - - - - - - - - - - - -") {
		alert("Escolha um assunto...");
		assunto.focus();
		return false; }

	if (descr.value == "") {
		alert("Preencha a descrição de seu contato...");
		descr.focus();
		return false; }

    return true; }
// --------------------------------------------------------------------------------------
