// JavaScript Document
$(function(){

	$.fn.equalHeight = function() {
        tallest = 0;
        this.each(function(){
            thisHeight = $(this).height();
            if( thisHeight > tallest)
                tallest = thisHeight;
        });

        // set each items height to use the tallest value found
        this.each(function(){
            $(this).height(tallest);
        });
	}
	
	$('#class_detail li').equalHeight();
	
	$('#inner_navi li.lvl_1').pullDownList();
	$('#inner_navi li.lvl_2').pullDownList();
	$('#navi li.lvl_1').pullDownList();
	$('#navi li.lvl_2').pullDownList();
	/*
	$('#inner_navi li.lvl_1').hover(
		function(){$(this).find('ul').addClass('on');},
		function(){$(this).find('ul').removeClass('on');}
	);
	
	$('#navi li.lvl_1').hover(
		function(){$(this).children('ul').addClass('on');},
		function(){$(this).children('ul').removeClass('on');}
	);
	*/
	
	if($('ul.calender_list')){
		$('ul.calender_list').each(function(){
			var calarr = new Array();
			var step = 150;
			$(this).find('li').each(function(){
				calarr.push($(this));		 
			});
			for(var i=0; i<calarr.length; i++){
				var amr = i % 4;
				var stab = 0;
				if(amr == 3) stab = step * 2;
				calarr[i].css('margin-left',step * amr - stab);
			}
		});
	}
	
	
	
});

jQuery.extend(jQuery.fn,{
	pullDownList:function(){
		$(this).hover(
			function(){$(this).children('ul').addClass('on');},
			function(){$(this).children('ul').removeClass('on');}
		);
	}
});
