function queryDB(region, party_size, bedrooms, price, page, pets, sea, country, start_date, end_date){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
            
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("HTTP Request Error");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){

		if(ajaxRequest.readyState == 4){

			var resultDisplay = document.getElementById('content');

			resultDisplay.innerHTML = ajaxRequest.responseText;
			
			window.scrollTo(0, 0);
		}
	}
	
	if (document.getElementById('pets').checked == true) {
	
		var pets = 1;
	
	}
	
	if (document.getElementById('smoking').checked == true) {
	
		var smoking = 1;
	
	}

	var queryString = "?region=" + region + "&party_size=" + party_size + "&bedrooms=" + bedrooms + "&price=" + price + "&pets=" + pets + "&smoking=" + smoking + "&page=" + page + "&sea=" + sea + "&country=" + country + "&start_date=" + start_date + "&end_date=" + end_date +"#top";
	
	ajaxRequest.open("GET", "http://www.jeanbartlettcottageholidays.co.uk/staticfiles/search_results.php" + queryString, true);
	ajaxRequest.send(null);
	

}

function addRating(rating,width)
{
	document.getElementById('ratingVal').value = rating;
	document.getElementById('add-rating').style.width = width+'%';
}

function addShortlist(addpropid){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("HTTP Request Error");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){

		if(ajaxRequest.readyState == 4){

			var resultDisplay = document.getElementById('content');

			resultDisplay.innerHTML = ajaxRequest.responseText;
		}
	}

	var queryString = "&addpropid=" + addpropid;
	
	ajaxRequest.open("GET", "http://jeanbartlett.designamitedevelopment.co.uk/staticfiles/property_details.php?logged_in=1&propid=" + addpropid + queryString, true);
	ajaxRequest.send(null);
	

}