// Easingの追加
jQuery.easing.quart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};


j$(document).ready(function(){
														
		//モーダルちっく											
		j$(".uchiwakeBtn").click(function () {
																			 
			if(j$(this).next("div.parents").css("display") == "none") {
				j$(this).next("div.parents").show();
			} else {
				j$(this).next("div.parents").hide();
			}
			
		});
		j$(".closeBtn a").click(function () {
				j$(this).parents("div.parents").hide();
		});

		//ツールチップ												
		j$(".planSort li a").hover(function() {
			j$(this).next(".planComment").stop(true, true).animate({opacity: "show", top: "-94"}, "2000");
			}, function() {
			j$(this).next(".planComment").animate({opacity: "hide", top: "-104"}, "500");
		});
		

		//タブ1 ※TOPとプロバイダー詳細ページで使用
    j$("ul#selctType").tabs("#itemSelectBOX .itemSelectList", {
		onBeforeClick: function(event, tabIndex) { 
			this.getCurrentPane().addClass("current"); 
		} 
		});
		
		//タブ2 ※光ファイバー回線のプラン一覧で使用
		j$("#typeHikari").tabs("#typeHikariInner > div", {
			tabs: "li",
			current: "current"
		});
		
		//タブ2 ※ADSL回線のプラン一覧で使用
		j$("#typeADSL").tabs("#typeADSLInner > div", {
			tabs: "li",
			current: "current"
		});
		
		//アコーディオン
		j$(".toggle_container").show();
	
		j$(".trigger").toggle(function(){
			j$(this).addClass("active"); 
			}, function () {
			j$(this).removeClass("active");
		});
		
		j$(".trigger").click(function(){
			j$(this).next(".toggle_container").slideToggle("normal");
		});
		
		//ドロップダウンメニュー
    j$("ul.dropdown li").hover(function(){
        j$(this).addClass("hover");
        j$('ul:first',this).css('visibility', 'visible');
    }, function(){
        j$(this).removeClass("hover");
        j$('ul:first',this).css('visibility', 'hidden');
    });
    j$("ul.dropdown li ul li:has(ul)").find("a:first").append("<span>&nbsp;</span>");
		
		//スクロール
		j$('a[href*=#]').not('.tooltip, .uchibtn').click(function() {
			if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
				var $target = jQuery(this.hash);
				$target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
				if ($target.length) {
					var targetOffset = $target.offset().top;
					jQuery('html,body').animate({ scrollTop: targetOffset }, 1200, 'quart');
					return false;
				}
			}
		});
		
			//アコーディオン02
      j$("div.priceBody").show();
      j$("div.priceHead a").click(function() {
																			
          var j$this = j$(this);
					
          if (j$this.hasClass("deActive")) {
              j$this.removeClass("deActive");
          }else {
              j$this.addClass("deActive");
          }
					
          j$this.parents().next("div.priceBody").slideToggle("slow");
					
      });
			
			//ツールチップ02
		
		j$(".pointList li span").hover(function() {
			j$(this).next(".pTip").stop(true, true).animate({opacity: "show", top: "-310"}, "2000");
			}, function() {
			j$(this).next(".pTip").animate({opacity: "hide", top: "-330"}, "500");
		});
		

});
