 $$.extend({
  Home : {
    Ready : function()
    {
      $('div.tmpDocumentFeature')
        .hover(
          function() {
            $(this).addClass('tmpDocumentFeatureOn');
          },
          function() {
            $(this).removeClass('tmpDocumentFeatureOn');
          }
        )
        .mouseover(
          function() {
            $$.Home.SlideInterupted = true;
            $('div.tmpSlide').hide();
            $('div.tmpDocumentFeature').removeClass('tmpDocumentFeatureSlideOn');

            $('div#tmpSlide-' + $(this).SplitID()).show()
            $(this).addClass('tmpDocumentFeatureSlideOn');
            
            $$.Home.SlideCounter = $(this).SplitID();
//            setTimeout('$$.Home.Slideshow();', 5000);
          }
        );

      
      this.SlideCounter = 6;//最初に表示するもの
      this.SlideInterupted = false;

      this.Slideshow();
    },

    Slideshow : function()
    {
      if ($$.Home.SlideInterupted) {
//        return;
      }

      $$.Home.SlideLast = $$.Home.SlideCounter - 1;

      if ($$.Home.SlideLast < 1) {
        $$.Home.SlideLast = 4;
      }

      $('div#tmpSlide-' + $$.Home.SlideLast).fadeOut(
        'slow',
        function() {
          $('div#tmpDocumentFeature-' + $$.Home.SlideLast).removeClass('tmpDocumentFeatureSlideOn');
          $('div#tmpDocumentFeature-' + $$.Home.SlideCounter).addClass('tmpDocumentFeatureSlideOn');
          $('div#tmpSlide-' + $$.Home.SlideCounter).fadeIn(800);

          $$.Home.SlideCounter++;

          if ($$.Home.SlideCounter > 4) {
            $$.Home.SlideCounter = 1;
          }

          //setTimeout('$$.Home.Slideshow();', 5000);
        }
      );
    }
  }
});

$(document).ready(
  function() {
    $$.Home.Ready();
  }
);

function loopWait( timeWait )
{
    var timeStart = new Date().getTime();
    var timeNow = new Date().getTime();
    while( timeNow < (timeStart + timeWait ) )
    {
        timeNow = new Date().getTime();
    }
    return;
}

