<script type="text/javascript">
var user_id = '{user-id}';
$(document).ready(function(){
	ajaxUpload = new AjaxUpload('upload_cover', {
		action: '/index.php?go=editprofile&act=upload_cover',
		name: 'uploadfile',
		onSubmit: function (file, ext) {
			if(!(ext && /^(jpg|png|jpeg|gif|jpe)$/.test(ext))) {
				addAllErr(lang_bad_format, 3300);
				return false;
			}
			$("#les10_ex2").draggable('destroy');
			$('.cover_loaded_bg').css('cursor', 'default');
			$('.cover_loading').show();
			$('.cover_description').hide();
	},
	onComplete: function (file, row){
		if(row == 1 || row == 2) addAllErr('Max size: 7 МB.', 3300);
		else {
			$('.cover_loading, #upload_cover').hide();
			$('.cover_loaded_bg, #hidden_cancel_button, #hidden_save_button, #hidden_delete_button, .cover_loaded_bg, .cover_description').show();
			$('.cover_loaded_bg').css('cursor', 'move');
			$('.cover_newpos').css('position', 'absolute').css('z-index', '2').show();
			row = row.split('|');
			rheihht = row[1];
			postop = (parseInt(rheihht/2)-100);
			if(rheihht <= 320) postop = 0;
			$('#les10_ex2').css('height', +rheihht+'px').css('top', '-'+postop+'px');
			Cover.Init('/uploads/users/'+row[0], rheihht);
			$('#hidden_edit_button').attr('onClick', 'Cover.Change(\'/uploads/users/'+row[0]+'\', '+rheihht+')');
	}
}
});
});
</script>

<div class="profile_user_info">
  <span id="avatar_no" {display-avatar-no}><img src="{avatar}" /></span>
  <span id="avatar_yes" {display-avatar}><img src="{avatar}" onClick="Photo.Profile('{user-id}', '{large-ava}', ''); return false;" id="avatar_{user-id}" /></span>
  <div class="profile_user_name">{name} {lastname}</div>
  <div class="profile_user_information">[not-all-country]
    <div id="profile_user_information_div"><img src="{theme}/images/spacer.gif" class="profile_user_from_ico" width="12px;" />{translate=lang_54} <span>{city}, {country}</span></div>
    [/not-all-country][not-all-birthday]
    <div id="profile_user_information_div"><img src="{theme}/images/spacer.gif" class="profile_user_birthday_ico" width="12px;" />{translate=lang_55} <span>{birth-day}</span></div>
    [/not-all-birthday]
    [xfgiven_work]
    <div id="profile_user_information_div"><img src="{theme}/images/spacer.gif" class="profile_user_work_ico" width="12px;" />{translate=lang_56} <span>[xfvalue_work]</span></div>
    [/xfgiven_work]
    <div class="clear" style="height:15px;"></div>
    [owner]
    <button onClick="Page.Go('/editprofile'); return false" style="width:130px;" >{translate=lang_57}</button>
    <button onclick="ProfileFunction.Show();" style="width:120px;" class="blue_button">{translate=lang_58}</button>
    [/owner]
    [not-owner]
    <button onClick="Messages.Write({user-id}); return false" style="margin-left:35px;">{translate=lang_59}</button>
    <button onclick="ProfileFunction.Show();" style="padding:0px 5px; width:auto;" class="blue_button"><img src="{theme}/images/spacer.gif" class="profile_button_ico" /></button>
    [/not-owner]
    <div class="profile_function" style="display:none;">
      <div class="usermenu_arrow" style="margin-left:32px; margin-top:-16px;"></div>
      <ul>
        [owner]
        <li onClick="Avatar.Change(); return false">{translate=lang_60}</li>
        <li onClick="Avatar.Delete({user-id}); return false" id="avatar_delete_button" {display-avatar}>{translate=lang_61}</li>
        [/owner]
        [not-owner][blacklist]  [no-friends]
        <li onClick="Friends.Add({user-id}); return false">{translate=lang_62}</li>
        [/no-friends]
        [yes-friends]
        <li onClick="Friends.Delete({user-id}, 1); return false" id="friend_delete_button"><span id="friend_delete_text">{translate=lang_622}</span></li>
        [/yes-friends]
        [no-following]
        <li onClick="Following.Add({user-id}); return false" id="following_button"><span id="text_add_following">{translate=lang_63}</span><img src="/templates/Default/images/loading_mini.gif" id="add_following_load" style="display:none; margin-left:5px;" /></li>
        [/no-following]
        [yes-following]
        <li onClick="Following.Delete({user-id}); return false" id="following_button"><span id="text_add_following">{translate=lang_64}</span><img src="/templates/Default/images/loading_mini.gif" id="add_following_load" style="display:none; margin-left:5px;" /></li>
        [/yes-following][/blacklist]
        [no-favourites]
        <li onClick="Favourites.Add({user-id}); return false" id="add_favourites"><span id="text_add_favourites">{translate=lang_65}</span><img src="/templates/Default/images/loading_mini.gif" id="add_favourites_load" style="display:none; margin-left:5px;" /></li>
        [/no-favourites]
        [yes-favourites]
        <li onClick="Favourites.Delete({user-id}); return false" id="add_favourites"><span id="text_add_favourites">{translate=lang_66}</span><img src="/templates/Default/images/loading_mini.gif" id="add_favourites_load" style="display:none; margin-left:5px;" /></li>
        [/yes-favourites]
        [no-blacklist]
        <li onClick="Blacklist.Add({user-id}); return false" id="add_blacklist_button"><span id="text_add_blacklist">{translate=lang_67}</span><img src="/templates/Default/images/loading_mini.gif" id="add_blacklist_load" style="display:none; margin-left:5px;" /></li>
        [/no-blacklist]
        [yes-blacklist]
        <li onClick="Blacklist.Delete({user-id}, 1); return false" id="add_blacklist_button"><span id="text_add_blacklist">{translate=lang_68}</span><img src="/templates/Default/images/loading_mini.gif" id="add_blacklist_load" style="display:none; margin-left:5px;" /></li>
        [/yes-blacklist][/not-owner]
      </ul>
    </div>
  </div>
</div>
[owner]
<div class="cover_loading no_display"><img src="{theme}/style/img/cover_loading.gif" /></div>
[/owner]
<div class="cover_profile">
  <div class="cover_profile_bg"> [owner]
    <div class="cover_buttons_position" id="cover_no_uploaded">
      <div class="cover_buttons_position_block">
        <div class="cover_add_button" id="hidden_cancel_button" {cover_uploaded} onClick="Cover.Cancel('{cover-pos}')">{translate=lang_69}</div>
        <div class="cover_add_button" id="hidden_delete_button" {cover_uploaded} onClick="Cover.Delete()">{translate=lang_70}</div>
        <div class="cover_add_button" id="hidden_save_button" {cover_uploaded} onClick="Cover.Save()">{translate=lang_71}</div>
        <div class="cover_add_button" id="upload_cover" {cover_upload_button}>{translate=lang_72}</div>
        <div class="cover_add_button" id="hidden_edit_button" {cover_change} onClick="Cover.Change('{cover_image}', '{cover_height}')">{translate=lang_73}</div>
      </div>
      <div class="cover_loaded_bg" {cover_no_uploaded}>
        <div class="cover_description" {cover_uploaded}>{translate=lang_74}</div>
        <div id="les10_ex2" {cover_position}><img src="{cover_image}" width="900" id="cover_img" /></div>
        <div id="cover_restart"></div>
      </div>
    </div>
  </div>
  [/owner]
  [not-owner][cover]
  <div class="cover_all_user"><img src="{cover_image}" width="900" id="cover_img" {cover-param-5} /></div>
  [/cover][/not-owner]
  <div class="clear"></div>
  [blacklist]
  <div class="cover_bottom_menu">
    <ul>
      <li onclick="Page.Go('/wall{user-id}'); return false">{translate=lang_75} <br />
        <span id="c_b_m_items">
        <div id="profile_posts_num">{posts-num}</div>
        </span></li>
      <li onclick="Page.Go('/friends/{user-id}'); return false">{translate=lang_76} <br />
        <span id="c_b_m_items">{friends-num}</span></li>
      <li onclick="Page.Go('/albums/{user-id}'); return false">{translate=lang_77} <br />
        <span id="c_b_m_items">{photos-num}</span></li>
      <li onclick="Page.Go('/videos/{user-id}'); return false">{translate=lang_78} <br />
        <span id="c_b_m_items">{videos-num}</span></li>
      <li onclick="Followers.All({user-id}); return false">{translate=lang_79} <br />
        <span id="c_b_m_items">{followers-num}</span></li>
      <li onclick="Following.All({user-id}, '', {following-num}); return false">{translate=lang_80} <br />
        <span id="c_b_m_items">{following-num}</span></li>
    </ul>
  </div>
  [/blacklist] </div>
[blacklist]
<div class="clear" style="height:25px;"></div>
<div class="float_l" style="width:505px"> [privacy-wall]
  <div class="profile_left">
    <div class="profile_wall" id="wall_tab">
      <div id="wall_mini_avatar"><img src="{mini-avatar}" id="wall_mini_avatar" class="profile_wall_mini_ava" /></div>
      <div id="profile_wall_ava_arrow" class="profile_wall_ava_arrow"></div>
      <textarea class="profile_wall_textarea" placeholder="[owner]{translate=lang_81} {name}?[/owner] [not-owner]{translate=lang_82}[/not-owner]" id="wall_text"></textarea>
      <div class="clear" style="height:10px;"></div>
      <div class="profile_wall_attach_text">{translate=lang_83}</div>
      <div class="profile_wall_attach_variant" onClick="Post.AttachPhoto()" onMouseOver='myhtml.title("photo", "{translate=lang_84}", "wall_attach_")' id="wall_attach_photo">
        <div class="profile_wall_attach_photo_ico float_l" id="wall_attach_link"></div>
        <span class="float_l"><b>{translate=lang_85}</b></span>
      </div>
      <div class="profile_wall_attach_variant" onClick="Post.AttachVideo()" onMouseOver='myhtml.title("video", "{translate=lang_86}", "wall_attach_")' id="wall_attach_video">
        <div class="profile_wall_attach_video_ico float_l" id="wall_attach_link"></div>
        <span class="float_l"><b>{translate=lang_87}</b></span>
      </div>
      <button class="float_r" onClick="Post.Send(); return false" id="wall_send">{translate=lang_88}</button>
      <div id="attach_files" class="profile_post_attach" style="display:none"></div>
      <div class="clear"></div>
      <input id="vaLattach_files" type="hidden" />
      <div class="clear"></div>
    </div>
    <div class="clear"></div>
  </div>
  [/privacy-wall]
  <div class="profile_records" id="wall_records">{records}
    <div class="profile_records_none" {no-records}>{translate=lang_89}</div>
    <span id="wall_all_record"></span>
    <div class="clear"></div>
  </div>
  [wall-link]
  <div onClick="Post.All('{user-id}'); return false" class="profile_records_all" id="wall_l_href">
    <div id="wall_link">{translate=lang_90}</div>
  </div>
  [/wall-link]
  <div class="clear"></div>
</div>
<div class="float_r"> [friends]
  <div class="profile_right">
    <div class="profile_right_top">[owner]{translate=lang_91}[/owner][not-owner]{translate=lang_92}[/not-owner]
      <a href="/friends/{user-id}">{friends-right-num}</a>
    </div>
    <div class="profile_right_content">{friends}</div>
    <div class="clear"></div>
  </div>
  <div class="clear" style="height:25px;"></div>
  [/friends]
  <div class="profile_right">
    <div class="profile_right_top">[owner]{translate=lang_93}[/owner][not-owner]{translate=lang_94}[/not-owner]
      <a href="/albums/{user-id}" onclick="Page.Go(this.href); return false;">{photos-right-num}</a>
    </div>
    <div class="profile_right_photos"> {photos} </div>
    <div class="clear"></div>
  </div>
  <div class="clear" style="height:25px;"></div>
  <div class="profile_right">
    <div class="profile_right_top">[owner]{translate=lang_95}[/owner][not-owner]{translate=lang_96}[/not-owner]
      <a href="/videos/{user-id}">{videos-right-num}</a>
    </div>
    <div class="profile_right_content"> {videos} </div>
    <div class="clear"></div>
  </div>
</div>
<div class="clear"></div>
[/blacklist]
[not-blacklist]
<div class="red_error" style="margin:10px;">{translate=lang_97} <b>{name}</b>, {translate=lang_98}</div>
[/not-blacklist]
<div class="clear" style="height:150px;"></div>
