function doMapSearch()
{
 $jquery('#search-loader').show();
  //alert('start')
      map.clearOverlays();
       params=Form.serialize('form-criterias');
       $jquery.getJSON('ajax/search.php?'+params, function(json) {
                         if(json.totalCount > 0)
                                {
                                  bounds = new GLatLngBounds();
                                  for (i=0; i < json.properties.length; i++)
                                  {
                                          showGeopoint(json.properties[i].lng, json.properties[i].lat, json.properties[i].html, 0, json.properties[i].FINID);
                                        zoomToBounds();
                                  }
                                }
                                $jquery('#search-loader').hide();
     });

}
function change_page_num(num)
{
   $('page').value=num;
   doSearch();
}
function ChangeRefLocs()
{
    keyword=$('ref-keyword').value;
  //  alert(keyword);
   //ptype=$('ptype').value;
   // ptype=1;
   params=Form.serialize('form-criterias');
 //  alert(params);
    location.href='/index.php?super_s=1&'+params;
}
function CheckLocs()
{
  ChangeRefLocs()
}
function parseMinMaxParams(val)
{
     if(val=='min'||val=='max')return;
     else  doSearch();
}



function to_number(somestring)

{

    return Number(somestring.toString().replace(/\$|\,/g,''));

}



function to_currency(anynum) {

   //-- Returns passed number as string in $xxx,xxx.xx format.
   anynum=eval(to_number(anynum))
      workNum=Math.abs((Math.round(anynum*100)/100));workStr=""+workNum

   if (workStr.indexOf(".")==-1){workStr+=".00"}

   dStr=workStr.substr(0,workStr.indexOf("."));dNum=dStr-0

   pStr=workStr.substr(workStr.indexOf("."))

   while (pStr.length<3){pStr+="0"}

    //--- Adds comma in thousands place.
     if (dNum>=1000) {

      dLen=dStr.length

      dStr=parseInt((dNum/1000))+","+dStr.substring(dLen-3,dLen)

   }
   //-- Adds comma in millions place.

   if (dNum>=1000000) {

      dLen=dStr.length

      dStr=parseInt((dNum/1000000))+","+dStr.substring(dLen-7,dLen)

   }

   retval = dStr; // + pStr

   if (anynum<0) {

      retval="-"+retval

   }
//  if(retval=='undefined'||isNaN(retval))retval=0;
   return retval
//   return retval


}
