

////////////////////////////////////////////////////////////////////////
// jquery-auto-height
////////////////////////////////////////////////////////////////////////
autoHeightFunction = function(){
	jQuery('#sectionA .leagueInfoIn2').autoHeight({column:2,clear:1});
	jQuery('#sectionA .detail').autoHeight({column:2,clear:1});
};


jQuery(autoHeightFunction);

/*
 * jquery-auto-height.js
 *
 * Copyright (c) 2010 Tomohiro Okuwaki (http://www.tinybeans.net/blog/)
 * Licensed under MIT Lisence:
 * http://www.opensource.org/licenses/mit-license.php
 * http://sourceforge.jp/projects/opensource/wiki/licenses%2FMIT_license
 *
 * Since:   2010-04-19
 * Update:  2010-07-02
 * version: 0.03
 * Comment: 
 *
 * jQuery 1.2 later
 * 
 */

 (function(jQuery){
    jQuery.fn.autoHeight = function(options){
        var op = jQuery.extend({
            column  : 0,
            clear   : 0,
            height  : 'minHeight',
            reset   : '',
            descend : function descend (a,b){ return b-a; }
        
        },options || {}); // optionsに値があれば上書きする

        var self = jQuery(this);
        var n = 0,
            hMax,
            hList = new Array(),
            hListLine = new Array();
            hListLine[n] = 0;
        var browser = jQuery.browser.version;

        // 要素の高さを取得
        self.each(function(i){
            if (op.reset == 'reset') {
                jQuery(this).removeAttr('style');
            }

            if (browser == '6.0') {
                jQuery(this).css('height','auto');
            } else {
                jQuery(this).css(op.height,'');
            }

            var h = jQuery(this).height();
            hList[i] = h;
            if (op.column > 1) {
                // op.columnごとの最大値を格納していく
                if (h > hListLine[n]) {
                    hListLine[n] = h;
                }
                if ( (i > 0) && (((i+1) % op.column) == 0) ) {
                    n++;
                    hListLine[n] = 0;
                };
            }
        });

        // 取得した高さの数値を降順に並べ替え
        hList = hList.sort(op.descend);
        hMax = hList[0];
        
        // 高さの最大値を要素に適用
        if (op.column > 1) {
            for (var j=0; j<hListLine.length; j++) {
                for (var k=0; k<op.column; k++) {
                    if (browser == '6.0') {
                        self.eq(j*op.column+k).height( hListLine[j] );
                        if (k == 0 && op.clear != 0) self.eq(j*op.column+k).css('clear','both');
                    } else {
                        self.eq(j*op.column+k).css( op.height, hListLine[j] );
                        if (k == 0 && op.clear != 0) self.eq(j*op.column+k).css('clear','both');
                    }
                }
            }
        } else {
            if (browser == '6.0') {
                self.height( hMax );
            } else {
                self.css( op.height, hMax );
            }
        }
    };
})(jQuery);




jQuery(function() {
  jQuery('#sectionA').find('div.leagueInfoIn2:odd').addClass('oddIn');
});

