function applet() { };

applet.prototype.init	= function() {
  //this.promoManager = this.add(new promoManager(), this.getField("_divPromo"), null, this, null);
  //this.promoManager.load(_PROMOS);
  //this.btn_register = new YAHOO.widget.Button(this.FLDID_btn_signup.id, {onclick: {fn:this.signup, scope:this}});  
};

applet.prototype.signup = function() {
	if (this.validateSignup(this.FLDID_email)) {
		try {
			var params = new Object();
			params.firstname = $encodeURI(this.FLDID_firstname.value);
			params.lastname = $encodeURI(this.FLDID_lastname.value);
			params.email = this.FLDID_email.value;
			params.community = "nexxtstudio.com";
			this.executeCommand(CONST_COMMAND_SERVER_POST, "common.actions.beta.signup", params, this.signupResponse);
		} catch(e) {
			$C.addLog("ERROR >> "+this.filename+" 'signup()' >> "+e.message);
		};
	};
	return false;
};

applet.prototype.signupResponse = function(rObj) {
	try {
		if (rObj.validation == "success") {
			this.FLDID_divSignup.style.display = "none";
			this.FLDID_divSignupComplete.style.display = "";
		} else {
			var eObj = YAHOO.util.Dom.get(this.FLDID_message.id+"Error");
			eObj.innerHTML = rObj.errors;
			eObj.style.display = "";
		}
	} catch(e) {
		$C.addLog("ERROR >> "+this.filename+" 'signupResponse()' >> "+e.message);
	};
};

applet.prototype.validateSignup = function() {
	var v = true;		
	v = ($checkEmpty(this.FLDID_firstname, "") && v) ? true : false;
	v = ($checkEmpty(this.FLDID_lastname, "") && v) ? true : false;
	v = ($checkEmail(this.FLDID_email, "") && v) ? true : false;	
	return v;
};

applet.prototype.handleEnter = function(e) {
	var keypressed = (window.event) ? event.keyCode : e.keyCode;	
	if (keypressed == 13) {
		this.signup();
	};
};

applet.prototype.application = function() {
	window.location.href = buildURL("user", "portfolio_request");
};