	$(document).ready(function(){
		
		$(".SearchOptionExpand").addClass("down");
		$(".SearchOptionExpand").attr("title", "more...");
		$(".hidingSO").hide();
		
		$("#showgenopts").click(function () {
			if ($(this).attr("title") == "more...") {
				$(this).removeClass("down"); 
				$(this).addClass("up"); 
				$(this).attr("title", "show less.");
				$(this).text("Less");

				$("#genopts").slideDown("slow");
			} else {
				$(this).removeClass("up"); 
				$(this).addClass("down"); 
				$(this).attr("title", "more...");
				$(this).text("More");
				
				$("#genopts").slideUp("fast");
			}
			
			return false;
    });


		$("#showsuitopts").click(function () {
			if ($(this).attr("title") == "more...") {
				$(this).removeClass("down"); 
				$(this).addClass("up"); 
				$(this).attr("title", "show less.");
				$(this).text("Less");

				$("#suitopts").slideDown("slow");
			} else {
				$(this).removeClass("up"); 
				$(this).addClass("down"); 
				$(this).attr("title", "more...");
				$(this).text("More");
				
				$("#suitopts").slideUp("fast");
			}
			
			return false;
    });


		$("#showactopts").click(function () {
			if ($(this).attr("title") == "more...") {
				$(this).removeClass("down"); 
				$(this).addClass("up"); 
				$(this).attr("title", "show less.");
				$(this).text("Less");

				$("#actopts").slideDown("slow");
			} else {
				$(this).removeClass("up"); 
				$(this).addClass("down"); 
				$(this).attr("title", "more...");
				$(this).text("More");
				
				$("#actopts").slideUp("fast");
			}
			
			return false;
    });

			
		$("#showattropts").click(function () {
			if ($(this).attr("title") == "more...") {
				$(this).removeClass("down"); 
				$(this).addClass("up"); 
				$(this).attr("title", "show less.");
				$(this).text("Less");

				$("#attropts").slideDown("slow");
			} else {
				$(this).removeClass("up"); 
				$(this).addClass("down"); 
				$(this).attr("title", "more...");
				$(this).text("More");
				
				$("#attropts").slideUp("fast");
			}
			
			return false;
    });


		$("a.searchOption").click(function(event) {
			var myid = this.id;
			
			myid = myid.replace("so_", "");
		
			$.ajax({
					url: '/property/amenity_click_count.asp',
					type: 'POST',
					data: 'id=' + myid,
					timeout: 1000,
					async: false
			});
		});

	
	});

