function AbreLetra(ID){
	var T, L, W, H, P
	
	W = 540;
	H = 420;
	L = (window.screen.width/2) - (W/2);
	T = (window.screen.height/2) - (H/2);
	window.open('letramusica.asp?ID='+ID, 'MuralRecados', 'width='+ W +' height='+ H +' top='+T+' left='+ L +', scrollbars=yes');
}

function AbreShow(ID, Local){
	var T, L, W, H, P
	
	W = 450;
	H = 130;
	L = (window.screen.width/2) - (W/2);
	T = (window.screen.height/2) - (H/2);
	if (Local == 1)
	{
		window.open('agenda/informacoes.asp?EventoID='+ID, 'InformaçõesShow', 'resizable=yes width='+ W +' height='+ H +' top='+T+' left='+ L +', scrollbars=yes');
	}
	else
	{
		window.open('informacoes.asp?EventoID='+ID, 'InformaçõesShow', 'resizable=yes width='+ W +' height='+ H +' top='+T+' left='+ L +', scrollbars=yes');
	}
	
}

function AbreCD(ID){
	var T, L, W, H, P
	
	W = 450;
	H = 350;
	L = (window.screen.width/2) - (W/2);
	T = (window.screen.height/2) - (H/2);
	window.open('VerCD.asp?CdID='+ID, 'InformaçõesCD', 'width='+ W +' height='+ H +' top='+T+' left='+ L +', scrollbars=yes');
}

function AbreCifra(ID){
	var T, L, W, H, P
	
	W = 540;
	H = 420;
	L = (window.screen.width/2) - (W/2);
	T = (window.screen.height/2) - (H/2);
	window.open('ciframusica.asp?ID='+ID, 'MuralRecados', 'width='+ W +' height='+ H +' top='+T+' left='+ L +', scrollbars=yes');
}

function AbreRecado(Caminho){
	var T, L, W, H, P
	
	W = 540;
	H = 330;
	L = (window.screen.width/2) - (W/2);
	T = (window.screen.height/2) - (H/2);
	window.open('mural_mensagem.asp', 'MuralRecados', 'width='+ W +' height='+ H +' top='+T+' left='+ L +', scrollbars=no');
}

function AbreIndique(){
	var T, L, W, H, P
	
	W = 540;
	H = 330;
	L = (window.screen.width/2) - (W/2);
	T = (window.screen.height/2) - (H/2);
	window.open('indique.asp', 'MuralRecados', 'width='+ W +' height='+ H +' top='+T+' left='+ L +', scrollbars=no');
}

function AbrirVideo(ID){
	var T, L, W, H, P
	W = 710;
	H = 470;
	L = (window.screen.width/2) - (W/2);
	T = (window.screen.height/2) - (H/2);
	window.open('vervideo.asp?ID='+ ID, 'Vídeo', 'width='+ W +' height='+ H +' top='+T+' left='+ L +', scrollbars=yes');
}

//-----------------------------------------------------------------------------------------------------------------------------------
    /***
    * Descrição.: formata um campo do formulário de acordo com a máscara informada...
    * Parâmetros: - objForm (o Objeto Form)
    * - strField (string contendo o nome do textbox)
    * - sMask (mascara que define o formato que o dado será apresentado, usando o algarismo "9" para
    * definir números e o símbolo "!" para qualquer caracter...
    * - evtKeyPress (evento)
    *
    * Uso: <input type="textbox" name="xxx" onkeypress="return txtBoxFormat(document.rcfDownload, 'str_cep', '99999-999', event);">
    * Observação: As máscaras podem ser representadas como os exemplos abaixo:
    * CEP -> 99999-999
    * CPF -> 999.999.999-99
    * CNPJ -> 99.999.999/9999-99
    * C/C -> 999999-!
    * Tel -> (99) 9999-9999
	* IE -> 999.999.999.999
	* DATA DE NASCIMENTO -> 99/99/9999
    ***/

    function txtBoxFormat(objForm, strField, sMask, evtKeyPress) {
      var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;

      if(document.all) { // Internet Explorer
        nTecla = evtKeyPress.keyCode; }
      else if(document.layers) { // Nestcape
        nTecla = evtKeyPress.which;
      }

      sValue = objForm[strField].value;

      // Limpa todos os caracteres de formatação que
      // já estiverem no campo.
      sValue = sValue.toString().replace( "-", "" );
      sValue = sValue.toString().replace( "-", "" );
      sValue = sValue.toString().replace( ".", "" );
      sValue = sValue.toString().replace( ".", "" );
      sValue = sValue.toString().replace( "/", "" );
      sValue = sValue.toString().replace( "/", "" );
      sValue = sValue.toString().replace( ":", "" );
      sValue = sValue.toString().replace( ":", "" );
      sValue = sValue.toString().replace( "(", "" );
      sValue = sValue.toString().replace( "(", "" );
      sValue = sValue.toString().replace( ")", "" );
      sValue = sValue.toString().replace( ")", "" );
      sValue = sValue.toString().replace( " ", "" );
      sValue = sValue.toString().replace( " ", "" );
      fldLen = sValue.length;
      mskLen = sMask.length;

      i = 0;
      nCount = 0;
      sCod = "";
      mskLen = fldLen;

      while (i <= mskLen) {
        bolMask = ((sMask.charAt(i) == "-") || (sMask.charAt(i) == ".") || (sMask.charAt(i) == "/") || (sMask.charAt(i) == ":"))
        bolMask = bolMask || ((sMask.charAt(i) == "(") || (sMask.charAt(i) == ")") || (sMask.charAt(i) == " "))

        if (bolMask) {
          sCod += sMask.charAt(i);
          mskLen++; }
        else {
          sCod += sValue.charAt(nCount);
          nCount++;
        }

        i++;
      }

      objForm[strField].value = sCod;

      if (nTecla != 8) { // backspace
        if (sMask.charAt(i-1) == "9") { // apenas números...
          return ((nTecla > 47) && (nTecla < 58)); } // números de 0 a 9
        else { // qualquer caracter...
          return true;
        } }
      else {
        return true;
      }
    }
//-----------------------------------------------------------------------------------------------------------------
	function Paginar(NPagina, TPagina){
		if(NPagina == ""){
			alert("Digite um número para páginar!");
			Pagina.focus();
		}else{
			if( parseInt(NPagina) > parseInt(TPagina) ){
				alert("O Número da página digitado é maior que o total de páginas existentes!");
				Pagina.value = ""
				Pagina.focus();
			}else{
				var URL;
				var Dados;
				var VetorDados;
				
				URL = window.location.href;
				
				Dados = "P=" + NPagina;
				if( URL.indexOf("?") != -1 ){
					if( URL.indexOf("&") == -1 ){
						VetorDados = URL.split("?")[1].split("=");
						if(VetorDados[0].toString() != "P"){								
							Dados += "&"+ VetorDados[0] +"="+ VetorDados[1];
						};
					}else{
						VetorDados = URL.split("?")[1].split("&");
						for(AUX=0; AUX <= VetorDados.length-1; AUX++){
							if( VetorDados[AUX].split("=")[0].toString() != "P" && VetorDados[AUX].split("=")[0].toString() != "acao" ){
								Dados += "&"+ VetorDados[AUX];
							};
						};
					};
				};
				window.location.href='?' + Dados;
			};
		};
	}
	
	
		function SoNumero(){
		if(event.keyCode < 48 || event.keyCode > 57){
			event.returnValue = false;
		};
	}

function pngAlphaLoader(sNomeImg, iWidth, iHeight)
{   
	if (navigator.userAgent.indexOf('MSIE') >= 0)
	{
		sConteudo = "<span style=\"cursor:pointer;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+sNomeImg+"'); width:"+iWidth+";height:"+iHeight+"px;\" >"+
					"<img style=\"cursor:pointer;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0)\" src=\""+sNomeImg+"\" width=\""+iWidth+"\" height=\""+iHeight+"\" border=\"0\" alt=\"\">"
					"</span>";
	}
	else
	{
			sConteudo = "<img src=\""+sNomeImg+"\" width=\""+iWidth+"\" height=\""+iHeight+"\" border=\"0\" alt=\"\">";
	}
	document.write(sConteudo);
}