<div id="tooltip" onclick="hideToolTip()" style="text-align:center; background-color: #FFFFFF; border: 1px dotted; text-align: {$default_left}; position:absolute; display:none; padding:5px;"></div>
{literal}
<script type="text/javascript">
$(function() {
$('#tool_tip_4 *').tooltip();
});
</script>
{/literal}
<div id="take_tour">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
	<tr class="table_header">
		<td align="center" colspan=2 width="80">{$lang.taketour.number}</td>
		<td align="left" >{$lang.taketour.slide}</td>
		<td align="left" >{$lang.taketour.comment}</td>
		<td align="left" >
			<select name="theme" onchange="ChangeTheme(); return false;">                        
				{foreach item=item from=$themes}
					<option value="{$item.name}" {if $item.sel eq 1}selected{/if}>{$item.title}</option>
				{/foreach}        
			</select>
		</td>
		<td align="center" width="70">{$lang.taketour.status}</td>
		<td align="right" width="100">{$lang.button.action}</td>
	</tr>
	{if $taketour}
	{section name=spr loop=$taketour}
	<tr {if $smarty.section.spr.index mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
		<td align="center" valign="top" width="70" style="padding:4">
			<table>
				<tr>
					<td align="center">
						<div style="cursor: pointer;" onclick="ShowBlock('show_block','{$taketour[spr].uplink}')"><img onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.up}');return false" src="{$site_root}{$template_root}/images/arrow_sort_up.png" border="0"></div>
					</td>
				</tr>
				<tr>
					<td align="center">
						<div style="cursor: pointer;" onclick="ShowBlock('show_block','{$taketour[spr].downlink}')"><img src="{$site_root}{$template_root}/images/arrow_sort_down.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.down}');return false" border="0"></div>
					</td>
				</tr>
			</table>
		</td>
		<td align="left"  valign="top"  width="10" style="padding:4"><a href="{$taketour[spr].editlink}" onclick="ShowBlock('show_block','{$taketour[spr].editlink}'); return false;">{$taketour[spr].number}</a></td>
		<td align="left"  valign="top" width="150"  style="padding:4"><a href="{$taketour[spr].editlink}" onclick="ShowBlock('show_block','{$taketour[spr].editlink}');return false;"><img width="100" alt="" src="{$taketour[spr].file_path}"></td>
		<td align="left"  valign="top"  style="padding:4">{if $taketour[spr].comment}{$taketour[spr].comment}{else}...{/if}</a></td>
		<td align="left"  valign="top"  style="padding:4">&nbsp;</td>
		<td align="center"  valign="top"  style="padding:4">{$taketour[spr].status}</td>
		<td align="right"  valign="top"  style="padding:4">
			<div class="block_action fr" style="display: none;">
				<div class="action_del" style="display: block;">
					<img width="16" alt="" src="{$site_root}{$template_root}/images/photo_delete.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.delete}');return false" onclick="{literal}javascript: if(confirm({/literal}'{$form.confirm|escape:javascript}'{literal})){ShowBlock('show_block','{/literal}{$taketour[spr].deletelink}{literal}')}{/literal}">
				</div>
			</div>
			<div style="width:10px;float:right;" class="fl">&nbsp;</div>
			<div class="block_action fr" style="display: none;">
				<div class="action_del" style="display: block;">
					<img width="16" alt="" src="{$site_root}{$template_root}/images/edit.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.edit}');return false" onclick="ShowBlock('show_block','{$taketour[spr].editlink}')">
				</div>
			</div>	
		</td>
	</tr>
	{/section}
	{else}
	<tr height="40">
		<td class="main_error_text" align="left" colspan="5">{$lang.taketour.empty}</td>
	</tr>
	{/if}
	<tr class="table_header">
		<td colspan="7">
			&nbsp;&nbsp;
			{if $links}
			{foreach item=item from=$links.pages}
				&nbsp;<a onclick="ShowBlock('show_block', '{$item.link}');" class="page_link" {if $item.selected} style=" font-weight: bold; text-decoration: none;" {/if}>{$item.name}</a>&nbsp;
			{/foreach}
			{/if}
			<div class="page_navigation">
			{if $links.previous}
				<a onclick="ShowBlock('show_block', '{$links.previous}');">< {$lang.content.previous} {$per_page}</a>
			{/if}
			{if $links.next}
				<a onclick="ShowBlock('show_block', '{$links.next}');">{$lang.content.next} {$per_page} ></a>
			{/if}
			</div>
		</td>
	</tr>
</table>

<table style="margin-top:15px;">
	<tr height="40">
			<td>
				<a class="admin_button_major" onclick="ShowBlock('show_block','{$add_link}')">{$lang.taketour.add}<span>&nbsp;</span></a>
			</td>
	</tr>
</table>
</div>
<script type="text/javascript">
{literal}
		function ChangeTheme(){
			var new_theme = $("select[name=theme]").val();
			$.post("admin_taketour.php", {theme: new_theme, ajax: '2'}, function(data){
				$("#take_tour").html(data);
			})
		}
		function showToolTip(e,text){
			if(document.all)e = event;
			var obj = document.getElementById('tooltip');
			obj.innerHTML = text;
			obj.style.display = 'block';
			var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;
			var leftPos = e.clientX - $('#tooltip').width()-10;
			if(leftPos<0)leftPos = 0;
			obj.style.left = leftPos + 'px';
			obj.style.top = e.clientY - obj.offsetHeight -10 + st + 'px';
		}
		function hideToolTip(){
			document.getElementById('tooltip').style.display = 'none';
		}
{/literal}		
</script>