window.addEvent ('domready',function () {
	var cornersArr = ['tl','tr','br','bl'];
	$$('.box').each(function (el, index) {
		for (var i = 0; i<cornersArr.length;i++) {
			var corner = new Element('span',{'class':'corner '+ cornersArr[i]});
			corner.inject(el);
		}
	});
	
	if ($('about')) {
		if ($('downloadSc10').getStyle('height') > $('about').getStyle('height')) {
			$('about').setStyle('height',$('downloadSc10').getStyle('height'));	
		} else if ($('downloadSc10').getStyle('height') < $('about').getStyle('height')){
			$('downloadSc10').setStyle('height',$('about').getStyle('height'));	
		}
	}
	if ($('prices')) {
		if ($('stations').getStyle('height') > $('prices').getStyle('height')) {
			$('prices').setStyle('height',$('stations').getStyle('height'));	
		} else if ($('prices').getStyle('height') > $('stations').getStyle('height')) {
			$('stations').setStyle('height',$('prices').getStyle('height'));	
		}
	}

	
	var stepsTest = new GTSteps('#imageList');
	$('stagePrev').addEvent('click', function () {
		stepsTest.showPrev();
	});

	$('stageNext').addEvent('click', function () {
		stepsTest.showNext();
	});
	/*
	if ($('imageStage')) {
		$('stageNext').addEvent('click',function () {
			$$('.mainPos')[0].morph('.prevPos');
			$$('.mainPos img')[0].morph('.prevPos img');
			//$$('.mainPos')[0].toggleClass('prevPos');
			$$('.nextPos')[0].morph('.mainPos');
			$$('.nextPos img')[0].morph('.mainPos img');
			//$$('.nextPos')[0].toggleClass('nextPos');
		});
		$('stagePrev').addEvent('click',function () {
			$$('.prevPos')[0].morph('.mainPos');
			$$('.prevPos img')[0].morph('.mainPos img');
			//$$('.prevPos')[0].toggleClass('mainPos');
			$$('.mainPos')[0].morph('.nextPos');
			$$('.mainPos img')[0].morph('.nextPos img');
			//$$('.mainPos')[0].toggleClass('nextPos');
		});
	}
	*/

	
	$('featureImage').addEvent('click',function () {
		console.log('asdf');
		//(function () {$('featureImage').fade(0.5);}).delay(1000);
		
		var myImage = new Asset.image('/xsl_gamebase/_magic/_sc10/_swiss/imgs/download/dl_button.jpg', {
			id: 'myImage', 
			title: 'myImage',
			onload: function () {
				startTween();
			}
		});

		var el = $('featureImage');
			
		var superEffect = new Fx.Tween(el,{
			duration: 'long', 
			link: 'chain'
		});
		
		var startTween = function () {
			superEffect
				.start('opacity',0)
				.chain(function () {el.getElement('img').dispose(); this.callChain();})
				.chain(function () { myImage.inject($('featureImage'));  this.callChain();})
				.chain(function () { el.fade('in');});
				
				//.chain(function () { $('featureImage').getElement('img').dispose();})
				//.chain(function () { myImage.inject($('featureImage')); console.log('featureImage'); })
				//.chain(function () { $('featureImage').fade('in');})
		}
	});
});
