			$(function(){
				// Datepicker
				$('#datepicker').datepicker({
					inline: true
				});
				$("#datepicker").datepicker( "option", "minDate", '+1d' );
			});




//these checkboxes should call a function

     function displayAddresses() {
     
         if ($('.box0:checked').val() !=null || $('.box1:checked').val() !=null || $('.box2:checked').val() !=null || $('.box3:checked').val() !=null){
		$('#address-fields').show('fast');
		 $('#address-fields input').addClass('required')
		//console.log("mm");
	 }else{
		$('#address-fields').hide();
		 $('#address-fields input').removeClass('required')

		//console.log("bah");
	}
	 
        
      }
     $(function() {
       $('#addy_checkb input').click(displayAddresses);
       $('#appt_checkb input').click(displayAddresses);
       displayAddresses();
     });
     



function displayDateTime() {
  if ($('.box0:checked').val() !=null) {
    $('#date').show('fast');
    $('#phone_input').addClass('required'); 
    $('#phone_label').html('Phone*'); 
	  }
    else{
      $('#date').hide();  ///*****************************uncomment this to make our appointment checkbox work again
      $('#phone_input').removeClass('required');	    
      $('#phone_label').html('Phone'); 
      }
}

     $(function() {
       $('#appt_checkb input').click(displayDateTime);
       displayDateTime();
     });
 

$(document).ready(function(){ 
	$('#locations_select').change(function() {
	newloc = $("#locations_select :selected").val(); 
	$('#caregive_select').html("");	
	$('#' + newloc).clone().appendTo('#caregive_select');
	});
}); 
     




$(function() {
	setupMenu();
});
/******************************/
function setupMenu() {
	$('div#menu ul li').hover(function() {
		$('ul#' + $(this).attr('id') + '-menu').show();
	}, function() {
		$('ul#' + $(this).attr('id') + '-menu').hide();
	});
	$('div#submenus ul').hover(function() { 
		$(this).show(); 
		thisid = $(this).attr('id');
		parentid = thisid.substring(0,(thisid.length-5));
		$("#"+parentid+" a").addClass('hover');
	}, function() { 
		$(this).hide(); 
		$("#"+parentid+" a").removeClass('hover');
	});
	$('div#submenus ul ul').hover(function() { $(this).show(); }, function() { $(this).show(); });	
}
function goTo(url) {
	window.location = url;
}