function JSObj_subscription_box()
{
	this.posId = 1;
	this.compId = 1;
	this.lngId = 'es';

	this.save = function() {
	    var oXml;
	    var oFormValidator = new WBEFormValidator();
	    oFormValidator.sLng = this.lngId;
	    var oAjax = new WBE_AjaxClass();
	    if (oFormValidator.validateForm(document.forms[0], this.posId)) {
	        oAjax.clear();
	        oAjax.addPostParameter("email", eval('document.forms[0].email_' + this.posId).value);
	        oXml = oAjax.throwEventXML("subscriber_add");
	        if (oXml) {
	            this.hideForm();
	            // debemos devolver resultado y actuar segun el mismo
	            var respuesta = oAjax.getXMLNodeValue(oXml, "c");
	            if (respuesta == 'OK') this.showOkMsg();
	            else this.showExistsMail();
	        }
	        else this.showError();
	    }
	};
	
	this.showError = function () {};
	
	this.showOkMsg = function () {
		document.getElementById('suscription_box_ok_' + this.posId).style.display = '';
	};
	this.showExistsMail = function () {
		document.getElementById('suscription_box_mail_exists_' + this.posId).style.display = '';
	};

	this.hideForm = function () {
		document.getElementById('suscription_box_' + this.posId).style.display = 'none';
	};
	
	this.showForm = function () {
		eval('document.InmediaFrm.email_' + this.posId).value = '';
		document.getElementById('suscription_box_' + this.posId).style.display = '';
		document.getElementById('suscription_box_ok_' + this.posId).style.display = 'none';
		document.getElementById('suscription_box_mail_exists_' + this.posId).style.display = 'none';
	};
	
};
