function teleFormula(){
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '320',
			'height', '270',
			'src', 'LiveVideo320x240',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'LiveVideo320x240',
			'bgcolor', '#ffffff',
			'name', 'LiveVideo320x240',
			'menu', 'true',
			'allowFullScreen', 'true',
			'allowScriptAccess','sameDomain',
			'movie', 'LiveVideo320x240',
			'salign', ''
			); //end AC code
	}
}

function _version ()
{
  _version=11;
  if (navigator.userAgent.indexOf('Mozilla/3') != -1){
  _version=10;} 
}

var oas='http://ads.radioformula.com.mx/RealMedia/ads/';
var site = "www.radioformula.com.mx";
var RN = new String (Math.random());
var RNS = RN.substring (2, 11);

function DisplayAds (page, position, width, height)
{
	var oaspage= site + '/' + page +'/1' + RNS +'@' + position;

	if (_version < 11) {
	document.write ('<A HREF="' + oas + 'click_nx.cgi/'+ oaspage + '" TARGET="_top" ><IMG SRC="' + oas + 'adstream_nx.cgi/' + oaspage + '" BORDER="0" WIDTH="' + width + '" HEIGHT="' + height + '"></a>');
	}
	else
	{
		document.write ('<'+'SCRIPT LANGUAGE="JavaScript1.1" SRC="' + oas + 'adstream_jx.cgi/' + oaspage + '">');
		document.write ('\<\!-- --\>');
		document.write ('\<\/SCRIPT\>');
 	   document.write ('\<\!-- --\>');
	}
}




/*Funcion de Fecha para la nueva versión */

function despliegas(variable,ancho,alto,barr) {
if (!barr) v_bar=0; else v_bar=1;
window.open(variable,"Online","scrollbars="+v_bar+",resizable=yes,width="+ancho+",height="+alto);
}


        function validaDatosAV(){
 		    if(IsBlank(document.forms.frmForma.tex_Archivo.value)){
			    alert("Proporcione el nombre del archivo");
			    document.frmForma.tex_Archivo.value="";
			    document.frmForma.tex_Archivo.focus();
			    return;
		    }

            sLista="abcdefghijklmnopqrstuvwxyz_1234567890";

 		    if(!esCaracterPermitido(sLista,document.frmForma.tex_Archivo.value)){
 		        alert("Sólo se permiten caracteres alfanumericos y guion bajo. Por ejemplo: 080908_tpm")
			    document.frmForma.tex_Archivo.focus();
			    return;
		    }

 		    if(document.forms.frmForma.sExt.value==""){
			    alert("Seleccione la extensión del archivo");
			    document.frmForma.sExt.focus();
			    return;
		    }

 		    if(IsBlank(document.forms.frmForma.tex_Titulo.value)){
			    alert("Proporcione el Titulo");
			    document.frmForma.tex_Titulo.value="";
			    document.frmForma.tex_Titulo.focus();
			    return;
		    }


 		    if(IsBlank(document.forms.frmForma.tex_Titulo.value)){
			    alert("Proporcione el Titulo");
			    document.frmForma.tex_Titulo.value="";
			    document.frmForma.tex_Titulo.focus();
			    return;
		    }
		    
 		    if(document.forms.frmForma.tex_Titulo.value.length>230){
			    alert("Sólo puede proporcionar 200 caracteres");
			    document.frmForma.tex_Titulo.value=document.frmForma.tex_Titulo.value.substring(0,200);
			    document.frmForma.tex_Titulo.focus();
			    return;
		    }
		    

 		    if(document.forms.frmForma.rad_VideoVideo.value=="V"&&IsBlank(document.forms.frmForma.tex_imagen.value)){
			    alert("Proporcione el nombre de la imagen");
			    document.frmForma.tex_imagen.value="";
			    document.frmForma.tex_imagen.focus();
			    return;
		    }
		    
		    if (document.forms.frmForma.tex_imagen.value!=""){
		        sLista="abcdefghijklmñnopqrstuvwxyz1234567890.";
 		        if(!esCaracterPermitido(sLista,document.forms.frmForma.tex_imagen.value)){
 		            alert("Sólo se permiten caracteres alfanumericos. Por ejemplo: edgar01.jpg")
			        document.frmForma.tex_imagen.focus();
			        return;
		        }
		        arc_sNombreArchivo=document.frmForma.tex_imagen.value.toLowerCase();
		        arrsNombreArchivo=arc_sNombreArchivo.split(".")
			    if(arrsNombreArchivo.length!=2){
				    alert("El nombre del archivo no es correcto");
			        document.frmForma.tex_imagen.focus();
				    return;
			    }
    			
			    if(IsBlank(arrsNombreArchivo[0])){
				    alert("El nombre del archivo no es correcto");
			        document.frmForma.tex_imagen.focus();
				    return;
			    }

			    if(IsBlank(arrsNombreArchivo[1])){
				    alert("La extesión no es correcta");
			        document.frmForma.tex_imagen.focus();
				    return;
			    }
			    
			    if (arrsNombreArchivo[1]!="jpg" && arrsNombreArchivo[1]!="gif" ){
				    alert("Solo se permiten imagenes con la extensión .jpg o .gif");
			        document.frmForma.tex_imagen.focus();
				    return;
			        
			    }
		    }
            document.frmForma.submit();

        }


function playMedia(mediaURL,rpt,height,width,pAuto) {


var mediaURL,rpt,height,width,pAuto


if (GetBrowser() == "IE")
	playAll(mediaURL,rpt,height,width,pAuto) ;  
else if (GetBrowser() == "unknown")
	embedSource(mediaURL,rpt,height,width,pAuto) ;
else if (navigator.appName.substring(0,5) == "WebTV")
	embedSource(mediaURL,rpt,height,width,pAuto) ;
else
	playAll(mediaURL,rpt,height,width,pAuto) ;
}

function embedSource(mediaURL,rpt,height,width,pAuto) {

    var CodeGen = ""
    var mediaURL,rpt,height,width,pAuto
 		 	
	 CodeGen = '<embed src="' + mediaURL + '"' + '\n' ;
	 CodeGen += ' height=' + height + ' width=' + width + ' autostart="'+pAuto+'"' + '\n'
	 CodeGen += ' LOOP=' + rpt + '>'
	 
    document.write(CodeGen)

}

function playAll(mediaURL,rpt,height,width,pAuto) {
		var CodeGen = "" 
					 	

		CodeGen = '<embed type="application/x-mplayer2" ' + '\n' ;
    	CodeGen += ' pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" ' + '\n' ;
	 	CodeGen += 'Name="Player" ' + 'src="' + mediaURL + '" ' + '\n' ;
	 	CodeGen += 'autoStart='+pAuto+' ' ;
		if ((height == 24) && (width == 299)) 
			CodeGen = CodeGen + 'ShowStatusBar=1 '; 
		if ((height >= 50) && (height <= 75) && (width >= 200)) 
			CodeGen = CodeGen + 'ShowStatusBar=1 '; 
		if ((height > 75) && (width >= 150)) 
			CodeGen = CodeGen + 'ShowStatusBar=0 '; 
		if ((height <= 49) && (width != 299))
			CodeGen += 'ShowStatusBar=0 '; 
		CodeGen += 'enableContextMenu=1 cache=0 ' + '\n' ;
		CodeGen += 'playCount=' + rpt + ' ' ;
		CodeGen += 'volume=-1 ' ;
		CodeGen += 'HEIGHT=' + height + ' WIDTH=' + width + '>'
			
			document.write(CodeGen)
	
}

function GetBrowser()
{
   var agt=navigator.userAgent.toLowerCase();
   if( ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) )
       return "IE";
   else if( ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
         && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
         && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)) )
       return "Netscape";
   else
       return "unknown";
}

function abreFotoGal(pAnio,pGal){
		abreVentana('/fotogaleria/rfg2000.asp?pAnio='+pAnio+"&pGal="+pGal,920,670,0,0,0,0)

}

function abreVentana(pagina,ancho,alto,ptoolbar,pmenubar,pscrollbars,presizable){
		var1="width="+ancho+",height="+alto+",toolbar="+ptoolbar+",location=no,directories=no,status=no,menubar="+pmenubar+",scrollbars="+pscrollbars+",resizable="+presizable
        ventanaOp=window.open(pagina,"Acceso", var1);
        ventanaOp.resizeTo(Width=ancho,Height=alto)
        ventanaOp.focus();
}

function Arreglo(){
  this.length = Arreglo.arguments.length 
  for (var i = 0; i < this.length; i++)
    this[i] = Arreglo.arguments[i]
}

function ventana(val){
     ventanaOP=window.open('/audiovideo/video.asp?Idvideo='+val, 'videowindows3', 'toolbar=0, resizable=0, location=0, status =0, scrollbars=0, top=50, left=120, width=712, height=586');
     ventanaOP.focus();
}

function mostrar(pNomDiv,pId,pPagina){ 
    document.frmAudioVideo.action=pPagina;
    iId=0;
    if(document.frmAudioVideo.Idvideo.value!=""&&document.frmAudioVideo.Idvideo.value!="0"){
            iId=document.frmAudioVideo.Idvideo.value;
            document.frmAudioVideo.Idvideo.value=0;
            self.frames["frmContenido"+iId].location.href=pPagina;
            //document.frmAudioVideo.target="frmContenido"+iId            
            //document.frmAudioVideo.submit();
            ocultar(pNomDiv,iId);

    }

    if (parseFloat(iId)!=parseFloat(pId)){
        document.frmAudioVideo.target="frmContenido"+pId;
        document.frmAudioVideo.Idvideo.value=pId;
        document.frmAudioVideo.submit();
        document.getElementById(pNomDiv+pId).style.display="";        

    }   


} 

function ocultar(pNomDiv,pId){ 
    document.getElementById(pNomDiv+pId).style.display="none"; 

} 

function fecha() {
  var ndia  = new Array("Domingo", "Lunes", "Martes", "Mi&eacute;rcoles", "Jueves", "Viernes", "Sabado");
  var nmes  = new Array('enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre');
  var ahora;
  var fecha = new Date();
  var ano   = fecha.getYear();
  var mes   = fecha.getMonth();
  var dia   = fecha.getDay();
  var dian  = fecha.getDate();
  if (ano < 200)
  	{ano += 1900;}		
  /*ahora = ndia[dia] + " " + dian + " de " + nmes[mes] + " de " + ano;*/
  //ahora = nmes[mes] + " " + dian + ", " + ano;
  ahora =  ndia[dia] + ", " + dian + " de " + nmes[mes] + " " + ano;
  //return ahora;
  document.write (ahora);
}

function _version ()
{
  _version=11;
  if (navigator.userAgent.indexOf('Mozilla/3') != -1){
  _version=10;} 
}

var oas='http://ads.radioformula.com.mx/RealMedia/ads/';
var site = "www.radioformula.com.mx";
var RN = new String (Math.random());
var RNS = RN.substring (2, 11);



/*Funcion de para los popup de las estaciones on-line */
	function estforaneas (archivo)
	{
	   open('/radio/' + archivo,'window3','scrollbars=0,width=556,height=445');
	}

	function egrupero() {open("/radio/fgrupero.htm","window2","scrollbars=0,width=550,height=445");}
	function ejuvenil() {open("/radio/fjuvenil.htm","window2","scrollbars=0,width=550,height=445");}
	function epop() {open("/radio/fpop.htm","window2","scrollbars=0,width=550,height=445");}
	function einternacional() {open("/radio/finternacional.htm","window2","scrollbars=0,width=550,height=445");}
	function ejazz() {open("/radio/fjazz.htm","window2","scrollbars=0,width=550,height=445");}
	function emexicana() {open("/radio/fmexicana.htm","window2","scrollbars=0,width=550,height=445");}
	function eoldies() {open("/radio/foldies.htm","window2","scrollbars=0,width=550,height=445");}
	function eromantica() {open("/radio/fromantica.htm","window2","scrollbars=0,width=550,height=445");}
	function edkdas() {open("/radio/fdkdas.htm","window2","scrollbars=0,width=550,height=445");}
	function erock() {open("/radio/frock.htm","window2","scrollbars=0,width=550,height=445");}
	function eradioai() {open("/radio/fradioai.htm","window2","scrollbars=0,width=550,height=445");}
	function elacueva() {open("/radio/flacueva.htm","window2","scrollbars=0,width=550,height=445");}
	function eangeles() {open("/radio/fangeles.htm","window2","scrollbars=0,width=550,height=445");}
	function eclasica() {open("/radio/fclasica.htm","window2","scrollbars=0,width=550,height=445");}
	function etrova() {open("/radio/ftrova.htm","window2","scrollbars=0,width=550,height=445");}

	function abremusica() {
	open("/radio/fgrupero.htm","window2","scrollbars=0,width=550,height=445");
	window.close();
	}
	function abrelocales() {
	open("/radio/f1470.htm","window1","scrollbars=0,width=511,height=385");
	window.close();
	}
	function e970() {open("/radio/f970.htm","window1","scrollbars=0,width=511,height=385");}
	function e1470() {open("/radio/f1470.htm","window1","scrollbars=0,width=511,height=385");}
	function e1500() {open("/radio/f1500.htm","window1","scrollbars=0,width=511,height=385");}
	function e1033() {open("/radio/f103.htm","window1","scrollbars=0,width=511,height=385");}
	function e1041() {open("/radio/f104.htm","window1","scrollbars=0,width=511,height=385");}



function valfecha(valores,pFormato)
{
	FechaArr = valores.split("/");
	if (pFormato=="mm/dd/aaaa"){
		DiaFecha = FechaArr[1];
		MesFecha = FechaArr[0];
		AniFecha = FechaArr[2];
	}

	if (pFormato=="dd/mm/aaaa"){
		DiaFecha = FechaArr[0];
		MesFecha = FechaArr[1];
		AniFecha = FechaArr[2];
	}
	
	if (isNaN(parseInt(DiaFecha, 10))){
		alert("Por favor proporcione la fecha correcta, el dia esta incorrecto, el formato es: "+pFormato);
		return false;
	}
	
	if (isNaN(parseInt(MesFecha, 10))){
		alert("Por favor proporcione la fecha correcta, el mes esta incorrecto, el formato es: "+pFormato);
		return false;
	}
	
	if (isNaN(parseInt(AniFecha, 10))){
		alert("Por favor proporcione la fecha correcta, el año esta incorrecto, el formato es: "+pFormato);
		return false;
	}


	if(NoTieneValoresNumericos(DiaFecha)){
		alert("Por favor proporcione la fecha correcta, el dia esta incorrecto, el formato es: "+pFormato);
		return false;
	}


	if(NoTieneValoresNumericos(MesFecha)){
		alert("Por favor proporcione la fecha correcta, el mes esta incorrecto, el formato es: "+pFormato);
		return false;
	}
	

	if(NoTieneValoresNumericos(AniFecha)){
		alert("Por favor proporcione la fecha correcta, el año esta incorrecto, el formato es: "+pFormato);
		return false;
	}
	
	
	if ((DiaFecha<=0) || (DiaFecha>31)) {
		alert("Por favor proporcione la fecha correcta, el dia esta incorrecto, el formato es: "+pFormato);
		return false;
	}
	
	if ((MesFecha<=0) || (MesFecha>12)) {
		alert("Por favor proporcione la fecha correcta, el mes esta incorrecto, el formato es: "+pFormato);
		return false;
	}

	if ((DiaFecha>30)&&((MesFecha==4)||(MesFecha==6)||(MesFecha==9)||(MesFecha==11))){
		alert("Por favor proporcione la fecha correcta, el día esta incorrecto, el formato es: "+pFormato);
		return false;
	}
	
	if ((DiaFecha>30)&&((MesFecha==4)||(MesFecha==6)||(MesFecha==9)||(MesFecha==11))){
		alert("Por favor proporcione la fecha correcta, el día esta incorrecto, el formato es: "+pFormato);
		return false;
	}
	
	if ((DiaFecha>30)&&((MesFecha==4)||(MesFecha==6)||(MesFecha==9)||(MesFecha==11))){
		alert("Por favor proporcione la fecha correcta, el día esta incorrecto, el formato es: "+pFormato);
		return false;
	}
	
	if ((AniFecha<1900) || (AniFecha>9000)) {
		alert("Por favor proporcione la fecha correcta, el año tiene que ser mayor a 1900 y solo puede contener 4 dígitos, el formato es: "+pFormato);
		return false;
	}
	
	if (((AniFecha % 4)!=0)&&(MesFecha==2)&&(DiaFecha>28)) {
			alert("Por favor proporcione la fecha correcta, el día esta incorrecto, el formato es: "+pFormato);
			return false;
	}
	
	if (((AniFecha % 4)==0)&&(MesFecha==2)&&(DiaFecha>29)) {
			alert("Por favor proporcione la fecha correcta, el día esta incorrecto, el formato es: "+pFormato);
			return false;
	}
	
	return true;
 }

function NoTieneValoresNumericos(pDato){
		pDato=pDato.toLowerCase();
		contador=0;
		sValoresPermitidos="1234567890";
		EsteCaracter="";
		for (var i=0; i < pDato.length; i++) {
			EsteCaracter=pDato.substring(i,i+1);
			EsteCaracter=EsteCaracter.toLowerCase();
			if (sValoresPermitidos.indexOf(EsteCaracter) == -1) {
				return true;
			}

		}


}


function IsBlank(strValor)
{
                strTmp=strValor;
                if (strTmp=="")
                        return true;
                else
                {
                        for(i=0;i<=strTmp.length-1;i++)
                        {
                                if (strTmp.charAt(i)!=" ")
                                {
                                        return false;
                                }
                        }
                }
                return true;
 }



function esCaracterPermitido(pValoresPermitidos,pDato){
		pDato=pDato.toLowerCase();
		contador=0;
		EsteCaracter="";
		for (var i=0; i < pDato.length; i++) {
			EsteCaracter=pDato.substring(i,i+1);
			EsteCaracter=EsteCaracter.toLowerCase();
			if (pValoresPermitidos.indexOf(EsteCaracter) == -1) {
				return false;
			}

		}
		return true;
}

function cambiaPagia(pPagina,pPaginaAux){
	document.frmBuscar.page.value=pPagina
	document.frmBuscar.pageInicio.value=pPaginaAux
	document.frmBuscar.submit();
}

function validaDatosBusqueda(){

	if(!esCaracterPermitido("áéíóúüabcdefghijklmnñopqrstuvwxyz1234567890 ",document.frmBuscar.txt_Busca.value)){
		alert("Sólo se permiten caracteres alfanumericos");
		document.frmBuscar.txt_Busca.focus();
		return;
	}

	if(document.frmBuscar.txt_fec1.value!=""&&!valfecha(document.frmBuscar.txt_fec1.value,"dd/mm/aaaa")){
		document.frmBuscar.txt_fec1.focus();
		return;
	}	

	if(document.frmBuscar.txt_fec2.value!=""&&!valfecha(document.frmBuscar.txt_fec2.value,"dd/mm/aaaa")){
		document.frmBuscar.txt_fec2.focus();
		return;
	}	
	
	//document.frmBuscar.action=document.frmBuscar.sNombrePag.value;
	document.frmBuscar.submit();
}

function enviaAV(pID){
    window.top.window.enviaAVDatos(pID);
}

function enviaAVDatos(pID){
    document.frmVA.Idvideo.value=pID;
    document.frmVA.submit();

}

function vrMasSelf(pPagina){
    self.close();
    opener.location.href=pPagina;
}


function vrMasB(pPagina){
    sPagina=pPagina;
    if (document.frmVA.pIdB.value==0){
        vrMasSelf('/rf3000.asp');
    }else{
        vrMasSelf(pPagina+'?pIdB='+document.frmVA.pIdB.value);
    }
}


   function cargaAudio(pNomDiv,pDiv,pId,pPagina){
        document.frmAudioVideo.action=pPagina;

	    valorSM = document.all(pNomDiv).item(pDiv).style.display;  
	    totalDivs = document.all(pNomDiv).length;
        for(i=0;i<totalDivs;i++){
            if (document.all(pNomDiv).item(i).style.display==""&&document.frmAudioVideo.Idvideo.value!=""){
                document.frmAudioVideo.target="frmContenido"+document.frmAudioVideo.Idvideo.value;            
                document.frmAudioVideo.Idvideo.value=0;
                document.frmAudioVideo.submit();
            }

           document.all("IdDiv").item(i).style.display = "none";
    		
        }
        
	    if (valorSM=="none"){
            document.frmAudioVideo.target="frmContenido"+pId;
            document.all(pNomDiv).item(pDiv).style.display = "";
            document.frmAudioVideo.Idvideo.value=pId;
            document.frmAudioVideo.submit();
          }
        
   }