 function Overlay(divId) {
	 this.inheritFrom = GenericDialog;
		this.inheritFrom(divId);
	}
	var oCorner;
	function CornerDiv(divId,corner,offset) {
	 this.inheritFrom = Overlay;
		this.inheritFrom(divId);
		this.corner = corner;
		this.offset = offset;
		this.attachAtCorner = function() {
		 var w = parseInt(this._objDiv.style.width);
		 var h = parseInt(this._objDiv.style.height);
			var y = this.adjustY();
			this._objDiv.style.top = y + 'px';
			this._objDiv.style.left = this.adjustX(w)	+ 'px';
			this._objDiv.style.display = 'block';
			oCorner = this;
   if(document.all) {
 			document.body.onscroll = cornerDivScroll;
			}
			else {
			 document.onscroll = cornerDivScroll;
			}
		}
		this.adjustX = function(w) {
			var x;
			var factor = 0;
			if(this.corner == 'right-top' || this.corner == 'right-bottom') {
			 x = this.screenWidth();
				if(x>1024) {
					x = x - parseInt(((x-1024)/2));
					if(document.all) factor = 10; else factor = 8;
				}
				else {
					if(document.all) factor = 22; else factor = 18;
				}
			}
			else {
				x = 0;
			}
			if(document.all) {	x -= (w + factor);	}
			else { x -= (w + factor); }
			return x;
		}
		this.adjustY = function() {
			var y = this.getScrollTop();
			if(this.corner == 'right-top') {
				if(this.offset > 0) {
					if(y < this.offset) y = this.offset;
				}
			}
			return y;
		}
		function cornerDivScroll(e) {
			var y = oCorner.adjustY();
   oCorner._objDiv.style.top = y + 'px';
			//if(e) { e.cancelBubble = true; }
			//else {	event.cancelBubble = true; }
		}
	}