function JSObj_xml_web_search_form()
{
	this.posId = 1;
	this.compId = 1;
	this.lngId = 'es';
	this.search_var_name = "";

	this.save = function () {
		var oFormValidator = new WBEFormValidator();
		var oAjax = new WBE_AjaxClass();
		if (oFormValidator.validateForm(document.InmediaFrm, this.posId)) {
			oAjax.clear();
			oAjax.addPostParameter("email", eval('document.InmediaFrm.email_' + this.posId).value);
			oAjax.throwEvent2("subscriber_add");
			this.hideForm();
			this.showOkMsg();
		}
	};
	
	this.showOkMsg = function () {
		document.getElementById('suscription_box_ok_' + 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.doSearch = function (url) {
		var oFormValidator = new WBEFormValidator();
		if (oFormValidator.validateForm(document.InmediaFrm, this.posId)) 
		{
			url = this.urlSearch;
			if (url != "") {						
				url += '?qryfld=' + this.search_var_name + '_' + this.posId;
				document.InmediaFrm.action = url;
			}
			var oField = document.getElementById(this.search_var_name + '_' + this.posId);
			if (oField!=null) oField.value = document.getElementById('text_search_' + this.posId).value;
			document.InmediaFrm.submit();
		}
	};
	this.enter_submit = function(e) {
		var keynum
		var keychar
		var numcheck
		if(window.event) { // IE 
			keynum = e.keyCode
		} else if(e.which) { // Netscape/Firefox/Opera 
			keynum = e.which
		}		
		keychar = String.fromCharCode(keynum)
		if (keychar == "\r") {
			this.doSearch();
			return false;
		}
		return true;
	};
};

function enter_submit(e) {
	var keynum
	var keychar
	var numcheck
	if(window.event) { // IE 
		keynum = e.keyCode
	} else if(e.which) { // Netscape/Firefox/Opera 
		keynum = e.which
	}		
	keychar = String.fromCharCode(keynum)
	if (keychar == "\r") {
		this.doSearch();
		return false;
	}
	return true;
};



