// vim:ft=javascript
dojo.require("dijit.form.TextBox")
dojo.require("dijit.form.Button")
dojo.require("dijit.form.ValidationTextBox");
dojo.require("dojox.validate.regexp");
dojo.require("dijit.form.FilteringSelect");
dojo.require("dojo.rpc.RpcService");

dojo.addOnLoad(function() {
	var regform = dojo.byId("regform")
	dojo.parser.parse(regform)
	dojo.style(regform, "opacity", "0")
	dojo.style(regform, "display", "block")
	dojo.fadeIn({node: regform, duration:720}).play()
})

regform_submit = function() {
	var data = {
		name: dojo.byId("regform_name").value,
		email: dojo.byId("regform_email").value,
		address: dojo.byId("regform_address1").value + "\n" + dojo.byId("regform_address2").value + "\n" + dojo.byId("regform_address3").value,
		phone: dojo.byId("regform_phone").value,
		campus: dojo.byId("regform_campus").value,
		field: dojo.byId("regform_field").value,
		year: dojo.byId("regform_year").value
	}
        if (dojo.byId("regform_comments")) {
                data.comments = dojo.byId("regform_comments").value
        }
	if (dojo.byId("regform_company")) {
                data.company = dojo.byId("regform_company").value
        }
	
	var def = dojo.xhrGet({
		url: "/staticsite/reg.cgi",
		content: {'message':dojo.toJson(data)},
		sync: true
	})

	return true
}
