﻿
//var lx_style = '<style type="text/css">.black_overlay{display: none;position: absolute;top: 0%;left: 0%;width: 100%;height: 100%;background-color: #cccccc;z-index:1001;-moz-opacity: 0.8;opacity:.80;filter: alpha(opacity=80);}.white_content {display: none;	position: absolute;	top: 25%;left: 25%;	width: 50%;	height: 50%;padding: 0px;border: 1px solid #999999;background-color: white;z-index:1002;overflow:auto;}.white_contentTOP {display: none;	position: absolute;	top: 18%;left: 25%;	width: 50%;padding: 0px;border: 0px solid #000000;background-color: transparent;z-index:1002;overflow:hidden;}</style>';
//document.write(lx_style);

//var lx_overlay = '<div id="fade" class="black_overlay" onclick="javascript:FecharLightbox();"></div>';
//document.write(lx_overlay);

//var lx_contentTOP = '<div id="lightTOP" class="white_contentTOP">           <table width="100%" cellpadding="0" cellspacing="0" border="0">            <tr>                <td align="left">&nbsp;<div id="conteudo_titulo"></div></td>                <td align="right"><a href="javascript:FecharLightbox();"><img src="close.png" border="0" /></a></td>            </tr>           </table>                    </div>';
//document.write(lx_contentTOP);

//var lx_content = '<div id="light" class="white_content"><table width="100%" cellpadding="0" cellspacing="0" border="0" style="width: 100%;height: 100%;border: none;display: block;">                <tr>                    <td valign="top" style="padding:5px 5px 5px 5px;">                        <div id="white_content_conteudo" style="width: 100%;height:100%; background-color:#ffffff;">                            <iframe marginheight="0" marginwidth="0"  frameborder="0" style="width: 100%;height: 100%;border: none;display: block;" id="white_content_conteudo_frame"></iframe>                        </div>                                            </td>                </tr>            </table>                   </div>';
//document.write(lx_content);

var loc_js_ao_fechar = null;

function lx() {
    this.lx_js_ao_abrir = '';
    this.lx_js_ao_fechar = '';
    this.lx_conteudo = '';
    this.lx_titulo = '';
    this.lx_url = '';
    this.Abrir = AbrirLightbox;


    function AbrirLightbox() {

        loc_js_ao_fechar = this.lx_js_ao_fechar;
        document.body.style.overflow = 'hidden';
        document.getElementById('lightTOP').style.display = 'block';
        document.getElementById('light').style.display = 'block';
        document.getElementById('fade').style.display = 'block'
        document.body.onkeypress = function (event) {
            event = event || window.event;
            if (event.keycode = 27) {
                FecharLightbox();
                return false;
            }
            return true;
        }
        if (this.lx_js_ao_abrir != '') { try { eval(this.lx_js_ao_abrir); } catch (e) { } }
        if (this.lx_url == '') {
            white_content_conteudo.innerHTML = this.lx_conteudo;
        } else {
            white_content_conteudo_frame.location = this.lx_url;
        }
        conteudo_titulo.innerHTML = this.lx_titulo;

    }
}
function FecharLightbox() {
    document.body.style.overflow = 'auto';
    document.getElementById('light').style.display = 'none';
    document.getElementById('lightTOP').style.display = 'none';
    document.getElementById('fade').style.display = 'none';
    white_content_conteudo.innerHTML = 'about:blank';
    conteudo_titulo.innerHTML = this.lx_titulo;
    if (loc_js_ao_fechar != '') { try { eval(loc_js_ao_fechar); } catch (e) { } }
}
