// lrsolução

	
	function SHL() { //v9.0
	  var i,p,v,obj,args=SHL.arguments;
	  for (i=0; i<(args.length-2); i+=3) 
	  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
		if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
		obj.visibility=v; }
	}
	
	function setClassName(objId, fundo) {
			document.getElementById(objId).style.background= fundo;
	
	
	}

	function mostra(bi) {
		if (bi == 1) {SHL('img_dh1','','show');SHL('img_dh2','','hide');SHL('img_dh3','','hide');SHL('img_dh4','','hide');SHL('img_dh5','','hide');SHL('img_dh6','','hide');setClassName('dh1','#fff');setClassName('dh2','#D8251E');setClassName('dh3','#D8251E');setClassName('dh4','#D8251E');setClassName('dh5','#D8251E');setClassName('dh6','#D8251E');}
		
		if (bi == 2) {SHL('img_dh1','','hide');SHL('img_dh2','','show');SHL('img_dh3','','hide');SHL('img_dh4','','hide');SHL('img_dh5','','hide');SHL('img_dh6','','hide');setClassName('dh1','#D8251E');setClassName('dh2','#fff');setClassName('dh3','#D8251E');setClassName('dh4','#D8251E');setClassName('dh5','#D8251E');setClassName('dh6','#D8251E');}
		
		if (bi == 3) {SHL('img_dh1','','hide');SHL('img_dh2','','hide');SHL('img_dh3','','show');SHL('img_dh4','','hide');SHL('img_dh5','','hide');SHL('img_dh6','','hide');setClassName('dh1','#D8251E');setClassName('dh2','#D8251E');setClassName('dh3','#fff');setClassName('dh4','#D8251E');setClassName('dh5','#D8251E');setClassName('dh6','#D8251E');}
		
		if (bi == 4) {SHL('img_dh1','','hide');SHL('img_dh2','','hide');SHL('img_dh3','','hide');SHL('img_dh4','','show');SHL('img_dh5','','hide');SHL('img_dh6','','hide');setClassName('dh1','#D8251E');setClassName('dh2','#D8251E');setClassName('dh3','#D8251E');setClassName('dh4','#fff');setClassName('dh5','#D8251E');setClassName('dh6','#D8251E');}
		
		if (bi == 5) {SHL('img_dh1','','hide');SHL('img_dh2','','hide');SHL('img_dh3','','hide');SHL('img_dh4','','hide');SHL('img_dh5','','show');SHL('img_dh6','','hide');setClassName('dh1','#D8251E');setClassName('dh2','#D8251E');setClassName('dh3','#D8251E');setClassName('dh4','#D8251E');setClassName('dh5','#fff');setClassName('dh6','#D8251E');}

		if (bi == 6) {SHL('img_dh1','','hide');SHL('img_dh2','','hide');SHL('img_dh3','','hide');SHL('img_dh4','','hide');SHL('img_dh5','','hide');SHL('img_dh6','','show');setClassName('dh1','#D8251E');setClassName('dh2','#D8251E');setClassName('dh3','#D8251E');setClassName('dh4','#D8251E');setClassName('dh5','#D8251E');setClassName('dh6','#fff');}
	}
	
	var gira = 1;
	var trocador = 0;
	
	function troca() {
		gira = gira + 1; 
		if (gira == 7) {gira = 1;}	
		mostra(gira);
	}	
	

	var timerval;
	timerval = setInterval("troca()",5000);
	

	function timeroff(){
		clearInterval(timerval);
	}
	

	function timeron(){
		clearInterval(timerval);
		timerval = setInterval("troca()",5000);
	} 
	
	function faixa() {
		SHL('faixa','','hide');
	}
	
	// Painel de chamadas rotativo com botões para navegação
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('t 6=1L.6||{};6.8={D:j,7:j,k:j,x:{1n:"E",1o:"F",Y:"1M",O:"1N"},n:"",i:0,F:0,E:0,Z:!!1O.1P.1Q(/1R/g),r:j,y:10,P:l,o:m.11("G"),H:l,Q:0,1S:9(a){5.D=m.1T(a.1U);5.y=a.y||5.y;5.n=a.n||5.n;5.x=a.x||5.x;f(1p 12=="1V"){12=0}5.H=H=(m.I.1q("1r=1")==-1)?s:l;5.7=5.D.z("1W");5.13(5.i);5.1s();f(5.7.p==1){a.14=s}q{5.1t()}f(m.I.1q("15=1")!=-1){a.14=s}f(!a.14){5.R()}q{5.A("O")}},16:{S:9(a){f(a.S){a.S()}q{a.1X=l}},1u:9(c,b,a){f(m.1v){c.1v("1Y"+b,a)}q{f(m.1w){c.1w(b,a,s)}}}},R:9(a){f((!a&&5.r==j)||(a&&5.r!=j)){1x(5.r);5.r=1Z(9(){6.8.17(1)},6.8.y*1y);m.I="15=0; 18=/";5.A("Y")}q{m.I="15=1; 18=/";1x(5.r);5.r=j;5.A("O")}},A:9(a){f(5.k!=j){t b=5.k.z("a")[1];b.v="20"+a;b.19=5.x[a]}},13:9(a){5.i=(21(a)+(5.i||5.7.p))%5.7.p;5.F=((5.i||5.7.p)-1)%5.7.p;5.E=((5.i||5.7.p)+1)%5.7.p},B:9(b,d,c){f(d){b.h.T=0;b.h.C="1a(1b=0)"}q{b.h.T=1;b.h.C="1a(1b=1z)"}6.8.P=s;1c(t a=1;a<=10;a++){1d(9(e){22 9(){f(6.8.Z){b.h.C="1a(1b="+(d?10*e:1z-10*e)+")"}q{b.h.T=(d?0.1*e:1-0.1*e)}f(e==10){6.8.P=l;f(1p c=="9"){c()}}}}(a),23*a)}},1A:9(){m.I="1r=1; 18=/";5.H=l;24(6.8.1B);5.1e()},1e:9(){5.B(5.o,l,9(){6.8.o.h.U="V";6.8.k.h.U="1C"});5.B(5.k,s,j)},17:9(b){t a=5.i;5.25=l;5.Q++;f(12==1&&5.H&&5.Q>0&&5.Q%5.7.p==0){5.o.h.U="1C";5.o.v="o";5.o.19=\'<a w="\'+26+\'" J="27"><K 1f="\'+28+\'" 1g="0" /></a><G L="29"><K 1f="1D://1E.K.M.1F.1G/1H/2a.1I" L="2b" 1g="0" /><a w="2c:2d(0)" 2e="6.8.1A()"><K 1f="1D://1E.K.M.1F.1G/1H/o-2f.1I" 1g="0" /></G>\';5.D.1h(5.o);5.B(5.o,s,9(){6.8.k.h.U="V"});5.B(5.k,l,j);f(5.r!=j){6.8.1B=1d(9(){6.8.1e()},6.8.y*1y)}}q{5.13(b);5.7[5.i].v=5.7[5.i].v.W(/1i/g,"");5.7[5.i].h.1j=3;5.7[a].h.1j=4;5.7[5.i].h.T=1;5.7[5.i].h.C="V";5.B(5.7[a],l,9(){f(6.8.Z){6.8.7[a].h.C=6.8.7[a].h.C="V"}6.8.7[a].v="1i";6.8.7[a].h.1j=2});5.1k();f(5.r==j){5.A("O")}q{5.A("Y")}}},1t:9(){5.k=m.11("G");5.k.v="2g";5.1k();5.D.1h(5.k)},1s:9(){t b=m.11("G");b.v="2h";1c(t a=0;a<5.7.p;a++){f(a>0){5.7[a].v+=" 1i"}5.7[a].1h(b.2i(s))}},1k:9(){5.k.19="<a N=\'-1\' w=\'"+5.7[5.F].z("a")[0].w.W(/(^.*?X\\.M.*?1l\\=).*?(&u\\=.*?)$/g,"$1"+5.n+"$2")+"\' L=\'F\' 1m=\'"+5.n+"\'>"+5.x.1o+"</a>      <a N=\'0\' w=\'"+5.7[5.i].z("a")[0].w.W(/(^.*?X\\.M.*?1l\\=).*?(&u\\=.*?)$/g,"$1"+5.n+"$2")+"\' L=\'\' 1m=\'"+5.n+"\'></a>      <a N=\'+1\' w=\'"+5.7[5.E].z("a")[0].w.W(/(^.*?X\\.M.*?1l\\=).*?(&u\\=.*?)$/g,"$1"+5.n+"$2")+"\' L=\'E\' 1m=\'"+5.n+"\'>"+5.x.1n+"</a>";t b=5.k.z("a");1c(t a=0;a<b.p;a++){5.16.1u(b[a],"X",9(c){6.8.1J(c)})}},1J:9(a){6.8.16.S(a);f(a.1K&&!a.J){a.J=a.1K}f(a.J.N==0){6.8.R()}q{f(6.8.P==l){1d(9(){6.8.17(a.J.N);6.8.R(s)},2j)}}}};',62,144,'|||||this|ContigoLib|itens|rotativoDeChamadas|function||||||if||style|ativado|null|botoes|false|document|botoesRefClickContigo|banner|length|else|timeOut|true|var||className|href|botoesTxts|timer|getElementsByTagName|setBtStopPlay|fadeIO|filter|painel|proximo|anterior|div|showBanner|cookie|target|img|class|Contigo|rel|play|animando|contaTrocas|stopPlay|preventDefault|opacity|display|none|replace|click|stop|navMSIE||createElement|mostrabanner|setNavegacao|startOff|rotativoDeChamadasStop|events|navegar|path|innerHTML|Alpha|Opacity|for|setTimeout|bannerFadeOut|src|border|appendChild|desativado|zIndex|writeBotoesHTML|rf|name|next|prev|typeof|indexOf|rotativoDeChamadasNoBanner|aplicarSombras|montarBotoes|add|attachEvent|addEventListener|clearInterval|1000|100|fecharBanner|bannerFadeOutTimer|block|http|home|com|br|h3|gif|btNavegacaoClick|srcElement|window|parar|executar|navigator|userAgent|match|MSIE|init|getElementById|id|undefined|li|returnValue|on|setInterval|bt|parseInt|return|75|clearTimeout|removerBanner|mostrabannerLINK|_blank|mostrabannerIMG|rodape|pub_h_120_b|txtPublicidade|javascript|void|onclick|fechar|botoesNavegacao|sombra|cloneNode|30'.split('|'),0,{}))


function limpar(id_obj){  

if(id_obj=='Nome'){
document.contato.nm.value = '';
document.contato.nm.style.color='#fff'; 
document.contato.nm.style.background='#333';
}

if(id_obj=='E-mail'){
document.contato.email.value = '';
document.contato.email.style.color='#fff'; 
document.contato.email.style.background='#333';
}
if(id_obj=='Telefone'){
document.contato.telefone.value = '';
document.contato.telefone.style.color='#fff'; 
document.contato.telefone.style.background='#333';
}

if(id_obj=='Cidade'){
document.contato.cidade.value = '';
document.contato.cidade.style.color='#fff'; 
document.contato.cidade.style.background='#333';
}

if(id_obj==""||id_obj=="Promoção"||id_obj=="Selecionar promoção"){

document.getElementById('text_style1').style.background='#333';
document.getElementById('text_style1').style.color='#fff'; 
}

if(id_obj=='CPF'){
document.contato.cpf.value = '';
document.contato.cpf.style.color='#fff'; 
document.contato.cpf.style.background='#333';
}

}




function verifica(){

if(document.contato.nm.value==''){
document.contato.nm.value = 'Nome';
document.contato.nm.style.color='#fff'; 
}

if(document.contato.email.value==''){
document.contato.email.value = 'E-mail';
document.contato.email.style.color='#fff'; 
}

if(document.contato.telefone.value==''){
document.contato.telefone.value = 'Telefone';
document.contato.telefone.style.color='#fff'; 
}

if(document.contato.cidade.value==''){
document.contato.cidade.value = 'Cidade';
document.contato.cidade.style.color='#fff'; 
}

if(document.getElementById('text_style1').innerHTML==""||document.getElementById('text_style1').innerHTML=="Promoção"||document.getElementById('text_style1').innerHTML=="Selecionar promoção"){

document.getElementById('text_style1').style.background='#333';
document.getElementById('text_style1').style.color='#fff'; 
}


if(document.contato.cpf.value==''){
document.contato.cpf.value = 'CPF';
document.contato.cpf.style.color='#fff'; 
}




}
	
	 function atribui_valor(id_v,valor,nome,metodo){ document.getElementById(id_v).innerHTML = ""+nome+"";document.contato.promocao2.value=""+nome+""; }
	




    function Mascara(o,f){
        v_obj=o
        v_fun=f
        setTimeout("execmascara()",1)
    }
    
    /*Função que Executa os objetos*/
    function execmascara(){
        v_obj.value=v_fun(v_obj.value)
    }
    
    /*Função que Determina as expressões regulares dos objetos*/
    function leech(v){
        v=v.replace(/o/gi,"0")
        v=v.replace(/i/gi,"1")
        v=v.replace(/z/gi,"2")
        v=v.replace(/e/gi,"3")
        v=v.replace(/a/gi,"4")
        v=v.replace(/s/gi,"5")
        v=v.replace(/t/gi,"7")
        return v;
    }
    
    /*Função que permite apenas numeros*/
    function Integer(v){
        return v.replace(/\D/g,"")
    }
    
    /*Função que padroniza telefone (11) 4184-1241*/
    function Telefone(v){
        v=v.replace(/\D/g,"")                 
        v=v.replace(/^(\d\d)(\d)/g,"($1) $2") 
        v=v.replace(/(\d{4})(\d)/,"$1-$2")    
        return v;
    }
    
    /*Função que padroniza telefone (11) 41841241*/
    function TelefoneCall(v){
        v=v.replace(/\D/g,"")                 
        v=v.replace(/^(\d\d)(\d)/g,"($1) $2")    
        return v;
    }

    
    /*Função que padroniza CPF*/
    function Cpf(v){
        v=v.replace(/\D/g,"")                    
        v=v.replace(/(\d{3})(\d)/,"$1.$2")       
        v=v.replace(/(\d{3})(\d)/,"$1.$2")       
                                                 
        v=v.replace(/(\d{3})(\d{1,2})$/,"$1-$2") 
        return v;
    }


// Páginas

var http_request = false;

   function makePOSTRequest(url, parameters) {
	      
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
	  }




   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('promo').innerHTML = result;    
			carrosselAutomatico();       
         } else {
            alert('Houve algum problema de conexão.'); }
			} else {
  document.getElementById('promo').innerHTML = '<br><center><span style="color:#666"> Processando, aguarde ...</span> </center>';
 }
}
   
  
function get(){
	   
var poststr = 

"nome=" + encodeURI( document.getElementById("nm").value ) + 
"&email=" + encodeURI( document.getElementById("email").value ) + 
"&telefone=" + encodeURI( document.getElementById("telefone").value) + 
"&cidade=" + encodeURI( document.getElementById("cidade").value) + 
"&cpf=" + encodeURI( document.getElementById("cpf").value) + 
"&promocao=" + encodeURI( document.getElementById("promocao2").value) + 
"&data=" + encodeURI( document.getElementById("data").value)+
"&MM_insert=" + encodeURI( document.getElementById("MM_insert").value);

		
 		
makePOSTRequest('add_promocao.php?id=promo', poststr );
 
};


function validar(){
	
	var nome=document.contato.nm.value;
    var email=document.contato.email.value;
	var telefone=document.contato.telefone.value;
	var cidade=document.contato.cidade.value;
	var cpf=document.contato.cpf.value;
	var promocao= document.getElementById('text_style1').innerHTML;
 
     if(nome==""||nome=="Nome"||nome.length < 5){
	 document.contato.nm.focus();
	 document.contato.nm.value = 'Nome';
	 document.contato.nm.style.background='#666';
	 document.contato.nm.style.color='#ffff66';
	 return false;
	 }
	 
	 if(email==""||email.indexOf('@')=="-1"||email.indexOf('.')=="-1"||email=="E-mail"){
	 document.contato.email.focus();
	 document.contato.email.value = 'E-mail';
	 document.contato.email.style.background='#666';
	 document.contato.email.style.color='#ffff66';
	 return false;
	 }
	 
	 if(telefone==""||telefone=="Telefone"||telefone.length < 14){
	 document.contato.telefone.focus();
	 document.contato.telefone.value = 'Telefone'; 
	 document.contato.telefone.style.background='#666';
	 document.contato.telefone.style.color='#ffff66';
	 return false;
     }
	 
	 if(cidade==""||cidade=="Cidade"||cidade.length < 2){
	 document.contato.cidade.focus();
     document.contato.cidade.value = 'Cidade';
	 document.contato.cidade.style.background='#666';
	 document.contato.cidade.style.color='#FFFF66';
	 return false;
     }
	 
	 if( promocao==""||promocao=="Promoção"||promocao=="Selecionar promoção"){	 
	 document.getElementById('text_style1').innerHTML = "Selecionar promoção";
	 document.getElementById('text_style1').style.background='#666';
	 document.getElementById('text_style1').style.color='#FFFF66'; 
	 document.getElementById("fonte1").focus();
	 
	 return false;
     }
	 
	 
	  if(cpf==""||cpf=="CPF"||cpf.length < 9){
	 document.contato.cpf.focus();
     document.contato.cpf.value = 'CPF';
	 document.contato.cpf.style.background='#666';
	 document.contato.cpf.style.color='#FFFF66';
	 return false;
     }
	 
get();


	 
	 };  
	 

