function CenterImage(id) {
        if (document && document.getElementById) {
                var windowHeight = 0;
                var windowWidth = 0;
                if (document.body && document.body.clientHeight) {
                        windowHeight = document.body.clientHeight;
                        windowWidth = document.body.clientWidth;
                } else if (document.documentElement && document.documentElement.clientHeight) {
                        windowHeight = document.documentElement.clientHeight;
                        windowWidth = document.documentElement.clientWidth;
                } else if (window && window.innerHeight) {
                        windowHeight = window.innerHeight;
                        windowWidth = window.innerWidth;
                }
		var image = document.getElementById(id);
		if (image) {
                        var imageHeight = image.offsetHeight;
                        var imageWidth = image.offsetHeight;
                        var imageVPos = image.style.left;
                        var imageHPos = image.style.top;
			if (windowHeight && imageHeight && (windowHeight > imageHeight))
				imageVPos = ((windowHeight-imageHeight)/2)|0;
			if (windowWidth && imageWidth && (windowWidth > imageWidth))
				imageHPos = ((windowWidth-imageWidth)/2)|0;
			if (imageHPos && imageVPos) {
				image.style.position = 'absolute';
				image.style.left = imageHPos;
				image.style.top = imageVPos;
                        }
                }
        }
}
