function centerDiv(o) {

	// request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;

	var wrapperHeight = $(o).height();
	var wrapperWidth = $(o).width();

	if ((navigator.appVersion).indexOf("MSIE") == -1) {
		// centering
		$(o).css( {
			"position" : "relative",
			"top" : (windowHeight / 2 - wrapperHeight / 2)
		});
	} else {
		// centering
		$(o).css( {
			"position" : "relative",
			"left" : (windowWidth / 2 - wrapperWidth / 2)
		});
	}
}

function centerVarDiv(o) {

	// request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;

	var wrapperHeight = $(o).height();
	var wrapperWidth = $(o).width();

	if ((navigator.appVersion).indexOf("MSIE") == -1) {
		// centering
		
		var dim = (windowWidth / 2 - wrapperWidth / 2);
		$("#bar_left").css( {
			"height" : "570px",
			"width" : dim,
			"position" : "absolute",
			"left" : "0px"
		});
		var space = $("#bar_left").width();
		
		$("#wrapper").css( {
			"position" : "absolute",
			"left" : space-1
			
		});
		var space = $("#bar_left").width() + $("#wrapper").width();
		
		$("#bar_right").css( {
			"height" : "570px",
			"width" : dim+1,
			"position" : "absolute",
			"left" : space-1
		});
	} else {
// centering
		
		var dim = (windowWidth / 2 - wrapperWidth / 2);
		$("#bar_left").css( {
			"height" : "570px",
			"width" : dim,
			"position" : "absolute",
			"left" : "0px"
		});
		var space = $("#bar_left").width();
		
		$("#wrapper").css( {
			"position" : "absolute",
			"left" : space-1
			
		});
		var space = $("#bar_left").width() + $("#wrapper").width();
		
		$("#bar_right").css( {
			"height" : "570px",
			"width" : dim+1,
			"position" : "absolute",
			"left" : space-1
		});
	}
}

$(document).ready(function(){
		centerVarDiv("#wrapper");
});

$(window).resize(function(){
	centerVarDiv("#wrapper");
});
