function chooseCategory(elementId,type)
{element=document.getElementById(elementId);if(type=="rental")
{if(element.value=="house")
{showContentNoFocusByType('land_area_row','table-row');showContentNoFocusByType('living_area_row','table-row');hideContent('size_text');}
else if(element.value=="condo")
{showContentNoFocusByType('living_area_row','table-row');hideContent('land_area_row');hideContent('size_text');}
else if(element.value=="all")
{showContentNoFocusByType('size_text','table-row');hideContent('living_area_row');hideContent('land_area_row');}}
else if(type=="sale")
{if(element.value=="house")
{showContentNoFocusByType('land_area_row_sale','table-row');showContentNoFocusByType('living_area_row_sale','table-row');showContentNoFocusByType('bedrooms_row','table-row');showContentNoFocusByType('bathrooms_row','table-row');hideContent('size_text_sale');hideContent('property_access_row');hideContent('land_type');hideContent('details_text_sale');}
else if(element.value=="condo")
{showContentNoFocusByType('living_area_row_sale','table-row');showContentNoFocusByType('bedrooms_row','table-row');showContentNoFocusByType('bathrooms_row','table-row');hideContent('size_text_sale');hideContent('land_area_row_sale');hideContent('property_access_row');hideContent('land_type');hideContent('details_text_sale');}
else if(element.value=="land")
{showContentNoFocusByType('land_area_row_sale','table-row');showContentNoFocusByType('property_access_row','table-row');showContentNoFocusByType('land_type','table-row');hideContent('living_area_row_sale');hideContent('size_text_sale');hideContent('bedrooms_row');hideContent('bathrooms_row');hideContent('details_text_sale');}
else if(element.value=="all")
{showContentNoFocusByType('size_text_sale','table-row');showContentNoFocusByType('details_text_sale','table-row');hideContent('living_area_row_sale');hideContent('land_area_row_sale');hideContent('bedrooms_row');hideContent('bathrooms_row');hideContent('property_access_row');hideContent('land_type');}}}
function showContentNoFocusByType(showId,type){var element=document.getElementById(showId);if(!element)
return true;if(element.style.display=="none"&&type==""){element.style.display="block";}else{element.style.display=type;}
return true;}
function decreaseValue(elementId,valueDecreased)
{element=document.getElementById(elementId);numi=document.getElementById(elementId).value;if(numi>=valueDecreased)
{element.value-=valueDecreased;}
else
{element.value=0;}}
function increaseValue(elementId,valueIncreased)
{element=document.getElementById(elementId);numi=document.getElementById(elementId).value;for(i=0;i<valueIncreased;i++)
{element.value++;}}
function increaseValueTimer(elementId,valueIncreased)
{function increaseValueAfterTimer()
{element=document.getElementById(elementId);numi=document.getElementById(elementId).value;for(i=0;i<valueIncreased;i++)
{element.value++;}
scrolldelay=setTimeout(increaseValueAfterTimer,100);}
increaseValueAfterTimer();}
function decreaseValueTimer(elementId,valueDecreased)
{function decreaseValueAfterTimer()
{element=document.getElementById(elementId);numi=document.getElementById(elementId).value;if(numi>=valueDecreased)
{element.value-=valueDecreased;}
else
{element.value=0;}
scrolldelay=setTimeout(decreaseValueAfterTimer,100);}
decreaseValueAfterTimer();}
function stopTimer()
{clearTimeout(scrolldelay);}
function increaseValueStopper(elementId,valueIncreased,stopValue)
{element=document.getElementById(elementId);numi=document.getElementById(elementId).value;if(numi<stopValue)
{for(i=0;i<valueIncreased;i++)
{element.value++;}}}
function currencyIncrease(elementId,step)
{element=document.getElementById(elementId);stepper=document.getElementById(step);if(stepper.value=="Thousand")
{if(element.value>=900)
{stepper.value="Million";element.value=1;}
else
{for(i=0;i<100;i++)
{element.value++;}}}
else
{element.value++;}}
function currencyDecrease(elementId,step)
{element=document.getElementById(elementId);numi=document.getElementById(elementId).value;stepper=document.getElementById(step);if(stepper.value=="Million")
{if(element.value<="1")
{stepper.value="Thousand";element.value=900;}
else
{element.value-=1;}}
else
{if(numi>0)
{element.value-=100;}}}
function showContentNoFocus(showId){var element=document.getElementById(showId);if(!element)
return true;if(element.style.display=="none"){element.style.display="block";}else{element.style.display="block";}
return true;}
function hideContent(hideId){var e=document.getElementById(hideId);if(e.style.display=="block"){e.style.display="none";}else{e.style.display="none";}
return true;}
function changeTab(tabId)
{if(tabId=="for_sale")
{hideContent('rental_search');showContentNoFocus('sale_search')
document.getElementById('for_rent_label').style.fontWeight='normal';document.getElementById('for_rent_label').style.border='0px';document.getElementById('for_sale_label').style.fontWeight='bold';document.getElementById('for_sale_label').style.border='1px solid #00245e';}
else if(tabId=="for_rent")
{hideContent('sale_search');showContentNoFocus('rental_search')
document.getElementById('for_sale_label').style.fontWeight='normal';document.getElementById('for_sale_label').style.border='0px';document.getElementById('for_rent_label').style.fontWeight='bold';document.getElementById('for_rent_label').style.border='1px solid #00245e';}}
function selectOption(id)
{var object=document.getElementById(id);object.selected=true;}
function changeValue(id,newValue)
{var object=document.getElementById(id);object.value=newValue;}
function disableOption(id)
{var object=document.getElementById(id);object.disabled=true;}
function enableOption(id)
{if(/msie/i.test(navigator.userAgent))
{var object=document.all.namedItem(id);}
else
{var object=document.getElementById(id);}
object.disabled=false;}
function resetData()
{object_sale=document.getElementById('all_sale');object_sale.selected=true;object_rental=document.getElementById('all_rental');object.rental.selected=true;}
