var _Price = {'default': 36, 'perframe': 12};
var s3FlashUploadOrderForm = null;
function enableButtonPlaceOrderButton() {
	var buttonPlaceOrderButton = $('place-order-button');
	if(buttonPlaceOrderButton) {
		buttonPlaceOrderButton.removeProperty('disabled');
	}
}
function disableButtonPlaceOrderButton() {
	var buttonPlaceOrderButton = $('place-order-button');
	if(buttonPlaceOrderButton) {
		buttonPlaceOrderButton.setProperty('disabled', 'disabled');
	}
};
function submitOrderForm() {
	if(canSubmitOrderForm()) {
if(s3FlashUploadOrderForm) {
	s3FlashUploadOrderForm.submit();
}

		return true;
	}
	else {
		return false;
	}
};
function canSubmitOrderForm() {
	if(typeof canSubmitOrderFormCustom == 'function') {
		return canSubmitOrderFormCustom();
	}
	else {
		return checkEmail('order-form', 'order-email', 'Please specify a valid email address.') && checkSource('order-form', 'order-link', 'Please upload your design sources or specify a link to your file(s).');
	}
};
window.addEvent('domready', function() {
	var buttonPlaceOrderButton = $('place-order-button');
	if(buttonPlaceOrderButton) {
		buttonPlaceOrderButton.addEvent('click', function(event) {
			event.stop();
			disableButtonPlaceOrderButton();
			if(!submitOrderForm()) {
				enableButtonPlaceOrderButton();
			}
		});
	}
	var formOrderForm = $('order-form');
	if(formOrderForm) {
		formOrderForm.addEvent('submit', function(event) {
			event.stop();
			submitOrderForm();
		});
	}
});
