$(document).ready(function() {
	$("#eform_128 .eform_button input").click(function() {
		if(!$("#eform_128 .eformbuilder_checkbox_LEFT input").is(":checked")) {
			alert("To proceed, you must agree to the terms and conditions by checking the box");
			return false;
		}
	});

  // Tooltip helpers for search input boxes
  $(".ss-formadvancedsidebarinput input").val("e.g. business name, location");
  $(".ss-searchformleft .input").focus(function() {
    if($(this).val() == "Enter your site search here...") {
      $(this).val("");
      $(this).addClass("focused");
    }
  });
  $(".ss-searchformleft .input").blur(function() {
    if($(this).val() == "") {
      $(this).val("Enter your site search here...");
      $(this).removeClass("focused");
    }
  });
  $(".ss-formadvancedsidebarinput input").focus(function() {
    if($(this).val() == "e.g. business name, location" || $(this).val() == "e.g. make, model, type") {
      $(this).val("");
      $(this).addClass("focused");
    }
  });
  $(".ss-formadvancedsidebarinput input").blur(function() {
    if($(this).val() == "") {
      if($("#ss-advancedsearchheader").length > 0) {
        $(this).val("e.g. business name, location");
        $(this).removeClass("focused");
      }
      else if($("#ss-autochoicesearchheader").length > 0 || $("#ss-autochoicesearchsidebarheader").length > 0){
        $(this).val("e.g. make, model, type");
        $(this).removeClass("focused");
      }
    }
  });
  
  $("#ss-galleryphoto a").lightBox({
	imageLoading: '/Branches/StaffServices/StaffServices/Files/Images/lightbox-ico-loading.gif',
	imageBtnClose: '/Branches/StaffServices/StaffServices/Files/Images/lightbox-btn-close.gif',
	imageBtnPrev: '/Branches/StaffServices/StaffServices/Files/Images/lightbox-btn-prev.gif',
	imageBtnNext: '/Branches/StaffServices/StaffServices/Files/Images/lightbox-btn-next.gif'
	});
  
});
