/* 
 * Calender support Javascript for iStudy Enterprise Server
 * update 2005/10/16 
 *
*/
function onClickCalendarType01(id_fld,id_btn) {

	Zapatec.Calendar.setup({
        inputField     :    id_fld,     /* id of the input field */
        ifFormat       :    "%Y/%m/%d" ,      /*  format of the input field */
        button         :    id_btn ,  /* trigger for the calendar (button ID) */
        align          :    "Tl" ,           /* alignment (defaults to "Bl") */
        singleClick    :    true
		});
	
}
function onClickCalendarType01Ex(id_fld,id_btn,fmt) {

	Zapatec.Calendar.setup({
        inputField     :    id_fld,     /* id of the input field */
        ifFormat       :    fmt ,      /*  format of the input field */
        daFormat       :    fmt ,      
        button         :    id_btn ,  /* trigger for the calendar (button ID) */
        align          :    "Tl" ,           /* alignment (defaults to "Bl") */
        singleClick    :    true
		});
	
}
function onClickCalendarType02(id_fld,id_btn) {

	Zapatec.Calendar.setup({
        inputField     :    id_fld, 
        ifFormat       :    "%Y/%m/%d %H:%M:%S",
        button         :    id_btn,
        align          :    "Tl",
		showsTime      :    true,
        singleClick    :    true
		});
	
}
function onClickCalendarType02Ex(id_fld,id_btn,fmt) {

	Zapatec.Calendar.setup({
        inputField     :    id_fld, 
        ifFormat       :    fmt,
        daFormat       :    fmt ,      
        button         :    id_btn,
        align          :    "Tl",
		showsTime      :    true,
        singleClick    :    true
		});
	
}
function onClickCalendarType03(id_fld,id_btn) {

	Zapatec.Calendar.setup({
        inputField     :    id_fld,     /* id of the input field */
        ifFormat       :    "%Y-%m-%d" ,      /*  format of the input field */
        button         :    id_btn ,  /* trigger for the calendar (button ID) */
        align          :    "Tl" ,           /* alignment (defaults to "Bl") */
        singleClick    :    true
		});
	
}

function setPramsDate(obj_fid,obj_y,obj_m,obj_d,fmt) {

	var n_day = obj_fid.value;
	var dateFormat = new DateFormat(fmt);
	
	if (n_day.length == 0) {
		return;
	}
	
	var date_x = dateFormat.parse(n_day);
	var dateFormat_yy = new DateFormat("yyyy");
	var date_yy = dateFormat_yy.format(date_x);
	if (date_yy != null) {
		obj_y.value = date_yy;
	}
	var dateFormat_mm = new DateFormat("MM");
	var date_mm = dateFormat_mm.format(date_x);
	if (date_mm != null) {
		obj_m.value = date_mm;
	}
	var dateFormat_dd = new DateFormat("dd");
	var date_dd = dateFormat_dd.format(date_x);
	if (date_dd != null) {
		obj_d.value = date_dd;
	}
	
}	

function clearTxt(obj_fid){

	obj_fid.value ="";
	
}

