var clone;
function swapImage(img_name, img_src, width, height) {
	if (img_src == '') {
		if (clone) {
			var o = document.getElementById(img_name);
			o.parentNode.replaceChild(clone, o);
		}
	} else {
		var el = document.getElementById(img_name);
		if (el) {
			clone = el.cloneNode(1);
			if (img_src.indexOf('jpg') > 0 || img_src.indexOf('gif') > 0) {
				el.src = img_src;
			}
			if (width > 0) {
				el.width = width;
			}
			if (height > 0) {
				el.height = height;
			}
		}
	}
}
