<!--
	function Popup() {
		this.ID = 'NINJAVA_POPUP_CONTENTS';
		this.popupElement = null;
		this.barElement = null;
		this.contentsElement = null;
		this.initialize = function() {		
			this.popupElement = document.createElement('DIV');
			this.popupElement.style.display = 'none';
			this.popupElement.style.position = 'absolute';
			this.popupElement.style.top = 0;
			this.popupElement.style.left = 0;
			this.popupElement.style.zIndex = CONST.POPUP_ZINDEX;
			this.barElement = document.createElement('DIV');
			this.barElement.id = 'NINJAVA_POPUP_BAR';
			this.popupElement.appendChild(this.barElement);
			this.contentsElement = document.createElement('DIV');
			this.contentsElement.id = this.ID;
			this.contentsElement.style.position = 'relative';
			this.contentsElement.style.top = 0;
			this.contentsElement.style.left = 0;
			this.popupElement.appendChild(this.contentsElement);
			document.body.appendChild(this.popupElement);
		}
		this.showTransparentGif = function() {
			var nullImage = document.getElementById("NINJAVA_NULL_IMG_DIV");
			if (nullImage == null) return;
			var _modal = false;
			if (this.popupElement.style.display != 'none') {
				var _popup = document.getElementById(this.ID);
				if (_popup != null) {
					var _popupInfoSpan  = getChildTag(_popup, 'SPAN', 'nj:popupInfo', false);
					if (_popupInfoSpan != null) {
						_modal = TAG_ATTRIBUTE.getBooleanAttribute(_popupInfoSpan, '_njModal');
			  	}
				}
			}
			if (_modal) {
				if (Browser.type == Browser.MSIE6) {
					disableSelectionList(this.contentsElement);
				}
				var scrollSize = getScrollSize();
				nullImage.firstChild.width  = scrollSize.width;
				nullImage.firstChild.height = scrollSize.height;
				nullImage.style.display = 'block';
				nullImage.style.visibility = 'visible';
			} else {
				nullImage.style.display = 'none';
				nullImage.style.visibility = 'hidden';
			}
		}
		this.show = function(show, sendElementPos) {
			var nullImage = document.getElementById("NINJAVA_NULL_IMG_DIV");
			if (show) {
				var _popupInfoSpan = getChildTag(this.contentsElement, 'SPAN', 'nj:popupInfo', false);
				var _positionType = 'CENTER';
				var _drag = false;
				if (_popupInfoSpan != null) {
					var _showBar = _popupInfoSpan.getAttribute('_njShowBar');
					if (_showBar == 'true') {
						var _barBgColor = _popupInfoSpan.getAttribute('_njBarBgColor');
						if (isNullString(_barBgColor)) {
							_barBgColor = '#8888ff';
						}
						this.barElement.style.backgroundColor = _barBgColor;
						var _barStyle = _popupInfoSpan.getAttribute('_njBarStyle');
						var _barTitle = _popupInfoSpan.getAttribute('_njBarTitle');
						var _showCloseButton = _popupInfoSpan.getAttribute('_njShowCloseButton');
						_innerHTML = '<table border="0" cellspacing="0" cellpadding="0"><tr><td style="background-color:' + _barBgColor + ';';
						if (isNotNullString(_barStyle)) {
							_innerHTML += _barStyle;
						}
						_innerHTML += '">';
						if (isNotNullString(_barTitle)) {
							_innerHTML += _barTitle;
						}
						_innerHTML += '</td>';
						if (_showCloseButton == 'true') {
							var _closeImage = _popupInfoSpan.getAttribute('_njCloseImage');
							if (isNullString(_closeImage)) {
								_closeImage = 'images/nj_close.jpg';
							}
							_innerHTML += '<td style="text-align:right;background-color:' + _barBgColor + ';"><img src="' + _closeImage + '" onmousedown="javascript:Popup.show(false);return false;"></td>';
						}
						_innerHTML += '</tr></table>';				  	
						this.barElement.innerHTML = _innerHTML;
						this.barElement.style.visibility = 'visible';
					} else {
						_showBar == 'false';
						this.barElement.style.visibility = 'hidden';
					}
					var _opacity = parseInt(_popupInfoSpan.getAttribute('_njOpacity'));
					if (_opacity > 0) {
						//this.popupElement.style.filter = 'alpha(opacity=' + _opacity + ')'; // for IE
						var _opacityPercent = _opacity / 100;
						this.popupElement.style.mozOpacity=_opacityPercent;
						this.popupElement.style.opacity=_opacityPercent;
					} else {
						//this.popupElement.style.filter = 'alpha(opacity=100)'; // for IE
						this.popupElement.style.mozOpacity=1.0;
						this.popupElement.style.opacity=1.0;
					}
					var _width = parseInt(_popupInfoSpan.getAttribute('_njWidth'));
					if (_width > 0) {
						this.barElement.style.width = _width;
						this.popupElement.style.width = _width;
					} else {
						this.barElement.style.width = '';
						this.popupElement.style.width = '';
					}
					_drag = TAG_ATTRIBUTE.getBooleanAttribute(_popupInfoSpan, '_njDrag');
					var _njPos = _popupInfoSpan.getAttribute('_njPos');
					if (_njPos == 'RELATIVE') {
						if (sendElementPos != null) {
							_positionType = 'RELATIVE';
							var _offsetX = parseInt(_popupInfoSpan.getAttribute('_njX'));
							var _offsetY = parseInt(_popupInfoSpan.getAttribute('_njY'));
							var scrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
							var scrollTop  = document.body.scrollTop  || document.documentElement.scrollTop;
							this.popupElement.style.left = sendElementPos.x + _offsetX + scrollLeft;
							this.popupElement.style.top  = sendElementPos.y + _offsetY + scrollTop;
						}
					} else if (_njPos == 'ABSOLUTE') {
						_positionType = 'ABSOLUTE';
						var _offsetX = parseInt(_popupInfoSpan.getAttribute('_njX'));
						var _offsetY = parseInt(_popupInfoSpan.getAttribute('_njY'));
						this.popupElement.style.left = _offsetX;
						this.popupElement.style.top  = _offsetY;
					}
				}								
				this.popupElement.style.display = 'block';
				if (_positionType == 'CENTER') {
					var _pos = getWindowOffset();
					var _windowSize = getWindowSize();
					var _popupWidth = this.barElement.offsetWidth;
					var _popupBarHeight = 0;
					if (_showBar == 'true') {
					  _popupBarHeight = this.barElement.offsetHeight;
					}
					var _popupContentsHeight = 0;
					try {
					  _popupContentsHeight = this.contentsElement.offsetHeight;
						if (_popupContentsHeight == 0) {
  						var _htmlDataViewSpan = this.contentsElement.childNodes[1].firstChild.firstChild;
  						_popupContentsHeight = getPixelValue(_htmlDataViewSpan.style.height);
  					}
					} catch (e) {
					}
					this.popupElement.style.left = _pos.x + (_windowSize.width - _popupWidth)/ 2;
					var scrollTop  = document.body.scrollTop  || document.documentElement.scrollTop;
					this.popupElement.style.top  = _pos.y + (_windowSize.height - _popupBarHeight - _popupContentsHeight)/ 2 + scrollTop;
				}
				if (Browser.type == Browser.MSIE6) {
					var _popupWidthHeight = new WidthHeight();
					_popupWidthHeight.width  = this.popupElement.offsetWidth;
					_popupWidthHeight.height = this.getContentsHeight(this.contentsElement, 0);
					if (_showBar == 'true') {
					  _popupWidthHeight.height += this.getContentsHeight(this.barElement, 0);
					}
					Drag.setDragWidthHeight(_popupWidthHeight.width, _popupWidthHeight.height);
					Drag.setDragElement(this.popupElement);
					Drag.hideSelectionList(this.popupElement, _popupWidthHeight.width, _popupWidthHeight.height);
				}
				var _dragElement;
				if (_showBar == 'true') {
				  _dragElement = this.barElement;
				} else {
				  _dragElement = this.contentsElement;
				}
				if (_drag) {
					Drag.setPositionElement(this.popupElement);
					Drag.setEventListenElement(_dragElement);
					addListener(_dragElement, 'mousedown', Drag.dragStart, false);					
				} else {
					removeListener(_dragElement, 'mousedown', Drag.dragStart, false);
				}
				//this.popupElement.focus();
				if (Browser.type != Browser.MSIE6) {
					this.popupElement.style.display = 'none';
					new Effect.Appear(this.popupElement, { 
						from:0.0, 		// 開始時透明度 
			    		to:1.0, 		// 終了時透明度 
			    		delay:0, 		// 開始までの秒数 
		    			fps:30, 		// フレームレート 
		    			duration: 0.5 	// アニメーションする時間(秒) 
					});
				}
	    	} else {
				this.popupElement.style.display = 'none';
				if (nullImage != null) {
					nullImage.style.display = 'none';
					nullImage.style.visibility = 'hidden';
				}
				if (Browser.type == Browser.MSIE6) {
					enableSelectionList(null);
				}
				Drag.showSelectionList();
			}
			if (this.barElement.style.visibility == 'visible') {
				if (isNullString(this.barElement.style.width)) {
					this.barElement.style.width = this.contentsElement.offsetWidth;
				}
				// <table><tr><td style="width:100%;">
				this.barElement.firstChild.firstChild.firstChild.firstChild.style.width = '100%';
			}
		}
		this.getContentsHeight = function(element, depth) {
			var _children = element.childNodes;
			if (_children == null || _children.length < 1) {
				return 0;
			}
			var _height = 0;
			for (var i=0; i<_children.length; i++) {
				var _child = _children[i];
				if (depth == 0 && i == 0 && _child.tagName == 'SPAN') continue;
				if (_child.offsetHeight > 0) {
					_height += _child.offsetHeight;
				} else {
					_height += this.getContentsHeight(_child, depth+1);
				}
			}
			return _height;
		}
		return this;
	}
//-->

