function loadlayer()
{
	// ajax通信時のローディングレイヤー
	$('<div id="loading_layer_front" />')
	.hide()
	.append(
		$('<div id="loading_layer_rear" />')
		.append('少々お待ちください。')
	)
	.appendTo('body');
	// htmlコンテンツ表示用レイヤー
	$('<div id="html_layer" />')
	.hide()
	.append(
		$('<div id="html_layer_rear" />')
		.attr('title','背景をクリックで閉じる')
		.click(function(){closelayer();})
	)
	.append($('<div id="html_layer_front" />'))
	.appendTo('body');
}
function resizelayer()
{
	var ww = $(this).width();
	var wh = $(this).height();
	$('#loading_layer_front')
	.css('top',$(window).scrollTop()+'px')
	.height(wh)
	.ajaxStart(function(event, XMLHttpRequest, options)
	{
		$(window).bind(
		'scroll',
		{'left':$(window).scrollLeft(),'top':$(window).scrollTop()},
		function(p)
		{
			window.scroll(p.data.left,p.data.top);
		});
		$('#loading_layer_front').show();
	})
	.ajaxStop(function(event, XMLHttpRequest, options)
	{
		if($('#html_layer').css('display') == 'none')
		{
			$(window).unbind('scroll');
		}
		$('#loading_layer_front').hide();
	});
	$('#loading_layer_rear').css('top',parseInt(wh/2)+20+'px');
	$('#html_layer_front').height(wh);
	$('#html_layer_rear').height(wh);
}
function closelayer()
{
	$(window).unbind('scroll');
	$('#html_layer').hide();
}
function loadhtml(url)
{
	resizelayer();
	$('#html_layer_front')
	.load(url,null,function(responseText, status, XMLHttpRequest)
	{
		/**
		 * 閉じる
		 */
		$('.close_btn').click(function()
		{
			closelayer();
		});
		/**
		 * 印刷
		 */
		$('.print_btn').click(function()
		{
			$('#html_layer_front').printArea();
		});
		$('#html_layer').show();
		// ie6用八苦
		if($.browser.msie && $.browser.version < 7)
		{
			$('#html_layer').css('margin-top',$(window).scrollTop()+'px');
			$('#html_layer_front').css('margin-top',$(window).scrollTop()+'px');
			$('#html_layer_rear').css('margin-top',$(window).scrollTop()+'px');
		}
		$(this)
		.scrollTop(0)
		.css('left',parseInt(($(window).width()-$(this).width())/2)+'px');
	});
	// gmap遅延ロード
	var wait_loading = function()
	{
		if($('#html_layer_front').css('display') == 'block')
		{
			clearInterval(timerID);
			loadgmap();
		}
	}
	var timerID = setInterval(wait_loading,500);
}
