Ext.onReady(function() {
    var hForm = '<div id="hiddenFormBG" class="lightboxBG" style="display:none;"></div><div id="hiddenForm" class="lightboxForm" style="display:none;"><iframe id="popup_iFrame" src="" frameborder="0" width="100%" height="" scrolling="no" allowTransparency="true"></iframe></div>';

    // create hidden div so it doesn't have to live in the template
    Ext.select('body').insertHtml('afterBegin', hForm);

    // add class to all links with the class of popupForm.  Will load the page from the href into the popup form.
    Ext.select('a.popupForm').on('click', function() {
        var newForm = new LightBoxForm('hiddenForm', 'hiddenFormBG', Ext.get(this).getAttribute('href'), Ext.get(this).getAttribute('fh'), Ext.get(this).getAttribute('fw'));
        newForm.show();
    });
});

