// JavaScript Document
function search_property()


    {


        document.search01.submit();


    }


    function search_by_id()


    {


        document.getElementById('spid').value = '';


        if(document.getElementById('srch_property_id').value)


        {


            document.getElementById('spid').value = 'property id : '+document.getElementById('srch_property_id').value;


        }else


        {


            document.getElementById('spid').value ='all properties';


        }


        document.srch_frm_by_id.submit();


    }


    function search_now()


    {


        document.getElementById('s').value = '';


        var srch_type = '';


        /*if(document.getElementById('srch_type_buy').checked)


        {


            var srch_type = document.getElementById('srch_type_buy').value;


        }else


            if(document.getElementById('srch_type_rent').checked){


                var srch_type = document.getElementById('srch_type_rent').value;


            }*/


        var srch_price = document.getElementById('srch_price').options[document.getElementById('srch_price').selectedIndex].text;


        var srch_location = document.getElementById('srch_location').options[document.getElementById('srch_location').selectedIndex].text;


        var srch_bedrooms = document.getElementById('srch_bedrooms').options[document.getElementById('srch_bedrooms').selectedIndex].text;


        var srch_bathroom = document.getElementById('srch_bathroom').options[document.getElementById('srch_bathroom').selectedIndex].text;


        var srch_area = document.getElementById('srch_area').options[document.getElementById('srch_area').selectedIndex].text;


        var srch_view = document.getElementById('srch_view').options[document.getElementById('srch_view').selectedIndex].text;





        var searchfor = '';


        if(document.getElementById('srch_price').value!='')


        {


            searchfor = srch_price;


        }


        if(srch_type!='')


        {


            if(srch_type!='' && searchfor=='')


            {


                searchfor = srch_type;


            }else


            {


                searchfor = searchfor +' & '+ srch_type;


            }


        }


        if(document.getElementById('srch_location').value!='')


        {


            if(srch_location!='' && searchfor=='')


            {


                searchfor = srch_location;


            }else


            {


                searchfor = searchfor +' & '+ srch_location;


            }


        }


        if(document.getElementById('srch_bedrooms').value!='')


        {


            if(srch_bedrooms!='' && searchfor=='')


            {


                //searchfor = srch_bedrooms;


                if(srch_bedrooms>1)


                {


                    searchfor = srch_bedrooms+' Bedrooms';


                }else


                {


                    searchfor = srch_bedrooms+' Bedroom';


                }


            }else


            {


                //searchfor = searchfor +' & '+ srch_bedrooms;


                if(srch_bathroom>1)


                {


                    searchfor = searchfor +' & '+  srch_bedrooms+' Bedrooms';


                }else


                {


                    searchfor = searchfor +' & '+ srch_bedrooms+' Bedroom';


                }


            }


        }


        if(document.getElementById('srch_bathroom').value!='')


        {


            if(srch_bathroom!='' && searchfor=='')


            {


                if(srch_bathroom>1)


                {


                    searchfor = srch_bathroom+' Baths';


                }else


                {


                    searchfor = srch_bathroom+' Bath';


                }


            }else


            {


                if(srch_bathroom>1)


                {


                    searchfor = searchfor +' & '+  srch_bathroom+' Baths';


                }else


                {


                    searchfor = searchfor +' & '+ srch_bathroom+' Bath';


                }


            }


        }


        if(document.getElementById('srch_area').value!='')


        {


            if(srch_area!='' && searchfor=='')


            {


                searchfor = srch_area;


            }else


            {


                searchfor = searchfor +' & '+ srch_area;


            }


        }


        if(document.getElementById('srch_view').value!='')


        {


            if(srch_view!='' && searchfor=='')


            {


                searchfor = srch_view;


            }else


            {


                searchfor = searchfor +' & '+ srch_view;


            }


        }


        /*


        if(srch_keyword=='' || srch_keyword=='<?php echo CITY_STATE_ZIP_SRCH_TEXT;?>')


        {


            document.getElementById('srch_keyword').value = '';


        }else


        {


            if(srch_keyword!='' && searchfor=='')


            {


                searchfor = srch_keyword;


            }else


            {


                searchfor = searchfor +' & '+ srch_keyword;


            }


        }


         */


        if(searchfor=='')


        {


            searchfor = 'all properties';


        }


        document.getElementById('s').value = searchfor;


        document.srch_frm.submit();


    }


    function show_hide_propertysearchoptions()


    {


        if(document.getElementById('searchcont').style.display == 'none')


        {
				$('#searchcont').slideDown('slow');
             /*$('#propertysearchoptions').fadeIn('slow', function() {
            document.getElementById('propertysearchoptions').style.display = '';
		  });*/



        }else


        {

		 /*$('#propertysearchoptions').fadeOut('slow', function() {
            document.getElementById('propertysearchoptions').style.display = 'none';
		  });*/
		 	
			$('#searchcont').slideUp("slow");



        }


    }

