﻿$(document).ready(function() {
$('a[href*=#]').click(function() {
 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
 && location.hostname == this.hostname) {
   var $target = $(this.hash);
   $target = $target.length && $target
   || $('[name=' + this.hash.slice(1) +']');
   if ($target.length) {
  var targetOffset = $target.offset().top;
  $('html,body')
  .animate({scrollTop: targetOffset}, 500);
    return false;
   }
  }
  });
});
 
/* justify */
$(document).ready(function(){
$('.justify th').justify();
});  
$(document).ready(function(){
$('.justify .td_l').justify();
});
 
/* toggle menu */
$(document).ready(function(){
	//mouse pointer
	$(".trigger").css({cursor:'pointer'}) 
	//Hide (Collapse) the toggle containers on load
	$(".toggle").hide(); 
 
	//Switch the "Open" and "Close" state per click
	$(".trigger").toggle(function(){
		$(this).addClass("active");
		}, function () {
		$(this).removeClass("active");
	});
 
	//Slide up and down on click
	$(".trigger").click(function(){
		$(this).next(".toggle").slideToggle("fast");
	});
 
});

function topr(){
document.write('<div class="prbox">[PR]　<a href="http://www.nttif.com/ranking/" target="_blank">自動車保険 ランキング</a>　<a href="http://cancer.nttif.com/" target="_blank">がん保険</a></div>');
}

