function showThrobber() {
	var position = $('tradeformbox').getCoordinates();
	$('overlay').setStyles(position);
	$('overlay').setStyle("display", "");
	$('throbber').setStyles({
		left: position.left + (position.width / 2) - 63,
		top: position.top + (position.height / 2) - 11,
		display: ""
	})
}

function submitForm(e) {
	e = new Event(e);
	if (checkForm('tradeform')) {
		showThrobber();
		$('tradeform').send({
			onComplete: success
		});
	}
	e.preventDefault;
	e.stop();
}

function success() {
	$('registration').setStyle('display', "none");
	$('throbber').setStyle('display', "none");
	$('overlay').setStyle('display', "none");
	$('thanks').setStyle("display", "");
	var scroll = new Fx.Scroll(window, {});
	scroll.toElement('registration');
	sIFR.replaceElement(named({sSelector:"#mainColWrapper h3", sFlashSrc:"/etc/avantgarde.swf", sColor:"#999999", sLinkColor:"#999999", sBgColor:"#FFFFFF", sHoverColor:"#999999", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"", sCase: "normal", sWmode: "transparent"}));
	var highlight = new Fx.Style("thanks", "background-color", { duration: 3000 });
	highlight.start("#ffffdd", "#ffffff");
}

function other(otherinput) {
	if ($('businessnature').selectedIndex == 23) { 
		$(otherinput).setStyle("display", ""); 
	} 
	else { 
		$(otherinput).setStyle("display", "none"); 
	}
}

function tradeinit() {
	$('businessnature').addEvent("change", function() { other('otherbn')});
	$('jobfunction').addEvent("change", function() { other('otherjf')});
}

$('tradeform').addEvent("submit", submitForm);
window.addEvent("domready", tradeinit);
