// menu

$(document).ready(function(){
	
	$(".btn_slide").mouseover(function(){
	
$('.btn_menu2').animate({
	left: '+100px',
	opacity: 'show'
  }, {
    duration: 700,
    specialEasing: {
      width: 'linear',
      height: 'easeOutElastic'
    }
});

	
	$(this).stop().animate({width:'500px'},{queue:false, duration:400, easing: 'linear',
    complete: function() {	}
	
	})
	});




	//When mouse is removed
	$(".btn_slide").mouseout(function(){
	
	
		$(this).stop().animate({width:'185px'},{queue:false, duration:600, easing: 'linear',
    complete: function() {
	$('.btn_menu2').animate({left: '+120px',opacity: 'hide'});
	}

	});
		

		
	});
	
});
















desemble='no';
function main_menu(val,sta,poz_sm1,poz_sm2,poz_sm3,sta_m1,sta_m2,sta_m3,id_menu1,id_menu2,id_menu3,container_name,container_poz) {


if (desemble!='yes') {
desemble='yes';

activ_conainer = container_name;
activ_b = val;

$('.s'+val).animate({
	left: sta+'px',
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});


// fade -------------------------

if (val!='1') {
$('.s1').animate({
	left: '+=40px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});
}

if (val!='2') {
$('.s2').animate({
	left: '+=40px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});
}

if (val!='3') {
$('.s3').animate({
	left: '+=40px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});
}

if (val!='4') {
$('.s4').animate({
	left: '+=40px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});
}



// mici ----------------------------------

if (poz_sm1=='l') { // left
$('.sm'+id_menu1).animate({
	left: sta_m1+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});
} else if (poz_sm1=='r') { //right
$('.sm'+id_menu1).animate({
	right: sta_m1+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});
}



if (poz_sm2=='l') { // left
$('.sm'+id_menu2).animate({
	left: sta_m2+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});
} else if (poz_sm2=='r') { //right
$('.sm'+id_menu2).animate({
	right: sta_m2+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});
}


if (poz_sm3=='l') { // left
$('.sm'+id_menu3).animate({
	left: sta_m3+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});
} else if (poz_sm3=='r') { //right
$('.sm'+id_menu3).animate({
	right: sta_m3+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});
}




$("."+container_name).animate({"left": container_poz+"px"}, 500, function () {
$("."+container_name).fadeIn(500, function () {
desemble='no';
});
});
 

} // desemble

}











// Right --------------------------------------

desemble='no';
function small_menuR(val,sta,activ_slide,menu_fade1,menu_fade2,main_btn_poz,menuL_poz1,menuL_id1,menuL_poz2,menuL_id2,menuL_poz3,menuL_id3,container_name,container_poz) {

if (desemble!='yes') {
desemble='yes';
// scoatem butonul activ
$('.smR'+val).animate({
	left: '-='+sta+'px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});



// scoatem butonul activ
$('.smR'+menu_fade1).animate({
	left: '-='+sta+'px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});

// scoatem butonul activ
$('.smR'+menu_fade2).animate({
	left: '-='+sta+'px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});







// scoatem butonul activ 
$('.s'+activ_b).animate({
	left: '+='+activ_slide+'px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});
activ_b = val; // scoatem si de aici




// pozitie buton pricipal
$('.s'+val).animate({
	left: ''+main_btn_poz+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});





// pozitie butone mici
$('.smL'+menuL_id1).animate({
	left: ''+menuL_poz1+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});

$('.smL'+menuL_id2).animate({
	left: ''+menuL_poz2+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});

$('.smL'+menuL_id3).animate({
	left: ''+menuL_poz3+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});


$("."+activ_conainer).fadeOut(500);

$("."+container_name).animate({"left": container_poz+"px"}, 500, function () {
$("."+container_name).fadeIn(500, function () {
desemble='no';
});
});

activ_conainer = container_name;

} // desemble
	
}










// Left --------------------------------------

desemble='no';
function small_menuL(val,sta,menu_val1,menu_val2,menu_val3,menu_poz1,menu_poz2,menu_poz3,container_name,container_poz) {

if (desemble!='yes') {
desemble='yes';

// scoatem butonul activ
$('.smL'+val).animate({
	left: '-='+sta+'px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});



// scoatem butonul activ 
$('.s'+activ_b).animate({
	left: '+='+sta+'px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});
activ_b = val; // scoatem si de aici

$('.s'+val).animate({
	left: ''+sta+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});




// scoatem right menu

$('.smR'+menu_val1).removeAttr('style');

$('.smR1').removeAttr('style');
$('.smR2').removeAttr('style');
$('.smR3').removeAttr('style');
$('.smR4').removeAttr('style');




$('.smR'+menu_val1).animate({
	right: ''+menu_poz1+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});

$('.smR'+menu_val2).animate({
	right: ''+menu_poz2+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});


$('.smR'+menu_val3).animate({
	right: ''+menu_poz3+'px',
	opacity: 'show'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});



// scoatem  left menu

$('.smL'+menu_val1).animate({
	right: '+='+menu_poz3+'px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});

$('.smL'+menu_val2).animate({
	right: '+='+menu_poz3+'px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});

$('.smL'+menu_val3).animate({
	right: '+='+menu_poz3+'px',
	opacity: 'hide'
  }, {
    duration: 500,
    specialEasing: {
      width: 'linear',
      height: 'easeOutBounce'
    },
    complete: function() {

	}
});

$("."+activ_conainer).fadeOut(500);

$("."+container_name).animate({"left": container_poz+"px"}, 500, function () {
$("."+container_name).fadeIn(500, function () {
desemble='no';
});
});

activ_conainer = container_name;


} // desemble

}
