// JavaScript Document

//画像ロールオーバー
$(function () {
	$('a img,:image').each(function () {
		var ofSrc = $(this).attr('src');
		var onSrc = ofSrc.replace('_off.', '_on.');
		$(this).hover(function () {
			$(this).attr('src', onSrc);
		}, function () {
			$(this).attr('src', ofSrc);
		});
	});
});

//globalnav
$(function(){
		$("header li:last").addClass("last");
});


//backtop
jQuery(function () {
    if (! jQuery.browser.safari) {
        jQuery('.linknaviGotop').click(function () {
            jQuery(this).blur();
            jQuery('html,body').animate({ scrollTop: 0 }, 'fast');
            return false;
        });
    }
});

//fancybox
jQuery(function() {
	$("a[rel=lightbox]").fancybox({
		"showNavArrows": false,
		"titlePosition": 'inside'
	});
});

//pdf
$(function(){
    $("a[href$='.pdf']").addClass("pdf_link");
    $("a[href$='.doc']").addClass("doc_link");
    $("a[href$='.xls']").addClass("xls_link");
});

//table
jQuery(function() {
	$("tr th:first-child,tr td:first-child").addClass("l-noborder");
	$("tr th:last-child,tr td:last-child").addClass("r-noborder");
				});
