//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div' );

//Specify spectrum of different font sizes:
var szs = new Array( '8px','9px','10px','11x','12px','14px','16px','18px' );
var startSz = 3;

function ts( trgt,inc ) {
if (!document.getElementById) return
var d = document,cEl = null,sz = startSz,i,j,cTags;
sz += inc;
if ( sz < 0 ) sz = 0;
if ( sz > 6 ) sz = 6;
startSz = sz;
if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

cEl.style.fontSize = szs[ sz ];

for ( i = 0; i < tgs.length; i++ ) {
	cTags = cEl.getElementsByTagName( tgs[ i ] );
	for ( j = 0; j < cTags.length; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}



function valida_classificado(){

	
	if(!document.getElementById("chkAcordo").checked){
	
		window.alert("Preencha o campo lí e estou de acordo com os critérios de publicação do anúncio no Portal KartOnline!");
		return;
	
	}
	
	
	if(document.getElementById("txtNome").value == ""){
		
		
		document.getElementById("txtNome").focus();
		window.alert("Preencha o campo Nome");
		return;
		
	
	}
	
	
	if(document.getElementById("txtApelido").value == ""){
		
		
		document.getElementById("txtApelido").focus();
		window.alert("Preencha o campo Apelido");
		return;
		
	
	}
	
	if(document.getElementById("txtEmail").value == ""){
		
		
		document.getElementById("txtEmail").focus();
		window.alert("Preencha o campo E-mail");
		return;
		
	
	}
	
	if(document.getElementById("txtCidade").value == ""){
		
		
		document.getElementById("txtCidade").focus();
		window.alert("Preencha o campo Cidade");
		return;
		
	
	}
	
	if(document.getElementById("txtCep").value == ""){
		
		
		document.getElementById("txtCep").focus();
		window.alert("Preencha o campo Cep");
		return;
		
	
	}
	
	
	if(document.getElementById("txtCep").value == ""){
		
		
		document.getElementById("txtCep").focus();
		window.alert("Preencha o campo Cep");
		return;
	
	}
	
	if(document.getElementById("ddd_celular").value == ""){
		
		
		document.getElementById("ddd_celular").focus();
		window.alert("Preencha o campo DDD Celular");
		return;
	
	}


	if(document.getElementById("txtCelular").value == ""){
		
		
		document.getElementById("txtCelular").focus();
		window.alert("Preencha o campo Celular");
		return;
	
	}
	
	var controle = 0;
	var listaMarcados = document.getElementsByTagName("INPUT");  
	   for (loop = 0; loop < listaMarcados.length; loop++) {  
		  var item = listaMarcados[loop];  
		  if (item.type == "checkbox" && item.checked) {  
			controle++;
		  }  
	   }  
	
	
	if(controle < 2){
	
		window.alert("Preencha o campo Categoria");
		return;
		
	}
	
	if(document.getElementById("txtTituloAnuncie").value == ""){
		
		
		document.getElementById("txtTituloAnuncie").focus();
		window.alert("Preencha o campo Título do Anúncio");
		return;
	
	}
	
	
	if(document.getElementById("txtDescricao").value == ""){
		
		
		document.getElementById("txtDescricao").focus();
		window.alert("Preencha o campo Descrição");
		return;
	
	}
	
	if(document.getElementById("txtValorAnuncie").value == ""){
				
		document.getElementById("txtValorAnuncie").focus();
		window.alert("Preencha o campo Valor");
		return;
	
	}
	
	
	/*
	if(!document.getElementById("chkAcordo").checked){
	
		window.alert("Preencha o campo lí e estou de acordo com os critérios de publicação do anúncio no Portal KartOnline!");
		return;
	
	}
	*/
	
	
	document.getElementById("form_classificado").submit();
	

}


function cancela_cadastro(){


	if(window.confirm("Deseja realmente cancelar seu cadastro?")){
				
		document.getElementById("form_cancela").submit();		
		
	}


}


function valida_cadastro(){

	/*
	if(!document.getElementById("radio_masculino").checked || !document.getElementById("radio_feminino").checked){
	
		window.alert("Preencha a opção sexo");
		return;
	
	}
	*/
	
	if(!document.getElementById("chkAcordo").checked){
	
		window.alert("Preencha a opção Li e estou de acordo com as Política de Privacidade do Portal KartOnline!");
		return;
	
	}
	
	document.getElementById("formCadastro").submit();
	

}


/*
*    Script:    Mascaras em Javascript
*    Autor:    Matheus Biagini de Lima Dias
*    Data:    26/08/2008
*    Obs:    
*/
    /*Função Pai de Mascaras*/
    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
    }
    
    /*Função que padroniza CEP*/
    function Cep(v){
        v=v.replace(/D/g,"")                
        v=v.replace(/^(\d{5})(\d)/,"$1-$2") 
        return v
    }
    
    /*Função que padroniza CNPJ*/
    function Cnpj(v){
        v=v.replace(/\D/g,"")                   
        v=v.replace(/^(\d{2})(\d)/,"$1.$2")     
        v=v.replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3") 
        v=v.replace(/\.(\d{3})(\d)/,".$1/$2")           
        v=v.replace(/(\d{4})(\d)/,"$1-$2")              
        return v
    }
    
    /*Função que permite apenas numeros Romanos*/
    function Romanos(v){
        v=v.toUpperCase()             
        v=v.replace(/[^IVXLCDM]/g,"") 
        
        while(v.replace(/^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/,"")!="")
            v=v.replace(/.$/,"")
        return v
    }
    
    /*Função que padroniza o Site*/
    function  Site(v){
        v=v.replace(/^http:\/\/?/,"")
        dominio=v
        caminho=""
        if(v.indexOf("/")>-1)
            dominio=v.split("/")[0]
            caminho=v.replace(/[^\/]*/,"")
            dominio=dominio.replace(/[^\w\.\+-:@]/g,"")
            caminho=caminho.replace(/[^\w\d\+-@:\?&=%\(\)\.]/g,"")
            caminho=caminho.replace(/([\?&])=/,"$1")
        if(caminho!="")dominio=dominio.replace(/\.+$/,"")
            v="http://"+dominio+caminho
        return v
    }

    /*Função que padroniza DATA*/
    function Data(v){
        v=v.replace(/\D/g,"") 
        v=v.replace(/(\d{2})(\d)/,"$1/$2") 
        v=v.replace(/(\d{2})(\d)/,"$1/$2") 
        return v
    }
    
    /*Função que padroniza DATA*/
    function Hora(v){
        v=v.replace(/\D/g,"") 
        v=v.replace(/(\d{2})(\d)/,"$1:$2")  
        return v
    }
    
    /*Função que padroniza valor monétario*/
    function Valor(v){
        v=v.replace(/\D/g,"") //Remove tudo o que não é dígito
        v=v.replace(/^([0-9]{3}\.?){3}-[0-9]{2}$/,"$1.$2");
        //v=v.replace(/(\d{3})(\d)/g,"$1,$2")
        v=v.replace(/(\d)(\d{2})$/,"$1.$2") //Coloca ponto antes dos 2 últimos digitos
        return v
    }
    
    /*Função que padroniza Area*/
    function Area(v){
        v=v.replace(/\D/g,"") 
        v=v.replace(/(\d)(\d{2})$/,"$1.$2") 
        return v
        
    }

