if (typeof WAS == 'undefined') {
	var WAS = {};
}

window.addEvent('domready', function() {
	WAS.boxes = new WASBox();
	WAS.foldOuts = new TeaserFoldOut();
	WAS.smoothScroll = new SmoothScroll({
		duration: 700, 
		transition: Fx.Transitions.Quad.easeInOut
	});
	WAS.smoothScroll.addEvent('scrolledTo', function(link, element) {
		element.highlight();
	});
	
	// auto scroll to element if there's a hash starting with "c" and highlight it
	if (document.location.hash && document.location.hash.substr(1,1) == 'c') {
		if ($chk($(document.location.hash.substr(1)))) {
			var element = $(window.location.hash.substr(1));
			if(element) {
				window.scrollTo(0, 0);
				var scroll = new Fx.Scroll(window, { 
					wait: false, 
					duration: 700, 
					transition: Fx.Transitions.Quad.easeInOut,
					onComplete: function() {
						$(window.location.hash.substr(1)).highlight();
					}
				});
				scroll.toElement(element);
			}
		}
	}
});
