function sotdImg(){
	var sotdData = document.getElementById('sotd-data');
	var sotdImage = document.getElementById('sotd-img');
	sotdImage.style.display='block';
	var tmpImgData = sotdData.getElementsByTagName('img')[0];
	try{
		sotdImage.src = tmpImgData.src;	
		scaleSOTD(sotdImage,285,95);
	} catch(e){
		try{
			sotdImage.style.display = 'none';
		} catch(x){};
	};
};

function scaleSOTD(img,w,h){
	var scaleBy=1, sW = w/img.width, sH = h/img.height, newW, newH;
	scaleBy = ((sW < sH) ? sW : sH);
	newW = scaleBy * img.width;
	newH = scaleBy * img.height;
img.setAttribute('width',newW);
img.setAttribute('height',newH);
	img.width = newW;
	img.height = newH;
};

sotdImg();