//アコーディオン

$(function(){
	$(".acc dd").hide();
	$(".acc dt").click(function(){
	var index = $("dt").index(this);
	$("dd").eq(index).slideToggle("fast");
	}).css("cursor","pointer");
});



//アンカーリンク

$(function(){
     $("a[href^=#]").click(function(){
     $('html,body').animate({ scrollTop: $($(this).attr("href")).offset().top }, 'slow','swing');
     return false;
     })
});



//ロールオーバー

$(function(){
     $('a img').hover(function(){
        $(this).attr('src', $(this).attr('src').replace('_off', '_on'));
          }, function(){
             if (!$(this).hasClass('currentPage')) {
             $(this).attr('src', $(this).attr('src').replace('_on', '_off'));
        }
   });
});



//外部リンク

$(document).ready(function() {
	 
	   //外部リンクは全て別ウインドウにする
	   $('a[href^="http://"]').attr("target", "_blank"); 
	   //$('a[href^="https://"]').attr("target", "_blank"); 

	   //クラス指定で別ウインドウにする
 	   $(".blank").attr("target", "_blank"); 

});



//表1行毎に色変え

$(function(){
     $("table.dataprice tr:odd").addClass("odd");
});



//表のカーソル

$(function(){
	  var overcells = $("table.hover td"),
	      hoverClass = "color",
	      current_r,
	      current_c;
	 
	  overcells.hover(
	    function(){
	      var $this = $(this);
	      (current_r = $this.parent().children("table.hover td")).addClass(hoverClass);
		  //縦のhover
	     // (current_c = overcells.filter(":nth-child("+ (current_r.index($this)+1) +")")).addClass(hoverClass);
	    },
	 
	    function(){
	      current_r.removeClass(hoverClass);
	      current_c.removeClass(hoverClass);
	 
	    }
	  );
	});




//文例ポップアップ

window.onload = function() {
	var node_a = document.getElementsByTagName('a');
		for (var i in node_a) {
			if (node_a[i].className == 'bun') {
				node_a[i].onclick = function() {
					return winOpen(this.href)
				};
			}
		}
};

function winOpen(url) {
	window.open(
	url,'popup',
	'width=800,height=900,scrollbars=1,resizable=1');

	return false;
};


