var timer_id;

function scroll_iframe(frm, inc, dir) {
	if (timer_id) clearTimeout(timer_id);
	if (window.frames[0]) {
		if (dir == "v") {
			window.frames[0].scrollBy(0, inc);
		} else {
			window.frames[0].scrollBy(inc, 0);
		}
		timer_id = setTimeout("scroll_iframe('" + 0 + "'," + inc + ",'" + dir + "')", 20);
	}
}

function stopScroll() { if (timer_id) clearTimeout(timer_id); }


function showImg(imgurl, counter) {
	var width = document.getElementById('thumbsFrame').contentWindow.document.getElementById('Image'+counter).width;
	var height = document.getElementById('thumbsFrame').contentWindow.document.getElementById('Image'+counter).height;

	if (height >= 320) {
		document.getElementById('ExpansionPhoto').height = 320;
		var resizeWidth = (320*width)/height;
		document.getElementById('ExpansionPhoto').width = resizeWidth;
	} else {
		document.getElementById('ExpansionPhoto').height = (height*484)/416;
		document.getElementById('ExpansionPhoto').width = 484;
	}
	
	document.getElementById('ExpansionPhoto').src = imgurl;
}
