resortJump = function(){
		   var SearchURL = "http://www.buyglobalhomes.com/orlando-real-estate.cfm?";
		   var resortCode = $('#sID').val();
		   qString = ("searchID=" + resortCode );
		   window.open(SearchURL + qString, "_self", "");
};

validate = function(){
	    var forc = "";
		var SearchURL = "http://mlx.buyglobalhomes.com/searchResults.cfm?";
		if ($("#b_foreclosures").is(":checked")){
		forc = 1;
		}
		
		if ($("#b_bankowned").is(":checked")){
		forc = forc + 2;
		}
		var Foreclosure = forc;
		var City = $('#City').val();
		var Zip = $('#Zip').val();
		var Community = $('#tags').val();
		var Beds = $('#MinBeds').val();
		var Baths = $('#MinBaths').val();
		var MinPrice = $('#MinPrice').val();
		var MaxPrice = $('#MaxPrice').val();
		
		QueryString = (Community == "" ? "" : "Communities=" + Community ) +
		(City == "" ? "" : "&Cities=" + encodeURIComponent(City)) +
		(Zip == "" ? "" : "&ZipCodes=" + encodeURIComponent(Zip)) +
		(Beds == "" ? "" : "&MinBeds="+Beds) +
		(Baths == "" ? "" : "&MinBaths="+Baths) +
		(MinPrice == "" ? "" : "&MinPrice="+MinPrice) +
		(MaxPrice == "" ? "" : "&MaxPrice="+MaxPrice) +
		(Foreclosure == "" ? "" : "&Foreclosures="+Foreclosure);
		
		QueryString += "&PerformSearch";
		//alert(QueryString);
		window.open(SearchURL + QueryString, "_self", "");
	};

$(function() {
		$("#slider-range").slider({
			range: true,
			min: 50000,
			max: 2000000,
			step: 50000,
			values: [200000, 500000],
			slide: function(event, ui) {
				$("#tMinPrice").val($("#slider-range").slider("values", 0));
				$("#MinPrice").val($("#slider-range").slider("values", 0));
				$("#tMinPrice").formatCurrency();
				$("#tMaxPrice").val($("#slider-range").slider("values", 1));
				$("#tMaxPrice").formatCurrency();
				$("#MaxPrice").val($("#slider-range").slider("values", 1));
			},
			stop: function(event,ui){
				
			}
		});
		$("#tMinPrice").val($("#slider-range").slider("values", 0));
		$("#tMaxPrice").val($("#slider-range").slider("values", 1));
		$("#tMinPrice,#tMaxPrice").formatCurrency();
		
});

$(function() {
		$("#slider-beds").slider({
			range: "min",
			min: 1,
			max: 8,
			value: 3,
			slide: function(event, ui) {
				$("#MinBeds").val(ui.value);
			}
		});
		$("#MinBeds").val($("#slider-beds").slider("value"));
	});

$(function() {
		$("#slider-baths").slider({
			range: "min",
			min: 1,
			max: 6,
			value: 2,
			slide: function(event, ui) {
				$("#MinBaths").val(ui.value);
			}
		});
		$("#MinBaths").val($("#slider-baths").slider("value"));
	});

// Code for twitter box

currentTweet = 1;

function pauseTweet(){
	window.clearTimeout(tweetTime);
	$('#tControl').empty().append('<a href="javascript:startTweet();">Play</a>');
	tStatus = 0;
}

function startTweet(){
	if (tStatus != 1){
	$('#tControl').empty().append('<a href="javascript:pauseTweet();">Pause</a>');	
	flipTweet();
	tStatus = 1;
	}
}

function flipTweet() {
  if (currentTweet != 4){
  $('#myTweet'+currentTweet).hide();
  currentTweet++;
  $('#myTweet'+currentTweet).fadeIn("slow");
  tweetTime = window.setTimeout(flipTweet, 7000, true);
  }else{
  $('#myTweet'+currentTweet).hide();
  currentTweet = 1;
  $('#myTweet'+currentTweet).fadeIn("slow");
  tweetTime = window.setTimeout(flipTweet, 7000, true);
  }
}
tweetTime= window.setTimeout(flipTweet, 7000, true);

