<script type="text/javascript" charset="utf-8">
var <{$dirname}>Edit = new XoonipsEdit.edit('<{$xoops_url}>', '<{$dirname}>', 'registerform', 'register');
jQuery.noConflict();
jQuery(function(){
	<{$dirname}>Edit.setMsgCss();
	<{$dirname}>Edit.sortable();
    jQuery('#<{$dirname}>_registerform :button[rel^="prettyPopin"]').prettyPopin({
        width : 400, /* false/integer */
        height: 400, /* false/integer */
        opacity: 0.5, /* value from 0 to 1 */
        animationSpeed: '0', /* slow/medium/fast/integer */
        close : false, /* true/false */
        followScroll: false, /* true/false */
        overflow : 'hidden', /* scroll/hidden */
        divname : 'prettyPopin',
        dirname : '<{$dirname}>',
        loader_path: './images/loader.gif', /* path to your loading image */
        callback: function(id, value) {
            return <{$dirname}>Edit.userCallback(id, value);
        }
    });
    jQuery('#<{$dirname}>_registerform :button[rel^="relatedItemPrettyPopin"]').prettyPopin({
        width : 600, /* false/integer */
        height: 500, /* false/integer */
        opacity: 0.5, /* value from 0 to 1 */
        animationSpeed: '0', /* slow/medium/fast/integer */
        close : false, /* true/false */
        followScroll: false, /* true/false */
        overflow : 'hidden', /* scroll/hidden */
        divname : 'prettyPopin',
        dirname : '<{$dirname}>',
        loader_path: './images/loader.gif', /* path to your loading image */
        callback: function(id, value) {
        	<{$dirname}>Edit.relatedItemCallback(id, value, null);
        }
    });
    jQuery('#<{$dirname}>_registerform :input[rel="date"]').change(function(){
    	<{$dirname}>Edit.changeDate(jQuery(this).attr('id'));
    });
    jQuery('#<{$dirname}>_registerform :input[type=file]').change(function(){
    	<{$dirname}>Edit.changeFile();
    });
    <{if ($relation === false)}>
        alert('failed to get resources');
    <{/if}>
});
</script>
<h4><{$smarty.const._MD_XOONIPS_ITEM_REGISTER_ITEM_TITLE}></h4>
<table cellspacing="1">
	<tr>
		<td class="even" style="width: 25%; text-align: center;"><{$smarty.const._MD_XOONIPS_ITEM_SELECT_ITEM_TYPE_LABEL}></td>
		<td class="even" style="width: 5%; text-align: center;">-></td>
		<td class="head" style="width: 25%; text-align: center;"><{$smarty.const._MD_XOONIPS_ITEM_REGISTER_ITEM_TITLE}></td>
		<td class="even" style="width: 5%; text-align: center;">-></td>
		<td class="even" style="width: 25%; text-align: center;"><{$smarty.const._MD_XOONIPS_ITEM_REGISTER_ITEM_CONFIRM}></td>
		<td style="width: 15%; text-align: center;"></td>
	</tr>
</table>

<table><tr><td width="30%">
<b><{$smarty.const._MD_XOONIPS_ITEM_SELECT_SUB_INDEX_TREE}></b><br>
<script type="text/javascript" charset="utf-8">
jQuery(function(){
	<{foreach item=index from=$indexes}>
	jQuery('#<{$dirname}>_item_regist_index_tree_<{$index.index_id}>').treeview({
			control: '#<{$dirname}>_item_regist_treecontrol',
			persist: 'cookie',
			cookieId: '<{$dirname}>_item_regist_index_treeview_<{$index.index_id}>'
		});
	<{/foreach}>
	
	jQuery('#<{$dirname}>_item_regist_index_tree_tabs').tabs({
		cookie: {}
	});
	<{$dirname}>Edit.setIndexTreeButton('_item_regist');
});
</script>
<div id="<{$dirname}>_item_regist_treecontrol" style="float: none; clear: both; margin: 0px 0px 3px 0px; padding: 0px;">
<button class="formButton" >open all</button>
<button class="formButton" >close all</button>
<button class="formButton" id="<{$dirname}>_index_tree_clear_button">clear</button>
</div>
<div style="margin: 0px; padding: 0px;font-size:80%;" id="<{$dirname}>_item_regist_index_tree_tabs">
<ul>
<{foreach item=index from=$indexes}>
	<li><a href="#<{$dirname}>_item_regist_index_tree_div_<{$index.index_id}>"><{$index.title|xoops_escape}></a></li>
<{/foreach}>
</ul>
<{foreach item=tree from=$trees}>
	<div id="<{$dirname}>_item_regist_index_tree_div_<{$tree.index_id}>" style="border-right: 1px solid #404040;border-top: 1px solid #e4e4e4; border-left: 1px solid #e4e4e4;
            border-bottom: 1px solid #858585; border-right: 1px solid #858585; padding: 0px; margin: 0px;">
	<ul id="<{$dirname}>_item_regist_index_tree_<{$tree.index_id}>" class="filetree">
	<{$tree.html}>
	</ul>
	</div>
<{/foreach}>
</div>
</td>

<td width="70%">
<{$errors}>
<form id="<{$dirname}>_registerform" target="<{$dirname}>_uploadoutputiframe" name="<{$dirname}>_registerform" action="register.php" method="post" enctype="multipart/form-data"<{$accept_charset}>>
<input type="hidden" name="itemtype_id" value="<{$itemtype_id}>" />
<input id="<{$dirname}>_targetItemId" type="hidden" name="targetItemId" value="">
<input id="<{$dirname}>_fileuploadclick" type="hidden" name="fileuploadclick" value="0">
<{if !empty($registryView)}>
	<div style="text-align: center; margin: 10px;">
	<span id="<{$dirname}>_message_label_top">
	<{$smarty.const._MD_XOONIPS_ITEM_SELECT_PRIVATE_INDEX}>
	</span>
	</div>
<{/if}>
<{if !empty($system_message)}>
	<p><{$system_message}></p>
<{/if}>
<{if isset($num_of_items_current) && isset($num_of_items_max)}>
	<{if $num_of_items_max == 0}>
		<{$smarty.const._MD_XOONIPS_ITEM_NUM_OF_ITEM}>:<{$num_of_items_current}> / <{$smarty.const._MD_XOONIPS_LABEL_UNLIMIT}><br />
	<{else}>
		<{$smarty.const._MD_XOONIPS_ITEM_NUM_OF_ITEM}>:<{$num_of_items_current}> / <{$num_of_items_max}><br />
	<{/if}>
<{/if}>
<{if isset($storage_of_items_current) && isset($storage_of_items_max)}>
	<{if $storage_of_items_max == 0}>
		<{$smarty.const._MD_XOONIPS_ITEM_STORAGE_OF_ITEM}>:<{$storage_of_items_current}>MB / <{$smarty.const._MD_XOONIPS_LABEL_UNLIMIT}><br />
	<{else}>
		<{$smarty.const._MD_XOONIPS_ITEM_STORAGE_OF_ITEM}>:<{$storage_of_items_current}>MB / <{$storage_of_items_max}>MB<br />
	<{/if}>	
<{/if}>
<font size="+1" color="red"><{$smarty.const._MD_XOONIPS_LABEL_REGISTER_TOP_MESSAGE}></font>
<{if !empty($registryView)}>
	<table class="outer">
	<{$registryView}>
	</table>
<{/if}>
<{if !empty($registryView)}>
	<div style="text-align: center; margin: 10px;">
	<span id="<{$dirname}>_message_label_bottom">
	<{$smarty.const._MD_XOONIPS_ITEM_SELECT_PRIVATE_INDEX}>
	</span></div>
<{/if}>
<{if !empty($registryView)}>
	<div style="text-align: center">
	<input class="formButton" type="button" value="<{$smarty.const._MD_XOONIPS_ITEM_NEXT_BUTTON_LABEL}>" onclick="<{$dirname}>Edit.registry()">
	<input type="button" rel="cancel" value="<{$smarty.const._MD_XOONIPS_LABEL_CANCEL}>">
	</div>
	<iframe id="<{$dirname}>_uploadoutputiframe" name="<{$dirname}>_uploadoutputiframe" style="display:none"></iframe>
<{/if}>
</td>
</tr>
</table>
</form>