    var showTime = 4000;
    var timer = 0;
    var total = 0;
    var count = 5000;//表示までの時間(ミリ秒) 

    var kurikaeshi = setInterval(autoPlay,count);

    $(function() {
      total = $('.thumb img').length;
      var $totalImgs = $('.thumb img');
      $('#imageNumber').html('Image: 1/' + total);


      var htmlStr = $('.thumb').html();
      showDiv(htmlStr);


      $('.thumb').click(function() {
            htmlStr = $(this).html();
        $('#top_cont_left1').fadeOut("fast", function() { showDiv(htmlStr) });
            clearInterval(kurikaeshi);
            //autoPlay()

      });


      $('#autoPlay').toggle(
          function() {
            clearTimeout(timer);
            $('#autoPlay')
              .css("backgroundImage", "url(themes/images/play.gif)")
              .attr("alt", "Play")
              .attr("title", "Play");
          },
          function() {
            $('#autoPlay')
              .css("backgroundImage", "url(themes/images/stop.gif)")
              .attr("alt", "Stop")
              .attr("title", "Stop");
            autoPlay()
          });


    });

    function autoPlay() {
      var currentLarge = $('#top_cont_left1 img').attr('class');

      if ("p" + total != currentLarge) {
        htmlStr = $('#innerContainer li.' + currentLarge).next('li').html();
        $('#top_cont_left1').fadeOut("fast", function() { showDiv(htmlStr) });
      }

      if ("p" + (total) == currentLarge) {
        htmlStr = $('#innerContainer li.p1').html();
        $('#top_cont_left1').fadeOut("fast", function() { showDiv(htmlStr) });
      }

      //timer = setTimeout("autoPlay()", showTime);
    }

    function showDiv(htmlStr) {
      $('#top_cont_left1').html(htmlStr);

      var currenthref = $('#top_cont_left1 img').attr('alt');
      $('#top_cont_left1').html('<a href="' + currenthref + '">' + htmlStr + '</a>');

      var currentcomment = $('#top_cont_left1 img').attr('title');
      $('#top_cont_left2').html('<a href="' + currenthref + '">' + currentcomment + '</a>');
      $('#top_cont_left3').html('<a href="' + currenthref + '"><img src="common/_img_/more_btn.jpg"></a>');


      $('#top_cont_left1 img').attr({ width: 600, height: 210 });
      $('#top_cont_left1').fadeIn("normal");

      var currentLarge = $('#top_cont_left1 img').attr('class');
      currentLarge = currentLarge.substr(1, 3);
      $('#imageNumber').html('Image: ' + currentLarge + '/' + total);

      //$('#thumbnails img').attr({ width: 400, height: 350 });
      //$('#thumbnails img ').css('プロパティ名','値');
      $('#innerContainer img').css("border", "1px #ffffff solid"); // ← ココ
      $('#top_cont_right #p' + currentLarge ).css("border", "1px #ff0000 solid"); // ← ココ


    }
