<script type="text/javascript">
$(document).ready(function(){
	Xajax = new AjaxUpload('upload', {
		action: '/index.php?go=editprofile&act=upload',
		name: 'uploadfile',
		onSubmit: function (file, ext) {
		if (!(ext && /^(jpg|png|jpeg|gif|jpe)$/.test(ext))) {
			$('.red_error').show().html(lang_bad_format);
			butloading('upload', '113', 'enabled', '{translate=lang_170}');
		}
		},
		onComplete: function (file, response) {
			if(response == 'bad_format'){
				$('.red_error').show().text(lang_bad_format);
				butloading('upload', '113', 'enabled', '{translate=lang_170}');}
			else if(response == 'big_size'){
				$('.red_error').show().html(lang_bad_size);
				butloading('upload', '113', 'enabled', '{translate=lang_170}');}
			else if(response == 'bad'){
				$('.red_error').show().text(lang_bad_aaa);
				butloading('upload', '113', 'enabled', '{translate=lang_170}');}
			else {
				Box.Close('photo');
				$('#avatar_no').hide();
				$('#avatar_yes').show().html('<img src="'+response+'" />');
				$('#top_ava_50').html('<img src="'+response+'" class="top_head_user_ava" width="35px;" />');
				$('#wall_mini_avatar').html('<img src="'+response+'" class="profile_wall_mini_ava" />');
				$('#top_ava_100').html('<img src="'+response+'" width="100px;" />');
				$('body, html').animate({scrollTop: 0}, 250);
				$('#avatar_delete_button').show();
			}
		}
	});
});
</script>

<div style="padding:10px;" align="center">
  <div class="red_error" style="display:none;"></div>
  <div class="clear" style="height:10px;"></div>
  <div class="load_photo_quote">{translate=lang_171}</div>
  <div class="clear" style="height:10px;"></div>
  <button id="upload">{translate=lang_170}</button>
  <div class="clear" style="height:10px;"></div>
  <small>{translate=lang_172}</small>
</div>
