$(document).ready(function() {
	// slider
	$('#coin-slider').coinslider({ 
		width: 703,
		height: 338,
		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 actBut5(){
		$('.but5 a').css({background:'url(images/active-button-top.png) no-repeat', 'z-index':7}).stop().animate({right:'30px'},600,'easeOutElastic')
	}
	function noActBut5(){
		$('.but5 a').stop().animate({right:'0'},400).css({background:'url(images/button-top.png) right 0 no-repeat', 'z-index':4});
	}
	
	function actBut6(){
		$('.but6 a').css({background:'url(images/active-button-top.png) no-repeat', 'z-index':7}).stop().animate({right:'30px'},600,'easeOutElastic')
	}
	function noActBut6(){
		$('.but6 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') {noActBut5();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();}
		if (idx=='cs-button-coin-slider-5') {noActBut4();actBut5();}
		if (idx=='cs-button-coin-slider-6') {noActBut5();actBut6();}
			
	}
  	
	
	$('#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();});
	$('#cs-button-coin-slider-5').hover(function(){actBut5();},function(){noActBut5();});
	$('#cs-button-coin-slider-6').hover(function(){actBut6();},function(){noActBut6();});
	 

});
