$(document).ready(function(){
  // $(".index #slider").easySlider({
  //   auto: true,
  //   numeric: true,
  //   numericId: 'controls',
  //   continuous: true
  // });

  $(".inner #slider").easySlider({
    auto: true,
    numeric: true,
    numericId: 'controls',
    nextId: "next",
    prevId: "prev",
    continuous: true,
    speed: 800
  });

  // Main Mobile slider
	$("#mobile-slider").easySlider({
		auto: true,
		continuous: true,
		speed:800,
		prevId: "mobile-prevBtn",
		nextId: "mobile-nextBtn",
		controlsShow: false
	});

  // Mobile 'yourway' slider
	$("#mobile-yourway-slider").easySlider({
		auto: true,
		continuous: true,
		speed:800,
		prevId: "mobile-prevBtn",
		nextId: "mobile-nextBtn",
		controlsShow: false
 
 	});

  // Mobile 'design' slider
	$("#mobile-design-slider").easySlider({
		auto: true,
		continuous: true,
		speed:800,
		prevId: "mobile-prevBtn",
		nextId: "mobile-nextBtn",
		controlsShow: false
 	});


  // GENERIC SLIDER
  $(".inner .slider").easySlider({
    auto: true,
    numeric: true,
    numericId: 'controls',
    nextId: "next",
    prevId: "prev",
    continuous: true,
    speed: 800
  });


  // GENERIC TOGGLE
  $('.toggle-dropdown .toggle').hide();
  $('.toggle-dropdown .trigger').click(function(){
		$(this).toggleClass("active").next().slideToggle("fast");
  });


  // LOWER TOGGLE
  $('.lower-trigger').click(function(){
    $(this).toggleClass("active").prev().slideToggle("fast");
  });


  // SPECIFIC TOGGLES
	$(".toggle_container1").hide();

	$("p.trigger1").click(function(){
		$(this).toggleClass("active").next().slideToggle("fast");
	});
	
	$(".toggle_container").hide();

	$("p.trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("fast");
	});
	
	$(".toggle_container").hide();

	$("h2.trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("fast");
	});

	$(".toggle_footer").hide();

	$("p.trigger-footer").click(function(){
		$(this).toggleClass("active").next().slideToggle("fast");
	});

	$(".toggle-fyh-price").hide();

	$("p.trigger-fyh-price").click(function(){
		$(this).toggleClass("active").next().slideToggle("fast");
	});

	$(".toggle-fyh-region").hide();

	$("p.trigger-fyh-region").click(function(){
		$(this).toggleClass("active").next().slideToggle("fast");
	});
	
	function promptForChat() {
		$("#chatPrompt").fadeIn("slow");
	}
	$("#chatPrompt > h2").click( function() {
		$("#hoc_icon > div").click();		// this activates the HelpOnClick window	
	});
	$("#chatPrompt > a").click( function( event ) {
		$("#chatPrompt").fadeOut("slow");	// get rid of the prompt slider
		event.preventDefault();				// stop the follow-through on the click; otherwise chat window opens
	});

	window.setTimeout( promptForChat, 120000 );	// 2 minutes (120,000 milliseconds = 2 minutes)

});

$(function(){
	// Tabs
	$('#tabs').tabs();
	//hover states on the static widgets
	$('#dialog_link, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
});

$(function() {
	$("#accordion").accordion();
});

$(function() {
	$("#faqs").accordion({
		collapsible: true
	});
});

$(function() {
	$("#real-estate-faqs").accordion({
		collapsible: true
	});
});

$(function() {
	$("#see-all").toggle("fast");
});

$(function() {
	$("#referral").toggle("fast");
});

$(function() {
	$("#solutions").accordion();
});

$(function() {
	$("#datepicker").datepicker();
});

