/*
	Projekt
*/
init = function() {
	//Home
	if ($(document.body).hasClass('home')) {
		fireDaScript = function(){
			Mediabox.open('../../terminatorsalvation.mp4', '', '640 272');
		};
		
		if(Browser.Plugins.Flash.version > 7){
			var theStageIsFlash = new Swiff('a/f/wonderland_home.swf', {
				id: 'theStageIsFlash',
				width: 980,
				height: 400,
				params: {
					wmode: 'transparent',
					bgcolor: '#000000',
					quality: 'high'
				}
			}).inject($('stage'));
		}else{
			var theStageIsIMG = new Element('img',{
				'src': 'a/i/wonderland_home_main_static.jpg',
				'styles': {
					'width': 980,
					'height': 400
				}
			}).inject(new Element('a',{
				'href':'http://www.terminatorsalvation.com',
				'target':'_blank'
			}).inject($('stage')));
		}

		var email = $('yuujut-yuujut');
		if(email){
			var emailLabel = email.getPrevious('label').get('text');
			if(email.get('value') != '' || email.get('value') != emailLabel){
				email.set('value',emailLabel);
				email.addEvents({
					click: function(){ if(email.get('value') == emailLabel){ email.set('value',''); } },
					blur: function(){ if(email.get('value') == ''){ email.set('value',emailLabel); } }
				})
			}
		}
		var mediaCSS = new Asset.css('a/c/mediaboxAdvBlack.css');
	}
	
	//About Us
	if($(document.body).hasClass('about')){
		var people = $('people').getChildren('li');
		var categories = $('content').getChildren('li');

		var portfolioAcc = new Accordion(people, categories, {
			'show': 0,
			'opacity':true,
			onActive: function(toggler, element){
				toggler.addClass('active');
			},
			onBackground: function(toggler, element){
				toggler.removeClass('active');
			}
		});
	}
	
	//Contact
	if($(document.body).hasClass('contact')){
		$$('.tel').each(function(el){
			new Element('div',{'class': 'tel js'})
			.adopt(
				new Element('span',{'text': 'Phone ','class': 'label'}),
				new Element('span',{'text': el.get('text')}))
			.replaces(el)
		})
		
		$$('.fax').each(function(el){
			new Element('div',{'class': 'fax js'})
			.adopt(
				new Element('span',{'text': 'Fax ','class': 'label'}),
				new Element('span',{'text': el.get('text')}))
			.replaces(el)
		})
		
		$$('.email').each(function(el){
			new Element('a',{'class': 'mail js','href': el.get('href')})
			.adopt(
				new Element('span',{'text': 'Email ','class': 'label'}),
				new Element('span',{'text': el.get('text'),'class':'content'}))
			.replaces(el)
		})
	}
}
