﻿
         var prefijoPagina = "ctl00_ContentPlaceHolder1_";
         var prefijoPagina = "";
         var releasePulsado = false;


         function RollOver(imagen) {
             if (imagen.src.indexOf('images/btOcultarFicha.jpg') != -1) {
                 imagen.src = 'images/btOcultarFichaOver.jpg'
             }
             else {
                 imagen.src = 'images/btVerFichaOver.jpg'
             }
             ;
         }

         function RollOut(imagen) {
             if (!releasePulsado) {
                 if (imagen.src.indexOf('images/btOcultarFichaOver.jpg') != -1) {

                     imagen.src = 'images/btOcultarFicha.jpg'
                 }
                 else {
                     imagen.src = 'images/btVerFicha.jpg'

                 }
             }
             else {
                 releasePulsado = false;
             }
         }

         function release(imagen) {
             releasePulsado = true;
             if (imagen.src.indexOf("images/btOcultarFicha") != -1) {
                 imagen.src = "images/btVerFicha.jpg";
             }
             else {
                 imagen.src = "images/btOcultarFicha.jpg";
             }
         }

        function abreVentana(url, winName, width, height) {

             var alto = (screen.height / 2) - (height / 2);
             var ancho = (screen.width / 2) - (width / 2);
             var features = "width=" + width + ", height=" + height + ", scrollbars=yes,top=" + alto + ",left=" + ancho;
             var vent = window.open(url, winName, features);
             vent.focus();
             return false;
         }

         function confirmarBorrado() {
             return confirm('Se va proceder a eliminar el registro seleccionado');
         }

         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 controlCaracteres(nombreControl, maxCaracteres) {
             var texto = document.getElementById(nombreControl).value;
             if (texto.length >= maxCaracteres) {
                 document.getElementById(nombreControl).value = texto.substr(0, maxCaracteres);
             }

         }

         function redirect(codDestino) {

             switch (codDestino) {
                 case "-1": document.location.href = document.location.href;
                     break;
                 case "0": document.location.href = "registro.aspx";
                     break;
                 //           case "1": window.open("tienda/Default.aspx", 'tienda', 'location=yes,directories=yes,status=yes,scrollbars=yes,width=1000,height=700'); 
                 //               break; 
                 case "2": document.location.href = "listadoRutas.aspx";
                     break;
                 case "3": document.location.href = "jugar.aspx";
                     break;
                 case "4": document.location.href = "listadoVideos.aspx";
                     break;
                 case "5": document.location.href = "listadoNoticias.aspx";
                     break;
                 case "6":
                     //alert("En nueva construcción");
                     //document.location.href = "#";
                     document.location.href = "foro.aspx";
                     break;
                 case "7":
                     //alert("En nueva construcción");
                     //document.location.href = "#";
                     document.location.href = "tablon.aspx";
                     break;
                 case "8": document.location.href = "galeriaFotos.aspx";
                     break;
             }
         }


         function abreVentanaZoom(url, winName, width, height) {
             var features = "width=" + width + ", height=" + height + ", scrollbars=no";
             var vent = window.open(url, winName, features);
             vent.focus();

         }

         function abreBasesLegales() {


             var url = "basesLegalesJuego.pdf";
             var winName = "basesLegalesJuego";
             var features = "width=600, height=750, scrollbars=auto";
             var vent = window.open(url, winName, features);
             vent.focus();

         }

         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 {
                 alerta('Es necesario estar identificado para poder publicar');
             }
         }

         function alerta(texto) {             
             return false;
         }

         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;
             }
         }       
        

      
    