// JavaScript Document


function villaSearch(){
	var frm = window.document.frmSearch;
	var timestamp = new Date();
	
	var strURL = 'villa_search_results.php?time=' + timestamp.getTime()+'&noBeds='+frm.noBeds.value;
	showloading();
	//alert(strURL);
	new xmlhttpPost(strURL,'villaSearch'); 
	return false;
}
function villaSearch_bkp(){
	var frm = window.document.frmSearch;
	var timestamp = new Date();
	
	var strURL = 'villa_search_results.php?time=' + timestamp.getTime()+'&noBeds='+frm.noBeds.value+'&priceFrom='+frm.priceFrom.value+'&priceTo='+frm.priceTo.value+'&months='+frm.months.value;
	showloading();
	//alert(strURL);
	new xmlhttpPost(strURL,'villaSearch'); 
	return false;
}
function villaSearchRsp(){
	hideloading();
	document.getElementById('searchResults').innerHTML = temp;
	addTableRolloverEffect('tbl_results','highlightOverColor','highlightClickColor');
	return;
}

function shortList(id,action){
	showloading();
	productid =id;
	act = action;
	var timestamp = new Date();
	var strURL = 'process-shortlist.php?time=' + timestamp.getTime() + '&action=' + action + '&productid='+id;
	new xmlhttpPost(strURL,'villaList');
}
function shortListRsp(){
	hideloading();
	document.getElementById('dLoad').innerHTML =temp;

	if(act=='add')
		window.opener.shortListView();
	document.getElementById('tbl_'+productid).style.display='none'; 
}
function addShortList(id){
	showloading('dLoad_'+id);
	productid =id;
	var timestamp = new Date();
	var strURL = 'process-shortlist.php?time=' + timestamp.getTime() + '&action=add&productid='+id;
	new xmlhttpPost(strURL,'addVillaList');
}
function addShortListRsp(){
	
	hideloading('dLoad_'+productid);
	document.getElementById('dLoad_'+productid).innerHTML =temp + ' [<a href="my_shortlist.php">View Shortlist</a>]';
}

function shortListView(){
	showloading();
	var timestamp = new Date();
	var strURL = 'villa_short_list.php?time=' + timestamp.getTime();
	new xmlhttpPost(strURL,'villaListView');
}
function shortListViewRsp(){
	hideloading();
	
	document.getElementById('dslist').innerHTML =temp;
	addTableRolloverEffect('tbl_results','highlightOverColor','highlightClickColor');
}

function shortListPopup(num){
	popUp('villa_select.php?noBeds='+num);
}