djConfig = {
	parseOnLoad: true
};
if (window.location.protocol == 'https:') {
	if (!djConfig.modulePaths) {
		djConfig.modulePaths={};
	}
	djConfig.modulePaths['dojo']='https://ajax.googleapis.com/ajax/libs/dojo/'+dojo_version+'/dojo';
	djConfig.modulePaths['dijit']='https://ajax.googleapis.com/ajax/libs/dojo/'+dojo_version+'/dijit';
	djConfig.modulePaths['dojox']='https://ajax.googleapis.com/ajax/libs/dojo/'+dojo_version+'/dojox';
}
google.setOnLoadCallback(function() {
	dojo.require("dijit.Dialog");
	dojo.require("dojox.widget.Standby");
	var standby=null;

	dojo.addOnLoad(function() {
		dojo.forEach(dojo.query('form.mailing-list'),function(form) {
			dojo.connect(form,'onsubmit',form,function(e) {
				dojo.stopEvent(e);
				if (!standby) {
					standby = new dojox.widget.Standby({
						target: form,
						color: 'black'
					});
					dojo.doc.body.appendChild(standby.domNode);
					standby.startup();
				}
				standby.show();

				dojo.xhrPost({
					form: form,
					handleAs: 'json',
					load: function(data) {
						standby.hide();
						var dialog=new dijit.Dialog({
							'class': 'stddlg',
							title:data.title,
							content:data.content,
						});
						dialog.show();
					}
				});
			});
		});
	});
});
google.load("dojo", dojo_version);
