Event.observe(window, 'load', init, false);
function init() {
  Event.observe('addressForm', 'submit', openInfoDialog);
}

var timeout;
var signupwin;
function openInfoDialog(e) {
	var pars = 'address=' + escape($F('address'));
	signupwin = new Window({className: "alphacube", title: "Sign-Up", 
                      width:250, height:150, zIndex: 100, resizable: false,
                      url: "ajaxServer.php?" + pars, showEffectOptions: {duration:1.5}})
					  
	//var win = new Window({className: "dialog",  width:350, height:400, zIndex: 100, resizable: true, title: "Sample window", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: true})
	Event.stop(e);
	signupwin.showCenter();
	
	//Dialog.info({className:"alphacube", title: "Sign-Up", width:250, height:100, showProgress: true,
	//		   url: "ajaxServer.php?" + pars});
	
	// var myAjax = new Ajax.Updater('response', 'ajaxServer.php', {method: 'get', parameters: pars});
	
	timeout=4;
	setTimeout(infoTimeout, 1000)
}

function infoTimeout() {
	timeout--;
	if (timeout >0) {
		//Dialog.setInfoMessage("Test of info panel, it will close <br>in " + timeout + "s ...")
		setTimeout(infoTimeout, 1000)
	}else{
		//Dialog.closeInfo()
		signupwin.destroy();
	}
}
