Its nice to see you had the interest in playing with this sort of thing. Even though is quite simple yet, it simulates the end results quite well.
Currently its not usable for a production environment as other scripts, such as jCrop or many others, but you can try to improve it and make a real script.