$(document).ready(function(){
	/* ヘッダーリンクの線を削除
	----------------------------------------------- */
	$('li:last-child', '.links').css('border-right', 'none');
	
	
	/* マージン削除
	----------------------------------------------- */
	$('li:last-child', '#container-list').css('margin-right', '0'); // トップページ
	$('#lineup .lineup-list:nth-child(even)').css('margin-right', '0').after('<div class="clear"></div>');
	$('#lineup .equip-list').each(function(e){
		var i = (e + 1) % 3;
		if (i == 0) {
			$(this).css('margin-right', '0').after('<div class="clear"></div>');
		}
	});
	
	
	/* パンクズの矢印生成
	----------------------------------------------- */
	$('a', '#bread-body').each(function(){
		$(this).after('<span class="bread-arrow"></span>');
	});


	/* テーブルにボーダーをつける
	----------------------------------------------- */

	$('.form table th:first-child').each(function(){	// 1個とは限らない
		$(this).css('border-top', '1px solid #dcdddd');
	});
	$('#download table tr:last-child td').css('border-bottom', '1px solid #36a0d9');
	/*
	$('td:first', '#equip').css('border-top', '1px solid #dcdddd');
	$('th:last', '#equip').css('border-bottom', '1px solid #dcdddd');
	$('td:first', '.formtable').css('border-top', '1px solid #dcdddd');
	$('th:first', '.formtable').css('border-top', '1px solid #dcdddd');
	$('th:last', '.formtable').css('border-bottom', '1px solid #dcdddd');
	*/

	/* テーブル生成
	----------------------------------------------- */
	var numTable = $('td', '.lineup-header');


	/* 高さを均一化
	----------------------------------------------- */
	/*
	$('.equip-header', '#lineup').flatHeights();
	$('.equip-body', '#lineup').flatHeights();
	*/

    /* div要素を3つずつの組に分ける */
    var sets = [], temp = [];
    $('.equip-list .equip-header').each(function(i) {
        temp.push(this);
        if (i % 3 == 2) {
            sets.push(temp);
            temp = [];
        }
    });
    if (temp.length) sets.push(temp);
    $.each(sets, function() {
        $(this).flatHeights();
    });
	
	// 2箇所目
    var setsd = [], tempd = [];
    $('.equip-list .equip-desc').each(function(i) {
        tempd.push(this);
        if (i % 3 == 2) {
            setsd.push(tempd);
            tempd = [];
        }
    });
    if (tempd.length) setsd.push(tempd);
    $.each(setsd, function() {
        $(this).flatHeights();
    });


});

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-6093155-59']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
