function loadTown(area,updateid){
 
	 $.ajax({
	   type: "POST",
	   url: "http://www.2bproperties.com/ajax.php",
	   data: "option=town&areaid="+area,
	   success: function(msg){
		 document.getElementById(updateid).innerHTML=msg;
	   }
	 });
}

function loadTownList(area,updateid){
 
	 $.ajax({
	   type: "POST",
	   url: "http://www.2bproperties.com/ajax.php",
	   data: "option=townlist&areaid="+area,
	   success: function(msg){
		 document.getElementById(updateid).innerHTML=msg;
	   }
	 });
}

function changeImage(obj){
	img=new Image();
	img.src=obj.name;
	//document.getElementById("propertyimage").src=img.src;
	document.getElementById("imageDiv").style.background="url('"+img.src+"')";
    //document.getElementById("imageDiv").style.background="url('includes/image.php?im="+escape(img.src)+"&height=314&width=588')";
}

function countMortgage(){

}

function setMergeListingIcons(id)
{
	obj=document.getElementById("row_"+id);
	imgobj=document.getElementById("merge_"+id);
	var curleft = curtop = 0;
	if(obj.offsetParent){
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	
	imgobj.style.display='';
	imgobj.style.position='absolute';
	if(document.all){
		imgobj.style.left=curleft+114+"px";
	}else{
		imgobj.style.left=curleft+112+"px";
	}
	imgobj.style.top=curtop-182+"px";
    
}

function setMergeIcons()
{
	obj=document.getElementById("imageDiv");
	imgobj=document.getElementById("mergeIcon");
	var curleft = curtop = 0;
	if(obj.offsetParent){
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}		
	
	imgobj.style.display='';
	imgobj.style.position='absolute';
	if(document.all){
		imgobj.style.left=curleft+498+"px";
	}else{
		imgobj.style.left=curleft+496+"px";
	}
	imgobj.style.top=curtop+20+"px";
}