window.addEvent('domready', function(){

/*
	var list = $$('div.menug','a.menug');
	list.each(function(element) {
	 
		var menu = new Fx.Styles(element, {duration:200, wait:false});
	 
		element.addEvent('mouseenter', function(e){
			e.stop();
			menu.start({
				'margin-top': 5,
				'color': '#f00'
			});
		});
	 
		element.addEvent('mouseleave', function(e){
		e.stop();
		menu.start({
				'margin-top': 0,
				'color': '#000'
			});
		});
	 
	});
*/

if( $('b_hosting') ) {
	var bHosting = new Fx.Tween('b_hosting');
	var bProjektowanie = new Fx.Tween('b_projektowanie');
	var bEmarketing = new Fx.Tween('b_emarketing');
	var bMediacenter = new Fx.Tween('b_mediacenter');
	var bDlagracza = new Fx.Tween('b_dlagracza');
	var bDopracy = new Fx.Tween('b_dopracy');

	var wStart = new Fx.Slide('window_start');
	var wHosting = new Fx.Slide('window_hosting');
	var wProjektowanie = new Fx.Slide('window_projektowanie');
	var wEmarketing = new Fx.Slide('window_emarketing');
	var wMediacenter = new Fx.Slide('window_mediacenter');
	var wDlagracza = new Fx.Slide('window_dlagracza');
	var wDopracy = new Fx.Slide('window_dopracy');

	var wHostingA = new Fx.Slide('window_hosting', {
		onComplete: function(){
			wProjektowanie.slideIn();
		}
	});

	wHosting.hide();
	wProjektowanie.hide();
	wEmarketing.hide();
	wMediacenter.hide();
	wDlagracza.hide();
	wDopracy.hide();

	$('b_hosting').addEvent('click', function(e){
		e.stop();
		bProjektowanie.start('border', '1px dotted #FFF');
		bHosting.start('border', '1px dotted #DB9');
		bEmarketing.start('border', '1px dotted #FFF');
		bMediacenter.start('border', '1px dotted #FFF');
		bDlagracza.start('border', '1px dotted #FFF');
		bDopracy.start('border', '1px dotted #FFF');
		wStart.slideOut();
		wHosting.slideIn.delay(1000, wHosting);
		wProjektowanie.slideOut();
		wEmarketing.slideOut();
		wMediacenter.slideOut();
		wDlagracza.slideOut();
		wDopracy.slideOut();
	});

	$('b_projektowanie').addEvent('click', function(e){
		e.stop();
		bProjektowanie.start('border', '1px dotted #DB9');
		bHosting.start('border', '1px dotted #FFF');
		bEmarketing.start('border', '1px dotted #FFF');
		bMediacenter.start('border', '1px dotted #FFF');
		bDlagracza.start('border', '1px dotted #FFF');
		bDopracy.start('border', '1px dotted #FFF');
		wHosting.slideOut();
		wProjektowanie.slideIn.delay(1000, wProjektowanie);
		wStart.slideOut();
		wEmarketing.slideOut();
		wMediacenter.slideOut();
		wDlagracza.slideOut();
		wDopracy.slideOut();
	});

	$('b_emarketing').addEvent('click', function(e){
		e.stop();
		bProjektowanie.start('border', '1px dotted #FFF');
		bHosting.start('border', '1px dotted #FFF');
		bEmarketing.start('border', '1px dotted #DB9');
		bMediacenter.start('border', '1px dotted #FFF');
		bDlagracza.start('border', '1px dotted #FFF');
		bDopracy.start('border', '1px dotted #FFF');
		wStart.slideOut();
		wProjektowanie.slideOut();
		wEmarketing.slideIn.delay(1000, wEmarketing);
		wHosting.slideOut();
		wMediacenter.slideOut();
		wDlagracza.slideOut();
		wDopracy.slideOut();
	});

	$('b_mediacenter').addEvent('click', function(e){
		e.stop();
		bProjektowanie.start('border', '1px dotted #FFF');
		bHosting.start('border', '1px dotted #FFF');
		bEmarketing.start('border', '1px dotted #FFF');
		bMediacenter.start('border', '1px dotted #DB9');
		bDlagracza.start('border', '1px dotted #FFF');
		bDopracy.start('border', '1px dotted #FFF');
		wStart.slideOut();
		wProjektowanie.slideOut();
		wEmarketing.slideOut();
		wHosting.slideOut();
		wMediacenter.slideIn.delay(1000, wMediacenter);
		wDlagracza.slideOut();
		wDopracy.slideOut();
	});

	$('b_dlagracza').addEvent('click', function(e){
		e.stop();
		bProjektowanie.start('border', '1px dotted #FFF');
		bHosting.start('border', '1px dotted #FFF');
		bEmarketing.start('border', '1px dotted #FFF');
		bMediacenter.start('border', '1px dotted #FFF');
		bDlagracza.start('border', '1px dotted #DB9');
		bDopracy.start('border', '1px dotted #FFF');
		wStart.slideOut();
		wProjektowanie.slideOut();
		wEmarketing.slideOut();
		wHosting.slideOut();
		wMediacenter.slideOut();
		wDlagracza.slideIn.delay(1000, wDlagracza);
		wDopracy.slideOut();
	});

	$('b_dopracy').addEvent('click', function(e){
		e.stop();
		bProjektowanie.start('border', '1px dotted #FFF');
		bHosting.start('border', '1px dotted #FFF');
		bEmarketing.start('border', '1px dotted #FFF');
		bMediacenter.start('border', '1px dotted #FFF');
		bDlagracza.start('border', '1px dotted #FFF');
		bDopracy.start('border', '1px dotted #DB9');
		wStart.slideOut();
		wProjektowanie.slideOut();
		wEmarketing.slideOut();
		wHosting.slideOut();
		wMediacenter.slideOut();
		wDlagracza.slideOut();
		wDopracy.slideIn.delay(1000, wDopracy);
	});

	$$('div[id^=b]').addEvents({
		'click': function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1
			});
			this.tween('border', '1px solid #db9');
		},
		'mouseenter': function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1
			});
		},
		'mouseleave': function(){
			// Morphes back to the original style
			this.morph({
				'opacity': 0.8
			});
		}
	});

	$$('div[class=realizacje]').addEvents({
		'mouseenter': function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1
			});
		},
		'mouseleave': function(){
			// Morphes back to the original style
			this.morph({
				'opacity': 0.8
			});
		}
	});
}
});