//-------------------------------------------------------------------------------------------------
//ポップアップウインドウ

	function Popup(){

		var DEF_W		= 150;
		var DEF_H		= 150;
		var MAX_W		= 640;
		var MAX_H		= 640;
		var MIN_W		= 270;
		var MIN_H		= 50;
		var MENU_H		= 32;
		var SCREEN_W	= window.screen.width;
		var SCREEN_H	= window.screen.height;

	//-------------------------------------------
	//オープン

		this.open = function( url, type ){

			var top		= parseInt( ( SCREEN_H - DEF_H ) / 2, 10 );
			var left	= parseInt( ( SCREEN_W - DEF_W ) / 2, 10 );
			var name	= "_blank";
			var style	= "";

			style	+= "width=" + DEF_W + ",height=" + DEF_H;
			style	+= ",top=" + top + ",left=" + left;
			if( type == "print" ){
				style	+= ",directories=no,location=no,menubar=yes,resizable=yes,scrollbars=yes,status=no,toolbar=no";
			}else{
				style	+= ",directories=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no";
			}

			window.open( url, name, style );
		}

	//-------------------------------------------
	//リサイズ

		this.resize = function( flag, w, h ){

			if( w > MAX_W ){
				w = MAX_W;
			}else if( w < MIN_W ){
				w = MIN_W;
			}
			if( h > MAX_H ){
				h = MAX_H;
			}else if( h < MIN_H ){
				h = MIN_H;
			}

			var revise_w;
			var revise_h;

			if( isMac && isIE ){
				revise_w = 4;
				revise_h = 4;

			}else if(document.all){
				window.resizeTo( DEF_W, DEF_H );
				revise_w = DEF_H - document.body.clientWidth;
				revise_h = DEF_W - document.body.clientHeight;

			}else{
				revise_w = window.outerWidth - window.innerWidth;
				revise_h = window.outerHeight - window.innerHeight;
			}

			var width	= w + revise_w;
			var height	= h + revise_h;
			if( flag ) height += MENU_H;

			var x	= parseInt( ( SCREEN_W - w ) / 2 );
			var y	= parseInt( ( SCREEN_H - h ) / 2 );

			window.moveTo( x, y );
			window.resizeTo( width, height );
		}
	}

//-------------------------------------------------------------------------------------------------
