﻿window.addEvent('domready', function() {

$('berlinholder').setStyle("opacity", "0");

var box = $('berlinholder')
var fx = box.effects({duration: 0});
var soles = function(){
fx.start({
'opacity': 0
}).chain(function(){
this.start.delay(5200, this, {
'opacity': 1
});
});
}; 

var scroll = new Fx.Scroll('content', {
wait: false,
duration: 5000,
offset: {'x': 0, 'y': 0},
transition: Fx.Transitions.Quad.easeInOut
});

$('forestlink').addEvent('click', function(event) {
event = new Event(event).stop();
$('forestbutton').setStyle("display", "none");
$('forestbutton2').setStyle("display", "block");
});

$('forestlink2').addEvent('click', function(event) {
event = new Event(event).stop();
var url = "berlin.html";
$('forestbutton2').setStyle("display", "none");
$('forestbutton3').setStyle("display", "block");
new Ajax(url, {
		method: 'get',
		evalScripts: true,
		update: $('berlinholder')
	}).request();
});

$('forestlink3').addEvent('click', function(event) {
event = new Event(event).stop();
scroll.toElement('berlinholder');
$('forest').setStyle("display", "none");
$('branches').setStyle("display", "none");
$('berlinfront').setStyle("display", "block");
$('berlinbutton').setStyle("display", "block");
soles();
});

});

window.addEvent('load', function() {

var scroll = new Fx.Scroll('content', {
wait: false,
duration: 0,
offset: {'x': 0, 'y': 0},
transition: Fx.Transitions.Quad.easeInOut
});

scroll.toElement('forest');

document.getElementById("forestcover").style.display = "none";

});
