var Widget = { headline: 'Download Center', body: 'Enter your code here to begin downloading.', width: 696, height: 680 } var STX = { url: 'http://www.soundtrax.com/custom/soundtrax', testCode: function(el) { var code = el.form.stx_code.value; STX.check( code ); }, popup: function(el) { var code = el.form.stx_code.value; window.open( STX.url + "/popup.php?code=" + code,"Soundtrax", "menubar=yes,width=" + Widget.width + ",height=" + Widget.height + ",toolbar=no,scrollbars=yes,resizable=no"); }, init: function() { el = document.getElementById('stx_widget'); STX.set_config(el.innerHTML); el.innerHTML = STX.get_widget(); el.style.display = "block"; el.style.visibility = "visible"; }, set_config: function( src ) { var headline = src.match(/headline: (.*)\s*body:/m); if (headline && headline[1]) { Widget.headline = headline[1]; } var body = src.match(/body: (.*)/); if (body && body[1]) { Widget.body = body[1]; } }, whats_this: function() { window.open( STX.url + "/whats_this.html","Soundtrax", "menubar=no,width=" + Widget.width + ",height=" + Widget.height + ",toolbar=no"); }, width_middle: /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) ? 296 : 256, width_bottom: /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) ? 296 : 276, height_bottom: /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) ? 40 : 29, get_widget: function() { return '\
' + Widget.body + '
\ \