<!--
//  ###################
//  #    INTERFACE    #
//  ###################
//  
//  limitaCampo(campo)
//  formatarDado(campo,tammax,pos,[char])
//  formatarValor(campo,tammax,teclapres)
//  campoVazio(campo)
//  inverteData(campo,campo2)
//  formatarData(campo)
//  formatarHora(campo)
//  formatarProcesso(campo)
//  findNextControl(campo)
//  saltaCampo(campo,tammax)
//  trataData(campo)
//  eData(texto)
//  formatarCNPJ(campo)
//  function formatarCPF(campo)
//  function checkbox
//  ###################

//  ###################
//  #    CONTROLES    #
//  ###################

//  UpVolumeClick()
//  DownVolumeClick()
//  function StopClick()
//  function PlayClick()
var tagAlvo = new Array('p'); //pega todas as tags p//
	var win;

 
// Especificando os possíveis tamanhos de fontes, poderia ser: x-small, small...
var tamanhos = new Array( '9px','10px','11px','12px','13px','14px','15px','18px' );
var tamanhoInicial = 2;
 
function mudaTamanho( idAlvo,acao ){
  if (!document.getElementById) return
  var selecionados = null,tamanho = tamanhoInicial,i,j,tagsAlvo;
  tamanho += acao;
  if ( tamanho < 0 ) tamanho = 0;
  if ( tamanho > 6 ) tamanho = 6;
  tamanhoInicial = tamanho;
  if ( !( selecionados = document.getElementById( idAlvo ) ) ) selecionados = document.getElementsByTagName( idAlvo )[ 0 ];
  
  selecionados.style.fontSize = tamanhos[ tamanho ];
  
  for ( i = 0; i < tagAlvo.length; i++ ){
    tagsAlvo = selecionados.getElementsByTagName( tagAlvo[ i ] );
    for ( j = 0; j < tagsAlvo.length; j++ ) tagsAlvo[ j ].style.fontSize = tamanhos[ tamanho ];
  }
}
// Fim do código de Aumentar/ Diminuir a letra

function GoToHome()
{
	window.open('index.asp','_self');	
}

function PlayClick() 
{ 
	vPosicaoH = (screen.width-778)/2;
	vPosicaoV = (screen.height-600)/2;
	win = window.open('player/player.html','radio_online', 'toolbar=no,location=no,directories=no,status=no,menubar=no,max=no,scrollbars=no,resizable=no,width=318,height=170,top='+vPosicaoV+',left='+vPosicaoH);
    //document.WMPlay.Play(); 
} 
function StopClick() 
{ 
   /* numero = 1; 
    document.WMPlay.Stop(); 
    if (navigator.appName.indexOf('Netscape') != -1) { 
        document.WMPlay.SetCurrentPosition(0); 
    } else { 
        document.WMPlay.CurrentPosition = 0; 
    } */
	win.close();
} 
function UpVolumeClick() 
{ 
    if (document.WMPlay.Volume <= -300) { 
        document.WMPlay.Volume = document.WMPlay.Volume + 300; 
    } 
} 
function DownVolumeClick() 
{ 
    if (document.WMPlay.Volume >= -8000) { 
        document.WMPlay.Volume = document.WMPlay.Volume - 300; 
    } 
}
arrSemana = new Array("Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado");
arrMes = new Array("janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro");
function data() {
	hoje = new Date();
	dia = hoje.getDate(); if (dia==1) dia+="&ordm";
	diaSem = arrSemana[hoje.getDay()];
	mes = arrMes[hoje.getMonth()];
	ano = hoje.getYear();
	if (ano<1900) ano+=1900;
	hora = hoje.getHours(); if (hora.toString().length<2) hora = "0"+hora;
	mins = hoje.getMinutes(); if (mins.toString().length<2) mins = "0"+mins;
	document.write(diaSem +", "+ dia +" de "+ mes +" de "+ ano);
}
function Select_vender(){
	//if(document.getElementById("bvenda_on").name == 
	document.getElementById("bvenda_on").src="./_images/b_vender_at.jpg";
	document.getElementById("bcomprar_on").src="./_images/b_comprar_ds.jpg";
	document.getElementById("btrocar_on").src="./_images/b_Trocar_ds.jpg";
}
function Select_comprar(){
	//if(document.getElementById("bvenda_on").name == 
	document.getElementById("bvenda_on").src="./_images/b_vender_ds.jpg";
	document.getElementById("btrocar_on").src="./_images/b_Trocar_ds.jpg";	
	document.getElementById("bcomprar_on").src="./_images/b_comprar_at.jpg";
}
function Select_trocar(){
	//if(document.getElementById("bvenda_on").name == 
	document.getElementById("btrocar_on").src="./_images/b_trocar_at.jpg";
	document.getElementById("bvenda_on").src="./_images/b_vender_ds.jpg";
	document.getElementById("bcomprar_on").src="./_images/b_comprar_ds.jpg";	
}
function imp_noticias(vNoticia) {
    window.open('noticias_imprimir.asp?vNoticia='+vNoticia,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,max=yes,scrollbars=yes,resizable=yes,width=600,height=400,top=10,left=10')    
}
function imp_nmusicais(vNmusicais) {
    window.open('nmusicais_imprimir.asp?vNmusicais='+vNmusicais,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,max=yes,scrollbars=yes,resizable=yes,width=600,height=400,top=10,left=10')    
}
function localiza_email(ConteudoEmail) {
	var vEmail;
	vEmail = ConteudoEmail.value;
    window.open('cadastro_vemail.asp?vEmail='+vEmail,'id_email','toolbar=no,location=no,directories=no,status=no,menubar=no,max=yes,scrollbars=yes,resizable=yes,width=600,height=400,top=10,left=10')    
}
function ContaTexto(objComentario, objContador, LimitMax){
	if (objComentario.value.length > LimitMax)
		{objComentario.value = objComentario.value.substring(0, LimitMax);}
	else
		{objContador.value = LimitMax - objComentario.value.length;}
}
function Banners(vB1, vB2){
	var vBanner_1 = vB1
	var vBanner_2 = vB2
	var MNews = new Array(); 
	MNews[0]= vBanner_1
	MNews[1]= vBanner_2
	var Numero = Math.floor(Math.random()*2);
	document.write(MNews[Numero]);
}
