function changeProductImage(obj, id, src)
{
	var productLineItemId = obj.value;
	productLineItemId = productLineItemId.replace(/^0+/, "");	
	var productMainImg = document.getElementById(id);
	productMainImg.src = productImages[productLineItemId];
}

function addressSelect(addressId, clicked)
{
	if (!clicked.value) {
		showElement(addressId);
	}
	else {
		hideElement(addressId);
	}
	
	if (addressId == 'billing-address') {
		var chk = document.getElementById('OrderUseShippingAddress');
		chk.checked = false;
	}
}

function toggleDisplay(itemId)
{
	var item = document.getElementById(itemId);

	if (item.className == 'hide') {
		item.className = 'show';		
	}
	else {
		item.className = 'hide';
	}
}

function showElement(itemId)
{
	var item = document.getElementById(itemId);
	item.className = 'show';
}

function hideElement(itemId)
{
	var item = document.getElementById(itemId);
	item.className = 'hide';
}

function swap(imgId, appendix)
{
	var img = document.getElementById(imgId);
	path = img.src.substring(0, img.src.indexOf(imgId));
	img.src = path + imgId + appendix;
}
