// JavaScript Document
 //<![CDATA[

 // If you don't want to put unstandard properties in your stylesheet, here's yet
 // another means of activating the script. This assumes that you have at least one
 // stylesheet included already. Remove the /* and */ lines to activate.

 /*
 if (document.all && document.styleSheets && document.styleSheets[0] &&
  document.styleSheets[0].addRule)
 {
  // Feel free to add rules for specific tags only, you just have to call it several times.
  document.styleSheets[0].addRule('*', 'behavior: url(iepngfix.htc)');
 }
 */

 //]]>
 
/********************************************************************************************
			AJAX SUBMETE
*/
 
	function updateResponseDiv(req) 
	{
		if(req.xhRequest.responseText == 'false'){
			document.getElementById("ZoupLoader").style.display='none';	
			alert('Ocorreu um erro no envio');
		}else{
			document.getElementById("ZoupLoader").style.display='none';	
			alert('E-mail enviado com sucesso!')	
			document.getElementById('frmContato').reset();
		}						
	} 
	function SubmetForm(frmNome){
		document.getElementById("ZoupLoader").style.display='block';
		Spry.Utils.submitForm(frmNome, updateResponseDiv)
	}
	function MySuccessCallbackExc(req){location.href = req.xhRequest.responseText;}	
	function MyErrorCallbackExc(req){document.getElementById('ZoupLoader').style.display='none';alert("Ocorreu um erro na exclusão");}
	function Excluir(strNuId,strUrl){
		if(confirm("Tem certeza que deseja excluir?")){	
			var req = Spry.Utils.loadURL("POST", "zoup.fit-global-salvar.asp?acao=excluir_texto&cont_cd_conteudo="+strNuId+"&url_page="+strUrl, true, MySuccessCallbackExc, { postData: "action=update&genre=fiction", headers: { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" }, errorCallback: MyErrorCallbackExc });
		}else{
			return false;
		}		
	}		
/********************************************************************************************
			CONFIG - CHECK FORMULÁRIOS
*/	
	function check_form(frmString, frmCampoValidar){
				
		var TstringCompara = frmCampoValidar.split(",").length;
		var StringElement = frmCampoValidar.split(",");
		var i;
		for (i=0;i<=(TstringCompara-1);i++){		
			var NomeCampo = StringElement[i];
			if(document.getElementById(NomeCampo).type == 'text' || document.getElementById(NomeCampo).type == 'textarea'){
				if(document.getElementById(NomeCampo).value==''){
					alert('Preencha: ' + document.getElementById(NomeCampo).title);
					document.getElementById(NomeCampo).style.borderColor='red';
					document.getElementById(NomeCampo).focus();				
					return false;
					break;		
				}else{document.getElementById(NomeCampo).style.border = "solid #CCCCCC 1px";}
			}else if(document.getElementById(NomeCampo).type == 'checkbox'){
				if(!document.getElementById(NomeCampo).checked){
					alert('Selecione: ' + document.getElementById(NomeCampo).title);
					document.getElementById(NomeCampo).focus();				
					return false;
					break;		
				}							
			}
		}
		return true;
	}	
	
/********************************************************************************************
			PRELOAD IMAGENS
*/
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	} 
/********************************************************************************************
			ESCONDE LAYER
*/
	function mostraLayer(Nlayer){
		var NomeLayer = Nlayer;
		if(document.getElementById(NomeLayer).style.display=='none'){
			document.getElementById(NomeLayer).style.display='block';
		}else{
			document.getElementById(NomeLayer).style.display='none';
		}
	 }
	 function seleciona_anuncio(nLayer){
		document.getElementById(nLayer).style.border = "solid red 0px";	
		document.getElementById(nLayer).style.backgroundColor = "#E5EEF5";	
	 }

/********************************************************************************************
			CONFIG - FIT
*/
	
	function exibirCampo(campoexibir,campoocutar){		
		if(document.getElementById(campoexibir).display=='none'){
			document.getElementById(campoexibir).display='block';
			document.getElementById(campoocutar).display='none';
		}		
	}	
	function SaveIMG(){
	
		document.getElementById("enviar_img").Value = "Aguarde enviando...";
		document.getElementById("enviar_img").disabled = true;
		document.getElementById("img_form").action="zoup.fit-salvar-img.asp"
		document.getElementById("img_form").submit();
		return true;	
	}
	function DellIMG(){
	
		document.getElementById("deletar_img").Value = "Aguarde enviando...";
		document.getElementById("deletar_img").disabled = true;
		document.getElementById("enviar_img").Value = "\&gt\;\&gt\;  selecionar imagem  \&lt\;\&lt\;";
		document.getElementById("enviar_img").disabled = false;
		document.getElementById("img_form").action="zoup.fit-deletar-img.asp"
		document.getElementById("img_form").submit();
		return true;	
	}		
	function SaveIMGBanco(){
		document.forms[0].acao.value ='atualizar_imagem';
		document.forms[0].target="execFunc";		
		document.forms[0].submit();
		return true;	
	}		 