$(document).ready(function() {
	// slider
	$('#coin-slider').coinslider({ 
		width: 666,
		height: 417,
		delay: 5000,
		opacity: 1
	});
	function actBut1(){
		$('.but1 a').css({background:'url(images/active-button-top.png) no-repeat', 'z-index':7}).stop().animate({right:'30px'},600,'easeOutElastic')
	}
	function noActBut1(){
		$('.but1 a').stop().animate({right:'0'},400).css({background:'url(images/button-top.png) right 0 no-repeat', 'z-index':4});
	}
	function actBut2(){
		$('.but2 a').css({background:'url(images/active-button-top.png) no-repeat', 'z-index':7}).stop().animate({right:'30px'},600,'easeOutElastic')
	}
	function noActBut2(){
		$('.but2 a').stop().animate({right:'0'},400).css({background:'url(images/button-top.png) right 0 no-repeat', 'z-index':4});
	}
	function actBut3(){
		$('.but3 a').css({background:'url(images/active-button-top.png) no-repeat', 'z-index':7}).stop().animate({right:'30px'},600,'easeOutElastic')
	}
	function noActBut3(){
		$('.but3 a').stop().animate({right:'0'},400).css({background:'url(images/button-top.png) right 0 no-repeat', 'z-index':4});
	}
	function actBut4(){
		$('.but4 a').css({background:'url(images/active-button-top.png) no-repeat', 'z-index':7}).stop().animate({right:'30px'},600,'easeOutElastic')
	}
	function noActBut4(){
		$('.but4 a').stop().animate({right:'0'},400).css({background:'url(images/button-top.png) right 0 no-repeat', 'z-index':4});
	}
	
	
	function SetActive(){
		idx = $('#cs-buttons-coin-slider .cs-active').attr('id');
		
		if (idx=='cs-button-coin-slider-1') {noActBut4();actBut1();}
		if (idx=='cs-button-coin-slider-2') {noActBut1();actBut2();}
		if (idx=='cs-button-coin-slider-3') {noActBut2();actBut3();}
		if (idx=='cs-button-coin-slider-4') {noActBut3();actBut4();}
			
	}
  	
	
	$('#cs-button-coin-slider-1').hover(function(){actBut1();},function(){noActBut1();});
	$('#cs-button-coin-slider-2').hover(function(){actBut2();},function(){noActBut2();});
	$('#cs-button-coin-slider-3').hover(function(){actBut3();},function(){noActBut3();});
	$('#cs-button-coin-slider-4').hover(function(){actBut4();},function(){noActBut4();});
	 
	 
	 $('ul.menu').superfish({
      delay:       400,
      animation:   {opacity:'show',height:'show'},
      speed:       400,
      autoArrows:  false,
      dropShadows: false
   });
});
