{include file="$gentemplates/$header_tpl"}
<h2>{$lang.organizer.page_title}</h2>
		
{*if $form.err && $form.section eq ''}
	<p class="error_msg">*&nbsp;{$form.err}</p>
{/if*}
	<h3 class="p-b5">{$lang.organizer.my_bookmarks}</h3>
	<p><input type="button" value="{$lang.organizer.add_bookmark}" onclick="ShowAddBookmarkForm();"></p>
	<div id="add_bookmark_form" {if $form.err && $form.section eq '2'} style="display: inline;"{else} style="display: none;"{/if}>
		<form method="post" action="{$seo_site_root}/organizer.php" style="margin: 0px; padding: 0px;">
			<input type="hidden" name="sel" value="save_bookmark">
			{*if $form.err && $form.section eq '2'}
				<p class="error_msg">*&nbsp;{$form.err}</p>
			{/if*}
			<p>
				{$lang.organizer.url}:&nbsp;<font class="error_msg">*</font><br />
				<span class="text_hidden">http://&nbsp;</span>
				<input type="text" name="bookmark_url" style="width: 200px;" value="{$data.bookmark_url}" maxlength="255">
			</p>
			<p>
				{$lang.organizer.description}:&nbsp;<font class="error_msg">*</font><br />
				<textarea name="bookmark_descr" id="bookmark_descr" onkeyup="BadWords('bookmark_descr');" style="width: 242px;" rows="5">{$data.bookmark_descr}</textarea>
                <div id="bad_div_bookmark_descr" class="bad_div_left"></div>
			</p>
			<p>
				<input type="submit" value="{$lang.organizer.save_bookmark}">
			</p>
		</form>
	</div>	
	
	{if $links_top}
	<div style="display:table;width:100%;padding: 15px 0;">
		{include file="$gentemplates/pagination_top.tpl"}
	</div>
	{/if}
	<form id="del_bookmark_form" name="del_bookmark_form" method="post" action="{$seo_site_root}/organizer.php" style="margin: 0px; padding: 0px;">
		<input type="hidden" name="sel" value="del_bookmark">
		{if $user_bookmarks}
			{foreach item=item from=$user_bookmarks}
			<p>
				<input type="checkbox" name="bookmark[]" value="{$item.id}">&nbsp;
				<a href="http://{$item.link}" target="_blank">http://{$item.link}</a>&nbsp;-&nbsp;{$item.descr}
			</p>
			{/foreach}
		{else}
			<p>{$lang.organizer.no_bookmarks}</p>
		{/if}
		{strip}
			{if $user_bookmarks}
				<p>
					<input type="button" value="{$lang.organizer.del_selected}" onclick="{literal}javascript: if(confirm({/literal}'{$lang.organizer.del_bookmark_confirm|escape:javascript}'{literal})){ document.del_bookmark_form.submit(); }{/literal}">
				</p>
			{/if}
		{/strip}
	</form>
			
	{include file="$gentemplates/pagination_bottom.tpl"}
	<!-- end main cell -->
{literal}
<script type="text/javascript">
function ShowAddBookmarkForm() {
	if (document.getElementById('add_bookmark_form').style.display == 'none') {
		document.getElementById('add_bookmark_form').style.display = 'inline';
	} else {
		document.getElementById('add_bookmark_form').style.display = 'none';
	}
	return;
}
</script>
{/literal}
{include file="$gentemplates/$footer_tpl"}