/* Functions for send message form */

function conditionChk(which) {
	if (which != '0') {
		$('conditionField0').style.display = "none";
		$('capsule.conditionDate').disable();
	}
	if (which != '1') {
		$('conditionField1').style.display = "none";
		$('capsule.conditionHistoryCount').disable();
	}
	if (which == '0') {
		$('conditionField0').style.display = "block";
		$('capsule.conditionDate').enable();
	}
	if (which == '1') {
		$('conditionField1').style.display = "block";
		$('capsule.conditionHistoryCount').enable();
	}
}

function prepareCalendar(){
	Calendar.setup({
		inputField     :    "capsule.conditionDate",     // id of the input field
		ifFormat       :    "%Y/%m/%d",      // format of the input field
		button         :    "conditionDate.calendar",  // trigger for the calendar (button ID)
		align          :    "Br",           // alignment (defaults to "Bl")
		singleClick    :    true,
		weekNumbers:false,
		range:[2007, 2999],
		positionType : "fixed" // Specify 'fixed' when it's loaded in a lightbox.
	});
}
