
var xmlhttp;
var str_pro;var str_type;
var str_town;var str_khan;
var str_sangkat;var str_price;
var str_fromprice;var str_toprice;
var page;var search_province_str;

function get_pro(str){
	str_pro=str;
}
function get_type(str){
	str_type=str;
}
function get_town(str){
	str_town=str;
}
function get_khan(str){
	str_khan=str;
}
function get_sangkat(str){
	str_sangkat=str;
}
function get_price(str){
	str_price=str;
}
function get_fromprice(str){
	str_fromprice=str;
}
function get_toprice(str){
	str_toprice=str;
}
function get_page(str){
	page=str;
}
function search_province(str){
	search_province_str=str;
}


function showUser(action,dataSource,divID)
{	
	var curDateTime = new Date();
	// combine url to send
	var gourl=dataSource+"?action="+action+"&str_pro="+str_pro+"&str_type="+str_type+"&str_town="+str_town+"&str_khan="+str_khan+"&str_sangkat="+str_sangkat+"&str_price="+str_price+"&str_fromprice="+str_fromprice+"&str_toprice="+str_toprice+"&page="+page+"&search_province_id="+search_province_str;
	http.open("GET",gourl,true);  // ajax call.....
		//=========
		http.onreadystatechange = function()	{ // standard call
				if (http.readyState == 4 && http.status == 200) { //when succeful do it
					//=========where that data go=====
					document.getElementById(divID).innerHTML=http.responseText;   // ajax get data from server
					}
			}
		http.send(null);  // clear ajax
}

function loading(divID)
{	
	// combine url to send
	var gourl="includes/ajax/loading.php";

	http.open("GET",gourl,true);  // ajax call.....
	//=========
		http.onreadystatechange = function()	{ // standard call
				if (http.readyState == 4 && http.status == 200) { //when succeful do it
				//=========where that data go=====
					document.getElementById(divID).innerHTML=http.responseText;   // ajax get data from server
					//document.getElementById("divLoading").innerHTML = "";  // clear image
				//===============
				}
			}
		http.send(null);  // clear ajax
}

///Show Select Town Search Property...................
function getdata(action,dataSource,divID,get_id,lang)
{	
	var curDateTime = new Date();
	// combine url to send
	var gourl=dataSource+"?action="+action+"&get_id="+get_id+"&curdate="+curDateTime+"&lang="+lang;

	http.open("GET",gourl,true);  // ajax call.....
	//=========
		http.onreadystatechange = function()	{ // standard call
				if (http.readyState == 4 && http.status == 200) { //when succeful do it
				//=========where that data go=====
					document.getElementById(divID).innerHTML=http.responseText;   // ajax get data from server
					//document.getElementById("divLoading").innerHTML = "";  // clear image
				//===============
				}
			}
		http.send(null);  // clear ajax
}

// JavaScript Document
//========AJAX creator to support browser============================
function getHTTPObject() { 
	  	var xmlhttp; 	
	  	if(window.XMLHttpRequest){ 
			xmlhttp = new XMLHttpRequest(); 
	  	} 
	  	else if (window.ActiveXObject){ 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
			if (!xmlhttp){ 
				xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
			}     
		}
  		return xmlhttp; 
	}
	
	var http = getHTTPObject();

//===================================================================

