	function classAjaxField(name,db_field,frm_field,search_name,search_type,lang,args)
	{
		if (arguments.length > 0) {
			this.Init(name,db_field,frm_field,search_name,search_type,lang,args);
		}
	}

	classAjaxField.prototype.Init = function(name,db_field,frm_field,search_name,search_type,lang,args)
	{
			this.name = name;
			this.ajxField = frm_field;
			this.dbField = db_field;
			this.ajxSearchName = search_name;
			this.ajxSearchType = search_type;
			this.ajxLang = lang;
			this.bTypeAhead = false;
			this.factor = args;
			this.frmTextbox = document.getElementById(this.ajxField);
			this.ajxAutoSuggestObj = new AutoSuggestControl(this.name,this.frmTextbox,this.ajxSearchName,this.factor);
			return false;
	}

	classAjaxField.prototype.xmlCallback = function ()
	{
		if(xmlHttp.readyState == 4)
		{
			if (xmlHttp.status == 200)
			{
				var response = xmlHttp.responseText.split('|');
				var obj = response[0];
				var sSuggestions = [];
				for(j=1; j < response.length; j++)
				{
					sSuggestions.push(response[j]);
				}
				eval('var ajxAutoSuggestObj = '+obj+'.ajxAutoSuggestObj');
				ajxAutoSuggestObj.textbox.focus();
				if (sSuggestions.length > 0 && sSuggestions[0] != '') 
					ajxAutoSuggestObj.autosuggest(sSuggestions,false);
				else
					ajxAutoSuggestObj.hideSuggestions();
				return true;
			}
		}				
	}	

	classAjaxField.prototype.search = function()
	{
		send_search();
	}
	
	classAjaxField.prototype.requestSuggestions = function (name, bTypeAhead) 
	{
		this.bTypeAhead = bTypeAhead;
		var sTextbox = this.ajxAutoSuggestObj.textbox;
		
		var sEncTextbox=sTextbox.value.replace(/\*/g,'%'); //replace all '*' with '%'
		sEncTextbox=sEncTextbox.replace(/%/g,'%25');	 //replace all '%' with '%25' for send url
		urlstr='';

		switch(this.ajxField)
		{
			case 's_zip_ort':
			case 'sstr':
			case 'snr':			
				var zip_ort = document.getElementById('s_zip_ort').value;
				var street = document.getElementById('sstr').value;
				var nr = document.getElementById('snr').value;			
				break;
			case 'z_zip_ort':
			case 'zstr':
			case 'znr':
				var zip_ort = document.getElementById('z_zip_ort').value;
				var street = document.getElementById('zstr').value;
				var nr = document.getElementById('znr').value;				
				break;
			default:
				var zip_ort = document.getElementById('zip_ort').value;
				var street = document.getElementById('str').value;
				var nr = document.getElementById('nr').value;						
		}
				
		switch(this.dbField)
		{
			case 'zip':
				urlstr='&zip='+escape(zip_ort);
				break;
			case 'street':
				urlstr='&zip='+escape(zip_ort);
				urlstr+='&street='+escape(street);
				break;
			case 'nr':
				urlstr='&zip='+escape(zip_ort);
				urlstr+='&street='+escape(street);
				urlstr+='&nr='+escape(nr);
				break;	
		}

		if (urlstr.length > 0){
			this.makeAjaxRequest('/sites/miplan/packages/processAddressSearchAjax.php?field='+this.dbField+'&'+urlstr+'&search_type='+this.ajxSearchType+'&search_name='+this.ajxSearchName+'&obj='+this.name+'&bTypeAhead='+this.bTypeAhead+'');
		}
	}

	classAjaxField.prototype.makeAjaxRequest = function(url)
	{
	    	xmlHttp = false;
	    	try {
	    		xmlHttp = new XMLHttpRequest();
	    	} catch (trymicrosoft) {
	    		try {
	    			xmlHttp = new ActiveXObject('Msxml2.XMLHTTP');
	    		} catch (othermicrosoft) {
	    			try {
	    				xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
	    			} catch (failed) {
	    				xmlHttp = false;
	    			}
	    		}
	    	} 
	
		xmlHttp.onreadystatechange = eval(this.name+'.xmlCallback');
		xmlHttp.open('GET', url, true);	
		xmlHttp.send(null);
	}			