function JSObj_subscription_box()
{
	this.posId = 1;
	this.compId = 1;
	this.lngId = 'es';
	
	this.saveEvent = 'subscriber_add';

	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) && this.checkCaptcha()) {		
	        oAjax.clear();
	        oAjax.addPostParameter("email", eval('document.forms[0].email_' + this.posId).value);
	        oAjax.addPostParameter("lng_id", eval('document.forms[0].lng_' + this.posId).value);
	        oXml = oAjax.throwEventXML(this.saveEvent);
	        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';
	};

	this.checkCaptcha = function() {
		if ((this.contentVersionId) && (this.contentVersionId != 0))  return true;

		var oElemCaptcha = eval('document.InmediaFrm.txt_captcha_' + this.posId);
		if (oElemCaptcha) {
			var oAjax = new WBE_AjaxClass();
			oAjax.clear();
			oAjax.addPostParameter('captcha', oElemCaptcha.value);
			xmlObj = oAjax.throwEventXML("check_captcha");
			if (xmlObj) return true;
			else {
				alert('Error comprobando campo de seguridad');
				oElemCaptcha.focus();
				return false;
			}

		} else {
			return true;
		}
	}

};

