<!--// 모바일에서 일자등 jquery 작동이 안되어 추가함: 모바일 스킨의 쓰기 앞부분임-->
<!--@if($_COOKIE["mobile"])-->
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/x.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("js/mboard.js")-->
<!--%import("css/mboard.css")-->
<!--@endif-->
<!--// 모바일에서 일자등 jquery 작동이 안되어 추가함 -->

<!--#include("_header.html")-->

<?php
$GLOBALS['pYear'] = Context::get('pYear');	// XE변수 넘겨받기 위해서.
$pYear=$GLOBALS['pYear']; 					// XE변수 넘겨받기 위해서.
$GLOBALS['pMonth'] = Context::get('pMonth');	// XE변수 넘겨받기 위해서.
$pMonth=$GLOBALS['pMonth']; 					// XE변수 넘겨받기 위해서.

$GLOBALS['extra_vars1'] = Context::get('extra_vars1');	  // XE변수 넘겨받기 위해서.
$in_extra_vars1=$GLOBALS['extra_vars1'];				
$in_extra_vars1_temp = str_replace("-", "", $in_extra_vars1);  // "-" 제거
$__Context->in_extra_vars1_temp = $in_extra_vars1_temp;			  // XE변수로 변환

if ($pYear == null){
    $pYear = date("Y");
    $pMonth = date("n");
    $pDay = date("d");
	}

$tmparr=explode("-", $in_extra_vars1);	//클릭한 날자
	if ($tmparr[2] != null){
	$wrkYear = $pYear =$tmparr[0];
	$wrkMonth = $pMonth =$tmparr[1];
	$wrkDay = $pDay =$tmparr[2];
	}
//echo "(".$wrkYear.$wrkMonth.$wrkDay.")"; //디버깅

// 타임 픽커를 위한 시작 종료 시간값 조정
if ($__Context->module_info->time_interval == null) {
	$__Context->time_interval = $time_interval = "15";		// 시간간격 15분
} else {
	$__Context->time_interval = $time_interval = $__Context->module_info->time_interval; // 시간간격 설정값
}
$__Context->working_start = $working_start = "08:30";	// 시작_부터 08:30분
$__Context->working_end = $working_end = "20:00";		// 시작_까지   20:00분
if(substr($working_end,0,2)*60 + substr($working_end,3,2) + $time_interval >= 24*60){
	$__Context->working_end = $working_end = intval((24*60-$time_interval)/60).":".((24*60-$time_interval)%60);
}
$s2 = mktime(substr($working_start,0,2), substr($working_start,3,2)+$time_interval-1, 0, 0, 0, 0);// 종료_부터 08:44분
$e2 = mktime(substr($working_end,0,2), substr($working_end,3,2)+$time_interval-1, 0, 0, 0, 0);    // 종료_까지 20:14분

$__Context->working_start_2 = $working_start_2 = date('H', $s2).":".date('i',$s2);	// 시작시간 08:00 + (간격-1)
$__Context->working_end_2 = $working_end_2 = date('H', $e2).":".date('i',$e2);		// 종료시간 20:00 + (간격-1)
?>

<!--// 미니칼렌다를 위한 스타일 --- -->
<style> 
.calendar_container { margin:0 0 20px 0; width:100%; height:auto; vertical-align:top; clear:both; *zoom:1; } 
.calendar_container:after { calendar_box:""; clear:both; display:block; } 
.calendar_box { float:left; width:185px; height:auto; text-align:center; border:1px solid #dddddd; margin-right:10px; padding:5px; } 
.calendar_box ul { width:100%; display:block; list-style-type:none; margin:0; padding:0; } 
.calendar_box li { width:25px; display:block; float:left; } 
.stoday { font-weight:bold; background-color:yellow; color:black;} 
.calendar_text { text-align:center; font-size:12px; } 
.ssunday { color:red; } 
.snday { color:blue; } 
.calendar_title { margin:0px; text-align:center; font-size:12px; background-color:#999999; color:#ffffff; } 
.clear { clear:both; } 
.time_table { width:640px; display:block; float:left; margin:0; padding:0; font-size:8pt;} 
.error { border:1px solid red; }
</style> 

<!--// 시간표시 테이블을 위한 스타일 --- -->
<style> 
.head_colunm_category { float:left; width:100px; text-align:center; border:1px #CCCCCC solid; margin:1px; font-size:12px; background-color:#999999; color:#ffffff; }
.head_colunm_subtitle { float:left; width:50px; text-align:center; border:1px #CCCCCC solid; margin:1px; font-size:12px; background-color:#999999; color:#ffffff; }
.head_colunm_time { float:left; width:30px; text-align:center; border:1px #CCCCCC solid; margin:1px; font-size:12px; background-color:#999999; color:#ffffff; }
.line_colunm_category { float:left;  width:100px; text-align:center; border:1px #CCCCCC solid; margin:1px; padding-top:3px;  padding-bottom:4px;} 
.line_colunm_subtitle { float:left;  width:50px; text-align:center; border:1px #CCCCCC solid; margin:1px; padding-top:5px;  padding-bottom:5px;} 
.line_colunm_time { float:left;  width:30px; text-align:center; border:1px #CCCCCC solid; margin:1px; }
.spacer { clear:both; margin:0; padding:0; line-height:0px; border-bottom:1px #CCCCCC solid;} 
</style> 

<?php 
// Display small calendar
function fn_smallcalendar_ymd($pYear, $pMonth, $pDay){ 
    $year = date("Y",mktime(0,0,0,$pMonth,1,$pYear)); 
    $month = date("n",mktime(0,0,0,$pMonth,1,$pYear)); 
    if ($pDay != 0){ 
    $day = date("d",mktime(0,0,0,$pMonth,$pDay,$pYear)); 
    } 
 
    $day_max = date("t",mktime(0,0,0,$month,1,$year)); 
    $week_start = date("w",mktime(0,0,0,$month,1,$year)); 
    $i = 0; 
    $j = 0; 
    $html = "<div class='calendar_box'>\n<div class='calendar_title stoday'>".sprintf("%d-%02d-%02d",$year,$month,$day)."</div>\n<ul>"; 
    while ($j<$day_max){ 
        if ($i<$week_start) { 
            $html .= "<li class='calendar_text'>*</li>"; 
        } else { 
            if ($i%7==0){ 
                $html .= "</ul><ul>\n"; 
                $font_color = " ssunday"; 
            } 
            else if ($i%7==6) $font_color = ""; 
            else $font_color = ""; 
            if ($month==$pMonth and $day == ($j+1)) $font_weight = " stoday"; 
            else $font_weight = ""; 
            $html .= "<li class='calendar_text$font_color$font_weight'>" . ($j+1) . "</li>"; 
            $j ++; 
        } 
        $i ++; 
    } 
    while ($i%7!==0){ 
        $html .= "<li class='calendar_text'>*</li>"; 
        $i ++; 
    } 
     $html .= "</ul>\n</div>\n"; 
    return $html; 
} 

// Get an array of file names in directory. 
function ReadFolderDirectory($dir) { 
	$listDir = array(); 
	if($handler = opendir($dir)) { 
		while (($sub = readdir($handler)) !== FALSE) { 
			if ($sub != "." && $sub != ".." && $sub != "Thumb.db" && $sub != "Thumbs.db") { 
				if(is_file($dir."/".$sub)) { 
					$listDir[] = $sub; 
                } 
			} 
		}    
		closedir($handler); 
	} 
	return $listDir;    
}
?>

<?php 
$year = date("Y"); 
$month = date("n"); 
$day = date("d"); 
?> 

<!--@if(!$_COOKIE["mobile"])-->
<div class="calendar_container"> 
    <?php echo fn_smallcalendar_ymd($pYear,$pMonth-1, 0);?> 
    <?php echo fn_smallcalendar_ymd($pYear,$pMonth, $pDay);?> 
    <?php echo fn_smallcalendar_ymd($pYear,$pMonth+1, 0);?> 
</div> 
<div class="clear">&nbsp;</div> 
<!--@endif-->

<!--// 아이콘 목록얻기 -->
<!--@if(is_dir($dir=$tpl_path."images/icon/client"))-->
    {@$icon_user = ReadFolderDirectory($dir)}
    {@$icon_user_path = $dir."/"}
<!--@endif-->
<!--@if(is_dir($dir=$tpl_path."images/icon/manager"))-->
    {@$icon_mgr = ReadFolderDirectory($dir)}
    {@$icon_mgr_path = $dir."/"}
<!--@endif-->

<!--// 중복일정 Y=허용, N=불허 (예약용)-->
<!--@if($module_info->duplicated_schedule == "N")--> 
	<!--#include("_write_reservation.html")-->
<!--@endif-->

<form action="./" method="post" onsubmit="jQuery(this).find('input').each(function(){if(this.title==this.value)this.value='';});return procFilter(this, window.insert)" id="fo_write" class="boardWrite">
<input type="hidden" name="mid" value="{$mid}" />
<!--@if(!$_COOKIE["mobile"])--> <!--// 모바일이 아닐때 실행 (에디터 관련 필드)-->
    <!--@if($oDocument->getContentText() == null && $module_info->auto_text != null)-->
      <input type="hidden" name="content" value="{$module_info->auto_text}" />
    <!--@else-->
      <input type="hidden" name="content" value="{$oDocument->getContentText()}" />
    <!--@endif-->
<!--@endif-->
<input type="hidden" name="document_srl" value="{$document_srl}" />

	<div class="boardWriteHeader">
		<!--// 중복일정 불허가 아니면 즉 허용이면 제목앞에 카테고리 출력-->
		<!--@if($module_info->use_category=="Y" && $module_info->duplicated_schedule != "N")-->  
		<select name="category_srl" class="category">
			<option value="">{$lang->category}</option>
			<!--@foreach($category_list as $val)-->
			<option <!--@if(!$val->grant)-->disabled="disabled"<!--@endif--> value="{$val->category_srl}" <!--@if($val->grant&&$val->selected||$val->category_srl==$oDocument->get('category_srl'))-->selected="selected"<!--@endif-->>
				{str_repeat("&nbsp;&nbsp;",$val->depth)} {$val->title} ({$val->document_count})
			</option>
			<!--@endforeach-->
		</select>
		<!--@endif-->

		<!--@if($oDocument->getTitleText())-->
		<input type="text" name="title" id="postTitle" class="inputText" value="{htmlspecialchars($oDocument->getTitleText())}" />
		<!--@else-->
		<input type="text" name="title" id="postTitle" class="inputText" value="{$lang->title}" title="{$lang->title}" onfocus="if(this.value==this.title) this.value='';" />
		<!--@endif-->
<!--@if(!$_COOKIE["mobile"])-->	<!--// 모바일일때 불러오기 숨김 -->
        <!--@if($is_logged)-->
        <span class="buttonOfficial"><button type="button" onclick="doDocumentLoad(this); return false;">{$lang->cmd_load}</button></span>
        <!--@endif-->
<!--@endif-->
		
	</div>

    <!--@if(count($extra_keys))-->
    <table border="1" cellspacing="0" summary="Extra Form" class="extraVarsList">
	<caption><em>*</em> : {$lang->is_required}</caption>
    <!--@foreach($extra_keys as $key => $val)-->
 	  <!--@if($val->idx != 7)-->  <!--// 시간이 아닐때 -->
      <tr>
		<!--@if($module_info->duplicated_schedule != "N")-->  <!--// 중복일정 Y=허용, N=불허 -->
        <th scope="row">{$val->name} <!--@if($val->is_required=='Y')--><em>*</em><!--@end--></th>
		<!--@else-->
			<!--@if($val->idx == 1 || $val->idx == 3 || $val->idx == 4 || $val->idx == 8)-->
		      <th scope="row">{$val->name} <!--@if($val->is_required=='Y')--><em>*</em><!--@end--></th>
			<!--@endif-->
		<!--@endif-->

		<!--@if($val->idx == 1)-->  <!--// 일정시작 -->
			<!--@if($in_extra_vars1_temp != null && $val->value == null)-->  <!--// 일정시작일자 없으면-->
				{@ $val->value = $in_extra_vars1_temp}
			<!--@endif-->
        <td>
		  <!--@if($module_info->duplicated_schedule != "N")-->  <!--// 중복일정 Y=허용, N=불허 -->
			  <div>{$val->getFormHTML()}</div>
		  <!--@else-->
	         {@$temp_getFormHTML = $val->getFormHTML()}
	         {@$temp_getFormHTML = str_replace("class=\"date\" />", " disabled class=\"date\" />", $temp_getFormHTML)}
			  <div>{$temp_getFormHTML}</div>
		  <!--@endif-->

          <!--@if(count($extra_keys) >= 7 )-->  <!--// 시간표 (0.2대 호환을 위해)-->
				{@$ev_arr=explode("|@|",$extra_keys[7]->value)}
				<!--@if($module_info->duplicated_schedule != "N")-->  <!--// 중복일정 허용-->
					<!--@if(count($ev_arr)>=2)-->{@$tmp_cnt = count($ev_arr)-1}<!--@else-->{@$tmp_cnt=1}<!--@endif--> <!--// 마지막시간값-->
	 				<p><br/>시작시간:&nbsp;<input type="text" name="extra_vars7" id="time1" size="7" value="{$ev_arr[0]}" />&nbsp;&nbsp;&nbsp;
					<!--@if($_COOKIE["mobile"])--><br/><!--@endif-->
					종료시간:&nbsp;<input type="text" name="extra_vars7" id="time2" size="7" value="{$ev_arr[$tmp_cnt]}" /></p>
					{$extra_keys[7]->desc}
				<!--@else-->	<!--// 중복일정 불허-->
					{@$ev_arr=explode("|@|",$extra_keys[7]->value)}  <!--// 선택된 시간 구하기-->
					{@$ev_type="checkbox"}
						<!--// 시간 레이블 출력-->
						<div class="spacer"></div>
						<div class="head_colunm_category" >분류</div>
						<div class="head_colunm_subtitle"> 분 </div>
						<!--@for($i = $wrking_start_stamp; $i <= $wrking_end_stamp; $i += 60*$time_interval)-->
							{@$tmp_fld03 = date('H', $i)}
							<!--@if($tmp_fld03 != $tmp_fld03_save)-->
								{@$hrs_label .=  ",".$tmp_fld03;}
							<!--@endif-->
							{@$tmp_fld03_save = date('H', $i);}
						<!--@endfor-->
							{@$hrs_label = substr($hrs_label,1);}
							{@$hrs_label_arr = explode(",",$hrs_label);}
							{@sort($hrs_label_arr);}
						<!--@foreach($hrs_label_arr as $val)-->			<!--// 시간 레이블 출력-->
							<div class="head_colunm_time">{$val}시</div>
						<!--@endforeach-->
						<div class="spacer"></div>
							
						<!--// 분 레이블 구하기-->
						<!--@for($i = $wrking_start_stamp; $i < $wrking_start_stamp + 60*60; $i += 60*$time_interval)-->
							{@$tmp_fld03 = date('i', $i);}
							{@$min_label .= ",".$tmp_fld03;}
						<!--@endfor-->
						{@$min_label = substr($min_label,1);}
						{@$min_label_arr = explode(",",$min_label);}
						{@sort($min_label_arr);}

						<!--@if($module_info->use_category == "Y")-->  <!--// 카테고리 사용 -->
							{@$tmp_category_list = $category_list}
						<!--@else-->	
							{@$tmp_category_list[0] = "0"}
						<!--@endif-->
						
						<!--@foreach($tmp_category_list as $val_cat)-->  <!--// 카테고리별 처리-->
						<!--//@if($val_cat->grant)--> <!--// 카테고리 사용 권한이 있으면(게시판 자체기능)-->
							<!--@if($module_info->use_category == "Y")-->  <!--// 카테고리 사용 -->
							{@$v_cat_arr=$reservation_arr[$val_cat->category_srl]}	<!--// 카테고리별 예약여부 점검을 위해-->
							<!--@else-->	
							{@$v_cat_arr=$reservation_arr[0]}	
							<!--@endif-->

							<!--@if($val_cat->category_srl==$oDocument->get('category_srl'))-->
								{@$ind_cat_checked = "Y"}
							<!--@else-->	
								{@$ind_cat_checked = null}
							<!--@endif-->

							<div class="line_colunm_category" style="float:left;">
								<!--// 카테고리 radio button 출력-->
							<!--@if($module_info->use_category == "Y")-->  <!--// 카테고리 사용 -->
								<li id="category_radio" style="flote:left;"><input type="radio" name="category_srl"  value="{$val_cat->category_srl}"  class="radio" <!--@if($ind_cat_checked == "Y")--> checked="checked" <!--@endif-->
								onchange="toggleStatus({$val_cat->category_srl})" /> 
								<label><br/>{$val_cat->title}</label></li>
							<!--@endif-->
							</div>
							<div class="line_colunm_subtitle" style='margin:0; padding:0;'>
							<!--@foreach($min_label_arr as $val_mm_label)-->			<!--// 분 레이블 출력-->
								<li style='margin:0; line-height:160%;'>{$val_mm_label}~{($val_mm_label + $time_interval -1)%60}</li>
							<!--@endforeach-->
							</div>
							<div id="line_div_time_{$val_cat->category_srl}" class="time">
							<!--@foreach($hrs_label_arr as $key_hh => $v_hh)-->  <!--// 시간대별 출력-->
							<div class="line_colunm_time">
								<!--@foreach($min_label_arr as $key_mm => $v_mm)-->  <!--// 분단위 출력-->
									{@$v_hhmm = $v_hh.":".$v_mm;}
									{@$tmp_css = "time_abled"}    <!--// jquery 시간선택 disabled 를 위해 필요-->
									<!--@if($v_cat_arr[$v_hhmm] == "*")-->
										{@$ind_disabled = null} 
									<!--@elseif($v_cat_arr[$v_hhmm] == "R")--> <!--// 예약된 경우 -->
										<!--@if(in_array($v_hhmm, $ev_arr) && $val_cat->category_srl == $oDocument->get('category_srl'))-->
										{@$ind_disabled = null} 		<!--// 문서수정일경우(카테고리사용) -->
										<!--@elseif(in_array($v_hhmm, $ev_arr) && $module_info->use_category != "Y")-->
										{@$ind_disabled = null} 		<!--// 문서수정일경우(카테고리사용않음) -->
										<!--@else-->
										{@$ind_disabled = "disabled"}  	<!--// 문서수정 아닐경우 -->
										{@$tmp_css = "time_disabled"}   <!--// jquery 시간선택 disabled 를 위해 필요-->
										<!--@endif-->
									<!--@else-->
										{@$ind_disabled = "disabled"}   <!--// 시간 외 -->
										{@$tmp_css = "time_disabled"}   <!--// jquery 시간선택 disabled 를 위해 필요-->
									<!--@endif-->
									<li class="{$tmp_css}{$val_cat->category_srl}" style='margin:0;'><input {$ind_disabled} type="{$ev_type}" name="extra_vars7" value="{$v_hhmm}" 
									<!--@if(in_array($v_hhmm, $ev_arr) && $module_info->use_category == "Y" && $val_cat->category_srl == $oDocument->get('category_srl'))-->
									checked="checked"
									<!--@elseif(in_array($v_hhmm, $ev_arr) && $module_info->use_category != "Y")-->	checked="checked"
									<!--@endif--> 
									/></li>
								<!--@endforeach-->  <!--// 분단위 출력 끝-->
							</div>
							<!--@endforeach-->  <!--// 시간대별 출력 끝-->
							</div>
						<div class="spacer"></div>

						<!--//@endif--> <!--// 카테고리 사용 권한이 있으면 끝(게시판 자체기능)-->
						<!--@endforeach-->  <!--// 카테고리별 출력 끝-->
				<!--@endif-->	<!--// 중복일정 불허 끝-->
          <!--@endif-->  <!--// 시간 끝-->
		</td>

		<!--@elseif($val->idx == 2)-->  <!--// 일정종료 -->
		  <!--@if($module_info->duplicated_schedule != "N")-->  <!--// 중복일정 허용-->
        <td>
		  <div>{$val->getFormHTML()}</div>
        </td>
		  <!--@end-->
		<!--@elseif($val->idx == 3 and $val->type != "color")-->  <!--// 배경색상 -->
        <td>
			<!--@if(!$val->value && $val->default)-->  <!--// value값 없고 default값 있으면..-->
				{@$val->value = $val->default}
			<!--@endif-->
            <!--@if($module_info->use_category != "Y")-->
                <?php Context::loadJavascriptPlugin('ui.colorpicker'); ?>
                <input type="text" name="extra_vars3" value="{$val->value}" class="color-indicator inputTypeText" />
                <br/>{$val->desc}
			<!--@else-->
				<!--@if($module_info->use_category_bgcolor == "category_bg" || $module_info->use_category_bgcolor == "category_text")-->
                    <?php Context::loadJavascriptPlugin('ui.colorpicker'); ?>
                    <input type="text" name="extra_vars3" value="{$val->value}" class="color-indicator inputTypeText" />
                    <br/>{$val->desc}
                    &nbsp;단, 이곳은 분류(카테고리) 색상이 적용됩니다.
			    <!--@else-->
                    <?php Context::loadJavascriptPlugin('ui.colorpicker'); ?>
                    <input type="text" name="extra_vars3" value="{$val->value}" class="color-indicator inputTypeText" />
                    <br/>{$val->desc}
                <!--@endif-->
            <!--@endif-->
        </td>
        <!--@elseif($val->idx == 4)-->  <!--// 일정확인 -->
        <td>
			<!--@if($extra_keys[4]->type == "radio" || $extra_keys[4]->type == "checkbox")-->
				{@$ev_type=$extra_keys[4]->type}
			<!--@else-->
				{@$ev_type="radio"}
			<!--@endif-->
            <!--@if($extra_keys[4]->default != null)-->         <!--// 기본값에 값이 있으면 이것으로 아이콘 목록 대체 -->
				{@$icon=explode("||",$extra_keys[4]->default)}  <!--// 기본값: 사용자용, 매니저용 아이콘 구분자 "||"-->
				{@$icon_user=explode(",",$icon[0])}
				{@$icon_user_path = $dir=$tpl_path."images/icon/"}
				{@$icon_mgr=explode(",",$icon[1])}
				{@$icon_mgr_path = $dir=$tpl_path."images/icon/"}
            <!--@endif-->

			{@$ev_arr=explode("|@|",$extra_keys[4]->value)}  <!--// 선택된 아이콘-->

			{@$tmp_count = 0}
			<!--@foreach($icon_user as $valf)-->  <!--// 사용자용 일정확인 아이콘 출력: 웹은 14개, 모바일 5개씩-->
				{@$tmp_count = $tmp_count + 1}
				{@$valf_id = str_replace(".", "_", $valf)}
				<input type="{$ev_type}" id="{$valf_id}" name="extra_vars4" value="{$valf}" 
				<!--@if(in_array($valf, $ev_arr))-->checked="checked"<!--@endif--> 
				/> 
				<label for="{$valf_id}" onclick="if(navigator.appVersion.indexOf('MSIE') != -1){$valf_id}.click()"><img src="{$icon_user_path}{$valf}" style="cursor:pointer;" /></label>
				<!--@if(($tmp_count == 14 && !$_COOKIE["mobile"]) || ($tmp_count == 5 && $_COOKIE["mobile"]))-->{@$tmp_count = 0} <br/> <!--@endif-->
			<!--@endforeach-->

			{@$tmp_count = 0}
			<!--@if($grant->manager && $icon_mgr[0] !=null )-->  <!--// 매니저용 일정확인 아이콘 출력-->
				<br />
				<!--@foreach($icon_mgr as $valf)-->
					{@$tmp_count =$tmp_count + 1}
					{@$valf_id = str_replace(".", "_", $valf)}
					<input type="{$ev_type}" id="{$valf_id}" name="extra_vars4" value="{$valf}" 
					<!--@if(in_array($valf, $ev_arr))-->checked="checked"<!--@endif--> 
					/> 
					<label for="{$valf_id}" onclick="if(navigator.appVersion.indexOf('MSIE') != -1){$valf_id}.click()"><img src="{$icon_mgr_path}{$valf}" style="cursor:pointer;" /></label>
					<!--@if(($tmp_count == 14 && !$_COOKIE["mobile"]) || ($tmp_count == 5 && $_COOKIE["mobile"]))-->{@$tmp_count = 0} <br/> <!--@endif-->
				<!--@endforeach-->
			<!--@endif-->

            <br/>{$val->desc}
        </td>
        <!--@elseif($val->idx == 8)-->  <!--// 공개그룹 -->
            <!--@if($logged_info->member_srl != null && $module_info->display_opengroup != "N")-->
            <!--@if($grant->manager)-->
                {@$oMemberModel = &getModel('member'); $group_list = $oMemberModel->getGroups($module_info->site_srl);}
                <!--@foreach($group_list as $key => $group)-->
                    {@$group_list_temp .= ','.$group->title}
                <!--@end-->
                {@$group_list_temp=substr($group_list_temp,1)}   <!--// 전체 user그룹목록 -->

                {@$oMemberAdminModel = &getAdminModel('member'); $member_list_out = $oMemberAdminModel->getMemberList();}
                <!--@foreach($member_list_out->data as $key_a => $member_tmp)-->
					<!--// {@$member_tmp_name = $member_tmp->nick_name}--> <!--// nick_name을 이용-->
					{@$member_tmp_name = $member_tmp->user_name} <!--// user_name을 이용-->
		            <!--@if($member_tmp_name)-->
                    {@$member_list_temp .= ','.$member_tmp_name} <!--// 전체 member_name 목록 -->
			         <!--@endif-->
                <!--@end-->

            <!--@else-->
                {@$group_list = $logged_info->group_list}
                <!--@foreach($group_list as $key => $group)-->
                    {@$group_list_temp .= ','.$group}
                <!--@end-->
                {@$group_list_temp=substr($group_list_temp,1)}  <!--// login user가 소속된 user그룹목록 -->
            <!--@endif-->
            {@$group_list_arr = explode(",",$group_list_temp)}
            {@$open_group_arr=explode("|@|",$extra_keys[8]->value)}  <!--// 선택된 공개그룹-->
            <!--@endif-->
        <td>
            <!--@if($module_info->display_opengroup != "N")-->
              <!--@if($logged_info->member_srl != null)-->
                <!--@foreach($group_list_arr as $key => $group)-->
                   <input type="checkbox" name="extra_vars8" value="{$group}" id="open_group_{$group}"<!--@if(in_array($group, $open_group_arr))--> checked="checked"<!--@end--> />
                   <label for="open_group_{$group}">{$group}</label>
                <!--@end-->
				<!--@if($oDocument->get('nick_name'))-->
					{@$tmp_nick_name = $oDocument->get('nick_name')}
				<!--@else-->
					{@$tmp_nick_name = $logged_info->nick_name}
				<!--@endif-->
                   <input type="hidden" name="extra_vars8" value="{$tmp_nick_name}" id="open_group_owner" checked="checked" />
                   <label for="open_group_owner"></label>

				<!--@if($grant->manager)-->
					{@$member_list_arr = explode(",",$member_list_temp)}
					{@sort($member_list_arr)}
					&nbsp;&nbsp;&nbsp;&nbsp;User:&nbsp;
					<select name="extra_vars8" id="open_group_user" > <!--// 공개할 user_name 선택-->
						<!--@foreach($member_list_arr as $key_a => $member_a)-->
						<option value="{$member_a}" <!--@if(in_array($member_a, $open_group_arr) && $member_a != $tmp_nick_name )--> selected="selected" <!--@endif--> >
						{$member_a}
						</option>
						<!--@endforeach-->
					</select>
				<!--@endif-->
              <!--@else-->
				로그인 하면 공개그룹을 선택할 수 있습니다.
              <!--@endif-->
            <!--@else-->
			   공개그룹 사용하지 않음으로 설정 되었습니다.
            <!--@endif-->
            <br/>{$val->desc}
        </td>

        <!--@elseif($val->idx == 5 || $val->idx == 6)-->
            <!--@if($module_info->duplicated_schedule != "N")-->  <!--// 중복일정 허용-->
        <td>{$val->getFormHTML()}</td>
            <!--@endif-->

		<!--@else-->
            {@$temp_getFormHTML = $val->getFormHTML()}
			<!--@if($val->type == "radio")-->  <!--// 라디오타입 한줄로 출력위해-->
            {@$temp_getFormHTML = str_replace("<ul>", "", $temp_getFormHTML)}
            {@$temp_getFormHTML = str_replace("</ul>", "", $temp_getFormHTML)}
			<!--@endif-->
        <td>{$temp_getFormHTML}</td>
		<!--@endif-->
      </tr>
 	  <!--@endif-->  <!--// 시간(7)이 아닐때 -->
   <!--@endforeach-->
    </table>
    <!--@endif-->

	<div class="editorOption">
		<!--@if(!$is_logged)-->
		   <input type="text" name="nick_name" class="inputText userName" value="{$lang->writer}" title="{$lang->writer}" onfocus="if(this.value==this.title)this.value='';return false;" />
		   <input type="password" name="password" class="inputText userPw" value="{$lang->password}" title="{$lang->password}"  onfocus="if(this.value==this.title)this.value='';return false;" />
		   <input type="text" name="email_address" class="inputText emailAddress" value="{$lang->email_address}" title="{$lang->email_address}"  onfocus="if(this.value==this.title)this.value='';return false;" />
		   <input type="text" name="homepage" class="inputText homePage" value="{$lang->homepage}" title="{$lang->homepage}"  onfocus="if(this.value==this.title)this.value='';return false;" /><br/>
		<!--@end-->
		
        <!--@if($grant->manager)-->
			{@$_status_arr = array('A'=>'기본', 'F'=>'완료', 'R'=>'취소') }   <!--// 기본: 최초는 null, 수정하면 A -->
			{@$_doc_extra_vars = explode(";", $oDocument->get('extra_vars'))}
			{@$_doc_extra_vars1 = explode(":", $_doc_extra_vars[0])}
			{@$_doc_status = str_replace("\"", "", $_doc_extra_vars1[2])}
			<!--@if($_doc_status != 'X')-->
			<select name="extra_vars" id="extra_vars" >
		        <!--@if($_doc_status == null)-->
					<option value="">상태</option>
		        <!--@endif-->
				<!--@foreach($_status_arr as $key => $_status)-->
					<option value={$key} <!--@if($key==$_doc_status)-->selected="selected"<!--@endif--> >
					{$_status}
					</option>
				<!--@endforeach-->
			</select>
			<!--@endif-->
			{@ $_color = array('555555','222288','226622','2266EE','8866CC','88AA66','EE2222','EE6622','EEAA22','EEEE22') }
	        <select name="title_color" id="title_color" <!--@if($oDocument->get('title_color'))-->style="color:#{$oDocument->get('title_color')};"<!--@end--> onchange="this.style.color=this.options[this.selectedIndex].style.color;">
                <option value="" style="color:#CCCCCC;">{$lang->title_color}</option>
                <!--@foreach($_color as $_col)-->
                <option value="{$_col}" style="color:#{$_col}" <!--@if($oDocument->get('title_color')==$_col)-->selected="selected"<!--@end-->>{$lang->title_color}</option>
                <!--@endforeach-->
            </select>
            <input type="checkbox" name="title_bold" id="title_bold" value="Y" <!--@if($oDocument->get('title_bold')=='Y')-->checked="checked"<!--@end--> />
            <label for="title_bold">{$lang->title_bold}</label>
            <input type="checkbox" name="is_notice" value="Y" <!--@if($oDocument->isNotice())-->checked="checked"<!--@end--> id="is_notice" />
            <label for="is_notice">{$lang->notice}</label>
            <input type="checkbox" name="lock_comment" value="Y" <!--@if($oDocument->isLocked())-->checked="checked"<!--@end--> id="lock_comment" />
            <label for="lock_comment">{$lang->lock_comment}</label>
		<!--@endif-->
        <!--@if($module_info->secret=="Y")-->
            <input type="checkbox" name="is_secret" value="Y" <!--@if($oDocument->isSecret())-->checked="checked"<!--@end--> id="is_secret" />
            <label for="is_secret">{$lang->secret}</label>
        <!--@end-->
            <input type="checkbox" name="allow_comment" value="Y" <!--@if($oDocument->allowComment())-->checked="checked"<!--@end--> id="allow_comment" />
            <label for="allow_comment">{$lang->allow_comment}</label>
            <input type="checkbox" name="allow_trackback" value="Y" <!--@if($oDocument->allowTrackback())-->checked="checked"<!--@end--> id="allow_trackback" />
            <label for="allow_trackback">{$lang->allow_trackback}</label>
        <!--@if($is_logged)-->
            <input type="checkbox" name="notify_message" value="Y" <!--@if($oDocument->useNotify())-->checked="checked"<!--@end--> id="notify_message" />
            <label for="notify_message">{$lang->notify}</label>
        <!--@end-->
    </div>

<!--@if($_COOKIE["mobile"])--> <!--//모바일일 경우 에디터 대신-->
			<ul class="sn"><li>
				<label for="nText" class="db fb">{$lang->content}</label>
				<textarea name="content" cols="20" rows="8" id="nText" class="itxx">{$oDocument->getContentText()}</textarea>
			</li></ul>
<!--@else--> <!--//모바일이 아닐때는 에디터 사용-->
    <div class="editor">{$oDocument->getEditor()}</div>
<!--@endif-->

    <div class="tag">
        <input type="text" name="tags" value="{htmlspecialchars($oDocument->get('tags'))}" class="inputText" title="Tag" />
		<p>{$lang->about_tag}</p>
    </div>
	
	<!--@if(unserialize($oDocument->get('extra_vars')) != "X")--> 
	<div class="boardNavigation">
		<span class="buttonOfficial"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
		<span class="buttonOfficial"><button type="button" onclick="doDocumentSave(this);">{$lang->cmd_temp_save}</button></span>
		<span class="buttonOfficial"><button type="button" onclick="doDocumentLoad(this);">{$lang->cmd_load}</button></span>
	</div>
	<!--@end-->

    </form>
<!--#include("_footer.html")-->

<!--@if($module_info->duplicated_schedule != "N" && count($extra_keys) >= 7)--> 

<!--// 일반적인 Time Picker -->
<style type="text/css" media="all"><!--%import("timepicker/timePicker.css")--></style>
<script type="text/javascript" src="{$tpl_path}timepicker/jquery.timePicker.js"></script>
<script type="text/javascript">//<![CDATA[
var $j = jQuery.noConflict();
$j(document).ready(function()
{
    // 시작시간 08:00  - 20:30, 15 minutes steps.
    $j('#time1').timePicker({
       startTime: "{$working_start}",  // Using string. Can take string or Date object.
       endTime: "{$working_end}",  // Using Date object here.
       show24Hours: true,
       separator:':',
       step: {$time_interval} });
    //  종료시간 08:00  - 20:30, 15 minutes steps.
    $j('#time2').timePicker({
       startTime: "{$working_start_2}",  // Using string. Can take string or Date object.
       endTime: "{$working_end_2}",  // Using Date object here.
       show24Hours: true,
       separator:':',
       step: {$time_interval} });

    // Store time used by duration.
    var oldTime = $j.timePicker("#time1").getTime();
    
    // Keep the duration between the two inputs.
    $j("#time1").change(function() {
      if ($j("#time2").val()) { // Only update when second input has a value.
        // Calculate duration.
        var duration = ($j.timePicker("#time2").getTime() - oldTime);
        var time = $j.timePicker("#time1").getTime();
        // Calculate and update the time in the second input.
        $j.timePicker("#time2").setTime(new Date(new Date(time.getTime() + duration)));
        oldTime = time;
      }
    });
    // Validate.
    $j("#time2").change(function() {
      if($j.timePicker("#time1").getTime() > $j.timePicker(this).getTime()) {
        $j(this).addClass("error");
      }
      else {
        $j(this).removeClass("error");
      }
    });

  });
  //]]></script>

<!--@else-->
<!--// 예약시간 선택을 위한 카테고리에따른 disabled 토글을 위하여 -->
<script type="text/javascript" >
var $j = jQuery.noConflict();
$j(document).ready(function(){
	var checked_category_srl = $j('.line_colunm_category input:radio:checked').val();
	//alert(checked_category_srl);
	//alert ($j('#category_radio').length);
	if ( $j('#category_radio').length ) {
	$j('.time :input').attr('disabled', true);
	$j('.time_abled'+ checked_category_srl + ' :input').attr('disabled', false);
	}
});

function toggleStatus(category_srl) {
	$j('.time :input').attr('disabled', true);
	$j('.time_abled'+ category_srl + ' :input').attr('disabled', false);
}
</script>
<!--@endif-->
