function getFileName() {
	    var url = document.location.href;
	    url = url.substring(0, (url.indexOf("#") == -1) ? url.length : url.indexOf("#"));
	    url = url.substring(0, (url.indexOf("?") == -1) ? url.length : url.indexOf("?"));
	    url = url.substring(url.lastIndexOf("/") + 1, url.length);
	    return url;
}

function ajaxFunction(lang) {
	// get host name
	theHost = document.location.hostname;
	if (theHost == 'localhost') {
		theHost = 'localhost/havenvilla/';
	} else {
		theHost = theHost + '/';
	}

	//alert (theHost);

	var xmlHttp;
	try {    // Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) {    // Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
    	catch (e) {
			try	{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}

	xmlHttp.onreadystatechange=function() {
	theFile = getFileName(document.location);
		if(xmlHttp.readyState==4) {
			document.getElementById('showLocations').innerHTML=xmlHttp.responseText;
			if (theFile == 'index.html' || theFile == '') {
				document.getElementById('showLocations2').innerHTML=xmlHttp.responseText;
			}

		}
	}
	if (lang != '') {
		//xmlHttp.open("GET","http://www.havenvilla.com/includes/get_locations.php?lang="+lang,true);
		xmlHttp.open("GET","http://"+theHost+"includes/get_locations.php?lang="+lang,true);
	} else {
		//xmlHttp.open("GET","http://www.havenvilla.com/includes/get_locations.php",true);
		xmlHttp.open("GET","http://"+theHost+"includes/get_locations.php",true);
	}

	xmlHttp.send(null);
}

<!--
	function isNumberKey(evt){
		var charCode = (evt.which) ? evt.which : event.keyCode
			if (charCode > 31 && (charCode < 48 || charCode > 57))
				return false;
		return true;
	}
//-->
function validateForm(){
	//if (document.search_form.loc_id.options.selectedIndex == 0){
		//alert ('You must select a location');
		//return false;
	//} else {
		return true;
	//}
}
