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

	// SUBTLE MOVEMENT
	//var movediv = $("contenttext");
	//var moveChange1 = new Fx.Style(movediv, 'margin-left', {duration:750});
	//var moveChange1b = new Fx.Style(movediv, 'margin-left', {duration:250});	
	
	// complex move
	//moveChange1b.start(-20, -30).chain(function() { 
	//		moveChange1.start(-30, 0) 
	//	} );
	// simple move
	//moveChange1.start(-30, 0) 
	
	//var movediv2 = $("menu");
	//var moveChange2 = new Fx.Styles(movediv2, {duration:500, transition: Fx.Transitions.Quart.easeOut});
	//moveChange2.start({
	//    'top': [67, 87],
	//    'left': [40, 56]
	//});	

	//var movediv3 = $("contentphoto");
	//var moveChange3 = new Fx.Style(movediv3, 'margin-left', {duration:750});
	//moveChange3.start(20, 0);
	
	// FADE IN TEXT AND BUTTONS
	var contentdiv = $("contenttext");
	var fadeFx = new Fx.Styles(contentdiv, {duration: 600, wait:false});	
	fadeFx.set({'opacity': 0 });
	fadeFx.start({'opacity': 1});
	
	var contentdiv2 = $("menu");
	var fadeFx2 = new Fx.Styles(contentdiv2, {duration: 400, wait:false});	
	fadeFx2.set({'opacity': 0 });
	fadeFx2.start({'opacity': 1});	
	
	// EVENTS FOR MENU BUTTONS (exclude IE6)
	if (window.ie6 != true) {
		var menuButtons = $$(".rollover");
		menuButtons.each(function(menuButton, i) {
			// prepare buttons
			menuButton.addEvent("mouseenter", function() {
				menuButton.setOpacity(0.4);
				
			});
			menuButton.addEvent("mouseleave", function() {
				menuButton.setOpacity(1);				
			});	
		});
	}
		
	// ENABLE SCROLLBARS WHERE NEEDED
	if ($('textscrollable')) {
		var content = $('textscrollable');
		var scrollbar = $('scrollbar');
		var handle = $('scrollhandle');
		makeScrollbar(content,scrollbar,handle);
	}
	
	
});

// FUNCTIONS
function PreloadImages() {
	new Asset.image('/images/bg_large.jpg');				
}

// FUNCTIONS
function makeScrollbar(content,scrollbar,handle){
	var size = content.getSize().size.y;
	var scrollSize = content.getSize().scrollSize.y;
	var steps = scrollSize - size;
	if (steps > 0) {
			var slider = new Slider(scrollbar, handle, 			{	
				steps: steps,
				mode: 'vertical',
				onChange: function(step){
					// Scrolls the content element in x or y direction.					
					content.scrollTo(0, step);
				}
			}).set(0);
		
			// Scroll the content element when the mousewheel is used within the 
			// content or the scrollbar element.
			$$(content, scrollbar).addEvent('mousewheel', function(e){	
				e = new Event(e).stop();
				var step = slider.step - e.wheel * 30;	
				slider.set(step);					
			});
		
			// Stops the handle dragging process when the mouse leaves the document body.
			$(document.body).addEvent('mouseleave',function(){slider.drag.stop()});
	} else {
			scrollbar.setOpacity(0);
	}
}