<!--
	function domPupup() {
		this.className;

		this.caption		= 'Caption';
		this.closeText		= 'Close';
		this.body			= '';

		this.posX			= 0;
		this.posY			= 0;

		this.sizeX			= 0;
		this.sizeY			= 0;

		this.elementId		= Math.floor(Math.random() * 10000);

		this.centered		= false;
		this.confirmType	= null;
		this.confirmParams	= null;
		this.confirmCallback= false;

		this.setClassName = function(className) {
			this.className = className;

			this.popupContainer.id				= this.className+this.elementId;

			var classString = this.className;
			if(this.className != 'domPopup') classString = 'domPopup' + classString;

			this.popupContainer.className		= classString;
			this.popupHeaderContainer.className = classString+'Header';
			this.popupHeaderPane.className		= classString+'HeaderPane';
			this.popupHeaderControls.className	= classString+'HeaderControls';
			this.popupBodyContainer.className	= classString+'Body';
			this.popupBodyPane.className		= classString+'BodyPane';

			this.createHeader();
		}

		this.setCaption = function(newCaption) {
			this.caption = newCaption;
			this.createHeader();
		}

		this.setCloseText = function(newCloseText) {
			this.closeText = newCloseText;
			this.createHeader();
		}

		this.createHeader = function() {
			this.popupHeaderPane.innerHTML		= this.caption;
			this.popupHeaderControls.innerHTML	= '<span onclick="closeDomPopup(\''+this.className+this.elementId+'\');">'+this.closeText+'</span>';
		}

		this.setBody = function(newBody) {
			this.body = newBody;
			this.popupBodyPane.innerHTML = this.body;
		}

		this.setSizeXY = function(sizeX,sizeY) {
			this.sizeX = sizeX;
			this.sizeY = sizeY;
			this.popupContainer.setStyle({width: this.sizeX+'px',height: this.sizeY+'px'});
		}

		this.setPositionXY = function(posX,posY) {
			this.posX = posX;
			this.posY = posY;
			this.popupContainer.setStyle({top: this.posY+'px', left: this.posX+'px'});
		}

		this.setCentered = function(centered) {
			this.centered = centered;
		}

		this.setConfirm = function(confirmType, params, callback) {
			this.confirmType	= confirmType;
			this.confirmParams	= params;
			this.confirmCallback= callback;
		}

		this.display = function() {
			if(this.centered) {
				var dimensions	= document.viewport.getDimensions();
				var offsets		= document.viewport.getScrollOffsets();

				var posX = Math.floor((dimensions['width']/2)-(this.sizeX/2));
				var posY = Math.floor((dimensions['height']/2)-(this.sizeY/2));
				
				posX += offsets['left'];
				posY += offsets['top'];

				this.setPositionXY(posX,posY);
			}

			this.popupContainer.setStyle({display: 'block'});

			if(this.confirmType != null) {
				switch(this.confirmType) {
					case 'YESNO':
						var confirmBody = '';
						confirmBody += '<div class="confirmBody">';
						confirmBody += '<input type="button" onclick="confirmDomPopup(\''+this.className+this.elementId+'\',true);" value="'+this.confirmParams.yes+'">';
						confirmBody += '<input type="button" onclick="confirmDomPopup(\''+this.className+this.elementId+'\',false);"value="'+this.confirmParams.no+'">';
						confirmBody += '</div>';
						this.popupBodyPane.innerHTML = this.body + confirmBody;
					break;
				}
			}
		}

		this.hide = function() {
			this.popupContainer.setStyle({display: 'none'});
		}

		this.close = function() {
			this.popupContainer.setStyle({display: 'none'});

			var domPopup = $(this.className+this.elementId);
			domPopup.up().removeChild(domPopup);
		}

		this.popupContainer			= document.createElement('div');
		this.popupPane				= document.createElement('div');
		this.popupHeaderContainer	= document.createElement('div');
		this.popupHeaderPane		= document.createElement('div');
		this.popupHeaderControls	= document.createElement('div');
		this.popupBodyContainer		= document.createElement('div');
		this.popupBodyPane			= document.createElement('div');

		this.popupContainer.appendChild(this.popupPane);
		this.popupPane.appendChild(this.popupHeaderContainer);
		this.popupPane.appendChild(this.popupBodyContainer);
		this.popupHeaderContainer.appendChild(this.popupHeaderPane);
		this.popupHeaderContainer.appendChild(this.popupHeaderControls);
		this.popupBodyContainer.appendChild(this.popupBodyPane);

		Element.extend(this.popupContainer);
		Element.extend(this.popupHeaderPane);
		Element.extend(this.popupHeaderControls);

		this.popupContainer.setStyle({display: 'none', position: 'absolute', zindex: 1000});
		this.popupHeaderPane.setStyle({cssFloat: 'left', width: '60%'});
		this.popupHeaderControls.setStyle({cssFloat: 'right', textAlign: 'right', width: '30%'});

		this.setClassName('domPopup');

		this.popupContainer.domPopup = this;
		document.body.appendChild(this.popupContainer);
	}

	function confirmDomPopup(elementId,confirmResult) {
		var domPopup = $(elementId);
		if(domPopup) {
			var callback = domPopup.domPopup.confirmCallback;
			
			domPopup.domPopup.close();
			callback(confirmResult);
		}
	}

	function hideDomPopup(elementId) {
		var domPopup = $(elementId);
		if(domPopup) {
			domPopup.domPopup.hide();
		}
	}

	function closeDomPopup(elementId) {
		var domPopup = $(elementId);
		if(domPopup) {
			domPopup.domPopup.close();
		}
	}
-->