
// Copyright
// ----------------------------------------------------------------------- //

function copyright() {
	startYear = 2008;
	
	thisDate = new Date();
	thisYear = thisDate.getFullYear();
	
	if (thisYear > startYear) { document.write(startYear + "-" + thisYear); }
	else { document.write(startYear); }
}



// Smooth Scroll
// ----------------------------------------------------------------------- //

$(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 - 20;
        $('html,body')
          .animate({scrollTop: targetOffset}, 300);
        return false;
      }
    }
  });
});



// even
// ----------------------------------------------------------------------- //

$(function(){
  $(".stripe tr:even").addClass("even");
});



// glossary
// ----------------------------------------------------------------------- //

$(function(){

$("a.glossary").each(function(i) {
  grs = $(this).html();
  $(this).attr("title","ベアリング用語集「"+grs+"」へ");
  $(this).attr("target","_blank");
});

$('a.glossary').tooltip({
	track: true,
	delay: 0,
	showURL: false,
	showBody: " - "
});

});



// plane
// ----------------------------------------------------------------------- //

$(function() {
	var list = location.href.split("?")[1];
	if (list) {
		var num = list.split("&")[0];
		var num = num.split("=")[1];
		var $target =$("#"+num);
		$($target).hide();
		$target.show();
	}
});



// lightbox
// ----------------------------------------------------------------------- //

$(function() {
	$('a[@rel*=large]').lightBox({
		overlayBgColor: '#eef9ff',
		imageBtnClose: '../img/closelabel.gif',
		imageBtnPrev: '../img/prevlabel.gif',
		imageBtnNext: '../img/nextlabel.gif',
		imageLoading: '../img/loading.gif'
	});
	$('a[@rel*=large]').after('<img src="../img/i_large.png" class="largeicon" />');
});

$(function() {
	$('a[@rel*=pic]').lightBox({
		overlayBgColor: '#eef9ff',
		imageBtnClose: '../img/closelabel.gif',
		imageBtnPrev: '../img/prevlabel.gif',
		imageBtnNext: '../img/nextlabel.gif',
		imageLoading: '../img/loading.gif'
	});
});


