<div id="content">
    <div class="left span-755">
        <div class="box">
            
            <div class="bmenu">
                <div class="bmenul"><h2>SEARCH RESULTS FOR '{$search_query|truncate:30:' ...':true|escape:'html'}'</h2></div>
                <div class="bmenur">{literal}
                    <script type="text/javascript">
                        $(document).ready(function(){
                            $("select[id='order_type'],select[id='order_timeline'],select[id='order_category']").change(function() {
                                $('#orderVideos').submit();
                            });
                        });
                    </script>
                    {/literal}
                    <div id="order_form">
                    <form name="orderVideos" id="orderVideos" method="get" action="{$relative}/search">
                        <input name="o" type="hidden" value="{$order}" />
                        <input name="search_query" type="hidden" value="{$search_query|escape:'url'}" />
                        <input name="search_type" type="hidden" value="videos" />
                        <span class="mleft">Type: </span>
                        <select name="type" id="order_type">
                            <option value=""{if $type == ''} selected="yes"{/if}>All</option>
                            <option value="public"{if $type == 'public'} selected="yes"{/if}>Public</option>
                            <option value="private"{if $type == 'private'} selected="yes"{/if}>Private</option>
                        </select>
                        <span class="mleft">Category:</span>
                        <select name="c" id="order_category">
                            <option value="0"{if $category == '0'} selected="yes"{/if}>All</option>
                            {section name=i loop=$categories}
                            <option value="{$categories[i].CHID}"{if $category == $categories[i].CHID} selected="yes"{/if}>{$categories[i].name}</option>
                            {/section}
                        </select>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
            <div class="bsubmenu">
                <div class="bsubmenul">
                    {if $order == 'bw'}Being Watched{else}<a href="{url base='videos' strip='o' value='bw'}">Being Watched</a>{/if} <strong>&middot;</strong>
                    {if $order == 'mr'}Most Recent{else}<a href="{url base='videos' strip='o' value='mr'}">Most Recent</a>{/if} <strong>&middot;</strong>
                    {if $order == 'mv'}Most Viewed{else}<a href="{url base='videos' strip='o' value='mv'}">Most Viewed</a>{/if} <strong>&middot;</strong>
                    {if $order == 'tr'}Top Rated{else}<a href="{url base='videos' strip='o' value='tr'}">Top Rated</a>{/if} <strong>&middot;</strong>
                    {if $order == 'md'}Most Commented{else}<a href="{url base='videos' strip='o' value='md'}">Most Commented</a>{/if} <strong>&middot;</strong>
                    {if $order == 'tf'}Top Favorites{else}<a href="{url base='videos' strip='o' value='tf'}">Top Favorites</a>{/if}                                                                                                                    
                </div>
                <div class="bsubmenur">
                    <div id="timeline_form">
                        <span>Timeline: </span>
                        <select name="t" id="order_timeline">
                            <option value="t"{if $timeframe == 't'} selected="yes"{/if}>Today</option>
                            <option value="w"{if $timeframe == 'w'} selected="yes"{/if}>This Week</option>
                            <option value="m"{if $timeframe == 'm'} selected="yes"{/if}>This Month</option>
                            <option value="a"{if $timeframe == 'a'} selected="yes"{/if}>All</option>
                        </select>
                    </div>
                    </form>
                </div>
                <div class="clear"></div>
            </div>
            <div class="blinkp">
                <div class="blinkcl">Showing <span>{$start_num}</span> to <span>{$end_num}</span> of <span>{$videos_total}</span> videos.</div>
                <div class="blinkcr"><a href="{$relative}/upload/video">Upload Video</a></div>
                <div class="clear"></div>
            </div>
            {if $videos}
            {section name=i loop=$videos}
            <div class="video_box">
                <a href="{$relative}/video/{$videos[i].VID}/{$videos[i].title|clean}"><span class="font-13 font-bold">{$videos[i].title|truncate:23:' ...':true|escape:'html'}</span><br /><img src="{$relative}/media/videos/tmb/{$videos[i].VID}/{$videos[i].thumb}.jpg" title="{$videos[i].title|escape:'html'}" alt="{$videos[i].title|escape:'html'}" width="160" height="120" id="rotate_{$videos[i].VID}" /><br />{if $videos[i].type == 'private'}<img alt="" style="position: absolute; left: 0px; top: +15px; width: 160px; height: 120px;" src="{$relative_tpl}/images/private-video.png"/>{/if}</a>
                <div class="box_left">
                    {insert name=duration assign=duration duration=$videos[i].duration}
                    {$duration}<br />
                    {insert name=time_range assign=addtime time=$videos[i].addtime}
                    {$addtime}                                                                                                
                </div>
                <div class="box_right">
                    {insert name=rating_small assign=video_rating rating=$videos[i].rate}
                    {$video_rating}
                    <div class="clear_right"></div>
                    {$videos[i].viewnumber} views
                </div>
                <div class="clear"></div>
            </div>
            {/section}
            <div class="clear_left"></div>
            <div class="pagination"><ul>{$page_link}</ul></div><br />
            {else}
                NO VIDEOS
            {/if}
        </div>
        {insert name=adv assign=adv group='videos_bottom'}
        {if $adv}<br /><div class="ads">{$adv}</div><br />{/if}                               
    </div>    
    <div class="right span-200">
          <div class="box">
              
              <div class="btitle">SPONSORS</div>
              {insert name=adv assign=adv group='videos_right'}
              {if $adv}<br /><div class="ads">{$adv}</div><br />{/if}
          </div>
    </div>
    <div class="clear"></div>
</div>
