<script id="directoryTemplate" type="text/x-handlebars-template">
	<div id="heading{{ index }}" class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapse{{ index }}">
		<a class="panel-toggle">
			{{ name }}
		</a>
	</div>
	<div id="collapse{{ index }}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading{{ index }}">
		<div class="panel-body">
			<ul class="nav nav-list"></ul>
		</div>
	</div>
</script>
<script id="stnDirectoryTemplate" type="text/x-handlebars-template">
   <li class="nav-header">{{ name }}</li>
   <li class="divider"></li>
</script>
<script id="ugDirectoryTemplate" type="text/x-handlebars-template">
   <li class="nav-header">{{ name }}</li>
   <li class="divider"></li>
</script>
<script id="programsTemplate" type="text/x-handlebars-template">
   <a href="#pgm{{ num }}" data-toggle="tab">{{ name }}</a>
</script>
<script id="functionsTemplate" type="text/x-handlebars-template">
   <a href="#{{ num }}" data-toggle="tab">{{ name }}</a>
</script>
<script id="stnProgramsTemplate" type="text/x-handlebars-template">
   <a href="#pgm{{ num }}" data-toggle="tab">{{ name }}</a>
</script>
<script id="ugProgramsTemplate" type="text/x-handlebars-template">
   <a href="#pgm{{ num }}" data-toggle="tab">{{ name }}</a>
</script>
<script id="pgmTemplate" type="text/x-handlebars-template">
   {{#if button}}
       {{key_func key}} {{button_func button}}
   {{/if}}
   {{#if preload}}
       {{key_func key}} {{load_func preload}}
   {{/if}}
   {{#if contents}}
       {{key_func key}} {{content_func contents}}
   {{/if}}
   {{#if table}}
       {{key_func key}} {{table_func table}}
   {{/if}}
   {{#if edit_table}}
       {{key_func key}} {{edit_table_func edit_table}}
   {{/if}}
   {{#if th}}
       {{key_func key}} {{head_func th}}
   {{/if}}
   {{#if tr}}
       {{key_func key}} {{item_func tr}}
   {{/if}}
   {{#if struct}}
       {{key_func key}} {{struct_func struct}}
   {{/if}}
   {{#if variable_data}}
       {{key_func key}} {{variable_func variable_data}}
   {{/if}}
</script>
<script id="make_attrTemplate" type="text/x-handlebars-template">
   {{#if title}}
       {{key_func key}} {{attr_func title}}
   {{/if}}
</script>
<script id="make_funcTemplate" type="text/x-handlebars-template">
   {{#if button}}
       {{key_func key}} {{fbutton_func button}}
   {{/if}}
   {{#if preload}}
       {{key_func key}} {{fload_func preload}}
   {{/if}}
   {{#if contents}}
       {{key_func key}} {{fcontent_func contents}}
   {{/if}}
   {{#if table}}
       {{key_func key}} {{ftable_func table}}
   {{/if}}
   {{#if edit_table}}
       {{key_func key}} {{ftable_func edit_table}}
   {{/if}}
   {{#if th}}
       {{key_func key}} {{fhead_func th}}
   {{/if}}
   {{#if tr}}
       {{key_func key}} {{fitem_func tr}}
   {{/if}}
   {{#if struct}}
       {{key_func key}} {{fstruct_func struct}}
   {{/if}}
   {{#if variable_data}}
       {{key_func key}} {{fvariable_func variable_data}}
   {{/if}}
</script>
<script id="functionTabTemplate" type="text/x-handlebars-template">
   <div class="tab-pane tab-pane-sub active" id={{tab_content_id}}>
   </div>
</script>
<script id="add_functionTemplate" type="text/x-handlebars-template">
   <div id=add_function_attrs class="col-md-3 lc-altwell" style="margin-left:0px; overflow-y:auto"></div>

   <div id=add_function_group class="col-md-9 lc-altwell">
       <div class="function_name" style="padding-bottom:5px">
           <span style="margin-left:10px">{{ add_name }}:</span> <input id="function_name" class="form-control" type='textfield' />
           <div class="toolTip">
					<img class="toolTip-img" src="img/help_icon.png">
					<div class="toolTip-txt" style="display: none;"> {{ add_toolTip1 }}<br>{{ add_toolTip2 }}<br>{{ add_toolTip3 }}<br><br>{{ add_toolTip4 }} </div>
			  </div>
           <input type="button" value="{{ add_save }}" class="btn_save_function"  style="margin-left:20px"/>
       </div>

       <div id="add_function_tab" class="tabbable">
           <ul class="nav nav-tabs nav-tabs-sub"></ul>
           <div class="tab-content tab-content-sub"></div>
       </div>
   </div>
</script>
<script id="favoriteTemplate" type="text/x-handlebars-template">
   <div class="fav_button" name="{{ num }}">
       <div class="fav_pgmname">{{ pgm_name }}</div>
       <div class="fav_dirname">{{ dir_name }}</div>
   </div>
</script>
<script id="stninfoTemplate" type="text/x-handlebars-template">
   <div style="height:100%; text-align:center">
{{#if IS_CHN}}
		 <br>
		 <p style="font-size:20px; font-weight:bold;">{{ STATION }} {{ STN_NUM }} {{ PROGRAM }}</p>
		 <br>
		 {{ SYSTEM_ID }} {{ VERSION }} : {{ APP_VERSION }}
		 <br><br>
{{else}}
       <p style="font-size:20px; font-weight:bold;">{{ BOARD_ID }}</p>
       <br><br>
       {{ STATION }} {{ STN_NUM }} {{ PROGRAM }}
       <br><br>
       {{ SYSTEM_ID }} {{ VERSION }} : {{ APP_VERSION }}
{{/if}}
   </div>
</script>
<script id="aclhelpTemplate" type="text/x-handlebars-template">
   <div style="height:100%;">
       <p>
       <B> < {{ ACLUSAGE }} > </B><br>
       {{ ACLUSAGE_TEXT }}
       </p>

       <p>
       <B> < {{ DEFACLACT }} > </B><br>
       {{ DEFACLACT_TEXT1 }}<br>
       <B> [{{ DEFACLACT_EXCEPT }}] </B> {{ DEFACLACT_EXCEPT_TEXT }}<br>
       {{ DEFACLACT_TEXT2 }}<br>
       {{ DEFACLACT_TEXT3 }}<br>
       {{ DEFACLACT_TEXT4 }}<br>
       </p>

       <p>
       <B> < {{ SORTBTN }} > </B><br>
       {{ SORTBTN_TEXT }}
       </p>

       <p>
       <B> < {{ APPLYBTN }} > </B><br>
       {{ APPLYBTN_TEXT }}<br>
       </p>

       <p>
       <B> < {{ STOPBTN }} > </B><br>
       {{ STOPBTN_TEXT }}<br>
       </p>

       <p>
       <B> < {{ CLEARBTN }} > </B><br>
       {{ CLEARBTN_TEXT }}<br>
       </p>

       <p>
       <B> < {{ SAVEBTN }} > </B><br>
       {{ SAVEBTN_TEXT }}<br>
       </p>

       <p>
       <B> < {{ ACLSET }} > </B><br>
       {{ ACLSET1 }}<br>
       {{ ACLSET1_TEXT }}<br>
       <br>
       {{ ACLSET2 }}<br>
       {{ ACLSET2_TEXT }}<br>
       <br>
       {{ ACLSET3 }}<br>
       {{ ACLSET3_TEXT }}<br>
       {{ ACLSET3_CASE1 }}<br>
       {{ ACLSET3_CASE1_TEXT }}<br>
       {{ ACLSET3_CASE2 }}<br>
       {{ ACLSET3_CASE2_TEXT }}
       </p>
   </div>
</script>
<script id="fileuploadTemplate" type="text/x-handlebars-template">
{{#if IS_IW}}
	<div class="button"><input type="button" class="btn_next" value=" {{ BTN_NEXT }} "></div>
	<br>
{{/if}}
   <div>
       <p><font size=2><strong>{{ INFO }}</strong></font></P>
       <br>
       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="fileupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								    <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
						</div>
               </div>
               <!-- The loading indicator is shown during file processing -->
               <div class="fileupload-loading"></div>
               <br>
               <!-- The table listing the files available for upload/download -->
               <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
           </form>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
   </div>
</script>
<script id="iwfileuploadTemplate" type="text/x-handlebars-template">
	<img src="img/close_icon.png" class="icon_closeUploadPanel" />
   <div>
       <p><font size=2><strong>{{ INFO }}</strong></font></P>
       <br>
       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="iwfileupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								    <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
						</div>
               </div>
               <!-- The loading indicator is shown during file processing -->
               <div class="fileupload-loading"></div>
               <br>
               <!-- The table listing the files available for upload/download -->
               <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
           </form>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
   </div>
</script>
<script id="dbfileuploadTemplate" type="text/x-handlebars-template">
   <div>
       <p><font size=2><strong>{{ INFO }}</strong></font></P>
       <br>
       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="dbfileupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								    <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
						</div>
               </div>
               <!-- The loading indicator is shown during file processing -->
               <div class="fileupload-loading"></div>
               <br>
               <!-- The table listing the files available for upload/download -->
               <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
           </form>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
   </div>
</script>
<script id="mlfileuploadTemplate" type="text/x-handlebars-template">
   <div>
       <p><font size=2><strong>{{ INFO }}</strong></font></P>
       <br>
       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="mlfileupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								    <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
						</div>
               </div>
               <!-- The loading indicator is shown during file processing -->
               <div class="fileupload-loading"></div>
               <br>
               <!-- The table listing the files available for upload/download -->
               <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
           </form>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
   </div>
</script>
<script id="VSFPromptUploadTemplate" type="text/x-handlebars-template">
   <div>
       <p><font size=2><strong>{{ PRMTUP_INFO5 }}</strong></font></P>
       <p><font size=2><strong>{{ PRMTUP_INFO1 }}</strong></font></P>
       <p><font color=red size=2><strong>{{ PRMTUP_INFO2 }}</strong></font></P>
       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="vsfprmtfileupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
{{#if IS_UVM}}
								  <input type="hidden" name="VSFPT_UPLOAD" value="16">
{{else}}
								  <select class="form-control" name="VSFPT_UPLOAD">
									  <option value="1" >{{ PRMTUP_FIRST }}</option>
									  <option value="2" >{{ PRMTUP_SECOND }}</option>
									  <option value="3" >{{ PRMTUP_THIRD }}</option>
									  <option value="4" >{{ PRMTUP_FOURTH }}</option>
									  <option value="5" >{{ PRMTUP_FIFTH }}</option>
									  <option value="6" >{{ PRMTUP_SIXTH }}</option>
								  </select>
{{/if}}
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								    <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
						</div>
               </div>
               <!-- The loading indicator is shown during file processing -->
               <div class="fileupload-loading"></div>
               <br>
               <!-- The table listing the files available for upload/download -->
               <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
           </form>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
			 <hr>
       <p><font size=2><strong>{{ PRMTUP_INFO4 }}</strong></font></P>
       <p><font size=2><strong>{{ PRMTUP_INFO3 }}</strong></font></P>
{{#if IS_UVM}}
       <table class="table table-bordered">
        <tr bgcolor="#d9edf7">
            <th width=150><input type="button" class="btn_selectall" value="{{ BTN_SELECTALL }}"></th>
         <th><strong>{{ PRMTUP_LANGUAGE }}</strong></th>
         <th><strong>{{ PRMTUP_VERSION }}</strong></th>
        </tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT1" class="chk_selectall"></td><td>{{ PPT1 }}</td><td>{{ PPT_VER1 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT2" class="chk_selectall"></td><td>{{ PPT2 }}</td><td>{{ PPT_VER2 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT3" class="chk_selectall"></td><td>{{ PPT3 }}</td><td>{{ PPT_VER3 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT4" class="chk_selectall"></td><td>{{ PPT4 }}</td><td>{{ PPT_VER4 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT5" class="chk_selectall"></td><td>{{ PPT5 }}</td><td>{{ PPT_VER5 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT6" class="chk_selectall"></td><td>{{ PPT6 }}</td><td>{{ PPT_VER6 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT7" class="chk_selectall"></td><td>{{ PPT7 }}</td><td>{{ PPT_VER7 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT8" class="chk_selectall"></td><td>{{ PPT8 }}</td><td>{{ PPT_VER8 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT9" class="chk_selectall"></td><td>{{ PPT9 }}</td><td>{{ PPT_VER9 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT10" class="chk_selectall"></td><td>{{ PPT10 }}</td><td>{{ PPT_VER10 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT11" class="chk_selectall"></td><td>{{ PPT11 }}</td><td>{{ PPT_VER11 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT12" class="chk_selectall"></td><td>{{ PPT12 }}</td><td>{{ PPT_VER12 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT13" class="chk_selectall"></td><td>{{ PPT13 }}</td><td>{{ PPT_VER13 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT14" class="chk_selectall"></td><td>{{ PPT14 }}</td><td>{{ PPT_VER14 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT15" class="chk_selectall"></td><td>{{ PPT15 }}</td><td>{{ PPT_VER15 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT16" class="chk_selectall"></td><td>{{ PPT16 }}</td><td>{{ PPT_VER16 }}</td></tr>
		<tr><td width=150><input type="checkbox" name="DEL_PPT17" class="chk_selectall"></td><td>{{ PPT17 }}</td><td>{{ PPT_VER17 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT18" class="chk_selectall"></td><td>{{ PPT18 }}</td><td>{{ PPT_VER18 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT19" class="chk_selectall"></td><td>{{ PPT19 }}</td><td>{{ PPT_VER19 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT20" class="chk_selectall"></td><td>{{ PPT20 }}</td><td>{{ PPT_VER20 }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT21" class="chk_selectall"></td><td>{{ PPT21 }}</td><td>{{ PPT_VER21 }}</td></tr>
          <tr>
               <td colspan="3" style="text-align: center;">
{{#ifEqual AUTH 2}}
						<input type="button" class="btn_p76_del" value=" {{ BTN_DEL }} ">
{{else}}
						<input type="button" class="btn_p76_del" value=" {{ BTN_DEL }} style="cursor: default;" disabled">
{{/ifEqual}}
					</td>
          </tr>
       </table>
{{else}}
       <table class="table table-bordered">
        <tr bgcolor="#d9edf7">
            <th width=150><input type="button" class="btn_selectall" value="{{ BTN_SELECTALL }}"></th>
         <th><strong>{{ PRMTUP_POSITION }}</strong></th>
         <th><strong>{{ PRMTUP_VERSION }}</strong></th>
        </tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT1" class="chk_selectall"></td><td>{{ PRMTUP_FIRST }}</td><td>{{ PRMTUP_VER_FIRST }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT2" class="chk_selectall"></td><td>{{ PRMTUP_SECOND }}</td><td>{{ PRMTUP_VER_SECOND }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT3" class="chk_selectall"></td><td>{{ PRMTUP_THIRD }}</td><td>{{ PRMTUP_VER_THIRD }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT4" class="chk_selectall"></td><td>{{ PRMTUP_FOURTH }}</td><td>{{ PRMTUP_VER_FOUTH }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT5" class="chk_selectall"></td><td>{{ PRMTUP_FIFTH }}</td><td>{{ PRMTUP_VER_FIFTH }}</td></tr>
        <tr><td width=150><input type="checkbox" name="DEL_PPT6" class="chk_selectall"></td><td>{{ PRMTUP_SIXTH }}</td><td>{{ PRMTUP_VER_SIXTH }}</td></tr>
          <tr>
               <td colspan="3" style="text-align: center;">
{{#ifEqual AUTH 2}}
						<input type="button" class="btn_p76_del" value=" {{ BTN_DEL }} ">
{{else}}
						<input type="button" class="btn_p76_del" value=" {{ BTN_DEL }} style="cursor: default;" disabled">
{{/ifEqual}}
					</td>
          </tr>
       </table>
{{/if}}
   </div>
</script>
<script id="VSFPromptIndividualUploadTemplate" type="text/x-handlebars-template">
   <div>
       <p><font size=2><strong>{{ INDIVUP_INFO1 }}</strong></font></P>
       <p><font size=2><strong>{{ INDIVUP_INFO2 }}</strong></font></P>
       <p><font color=red size=2><strong>{{ INDIVUP_INFO3 }}</strong></font></P>
       <p><font color=red size=2><strong>{{ INDIVUP_INFO4 }}</strong></font></P>

       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="indivfileupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
							  <select class="form-control" name="VSFPT_UPLOAD">
{{#if IS_UVM}}
									<option value="31" >{{ INDIVUP1 }}</option>
									<option value="32" >{{ INDIVUP2 }}</option>
									<option value="33" >{{ INDIVUP3 }}</option>
									<option value="34" >{{ INDIVUP4 }}</option>
									<option value="35" >{{ INDIVUP5 }}</option>
									<option value="36" >{{ INDIVUP6 }}</option>
									<option value="37" >{{ INDIVUP7 }}</option>
									<option value="38" >{{ INDIVUP8 }}</option>
									<option value="39" >{{ INDIVUP9 }}</option>
									<option value="40" >{{ INDIVUP10 }}</option>
									<option value="41" >{{ INDIVUP11 }}</option>
									<option value="42" >{{ INDIVUP12 }}</option>
									<option value="43" >{{ INDIVUP13 }}</option>
									<option value="44" >{{ INDIVUP14 }}</option>
									<option value="45" >{{ INDIVUP15 }}</option>
									<option value="46" >{{ INDIVUP16 }}</option>
									<option value="47" >{{ INDIVUP17 }}</option>
									<option value="48" >{{ INDIVUP18 }}</option>
									<option value="49" >{{ INDIVUP19 }}</option>
									<option value="50" >{{ INDIVUP20 }}</option>
									<option value="51" >{{ INDIVUP21 }}</option>
{{else}}
									<option value="11" >{{ INDIVUP_FIRST }}</option>
									<option value="12" >{{ INDIVUP_SECOND }}</option>
									<option value="13" >{{ INDIVUP_THIRD }}</option>
									<option value="14" >{{ INDIVUP_FOURTH }}</option>
									<option value="15" >{{ INDIVUP_FIFTH }}</option>
									<option value="16" >{{ INDIVUP_SIXTH }}</option>
{{/if}}
							  </select>
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								    <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
						</div>
               </div>
               <!-- The loading indicator is shown during file processing -->
               <div class="fileupload-loading"></div>
               <br>
               <!-- The table listing the files available for upload/download -->
               <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
           </form>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
   </div>
</script>
<script id="VSFSGIndividualUploadTemplate" type="text/x-handlebars-template">
   <div>
       <p><font size=2><strong>{{ SGINDIVUP_INFO1 }}</strong></font></P>
{{#if IS_UVM}}
		 <p><font size=2><strong>{{ SGINDIVUP_INFO2_UVM }}</strong></font></P>
{{else}}
       <p><font size=2><strong>{{ SGINDIVUP_INFO2 }}</strong></font></P>
{{/if}}
       <p><font color=red size=2><strong>{{ SGINDIVUP_INFO3 }}</strong></font></P>
       <p><font color=red size=2><strong>{{ SGINDIVUP_INFO4 }}</strong></font></P>

       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="sgindivfileupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
							  <select class="form-control" name="VSFPT_UPLOAD">
{{#if IS_UVM}}
									<option value="131" >{{ SGINDIVUP_FIRST }}</option>
									<option value="132" >{{ SGINDIVUP_SECOND }}</option>
									<option value="133" >{{ SGINDIVUP_THIRD }}</option>
									<option value="134" >{{ SGINDIVUP_FOURTH }}</option>
									<option value="135" >{{ SGINDIVUP_FIFTH }}</option>
									<option value="136" >{{ SGINDIVUP_SIXTH }}</option>
{{else}}
									<option value="41" >{{ SGINDIVUP_FIRST }}</option>
									<option value="42" >{{ SGINDIVUP_SECOND }}</option>
									<option value="43" >{{ SGINDIVUP_THIRD }}</option>
									<option value="44" >{{ SGINDIVUP_FOURTH }}</option>
									<option value="45" >{{ SGINDIVUP_FIFTH }}</option>
									<option value="46" >{{ SGINDIVUP_SIXTH }}</option>
{{/if}}
							  </select>
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								    <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
						</div>
               </div>
               <!-- The loading indicator is shown during file processing -->
               <div class="fileupload-loading"></div>
               <br>
               <!-- The table listing the files available for upload/download -->
               <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
           </form>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
   </div>
</script>
<script id="VSFSGDownloadTemplate" type="text/x-handlebars-template">
   <div>
		<p><font size=2><strong>{{ SGDN_INFO1 }}</strong></font></p>
		<form method="get" action="" name="ONE_SGDOWN">
			<select class="form-control" name="SGNAME">
				<option value="SGTYPE1.rom" {{ SGDN_TYPE_DA_1 }}>{{ SGDN_TYPE1 }}</option>
				<option value="SGTYPE2.rom" {{ SGDN_TYPE_DA_2 }}>{{ SGDN_TYPE2 }}</option>
				<option value="SGTYPE3.rom" {{ SGDN_TYPE_DA_3 }}>{{ SGDN_TYPE3 }}</option>
				<option value="SGTYPE4.rom" {{ SGDN_TYPE_DA_4 }}>{{ SGDN_TYPE4 }}</option>
				<option value="SGTYPE5.rom" {{ SGDN_TYPE_DA_5 }}>{{ SGDN_TYPE5 }}</option>
				<option value="SGTYPE6.rom" {{ SGDN_TYPE_DA_6 }}>{{ SGDN_TYPE6 }}</option>
			</select>
			<br><br><font color="red" size=2><strong>{{ SGDN_INFO2 }}</strong></font>
			<br><br>
			<input type="button" onclick="SGdownload()" value="{{ BTN_DOWN }}">
		</form>
   </div>
</script>
<script id="VSFSGUploadTemplate" type="text/x-handlebars-template">
   <div>
       <p><font size=2><strong>{{ SGUP_INFO1 }}</strong></font></p>
{{#unless IS_UVM}}
       <table class="table table-bordered">
        <tr bgcolor="#d9edf7">
         <th colspan=2><strong>{{ SGUP_LTYPE }}</strong></th>
        </tr>
        <tr><td>{{ SGUP_FIRST }}</td><td>{{ SGUP_LTYPE_FIRST }}</td></tr>
        <tr><td>{{ SGUP_SECOND }}</td><td>{{ SGUP_LTYPE_SECOND }}</td></tr>
        <tr><td>{{ SGUP_THIRD }}</td><td>{{ SGUP_LTYPE_THIRD }}</td></tr>
        <tr><td>{{ SGUP_FOURTH }}</td><td>{{ SGUP_LTYPE_FOUTH }}</td></tr>
        <tr><td>{{ SGUP_FIFTH }}</td><td>{{ SGUP_LTYPE_FIFTH }}</td></tr>
        <tr><td>{{ SGUP_SIXTH }}</td><td>{{ SGUP_LTYPE_SIXTH }}</td></tr>
       </table>
       <br>
{{/unless}}
       <p><font color=red size=2><strong>{{ SGUP_INFO2 }}</strong></font></P>

       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="vsfsgfileupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
							  <select class="form-control" name="VSFPT_UPLOAD">
{{#if IS_UVM}}
									<option value="101" >{{ SGUP_FIRST }}</option>
									<option value="102" >{{ SGUP_SECOND }}</option>
									<option value="103" >{{ SGUP_THIRD }}</option>
									<option value="104" >{{ SGUP_FOURTH }}</option>
									<option value="105" >{{ SGUP_FIFTH }}</option>
									<option value="106" >{{ SGUP_SIXTH }}</option>
{{else}}
									<option value="31" >{{ SGUP_FIRST }}</option>
									<option value="32" >{{ SGUP_SECOND }}</option>
									<option value="33" >{{ SGUP_THIRD }}</option>
									<option value="34" >{{ SGUP_FOURTH }}</option>
									<option value="35" >{{ SGUP_FIFTH }}</option>
									<option value="36" >{{ SGUP_SIXTH }}</option>
{{/if}}
							  </select>
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								    <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
						</div>
               </div>
               <!-- The loading indicator is shown during file processing -->
               <div class="fileupload-loading"></div>
               <br>
               <!-- The table listing the files available for upload/download -->
               <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
           </form>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
   </div>
</script>
<script id="usrgrtfileuploadTemplate" type="text/x-handlebars-template">
   <div>
      <p><font size=2><strong>{{ INFO }}</strong></font></P>
      <p><font color="red" size=2><strong>{{ INFO2 }}</strong></font></P>
      <br>
		<p><font size=2><strong>{{ INFO3 }}</strong></font></P>
       <br>
       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="usrgrtfileupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
								  <input type="hidden" name="VSFUG_UPLOAD" value="151">
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								    <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
						</div>
               </div>
               <!-- The loading indicator is shown during file processing -->
               <div class="fileupload-loading"></div>
               <br>
               <!-- The table listing the files available for upload/download -->
               <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
           </form>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
   </div>
</script>
<script id="usrgrtfiledownloadTemplate" type="text/x-handlebars-template">
   <div>
		<p><font size=2><strong>{{ INFO }}</strong></font></p>
{{#if FILE_EXIST}}
		<p><font size=2><strong>{{ INFO2 }}</strong></font><font color="blue" size=2><strong>UG.rom</strong></font></p>
{{else}}
		<p><font color="blue" size=2><strong>{{ NO_FILE_EXIST }}</strong></font></p>
{{/if}}
{{#if FILE_EXIST}}
		<input type="button" onclick="USRGRTdownload()" value="{{ BTN_DOWN }}">
{{else}}
		<input type="button" onclick="USRGRTdownload()" value="{{ BTN_DOWN }}" disabled>
{{/if}}
   </div>
</script>
<script id="usrgrtindividualUploadTemplate" type="text/x-handlebars-template">
   <div>
       <p><font size=2><strong>{{ UGINDIVUP_INFO1 }}</strong></font></P>
       <p><font size=2><strong>{{ UGINDIVUP_INFO2 }}</strong></font></P>
       <p><font color=red size=2><strong>{{ UGINDIVUP_INFO3 }}</strong></font></P>
       <p><font color=red size=2><strong>{{ UGINDIVUP_INFO4 }}</strong></font></P>

       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="ugindivfileupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
							  <select class="form-control" name="VSFUG_UPLOAD">
									<option value="155" >{{ UGINDIVUP_FIRST }}</option>
									<option value="156" >{{ UGINDIVUP_SECOND }}</option>
									<option value="157" >{{ UGINDIVUP_THIRD }}</option>
									<option value="158" >{{ UGINDIVUP_FOURTH }}</option>
							  </select>
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								    <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
						</div>
               </div>
               <!-- The loading indicator is shown during file processing -->
               <div class="fileupload-loading"></div>
               <br>
               <!-- The table listing the files available for upload/download -->
               <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
           </form>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
   </div>
</script>
<script id="cdnfileuploadTemplate" type="text/x-handlebars-template">
   <div>
      <p><font size=2><strong>{{ INFO }}</strong></font></P>
      <p><font color="red" size=2><strong>{{ INFO2 }}</strong></font></P>
      <br>
		<p><font size=2><strong>{{ INFO3 }}</strong></font></P>
       <br>
       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="cdnfileupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
								  <input type="hidden" name="VSFCDN_UPLOAD" value="152">
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								    <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
						</div>
               </div>
               <!-- The loading indicator is shown during file processing -->
               <div class="fileupload-loading"></div>
               <br>
               <!-- The table listing the files available for upload/download -->
               <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
           </form>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
   </div>
</script>
<script id="cdnfiledownloadTemplate" type="text/x-handlebars-template">
   <div>
		<p><font size=2><strong>{{ INFO }}</strong></font></p>
{{#if FILE_EXIST}}
		<p><font size=2><strong>{{ INFO2 }}</strong></font><font color="blue" size=2><strong>CDN.rom</strong></font></p>
{{else}}
		<p><font color="blue" size=2><strong>{{ NO_FILE_EXIST }}</strong></font></p>
{{/if}}
{{#if FILE_EXIST}}
		<input type="button" onclick="CDNdownload()" value="{{ BTN_DOWN }}">
{{else}}
		<input type="button" onclick="CDNdownload()" value="{{ BTN_DOWN }}" disabled>
{{/if}}
   </div>
</script>
<script id="hotelReceiptTemplate" type="text/x-handlebars-template">
	<!DOCTYPE html>
	<html>
	<head></head>
	<body>
		<scr{{!}}ipt type="text/javascript" src="js/libs/jquery-2.1.1.min.js"></scr{{!}}ipt>
		<scr{{!}}ipt type="text/javascript">
			function disableF5(e) {
				if ((e.which || e.keyCode) == 116)
					e.preventDefault();
			};
			$(document).bind("keydown", disableF5);
			$(document).on("keydown", disableF5);
		</scr{{!}}ipt>
		<input type="button" value=" {{ RCPT_PRINT }} " onclick="window.document.close();window.print();">

		<table border=1 width=600 cellspacing=0>
			<tr>
				<td colspan=4 align=right>{{ RCPT_TITLENUM }} : {{ RCPT_NUM }}</td>
			</tr>

			<tr>
			<th colspan=4 align=center>
			<br><FONT SIZE=4> {{ RCPT_RECEIPT }}
			<br>
			<P>
			</th>
			</tr>

			<tr>
			<td colspan=4 align=left>
			<br><pre> {{ RCPT_HOTELNAME }}
			<br> {{ RCPT_TITLETEL }} : {{ RCPT_TEL }}
			<br> {{ RCPT_TITLEADDR }} : {{ RCPT_ADDR }}
			<br> {{ RCPT_TITLEHP }} : {{ RCPT_HP }}
			<br> {{ RCPT_TITLETAXNUM }} : {{ RCPT_TAXNUM }}</pre>
			<P>
			</td>
			</tr>

			<tr>
			<td colspan=4 align=left>
			<br><pre> {{ RCPT_TITLEROOMNUM }} : {{ RCPT_ROOMNUM }}
			<br> {{ RCPT_TITLENAME }} : {{ RCPT_GUESTNAME }}
			<br> {{ RCPT_TITLECOM }} : {{ RCPT_COM }}
			<br> {{ RCPT_TITLEMADDR }} : {{ RCPT_MADDR }}
			<br> {{ RCPT_TITLESADDR }} : {{ RCPT_SADDR }}
			<br> {{ RCPT_TITLECHKIN }} : {{ RCPT_CHKIN }}({{ RCPT_CMTHOUR }})
			<br> {{ RCPT_TITLECHKOUT }} :{{ RCPT_CHKOUT }}({{ RCPT_CMTHOUR }})</pre>
			<P>
			</td>
			</tr>

			<tr>
			<td><B>{{ RCPT_ITEM }}</B></td><td><B>{{ RCPT_COST }} ({{ RCPT_CURUNIT }})</B></td><td><B>{{ RCPT_TAX }} ({{ RCPT_CURUNIT }})</B></td><td><B>{{ RCPT_SUM }}</B></td>
			</tr>
			<tr>
			<td><LI>{{ RCPT_TITLEROOMCH }}</td><td>{{ RCPT_ROOMCH }}</td><td>{{ RCPT_ROOMTAX }}</td><td>{{ RCPT_ROOMSUM }}</td>
			</tr>
			<tr>
			<td><LI>{{ RCPT_TITLECALLCH }}</td><td>{{ RCPT_CALLCH }}</td><td>{{ RCPT_CALLTAX }}</td><td>{{ RCPT_CALLSUM }}</td>
			</tr>
			<tr>
			<td><LI>{{ RCPT_TITLEBARCH }}</td><td>{{ RCPT_BARCH }}</td><td>{{ RCPT_BARTAX }}</td><td>{{ RCPT_BARSUM }}</td>
			</tr>
			<tr>
			<td><LI>{{ RCPT_TITLEPREPAID }}</td><td> </td><td> </td><td>{{ RCPT_PREPAID }}</td>
			</tr>
			<tr>
			<td colspan=3><B>{{ RCPT_TITLETOTAL }}</B></td><td><B>{{ RCPT_TOTALSUM }}</B></td>
			</tr>

			<tr align=right>
			<td colspan=4>
			<br>
			<pre>{{ RCPT_DATE }}       </pre>
			<pre>{{ RCPT_SIGN }} :                    </pre>
			</td>
			</tr>
		</table>
	</body>
	</html>
</script>
<script id="hotelRoomChTemplate" type="text/x-handlebars-template">
	<!DOCTYPE html>
	<html>
	<head></head>
	<body>
		<scr{{!}}ipt type="text/javascript" src="js/libs/jquery-2.1.1.min.js"></scr{{!}}ipt>
		<scr{{!}}ipt type="text/javascript">
			function disableF5(e) {
				if ((e.which || e.keyCode) == 116)
					e.preventDefault();
			};
			$(document).bind("keydown", disableF5);
			$(document).on("keydown", disableF5);
		</scr{{!}}ipt>
		<input type="button" value=" {{ ROOMCH_PRINT }} " onclick="window.document.close();window.print();">

		<table border=1 width=600 cellspacing=0>
			<tr>
				<td colspan=8 align=right>{{ ROOMCH_TITLENUM }} : {{ ROOMCH_NUM }}</td>
			</tr>

			<tr>
			<th colspan=8 align=center>
			<br><FONT SIZE=4> {{ ROOMCH_RECEIPT }}
			<br>
			<P>
			</th>
			</tr>

			<tr>
			<td colspan=8 align=left>
			<br><pre> {{ ROOMCH_HOTELNAME }}
			<br> {{ ROOMCH_TITLETEL }} : {{ ROOMCH_TEL }}
			<br> {{ ROOMCH_TITLEADDR }} : {{ ROOMCH_ADDR }}
			<br> {{ ROOMCH_TITLEHP }} : {{ ROOMCH_HP }}
			<br> {{ ROOMCH_TITLETAXNUM }} : {{ ROOMCH_TAXNUM }}</pre>
			<P>
			</td>
			</tr>

			<tr>
			<td colspan=8 align=left>
			<br><pre> {{ ROOMCH_TITLEROOMNUM }} : {{ ROOMCH_ROOMNUM }}
			<br> {{ ROOMCH_TITLENAME }} : {{ ROOMCH_GUESTNAME }}
			<br> {{ ROOMCH_TITLECOM }} : {{ ROOMCH_COM }}
			<br> {{ ROOMCH_TITLEMADDR }} : {{ ROOMCH_MADDR }}
			<br> {{ ROOMCH_TITLESADDR }} : {{ ROOMCH_SADDR }}
			<br> {{ ROOMCH_TITLECHKIN }} : {{ ROOMCH_CHKIN }}({{ ROOMCH_CMTHOUR }})
			<br> {{ ROOMCH_TITLECHKOUT }} :{{ ROOMCH_CHKOUT }}({{ ROOMCH_CMTHOUR }})</pre>
			<P>
			</td>
			</tr>

			<tr>
			<td><B>{{ ROOMCH_STARTTIME }}</B></td><td><B>{{ ROOMCH_CO }}</B></td><td><B>({{ ROOMCH_DURATION }})</B></td><td colspan=2><B>{{ ROOMCH_DIALEDNUM }}</B></td><td><B>({{ ROOMCH_COUNT }})</B></td><td><B>{{ ROOMCH_TITLECALLCH }}</B></td><td><B>{{ ROOMCH_REMARK }}</B></td>
			</tr>
			{{{ ROOMCH_CALLDETAIL }}}
			<tr>
			<td colspan=6><B>{{ ROOMCH_TITLETOTALCNT }}</B></td><td colspan=2><B>{{ ROOMCH_TOTALCALLCNT }}</B></td>
			</tr>
			<tr>
			<td><B>{{ ROOMCH_CHARGETIME }}</B></td><td colspan=2><B>{{ ROOMCH_CHARGESTA }}</B></td><td colspan=3><B>({{ ROOMCH_ITEM }})</B></td><td><B>{{ ROOMCH_TITLEBARCH }}</B></td><td><B>({{ ROOMCH_TAX }})</B></td>
			</tr>
			{{{ ROOMCH_BARDETAIL }}}
			<tr>
			<td colspan=6><B>{{ ROOMCH_TITLETOTALCNT }}</B></td><td colspan=2><B>{{ ROOMCH_TOTALBARCNT }}</B></td>
			</tr>
			<tr>
			<td><B>{{ ROOMCH_ITEM }}</B></td><td colspan=2><B>{{ ROOMCH_COST }} ({{ ROOMCH_CURUNIT }})</B></td><td colspan=3><B>{{ ROOMCH_TAX }} ({{ ROOMCH_CURUNIT }})</B></td><td colspan=2><B>{{ ROOMCH_SUM }}</B></td>
			</tr>
			<tr>
			<td><LI>{{ ROOMCH_TITLEROOMCH }}</td><td colspan=2>{{ ROOMCH_ROOMCH }}</td><td colspan=3>{{ ROOMCH_ROOMTAX }}</td><td colspan=2>{{ ROOMCH_ROOMSUM }}</td>
			</tr>
			<tr>
			<td><LI>{{ ROOMCH_TITLECALLCH }}</td><td colspan=2>{{ ROOMCH_CALLCH }}</td><td colspan=3>{{ ROOMCH_CALLTAX }}</td><td colspan=2>{{ ROOMCH_CALLSUM }}</td>
			</tr>
			<tr>
			<td><LI>{{ ROOMCH_TITLEBARCH }}</td><td colspan=2>{{ ROOMCH_BARCH }}</td><td colspan=3>{{ ROOMCH_BARTAX }}</td><td colspan=2>{{ ROOMCH_BARSUM }}</td>
			</tr>
			<tr>
			<td><LI>{{ ROOMCH_TITLEPREPAID }}</td><td colspan=2> </td><td colspan=3> </td><td colspan=2>{{ ROOMCH_PREPAID }}</td>
			</tr>
			<tr>
			<td colspan=6><B>{{ ROOMCH_TITLETOTAL }}</B></td><td colspan=2><B>{{ ROOMCH_TOTALSUM }}</B></td>
			</tr>

			<tr align=right>
			<td colspan=8>
			<br>
			<pre>{{ ROOMCH_DATE }}       </pre>
			<pre>{{ ROOMCH_SIGN }} :                    </pre>
			</td>
			</tr>
		</table>
	</body>
	</html>
</script>
<script id="stnlabelTemplate" type="text/x-handlebars-template">
	<!DOCTYPE html>
	<html>
	<head>
	</head>
	<body>
		<scr{{!}}ipt type="text/javascript" src="js/libs/jquery-2.1.1.min.js"></scr{{!}}ipt>
		<scr{{!}}ipt type="text/javascript">
			function disableF5(e) {
				if ((e.which || e.keyCode) == 116)
					e.preventDefault();
			};
			$(document).bind("keydown", disableF5);
			$(document).on("keydown", disableF5);
		</scr{{!}}ipt>
		<img id="BIMG" src="img/{{ IMAGEFILE }}">
		<br><br>
		<input type="button" value=" {{ PRINT }} " onclick="window.document.close();window.print();">
		<br>
		{{ INFO }}
   </body>
	</html>
</script>
<script id="licenseUploadTemplate" type="text/x-handlebars-template">
{{#if IS_IW}}
	<div class="button"><input type="button" class="btn_prev" value=" {{ BTN_PREV }} "><input type="button" class="btn_next" value=" {{ BTN_NEXT }} "></div>
	<br>
{{/if}}
   <div>
       <p><font color=red size=2><strong>{{ INFO }}</strong></font></P>
	    <p><font size=2><strong>{{ INFO2 }}</strong></font></P>
	    <p><font size=2><strong>{{ SERIAL_NO_TXT }} : {{ SERIAL_NO_VAL }}</strong></font></P>
       <br>
       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="licenseupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
									 <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
					 </div>
				 </div>
				 <!-- The loading indicator is shown during file processing -->
				 <div class="fileupload-loading"></div>
					 <br>
					 <!-- The table listing the files available for upload/download -->
					 <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
			  </form>
			  <div>
{{#if SERIAL_INVALID}}
           <font size=3>{{ INFO3 }}</font><br><br>
{{#if IS_NO_SERIAL}}
				<!-- The global progress information -->
				<font size=3>{{ OPT1 }}{{ INFO4 }}</font>
				<input name="CREATE" class="btn_p89_lic auth_write" value={{ BTN_CREATE }} type="button"><br>
				<font size=3>{{ INFO5_1 }}{{ INFO5_2 }}</font><br><br>
{{else}}
{{#ifEqual IS_INVALIDKEY false}}
				<font size=3>{{ OPT1 }}{{ INFO9 }}</font><br>
				<font size=3>{{ INFO10}}</font><br><br>
				<font size=3>{{ OPT2 }}{{ INFO6 }}</font>
				<input name="TRANSFER" class="btn_p89_lic auth_write" value={{ BTN_TRANS }} type="button"><br>
				<font size=3>{{ INFO7 }}</font>
{{else}}
				<font size=3>{{ OPT1 }}{{ INFO6 }}</font>
				<input name="TRANSFER" class="btn_p89_lic auth_write" value={{ BTN_TRANS }} type="button"><br>
				<font size=3>{{ INFO7 }}</font>
{{/ifEqual}}           
{{/if}}
{{/if}}
           </div>            
           <span>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
   </div>
</script>
<script id="DevMonitorTemplate" type="text/x-handlebars-template">
	<!DOCTYPE html>
	<html>
	<head>
		<link rel="stylesheet" href="css/bootstrap.css">
		<link rel="stylesheet" href="css/main_style.css">
	</head>
	<body>
		<scr{{!}}ipt type="text/javascript" src="js/libs/jquery-2.1.1.min.js"></scr{{!}}ipt>
		<scr{{!}}ipt type="text/javascript">
			function disableF5(e) {
				if ((e.which || e.keyCode) == 116)
					e.preventDefault();
			};
			$(document).bind("keydown", disableF5);
			$(document).on("keydown", disableF5);

			var timer = null;
			$(document.body).bind("DOMSubtreeModified", function() {
				if (timer) {
					clearTimeout(timer);
				}
				timer = setTimeout(function () {
					document.title = "Disconneted";
					alert("Disconneted");
				}, 30000);
			});
		</scr{{!}}ipt>
   </body>
	</html>
</script>
<script id="MOHIndividualUploadTemplate" type="text/x-handlebars-template">
   <div>
       <p><font size=2><strong>{{ MOHINDIVUP_INFO1 }}</strong></font></P>
       <p><font size=2><strong>{{ MOHINDIVUP_INFO3 }}</strong></font></P>

       <div>
           <!-- The file upload form used as target for the file upload widget -->
           <form id="mohindivfileupload" action="" method="POST" enctype="multipart/form-data">
               <!-- Redirect browsers with JavaScript disabled to the origin page -->
               <noscript><input type="hidden" name="redirect" value="/a_index.html"></noscript>
               <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
               <div class="row">
						<div class="fileupload-buttonbar">
							 <div class="col-md-3">
							  <select class="form-control" name="VSFPT_UPLOAD">

									<option value="531" >{{ MOHINDIVUP_1ST }}</option>
									<option value="532" >{{ MOHINDIVUP_2ND }}</option>
									<option value="533" >{{ MOHINDIVUP_3RD }}</option>
									<option value="534" >{{ MOHINDIVUP_4TH }}</option>
									<option value="535" >{{ MOHINDIVUP_5TH }}</option>
									<option value="536" >{{ MOHINDIVUP_6TH }}</option>
									<option value="537" >{{ MOHINDIVUP_7TH }}</option>
									<option value="538" >{{ MOHINDIVUP_8TH }}</option>
									<option value="539" >{{ MOHINDIVUP_9TH }}</option>
									<option value="540" >{{ MOHINDIVUP_10TH }}</option>
									<option value="541" >{{ MOHINDIVUP_11TH }}</option>
									<option value="542" >{{ MOHINDIVUP_12TH }}</option>
									<option value="543" >{{ MOHINDIVUP_13TH }}</option>
							  </select>
								  <!-- The fileinput-button span is used to style the file input field as button -->
{{#ifEqual AUTH 2}}
								  <span class="btn btn-success fileinput-button">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file">
								  </span>
{{else}}
								  <span class="btn btn-success fileinput-button disabled">
										<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
										<span>{{ ADD_FILE }}</span>
										<input type="file" name="file" disabled>
								  </span>
{{/ifEqual}}
							 </div>
							 <!-- The global progress information -->
							 <div class="col-md-5 fileupload-progress fade">
								 <!-- The global progress bar -->
								 <div class="progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								    <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width:0%;"></div>
								 </div>
								 <!-- The extended global progress information -->
								 <div class="progress-extended">&nbsp;</div>
							 </div>
						</div>
               </div>
               <!-- The loading indicator is shown during file processing -->
               <div class="fileupload-loading"></div>
               <br>
               <!-- The table listing the files available for upload/download -->
               <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
           </form>
           <br>
       </div>
       <!-- modal-gallery is the modal dialog used for the image gallery -->
       <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">&times;</a>
               <h3 class="modal-title"></h3>
           </div>
           <div class="modal-body"><div class="modal-image"></div></div>
           <div class="modal-footer">
               <a class="btn modal-download" target="_blank">
                   <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                   <span>Download</span>
               </a>
               <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                   <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                   <span>Slideshow</span>
               </a>
               <a class="btn btn-info modal-prev">
                   <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                   <span>Previous</span>
               </a>
               <a class="btn btn-primary modal-next">
                   <span>Next</span>
                   <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
               </a>
           </div>
       </div>
   </div>
</script>
<script>
   var cur_key = '';
   var type_history = [];
   type_history[0] = null;
   type_history[1] = null;
   var variable_order = new Object;
   var tbl_render_flag = true;
   var no_margin_flag = true;
   var tmp_pgmnum = '';
   var tmp_cur_attr_name = '';
   
	function orderToAlphabet(order) {
		var codeA = 'a'.charCodeAt(0);
		var codeZ = 'z'.charCodeAt(0);
		var len = codeZ - codeA + 1;
		var alphabet = "";
		
		while(order >= 0) {
			alphabet = String.fromCharCode(order % len + codeA) + alphabet;
			order = Math.floor(order / len) - 1;
		}
		
		return alphabet.toUpperCase();
	}

	Handlebars.registerHelper('ifEqual', function(v1, v2, options) {
		if(v1 === v2) {
			return options.fn(this);
		}
		return options.inverse(this);
	});

   Handlebars.registerHelper('attr_func', function(item) {
       $("#"+ap.render_pgm+"_attrs").append("<div style='margin-bottom:0px'><input type='checkbox' value='" + cur_key + "' style='margin-right:10px'>"+ item+ "</div>");
   });

   Handlebars.registerHelper('key_func', function(key) {
       cur_key = key;
   });

   Handlebars.registerHelper('button_func', function(item) {
       var str = '';

       if(hidden_flags[ap.render_pgm] === false) {
			  if(active_base != "tab_install_wizard") {
					$('#'+ap.render_pgm).append("<div class='button'></div>");
				}

           _.each(item, function(button) {
               if(button.btn) {
						str += "<input type='button' name='"+button.name+"' class='"+button.btn_type+"' value=' "+button.btn+" '><br>";
               }
           });

           $('#'+ap.render_pgm+' .button').append(str);

           if(no_margin_flag) {
               $('#'+ap.render_pgm+' .button').after("<br>");
               _.each($('#'+ap.render_pgm+' .button').children('input'), function() {
                   $('#'+ap.render_pgm+' .button').after("<br>");
               });
           }
       }
   });

   Handlebars.registerHelper('load_func', function(item) {
       var str = '';
       var isExit = false;
       var cmtoff_flag = false;

       _.each(item, function(obj, i) {
          if(isExit === true) {
               return false;
          }

          if(obj.range_type) {
               str += "<input type='hidden' name='"+obj.name+"' value='"+obj.range_type+"'>";
          } else if(obj.text) {
               if(obj.name) {
                   if(obj.name.match(/^RANGE_VIEW/)) {
   						 if(obj.show == 0) {
   							 str += "<span class='"+obj.name+"' style='display:none;'>"+obj.value+"</span>";
							 } else {
   							 str += "<span class='"+obj.name+"'>"+obj.value+"</span>";
                      }
                   } else {
                       str += obj.value;
                   }
               } else {
                   str += obj.text;
               }
          } else if(obj.select) {
               if(obj.show == 0) {
                   _.each(obj.select, function (opt) {
                       if(opt.value === obj.value) {
                           if(obj.name == "RANGE_ERROR") {
   									str += "<span class='RANGE_ERROR' style='color:red;font-weight:bold;margin-left:10px;'>"+opt.option+"</span>";
										if (active_base == "tab_install_wizard" || active_base == "tab_function_base") {
											for (var idx = 0; idx < pgm_views[ap.render_pgm].collection.models[0].attributes.elements[0].tab.length; idx++) {
												if (pgm_views[ap.render_pgm].collection.models[0].attributes.elements[0].tab[idx].key) {
													pgm_name_maps[pgm_views[ap.render_pgm].collection.models[0].attributes.elements[0].tab[idx].key.split('_')[0]]["RANGE_ERROR"].value = "";
													break;
												}
											}
										} else {
											pgm_name_maps[ap.render_pgm]["RANGE_ERROR"].value = "";
										}
   								} else if(obj.name.match(/^RANGE_VIEW/)) {
   									str += opt.option+"<span class='"+obj.name+"' style='display:none;'>"+obj.value+"</span>";
                           } else {
                               str += opt.option;
                           }
                       }
                   });
               } else {
                   var tmp = '';
                   _.each(obj.select, function (opt) {
                       if(opt.value === obj.value) {
                          tmp += "<option value="+opt.value+" selected>"+opt.option+"</option>";
                       } else {
                          tmp += "<option value="+opt.value+">"+opt.option+"</option>";
                       }
                   });

                   str += "<select name="+obj.name+" class='"+obj.sel_type+" form-control'>"+tmp+"</select>";
               }
          } else if(obj.textfield) {
				 if (obj.default_range) {
					 str += "<input type='text' class='form-control' name='"+obj.name+"' maxlength='"+obj.textfield[0].max+"' size='"+obj.textfield[0].size+"' placeholder='"+langs.getText("common","txt_default")+" : "+obj.default_range+"' default_range='"+obj.default_range+"' value='"+obj.value+"'>";
				 } else {
                str += "<input type='text' class='form-control' name='"+obj.name+"' maxlength='"+obj.textfield[0].max+"' size='"+obj.textfield[0].size+"' value='"+obj.value+"'>";
             }
          } else if(obj.btn) {
               str += "<input type='button' name='"+obj.name+"' class='"+obj.btn_type+"' value='"+obj.btn+"' style='margin-left:10px;'>";
          } else if(obj.br) {
               for(var i=0; i<obj.br; i++) {
                   str += "<br>";
               }
          } else if(obj.endload) {
               if(hidden_flags[ap.render_pgm] === true) {
                   isExit = true;
               }
          }

			 if(obj.help) {
             str += "<div class='toolTip'><img class='toolTip-img' src='img/help_icon.png'><div class='toolTip-txt'>"+obj.help+"</div></div>";
          }
       });

       $("#"+ap.render_pgm).append("<div class='preload' key="+cur_key+">"+str+"</div>");
   });

   Handlebars.registerHelper('content_func', function(item) {
       if(hidden_flags[ap.render_pgm] === false) {
           var str = '';
           var sub_str = '';
           var radio_flag = false;
           var radio_names = new Array();
           var da_flag = false;
           var da_names = new Array();

           _.each(item, function(obj, i) {
               sub_str = '';

              if(obj.text) {
                  if((obj.text+="").toLowerCase().match(searchText)){
                     sub_str = "<font style='background-color: #99ff99'>";
                  }
                   if(obj.name) {
                       sub_str += "<span name="+obj.name+">"+obj.value+"</span>";
                   } else if(obj.title) {
							  sub_str += "<h" + obj.title + ">" + obj.text + "</h" + obj.title + ">";
                   } else {
                       sub_str += obj.text;
                   }
                   if((obj.text+="").toLowerCase().match(searchText)){
                      sub_str += "</font>";
                   }
              } else if(obj.text_p73_table) {
                   sub_str = "<span class='text_p73_table' style='font-family:Courier;'>"+obj.value+"</span>";
              } else if(obj.textfield) {
                   sub_str = "<input type='text' class='form-control' name="+obj.name+" maxlength="+obj.textfield[0].max+" size="+obj.textfield[0].size+" value='"+obj.value+"'>";
              } else if(obj.select) {
						if(obj.show == 0) {
							var exopt_flag = false;
							_.each(obj.select, function (opt) {
								if(opt.value === obj.value) {
									str += "<span name="+obj.name;
									if(obj.color==1)
										str+=" style='color:red;font-weight:bold;'"+">";
									else
										str+=">";
									str+=opt.option+"</span>";
									exopt_flag = true;
								}
							});
							if (!exopt_flag) {
								str += "<span name="+obj.name+"></span>";
							}
						} else {
							var tmp = '';
							_.each(obj.select, function (opt) {
								 if(opt.value === obj.value)
									 tmp += "<option value="+opt.value+" selected>"+opt.option+"</option>";
								 else
									 tmp += "<option value="+opt.value+">"+opt.option+"</option>";
							});

							sub_str = "<select name="+obj.name+" class='"+obj.sel_type+" form-control'>"+tmp+"</select>";
                  }
              } else if(obj.btn) {
                   sub_str = "<input type='button' name='"+obj.name+"' class='"+obj.btn_type+"' value='"+obj.btn+"'>"
				  } else if(obj.chk) {
   				  sub_str = "<input type='checkbox' name='"+obj.name+"' class='"+obj.chk_type+"'";
   				  if((obj.chk_type == "chk_selectall" || obj.chk_type == "chk_checkall") && obj.value == 1) {
   					  sub_str += "checked='checked'>";
   				  } else if((obj.chk_type == "chk_selectall" || obj.chk_type == "chk_checkall") && obj.value == 0) {
   					  sub_str += ">";
   				  } else {
   					  sub_str += " value='"+obj.value+"'>";
   				  }
				  } else if(obj.radio) {
						 sub_str += "<input type='radio' name="+obj.name+" class="+obj.radio_type+" value='"+obj.radio[0].value+"'>";
						 radio_flag = true;
						 radio_names.push(obj.name);
				  } else if(obj.br) {
						 for(var i=0; i<obj.br; i++) {
							  sub_str += "<br>";
						 }
				  } else if(obj.hr) {
						 for(var i=0; i<obj.hr; i++) {
							  sub_str += "<hr>";
						 }
				  } else if(obj.img) {
						sub_str = "<img src='"+obj.img+"' class='"+obj.img_type+"'>";
				  }

				  if(obj.message) {
						if(langs.hover && langs.hover[obj.message]) {
							for(var i=0; i<sub_str.length; i++) {
								 //debug_mode.flag && console.log(sub_str.charAt(i));
								 if(sub_str.charAt(i) == ">") {
									  sub_str = sub_str.replace(sub_str.charAt(i), " title='" + langs.getText("hover",obj.message) + "'>");
									  //debug_mode.flag && console.log(sub_str);
									  break;
								 }
							}
						} else {
							for(var i=0; i<sub_str.length; i++) {
								 //debug_mode.flag && console.log(sub_str.charAt(i));
								 if(sub_str.charAt(i) == ">") {
									  sub_str = sub_str.replace(sub_str.charAt(i), " title='" + obj.message + "'>");
									  //debug_mode.flag && console.log(sub_str);
									  break;
								 }
							}
						}
				  }

				  if(obj.error) {
						if (obj.error == "DA") {
							for(var i=0; i<sub_str.length; i++) {
								  //debug_mode.flag && console.log(sub_str.charAt(i));
								  if(sub_str.charAt(i) == ">") {
										sub_str = sub_str.replace(sub_str.charAt(i), " disabled>");
										//debug_mode.flag && console.log(sub_str);
										break;
								  }
							}
							da_flag = true;
							da_names.push(obj.name);
						} else {
							for(var i=0; i<sub_str.length; i++) {
								 //debug_mode.flag && console.log(sub_str.charAt(i));
								 if(sub_str.charAt(i) == ">") {
									  sub_str = sub_str.replace(sub_str.charAt(i), " style='outline:2px solid red; margin:2px;'>");
									  //debug_mode.flag && console.log(sub_str);
									  break;
								 }
							}
							if(obj.error == "no_msg") {
   							sub_str += "";
   						} else if(langs.error_msg[obj.error]) {
   							sub_str += "<font style='font-weight: bold; color: red; margin-left: 5px;'>"+ langs.getText("error_msg",obj.error) +"</font>";
							} else {
   							sub_str += "<font style='font-weight: bold; color: red; margin-left: 5px;'>"+ langs.getText("error_msg","error") +"</font>";
							}
						}
				  }

				  if(obj.help) {
					   sub_str += "<div class='toolTip'><img class='toolTip-img' src='img/help_icon.png'><div class='toolTip-txt'>"+obj.help+"</div></div>";
				  }

              str += sub_str;
           });

           $("#"+ap.render_pgm).append("<div class='contents' key="+cur_key+">"+str+"</div>");
           //console.log(radio_flag);
           //console.log(radio_names);
           if(radio_flag) {
					for(var i in radio_names) {
						 _.each($("#"+ap.render_pgm+" .contents [name="+radio_names[i]+"]"), function(item) {
							  if(item.value == pgm_name_maps[ap.render_pgm][radio_names[i]].value) {
									item.checked = true;
							  }
						 });
					}
           }

           if(da_flag) {
					for(var i in da_names) {
						$("#"+ap.render_pgm+" .contents [name="+da_names[i]+"]").attr('disabled','disabled');
					}
           }
       }
   });

   Handlebars.registerHelper('table_func', function(item) {
       if(!hidden_flags[ap.render_pgm] && tbl_render_flag) {
           $("#"+ap.render_pgm).append("<table class='table table-bordered'><tr key="+cur_key+" align='center' bgcolor='#d9edf7'></tr></table>");

           _.each(item, function(th) {
					if(!$.isEmptyObject(th)) {
						make_th_func(th);
               }
           });
       }
   });

   Handlebars.registerHelper('edit_table_func', function(item) {
       if(!hidden_flags[ap.render_pgm] && tbl_render_flag) {
           $("#"+ap.render_pgm).append("<table class='table table-bordered edit_table'><tr key="+cur_key+" align='center' bgcolor='#d9edf7'></tr></table>");

           _.each(item, function(th) {
					if(!$.isEmptyObject(th)) {
						make_th_func(th);
               }
           });
       }
   });

   Handlebars.registerHelper('head_func', function(item) {
       if(!hidden_flags[ap.render_pgm] && tbl_render_flag) {
           $("#"+ap.render_pgm+" tr:last").after("<tr key='"+cur_key+"' bgcolor=\"#d9edf7\"></tr>");

           _.each(item, function(th) {
					if(!$.isEmptyObject(th)) {
						make_th_func(th);
               }
           });
       }
   });

   function make_th_func(th) {
       var str = '';
       variable_order[ap.render_pgm] = 0;

       if(th.tbl_show_flag) {
           return false;
       }
       
       if(th.label) {
           if((th.label+="").toLowerCase().match(searchText)){
                        str = "<font style='background-color: #99ff99'>";
           } 
           if(th.name) {
               str += th.value;
           } else {
               str += th.label;
           }
           if((th.label+="").toLowerCase().match(searchText)){
               str += "</font>";
           }
       } else if(th.select) {
           var tmp = '';
           _.each(th.select, function (opt) {
               if(opt.value === th.value)
                  tmp += "<option value="+opt.value+" selected>"+opt.option+"</option>";
               else
                  tmp += "<option value="+opt.value+">"+opt.option+"</option>";
           });

           str = "<select name="+th.name+" class='"+th.sel_type+" form-control'>"+tmp+"</select>";
       } else if(th.btn) {
           str = "<input type='button' name='"+th.name+"' class='"+th.btn_type+"' value='"+th.btn+"'>";
       } else if(th.chk) {
           str = "<input type='checkbox' name="+th.name+" class="+th.chk_type+" value="+th.value;
           if(th.chk_type == "chk_p178_dontsave") {
   			  str += " checked>";
           } else {
   			  str += ">";
           }
       } else if(th.br) {
           for(var i=0; i<th.br; i++) {
              str += "<br>";
           }
       }

		 if(th.help) {
		     str += "<div class='toolTip'><img class='toolTip-img' src='img/help_icon.png'><div class='toolTip-txt'>"+th.help+"</div></div>";
		 }

       if(th.check_flag) {
          str = "<th style='display:none'><input type='hidden' name='"+th.name+"' value='"+th.value+"'></th>";
          $('#'+ap.render_pgm+' tr:last').append(str);
       } else if(th.rowspan || th.colspan) {
          str = "<th rowspan="+th.rowspan+" colspan="+th.colspan+"> "+str+" </th>";
          $('#'+ap.render_pgm+' tr:last').append(str);
       } else if(th.cont) {
          $('#'+ap.render_pgm+' th:last').append(str);
       } else if(th.order_alphabet) {
			 str = "<th class='th_identifier'>"+orderToAlphabet($("#"+ap.render_pgm+" th.th_identifier").length)+"</th>"
			 $('#'+ap.render_pgm+' tr:last').append(str);
       } else {
          str = "<th> "+str+" </th>";
          $('#'+ap.render_pgm+' tr:last').append(str);
       }

       if(th.sort) {
			_.each($.trim(th.sort).split(" "), function (s_item) {
				 $('#'+ap.render_pgm+' th:last').addClass('sort_'+s_item);
			});
			 $('#'+ap.render_pgm+' th:last').append("<img src='img/sort_asce.png' class='img_asce' /><img src='img/sort_desc.png' class='img_desc' style='display:none;' />");
       }
   }

   var tmp_tr = null;

   Handlebars.registerHelper('item_func', function(item) {
       if(!hidden_flags[ap.render_pgm] && tbl_render_flag) {
           tmp_tr = $('<tr/>');

           _.each(item, function(td) {
					if(!$.isEmptyObject(td)) {
						make_td_func(td);
               }
           });

           $("#"+ap.render_pgm+" tr:last").after(tmp_tr);

           if(cur_key) {
               $("#"+ap.render_pgm+" tr:last").attr("key",cur_key);
           }
       }
   });

   Handlebars.registerHelper('struct_func', function(items) {
       if(!hidden_flags[ap.render_pgm] && tbl_render_flag) {
           _.each(items, function(item, i) {
               if(item.tr) {
						tmp_tr = $('<tr/>');

					   _.each(item.tr, function(td) {
							if(!$.isEmptyObject(td)) {
								make_td_func(td);
							}
					   });

					   $("#"+ap.render_pgm+" tr:last").after(tmp_tr);
               } else if(item.th) {
					   $("#"+ap.render_pgm+" tr:last").after("<tr bgcolor=\"#d9edf7\"></tr>");
					   _.each(item.th, function(th) {
							if(!$.isEmptyObject(th)) {
								make_th_func(th);
							}
					   });
               } else if(item.table) {
						$("#"+ap.render_pgm).append("<table class='table table-bordered'><tr align='center' bgcolor='#d9edf7'></tr></table>");
					   _.each(item.table, function(th) {
							if(!$.isEmptyObject(th)) {
								make_th_func(th);
							}
					   });
               }

               if((i == 0) && cur_key) {
                  $("#"+ap.render_pgm+" tr:last").attr("key",cur_key);
               }
           });
       }
   });

   Handlebars.registerHelper('variable_func', function(items) {
       if(!hidden_flags[ap.render_pgm] && tbl_render_flag) {
           //debug_mode.flag && console.log("items");
           //debug_mode.flag && console.log(items);
           _.each(items, function(item) {
               //debug_mode.flag && console.log("item");
               //debug_mode.flag && console.log(item);
                if(item.struct) {
                    _.each(item.struct, function(row) {
                        //debug_mode.flag && console.log("row");
                        //debug_mode.flag && console.log(row);
								if(row.tr) {
									tmp_tr = $('<tr/>');

									_.each(row.tr, function(td) {
										 //debug_mode.flag && console.log("td");
										 //debug_mode.flag && console.log(td);
										 if(!$.isEmptyObject(td)) {
											 make_td_func(td);
										 }
									});

									$("#"+ap.render_pgm+" tr:last").after(tmp_tr);
                        } else if(row.th) {
									$("#"+ap.render_pgm+" tr:last").after("<tr bgcolor=\"#d9edf7\"></tr>");
									_.each(row.th, function(th) {
										 //debug_mode.flag && console.log("th");
										 //debug_mode.flag && console.log(th);
										 if(!$.isEmptyObject(th)) {
											 make_th_func(th);
										 }
									});
                        }
                    });
                } else if(item.tr) {
						  tmp_tr = $('<tr/>');

                    _.each(item.tr, function(td) {
                        //debug_mode.flag && console.log("td");
                        //debug_mode.flag && console.log(td);
                        if(!$.isEmptyObject(td)) {
									make_td_func(td);
                        }
                    });

                    $("#"+ap.render_pgm+" tr:last").after(tmp_tr);
                } else if(item.th) {
						  $("#"+ap.render_pgm+" tr:last").after("<tr key='"+cur_key+"' bgcolor=\"#d9edf7\"></tr>");

						  _.each(item, function(th) {
								if(!$.isEmptyObject(th)) {
									make_th_func(th);
								}
						  });
                }
           });
       }
   });

   function make_td_func(td) {
      var str = '';
      var colspan = 0;
      var center_flag = false;
      var right_flag = false;

      if(td.show === 0) {
           if(td.select) {
               _.each(td.select, function (opt) {
                   if(opt.value === td.value) {
                       if(td.name == "RANGE_ERROR") {
                           //$('#'+ap.render_pgm+' td:last').css("background-color","red");
                           $('#'+ap.render_pgm+' td:last').append("<span class='RANGE_ERROR' style='color:red;font-weight:bold;margin-left:10px;'>"+opt.option+"</span>");
                           if (active_base == "tab_install_wizard" || active_base == "tab_function_base") {
										for (var idx = 0; idx < pgm_views[ap.render_pgm].collection.models[0].attributes.elements[0].tab.length; idx++) {
											if (pgm_views[ap.render_pgm].collection.models[0].attributes.elements[0].tab[idx].key) {
												pgm_name_maps[pgm_views[ap.render_pgm].collection.models[0].attributes.elements[0].tab[idx].key.split('_')[0]]["RANGE_ERROR"].value = "";
												break;
											}
										}
									} else {
										pgm_name_maps[ap.render_pgm]["RANGE_ERROR"].value = "";
									}
                       } else {
                           str = opt.option;
                       }
                   }
               });
           } else if(td.textfield) {
               str = td.value;
           } else if(td.send_label) {
               str = "<input type='hidden' name='"+td.name+"' value='"+td.value+"'>";
           }
      } else {
          if(td.label) {
               if(td.name) {
						if (td.name.match("WADLOG_PGMNUM")) {
							tmp_pgmnum = $.trim(td.value);
							if (langs.getText("adm_menu",tmp_pgmnum) != "Error : Can't find this string. Please check your multi language file") {
								str = langs.getText("adm_menu",tmp_pgmnum);
							} else if (langs.getText("mnt_menu",tmp_pgmnum) != "Error : Can't find this string. Please check your multi language file") {
								str = langs.getText("mnt_menu",tmp_pgmnum);
							} else if (langs.getText("stn_menu",tmp_pgmnum) != "Error : Can't find this string. Please check your multi language file") {
								str = langs.getText("stn_menu",tmp_pgmnum);
							} else if (langs.getText("up_menu",tmp_pgmnum) != "Error : Can't find this string. Please check your multi language file") {
								str = langs.getText("up_menu",tmp_pgmnum);
							} else {
								str = tmp_pgmnum;
							}
						} else if (td.name.match("WADLOG_ATTR")) {
							if ($.trim(td.value).length) {
								var tmp_lang_path = tmp_pgmnum.replace("gm", "");
								tmp_cur_attr_name  = $.trim(td.value);
								
								for (var lang_keys in langs[tmp_lang_path]) {
									if (lang_keys.match(tmp_cur_attr_name.toLowerCase())) {
										str = langs.getText(tmp_lang_path, lang_keys);
										break;
									}
								}
							}
						} else if (td.name.match("WADLOG_PVALUE") || td.name.match("WADLOG_NVALUE")) {
							if ($.trim(td.value).length) {
								var tmp_value = $.trim(td.value);
								var tmp_matched_name = '';

								if (pgm_name_maps[tmp_pgmnum]) {
									for (var tmp_attr_names in pgm_name_maps[tmp_pgmnum]) {
										if (tmp_attr_names.match(tmp_cur_attr_name)) {
											tmp_matched_name = tmp_attr_names;
											break;
										}
									}
									
									if (tmp_matched_name.length) {
										if (pgm_name_maps[tmp_pgmnum][tmp_matched_name].select) {
											_.each(pgm_name_maps[tmp_pgmnum][tmp_matched_name].select, function (opt) {
												 if(opt.value === tmp_value) {
														str = opt.option;
												 }
											});
										} else {
											str = tmp_value;
										}
									}
								}
								
								console.log("1. tmp_matched_name : " + tmp_matched_name);
								
								if (!tmp_matched_name.length && pgm_views[tmp_pgmnum]) {
									_.each(pgm_views[tmp_pgmnum].collection.models[0].attributes.elements[0].tab, function (tabs) {
										if (tabs.data_form) {
											_.each(tabs.data_form, function (forms) {
												if (forms.tr) {
													_.each(forms.tr, function (trs) {
														console.log("trs.name : " + tmp_attr_names);
														if (trs.name.match(tmp_cur_attr_name)) {
															if (trs.select) {
																_.each(trs.select, function (opt) {
																	 if(opt.value === tmp_value) {
																			str = opt.option;
																	 }
																});
															} else {
																str = tmp_value;
															}
															tmp_matched_name = trs.name;
															console.log("2. tmp_matched_name : " + tmp_matched_name);
															return false;
														}
													});
												}
											});
										}
									});
								}
								
								console.log("3. tmp_matched_name : " + tmp_matched_name);
								
								if (!tmp_matched_name.length) {
									str = tmp_value;
								}
								console.log("1. str : "+str);
							}
						} else {
						   if((td.label+="").toLowerCase().match(searchText)){
                        str = "<font style='background-color: #99ff99'>";
                     }
							str += td.value;
						   if((td.label+="").toLowerCase().match(searchText)){
                        str += "</font>";
                     }
                  }
               } else {
                  if((td.label+="").toLowerCase().match(searchText)){
                     str = "<font style='background-color: #99ff99'>";
                  }
                  str += td.label;
                  if((td.label+="").toLowerCase().match(searchText)){
                     str += "</font>";
                  }
               }
          } else if(td.select) {
               var tmp = '';
               _.each(td.select, function (opt) {
                   if(opt.value === td.value)
                      tmp += "<option value="+opt.value+" selected>"+opt.option+"</option>";
                   else
                      tmp += "<option value="+opt.value+">"+opt.option+"</option>";
               });

               str = "<select name="+td.name+" class='"+td.sel_type+" form-control'>"+tmp+"</select>";
          } else if(td.textfield) {
               if(td.name.match("DGT_DNT_0")) {
                   right_flag = true;
               }
               str = "<input type='text' class='form-control' name="+td.name+" maxlength="+td.textfield[0].max+" size="+td.textfield[0].size+" value='"+td.value.replace(/\'/g,'&#39;')+"'>";
          } else if(td.chk) {
   			  str = "<input type='checkbox' name='"+td.name+"' class='"+td.chk_type+"'";
   			  if((td.chk_type == "chk_selectall" || td.chk_type == "chk_checkall") && td.value == 1) {
   				  str += "checked='checked'>";
   			  } else if((td.chk_type == "chk_selectall" || td.chk_type == "chk_checkall") && td.value == 0) {
   				  str += ">";
   			  } else {
   				  str += " value='"+td.value+"'>";
   			  }
          } else if(td.btn) {
               str = "<input type='button' name='"+td.name+"' class='"+td.btn_type+"' value='"+td.btn+"'>";
               if((td.btn_type != "btn_addstn") && (!td.btn_type.match("btn_link_to_otherpgm"))) {
   					center_flag = true;
               }
          } else if(td.radio) {
               str = "<input type='radio' name="+td.name+" class="+td.radio_type+" value='"+td.radio[0].value+"'>";
          } else if(td.order) {
               if(type_history[0] != type_history[1]) {
                   variable_order[ap.render_pgm] = 0;
               }
               variable_order[ap.render_pgm]++;
               str = variable_order[ap.render_pgm];
          } else if(td.send_label) {
               str = td.value+"<input type='hidden' name='"+td.name+"' value='"+td.value.replace(/\'/g,'&#39;')+"'>";
          } else if(td.password) {
               str = "<input type='password' class='form-control' name="+td.name+" maxlength="+td.password[0].max+" size="+td.password[0].size+" value='"+td.value+"'>";
          } else if(td.textarea) {
               str = "<textarea class='form-control' name="+td.name+" rows="+td.textarea[0].rows+" cols="+td.textarea[0].cols+">"+td.value+"</textarea>";
          } else if(td.br) {
               for(var i=0; i<td.br; i++) {
                   str += "<br>";
               }
          } else if(td.slot_type) {
               if(td.value === "1") {    // MISC
						if (info.SYSTEM_ID == "iPECS eMG80" || info.SYSTEM_ID == "iPECS eMG800") {
							str = langs.getText("common","misc_gw_emg80");
						} else {
							str = langs.getText("common","misc_gw");
						}
               } else if(td.value === "2") { // CO Line
						if (info.SYSTEM_ID == "iPECS eMG80" || info.SYSTEM_ID == "iPECS eMG800") {
							str = langs.getText("common","co_gateway_emg80");
						} else {
							str = langs.getText("common","co_gateway");
						}
               } else if(td.value === "4") { // STN
                 str = langs.getText("common","simple_sta");
               } else if(td.value === "8") { // VSF
						if (info.SYSTEM_ID == "iPECS eMG80" || info.SYSTEM_ID == "iPECS eMG800") {
							str = langs.getText("common","vsf_gw_emg80");
						} else {
							str = langs.getText("common","vsf_gw");
						}
               } else if(td.value === "11") {    // MCIM
						if (info.SYSTEM_ID == "iPECS eMG80" || info.SYSTEM_ID == "iPECS eMG800") {
							str = langs.getText("common","mcim_gw_emg80");
						} else {
							str = langs.getText("common","mcim_gw");
						}
               } else if(td.value === "12") {  // UCS Server
                 str = langs.getText("common","ucs_server");
               } else if(td.value === "13") {    // WTIM
						if (info.SYSTEM_ID == "iPECS eMG80" || info.SYSTEM_ID == "iPECS eMG800") {
							str = langs.getText("common","wtim_gw_emg80");
						} else {
							str = langs.getText("common","wtim_gw");
						}
               } else if(td.value === "14") {    // SERVER_3RD
						str = langs.getText("common","third_party_server");
				}
          } else if(td.dir_list) {
               if(td.value === "1") {
                 str = langs.getText("p78","hdl");
               } else if(td.value === "7") {
                 str = langs.getText("p78","udl");
               } else if(td.value === "11") {
                 str = langs.getText("p78","ddl");
               }
          } else if(td.cos_type) {
               if(td.value === "1") {
                 str = langs.getText("p2270","sta_cos");
               } else if(td.value === "2") {
                 str = langs.getText("p2270","sys_cos");
               }
          } else if(td.type_list) {
               if(td.value === "1") {
                 str = langs.getText("common","type")+" #1";
               } else if(td.value === "2") {
                 str = langs.getText("common","type")+" #2";
               } else if(td.value === "3") {
                 str = langs.getText("common","type")+" #3";
               } else if(td.value === "4") {
                 str = langs.getText("common","type")+" #4";
               } else if(td.value === "5") {
                 str = langs.getText("common","type")+" #5";
               } else if(td.value === "6") {
                 str = langs.getText("common","type")+" #6";
               }
          } else if(td.progressbar) {
					var tmp_addtxt = "";

					if(td.value.match("Disconnected")) {
						tmp_addtxt = ' ('+langs.getText("common","disconnected")+')';
					}

               if(td.value.match("Start")) {
                   str = "<div name='" + td.name + "' class='progress' aria-valuemin='0' aria-valuemax='100'><div class='progress-bar progress-bar-info progress-bar-striped active' style='width: 0%;'></div><div class='percent'>"+langs.getText("common","start")+tmp_addtxt+"</div></div>";
               } else if(td.value.match("Error")) {
                   str = "<div name='" + td.name + "' class='progress' aria-valuemin='0' aria-valuemax='100'><div class='progress-bar progress-bar-warning' style='width: 100%;'></div><div class='percent'>"+langs.getText("error_msg","error")+tmp_addtxt+"</div></div>";
               } else if(td.value.match("Burning")) {
                   str = "<div name='" + td.name + "' class='progress' aria-valuemin='0' aria-valuemax='100'><div class='progress-bar progress-bar-info progress-bar-striped active' style='width: 100%;'></div><div class='percent'>"+langs.getText("p52","progress_burning")+tmp_addtxt+"</div></div>";
               } else if(td.value.match("Success")) {
                   str = "<div name='" + td.name + "' class='progress' aria-valuemin='0' aria-valuemax='100'><div class='progress-bar progress-bar-info progress-bar-striped active' style='width: 0%;'></div><div class='percent'>"+langs.getText("common","success")+tmp_addtxt+"</div></div>";
               } else {
                   str = "<div name='" + td.name + "' class='progress' aria-valuemin='0' aria-valuemax='100'><div class='progress-bar progress-bar-info progress-bar-striped active' style='width: "+td.value+";'></div><div class='percent'>"+td.value+tmp_addtxt+"</div></div>";
               }
          } else if(td.date) {
               str = "<input class='date' name='"+td.name+"' value='"+td.value+"' />";
          } else if(td.img) {
					str = "<img src='"+td.img+"' class="+td.img_type+"' />";
          }
      }

      if(td.slot_type || td.dir_list || td.type_list || td.cos_type) {
         type_history[0] = type_history[1];
         type_history[1] = td.value;

         if(type_history[0] != type_history[1]) {
				if(!td.cos_type) {
               colspan = $("#"+ap.render_pgm+" table:last tr:first th").length;
				} else {
					if (td.value === "1") {
                  tmp_tr.append("<th>"+langs.getText("common","sta_num")+"</th><th>"+langs.getText("common","daytime")+"</th><th>"+langs.getText("common","nighttime")+"</th><th>"+langs.getText("common","timed_ring")+"</th>");
						tmp_tr.css("background-color","#d9edf7");
						$("#"+ap.render_pgm+" tr:last").after(tmp_tr);
						tmp_tr = $('<tr/>');
               } else if (td.value === "2") {
                  tmp_tr.append("<th>"+langs.getText("common","index")+"</th><th>"+langs.getText("common","daytime")+"</th><th>"+langs.getText("common","nighttime")+"</th><th>"+langs.getText("common","timed_ring")+"</th>");
						tmp_tr.css("background-color","#d9edf7");
						$("#"+ap.render_pgm+" tr:last").after(tmp_tr);
						tmp_tr = $('<tr/>');
               }
               colspan = eval($("#"+ap.render_pgm+" table:last tr:first th").attr("colspan"));
            }
            
            if (td.slot_type) {
					str = "<th class='th_identifier'>"+orderToAlphabet($("#"+ap.render_pgm+" th.th_identifier").length)+"</th><th colspan="+colspan+">"+str+"</th>"
            } else {
					str = "<th colspan="+colspan+">"+str+"</th>"
            }

            tmp_tr.append(str);
            tmp_tr.css("background-color","#d9edf7");
				$("#"+ap.render_pgm+" tr:last").after(tmp_tr);
				tmp_tr = $('<tr/>');
         }
      } else if(td.rowspan || td.colspan) {
         str = "<td rowspan="+td.rowspan+" colspan="+td.colspan+"> "+str+" </td>";

         tmp_tr.append(str);
      } else if(td.cont) {
         tmp_tr.find('td:last').append(" "+str);
      } else if(td.freespace) {
			tmp_tr = $(td.value);
      } else {
         str = "<td> "+str+" </td>";
         tmp_tr.append(str);
      }

      if(td.radio) {
           if(td.value) {
               _.each($('#'+ap.render_pgm+' [name='+td.name+']'), function(radio) {
                    if(radio.value == td.value) {
                       radio.checked = true;
                    }
               });

               _.each(tmp_tr.find('[name='+td.name+']'), function(radio) {
                    if(radio.value == td.value) {
                       radio.checked = true;
                    }
               });
           }
      } else if(td.date) {
           tmp_tr.find('.date').datepicker({dateFormat: "yy-mm-dd"});
      }

      if(center_flag) {
           tmp_tr.find('td:last').css("text-align","center");
      } else if(right_flag) {
           tmp_tr.find('td:last').css("text-align","right");
      }

      if(td.enable_mullang && info.MULLANG) {
			 tmp_tr.find('td:last').children().last().addClass('enable_mullang');
      }

      if(td.message) {
			 if(langs.hover && langs.hover[td.message]) {
				  tmp_tr.find('[name='+td.name+']').attr('title',langs.getText("hover",td.message));
			 } else {
				  tmp_tr.find('[name='+td.name+']').attr('title',td.message);
			 }
      }

		if(td.error) {
           if (td.error == "DA") {
					if(tmp_tr.find('[name='+td.name+']').length) {
						 tmp_tr.find('[name='+td.name+']').attr('disabled','disabled');
					} else {
						 for(var i=0; i<str.length; i++) {
							  if(str.charAt(i) == ">") {
									str = str.replace(str.charAt(i)," disabled>");
									break;
							  }
						 }
					}
           } else if (td.error == "HD") {
					tmp_tr.find('td:last').css("display","none");
           } else {
				  //$('#'+ap.render_pgm+' td:last').css("background-color","red");
				  if (tmp_tr.find('td:last').children().last().get(0)) {
					  tmp_tr.find('td:last').children().last().get(0).style.outline = "2px solid red";
					  tmp_tr.find('td:last').children().last().get(0).style.margin = "2px";
				  }
				  if(td.error != "no_msg") {
   					if(langs.error_msg[td.error]) {
   						tmp_tr.find('td:last').append("<font class='error' style='font-weight: bold; color: red; margin-left: 5px;'>"+langs.getText("error_msg",td.error)+"</font>");
   					} else {
   						tmp_tr.find('td:last').append("<font class='error' style='font-weight: bold; color: red; margin-left: 5px;'>"+langs.getText("error_msg","error")+"</font>");
   					}
				  }
           }
      }

      if(td.help) {
		    tmp_tr.find('td:last').append("<div class='toolTip'><img class='toolTip-img' src='img/help_icon.png'><div class='toolTip-txt'>"+td.help+"</div></div>");
	   }
      //debug_mode.flag && console.log("str : "+str);
   }

   Handlebars.registerHelper('fbutton_func', function(item) {
       var str = '';

       $('#'+active_tab).append("<div class='button'  key="+cur_key+" style='margin-right:25px'></div>");

       _.each(item, function(button) {
          if(button.btn) {
             str += "<input type='button' name='"+button.name+"' class='btn_sample' value=' "+button.btn+" '>";
          }
			 str += "<br>";
       });

       $('#'+active_tab+' .button').append(str);

       if(no_margin_flag) {
          $('#'+active_tab+' .button').after("<br>");
          _.each($('#'+active_tab+' .button').children('input'), function() {
             $('#'+active_tab+' .button').after("<br>");
          });
       }
   });

   Handlebars.registerHelper('fload_func', function(item) {
       var str = '';
       var cmtoff_flag = false;

       _.each(item, function(obj, i) {
          if(obj.text) {
             if(obj.name) {
                 str += obj.value;
             } else {
                 str += obj.text;
             }
          } else if(obj.select) {
             if(obj.show == 0) {
                _.each(obj.select, function (opt) {
                   if(opt.value === obj.value) {
                      str += opt.option;
                   }
                });
				 } else {
                var tmp = '';
                _.each(obj.select, function (opt) {
                   if(opt.value === obj.value) {
                      tmp += "<option value="+opt.value+" selected>"+opt.option+"</option>";
                   } else {
                      tmp += "<option value="+opt.value+">"+opt.option+"</option>";
                   }
                });

                str += "<select name="+obj.name+" class='form-control'>"+tmp+"</select>";
             }
          } else if(obj.textfield) {
             str += "<input type='text' class='form-control' name="+obj.name+" maxlength="+obj.textfield[0].max+" size="+obj.textfield[0].size+" value="+obj.value+">";
          } else if(obj.btn) {
             str += "<input type='button' name='"+obj.name+"' class='btn_sample' value='"+obj.btn+"' style='margin-left:10px;'>";
          } else if(obj.br) {
             for(var i=0; i<obj.br; i++) {
                str += "<br>";
             }
          }
       });

       $("#"+active_tab).append("<div class='preload' key="+cur_key+">"+str+"</div>");
   });

   Handlebars.registerHelper('fcontent_func', function(item) {
      var str = '';
      var sub_str = '';
      var radio_flag = false;
      var radio_names = new Array();

      _.each(item, function(obj, i) {
         sub_str = '';

         if(obj.text) {
            if(obj.name) {
               sub_str = obj.value;
            } else if(obj.title) {
					sub_str = "<h" + obj.title + ">" + obj.text + "</h" + obj.title + ">";
            } else {
               sub_str = obj.text;
            }
         } else if(obj.textfield) {
            sub_str = "<input type='text' class='form-control' name="+obj.name+" maxlength="+obj.textfield[0].max+" size="+obj.textfield[0].size+" value='"+obj.value+"'>";
         } else if(obj.select) {
				if(obj.show == 0) {
					_.each(obj.select, function (opt) {
						if(opt.value === obj.value) {
							str += opt.option;
						}
					});
				} else {
					var tmp = '';
					_.each(obj.select, function (opt) {
						 if(opt.value === obj.value)
							 tmp += "<option value="+opt.value+" selected>"+opt.option+"</option>";
						 else
							 tmp += "<option value="+opt.value+">"+opt.option+"</option>";
					});

					sub_str = "<select name="+obj.name+" class='form-control'>"+tmp+"</select>";
            }
         } else if(obj.btn) {
            sub_str = "<input type='button' name='"+obj.name+"' class='btn_sample' value='"+obj.btn+"'>"
		   } else if(obj.chk) {
			   sub_str = "<input type='checkbox' name='"+obj.name+"' class='chk_sample' value='"+obj.value+"'>";
		   } else if(obj.radio) {
				sub_str += "<input type='radio' name="+obj.name+" class='radio_sample' value='"+obj.radio[0].value+"'>";
		   } else if(obj.br) {
				for(var i=0; i<obj.br; i++) {
					sub_str += "<br>";
				}
		   } else if(obj.hr) {
				for(var i=0; i<obj.hr; i++) {
				   sub_str += "<hr>";
				}
		   }

         str += sub_str;
      });

      $("#"+active_tab).append("<div class='contents' key="+cur_key+">"+str+"</div>");
   });

   Handlebars.registerHelper('ftable_func', function(item) {
      $("#"+active_tab).append("<table class='table table-bordered'><tr key="+cur_key+" align='center' bgcolor='#d9edf7'></tr></table>");

      _.each(item, function(th) {
			if(!$.isEmptyObject(th)) {
				make_fth_func(th);
         }
      });
   });

   Handlebars.registerHelper('fhead_func', function(item) {
      $("#"+active_tab+" tr:last").after("<tr key='"+cur_key+"' bgcolor=\"#d9edf7\"></tr>");

      _.each(item, function(th) {
			if(!$.isEmptyObject(th)) {
				make_fth_func(th);
         }
      });
   });

   function make_fth_func(th) {
      var str = '';

		if(th.tbl_show_flag || th.check_flag) {
		  return false;
		}

      if(th.label) {
         if(th.name) {
            str = th.value;
         } else {
            str = th.label;
         }
      } else if(th.select) {
         var tmp = '';
         _.each(th.select, function (opt) {
             if(opt.value === th.value)
                tmp += "<option value="+opt.value+" selected>"+opt.option+"</option>";
             else
                tmp += "<option value="+opt.value+">"+opt.option+"</option>";
         });

         str = "<select name="+th.name+" class='sel_sample form-control'>"+tmp+"</select>";
      } else if(th.btn) {
         str = "<input type='button' name='"+th.name+"' class='btn_sample' value='"+th.btn+"'>";
      } else if(th.chk) {
         str = "<input type='checkbox' name="+th.name+" class='chk_sample' value='"+th.value+"'>";
      } else if(th.br) {
         for(var i=0; i<th.br; i++) {
            str += "<br>";
         }
      }

      if(th.colspan) {
         str = "<th colspan="+th.colspan+"> "+str+" </th>";
         $('#'+active_tab+' tr:last').append(str);
      } else if(th.cont) {
         $('#'+active_tab+' th:last').append(str);
      } else {
         str = "<th> "+str+" </th>";
         $('#'+active_tab+' tr:last').append(str);
      }
   }

   Handlebars.registerHelper('fitem_func', function(item) {
      $("#"+active_tab+" tr:last").after("<tr></tr>");

      _.each(item, function(td) {
			if(!$.isEmptyObject(td)) {
				make_ftd_func(td);
         }
      });

      if(cur_key) {
         $("#"+active_tab+" tr:last").attr("key",cur_key);
      }
   });

   Handlebars.registerHelper('fstruct_func', function(items) {
      _.each(items, function(item, i) {
         if(item.tr) {
            $("#"+active_tab+" tr:last").after("<tr></tr>");
            _.each(item.tr, function(td) {
					if(!$.isEmptyObject(td)) {
						make_ftd_func(td);
               }
            });
         } else if(item.th) {
			   $("#"+active_tab+" tr:last").after("<tr bgcolor=\"#d9edf7\"></tr>");
			   _.each(item.th, function(th) {
					if(!$.isEmptyObject(th)) {
						make_fth_func(th);
					}
			   });
         }

         if((i == 0) && cur_key) {
            $("#"+active_tab+" tr:last").attr("key",cur_key);
         }
      });
   });

   Handlebars.registerHelper('fvariable_func', function(items) {
		var independence_flag = true;

		for (var idx = 0; idx < pgm_views[$('#'+ap.active_pgm+'_attrs .btn_save_attr').attr('name')].collection.models[0].attributes.elements[0].tab.length; idx++) {
			if (pgm_views[$('#'+ap.active_pgm+'_attrs .btn_save_attr').attr('name')].collection.models[0].attributes.elements[0].tab[idx].variable_data) {
				for (var key_name in pgm_views[$('#'+ap.active_pgm+'_attrs .btn_save_attr').attr('name')].collection.models[0].attributes.elements[0].tab[idx]) {
					if (key_name == "data_form") {
						independence_flag = false;
					}
				}
				break;
			}
		}

		console.log(independence_flag);

		if(independence_flag) {
			$("#"+active_tab+" tr:last").after("<tr style='display:none;'></tr>");

			if(cur_key) {
				$("#"+active_tab+" tr:last").attr("key",cur_key);
			}
      }
   });

   function make_ftd_func(td) {
      var str = '';
      var colspan = 0;
      var center_flag = false;
      var right_flag = false;

      if(td.show === 0) {
         if(td.select) {
            _.each(td.select, function (opt) {
               if(opt.value === td.value) {
                  str = opt.option;
               }
            });
         } else if(td.textfield) {
            str = td.value;
         }
      } else {
         if(td.label) {
            if(td.name) {
               str = td.value;
            } else {
               str = td.label;
            }
         } else if(td.select) {
            var tmp = '';
            _.each(td.select, function (opt) {
               if(opt.value === td.value)
                  tmp += "<option value="+opt.value+" selected>"+opt.option+"</option>";
               else
                  tmp += "<option value="+opt.value+">"+opt.option+"</option>";
            });

            str = "<select name="+td.name+" class='sel_sample form-control'>"+tmp+"</select>";
         } else if(td.textfield) {
            if(td.name.match("DGT_DNT_0")) {
               right_flag = true;
            }
            str = "<input type='text' class='form-control' name="+td.name+" maxlength="+td.textfield[0].max+" size="+td.textfield[0].size+" value='"+td.value+"'>";
         } else if(td.password) {
            str = "<input type='password' class='form-control' name="+td.name+" maxlength="+td.password[0].max+" size="+td.password[0].size+" value='"+td.value+"'>";
         } else if(td.textarea) {
            str = "<textarea class='form-control' name="+td.name+" rows="+td.textarea[0].rows+" cols="+td.textarea[0].cols+">"+td.value+"</textarea>";
         } else if(td.radio) {
            str = "<input type='radio' name="+td.name+" class='radio_sample' value='"+td.radio[0].value+"'>";
         } else if(td.btn) {
            str = "<input type='button' name='"+td.name+"' class='btn_sample' value='"+td.btn+"'>";
            if(td.btn_type != "btn_addstn") {
   				center_flag = true;
            }
         } else if(td.chk) {
   			str = "<input type='checkbox' name='"+td.name+"' class='chk_sample'>";
         } else if(td.order) {
            if(type_history[0] != type_history[1]) {
               variable_order[ap.render_pgm] = 0;
            }
            variable_order[ap.render_pgm]++;
            str = variable_order[ap.render_pgm];
         } else if(td.send_label) {
            str = td.value;
         } else if(td.progressbar) {
            str = "<div class='progress' aria-valuemin='0' aria-valuemax='100'><div class='progress-bar progress-bar-info progress-bar-striped active' style='width: "+td.value+";'></div><div class='percent'>"+td.value+"</div></div>";
         } else if(td.date) {
            str = "<input class='date' name='"+td.name+"' value='"+td.value+"' />";
         } else if(td.br) {
            for(var i=0; i<td.br; i++) {
               str += "<br>";
            }
         }
      }

      if(td.slot_type || td.dir_list || td.type_list || td.cos_type) {
         type_history[0] = type_history[1];
         type_history[1] = td.value;

         if(type_history[0] != type_history[1]) {
            colspan = $("#"+active_tab+" table:last tr:first th").length;
            str = "<th colspan="+colspan+">"+str+"</th>"

            $('#'+active_tab+' tr:last').append(str);
            $('#'+active_tab+' tr:last').attr("bgcolor","#d9edf7");
            $("#"+active_tab+" tr:last").after("<tr></tr>");
         }
      } else if(td.rowspan || td.colspan) {
         str = "<td rowspan="+td.rowspan+" colspan="+td.colspan+"> "+str+" </td>";

         $('#'+active_tab+' tr:last').append(str);
      } else if(td.cont) {
         $('#'+active_tab+' td:last').append(" "+str);
      } else {
         str = "<td> "+str+" </td>";

         $('#'+active_tab+' tr:last').append(str);
      }

      if(td.date) {
         $('#'+active_tab+' .date').datepicker({dateFormat: "yy-mm-dd"});
      }

      if(center_flag) {
         $('#'+active_tab+' td:last').css("text-align","center");
      } else if(right_flag) {
         $('#'+active_tab+' td:last').css("text-align","right");
      }
   }
</script>

