function AllLocations_Click() {

    if ($j("#divAllLocations").is(":visible")) {
        $j("#divAllLocations").slideUp('slow');
        $j("#AllLocations").removeClass('Opened').addClass('Closed');  
        
    }
    else {
        $j("#divAllLocations").slideDown('slow');
        $j("#AllLocations").removeClass('Closed').addClass('Opened');
    }

    //alert(3);
}

function AllTypes_Click() {

    if ($j("#divAllTypes").is(":visible")) {
        $j("#divAllTypes").slideUp('slow');
        $j("#AllTypes").removeClass('Opened').addClass('Closed');

    }
    else {
        $j("#divAllTypes").slideDown('slow');
        $j("#AllTypes").removeClass('Closed').addClass('Opened');
    }

    //alert(3);
}
function ShowHide(obj,showHideObjId) {
    
      
	   
    var targetObj = $j("div[id$='" + showHideObjId + "']");
    if (targetObj.is(":visible")) {
           targetObj.slideUp('slow');
           $j(obj).removeClass('Opened').addClass('Closed');

    }
    else {
        targetObj.slideDown('slow');
        $j(obj).removeClass('Closed').addClass('Opened');
    }
    //alert(3);
}
function TypeFilterClick(lnk, typeID) {

    //alert(dummyHtml);

    if (typeID != 59) {
        if ($j("li[parentID=" + typeID + "]").length > 0) {//check if this type have any subtypes

            if ($j("li[parentID=" + typeID + "]").is(":visible")) //if subtypes are expended then unexpend subtypes
            {
                $j("li[parentID=" + typeID + "]").slideUp(); //unexpend                
            }
            else //if subtypes are unexpended make them expended
            {
                $j("li[parentID=" + typeID + "]").slideDown(); //expend suntypes
                $j("li[parentID!=" + typeID + "][rel='TypesFilter'][parentID!=-1][parentID!=59]").slideUp(); //make all other expended sub types unexpended                                       
            }
            return true;

        }
    }

    //go to the selected type page
    
    window.location= lnk;    
    return false;
}

$j(document).ready(function () {
$j("li[rel='TypesFilter'][parentID!=-1][parentID!=59][parentID!=" + $j("#searchBox_categoryID").val() + "]").hide(); //hid all sub types excluding residential subtypes
});


function TopSingleProperty_Click() {
    window.location = ($j("a[id$='_lnkTopPropertyMore']").attr('href'));
}
