(function($) {

	//ユーザーエージェント判別
  	var spFlg = false;
	if( navigator.userAgent.indexOf('iPhone') != -1 || navigator.userAgent.indexOf('iPod') != -1 || ( navigator.userAgent.indexOf('Android') != -1 && navigator.userAgent.indexOf('Mobile') != -1 ) ) {
		spFlg = true;
	}

  var Index = $.index = (function() {

	var
		widthFlg = false,
		speedTime = 800,
		pauseTime = 3000

	// コンストラクタ
    function init() {

		if( !spFlg ) {
			var $bnrSlider = $('.bxslider');

			$bnrSlider.bxSlider({
				slideWidth: 1500,
				moveSlides:1,
				speed: speedTime,
				pause: pauseTime,
				auto: true,
				pager: true,
				minSlides: 3,
        maxSlides: 3,
				slideMargin: 10,
				onSlideAfter: function(){
					$bnrSlider.startAuto();
				}
			});

			$(window).on('resize', function(){
				$bnrSlider.destroySlider();
        
				$bnrSlider.bxSlider({
				slideWidth: 1500,
				moveSlides:1,
				speed: speedTime,
				pause: pauseTime,
				auto: true,
				pager: true,
				minSlides: 3,
        maxSlides: 3,
				slideMargin: 10,
				onSlideAfter: function(){
					$bnrSlider.startAuto();
				}
			});
			});
		} else if(spFlg) {
			widthFlg = true;
		}

	}

    // アクセス制御
    return {
      init : init
    }
  })();
  /* document.ready
  ----------------------------------------*/
  $(Index.init);
})(jQuery);