var html = '';

// サイト初期設定
$(function() {

//	// Google外部リンク
//	jQuery.each($('a.blank[href^="http:"], a.blank[href$=".pdf"]'), function() {
//		var url = $(this).attr('href').replace('http://', '');
//		$(this).click( function () { pageTracker._trackPageview('/outgoing/' + url); });
//	});

	// リンクの点線除去
	$("a").focus( function(){ if(this.blur)this.blur(); });

	// 別窓
	$('a.blank').click(function(){ this.target = "_blank"; });

	// 画像ロールオーバー
	$('img.imgover').rollover('_on');
	$('img.imgfade').mouseover(function () {
		$(this).animate({opacity:'0.6'}, {duration: "slow"} );
		$(this).animate({opacity:'1.0'}, {duration: "normal"});
	});

	// 小窓
	var winconfig = { mapwin: { height:700, width:800, center:1, resizable:0 } };
	$('a.popwin').popupwindow(winconfig);

	$('.two_column').each(function(){
		var point = parseInt($('li', this).size() / 2);
		var remnants = $('li', this).size() % 2;
		if (remnants > 0) point++;

		point -= 1;
		html = '<ul class="fl-l w250">';
		$('li:gt(' + point + ')', this).each(addLi);
		html += '</ul>';
		$(this).after(html);

		point += 1;
		html = '<ul class="fl-l w250">';
		$('li:lt(' + point + ')', this).each(addLi);
		html += '</ul>';
		$(this).after(html);

		$(this).remove();
	});

	$('.three_column').each(function(){
		var point = parseInt($('li', this).size() / 3);
		var remnants = $('li', this).size() % 3;
		if (remnants > 0) point++;

		var epoint = point * 2 - 1;
		html = '<ul class="fl-l w150">';
		$('li:gt(' + epoint + ')', this).each(addLi);
		html += '</ul>';
		$(this).after(html);

		var spoint = point - 1;
		html = '<ul class="fl-l w200">';
		$('li:gt(' + spoint + '):lt(' + point + ')', this).each(addLi);
		html += '</ul>';
		$(this).after(html);

		point = point;
		html = '<ul class="fl-l w200">';
		$('li:lt(' + point + ')', this).each(addLi);
		html += '</ul>';
		$(this).after(html);

		$(this).remove();
	});

});

function addLi () {
	html += '<li>' + $(this).html() + '</li>';
}

