var LB = Class.create(); LB.prototype = { alto : typeof String, ancho : typeof String, cerrar : typeof string, initialize : function(){ this.alto = 210; this.ancho = "100%"; this.cerrar = ""; this.addLightboxMarkup(); lbox = document.getElementsByClassName('lbOn'); for(i = 0; i < lbox.length; i++) { valid = new lightbox(lbox[i]); } }, ShowInfo: function(iframe){ var cerrar = arguments[1] != undefined || arguments[1] != '' ? arguments[1] : this.cerrar; var alto = arguments[2] != undefined ? arguments[2] : this.alto; var ancho = arguments[3] != undefined ? arguments[3] : this.ancho; $('lightbox').innerHTML = ""; var inner = ''; var src = '
CERRAR [X]
' + inner + '
'; $('lightbox').innerHTML = src; $('lightbox').style.display = "block"; $('overlay').style.display = "block"; }, HideInfo: function(){ try{ $('lightbox').style.display = "none"; $('overlay').style.display = "none"; $('lightbox').innerHTML = ""; }catch(e){ console.log (e); } }, addLightboxMarkup: function() { bod = document.getElementsByTagName('body')[0]; overlay = document.createElement('div'); overlay.id = 'overlay'; lb = document.createElement('div'); lb.id = 'lightbox'; lb.className = 'loading'; lb.innerHTML = '
' + 'loading' + '
'; bod.appendChild(overlay); bod.appendChild(lb); } } var DEMOWIDGET = { ventana: new LB(), mostrarWidget : function(){ if (true){ return true; }else{ return false; } }, abrir : function(titulo){ if (this.mostrarWidget()){ this.ventana.ShowInfo("../../../componente/demoWidget/index.php?tituloWidget=" + titulo,'parent.DEMOWIDGET.cerrar',200,200); return; } }, cerrar : function(){ this.ventana.HideInfo(); } }