/**
 * rokUtils - A set of tools for Meridian
 * 
 * @version		1.0
 * 
 * @license		MIT-style license
 * @author		Djamil Legato <djamil [at] djamil.it>
 * @client		Andy Miller @ Rockettheme
 * @copyright	Author
 */

window.addEvent('domready', function() {
	var scrollToTop = $('top-scroll');

	if (scrollToTop) {
		var scroll = new Fx.Scroll(window);
		scrollToTop.setStyle('outline', 'none').addEvent('click', function(e) {
			new Event(e).stop();
			scroll.toTop();
		});
	};

	// Showcase bar hack for IE6
	if (window.ie6) {
		var showcasebar = $$('.showcase-bar'), showcasesurround = $$('.showcase-surround');
		
		if (showcasebar.length && showcasesurround.length) {
			showcasebar = showcasebar[0];
			showcasesurround = showcasesurround[0];
			
			var width = showcasesurround.getSize().size.x;
			showcasebar.setStyle('width', width);
			window.addEvent('resize', function() {
				var width = showcasesurround.getSize().size.x;
				showcasebar.setStyle('width', width);
			});
		}
	}
	
	// Separators hack for IE6
	if (window.ie6) {
		var separators = $('horiz-menu').getElements('.separator');
		if (separators.length) {
			separators.each(function(separator, i) {
				if (separator.hasClass('daddy')) separator.addClass('separator-daddy');
			});
		}
	}
});
