/*==============================================================================
 float-window.js
 指定されたidを持つdivを中央に配置する
------------------------------------------------------------------------------*/
/*==============================================================================
 ウィンドウのサイズ確認
------------------------------------------------------------------------------*/
function float_window_blur( set_obj ){



}
/*==============================================================================
 ウィンドウのサイズ確認
------------------------------------------------------------------------------*/
function float_window_init( set_obj ){

	var size = document.viewport.getDimensions();
	stat = document.viewport.getScrollOffsets();

	//----- 表示サイズを計算
	if( set_obj.width.match( /([0-9]+)%$/ ) ){
		set_obj.width = parseInt( parseInt( size.width ) * parseInt( RegExp.$1 ) / 100 )
			+ 'px';
	}
	if( set_obj.height.match( /([0-9]+)%$/ ) ){
		set_obj.height = parseInt( parseInt( size.height ) * parseInt( RegExp.$1 ) / 100 )
			+ 'px';
	}

	if( set_obj.left.match( /([0-9]+)%$/ ) ){
		set_obj.left = parseInt( parseInt( size.width ) * parseInt( RegExp.$1 ) / 100 )
			+ parseInt( stat.left )
			+ 'px';
	}
	if( set_obj.top.match( /([0-9]+)%$/ ) ){
		set_obj.top = parseInt( parseInt( size.height ) * parseInt( RegExp.$1 ) / 100 )
			+ parseInt( stat.top )
			+ 'px';
	}

	$( set_obj.id ).style.top = set_obj.top;
	$( set_obj.id ).style.left = set_obj.left;
	$( set_obj.id ).style.width = set_obj.width;
	$( set_obj.id ).style.height = set_obj.height;
	$( set_obj.id ).style.display = 'block';

}

function float_window( set_html ){

	$( 'fw_content' ).innerHTML = set_html;
	$( 'float_window' ).style.display = 'block';

}

