// ロールオーバー
$(function () {
    $.rollover = {
        init: function () {
            $('a img,input[type="image"]').not('[src*="_on."]')
                .bind('mouseover', this.over)
                .bind('mouseout',  this.out)
                .each(this.preload);
        },

        over : function () {
            this.setAttribute('src', this.getAttribute('src').replace('_off.', '_on.'));
        },

        out : function () {
            this.setAttribute('src', this.getAttribute('src').replace('_on.', '_off.'));
        },

        preload : function () {
            new Image().src = this.getAttribute('src').replace('_off.', '_on.');
        }
    };

    $.rollover.init();
});


//flatheight
$(window).bind('load',function(){
    var sets = [], temp = [];
    $('div.section div.navigation').each(function(i) {
        temp.push(this);
        if (i % 2 == 1) {
            sets.push(temp);
            temp = [];
        }
    });
    if (temp.length) sets.push(temp);
    $.each(sets, function() {
        $(this).flatHeights();
    });
});

$(function(){
    $("div.navigation:even").addClass("odd");
    $("div.navigation:odd").addClass("even");
});


//extension
$(function(){

       $("div.section a[href$=pdf]").addClass("pdf");

       $("div.section a[href$=doc]").addClass("doc");

       $("div.section a[href$=xls]").addClass("xls");

       $("div.section a[href$=ram]").addClass("sound");

       $("div.section a[href$=mp3]").addClass("sound");

});

//fancybox
$(function(){
	$("a[href$='jpg'],a[href$='gif'],a[href$='png']").fancybox({
		'overlayOpacity':	'0.5',
		'overlayColor'	:	'#000'
	});
});

