function textOn(txt){
	document.getElementById(txt).className="textboxOn";
}

function textNormal(txt){
	document.getElementById(txt).className="textbox";
}

function dataOn(txt){
	document.getElementById(txt).className="textdataOn";
}

function dataNormal(txt){
	document.getElementById(txt).className="textdata";
}

function DropOn(txt){
	document.getElementById(txt).className="dropdownOn";
}

function DropNormal(txt){
	document.getElementById(txt).className="dropdown";
}

function abreJanelaPlayer(nomejanela, pagina, largura, altura, barra){
	var janela;
	winprops = "width="+largura+",height="+altura+",top=50,left=150"+
		  ",scrollbars=no,hscroll=0,dependent=no,toolbar="+barra
	janela = window.open(pagina,nomejanela,winprops)
	if (window.focus) {janela.focus()}
	return false;
}

	function validacamposcontato(){
		var email=document.email;
		var msg="";	
		
		if(email.txt_nome.value == "") {msg=msg + "\n Digite seu nome.";}
		if(email.txt_email.value == ""){msg=msg + "\n Digite seu email.";}
		if(email.txt_email.value.indexOf('@', 0) == -1){msg=msg + "\n Digite um e-mail valido.";}
		if(email.txt_assunto.value == "") {msg=msg + "\n Selecione um assunto.";}
		if(email.txt_msg.value == "") {msg=msg + "\n Escreva algo na mensagem."; }
			
		if(msg != ""){
			msg="Erro no preenchimento dos campos:\n" + msg;
			alert(msg);
			return false;
		} else {
			return true;
		}
	}
	
	function validaBuscaClipping(){
		var form=document.busca_clipping;
		var msg="";	
		
		if(form.txt_cliente.value == "") {msg=msg + "\n Selecione o cliente.";}
			
		if(msg != ""){
			msg="Erro no preenchimento dos campos:\n" + msg;
			alert(msg);
			return false;
		} else {
			return true;
		}
	}

function formatar(mascara, documento){
  var i = documento.value.length;
  var saida = mascara.substring(0,1);
  var texto = mascara.substring(i)
  
  if (texto.substring(0,1) != saida){
	documento.value += texto.substring(0,1);
  }
  
}	