function SetImg(obj){
if(obj.offsetWidth>obj.offsetHeight)
obj.style.width=obj.offsetWidth>=500?"500px":"auto"
else
obj.style.height=obj.offsetHeight>=500?"500px":"auto"
}
