<div id="header_photo"></div>
<div style="text-align:center;" id="slides"></div>
<a class="arr-left1-icon" id="photo_pager_l" title="{$lang.general.prev}">&nbsp;</a>
<a class="arr-right1-icon" id="photo_pager_r" title="{$lang.general.next}">&nbsp;</a>
<div style="width: 100%; display:table; width: 390px; margin: 0 auto;">
	<div class="hotornot" style="margin: 5px auto; display:none;"></div>
</div>
<div class="slide_add" style="display:{if $view_all}none;{else}table;{/if}">
	<span id="error_msg">&nbsp;</span>

	<input type="hidden" name="sel" id="sel" value="set_comment" />
	<input type="hidden" name="id_user" id="id_user" value="{$data_9.id_user}" />
	<input type="hidden" name="id_upload" id="id_upload" value="{$data_9.id_subitem}" />
	<input type="hidden" name="id_album" id="id_album" value="{$data_9.id_album}" />
	<input type="hidden" name="upload_type" id="upload_type" value="{$data_9.type}" />
	<input type="hidden" name="id_gallery" id="id_gallery" value="{$data_9.photos[$data_9.num_selected].id_gallery}" />
				
	<div id="comments_div" class="comment_div float_left"></div>
	
	<!--  right block: delete, abuse report, edit-->
	<div class="discr_div float_right">
		<!-- album name -->
		<div style="position: relative;">
			<span class="opt_name">{$lang.gallary.album}:</span>
			<span {if $can_edit}class="text_red"{else}class="link" onClick="document.location.href='{$site_root}/{$seo.viewprofile}{literal}?sel=4&id='+$('#id_user').val()+'&id_album='+$('#id_album').val()+'{/literal}'"{/if} id="selected_album">{$data_9.photos[$data_9.num_selected].title}</span>
			{if $can_edit}
				<a class="small-arr-down" style="padding: 7px 5px" onClick="$('#select_album').toggle();">&nbsp;</a>
				<div id="select_album" class="select_list popup">
					{foreach from=$data_9.albums item=item}
						<p onClick="ChangePhotoPar('album','{$item.id}','{$item.name}')"><a>{$item.name}</a></p>
					{/foreach}
				</div>
			{/if}
		</div>
		{if $can_edit}
			<!-- permisions -->
			<div style="position: relative;">
				<span class="opt_name">{$lang.users.allow_type}:</span>
				<span class="text_red" id="selected_perm"></span>
				<a class="small-arr-down" style="padding: 7px 5px" onClick="$('#select_perm').toggle();">&nbsp;</a>
				<div id="select_perm" class="select_list popup">
					<p onClick="ChangePhotoPar('perm','1')"><a>{$lang.users.allow_1}</a></p>
					<p onClick="ChangePhotoPar('perm','2')"><a>{$lang.users.allow_2}</a></p>
					<p onClick="ChangePhotoPar('perm','3')"><a>{$lang.users.allow_3}</a></p>
				</div>
			</div>
			<div class="dl_line" id="dl_line_gallery"></div>
			<!-- is allowed -->
			<div id="photo_gallery" style="position: relative;display:block;">
				<span class="opt_name">{$lang.profile.show_in}: </span>
				<span class="text_red" id="selected_show_in"></span>
				<a class="small-arr-down" style="padding: 7px 5px" onClick="$('#select_show_in').toggle();">&nbsp;</a>
				<div id="select_show_in" class="select_list popup">
					{if $data_9.type ne 'a'}
						<p onClick="ChangePhotoPar('show_in','1')"><a>{$lang.profile.show_in_photo_gallery}</a></p>
						<p onClick="ChangePhotoPar('show_in','0')"><a>{$lang.profile.show_in_nowhere}</a></p>
					{/if}
				</div>
			</div>
		{/if}
		<!-- category -->
		<div style="position: relative;" id="category_div">
			<span class="opt_name">{$lang.gallary.category}:</span>
			<span {if $can_edit}class="text_red"{else}class="link" onClick="document.location.href='{$site_root}/{$seo.gallery}?sel=category&upload_type=f&id_category='{literal}+$('#id_gallery').val(){/literal}"{/if} id="selected_category">
				{if $data_9.photos[$data_9.num_selected].gallery_name} 
					{$data_9.photos[$data_9.num_selected].gallery_name}
				{else}
					{$lang.gallary.no_category}
				{/if}
			</span>
			{if $can_edit}
			<a class="small-arr-down" style="padding: 7px 5px" onClick="$('#select_category').toggle();">&nbsp;</a>
			<div id="select_category" class="select_list popup">
				{foreach from=$data_9.categories item=item}
					<p onClick="ChangePhotoPar('category','{$item.id}', '{$item.name|escape:javascript}')"><a>{$item.name}</a></p>
				{/foreach}
			</div>
			{/if}
		</div>
		<div class="dl_line"></div>
		
		<!-- main photo -->
		<div style="position: relative;">
			<span class="text_red" id="main_photo"></span>
		</div>
		
		<!-- delete -->
		<div style="position: relative;">
			<span class="opt_name">{$lang.button.action}:</span>
			<span class="text_red" id="delete"></span>&nbsp;&nbsp;<span class="text_red" id="recrop"></span>
		</div>
		<!-- report abuse -->
		<div style="position: relative;">
			<span class="opt_name">&nbsp;</span>
				<!-- abuse report -->
			{if $abuse_link && !$can_edit}
				<a href="#" id="abuse_link_popup" onClick="onformclick=1;
				{if $form.upload_type=='a' || $form.upload_type=='v'}
					$('#video_screen_box').css('height',$('#video_screen_box').attr('offsetHeight')); 
					$('#video_screen').toggle(); 
				{/if} abuseReport(); return false;">{$report_abuse.report_link}</a>
				<div id="abuse_form_tpl_popup" style="display:none;margin-{$default_left}:0px;">
					<div id="abuse_form_popup" style="z-index:100;margin-bottom:15px;">
						<p class="text_head">{$report_abuse.form_header_text}</p>
						<p>
							{foreach name=amt from=$abuse_link.abuse_types_msg item=item}
							<input type="radio" name="ab_type_msg" value="{$item}" {if $smarty.foreach.amt.iteration == 2}checked="checked"{/if} /> {$report_abuse.msg_types.$item}<br />
							{/foreach}
						</p>
						<p>{$report_abuse.get_descr}:</p>
						<p>
							<textarea id="ab_msg_popup" style="width:97%" onBlur="if (this.value=='') $('#submit_am').attr('disabled','disabled'); else $('#submit_am').attr('disabled','');"  onkeyup="if (this.value=='') $('#submit_am').attr('disabled','disabled'); else $('#submit_am').attr('disabled','');" rows="3" cols="5"></textarea>
						</p>
						<p>
							<span id="abuse_button"></span>
						</p>
					</div>
				</div>
				<script type="text/javascript">
				{literal}
					var onformclick = 0;
					$(document).ready(function(){
						$(document).click(function(){
							$("#abuse_form_parent_popup").click(function(){onformclick=1;});
							if (!onformclick){
								if ($("#abuse_form_parent_popup").html()){
									$("#abuse_form_parent_popup").remove();
									$("#video_screen").show();
								}
							}
							onformclick=0;
						});
					});
				{/literal}
				</script>
			{/if}
		</div>
	</div>
</div>
<script type="text/javascript">
	var arr_images=[{foreach item=item name=k from=$data_9.photos}'{$item.url_image}'{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var arr_comments=[{foreach item=item name=k from=$data_9.photos}"{$item.user_comment|escape:javascript}"{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var arr_height=[{foreach item=item name=k from=$data_9.photos}'{$item.imagesize[1]}'{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var arr_width=[{foreach item=item name=k from=$data_9.photos}'{$item.imagesize[0]}'{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var arr_id=[{foreach item=item name=k from=$data_9.photos}'{$item.id}'{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var arr_main_photo = [{foreach item=item name=k from=$data_9.photos}'{$item.main_photo}'{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var arr_delete=[{foreach item=item name=k from=$data_9.photos}'{$item.del_link}'{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var arr_recrop=[{foreach item=item name=k from=$data_9.photos}'{$item.crop_click|escape:javascript}'{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var arr_album=[{foreach item=item name=k from=$data_9.photos}"{$item.title|escape:javascript}"{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var arr_permission=[{foreach item=item name=k from=$data_9.photos}'{$item.allow}'{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var arr_show_in=[{foreach item=item name=k from=$data_9.photos}'{$item.is_gallary}'{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var arr_category=[{foreach item=item name=k from=$data_9.photos}"{$item.gallery_name|escape:javascript}"{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var arr_id_gallery=[{foreach item=item name=k from=$data_9.photos}'{$item.id_gallery}'{if !$smarty.foreach.k.last},{/if}{/foreach}];
	var cur_slide = {$data_9.num_selected};
	var count_img = {$data_9.count_photos};
	var edit_descr = "";
	var view_album = "";
	var album = arr_album[0];
	var can_edit = {$can_edit};
	view_album = "<a href='{$site_root}/{$seo.viewprofile}?sel=4&type={$data_9.type}&id={$data_9.id_user}'>{$lang.profile.more_photos}</a>";
	var id_main_photo = '{$id_main_photo}';
	{literal}

	$(document).ready(function() {
		var ok = '{/literal}{$lang.gallary.voice_submitted}{literal}';
		var del_link_href = '{/literal}{$lang.button.delete}{literal}';
		var recrop_link_href = '{/literal}{$lang.button.recrop}{literal}';
		var edit_link_href = '{/literal}{$lang.button.edit}{literal}';
		var height='{/literal}{$gallery_height}{literal}';
		ShowContent(cur_slide);
		
		$("#photo_pager_l").click(function(){
			$('#slides').fadeTo(600,0.2, function() {
				$('#slides').fadeTo(200,1);			
				if (cur_slide == 0) cur_slide = arr_images.length - 1;
				else cur_slide = cur_slide - 1;
				ShowContent(cur_slide);
			});
		});

		$("#photo_pager_r").click(function(){
			$('#slides').fadeTo(600,0.2, function() {
				$('#slides').fadeTo(200,1);
				if (cur_slide == (arr_images.length - 1)) {cur_slide = 0;} 
				else {cur_slide = cur_slide + 1;}
				ShowContent(cur_slide);
				
			});
		});
		
		$('#send_comment_myprofile').click (function (e) {
				var height_comment = $('#comments').height();
				$('#comments').css({'height':height_comment});
				var message = $('#message_popup').val();
				var id = $('#id_upload').val();
				var type = $('#upload_type').val();
				var id_user = $('#id_user').val();
				if (message != '' && id > 0){
						ajaxLoadingImage(1, 'comments');        
						$.post(SEO_SITE_ROOT+'/myprofile.php', {sel:'set_comment', id:id, message:message, type:type, id_user: id_user}, function(data){
					if (data == 'send'){
						$('#error_msg').html('');
						$('#comments').html('');
						$('#message_popup').val('');
						count = 256;
						$('#count_sym2').html(count);
						GetComments_myprofile(arr_id[cur_slide], 1, can_edit);
					}
					else{
						ShowAjaxError('', data);
						/*data = '<p>'+data+'</p>'
						$('#error_msg').html(data);*/
						GetComments_myprofile(arr_id[cur_slide], 1, can_edit);
					}
				});
			}
		});
		
		
		
		function ShowContent(cur_slide){
				if(count_img == 0){
					$('#mask').fadeOut(300);
					$('.window').fadeOut(300);
					window.location.reload();
				}
				current_photo_num = cur_slide + 1;
				$('#id_file').val(arr_id[cur_slide]);
				$('#id_upload').val(arr_id[cur_slide]);
				$('#id_gallery').val(arr_id_gallery[cur_slide]);
					//header
					if (can_edit)
						$('#header_photo').html("<h2>{/literal}{$lang.profile.my_photos}{literal} ("+ current_photo_num +" {/literal}{$lang.users.of}{literal} "+count_img+")&nbsp;</h2>");
					else
						$('#header_photo').html("<h2>{/literal}{$lang.section.photos}{literal} ("+ current_photo_num +" {/literal}{$lang.users.of} {$data_9.count_photos}{literal})&nbsp;</h2>");
					
					//foto + ����������� 
								if (arr_height[cur_slide] < 500 && arr_width[cur_slide] < 500) height = 'max-height: 500px;';
								else height = 'height: 500px;';                        
					size_string = '';
					if (arr_width[cur_slide] > arr_height[cur_slide]*8/5) {size_string += 'max-height: 500px; width: 695px';}   
					else {
									size_string += ' max-width: 695px; ';
									size_string += height;
								}
					to_slide = '<div id="image_area" style="'+height+'"><img style="'+size_string+'" src="'+arr_images[cur_slide]+'?rand='+Math.random()+'"></div>';
					if (!arr_comments[cur_slide]) arr_comments[cur_slide] = '&nbsp;';
					
					//description
					if (can_edit) edit_descr = '<a style="cursor:pointer;" class="float_right" onClick="ChangeStat('+cur_slide+'); return false;">{/literal}{$lang.button.edit}{literal}</a>';
					to_slide += '<div id="photo_description" style="position: relative;">'+arr_comments[cur_slide]+edit_descr+'</div>';
					
					$('#slides').html(to_slide);	
					
					//get comments
					GetComments_myprofile(arr_id[cur_slide], 1, can_edit);
					
					//links
					//delete
					if (can_edit) $('#delete').html('<a id="delete" href="'+arr_delete[cur_slide]+'">'+del_link_href+'</a>');
					else $('#delete').html(view_album);
					
					if (can_edit){
						$('#recrop').html('<a href="javascript:void(0)" onclick="'+arr_recrop[cur_slide]+'">{/literal}{$lang.profile.recrop}{literal}</a>');
					}else{
						$('#recrop').html('');
					}
					
					//main_photo
					if (can_edit) {		
						if (id_main_photo == arr_id[cur_slide])
							$('#main_photo').html('{/literal}{$lang.profile.main_photo}{literal}');
						else
							$('#main_photo').html('<a style="cursor:pointer;" onclick="MakeMain('+arr_id[cur_slide]+')">{/literal}{$lang.profile.make_main}{literal}</a>');
					}
					
					//permissions
					if (arr_permission[cur_slide] == 1) perm_text = '{/literal}{$lang.users.allow_1}{literal}';
					if (arr_permission[cur_slide] == 2) perm_text = '{/literal}{$lang.users.allow_2}{literal}';
					if (arr_permission[cur_slide] == 3) perm_text = '{/literal}{$lang.users.allow_3}{literal}';
					$('#selected_perm').html(perm_text);
								
					//show or not show
					if (arr_permission[cur_slide] == 1){
						if (arr_show_in[cur_slide] == 1) show_in_text = '{/literal}{$lang.profile.show_in_photo_gallery}{literal}';
						else show_in_text = '{/literal}{$lang.profile.show_in_nowhere}{literal}';
						$('#selected_show_in').html(show_in_text);
					}
					else{
						$("#photo_gallery").hide();
						$("#dl_line_gallery").hide();
					}
					
					//category
					if (arr_permission[cur_slide] == 1){
						if (arr_show_in[cur_slide] == 0)
							$('#category_div').hide();
						else
							$('#category_div').show();
						$('#selected_category').html(arr_category[cur_slide]);
					}else{
						$("#category_div").hide();
					}
					
					//abuse_button
					$('#abuse_button').html('<input id="submit_am" type="button" value="{/literal}{$lang.button.send}{literal}" onClick="sendAbuse({/literal}{$abuse_link.id_user}{literal},'+arr_id[cur_slide]+');" />');
		}
	});

	function ChangePhotoPar(par, new_par, album_name){
		album_name = album_name || 0;
		id_photo = $('#id_upload').val();
		$.post(SEO_SITE_ROOT+"/myprofile.php",{sel:"change_photo_par",id_photo:id_photo, par:par, new_par:new_par},function(data){
			if (data != 'error'){
				//console.log('selected_'+par);
				$('#selected_'+par).html(data);
				if (par == 'perm') arr_permission[cur_slide] = new_par;
				else if (par == 'show_in') arr_show_in[cur_slide] = new_par;
				else if (par == 'category') arr_category[cur_slide] = album_name;
				else if (par == 'album') arr_album[cur_slide] = new_par;
				//если права и смена альбома
				if (par == 'perm' || par == 'album'){                       
					if (arr_permission[cur_slide] == 1){
						//если разрешено всем
						if(album_name!=album && par=='album') ChangeAlbum(id_photo);
						if (arr_show_in[cur_slide] == 1)
							$('#category_div').show();
						else
							$('#category_div').hide();
						$("#dl_line_gallery").show();
						$("#photo_gallery").show();
					}else{
						//если не всем, то скрываем показ в галерее и категории
						$('#category_div').hide();
						$("#photo_gallery").hide();
						$("#dl_line_gallery").hide();
					}
				}
				//если показ в галерее
				if (par == 'show_in'){
					//если отображать в галерее, то показываем категории
					if (arr_show_in[cur_slide] == 1)
						$('#category_div').show();
					else
						$('#category_div').hide();
				}
			}
		});
		$('#select_'+par).hide();
	}

	function ChangeAlbum(id){
		var id_photo = id;
		var item_id = arr_id.indexOf(id_photo);
		arr_id.splice(arr_id.indexOf(id_photo), 1);
		arr_images.splice(arr_images.indexOf(arr_images[cur_slide]), 1);
		arr_id_gallery.splice(arr_id_gallery.indexOf(arr_id_gallery[cur_slide]), 1);
		cur_slide = arr_images.length - 1;
		count_img = count_img - 1;
	}


	function ShowHideCatForm() {
		if ($('#is_gallary').is(':checked')) {
			$('#categories_div_photo').css('display','block');
		} else {
			$('#categories_div_photo').css('display','none');
		}
	}

	function ChangeStat(par) {
		$("#photo_description").html("<div><input type='text' id='descr' name='descr' onkeyup=\"BadWords('descr');\" value='"+arr_comments[par]+"'><a class='small-active-icon' style='padding-top:0px; padding-bottom: 6px;' name='submit' onclick='SaveStat("+par+");'>&nbsp;</a></div><div id=\"bad_div_descr\" class=\"bad_div_left\"></div>");
	}

	function SaveStat(par) {
		var value = $("#descr").val();
		var id_upload = $('#id_upload').val();
		var edit_descr = '<a onClick="ChangeStat('+par+'); return false;" class="float_right">{/literal}{$lang.button.edit}{literal}</a>';

		$.post(SEO_SITE_ROOT+"/myprofile.php",{sel:"set_description_photo",id:id_upload, text:value},function(data){
			if (data == "send")
				$("#photo_description").html(value+edit_descr);
		});
	}

	var	smileLayer	= 0;

	var	bbcode		= Array();
	bbcode['b']		= Array('[b]', '[/b]');
	bbcode['i']		= Array('[i]', '[/i]');
	bbcode['u']		= Array('[u]', '[/u]');
	bbcode['img']	= Array('[img]', '[/img]');
	bbcode['url']	= Array('[url={$lang.forum.insert_link_url}]', '{$lang.forum.insert_link_name}[/url]');

	bbcode['s1']	= Array(' :) ');
	bbcode['s2']	= Array(' ;) ');
	bbcode['s3']	= Array(' :D ');
	bbcode['s4']	= Array(' 8) ');
	bbcode['s5']	= Array(' :] ');
	bbcode['s6']	= Array(' :O ');
	bbcode['s7']	= Array(' :/ ');
	bbcode['s8']	= Array(' :( ');
	bbcode['s9']	= Array(' ;( ');
	bbcode['s10']	= Array(' O_O ');
	function insertBB(code)
	{
		var tag1 = bbcode[code][0];
		var tag2 = bbcode[code][1];
		var txta = document.getElementById('message_popup');
		txta.focus();

		if (typeof document.selection != 'undefined') {
			var range = document.selection.createRange();
			var sel = range.text;
			range.text = tag2 ? tag1 + sel + tag2 : tag1;
			range = document.selection.createRange();
			if (tag2 && !sel.length) range.move('character', -tag2.length);
			else if (tag2) range.move('character', tag1.length + sel.length + tag2.length);
			range.select();
		}
		else if (typeof txta.selectionStart != 'undefined') {
			var scroll = txta.scrollTop;
			var start  = txta.selectionStart;
			var end    = txta.selectionEnd;
			var before = txta.value.substring(0, start);
			var sel    = txta.value.substring(start, end);
			var after  = txta.value.substring(end, txta.textLength);
			txta.value = tag2 ? before + tag1 + sel + tag2 + after	: before + tag1 + after;
			var caret = sel.length == 0	? start + tag1.length : start + tag1.length + sel.length + tag2.length;
			txta.selectionStart = caret;
			txta.selectionEnd = caret;
			txta.scrollTop = scroll;
		}
		return false;
	}
	function marks(id,type){
			if (!document.images) return false;
			for (i=1; i<=id; i++){
				if (type=="show"){
					$("#mark"+i).removeClass("rate_heart_inactive");
					$("#mark"+i).addClass("rate_heart_active");
				}
				else if (type=="hide"){
					$("#mark"+i).removeClass("rate_heart_active");
					$("#mark"+i).addClass("rate_heart_inactive");
				}
			}
			return;
		}
	function VoteUser_myrpofile(estim){
		var destination = $(".active_section");
		var id_album = $('#id_album').val();
		var id_upload = $('#id_upload').val();
		var vote = $('#vote').val();
		var upload_type = $('#upload_type').val();
		var ok = '{/literal}{$lang.gallary.voice_submitted}{literal}';
		InitXMLHttpRequest();
		if (req){
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					destination.innerHTML = req.responseText;
				} else {
					destination.innerHTML = "Loading...";
				}
			}
			req.open('GET', SEO_SITE_ROOT+'/myprofile.php?sel=vote&id_upload=' + id_upload + '&vote=' + estim + '&id_category=' + id_album+ '&upload_type=' + upload_type, true);
			req.send(null);
			$(".hotornot").html(ok);
		}
		else{
		   destination.innerHTML = 'Browser unable to create XMLHttp Object';
		}
		return;
	}

	function abuseReport(){
		if ($("#abuse_form_popup_parent_popup").html() && $("#abuse_form_parent_popup").remove()) return;
		$("#abuse_link_popup").before("<div id='abuse_form_parent_popup' style='display:inline; position:relative;top:20px;'>"+$("#abuse_form_tpl_popup").html()+"</div>");
		$("#abuse_form_popup").addClass('abuse_form_popup');
		var height = ($("#abuse_form_popup").height()+$("#abuse_link_popup").height());
		$("#abuse_form_popup").css('bottom','25px');
		$("#abuse_form_popup").css('left','0px');
		$("#abuse_form_popup").css('width','145px');
	$('#abuse_form_tpl_popup').toggle();
	}

	function sendAbuse(id_user, id_item){
		var type_msg = $("input[name='ab_type_msg']:checked").attr('value');
		var msg = $("#ab_msg_popup").val();
		if (!id_user || !id_item || !type_msg || !msg) return;
		str = 'ajax=1&sel=save_abuse_report&id_user='+id_user+'&id_item='+id_item+'&type_item=viewphoto&type_msg='+type_msg+'&msg='+msg;
		$.post(SEO_SITE_ROOT+"/backend.php", str, function(data){
			alert(data);
			//$("#abuse_form_popup").html(data);
			var height = ($("#abuse_form_popup").height()+$("#abuse_link_popup").height());
			$("#abuse_form_popup").css('bottom','20px');
			$("#abuse_form_popup").css('left','0px');
			$("#abuse_form_popup").css('white-space','nowrap');
			$("#abuse_form_popup").fadeIn('fast').fadeTo(1000,1).fadeOut(2000,function(){$("#abuse_form_parent_popup").remove()});
			$('#abuse_form_tpl_popup').toggle();
		})
		
	}

	function MakeMain(id_file){
		$.post(SEO_SITE_ROOT+"/myprofile.php",{sel:"make_main",id_file:id_file},function(data){
			if (data != "error"){
				$("#main_photo").html('{/literal}{$lang.profile.main_photo}{literal}');
				//window.location.reload(true);
				if ({/literal}{$data_9.photos[$data_9.num_selected].imagesize[0]}{literal} < {/literal}{$settings.gal_big_thumb_max_width}{literal})
					add_width = 405;
				else add_width = 250;
				add_width += {/literal}{$data_9.photos[$data_9.num_selected].imagesize[0]}{literal};
				launchWindow('{/literal}{$site_root}{literal}/include/crop.php?image_id='+id_file,'', add_width, 600, true);return false;
			}
		});
	}
</script>
{/literal}