<div id="content">
    <div class="left span-630">
        <h1>{$video.title|escape:'html'}</h1>
        <div id="player">
        {if $guest_limit}
        <div class="font-size16" style="margin-left: 10px;">Sorry, email verification members only for more free videos!<br />Visitors and Non-email verified members' bandwidth has been reached!<br /> To watch more videos, Please <a href="{$relative}/signup"><strong>signup</strong></a> for free and <a href="{$relative}/confirm"><strong>verify</strong></a> your email.<br />For members, Please <a href="{$relative}/login"><strong>login</strong></a> and try it again.</div>
        {elseif !$is_friend}
<div class="font-size16" style="margin-left: 10px;">This video is private! You must be friends with <a href="{$relative}/user/{$video.username}"><strong>{$video.username}</strong></a> to view it!<br /> Please <a href="{$relative}/signup"><strong>signup</strong></a> and <a href="{$relative}/login"><strong>login</strong></a> FOR FREE and then just add <a href="{$relative}/user/{$video.username}"><strong>{$video.username}</strong></a> to your friends!<br />(You can find "Add To Friends" link at bottom of <a href="{$relative}/user/{$video.username}"><strong>{$video.username}</strong></a> homepage)<br />Don't forget to <a href="{$relative}/confirm"><strong>verify</strong></a> your email address after you <a href="{$relative}/signup"><strong>signup</strong></a>!</div>
        {/if}
        {if $is_friend && !$guest_limit}
        {include file='video_vplayer.tpl'}
        {/if}
        </div>
        <div class="video_actions">
            <div class="video_rating">
                <input name="current_rating" type="hidden" value="{$video.rate}" id="current_rating" />
                <div id="rating">
                    {insert name=rating assign=video_rating rating=$video.rate ratedby=$video.ratedby type='video' item_id=$video.VID}
                    {$video_rating}                                        
                </div>
                <div id="rating_text">
                    {$video.ratedby} ratings
                </div>
                <div class="clear"></div>
            </div>
            <div class="video_links">
                {if $video_embed == '1'}
                <div id="embed_video"><a href="#embed_video">Embed</a></div>
                {/if}
                {if isset($smarty.session.uid)}
                <div id="flag_video"><a href="#flag_video">Flag</a></div>
                <div id="favorite_video"><a href="#favorite_video" id="favorite_video_{$video.VID}">Favorite</a></div>
                {/if}
                <div id="share_video"><a href="#share_video">Share</a></div>
                <div class="clear_right"></div>
            </div>
            <div class="clear"></div>
        </div>
        <div id="response_message" class="response" style="display: none;"></div>
        <div id="share_video_box" style="display: none;">
            <div class="box">
                
                <div class="btitle"><h2>SHARE VIDEO</h2></div>
                <div class="blink"><a href="#close_share" id="close_share">close</a></div>
                <div class="clear_right"></div>
                <div id="share_video_response" class="response" style="display: none;"></div>
                <div id="share_video_form">
                    <form name="share_video_form" method="post" action="#share_video">
                    <div class="video_box_left">
                        <div class="separator">
                            From: <br />
                            <input name="from" type="text" value="{if isset($smarty.session.uid)}{if $smarty.session.fname != ''}{$smarty.session.fname}{else}{$smarty.session.username}{/if}{/if}" maxlength="50" id="share_from" /><br />
                            <span id="share_from_error" class="font-11 font-bold" style="color: red; display: none;"></span>
                        </div>
                        <div class="separator">
                            To: <br />
                            <textarea name="to" cols="30" rows="5" id="share_to"></textarea><br />
                            <span id="share_to_error" class="font-11 font-bold" style="color: red; display: none;"><br /></span>
                            <span class="font-11">Enter E-mails or {$site_name} usernames<br />comma or space separated).</span>
                        </div>
                    </div>
                    <div class="video_box_right">
                        <div class="separator">
                            Message (optional):
                            <textarea name="message" cols="30" rows="8" id="share_message"></textarea>
                        </div>
                    </div>
                    <div class="clear"></div>
                    <div style="width: 100%; text-align: center; padding-bottom: 5px;">
                        <input name="submit_share" type="button" value=" Share Video " id="send_share_video_{$video.VID}" class="button" />
                    </div>
                    </form>
                </div>
            </div>
        </div>
        {if isset($smarty.session.uid)}
        <div id="flag_video_box" style="display: none;">
            <div class="box">                
                <div class="btitle"><h2>FLAG VIDEO</h2></div>
                <div class="blink"><a href="#close_flag" id="close_flag">close</a></div>
                <div class="clear_right"></div>
                <div id="flag_video_response" class="posting" style="display: none;"></div>
                <div id="flag_video_form">
                    <div class="video_box_left">
                        <input name="flag_reason" type="radio" value="inappropriate" checked="yes" />&nbsp; Inappropriate (rape, incest, etc.)<br />
                        <input name="flag_reason" type="radio" value="underage" />&nbsp; Underage<br />
                        <input name="flag_reason" type="radio" value="copyrighted" />&nbsp; Copyrighted Material<br />
                        <input name="flag_reason" type="radio" value="not_playing" />&nbsp; Video Not Playing<br />
                        <input name="flag_reason" type="radio" value="other" />&nbsp; Other<br />
                        <span id="flag_reason_error" class="font-11 font-bold" style="color: red; display: none;"></span>
                    </div>
                    <div class="video_box_right">
                        <div class="separator">
                            Reason (optional):<br />
                            <textarea name="flag_message" cols="30" rows="4" id="flag_message"></textarea>
                        </div>
                    </div>
                    <div class="clear"></div>
                    <div style="width: 100%; text-align: center; padding-bottom: 5px;">
                        <input name="submit_flag" type="button" value=" Flag Video " id="submit_flag_video_{$video.VID}" class="button" />
                    </div>
                </div>
            </div>
        </div>
        {/if}
        {if $video_embed == '1'}
        <div id="embed_video_box" style="display: none;">
            <div class="box">
                <div class="btitle"><h2>EMBED VIDEO</h2></div>
                <div class="blink"><a href="#close_embed" id="close_embed">close</a></div>
                <div class="clear_right"></div>
				{include file='video_embed_vplayer.tpl'}
            </div>
        </div>
        {/if}
        <div class="video_info">
            <div class="video_username">
                From: <a href="{$relative}/user/{$video.username}">{$video.username}</a><br />
            </div>
            <div class="video_views">
                {$video.viewnumber} views
            </div>
            <div class="clear"></div>
            <div class="video_tags" id="video_tags">
                Tags:
                {assign var='keywords' value=$video.keyword}
                {section name=i loop=$keywords}
                <a href="{$relative}/search?search_type=videos&search_query={$keywords[i]}">{$keywords[i]}</a>,
                {/section}
            </div>
            <div class="video_addtime">
                {insert name=time_range assign=addtime time=$video.addtime}
                {$addtime}
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="right span-320">
        {insert name=adv assign=adv group='video_right'}
        {if $adv}<br /><div class="ads">{$adv}</div><br />{/if}
        {insert name=adv assign=adv group='video_right_second'}
        {if $adv}<br /><div class="ads">{$adv}</div><br />{/if}
    </div>
    <div class="clear"></div>
    <div class="box">
        <div class="bmenu">
            <div class="bmenul">
                <h2>
                    <a href="#related_videos" id="show_related_videos">RELATED VIDEOS ({$videos_total})</a> <strong>&middot;</strong>
                    <a href="#comments" id="show_comments">COMMENTS ({$comments_total})</a>
                </h2>
            </div>
            <div class="bmenur">
                <div class="center_related" style="display: none;"><img src="{$relative_tpl}/images/ajax_loader_bar.gif" alt="Ajax Loader" /></div>
            </div>
            <div class="clear"></div>
        </div>
        <div id="related_videos">
            {if $videos}
            <input name="current_page_related_videos" type="hidden" value="1" id="current_page_related_videos" />
            <div class="bar_space_related_left">
                <a href="#prev_related_videos" id="prev_related_videos_{$video.VID}" class="prev_bar_related" style="display: none;"></a>
            </div>
            <div id="related_videos_container">
            {section name=i loop=$videos}
            <div class="video_box_related">
                <a href="{$relative}/video/{$videos[i].VID}/{$videos[i].title|clean}"><span class="font-13 font-bold">{$videos[i].title|truncate:21:' ...':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" 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="vbox_rel_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="vbox_rel_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>
            {if $videos_total > 10}
            <div class="bar_space_related_right">
                <a href="#next_related_videos" id="next_related_videos_{$video.VID}" class="next_bar_related"></a>
            </div>
            {/if}
            <div class="clear"></div>
            {else}
            <div class="no_comments">No related videos found!</div>
            {/if}
            <br />
        </div>
        <div id="video_comments" style="display: none;">
            {if isset($smarty.session.uid) && $video_comments == '1'}
            <div id="post_comment">
                <form name="postVideoComment" id="postVideoComment" method="post" action="#">
                    <textarea name="video_comment" id="video_comment" cols="100" rows="5" class="video_comment"></textarea>
                    <div id="post_message" class="post_message" style="display: none;">Please enter your comment!</div>
                    <div class="action" id="chars_left">1000 characters left</div>
                    <div class="action">
                        <input name="submit_comment" type="button" value=" Post " id="post_video_comment_{$video.VID}" class="button" />
                    </div>
                    <div class="clear_left"></div>
                </form>
                <div id="video_response" class="response" style="display: none;"></div>
            </div>
            {/if}
            <div id="video_comments_{$video.VID}">
                <div class="blinkp">
                    Showing <span>{$start_num}</span> to <span>{$end_num}</span> of <span>{$comments_total}</span> comments.
                </div>
                <div class="pagination"><ul>{$page_link_comments}</ul></div>
                <div id="comments_delimiter" style="display:none;"></div>
                {if $comments}
                {section name=i loop=$comments}
                <div id="video_comment_{$video.VID}_{$comments[i].CID}">
                <div id="delete_response_{$comments[i].CID}" class="response" style="display: none;"></div>
                    <div class="comment">
                        <div class="comment_left">
                            <a href="{$relative}/user/{$comments[i].username}"><img src="{$relative}/media/users/{if $comments[i].photo != ''}{$comments[i].photo}{else}nopic-{$comments[i].gender}.gif{/if}" width="60" title="{$comments[i].username}'s avatar" alt="{$comments[i].username}'s avatar" /></a>
                        </div>
                        <div class="comment_right_video">
                            <div class="comment_info_video">
                                {insert name=time_range assign=addtime time=$comments[i].addtime}
                                <a href="{$relative}/user/{$comments[i].username}">{$comments[i].username}</a>&nbsp;<strong>-</strong>&nbsp;<span class="font-10">{$addtime}</span>
                            </div>
                            <p class="comment_body_video">{$comments[i].comment|escape:'html'|nl2br}</p>
                            {if isset($smarty.session.uid)}
                            <div class="comment_actions_video">
                                {if $smarty.session.uid == $comments[i].UID}
                                <a href="#delete_comment" id="delete_comment_video_{$comments[i].CID}_{$video.VID}">Delete</a> <strong>&middot;</strong>
                                {/if}
                                <span id="reported_spam_{$comments[i].CID}_{$video.VID}"><a href="#report_spam" id="report_spam_video_{$comments[i].CID}_{$video.VID}">Report Spam</a></span>
                            </div>
                            {/if}
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
                {/section}
                <div class="pagination"><ul>{$page_link_comments_bottom}</ul></div>
                {else}
                <div class="no_comments">No comments yet. Be first to comment!</div>
                {/if}
            </div>
            <br />
        </div>
    </div>
    <div class=" box span-100">
    {insert name=adv assign=adv group='video_bottom'}
    {if $adv}<br /><div class="ads">{$adv}</div><br />{/if}
    </div>
</div>
