$(document).ready(function() {
	// slider
	$('#coin-slider').coinslider({ 
		width: 743,
		height: 417,
		delay: 5000,
		opacity: 1
	});
	function actBut1(){
		$('.but1 a').css({background:'url(skin/default/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(skin/default/images/button-top.png) right 0 no-repeat', 'z-index':4});
	}
	function actBut2(){
		$('.but2 a').css({background:'url(skin/default/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(skin/default/images/button-top.png) right 0 no-repeat', 'z-index':4});
	}
	function actBut3(){
		$('.but3 a').css({background:'url(skin/default/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(skin/default/images/button-top.png) right 0 no-repeat', 'z-index':4});
	}
	function actBut4(){
        $('.but4 a').css({background:'url(skin/default/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(skin/default/images/button-top.png) right 0 no-repeat', 'z-index':4});
    }
    function actBut5(){
		$('.but5 a').css({background:'url(skin/default/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(skin/default/images/button-top.png) right 0 no-repeat', 'z-index':4});
	}
    function actBut6(){
        $('.but6 a').css({background:'url(skin/default/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(skin/default/images/button-top.png) right 0 no-repeat', 'z-index':4});
    }
	function actBut7(){
        $('.but7 a').css({background:'url(skin/default/images/active-button-top.png) no-repeat', 'z-index':7}).stop().animate({right:'30px'},600,'easeOutElastic')
    }
    function noActBut7(){
        $('.but7 a').stop().animate({right:'0'},400).css({background:'url(skin/default/images/button-top.png) right 0 no-repeat', 'z-index':4});
    }
    function actBut8(){
        $('.but8 a').css({background:'url(skin/default/images/active-button-top.png) no-repeat', 'z-index':7}).stop().animate({right:'30px'},600,'easeOutElastic')
    }
    function noActBut8(){
        $('.but8 a').stop().animate({right:'0'},400).css({background:'url(skin/default/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') {noActBut8();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();}
        if (idx=='cs-button-coin-slider-7') {noActBut6();actBut7();}
		if (idx=='cs-button-coin-slider-8') {noActBut7();actBut8();}
			
	}
  	
	
	$('#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();});
    $('#cs-button-coin-slider-7').hover(function(){actBut7();},function(){noActBut7();});
	$('#cs-button-coin-slider-8').hover(function(){actBut8();},function(){noActBut8();});
	 
	 
	 $('ul.menu').superfish({
      delay:       400,
      animation:   {opacity:'show',height:'show'},
      speed:       400,
      autoArrows:  false,
      dropShadows: false
   });
});
