this is writen on my resttime,a useful small javascript,used to scale a pictue