window.addEvent('domready', function() {
	
	
	var myTips = new Tips($$('#top a'), {className: "menuTip"});
	
	var myContent = new Fx.Slide('content-tresc');
	
	var przejscie = new Fx.Tween('content-tresc');

	
		//przejscie.start('opacity', '1', '0');
		myContent.slideIn();
		
		
	var req = new Request.HTML({url: 'index.php?p=lol', 
		onSuccess: function(html) {		
			$('content-tresc').set('text', '');				
			$('content-tresc').adopt(html);
			//przejscie.start('opacity', '1', '0');
			myContent.slideIn();
			przejscie.start('opacity', '0', '1');
			
			var mys = new Tips($$('#content div.zdjecie, #content a.image'), {className: "zdjecieTip"});
			var slajd = new Tips($$('#content div.slajd'), {className: "slajdTip"});
			// --------------------------------------------------------------
			/*var req2 = new Request.HTML({url: './przyklad.html', 
						onSuccess: function(html) {	
							myContent.slideOut();
							$('tresc').set('text', '');	
							myContent.slideIn();	
							$('tresc').adopt(html);
							
						},
						onFailure: function() {
							$('tresc').set('text', 'The request failed.');
						}
					});
			// --------------------------------------------------------------
					
					
				$('sprawdz').addEvent('click', function() {
						req2.send({url:'./przyklad.html'});
					});	
				$('wylacz').addEvent('click', function() {
					otherEl.tween('opacity', [1, 0]);
					mainEl.start('display', 'block', 'none');	
					});	
			// --------------------------------------------------------------
			*/
			
		},
		onFailure: function() {
			$('content-tresc').set('text', 'The request failed.');
		}
	});
		
	
//------------------------------------------------------------
	$('main').addEvent('click', function() {
		myContent.slideOut();
	});	
	$('prywatnie').addEvent('click', function() {
		
		//przejscie.start('opacity', '1', '0');
		req.send({url:'index.php?p=prywatnie'});
		//przejscie.start('opacity', '0', '1');
		
	});
	
	$('wirtualnie').addEvent('click', function() {
		
		//przejscie.start('opacity', '1', '0');
		req.send({url:'index.php?p=wirtualnie'});
		//przejscie.start('opacity', '0', '1');
	});
	
	$('kreatywnie').addEvent('click', function() {
		req.send({url:'index.php?p=kreatywnie'});		
		//przejscie.start('opacity', '0', '1');
	});
	
	$('kontakt').addEvent('click', function() {
		req.send({url:'index.php?p=kontakt'});
		//przejscie.start('opacity', '0', '1');
	});
	
});