// JavaScript Document

$(document).ready(function(){
	


// Additional information animation.
	
	 $("#add-info").ready(function(){
	  	$("#hide").fadeOut("fast");
	  
    });
	 
	 $("#details-show").ready(function(){
     	$("#close").fadeOut("fast");
	  
    });
	 
	$("#list-show ").ready(function(){
      $("#hidden").fadeOut("fast");
	  
    });
	  
	  
	$("#popClose").click(function (){
		document.getElementById("gallery_holder").innerHTML="";
	});

	
	


function choice(t){
// format of array fields  Display:Value
	var sale = ['All:all','under $500,000:under500000','$500,000 to $999,999:500000-999999','$1,000,000+:10000000plus'];
	var rental = ['All:all','under $1,000 monthly:under1000','$1,000 to $2,999 monthly:under3000','$3,000 to $4,999 month:under5000','$5,000+ monthly:over5000'];
	s = document.getElementById('prices');
	var sl = s.options.length;
	for(var i = sl-1; i >= 0 ; i--) { s.options[i] = null; }
	if(t.value != 0){
		var z;
		switch (t.value) {
			case 'sales' : z = sale; break;
			case 'rentals' : z = rental; break;
			default : alert('Invalid entry'); break;
		}
		var l = z.length;
		for(i = 0; i < l; i++ ) {
		  tmp = z[i].split(':');
		  s.options[i] = new Option(tmp[0],tmp[1],false,false);
		}
	}
}
		 
	 
	 
});



