$(function(){

/*
	var updateSelects = function (selectedDate)
	{
		
		$('#day option[value=' + selectedDate.getDate() + ']').attr('selected', 'selected');
		$('#month option[value=' + (selectedDate.getMonth()+1) + ']').attr('selected', 'selected');
		//$('#y option[value=' + (selectedDate.getFullYear()) + ']').attr('selected', 'selected');
	}
*/
	
    
	$('.content_block').hover(function() {
		$(this).addClass('content_active');
	}, function() {
		$(this).removeClass('content_active');
	});
	
	$("a.content_edit_link").fancybox({
		'frameWidth': 800,
		'frameHeight': 600,
		'hideOnContentClick': false,
		'overlayOpacity': 0.7
	});
	$("a.fbox").fancybox({
		'frameHeight': 600,
		'hideOnContentClick': false,
		'overlayOpacity': 0.7
	});-
	
	$("#appointment_date").datepicker({onSelect: function(dateText, inst) {
	
var selectedDate = new Date(dateText);
		
		var day = selectedDate.getDate();
		var month = (selectedDate.getMonth()+1);
		var month_name = $('#month option[value=' + month + ']').html();
		//updateSelects(dateText);
		$('#day option[value=' + day + ']').attr('selected', 'selected');
		$('#month option[value=' + month + ']').attr('selected', 'selected');
		
		//$('#day_container li').removeClass('selected');
		//$('#month_container li').removeClass('selected');
		
		//$('#day_container #day_input_'+day).addClass('selected');
		//$('#month_container #month_input_'+month).addClass('selected');
		
		$('.appointment_date_block .appointment_day_field span').html(day);
		$('.appointment_date_block .appointment_month_field span').html(month_name);
		//$('#month_input').val(month).html();
		
		
		//$(this).datepicker("setDate", new Date(2009,month,day));

		//$('')
		//console.log(dateText);
	}});
	
	$('#appointment_js_calendar').click(function(){
		$("#appointment_date").datepicker('show');
		return false;
	});
	
	$("#appointment_form").jqTransform();

	// http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerIntoSelects.html
	// $('.appointment_block select').selectbox();


});

/*
tinyMCE.init({
	mode : "exact",
	elements : "tinymce",
	theme : "simple"
});
*/
