function pfRollover(section) {
	toggleDisplay('pf');
	toggleDisplay('pf-over' + section);
}

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 PopupCenter(pageURL,title,w,h) {
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}

