            
  function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
//return (((sign)?'':'-') + '$' + num + '.' + cents);
return (((sign)?'':'-') + '$' + num );
}


	///////////////////////////////////////////////////////////////////
//this function opens and center a window
	function winBRopen(theURL, Name, popW, popH, scroll, resize) { // V 1.0
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable='+resize+'';
	Win = window.open(theURL, Name, winProp);
	Win.window.focus();
}
/////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////





function DolnQuickSearch()
{
var lnlist = document.getElementById('inputmail').value;
var linkto = "default.aspx?typ=1&list=" + lnlist;
//alert(linkto)
location.href=linkto
}

function ClearMe(ele)
{
document.getElementById(ele).value = "";


}

function doAreaQuickSearch()
{

var pTypeindex = document.getElementById('type').selectedIndex;
var pType = document.getElementById('type')[pTypeindex].value;

var MinPriceindex = document.getElementById('min').selectedIndex;
var MinPrice = document.getElementById('min')[MinPriceindex].value;

var MaxPriceindex = document.getElementById('max').selectedIndex;
var MaxPrice = document.getElementById('max')[MaxPriceindex].value;

var bedsindex = document.getElementById('beds').selectedIndex;
var bed = document.getElementById('beds')[bedsindex].value;

var bathsindex = document.getElementById('baths').selectedIndex;
var bth = document.getElementById('baths')[bathsindex].value;


var  AreaList = getCheckValuesA(document.asearch.area)
 // document.getElementById('area').value // getSelectedCheckboxValue(document.getElementById('area'));


//alert(getCheckValuesA(document.asearch.area))

var linkto = "default.aspx?typ=2&br=" + bed + "&bth=" + bth +"&min=" + MinPrice + "&max=" + MaxPrice + "&ptype=" + pType + "&ar=" + AreaList;
location.href= linkto

}






function getCheckValuesA(checkBoxArray){
var values = new Array()
for (i = 0; i < checkBoxArray.length; i++){
   if (checkBoxArray[i].checked) values[values.length] = checkBoxArray[i].value
   }
return values
}

///////////////////////////////////////////////////////////////////
//this function opens and center a window
	function winBRopenLA(theURL, Name, popW, popH, scroll, resize) { // V 1.0
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'toolbar=1,location=1,width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable='+resize+'';
	Win = window.open(theURL, Name, winProp);
	Win.window.focus();
}
/////////////////////////////////////////////////////////

function Showall() {
	var count = 1
	for (count=1;count<=10;count++)
	{
		document.getElementById(count).style.display = "block";
		document.getElementById(count).style.visibility = "visible";
	}
}

function Hideall() {
	var count = 1
	for (count=1;count<=10;count++)
	{
		document.getElementById(count).style.display = "none";
		document.getElementById(count).style.visibility = "hidden";
	}
}

function showLevel(value) {
	document.getElementById(value).style.display = "block";
		document.getElementById(value).style.visibility = "visible";
}

function hideLevel(value) {
	document.getElementById(value).style.display = "none";
		document.getElementById(value).style.visibility = "hidden";
}





