{strip}

<script type="text/javascript">
{literal}

var view1 = 0;
var view2 = 0;

{/literal}
</script>

<div id="menu">
	<ul>
    	<li><div class="split"></div></li>
    	<li>
    		<a href="" 
    		onclick ="return false;"
    		onmouseover="document.getElementById('bar1').style.display='block';" 
    		onmouseout="if(view1==0) document.getElementById('bar1').style.display='none';">
    			<span class="dropdown">{l}Submit{/l}</span>
    		</a>
    		<div id="bar1" style="display: none;" onmouseover="this.style.display='block'; view1++;" onmouseout="this.style.display='none';  view1--;">
			<a href="{$smarty.const.DOC_ROOT}/submit.php{if !empty ($category.ID) and $category.ID > 0}?c={$category.ID}{/if}">
				&raquo;&nbsp;&nbsp;{l}Link{/l}
			</a><br/>
			<a href="{$smarty.const.DOC_ROOT}/submit_article.php{if !empty ($category.ID) and $category.ID > 0}?c={$category.ID}{/if}" style="border-top: 1px dotted #A4A4A4;">&raquo;&nbsp;&nbsp;{l}Article{/l}</a>
			</div>
    	</li>
        <li><div class="split"></div></li>
        <li>
        	<a href="" 
    		onclick ="return false;"
    		onmouseover="document.getElementById('bar2').style.display='block';" 
    		onmouseout="if(view2==0) document.getElementById('bar2').style.display='none';">
    			<span class="dropdown">{l}Latest{/l}</span>
    		</a>
    		<div id="bar2" style="display: none;" onmouseover="this.style.display='block'; view1++;" onmouseout="this.style.display='none';  view1--;">
	        	<a href="{if !$smarty.const.ENABLE_REWRITE}{$smarty.const.DOC_ROOT}/index.php?list=latest{else}{$smarty.const.DOC_ROOT}/latest-links.html{/if}">
	        		&raquo;&nbsp;&nbsp;{l}Latest Links{/l}
	        	</a>
	        	<a href="{if !$smarty.const.ENABLE_REWRITE}{$smarty.const.DOC_ROOT}/index.php?list=latestarticles{else}{$smarty.const.DOC_ROOT}/latest-articles.html{/if}"  style="border-top: 1px dotted #A4A4A4;">
	        		&raquo;&nbsp;&nbsp;{l}Latest Articles{/l}
	        	</a>
	        </div>
        </li>
        <li><div class="split"></div></li>
        <li>
        	<a href="{if !$smarty.const.ENABLE_REWRITE}{$smarty.const.DOC_ROOT}/index.php?list=top{else}{$smarty.const.DOC_ROOT}/top-hits.html{/if}" title="{l}Browse most popular links{/l}">
        		<span>{l}Top Hits{/l}</span>
        	</a>
        </li>
        <li><div class="split"></div></li>
        <li>
        	<a href="{$smarty.const.DOC_ROOT}/contact.php">{l}Contact{/l}</a>
       	</li>
    </ul>
    
</div>
</div>
			<div class="right"></div>
			<a class="rss" href="{$smarty.const.DOC_ROOT}/rss.php?{if !empty($search)}search={$search|@urlencode}{elseif $list}list={$list}{else}c={$category.ID}{/if}{if $sort}&amp;s={$sort}{/if}{if $p}&amp;p={$p}{/if}">
				<img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/rss.jpg" alt="RSS" />
			</a>
		</div>
	</div>
</div>

<div id="contentwrapper">
	<div id="content">
		<div id="contentTop"></div>
		<div class="clear"></div>
		<div id="contentMiddle">
	
		{include file="left_side.tpl"}
	
		<div id="main">
			<ul id="main_container" style="list-style-type: none; padding: 0px; margin: 0;">
			<li>
			{if !$uid & !$search & empty($category.ID) & !$list & $scriptname == "index"}
			{foreach from=$widgets.MAIN_ON_HOMEPAGE.TOP item=v}
				{if $v.SETTINGS.DISPLAY_IN_BOX eq 'Yes'}
				{include file="widget_central_top.tpl" TITLE=$v.SETTINGS.TITLE}
				{/if}
				{$v.CONTENT}
				{if $v.SETTINGS.DISPLAY_IN_BOX eq 'Yes'}
				{include file="widget_central_bot.tpl"}
				{/if}
			{/foreach}
			{else}
			{foreach from=$widgets.MAIN_NOT_ON_HOMEPAGE.TOP item=v}
				{if $v.SETTINGS.DISPLAY_IN_BOX eq 'Yes'}
				{include file="widget_vertical_top.tpl"}
				{/if}
				{$v.CONTENT}
				{if $v.SETTINGS.DISPLAY_IN_BOX eq 'Yes'}
				{include file="widget_vertical_bot.tpl"}
				{/if}
			{/foreach}
			{/if}
			</li>
			</ul>
		
		
			{* Display current path *}
			{if $path|@count > 1}
	        <div class="path">
				{assign var="current_path" value=""}
				{foreach from=$path item=cat name=path}
				   {assign var="current_path" value="`$current_path``$cat.TITLE_URL`/"}
				   {if !$smarty.foreach.path.last}
				      <a href="{if $smarty.const.ENABLE_REWRITE}{$current_path}{else}index.php?c={$cat.ID}{/if}" {if $smarty.foreach.path.first}id="firstPath"{/if}>{$cat.TITLE|escape|trim}</a>
				   {else}
				      <span>{$cat.TITLE|escape|trim}</span>
				   {/if}
				{/foreach}
	        </div>
			{/if}

{/strip}

{if $uLevel eq 1}
 {literal}
 <style type="text/css">
     .placeholder {
         border: 1px solid #FCEFA1;
         background: #FDFADF; 
         color: #363636;
         width: 187px;
         height: 60px;
         margin: 14px;
     }
     
     .placeholder_central {
         border: 1px solid #FCEFA1;
         background: #FDFADF; 
         color: #363636;
         width: 496px;
         height: 60px;
         margin: 16px;
     }
 </style>
 
 <script type="text/javascript">
 
 jQuery(function($) {
 
         $("#sortable_left").sortable({
             placeholder: "placeholder",
             connectWith: "#sortable_right",
             opacity: 0.6,
             cursor: "move",
             stop: function() {
                 var left_hash = '';
                 var right_hash = '';
                 $('#sortable_left li').each(function(i){
                     if ($(this).attr('id'))
                     left_hash += $(this).attr('id') + ',';
                 });
                 $('#sortable_right li').each(function(i){
                     if ($(this).attr('id'))
                     right_hash += $(this).attr('id') + ',';
                 });
                 $.ajax({
                     url: "{/literal}{$smarty.const.DOC_ROOT}{literal}/admin/frontend_edit_widget.php",
                     cache: false,
                     data: {
                         action: "ORDER",
                         left_hash: left_hash,
                         right_hash: right_hash,
                         zone: "left"
                     },
                 });
             }
         });
         
         $("#sortable_right").sortable({
             placeholder: "placeholder",
             connectWith: "#sortable_left",
             opacity: 0.6,
             cursor: "move",
             stop: function() {
                 var left_hash = '';
                 var right_hash = '';
                 $('#sortable_left li').each(function(i){
                     if ($(this).attr('id'))
                     left_hash += $(this).attr('id') + ',';
                 });
                 $('#sortable_right li').each(function(i){
                     if ($(this).attr('id'))
                     right_hash += $(this).attr('id') + ',';
                 });
                 $.ajax({
                     url: "{/literal}{$smarty.const.DOC_ROOT}{literal}/admin/frontend_edit_widget.php",
                     cache: false,
                     data: {
                         action: "ORDER",
                         left_hash: left_hash,
                         right_hash: right_hash,
                         zone: "left"
                     },
                 });
             }
         });
         
         $("#sortable_central").sortable({
             placeholder: "placeholder_central",
             connectWith: "#main_container",
             opacity: 0.6,
             cursor: "move",
             stop: function() {
                 var central_hash = '';
                 $('#sortable_central li').each(function(i){
                     if ($(this).attr('id'))
                     central_hash += $(this).attr('id') + ',';
                 });
                 $.ajax({
                     url: "{/literal}{$smarty.const.DOC_ROOT}{literal}/admin/frontend_edit_widget.php",
                     cache: false,
                     data: {
                         action: "ORDER",
                         central_hash: central_hash
                     },
                 });
             }
         }); 
 
 });
 
 </script>
 {/literal}
 
 {/if}