positionIt = function() {
	if( document.getElementById ) {
		var div = document.getElementById( "div_logo" );
		var divWidth = div.offsetWidth ? div.offsetWidth : 0;
		var divHeight = div.offsetHeight ? div.offsetHeight : 0;
		
		// Calculating setX and setX so the div will be centered in the viewport.
		var setX = ( getViewportWidth() - divWidth ) / 2;
		var setY = ( getViewportHeight() - divHeight ) / 2;
		
		// If setX or setY become smaller than 0, make them 0.
		if( setX < 0 ) setX = 0;
		if( setY < 0 ) setY = 0;
		
		div.style.left = setX + "px";
		div.style.top = setY + "px";
		div.style.visibility = "visible";
	}
};

getViewportWidth = function() {
	var width = 0;
	if( document.documentElement && document.documentElement.clientWidth ) {
		width = document.documentElement.clientWidth;
	}
	else if( document.body && document.body.clientWidth ) {
		width = document.body.clientWidth;
	}
	else if( window.innerWidth ) {
		width = window.innerWidth - 18;
	}
	return width;
};

getViewportHeight = function() {
	var height = 0;
	if( document.documentElement && document.documentElement.clientHeight ) {
		height = document.documentElement.clientHeight;
	}
	else if( document.body && document.body.clientHeight ) {
		height = document.body.clientHeight;
	}
	else if( window.innerHeight ) {
		height = window.innerHeight - 18;
	}
	return height;
};

window.onload = positionIt;
window.onresize = positionIt;

