window.addEvent('load', function() {
	// for some reason, Safari doesn't like doing this on 'domready'
	initTitleBar();
});

function initTitleBar() {
	if(!window.ie) {
		var title = document.getElementById('title-bar');
		var buttons = document.getElementById('title-bar-buttons');
		var contentPane = document.getElementById('mc-left');

		if(title && buttons && contentPane) {
			var temp = contentPane.offsetWidth - buttons.offsetWidth;
			title.style.width = (temp) + 'px';
		}
	} else {
		var title = document.getElementById('title-bar');
		var buttons = document.getElementById('title-bar-buttons');
		var contentPane = document.getElementById('mc-left');

		if(title && buttons && contentPane) {
			var temp = contentPane.offsetWidth - buttons.offsetWidth;
			title.style.styleFloat = 'left';
			title.style.width = (temp) + 'px';
		}
	}
}

function showSplash() {
	var splash = document.getElementById('splash');
	splash.style.display = "block";
}

function hideSplash() {
	var splash = document.getElementById('splash');
	splash.style.display = "none";
}

function init()  {
   var iBase = TextResizeDetector.addEventListener(onFontResize,null);
}
function onFontResize(e,args) {
	initTitleBar();
}
//id of element to check for and insert control
TextResizeDetector.TARGET_ELEMENT_ID = 'title-bar';
//function to call once TextResizeDetector has init'd
TextResizeDetector.USER_INIT_FUNC = init;