{include file="$gentemplates/$header_tpl"}
	{*<script type="text/javascript" src="{$site_root}{$index_theme_path}/js/jquery-ui-1.7.1.custom.min.js"></script>*}
	<script type="text/javascript" src="{$site_root}{$index_theme_path}/js/class.wall_events.js"></script>
	<script type="text/javascript" src="{$site_root}{$index_theme_path}/js/jquery.jplayer.min.js"></script>
	<link href="{$site_root}{$index_theme_path}{$index_theme_css_path}/player_skin/jplayer.blue.monday_{$default_left}.css" rel="stylesheet" type="text/css" />
	{include file="$gentemplates/wall_events_audio_player.tpl"}
	
	<h2>{$lang.top_menu.my_profile}</h2>
	{if $changed_fields_str}
		<div>
			*&nbsp;{$lang_sharing_tools.proile_bad_notice1}:<br />
			{$changed_fields_str}
			{$lang_sharing_tools.proile_bad_notice2}
		</div>
		<br />
	{/if}
	{if $org_home[0] == 'true'}
	<div class="profile_info_table">
		<div>
			<div class="profile_icon">
				{if $data.big_thumb_photo_path || $data.icon_path}
					<div class="profile_icon_slider">
					   <div class="slider_list">
						   <ul id="listtt" style="width:{$data.photo_count*200}px;">
							 {if $data.icon_path}
								<li><img src="{$data.icon_path}?rand={math equation='rand()'}" onclick="/*load_all_images(this); return false;*/" class="icon imgcanvas" width="200px"  alt="" /></li>
							 {/if}
							 {foreach from = $data.big_thumb_photo_path item=item}
								{if $data.icon_path ne $item.path}
								<li><img class="imgcanvas" src="{$item.path}" width="200px" onclick="/*load_all_images(this); return false;*/"  alt="" /></li>
								{/if}
							 {/foreach}
							 {if $data.icon_path}
								<li><img src="{$data.icon_path}" onclick="/*load_all_images(this); return false;*/" class="icon imgcanvas" width="200px"  alt="" /></li>
							 {/if}
							</ul>
					   </div>
					   <div class="signature">	   
						   <a class="prevslide" onclick="icon_slider('left');" title="{$lang.general.prev}">&nbsp;</a>
						   <span id="this_icon">{if $data.big_photo_count eq 0}0{else}1{/if}</span> {$lang.users.of} <span id="count_icon">{$data.big_photo_count}</span>
						   <a class="nextslide" onclick="icon_slider('right');" title="{$lang.general.next}">&nbsp;</a>
					   </div>
					</div>
				{/if}
			</div>
						{literal}
			<script>
			  function load_all_images(elem)
			  {
			      var link = elem.src.match(/[^\/]+$/);
				  launchWindow('/myprofile.php','sel=start_slide&all_images=true&img='+link,800,550);
			  };			  
			  function icon_slider(to,time)
			  {
				 left = '{/literal}{$default_left}{literal}';
			     to = (to=='left')?(200):(-200);
				 time = (time && parseInt(time)>10)?parseInt(time):250;
				 time = parseInt(time/10);
				 var ul = document.getElementById('listtt');
				if (left=='left')
				 var margin = (ul.style.marginLeft)?parseFloat(ul.style.marginLeft):0;
				else
					var margin = (ul.style.marginRight)?parseFloat(ul.style.marginRight):0;
				 var delta = to/time;
				 var iter = 0;
				 var it    = parseInt(document.getElementById('this_icon').innerHTML);
				 var count = parseInt(document.getElementById('count_icon').innerHTML);
                 it = (to<0)?(it+1):(it-1);	
                 if(it>count || it<1) return;
				 
				 document.getElementById('this_icon').innerHTML = it;
                 var func = function()
				 {
					iter++;
					if (left=='left'){
					 var margin = (ul.style.marginLeft)?parseFloat(ul.style.marginLeft):0;
					 ul.style.marginLeft = margin + delta + 'px';
					}
					else{
						var margin = (ul.style.marginRight)?parseFloat(ul.style.marginRight):0;
						ul.style.marginRight = margin + delta + 'px';
					}
					if(iter < time) setTimeout(func,10);
				};
				func();
			  }
			</script>
			{/literal}
			<div class="profile_info">	
				<div class="block">
					<h3 class="float_left">{$data.name}</h3>
					{if $wait_activate}
						<span class="status_text float_left" style="margin: 2px 10px"><a href="account.php" style="cursor:pointer;" class="status_text">{$lang.status.activate}</a></span>
					{else}
						<span class="status_link float_left" style="margin: 2px 10px">{$lang.status.on}</span>
					{/if}
				</div>
				<div class="block">
					<div style="width: 300px" class="float_left">
						<p>{$data.age} {$lang.profile.years}</p>
						<p class="text_red">
							{if $data.city}
								{if $data.seo_city}<a href="{$site_root}/{$seo.main_location}-{$data.seo_city}">{/if}
								{$data.city},
								{if $data.seo_city}</a>{/if}
							{/if}
							{if $data.region}{$data.region}, {/if}{$data.country}
						</p>
					</div>
					<div class="completion">
						<p class="text_hidden">{$lang.homepage.completion}:</p>
						<div class="line_main">
							<div class="line_filled" style="width:{$data.complete}%;">
								&nbsp;
							</div>
							
						</div>
						<p>&nbsp;{$data.complete}%</p>
					</div>
				</div>
				<div class="block photos">
					{section loop=$data.main_thumb_photo_path name=c max=6}
						<a class="imgcanvas_container" style="text-decoration: none;" href="#" onclick="launchWindow('{$site_root}/{$seo.myprofile}','sel=start_slide&id_item={$data.main_thumb_photo_path[c].id_album}&id_subitem={$data.main_thumb_photo_path[c].id}&type=f',800,550); return false;">
							<img src="{$data.main_thumb_photo_path[c].path}?rand={math equation='rand()'}" class="imgcanvas">
						</a>
					{/section}
				</div>
				<div class="profile_buttons p-b5">
					<a class="edit-icon icon_bet" onclick="javascript:location.href='{$menu.edit_profile}';" title="{$lang.button.gr_profile}">&nbsp;</a>
					{if $settings.use_lift_up_in_search_service}
					<a class="lift-up-icon icon_bet" onclick="javascript:location.href='{$menu.lift_up}';" title="{$lang.profile.lift_up}">&nbsp;</a>
					{/if}
					{if ($use_pilot_module_blog)}
					<a class="blog-icon icon_bet" onclick="javascript:location.href='{$menu.blog}';" title="{$lang.blog.blog_menu_1}">&nbsp;</a>
					{/if}
					{if $voipcall_feature && $data.webrecorder_player}
						<a href="#" alt="{$lang.recorder.view_record}" title="{$lang.recorder.view_record}" class="video-icon icon_bet" onclick="javascript: window.open('{$data.webrecorder_player}','video_view','menubar=0, resizable=1, scrollbars=0,status=0,toolbar=0, width=340,height=280');return false;">&nbsp;</a>
					{/if}
					{if $data.webrecorder_recorder}
					   <a href="#" alt="{$lang.recorder.save_record}" title="{$lang.recorder.save_record}" class="recorder icon_bet" onclick="javascript: window.open('{$data.webrecorder_recorder}','video_view','menubar=0, resizable=1, scrollbars=0,status=0,toolbar=0, width=340,height=280');return false;">&nbsp;</a>
					{/if}
					<a class="print-icon icon_bet" alt="{$lang.profile.print_version}" title="{$lang.profile.print_version}" href="#" onclick="javascript: window.open('{$data.print_link}','{$data.login}','menubar=0, resizable=1, scrollbars=1,status=0,toolbar=0, width=800,height=600');return false;">&nbsp;</a>
					{if $settings.use_hide_profile_feature}
						<a href="{$data.switch_link}" title="{$data.info_switch}" class="icon_bet {if $data.status}hide{else}show{/if}-profile-icon">&nbsp;</a>
						{*<p>{$data.info_switch_comment}</p>*}
					{/if}
				</div>
				{*
				<a href="#" onclick="javascript: if (window.confirm('{$lang.profile.info_delete_confirm|escape:javascript}')) document.location='{$data.delete_link}'; else return false;">{$lang.profile.info_delete}</a>
				*}
				
			</div>
		</div>
	</div>
	{/if}
	<!-- main tabs -->
	<div class="main_tabs" name="main_tabs">
		{if $org_home[6] == 'true'}
		<div id="menu5" class="tab_block first {if $form.page eq '5'} active{/if}">
			<a href="#" onclick="javascript: ShowTab(5,'{$menu.5}'); return false;">{$lang.section.wall}</a>
		</div>
		{/if}
		{if $org_home[7] == 'true'}
		<div id="menu1" class="tab_block {if $form.page eq '1'} active{/if} {if $org_home[6] == 'false'}first{/if}">
			<a href="#" onclick="javascript: ShowTab(1,'{$menu.1}');return false;">{$lang.section.description}</a>
		</div>
		{/if}
		{if $org_home[8] == 'true'}{**}
		<div id="menu4" class="tab_block {if $form.page eq '4'}active{/if} {if $org_home[6] == 'false' && $org_home[7] == 'false'}first{/if}">
			<a href="#" onclick="javascript: ShowTab(4,'{$menu.4}');  return false;">{$lang.section.photo_album}</a>
		</div>
		{/if}
	</div>
	<!-- end main tabs -->
	
	<div class="profile_general_table">
		<div style=" margin: 0px">
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
		<tr>
			<td><div id="tab_div">
                {if $form.page eq '1'}
					{if $org_home[7] == 'true'}
						{include file="$gentemplates/myprofile_view_new.tpl"}
					{/if}
                {else}
					{include file="$gentemplates/myprofile_view.tpl"}
                {/if}
			</div></td>
		</tr>
		</table>
		</div>
		<!-- end profile tables -->
		<div>
	</div>
<script language="JavaScript" type="text/javascript">
	{if $first}
	{literal}
		launchWindow(SITE_ROOT+"/backend.php",'sel=invite_friends',650,240,1);
	{/literal}
	{/if}
</script>	
<script type="text/javascript">
{literal}
$(document).ready(function() {
var sel = '{/literal}{$save_9}{literal}';
var upload_type = '{/literal}{$upload_type}{literal}';
var id_item = '{/literal}{$id_item}{literal}';
var id_subitem = '{/literal}{$id_subitem}{literal}';
var err = '{/literal}{$form.err|escape:javascript}{literal}';
if (sel=='1' && err=='' && upload_type=='f'){
	//launchWindow(SITE_ROOT+'/myprofile.php','sel=start_slide&id_item='+id_item+'&type=f&id_subitem='+id_subitem,800,550);
}
});
{/literal}
</script>
{literal}
<script type="text/javascript">
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');
	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;
}

var delete_progress = 0;
var submit_html;
function SubmitComment(obj){
	if($('#message').val() == '' || $('#message').val() == undefined){
		return;
	}
	submit_html = $('#submit_comment').html();
	$('#submit_comment').html('<img border=0 src="{/literal}{$site_root}{$template_root}{$template_images_root}/ajax_loader.gif{literal}">');

	$.ajax({
		type: 'POST',
		url: SEO_SITE_ROOT + '/myprofile.php',
		data: {'sel': 'add_owner_comment', 'message': $('#message').val()},
		success: function(msg){
			if(msg != "error"){
				$('#submit_comment').html(submit_html);
				$('#message').val('');
				$('#comments_area').prepend(msg);
			}
			else{
				$('#submit_comment').html(submit_html);
				var error_message = '{/literal}{$lang.err.info_finding_1|escape:javascript}{literal}';
				alert(error_message);
			}
		}
	});
}

function displaySmileLayer(id)
{
	if (document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = 'inline-block';
	} else {
		document.getElementById(id).style.display = 'none';
	}
	return false;
}

function DeleteOwnerComment(obj, comment_id){
	var delete_alert = '{/literal}{$lang.err.comment_delete_confirm|escape:javascript}{literal}';
	if(delete_alert != ''){
		if(!confirm(delete_alert)){
			return;
		}
	}

	if(delete_progress == 0){
		delete_progress = 1;
	}else{
		return;
	}
	if(comment_id == undefined || comment_id == 0 || obj == undefined){
		return;
	}
	
	$(obj).html('<img border=0 src="{/literal}{$site_root}{$template_root}{$template_images_root}/ajax_loader.gif{literal}">');
	$(obj).blur();
	$.ajax({
		type: 'POST',
		url: SEO_SITE_ROOT + '/myprofile.php',
		data: {'sel':'delete_owner_comment', 'comment_id':comment_id},
		success: function(msg){
			if(msg != 'ERROR'){
				delete_progress = 0;
				$(obj).closest('.comment_wrapper').remove();
			}
			else{
				delete_progress = 0;
				var del_comment = '{/literal}{$lang.err.comment_cant_del|escape:javascript}{literal}';

				$(obj).html('[{/literal}{$lang.button.delete|escape:html}{literal}]');
				if(del_comment != ''){
					alert(del_comment);
				}
			}
		}
	});
}
function DeleteUploadComment(obj, comment_id){
	var delete_alert = '{/literal}{$lang.err.comment_delete_confirm|escape:javascript}{literal}';
	if(delete_alert != ''){
		if(!confirm(delete_alert)){
			return;
		}
	}

	if(delete_progress == 0){
		delete_progress = 1;
	}else{
		return;
	}
	if(comment_id == undefined || comment_id == 0 || obj == undefined){
		return;
	}
	
	$(obj).html('<img border=0 src="{/literal}{$site_root}{$template_root}{$template_images_root}/ajax_loader.gif{literal}">');
	$(obj).blur();
	$.ajax({
		type: 'POST',
		url: SEO_SITE_ROOT + '/myprofile.php',
		data: {'sel':'delete_upload_comment', 'comment_id':comment_id},
		success: function(msg){
			if(msg != 'ERROR'){
				delete_progress = 0;
				$(obj).closest('.comment_upload').remove();
			}
			else{
				delete_progress = 0;
				var del_comment = '{/literal}{$lang.err.comment_cant_del|escape:javascript}{literal}';

				$(obj).html('[{/literal}{$lang.button.delete|escape:html}{literal}]');
				if(del_comment != ''){
					alert(del_comment);
				}
			}
		}
	});
}

function ShowUploadForm(par) {
	if (par == 'f') {
		if (document.getElementById('upload_photo_form').style.display == 'none') {
			document.getElementById('upload_photo_form').style.display = 'inline';
		} else {
			document.getElementById('upload_photo_form').style.display = 'none';
		}
	} else if (par == 'a') {
		if (document.getElementById('upload_audio_form').style.display == 'none') {
			document.getElementById('upload_audio_form').style.display = 'inline';
		} else {
			document.getElementById('upload_audio_form').style.display = 'none';
		}
	} else if (par == 'v') {
		if (document.getElementById('upload_video_form').style.display == 'none') {
			document.getElementById('upload_video_form').style.display = 'inline';
		} else {
			document.getElementById('upload_video_form').style.display = 'none';
		}
	}
	document.getElementById('focus_field').focus();
	return;
}
function ShowHideCategories(param, id_value) {
	if (document.getElementById('categories_div'+param+id_value).style.display == 'none') {
		document.getElementById('categories_div'+param+id_value).style.display = 'inline';
	} else {
		document.getElementById('categories_div'+param+id_value).style.display = 'none';
	}
	return;
}
function textchange_2() {
	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");
	}
}
function DeleteUpload(link, par){
	$.post(link+"&ajax=1", function(data){
        $("#"+par).html(data);
		$("#"+par).hide();
    })
}
</script>
{/literal}
 		{* {if $banner.right}<div style="float: left;">{$banner.right}</div>{/if}	*}
{include file="$gentemplates/$footer_tpl"}