//alert('Mod_search1');


var http = createRequestObject2();
var identity;

function createRequestObject2() {
			var ro;
			var browser = navigator.appName;
			if(browser == "Microsoft Internet Explorer"){
				ro = new ActiveXObject("Microsoft.XMLHTTP");
			}else{
				ro = new XMLHttpRequest();
			}
			return ro;
		}
		
		
		function pop_town2(value,id, h_path) {	
			//alert(value);
			//alert('Hi'+id);
			arr = value.split('|');
			codprov = arr[1]; 
				
			var path = h_path;
			if(path=='www.casasevende.eu'){
				var action = "http://www.casasevende.eu/components/com_frontpage/pop_town_left.php?prov=" + codprov + "&lang=<?php echo _LANGUAGE; ?>";
			}
			else{
				var action = "components/com_frontpage/pop_town_left.php?prov=" + codprov + "&lang=<?php echo _LANGUAGE; ?>";
			}
			
			document.getElementById(id).innerHTML='Please wait';
			identity = id;
			http.open('GET', action, true);
			http.onreadystatechange = handleResponseToLoadComboBoxItem2;
			http.send(null);
		}
		
		function pop_town3(value,id, town_arr, h_path) {	
			
			///alert(town_arr);
			arr = value.split('|');
			codprov = arr[1]; 
				
			var path = h_path;
			if(path=='www.casasevende.eu'){
				var action = "http://www.casasevende.eu/components/com_frontpage/pop_town_left2.php?prov=" + codprov + "&lang=<?php echo _LANGUAGE; ?>&town=" + town_arr;
			}
			else{
				var action = "components/com_frontpage/pop_town_left2.php?prov=" + codprov + "&lang=<?php echo _LANGUAGE; ?>&town=" + town_arr;
			}
			
			document.getElementById(id).innerHTML='Please wait';
			identity = id;
			http.open('GET', action, true);
			http.onreadystatechange = handleResponseToLoadComboBoxItem2;
			http.send(null);
		}
		
		function handleResponseToLoadComboBoxItem2() {
			if(http.readyState == 4){
				var response = http.responseText;
				if(http.status >= 400 && http.status <600)
					{
						 document.getElementById(identity).innerHTML =  '<span style="color:#FF0000">Item is Not Found</span>';			
					}	
				else{	
					  document.getElementById(identity).innerHTML = response;
					  document.getElementById('shado_div').style.height = '86px';
					  document.getElementById('shado_div').style.width = '186px';
				}
			}   
		}

