window.addEvent('domready', function(){
			var scroll2 = new Scroller('content1', {area: 80, velocity: 0.4});			
			// Mousemove
			$('content1').addEvent('mouseover', scroll2.start.bind(scroll2));
			$('content1').addEvent('mouseout', scroll2.stop.bind(scroll2));
		}); 
window.addEvent('domready', function(){
			var scroll2 = new Scroller('content2', {area: 80, velocity: 0.4});			
			// Mousemove
			$('content2').addEvent('mouseover', scroll2.start.bind(scroll2));
			$('content2').addEvent('mouseout', scroll2.stop.bind(scroll2));
		}); 
window.addEvent('domready', function(){
			var scroll2 = new Scroller('content3', {area: 80, velocity: 0.4});			
			// Mousemove
			$('content3').addEvent('mouseover', scroll2.start.bind(scroll2));
			$('content3').addEvent('mouseout', scroll2.stop.bind(scroll2));
		}); 
window.addEvent('domready', function(){
			var scroll2 = new Scroller('content4', {area: 80, velocity: 0.4});			
			// Mousemove
			$('content4').addEvent('mouseover', scroll2.start.bind(scroll2));
			$('content4').addEvent('mouseout', scroll2.stop.bind(scroll2));
		}); 
window.addEvent('domready', function(){
			var scroll2 = new Scroller('content6', {area: 80, velocity: 0.4});			
			// Mousemove
			$('content6').addEvent('mouseover', scroll2.start.bind(scroll2));
			$('content6').addEvent('mouseout', scroll2.stop.bind(scroll2));
		}); 
window.addEvent('domready', function(){
			var scroll2 = new Scroller('content7', {area: 80, velocity: 0.4});			
			// Mousemove
			$('content7').addEvent('mouseover', scroll2.start.bind(scroll2));
			$('content7').addEvent('mouseout', scroll2.stop.bind(scroll2));
		}); 

window.addEvent('domready', function(){
var scroll = new Fx.Scroll('content', {
wait: false,
duration: 1200,
offset: {'x': 0, 'y': 0},
transition: Fx.Transitions.Quad.easeInOut
});
$('link1').addEvent('click', function(event) { event = new Event(event).stop(); scroll.toElement('content1'); });
$('link2').addEvent('click', function(event) { event = new Event(event).stop(); scroll.toElement('content2'); });
$('link3').addEvent('click', function(event) { event = new Event(event).stop(); scroll.toElement('content3'); });
$('link4').addEvent('click', function(event) { event = new Event(event).stop(); scroll.toElement('content4'); });
$('link6').addEvent('click', function(event) { event = new Event(event).stop(); scroll.toElement('content6'); });
$('link7').addEvent('click', function(event) { event = new Event(event).stop(); scroll.toElement('content7'); });
}); 

window.addEvent('domready', function(){
var scroll = new Fx.Scroll('treasure', {
wait: false,
duration: 1400,
offset: {'x': 0, 'y': 0},
transition: Fx.Transitions.Quad.easeInOut
});
$('link5').addEvent('click', function(event) { event = new Event(event).stop(); scroll.toElement('content5'); });
});

            var visibleDiv = $("div1");
            function toggle(newSrc){
                if($("div1").fx){$("div1").fx.stop();}
                if($("div2").fx){$("div2").fx.stop();}
                if(visibleDiv == $("div1")){
                    $("image2").src = newSrc;
                    $("div1").fx = new Fx.Style($("div1"), 'opacity', {duration: 2000}).start(0);
                    $("div2").fx = new Fx.Style($("div2"), 'opacity', {duration: 2000}).start(1);
                    visibleDiv = $("div2");
                }else{
                    $("image1").src = newSrc;
                    $("div1").fx = new Fx.Style($("div1"), 'opacity', {duration: 2000}).start(1);
                    $("div2").fx = new Fx.Style($("div2"), 'opacity', {duration: 2000}).start(0);
                    visibleDiv = $("div1");
                }
            }
            function loadImages(buttonsAndImages){
                for(biPairKey in buttonsAndImages) {
                    var image = new Element('img',{ src:buttonsAndImages[biPairKey], style:'margin:3px;' });
                    $(biPairKey).image = image;
                }
            }
            function faderInit(){
                //create an object to store the relationship of the buttons to the images.
                var buttonsAndImages = {'button1':'images/bg-guild.jpg','button2':'images/maps/map-2.jpg','button3':'image3.jpg','button4':'image4.jpg'};
                loadImages(buttonsAndImages);
            }
            window.addEvent("domready", faderInit);
