var expDays = [];
expDays.push({stdWorkingHours: 8, stdETADays: 1, expETADays: 0});
expDays.push({stdWorkingHours: 16, stdETADays: 2, expETADays: 1});
expDays.push({stdWorkingHours: 20, stdETADays: 3, expETADays: 1});
expDays.push({stdWorkingHours: 24, stdETADays: 3, expETADays: 1});
expDays.push({stdWorkingHours: 32, stdETADays: 4, expETADays: 2});
expDays.push({stdWorkingHours: 36, stdETADays: 5, expETADays: 2});
expDays.push({stdWorkingHours: 40, stdETADays: 5, expETADays: 2});
expDays.push({stdWorkingHours: 48, stdETADays: 6, expETADays: 3});
expDays.push({stdWorkingHours: 54, stdETADays: 7, expETADays: 3});
expDays.push({stdWorkingHours: 56, stdETADays: 7, expETADays: 3});
expDays.push({stdWorkingHours: 64, stdETADays: 8, expETADays: 4});
expDays.push({stdWorkingHours: 68, stdETADays: 9, expETADays: 4});
var stdDays = [];
stdDays.push({stdWorkingHours: 8});
stdDays.push({stdWorkingHours: 1});
stdDays.push({stdWorkingHours: 2});
stdDays.push({stdWorkingHours: 3});
stdDays.push({stdWorkingHours: 4});
stdDays.push({stdWorkingHours: 4});
stdDays.push({stdWorkingHours: 5});
stdDays.push({stdWorkingHours: 6});
stdDays.push({stdWorkingHours: 6});
var webPageBasePrice = 145;
var webPagePrices = {};

function initOrderForm() {
	var order = new Order({
		stdDays: stdDays,
		expDays: expDays,
		webPageBasePrice: webPageBasePrice,
		webPagePrices: webPagePrices
	})
	var orderButton = $('order-button');
	if(orderButton)
	{
		orderButton.addEvent('click', function() {
			submitOrder();
		})
	}
}

window.addEvent('domready', function() {
	initOrderForm();
	setGmtOffset('order-gmt-offset');
});
webPagePrices['i_engine_1'] = 0;
webPagePrices['i_engine_2'] = 215;
webPagePrices['cd_coding_1'] = 0;
webPagePrices['cd_tableless_1'] = 0;
webPagePrices['c_opera_1'] = 0;
webPagePrices['c_safari_1'] = 0;
webPagePrices['css_w3c_1'] = 0;
webPagePrices['cd_wai_1'] = 0;
webPagePrices['cd_seo_1'] = 0;
webPagePrices['cd_seo_2'] = 39;
webPagePrices['cd_speed_1'] = 0;
webPagePrices['cd_speed_2'] = 11;
webPagePrices['l_width_1'] = 0;
webPagePrices['l_width_2'] = 29;
webPagePrices['f_resize_1'] = 0;
webPagePrices['f_resize_2'] = 29;
webPagePrices['d_menu_1'] = 0;
webPagePrices['d_menu_2'] = 19;
webPagePrices['f_sifr_1'] = 0;
webPagePrices['f_sifr_2'] = 19;
webPagePrices['cd_commented_1'] = 0;
webPagePrices['cd_commented_2'] = 9;
webPagePrices['cd_print_version_css_1'] = 0;
webPagePrices['cd_print_version_css_2'] = 99;
var s3FlashUploadOrder = null;
function submitOrder() {
	if(canSubmitOrder()) {
if(s3FlashUploadOrder) {
	s3FlashUploadOrder.submit();
}

		return true;
	}
	else {
		return false;
	}
};
function canSubmitOrder() {
	return checkEmail('order', 'order-email', 'Please specify a valid email address.') && checkSource('order', 'link', 'Please upload your design sources or specify a link to your file(s).');
};
window.addEvent('domready', function() {
	var formOrder = $('order');
	if(formOrder) {
		formOrder.addEvent('submit', function(event) {
			event.stop();
			submitOrder();
		});
	}
});
