/* Accessible Popups 
	http://www.alistapart.com/articles/popuplinks/ */

var _POPUP_FEATURES = 'location=0,statusbar=1,menubar=0,width=600,height=435,resizable,scrollbars=yes';



function init()
{
	try {
		if(document.getElementById) {
			initRollovers();	
			// make all links with class "popup" open in popup windows
			/*mlisten(
				'click',
				getElementsByClass('popup','a'),
				event_popup
			);*/
			var same = document.getElementById('same');
			if(same) {
				addEvent(same, 'click', SameAddress);
			}
		}
	}
	catch(e) {}
}


var SameAddress = function() {
	var the_box = document.getElementById('same');
	var checkbox_status = the_box.checked;
	
	var bill_address1 = document.getElementById('bill_address1');
	var bill_address2 = document.getElementById('bill_address2');
	var bill_city = document.getElementById('bill_city');
	var bill_state = document.getElementById('bill_state');
	var bill_postal = document.getElementById('bill_postal');
	var bill_country = document.getElementById('bill_country');	
	
	if (!checkbox_status) {
		bill_address1.value = '';
		bill_address2.value = '';
		bill_city.value = '';
		bill_state.value = 'not_selected';
		bill_postal.value = '';
		bill_country.value = 'not_selected';
	}
	else {
		var donor_address1 = document.getElementById('donor_address1');
		var donor_address2 = document.getElementById('donor_address2');
		var donor_city = document.getElementById('donor_city');
		var donor_state = document.getElementById('donor_state');
		var donor_postal = document.getElementById('donor_postal');
		var donor_country = document.getElementById('donor_country');
		
		bill_address1.value = donor_address1.value;
		bill_address2.value = donor_address2.value;
		bill_city.value = donor_city.value;
		bill_state.value = donor_state.value;
		bill_postal.value = donor_postal.value;
		bill_country.value = donor_country.value;
	}
}


addEvent(window, 'load', ieHover);
addEvent(window, 'load', init);
addEvent(window, 'load', stripeTables);
