function muestra_mensaje(){document.getElementById("div_mensaje").style.display = 'block';}
function fuera_mensaje(){document.getElementById("div_mensaje").style.display = 'none';}
function error(texto)
{
    muestra_mensaje();
    var tabla_info = "<table width='100%' height='100%' background='"+document.formulario['raiz'].value+"imagenes/fondo_gris.png' style='z-index:100; position: absolute; left: 0px; top: "+document.body.scrollTop+"px;'> <tr><td align='center'>";
            tabla_info += "<table width='400' bgcolor='#FEA3A3' style='border: 3px #A2101E solid;' cellspacing='0' cellpadding='0'>";
            tabla_info += "<tr><td height='10'></td></tr>";
            tabla_info += "<tr><td width='10'></td> <td class='texto' align='center'>"+texto+"</td> <td width='10'></td></tr>";
            tabla_info += "<tr><td height='10'></td></tr>";
            tabla_info += "<tr><td align='center' colspan='3'><input type='button' name='boton_aceptar' value='Aceptar' onclick='fuera_mensaje();' /></td></tr>";
            tabla_info += "<tr><td height='10'></td></tr>";
            tabla_info += "</table>";
    tabla_info += "</td></tr> </table>";
    document.getElementById("div_mensaje").innerHTML = tabla_info;
}
function exito(texto)
{
    muestra_mensaje();
    var tabla_info = "<table width='100%' height='100%' background='"+document.formulario['raiz'].value+"imagenes/fondo_gris.png' style='z-index:100; position: absolute; left: 0px; top: "+document.body.scrollTop+"px;'> <tr><td align='center'>";
            tabla_info += "<table width='400' bgcolor='#D9FFD2' style='border: 3px #106E00 solid;' cellspacing='0' cellpadding='0'>";
            tabla_info += "<tr><td height='10'></td></tr>";
            tabla_info += "<tr><td width='10'></td> <td class='texto' align='center'>"+texto+"</td> <td width='10'></td></tr>";
            tabla_info += "<tr><td height='10'></td></tr>";
            tabla_info += "<tr><td align='center' colspan='3'><input type='button' name='boton_aceptar' value='Aceptar' onclick='fuera_mensaje();' /></td></tr>";
            tabla_info += "<tr><td height='10'></td></tr>";
            tabla_info += "</table>";
    tabla_info += "</td></tr> </table>";
    document.getElementById("div_mensaje").innerHTML = tabla_info;
}
function confirmacion(texto)
{
    muestra_mensaje();
    var tabla_info = "<table width='100%' height='100%' background='"+document.formulario['raiz'].value+"imagenes/fondo_gris.png' style='z-index:100; position: absolute; left: 0px; top: "+document.body.scrollTop+"px;'> <tr><td align='center'>";
            tabla_info += "<table width='800' bgcolor='#FFF2AB' style='z-index:100; border: 3px #DAC17B solid;' cellspacing='0' cellpadding='0'>";
            tabla_info += "<tr><td height='10'></td></tr>";
            tabla_info += "<tr><td width='10'></td> <td width='780' align='center'><div style='width:780px; height:450px; overflow: auto;'>";
                tabla_info += "<div align='right'><img src='"+document.formulario['raiz'].value+"imagenes/lightbox-btn-close.gif' class='manita' onclick='fuera_mensaje();' alt='Cerrar' /></div>";
                tabla_info += "<div class='alto10'></div>";
                tabla_info += texto;
            tabla_info += "</div></td><td width='10'></td></tr>";
            tabla_info += "<tr><td height='10'></td></tr>";
            tabla_info += "</table>";
    tabla_info += "</td></tr> </table>";
    document.getElementById("div_mensaje").innerHTML = tabla_info;
}
function mas_info(url)
{
    var ajax = nuevoAjax();
    div_ajax(document.formulario['raiz'].value+url,"raiz="+document.formulario['raiz'].value,ajax);
    ajax.onreadystatechange=function()
    {
        if(ajax.readyState==4)
        {
            confirmacion(ajax.responseText);
        }
    }
}

function mas_info_video(url)
{
    var ajax = nuevoAjax();
    div_ajax_videos(document.formulario['raiz'].value+url,"raiz="+document.formulario['raiz'].value,ajax);
    ajax.onreadystatechange=function()
    {
        if(ajax.readyState==4)
        {
            confirmacion(ajax.responseText);
        }
    }
}

function despliega_info(url,div)
{
    if(document.formulario["bandera_"+div].value==0)
    {document.formulario["bandera_"+div].value = 1;
        var ajax = nuevoAjax();
        envio_ajax(div,url,"variable=1",ajax);
        ajax.onreadystatechange=function()
        {
            if(ajax.readyState==4)
            {
                document.getElementById(div).innerHTML = ajax.responseText;
            }
        }
    }else{document.getElementById(div).innerHTML = "";document.formulario["bandera_"+div].value = 0;}
}
function ayuda(e,texto)
{
    var posx = 0, posy = 0;
    var e = e || window.event;
    if (e.pageX || e.pageY)
    {
        posx = e.pageX+15;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY)
    {
        posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft+15;
        posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
    }
    muestra_mensaje();
    document.getElementById("div_mensaje").innerHTML = "<table id='tabla_ayuda' class='texto' width='300' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF' style='border: 2px solid #556379; position: absolute; left:"+posx+"; top:"+posy+";'> <tr><td height='10'></td></tr> <tr><td width='10'></td> <td><p align='justify'>"+texto+"</p></td> <td width='10'></td></tr> <tr><td height='10'></td></tr> </table>";
}
function popup_principal()
{
    muestra_mensaje();
    var tabla_info = "<table width='100%' height='100%' background='"+document.formulario['raiz'].value+"imagenes/fondo_gris.png' style='z-index:100; position: absolute; left: 0px; top: "+document.body.scrollTop+"px;'> <tr><td align='center'>";
            tabla_info += "<table width='800' bgcolor='#FFFFFF' style='border: 3px #062C79 solid;' cellspacing='0' cellpadding='0'>";
            tabla_info += "<tr><td height='15'></td></tr>";
            tabla_info += "<tr><td width='2%'></td> <td width='96%' align='right' height='450' valign='top'>";
                tabla_info += "<p align='right'><img src='"+document.formulario['raiz'].value+"imagenes/lightbox-btn-close.gif' class='manita' onclick='fuera_mensaje();' alt='Cerrar' /></p>";
                tabla_info += "<center><a href='premios/ganadores.php'><img src='imagenes/PopUpListaGanadores.jpg' alt='PopUp Principal' /></a><a href='premios/galeria_suv.php'><img src='imagenes/PopUpGaleriaGanadores.jpg' alt='PopUp Principal' /></a></center>";
            tabla_info += "</td><td width='2%'></td></tr>";
            tabla_info += "<tr><td height='15'></td></tr>";
            tabla_info += "</table>";
    tabla_info += "</td></tr> </table>";
    document.getElementById("div_mensaje").innerHTML = tabla_info;
}
function popup_diasfaltantes(dias)
{
    muestra_mensaje();
    var tabla_info = "<table width='100%' height='100%' background='"+document.formulario['raiz'].value+"imagenes/fondo_gris.png' style='z-index:100; position: absolute; left: 0px; top: "+document.body.scrollTop+"px;'> <tr><td align='center'>";
            tabla_info += "<table width='800' bgcolor='#FFFFFF' style='border: 3px #062C79 solid;' cellspacing='0' cellpadding='0'>";
            tabla_info += "<tr><td height='15'></td></tr>";
            tabla_info += "<tr><td width='40'></td> <td width='720' height='50' align='right'><img src='"+document.formulario['raiz'].value+"imagenes/lightbox-btn-close.gif' class='manita' onclick='fuera_mensaje();' alt='Cerrar' /></td> <td width='40'></td>";
            tabla_info += "<tr><td height='10'></td></tr>";
            tabla_info += "<tr><td width='40'></td> <td class='fondo_dias_faltantes manita' width='720' height='450' align='center' valign='middle' onclick=\"envia('puntosdeventa/index.php');\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class='texto_dias_faltantes'>"+dias+"</span><div class='alto20'></div></td> <td width='40'></td>";
            tabla_info += "<tr><td height='15'></td></tr>";
            tabla_info += "</table>";
    tabla_info += "</td></tr> </table>";
    document.getElementById("div_mensaje").innerHTML = tabla_info;
}
function popup_faltaUnDia()
{
    muestra_mensaje();
    var tabla_info = "<table width='100%' height='100%' background='"+document.formulario['raiz'].value+"imagenes/fondo_gris.png' style='z-index:100; position: absolute; left: 0px; top: "+document.body.scrollTop+"px;'> <tr><td align='center'>";
            tabla_info += "<table width='800' bgcolor='#FFFFFF' style='border: 3px #062C79 solid;' cellspacing='0' cellpadding='0'>";
            tabla_info += "<tr><td height='15'></td></tr>";
            tabla_info += "<tr><td width='40'></td> <td width='720' height='50' align='right'><img src='"+document.formulario['raiz'].value+"imagenes/lightbox-btn-close.gif' class='manita' onclick='fuera_mensaje();' alt='Cerrar' /></td> <td width='40'></td>";
            tabla_info += "<tr><td height='10'></td></tr>";
            tabla_info += "<tr><td width='40'></td> <td class='fondo_lista_ganadores manita' width='720' height='450' onclick=\"envia('premios/ganadores.php');\"><br /></td> <td width='40'></td>";
            tabla_info += "<tr><td height='15'></td></tr>";
            tabla_info += "</table>";
    tabla_info += "</td></tr> </table>";
    document.getElementById("div_mensaje").innerHTML = tabla_info;
}
function muestraObservacionesSondeos(texto)
{
    muestra_mensaje();
    var tabla_info = "<table width='100%' height='100%' background='"+document.formulario['raiz'].value+"imagenes/fondo_gris.png' style='z-index:100; position: absolute; left: 0px; top: "+document.body.scrollTop+"px;'> <tr><td align='center'>";
            tabla_info += "<table width='600' bgcolor='#FFF2AB' style='z-index:100; border: 3px #DAC17B solid;' cellspacing='0' cellpadding='0'>";
            tabla_info += "<tr><td height='10'></td></tr>";
            tabla_info += "<tr><td width='10'></td> <td width='780' align='center'><div style='width:580px; height:400px; overflow: auto;'>";
                tabla_info += "<div align='right'><img src='"+document.formulario['raiz'].value+"imagenes/lightbox-btn-close.gif' class='manita' onclick='fuera_mensaje();' alt='Cerrar' /></div>";
                tabla_info += "<div class='alto10'></div>";
                tabla_info += texto;
            tabla_info += "</div></td><td width='10'></td></tr>";
            tabla_info += "<tr><td height='10'></td></tr>";
            tabla_info += "</table>";
    tabla_info += "</td></tr> </table>";
    document.getElementById("div_mensaje").innerHTML = tabla_info;
}
