function init_wl_idea() { var WLIdea = Class.create({ initialize: function() { lightbox.addMethods({ loadInfo: function() { info = new Element('iframe', { id: 'lbInfo', src: this.content }); close = new Element('div', { id: 'lbClose' }).update(new Element('a', { href: '#', onclick: 'closeLB();' }).update('Close')); content = new Element('div', { id: 'lbContent' }); content.insert(close); content.insert(info); new Insertion.Before($('lbLoadMessage'), content); $('lightbox').className = "done"; this.actions(); }, }); var a = new Element('a', { 'class': 'lbOn wl_idea', href: 'http://rocker.whisperlabs.com/idea/22' }).update("Suggest Idea"); document.getElementsByTagName('body')[0].appendChild(a); new lightbox(a); }, }); Event.observe(window, 'load', function(event) { new WLIdea(); }); } function include_css(css_file) { var html_doc = document.getElementsByTagName('head')[0]; var css = document.createElement('link'); css.setAttribute('rel', 'stylesheet'); css.setAttribute('type', 'text/css'); css.setAttribute('href', css_file); html_doc.appendChild(css); } function include_js(file, loadfunc) { var html_doc = document.getElementsByTagName('head')[0]; var js = document.createElement('script'); js.setAttribute('type', 'text/javascript'); js.setAttribute('src', file); html_doc.appendChild(js); if (loadfunc == null) { return; } // IE js.onreadystatechange = function () { if (js.readyState == 'complete') { loadfunc(); } } // FF js.onload = function () { loadfunc(); } } include_css('http://rocker.whisperlabs.com/stylesheets/lightbox.css'); include_css('http://rocker.whisperlabs.com/stylesheets/idea.css'); include_js('http://rocker.whisperlabs.com/javascripts/prototype.js', function() { include_js('http://rocker.whisperlabs.com/javascripts/lightbox.js', function() { include_js('http://rocker.whisperlabs.com/javascripts/wizard.js', function() { init_wl_idea(); }); }); });