// JavaScript Document

var mubForm = {

	addListeners: function () {
		if (!document.getElementsByTagName || !document.getElementById)
			return;	
		
		// set listeners
		if (document.getElementById('mub_Order')) {
					
			// 		address stuff
			var cboCountry = document.getElementById('cnCountry');
			rwScript.addEvent(cboCountry, 'change', mubForm.getCountryChange(cboCountry), false);
			var txtOtherCountry = document.getElementById('cnOtherCountry');
			var lblOtherCountry = document.getElementById('lblOtherCountry');
			if (cboCountry.value != "International") {
				txtOtherCountry.disabled = true;
				txtOtherCountry.style.display = 'none';
				lblOtherCountry.style.display = 'none';
			} else {
				txtOtherCountry.disabled = false;
				txtOtherCountry.style.display = 'block';
				lblOtherCountry.style.display = 'inline';
			}

		}
	},

// Country Change: Update Shipping Amount
	countryChange: function (e, targetElement) {
		var el = window.event ? targetElement : e ? e.currentTarget : null;
		if (!el) return;
		
		// Reload page with International shipping method tag
		if (el.value != 'International') {
			window.location = 'mub_Order.asp';
		} else {
			window.location = 'mub_Order.asp?shp=int';
		}
	
	},
	getCountryChange: function (node) { return function(e) { mubForm.countryChange(e, node); }; },

	sngShipping_INT: 15

};

rwScript.addEvent(window, 'load', mubForm.addListeners, false);
rwScript.addEvent(window, 'unload', EventCache.flush, false);
