
$.fn.adjustPageHeight = function()
{
	var bg = $('#BG');
	var content = $('#CONTENT');
	var isIE6 = bg.data('isIE6');
	var ih = $('html').innerHeight() - (isIE6?1:0);
	var prop = isIE6 ? 'height' : 'min-height';
	if(content.outerHeight() < ih) bg.css(prop, ih);
	else bg.css(prop, 'auto');
	return this;
};

$.fn.adjustBoxHeight = function()
{
	var prop = $('#BG').data('isIE6') ? 'height' : 'min-height';
	var max = 0;
	this.each(function()
	{
		var h = $(this).height();
		if(max < h) max = h;
	});
	return this.each(function()
	{
		$(this).css(prop, max);
	});
};

$(function()
{
	var jq = jQuery.browser;
	$('#BG').data('isIE6', (jq.msie && jq.version=='6.0')?true:false);
	
	$.fn.adjustPageHeight();
	$(window).resize($.fn.adjustPageHeight);
	
	var selector = $.browser.safari ? 'body' : 'html';
	$('p.pagetop a').click(function()
	{
		$(selector).animate({scrollTop:0}, 'fast');
		return false;
	});
	
	$('#CONTENT-BODY div.h2-binder:has(p.date)').each(function()
	{
		var self = $(this);
		var p = self.children('p.date:first');
		p.css('top', Math.round(self.innerHeight()/2 - p.height()/2));
		var pw = p.width();
		self.children('h2').css('margin-right', pw+20);
		p.width(pw+10);
	});
	
	$('#CONTENT-BODY dl.annotation dt').append('：');
});

function popup($id)
{
	var path = '/help/h_subwin.html';
	window.open(path+'?id='+$id, 'magnification', 'scrollbars=yes,resizable=yes,width=840,height=670').focus();
}

function popupFullScreen($url)
{
	var options = 'scrollbars=yes,resizable=yes';
	if(jQuery.browser.msie) options += ',fullscreen=yes';
	else options += (',width=' + screen.availWidth + ',height=' + screen.availHeight);
	window.open($url, 'fullwin', options).focus();
}
