//スタイル制御
$(document).ready(function(){
	$(".news_body ul li:even").addClass("odd");
	$(".news_body > table > tbody > tr:even").addClass("odd");
	$("h1.logo").jQIR("gif", "img/");
	$(".localNav ul li:last-child").addClass("last-child");
	$("div.sitemap li:last-child").addClass("last-child");
	$("div.inquiry_text img:last-child").addClass("last-child");
	$(".subNav li:nth-child(2n) ").addClass("odd");	
	$(".figure img:nth-child(2n) ").addClass("figure_02");	
});
//heightLine
$(function() {
    $('.heightline').flatHeights();
});

$(function(){
    var sets = [], temp = [];
    $('.box dl').each(function(i) {
        temp.push(this);
        if (i % 4 == 3) {
            sets.push(temp);
            temp = [];
        }
    });
    if (temp.length) sets.push(temp);
    $.each(sets, function() {
        $(this).flatHeights();
    });
});

$(function(){
    var sets = [], temp = [];
    $('.indextext').each(function(i) {
        temp.push(this);
        if (i % 4 == 3) {
            sets.push(temp);
            temp = [];
        }
    });
    if (temp.length) sets.push(temp);
    $.each(sets, function() {
        $(this).flatHeights();
    });
});

//スムーズスクロール

var span = 1000;
var effect = 'easeOutQuint';

$(function() {
	var ua = $.browser;
	$("a.scroll").click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			$(this).blur();
			var t = navigator.appName.match(/Opera/) ? "html" : "html,body";
			$(t).queue([]).stop();
			var $targetElement = $(this.hash);
			var scrollTo = $targetElement.offset().top;
			if (window.scrollMaxY) {
				var maxScroll = window.scrollMaxY;
			} else {
				var maxScroll = document.documentElement.scrollHeight - document.documentElement.clientHeight;
			}
			if (scrollTo > maxScroll){
				scrollTo = maxScroll;
			}
			$(t).animate({ scrollTop: scrollTo }, span, effect);
			return false;
		}
	});
});


