
//------------------------------------------------------
// returns the DOM element with the specified id, if any
//------------------------------------------------------
function eid(id)
{
	if(document.getElementById)
	{
		target = document.getElementById(id);
		if(target)
			return target;
	}
	return null;
}

//------------------------------------------------------
//
//------------------------------------------------------
function switchOn(id) {
	element = eid(id);
	if(element)
		element.style.display="block";
}

//------------------------------------------------------
//
//------------------------------------------------------
function switchOff(id) {
	element = eid(id);
	if(element)
		element.style.display="none";
}


//------------------------------------------------------
//
//------------------------------------------------------
function displayPaymentInfo(sourceID) {
	switchOn('paymentinfo');
}



//------------------------------------------------------
//
//------------------------------------------------------
function PaymentTypeChanged()
{
	paymentSelector = eid('PaymentType');
	if(paymentSelector)
		if(paymentSelector.selectedIndex==1)
			eid('creditcard').style.display="block";
		else
			eid('creditcard').style.display="none";
				
}

//------------------------------------------------------
//
//------------------------------------------------------
function copyAddressToCreditCard() {
	eid('CCAddress').value = eid('address_1').value;
	eid('CCCity').value = eid('city').value;
	eid('CCState').value = eid('state').value;
	eid('CCPostal').value = eid('zipcode').value;
}
