function minimize_menu(){
	/*****************************
	muta titlul
	*****************************/
	var titlu = $('titlu');
	var titlufx = new Fx.Morph(titlu, {duration: 1000, wait: false});
	titlufx.options.transition = Fx.Transitions.Quad.easeOut;
	titlufx.start({
	'left': '0'});

	/**************************
	set motion FX for menu
	***************************/
	var menu = $('main-menu');
	var menufx = new Fx.Morph(menu, {duration: 1200,wait: false});
	menufx.options.transition = Fx.Transitions.Quad.easeOut;
	menufx.start({
		'height': '50',
		'width': '430',
		'margin': '5px 0 0 260px'});
	
	/**************************
	set motion FX for links
	***************************/
	var indexlink = $('index-link');
	var indexfx = new Fx.Morph(indexlink, {duration: 800,wait: false});
	indexfx.options.transition = Fx.Transitions.Quad.easeOut;
	indexfx.start({
		'width': '106',
		'left': '0',
		'top': '0',
		'background-image': 'images/mainmenu_small_gif'
		});
	var servlink = $('servicii-link');
	var servfx = new Fx.Morph(servlink, {duration: 800,wait: false});
	servfx.options.transition = Fx.Transitions.Quad.easeOut;
	servfx.start({
		'width': '106',
		'left': '108',
		'top': '0',
		'background-image': 'images/mainmenu_small_gif'
		});
	var comlink = $('cum-comand-link');
	var comfx = new Fx.Morph(comlink, {duration: 500,wait: false});
	comfx.options.transition = Fx.Transitions.Quad.easeOut;
	comfx.start({
		'width': '106',
		'left': '216',
		'top': '0',
		'background-image': 'images/mainmenu_small_gif'
		});
	var contlink = $('contact-link');
	var contfx = new Fx.Morph(contlink, {duration: 500,wait: false});
	contfx.options.transition = Fx.Transitions.Quad.easeOut;
	contfx.start({
		'width': '106',
		'left': '324',
		'top': '0',
		'background-image': 'images/mainmenu_small_gif'
		});
	
	/******************************
	schimba background-ul butoanelor
	*******************************/
	indexlink.setStyles({background: 'url(images/mainmenu_small.gif) no-repeat 0 0', height: 37});
	servlink.setStyles({background: 'url(images/mainmenu_small.gif) no-repeat 0 -37px', height: 37});
	comlink.setStyles({background: 'url(images/mainmenu_small.gif) no-repeat 0 -74px', height: 37});
	contlink.setStyles({background: 'url(images/mainmenu_small.gif) no-repeat 0 -111px', height: 37});
	
	$('main-content').setStyle('visibility','visible');
	}

/*****************************************************************************************************************************************************/

window.addEvent('domready', function() {
	var smallmenu = 'false';
	
	$$('a.txt-link').addEvents({
		'click': function(e){
			/*********************************
			stop the current event and get the link
			**********************************/
			e = new Event(e).stop();
			var calea = this.href;
			calea += '?inside=true';
			var req = new Request.HTML({url: calea,
				onSuccess: function(html) {
					$('main-content-body').set('text', '');
					$('main-content-body').adopt(html);
					},
				onFailure: function() {
					$('main-content-body').set('text', 'The request failed.<br>'+calea);
					}
				});
				
			if(smallmenu == 'false'){
				/***************************
				daca meniul nu a fost micsorat, micsoreaza-l
				****************************/
				smallmenu = 'true';
				$('imageflow-container').dispose();
				minimize_menu();
				}
			
			var contentfx = new Fx.Morph('main-content-body', {duration: 500,wait: false});
			contentfx.options.transition = Fx.Transitions.Quad.easeIn;
			contentfx.start({'height': 0}).chain(function(){
				req.send().chain(function(){
					var inaltimea = $('main-content-body').getScrollSize();
					contentfx.start({'height': inaltimea.y});
					})
				})
			}
		});
	
	$(document.body).getElements('a.main-link').addEvents({
		'click': function(e){
			/*********************************
			stop the current event and get the link
			**********************************/
			e = new Event(e).stop();
			var calea = this.href;
			calea += '?inside=true';
			var req = new Request.HTML({url: calea,
				onSuccess: function(html) {
					$('main-content-body').set('text', '');
					$('main-content-body').adopt(html);
					},
				onFailure: function() {
					$('main-content-body').set('text', 'The request failed.<br>'+calea);
					}
				});
				
			if(smallmenu == 'false'){
				/***************************
				daca meniul nu a fost micsorat, micsoreaza-l
				****************************/
				smallmenu = 'true';
				$('imageflow-container').dispose();
				minimize_menu();
				}

			var contentfx = new Fx.Morph('main-content-body', {duration: 500,wait: false});
			contentfx.options.transition = Fx.Transitions.Quad.easeIn;
			contentfx.start({'height': 0}).chain(function(){
				req.send().chain(function(){
					var inaltimea = $('main-content-body').getScrollSize();
					contentfx.start({'height': inaltimea.y}).chain(function(){
						$$('#main-content-body a.link_produse').addEvents({
							'click': function(e){
								e = new Event(e).stop();
								var calea = this.href;
								calea += '&inside=true';
								var req = new Request.HTML({url: calea,
									onSuccess: function(html) {
										$('thumbnails').set('text', '');
										$('thumbnails').adopt(html);
										},
									onFailure: function() {
										$('thumbnails').set('text', 'The request failed.<br>'+calea);
										}
									});
								contentfx.start({'height':0}).chain(function(){
									req.send().chain(function(){
										$('linkurigal').setStyles({display:'none', height:0,overflow:'hidden'});
										$('backbutton').setStyles({display:'block',height:'auto',overflow:'visible'});
										inaltimea = $('main-content-body').getScrollSize();
										contentfx.start({'height': inaltimea.y}).chain(function(){
											$('backbutton').addEvent('click',function(e){
												e = new Event(e).stop();
												contentfx.start({'height':0}).chain(function(){
													$('thumbnails').set('text', '');
													$('backbutton').setStyles({display:'none', height:0,overflow:'hidden'});
													$('linkurigal').setStyles({display:'block',height:'auto',overflow:'visible'});
													var inaltimea = $('main-content-body').getScrollSize();
													contentfx.start({'height': inaltimea.y});
													});
												});
											$$('#main-content-body a.lightboxlink').slimbox({resizeDuration: 300, overlayOpacity:0.8});
											})
										})
									})
								}
							});
							
						if($('formular_contact')){
							$('formular_contact').addEvent('submit', function(e) {
								new Event(e).stop();
								var log = $('log_result');
								this.set('load', {
									url: this.get("action"),
									method: this.get("method"),
									update: log,
									onSuccess: function(html) {$('log_result2').adopt(html);}
									});
								this.load();
								}); 
							}
						});
					})
				});
			}
		})
	});
