initConfig();

document.observe('dom:loaded',init);
//Element.observe(window,'load',init);

function init() {

	initFields();
	initToggles();
	initValidation();
	initClient();
	initCalendar('schedule-demo');
	typeof customFunctions == 'function' ? customFunctions() : '';
}

function initToggles() {

	// show/hide "other" field
	$('referer') ? addDropDownToggle({ dropdown: $('referer'), index: $('referer').options.length-1, target: $('specify-referer') }) : '';
	$('industry') ? addDropDownToggle({ dropdown: $('industry'), index: $('industry').options.length-1, target: $('specify-industry') }) : '';
	$('role') ? addDropDownToggle({ dropdown: $('role'), index: $('role').options.length-1, target: $('specify-role') }) : '';
	$('state') ? addDropDownToggle({ dropdown: $('state'), index: $('state').options.length-1, target: [ $('specify-state'), $('specify-country') ] }) : '';
}
