window.addEvent('domready',function() {
    	new SmoothScroll({duration:250});
    	var a = $('gantry-totop');
    	if (a) {
        	var b = new Fx.Scroll(window);
        	a.setStyle('outline', 'none').addEvent('click', function (e) {
            new Event(e).stop();
            b.toTop()
        	})
    	}
    	var go = $('gototop');
    	go.set('opacity','0').setStyle('display','block');
    	window.addEvent('scroll',function(e) {
    		if(Browser.Engine.trident4) {
    			go.setStyles({
    				'position': 'absolute',
    				'bottom': window.getPosition().y + 10,
    				'width': 100
    			});
    		}
    		go.fade((window.getScroll().y > 300) ? 'in' : 'out')
    	});    	
});
