var BASE_URL = 'http://www.badgerscreek.com/online/'; window.addEvent('domready', function() { // sort any external links that need to open in a new window external_links(); // JS popups for enlargements pop_links(); // button disabler for submit buttons //submit_disabler(); var p = $('paybutton'); if (p) $('paybutton').addEvent('click', sendform); }); function external_links() { $$('a').each(function(link) { if (link.getProperty('rel') == 'external') { link.target = '_blank'; link.title += ' (opens in a new window)'; } }); } function pop_links() { $$('a.popup').each(function(link) { link.addEvent('click', popcard); }); } function submit_disabler() { $$('input.addbutton').each(function(btn) { btn.addEvent('click', sendform); }); } function sendform(e) { e = new Event(e).stop(); if (this.form.id == 'paypal_form') { if ($('shipping').selectedIndex == 0) { alert('You must pick a shipping area'); return false; } else this.form.submit(); } //this.setProperty('disabled', 'disabled'); //this.form.submit(); } function popcard(e) { e = new Event(e).stop(); pop = $('popup'); if (pop) { bi = $('big_image'); if (bi) bi.src = this; scr_w = window.getScrollSize().x; pop_w = pop.getStyle('width').toInt(); pop_left = Math.round((scr_w - pop_w) / 2); pop_top = window.getScroll().y + 50; pop.setStyles({display: 'block', left: pop_left, top:pop_top}); } } function hidepop() { $('popup').setStyle('display', 'none'); } function goback() { window.history.back(1); return false; }