	 $(document).ready(function(){	
		loop();

		
			$(".select_loc").change(function(){
 				window.location.href = $(this).val();
			});


			var category = 'all';
			var order = 'stars';

			$(".show_sel").change(function(){
				category = $(this.options[this.selectedIndex]).val();
			});

			$(".sort_sel").change(function(){
				order = $(this.options[this.selectedIndex]).val();
			});
		
		$('.show_go').click(function(){
			var id ='#list_property';
			var location_id = 0;
			location_id = $(this).next().attr('value');
			var postdata='order='+order+'&category='+category+'&location_id='+location_id;
			$(id).html("<img src='/css-img/load.gif' />");
			$.ajax({type: "POST",url: "/ajax/list_property.php",data: postdata,success: function(msg){$(id).html(msg).fadeIn();}});
		});

		

		var rent_type = 'any';
		var location_id = '0';

		$(".need_sel").change(function(){
			rent_type = $(this.options[this.selectedIndex]).val();
		});

		$(".in_sel").change(function(){
			location_id = $(this.options[this.selectedIndex]).val();
		});
		
		$('.need_go').click(function(){
			var id ='#community_activity';
			var postdata='location_id='+location_id+'&rent_type='+rent_type;
			$(id).html("<img src='/css-img/load.gif' />");
			$.ajax({type: "POST",url: "/ajax/rent_property.php",data: postdata,success: function(msg){$(id).html(msg).fadeIn();}});
		});


	});	
	var currentslide = 1;
	var i=1;
	var nrSld1 =1
		function showSlide(nrSld) {
			currentslide = parseInt(nrSld)
			$('#slider .slideWrapper').animate({left:-385*(parseInt(nrSld)-1)})
			redrawBullets(nrSld);
		};

		function redrawBullets(slide) {
			var currentBullet = 's'+slide;
			$('#slideCtrl a').each(function(){
			$(this).removeClass('s');
			if($(this).hasClass(currentBullet)){
				$(this).addClass('s')
				}
			});
		};

		function loop() { 
		  if (i<4) {
		   showSlide(i);
		   setTimeout(function() { incr(); }, 12000);
		  }
		  else
		  {
		  i= 1;
		  showSlide(i);
		  loop();
		  }
		}
		function incr() {
		  i++;
		  loop();
		}

		function more_properties(page_no, quantity, order, category, total_pages)
		{
		var id = '#list_property';
		var postdata='page_no='+page_no+'&quantity='+quantity+'&order='+order+'&category='+category+'&total_pages='+total_pages;
		$(id).html("<img src='/css-img/load.gif' />");
		$.ajax({type: "POST",url: "/ajax/more_properties.php",data: postdata,success: function(msg){$(id).html(msg).fadeIn();}});
		}

