$(document).ready(function() {
	ezCufon('#MainNavigation > li > a', true, false);
	if (backend !== true) {
		ezCufon('h1, #RightColumn > div > h2, #CenterColumn h2', false, true);
	}
});

function ezCufon(selector, hover, trim) {
	if (trim) {
		$(selector).each(function(){
			var el = $(this);
			el.html($.trim(el.html()));
			el.find('> a').each(function() {
				var el = $(this);
				el.html($.trim(el.html()));
			})
		});
	}
	Cufon.replace(selector, {'hover': hover});
} 

$(document).ready(function() {
	fixHeight();
	window.setTimeout(fixHeight, 1000);
	window.setTimeout(fixHeight, 5000);
	$(window).resize(fixHeight);
});

function fixHeight() {
	var containerHeight = $('#OuterContainer').outerHeight();
	var windowHeight;
	if (typeof(window.innerWidth) == 'number') {
		windowHeight = window.innerHeight;
	} else if (document.documentElement && (document.documentElement.clientWidth
			|| document.documentElement.clientHeight)) {
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
		windowHeight = document.body.clientHeight;
	}
	if (containerHeight < windowHeight) {
		$('#Container').css('height', windowHeight+'px');
	}
}

