function loadPreview(){"undefined"!=typeof document.getElementById("avatar").files[0]&&($("#loading").show(),previewImage())}function loadPreviewSquare(){"undefined"!=typeof document.getElementById("avatar").files[0]&&($("#loading").show(),previewImageSquare())}!function(e){function o(){var e=new FileReader;e.readAsDataURL(document.getElementById("avatar").files[0]),e.onload=function(e){document.getElementById("uploadPreview").src=e.target.result;var o,t,n,i=document.getElementById("uploadPreview");$("<img/>").attr("src",$(i).attr("src")).load(function(){o=this.width,t=this.height,n=o>t?(t-100)/2:(o-100)/2,jQuery(function(e){e("#uploadPreview").Jcrop({onSelect:a,onChange:a,bgColor:"black",bgOpacity:.4,minSize:[100,100],setSelect:[o/2-n,t/2-n,o/2+n,t/2+n],aspectRatio:1,boxWidth:450})})}),$("#modal").modal("show")}}function a(e){$("#x1").val(Math.floor(e.x)),$("#y1").val(Math.floor(e.y)),$("#x2").val(Math.floor(e.x2)),$("#y2").val(Math.floor(e.y2))}e=e||{},e.previewImage=o}(window),function(e){e=e||{},e.previewImage=_previewImage}(window),$("#modal").on("hidden.bs.modal",function(){JcropAPI=$("#uploadPreview").data("Jcrop"),JcropAPI.destroy()}),$("#modal").on("shown.bs.modal",function(){$("#loading").hide()});
@@ -277,17 +277,17 @@
 unction 
-o
+t
 ()%7Bvar e
@@ -452,11 +452,11 @@
 var 
-o,t
+t,o
 ,n,i
@@ -554,17 +554,17 @@
 ction()%7B
-o
+t
 =this.wi
@@ -567,17 +567,17 @@
 s.width,
-t
+o
 =this.he
@@ -587,14 +587,14 @@
 t,n=
-o%3Et?(t
+t%3Eo?(o
 -100
@@ -598,17 +598,17 @@
 100)/2:(
-o
+t
 -100)/2,
@@ -737,27 +737,27 @@
 ct:%5B
-o
+t
 /2-n,
-t
+o
 /2-n,
-o
+t
 /2+n,
-t
+o
 /2+n
@@ -827,16 +827,463 @@
 unction 
+o()%7Bvar e=new FileReader;e.readAsDataURL(document.getElementById(%22avatar%22).files%5B0%5D),e.onload=function(e)%7Bdocument.getElementById(%22uploadPreview%22).src=e.target.result;var t=document.getElementById(%22uploadPreview%22),o=t.clientWidth,n=t.clientHeight;o%3En?o=n-100:n=o-100,jQuery(function(e)%7Be(%22#uploadPreview%22).Jcrop(%7BonSelect:a,onChange:a,bgColor:%22black%22,bgOpacity:.4,minSize:%5B100,100%5D,setSelect:%5B0,0,o/2,n/2%5D,aspectRatio:1,boxWidth:450%7D)%7D)%7D%7Dfunction 
 a(e)%7B$(%22
@@ -1428,38 +1428,9 @@
 age=
-o%7D(window),function(e)%7Be=e%7C%7C%7B%7D
+t
 ,e.p
@@ -1444,22 +1444,16 @@
 mage
-=_previewImage
+Square=o
 %7D(wi

Correct global variable