{include file="$gentemplates/$header_tpl"}
<div class="profile_general_table" style="padding-top:20px;">

	{literal}
	<script type="text/javascript">
		{/literal}{if $form.no_rating ne '1'}{literal}
		if (document.images){
			var mark_show=new Image;
			mark_show.src="{/literal}{$form.vote_icon_1_path}{literal}"
			var mark_hide=new Image;
			mark_hide.src="{/literal}{$form.vote_icon_0_path}{literal}"
		}

		function marks(id,type){
			if (!document.images){return false;}
			for (i=1; i<=id; i++){
				if (type=="show"){document.images["mark"+i].src=mark_show.src;}
				else if (type=="hide"){document.images["mark"+i].src=mark_hide.src;}
			}
			return;
		}
		{/literal}{/if}{literal}
		{/literal}
			pause = '{$lang.gallary.pause_slide}';
			play = '{$lang.gallary.play_slide}';
			left = '{$default_left}';			
		{literal}
		$(document).ready(function() {			
			$('#flyerslider').fadeSlideShow({
				ListElement: 'fssList',
				NextElement: '',
				PrevElement: '',
				PlayText: '<a style="float:'+left+';padding-top:8px;" href="#">&nbsp;'+play+'</a><a href="#" id="pause-play" alt="play" class="play-icon">&nbsp;</a>',
				PauseText: '<a style="float:'+left+';padding-top:8px;" href="#">&nbsp;'+pause+'</a><a href="#" id="pause-play" alt="play" class="pause-icon">&nbsp;</a>'
			});			
		});
	</script>
	{/literal}

	<h2 class="float_left">{if $form.upload_type eq 'f'}{$lang.gallary.photos}{/if}{if $form.upload_type eq 'v'}{$lang.gallary.video_preview}{/if}</h2>
	<div style="overflow:hidden; height:32px;">
		<div class="float_right" style="padding-top:7px;padding-bottom:5px;">
			<a id="pause-play" href="#" style="padding:7px 14px;">&nbsp;</a>
		</div>
	</div>
	<div class="gallery_content search_result_list">
		{if $form.upload_type eq 'f'}
			<div class="slider" style="float:none; width:650px; margin: 0 auto;">
				<ul class="flyerslider" id="flyerslider" class="jcarousel-skin-flyerslider">
					{section loop=$scroll_preview name=item start=$scroll.start max=$scroll.end}					
					{if $scroll_preview[item].big_img}
						<li class="flysellobject">
							<img src="{$scroll_preview[item].big_img}" alt="" class="icon imgcanvas" height="500px" /> 
						</li>
					{/if}
					{/section}
					<li class="flysellobject">
						<img src="{$form.image_path}" alt="" class="icon imgcanvas" height="500px" /> 						
					</li>
				</ul>
			</div>
		{else}
			{if $form.type eq 'embed'}
				{$form.file_path}
			{else}
				<a href="{$form.file_path}" class="player" style="display:block;width:650px;height:450px;" id="player"></a>
				<script type="text/javascript" src="{$server}/flowplayer/flowplayer-3.2.8.min.js"></script>
				<script type="text/javascript" src="{$server}/flowplayer/flowplayer.ipad-3.2.8.js"></script>
				<script type="text/javascript" src="http://flowplayer.org/media/js/site.js"></script>
				<script>
					$f("player", "{$server}/flowplayer/flowplayer-3.2.8.swf").ipad();
				</script>
			{/if}
		{/if}
	</div>
	<div class="gallery_content" style="padding-top:0px;">
		<link href="{$site_root}{$template_root}{$template_css_root}/jquery/carousel.css" rel="stylesheet" type="text/css" media="all">	
		{if $form.upload_type eq 'f'}				
		<div class="carousel_gallery search" style="height:85px;margin-top:15px;overflow:hidden;" dir="ltr">
			<ul id="small_mycarousel" class="jcarousel-skin-dating" style="width:100%;">
				{section loop=$scroll_preview name=item start=$scroll.start max=$scroll.end}				
				<li class="float_left" style="height:80px;width:62px;padding:5px;" id="{$smarty.section.item.index}">
					<!--onClick="GetComments({$scroll_preview[item].id}, 1);"-->
					<a {if $scroll_preview[item].is_adult}onClick="launchWindow('{$scroll_preview[item].link}', '', 800,580)"{else}href={$scroll_preview[item].link}{/if}>
						<img alt="" {if $scroll_preview[item].id eq $id}style="border: 3px solid #D00C0C;margin-top: -5px;padding: 5px;"{/if} class="icon imgcanvas" src="{$scroll_preview[item].img}" id="prev_{$smarty.section.item.index}"/>
						{if $scroll_preview[item].id eq $id}{assign var=prev_id value=$smarty.section.item.index}{/if}
					</a>
				</li>
				{/section}
			</ul>
		</div>			
		{/if}
		{if $form.upload_type eq 'v'}
			<div class="carousel_gallery search" style="height:85px;margin-top:15px;overflow:hidden;"  dir="ltr"> 
				<ul id="small_mycarousel" class="jcarousel-skin-dating" style="width:100%;">
					{section loop=$scroll_preview name=item start=$scroll.start max=$scroll.end}			
					<li class="float_left" style="height:80px;width:62px;padding:5px;" id="{$smarty.section.item.index}">
					<a {if $scroll_preview[item].is_adult}onClick="launchWindow('{$scroll_preview[item].link}', '', 600,300); return false;"{else}href={$scroll_preview[item].link}{/if}>
						{if $scroll_preview[item].img == 'default'}
							<img alt="" style="cursor:pointer; width: 60px; height: 60px;" class="icon imgcanvas{if $scroll_preview[item].id eq $id} select{/if}" src="{$site_root}{$template_root}{$template_images_root}/video_icn_60x60.png"/>
						{else}
							<img alt="" style="cursor:pointer; width: 60px; height: 60px;" class="icon imgcanvas{if $scroll_preview[item].id eq $id} select{/if}" src="{$scroll_preview[item].img}"/>
						{/if}
					</a>
					</li>
					{/section}
				</ul>
			</div>			
		{/if}
	</div>
	<div class="gallery_content" id="comment">
		<h3 class="p-b5">{$lang.gallary.comments}</h3>
		<p id="error_msg"></p>
		<div class="comments_links_gallary"></div>
		<div align="{$default_left}" id="comments">
			{foreach key=key item=item from=$comments name=s}
				<div style="display:table;width:100%;">
					<div style="width:120px;position:relative;" class="float_left">
						<img src="{$item.icon_path}" class="icon imgcanvas" onmouseover="javascript: CreateBigImage(this, event, {if $default_left eq 'left'}false{else}true{/if}, false);"/>
					</div>
					<div style="width:500px;" class="float_left">
						<p style="overflow:hidden;">
                                                    <a class="float_left" href="{$item.profile_link}">{$item.name}</a>
                                                    <span class="float_left">&nbsp;</span>
                                                    <span class="float_left">({$item.date_post})</span>
                                                    {if $item.del_link}
                                                       <span class="float_left">&nbsp;&nbsp;&nbsp;</span>
                                                        <a class="float_left" href="{$item.del_link}&id_upload={$form.id_upload}&type={$form.upload_type}">{$lang.button.delete}</a>
                                                    {/if}
                                                </p>
						<p>{$item.comment}</p>                         
					</div>
				</div>
			{/foreach}
		</div>
		<p>{$lang.gallary.your_comments}</p>
		<div class="content_alloc classfields">
		<div style="display:table;margin-{$default_left}:2px; overflow:hidden;" class="comments">
			<input type="hidden" name="id_upload" id="id_upload" value="{$form.id_upload}">
			<input type="hidden" name="upload_type" id="upload_type" value="{$form.upload_type}">
		   
			<textarea style="resize: none;" name="message" onkeyup="BadWords('message'); textchange2()" id="message" cols="118" rows="3"></textarea>
			<div id="bad_div_message" class="bad_div"></div>
            <div style="margin: 10px 2px;">
				<div class="float_right" style="margin-top:9px;margin-right:7px;" id="count_sym2">256</div>
				<script>{literal}
					function textchange2() {
						var count = 256;
						$('#count_sym2').text(count);
						a = $('#message').val().length;
						if (a > count) {
							$('#message').val($('#message').val().substring(0, count));
						}
						a = $('#message').val().length;
						$('#count_sym2').text(count - a);
						if (a > count){
							$('#message').css("disabled", "disabled");
						}
					}
				{/literal}</script>
				<div style="height: 16px; width: 10px;" class="icon_smail_for_comment float_left" onclick="return displaySmileLayer();"></div>
				
				<div id=smiles class="smiles" style="display:none; {$default_left}: 35px; width: 255px;">                                   
					<ul>
					{section name=sm loop=$smiles}
					{if $use_default_smiles eq '1'}
					<li><a style="cursor:pointer;" onclick="document.getElementById('message').value=document.getElementById('message').value+'{$smiles[sm].value}'; document.getElementById('smiles').style.display = 'none';document.getElementById('comment').style.marginBottom  = '10px';"><img src="{$site_root}{$template_root}/emoticons/{$smiles[sm].file}" class="smile_icon" alt=""></a></li>
					{else}
					<li><a style="cursor:pointer;" onclick="document.getElementById('message').value=document.getElementById('message').value+'{$smiles[sm].value}'; document.getElementById('smiles').style.display = 'none';document.getElementById('comment').style.marginBottom  = '10px';"><img src="{$site_root}/uploades/smiles/{$smiles[sm].file}" class="smile_icon" alt=""></a></li>
					{/if}
					{/section}
					</ul>
				</div>
			</div>
		</div>		
		</div>
		<p>
		   <input type="button" name="send_comment" id="send_comment" value="{$lang.gallary.add_comment}">
		</p>
	</div>
	

<script language="JavaScript" type="text/javascript">
var prev_start = {if $prev_id}{$prev_id}{else}''{/if};
{literal}

	$(document).ready(function() {
		$('#small_mycarousel').jcarousel();
	}); 
	
	function prevPhoto(ActSlide){
		var prev_id = ActSlide - 1;
		var last_id = prev_id + 1;
		$("#prev_"+prev_start).css("border","1px solid #CCCDCB");
		$("#prev_"+prev_id).css("border","3px solid #D00C0C").css("margin-top","-5px").css("padding","5px");
		$("#prev_"+last_id).css("border","1px solid #CCCDCB");
		if(last_id==0)$("#prev_"+prev_start).css("border","3px solid #D00C0C").css("margin-top","-5px").css("padding","5px");
	}	
	
	function displaySmileLayer()
{
	if (document.getElementById('smiles').style.display == 'none') {
		document.getElementById('smiles').style.display = 'inline-block';
		$('#comment').css("margin-bottom", $('#smiles').height() - 66);
	} else {
		document.getElementById('smiles').style.display = 'none';
		$('#comment').css("margin-bottom", "10px");
	}
	return false;
}
{/literal}
</script>
	
{include file="$gentemplates/$footer_tpl"}