function Registration(){
	this.handleFailure=function(o){alert(o.responseText);}
	this.preloader = new PreLoader();
	this.register=function(invited,gId){
		location.href='#wrapper';
		regURL = GLOBAL_URI+"Registration/doRegister/"+invited+","+gId+"?ajaxcall=true";
		x = getElementId("addUser");
		var pre = this.preloader.getPreLoader();
		handleSuccess = function( o ){
			if(o.responseText == 'Success'){
				//pre.hide();
				location.href=GLOBAL_URI+"user/home";
			}
			else if(o.responseText == ''){
				pre.hide();
				location.href=GLOBAL_URI+"index.php/page/wait";
			}
			else{
				pre.hide();
				getElementId("addEventDiv").innerHTML=o.responseText;				
			}
		}
		callback={upload:handleSuccess,failure:this.handleFailure}
		YAHOO.util.Connect.setForm(x,true);
		pre.show();
		YAHOO.util.Connect.asyncRequest("POST", regURL, callback);
	}
}
