	
	var hoverSpeed = 300;
	var buttonDelay = 1000;
	var codeBuilderSpeed = 500;

	var	currentDownloadButton = 1;
	var buttonDownloadTimer;
	
	window.addEvent('domready',initInstallations);

	function initInstallations()
	{
		initScroller();
		initThumbnails();
		initWindow();
		initWindowTriple();
	}

	function initScroller()
	{
		var slider = new Slider($('scrollBar'), $('scrollBarButton'), {steps:$('scrollableContent').getSize().y-$('scrollable').getSize().y, mode:'vertical', onChange:
			function(pos)
			{
				$('scrollableContent').setStyle('top',0-pos);
			}
		});																																		
	}
	
	function initThumbnails()
	{
		$$('.installationThumbnail').each(
			function(el)
			{
				el.addEvent('mouseenter', function(){this.addClass('hover')});	
				el.addEvent('mouseleave', function(){this.removeClass('hover')});	
			}
		);	
	}
	
	function initWindow()
	{
		$('installationWindow').set({'morph':{duration:codeBuilderSpeed*2, transition:Fx.Transitions.Pow.easeOut}});
		$('installationWindowClose').addEvent('mouseenter',function(){$('installationWindowCloseHover').set({'opacity':1});});
		$('installationWindowClose').addEvent('mouseleave',function(){$('installationWindowCloseHover').set({'opacity':0});});
		
		$('installationWindowCloseHover').set({'opacity':0});
		$('installationWindowCloseHover').addEvent('click',function(){hideWindow()});

	}

	function initWindowTriple()
	{
		$('installationWindowTriple').set({'morph':{duration:codeBuilderSpeed*2, transition:Fx.Transitions.Pow.easeOut}});
		$('installationWindowTripleClose').addEvent('mouseenter',function(){$('installationWindowTripleCloseHover').set({'opacity':1});});
		$('installationWindowTripleClose').addEvent('mouseleave',function(){$('installationWindowTripleCloseHover').set({'opacity':0});});
		
		$('installationWindowTripleCloseHover').set({'opacity':0});
		$('installationWindowTripleCloseHover').addEvent('click',function(){hideWindowTriple()});

	}

	function showWindow(id)
	{
		el=$('installation'+id);
		$('installationPhoto').getChildren().each(function(el){el.destroy()});
		var imgPhoto= new Asset.image('images/thumbnail.ashx?name=installations/installation'+id+'.jpg&width=430&height=305&back=ffffff', {onload: 
		function()
			{
				$('installationPhoto').adopt(imgPhoto);	
			}
		});				

		$('installationTitle').innerHTML=el.getChildren()[2].innerHTML;
		$('installationDetails').innerHTML=el.getChildren()[3].innerHTML;
		$('installationWindow').morph({'top':-700});	
	}
	
	function showWindowTriple(id)
	{
		el=$('installation'+id);
		$('installationPhotoTriple').getChildren().each(function(el){el.destroy()});
		var imgPhoto= new Asset.image('images/thumbnail.ashx?name=installations/installation'+id+'.jpg&width=820&height=210&back=ffffff', {onload: 
		function()
			{
				$('installationPhotoTriple').adopt(imgPhoto);	
			}
		});				

		$('installationTitleTriple').innerHTML=el.getChildren()[2].innerHTML;
		$('installationDetailsTriple').innerHTML=el.getChildren()[3].innerHTML;
		$('installationWindowTriple').morph({'top':-1200});	
	}
	

	function hideWindow()
	{
		$('installationWindow').morph({'top':-1400});
	}
	
	function hideWindowTriple()
	{
		$('installationWindowTriple').morph({'top':-2000});
	}