var h = null;
var image = null;
var index  = null;

var offset = -413;

function initBg() {
	h = document.getElementsByTagName('html')[0];
	image = document.getElementById("bg"); 
	// adjust on first time load
	if (image != null) { 
		index = offset + (h.clientWidth -960) / 2;
		if (index > 0)
			index = 0;
		if (index < offset)
			index = offset;
		image.style.left = index + 'px'; 
		image.style.display = 'block';
		image.style.visibility = 'visible';
	} 
}

onresize = function() {
	if (image != null) { 
		index = offset + (h.clientWidth - 960) / 2 ;
		if (index > 0)
			index = 0;
		if (index < offset)
			index = offset;
		image.style.left = index + 'px'; 
	} 
};



