/* BETA slider - ONLY FOR DEVELOPERS */

jQuery(document).ready(function ($) {

  $('#checkbox').change(function(){
    setInterval(function () {
        moveRight();
    }, 3000);
  });
  
	var slideCount = $('#hs-beta-slider ul li').length;
	var slideWidth = $('#hs-beta-slider ul li').width();
	var slideHeight = $('#hs-beta-slider ul li').height();
	var sliderUlWidth = slideCount * slideWidth;
	
	$('#hs-beta-slider').css({ width: slideWidth, height: slideHeight });
	
	$('#hs-beta-slider ul').css({ width: sliderUlWidth, marginLeft: - slideWidth });
	
    $('#hs-beta-slider ul li:last-child').prependTo('#hs-beta-slider ul');

    function moveLeft() {
        $('#hs-beta-slider ul').animate({
            left: + slideWidth
        }, 200, function () {
            $('#hs-beta-slider ul li:last-child').prependTo('#hs-beta-slider ul');
            $('#hs-beta-slider ul').css('left', '');
        });
    };

    function moveRight() {
        $('#hs-beta-slider ul').animate({
            left: - slideWidth
        }, 200, function () {
            $('#hs-beta-slider ul li:first-child').appendTo('#hs-beta-slider ul');
            $('#hs-beta-slider ul').css('left', '');
        });
    };

    $('a.control_prev').click(function () {
        moveLeft();
    });

    $('a.control_next').click(function () {
        moveRight();
    });

});    
