﻿
                    
function abrir(archivo) {
    hidden = open(archivo, '', 'top=200,left=200,width=800,height=600,status=yes,resizable=yes,scrollbars=yes');
}


function abreVentana(url,winName,width,height) {
    var features="width="+width+", height="+height+", scrollbars=yes";
    var vent = window.open(url, winName, features);
    vent.focus();
   return false;
}

function controlCaracteres(nombreControl, maxCaracteres) {
    var texto = document.getElementById('ctl00_ContentPlaceHolder1_' + nombreControl).value;
    if (texto.length >= maxCaracteres) {
        document.getElementById('ctl00_ContentPlaceHolder1_' + nombreControl).value = texto.substr(0, maxCaracteres);
    }

}

function enviarClick(hayAsunto) {
    if (hayAsunto) {
        var textoAsunto = document.getElementById('ctl00_ContentPlaceHolder1_' + nuevoAsunto).Content;
        if (textoAsunto.length = 0) {
            return alert('Es obligatorio especificar un asunto para el mensaje');
        }
    } else {
        var textoMensaje = document.getElementById('ctl00_ContentPlaceHolder1_' + nuevoMensaje).Content;
        if (textoAsunto.length = 0) {
            return alert('Es obligatorio especificar un mensaje');
        }
    }
}

function controlCaracteresComentarios(nombreControl, maxCaracteres) {
    var texto = document.getElementById(nombreControl).value;
    if (texto.length >= maxCaracteres) {
        document.getElementById(nombreControl).value = texto.substr(0, maxCaracteres);
    }

}

        function OnClientCommandExecuting(editor, args) {
            var name = args.get_name();
            var val = args.get_value();
            if (name == "Emoticons") {
                editor.pasteHtml("<img src='" + val + "'>");
                //Cancel the further execution of the command as such a command does not exist in the editor command list
                args.set_cancel(true);
            }
        }

        function mostrarRad(quePanel)
        {     
            if (document.getElementById("idUsuario").value != 0)
            {   
                if (document.getElementById("visibleRad" + quePanel).value=="0")
                {
                    document.getElementById("panelNuevo" + quePanel).style.display="inline";
                    document.getElementById("visibleRad" + quePanel).value="1";
                    if(quePanel==1){quePanel=2}else{quePanel=1;}
                    if (document.getElementById("visibleRad" + quePanel).value=="1"){
                        document.getElementById("panelNuevo" + quePanel).style.display="none";
                        document.getElementById("visibleRad" + quePanel).value="0"
                    }
                }
            }
            else{
                    alert("Debes identificarte para poder publicar una respuesta");
                } 
        } 
        
        function ocultarRad(quePanel)
        {            
            if (document.getElementById("visibleRad" + quePanel).value=="1")
            {
                document.getElementById("panelNuevo" + quePanel).style.display="none";
                document.getElementById("visibleRad" + quePanel).value="0" 
            }       
        }
        
        function denunciar()
        {
         if (document.getElementById("idUsuario").value == "0")
         {
         alert('Debes identificarte para poder denunciar un Post o Tema');
         return false;
         }
         else
         {
           return true;
         }
        }

        function mostrarPanel(nombrePanel) {
            document.getElementById('tablaca').style.display = 'inline';
            document.getElementById('panelResultados').style.display = 'none';
            document.getElementById('panelEquipos').style.display = 'none';
            document.getElementById('panelPilotos').style.display = 'none';
            document.getElementById('panelClasificacion').style.display = 'none';
            document.getElementById('panelCalendario').style.display = 'none';
            document.getElementById(nombrePanel).style.display = 'inline';
            document.getElementById('ctl00_ContentPlaceHolder1_botonera_btCircuitos').src = 'images/sub2.jpg';
            document.getElementById('ctl00_ContentPlaceHolder1_botonera_btEquipos').src = 'images/sub3.jpg';
            document.getElementById('ctl00_ContentPlaceHolder1_botonera_btPilotos').src = 'images/sub4.jpg';
            document.getElementById('ctl00_ContentPlaceHolder1_botonera_btResultados').src = 'images/sub5.jpg';
            document.getElementById('ctl00_ContentPlaceHolder1_botonera_btCalendario').src = 'images/sub7.jpg';
            document.getElementById('ctl00_ContentPlaceHolder1_botonera_btCircuitos').disabled= true;
            document.getElementById('ctl00_ContentPlaceHolder1_botonera_btEquipos').disabled = true;
            document.getElementById('ctl00_ContentPlaceHolder1_botonera_btPilotos').disabled = true;
            document.getElementById('ctl00_ContentPlaceHolder1_botonera_btResultados').disabled = true;
            document.getElementById('ctl00_ContentPlaceHolder1_botonera_btCalendario').disabled = true;           
            if (nombrePanel != 'panelResultados') {
                document.getElementById('ctl00_ContentPlaceHolder1_botonera_btCircuitos').src = 'images/sub2over.jpg';
                document.getElementById('ctl00_ContentPlaceHolder1_botonera_btCircuitos').disabled=false;
            }
            if (nombrePanel != 'panelEquipos') {
                document.getElementById('ctl00_ContentPlaceHolder1_botonera_btEquipos').src = 'images/sub3over.jpg';
                document.getElementById('ctl00_ContentPlaceHolder1_botonera_btEquipos').disabled = false;
            }
            if (nombrePanel != 'panelPilotos') {
                document.getElementById('ctl00_ContentPlaceHolder1_botonera_btPilotos').src = 'images/sub4over.jpg';
                document.getElementById('ctl00_ContentPlaceHolder1_botonera_btPilotos').disabled = false;
            }
            if (nombrePanel != 'panelClasificacion') {
                document.getElementById('ctl00_ContentPlaceHolder1_botonera_btResultados').src = 'images/sub5over.jpg';
                document.getElementById('ctl00_ContentPlaceHolder1_botonera_btResultados').disabled = false;
            }
            if (nombrePanel != 'panelCalendario') {
                document.getElementById('ctl00_ContentPlaceHolder1_botonera_btCalendario').src = 'images/sub7over.jpg';
                document.getElementById('ctl00_ContentPlaceHolder1_botonera_btCalendario').disabled = false;
            }
            return false;
         }



         sas_1 = Math.round(Math.random() * 10000000000); sas_2 = 1; function SmartAdServer(sas_3, sas_4, sas_5) { if (sas_2 == 1) { sas_2 = 0; sas_6 = 'M'; } else { sas_6 = 'S'; }; sas_7(sas_3, sas_4, sas_6, sas_5); if (sas_6 == 'M') { sas_7(sas_3, 3851, 'S', sas_5); }; } function sas_7(sas_8, sas_9, sas_10, sas_11) { document.write('<SCR' + 'IPT SRC=" http://reachandrich.antevenio.com/call/pubj/' + sas_8 + '/' + sas_9 + '/' + sas_10 + '/' + sas_1 + '/' + escape(sas_11) + '?"></SCR' + 'IPT>'); }