/*
name: workspace.UI
extends: workspace
*/
workspace.UI = {}
workspace.UI._construct = function() 
{
		
	function displayXMLBoundForm(Data, FormID)
	{
		var oData = Data.cloneNode(true)
		var oXML = window.showModalDialog("/managedJS/workspace/UI/formDialog.asp?fromURL=" + escape(window.location.pathname) + "&formID=" + escape(FormID), oData)
		if(oXML)
		{
			Data.parentNode.replaceChild(oXML, Data )
			return oXML
		}
	}
		
	function getNewWindow(url, x , y, menu, toolbar, status)
	{
		if (typeof(arguments[1]) == 'object')
			return fnUrlOptions.apply(this, arguments)
		else
			return fnLegacy.apply(this, arguments)
		
		function fnUrlOptions(url, options)
		{
			var sWindowName  = 'newwind' + (new Date()).getTime();
			
			if (options.width == null) options.width = 700
			if (options.height == null) options.height = 500
			
			if (options.center)
			{
				options.left =(screen.availWidth / 2) - (options.width / 2);
				options.top = (screen.availHeight / 2) - (options.height / 2);
			}
			else
			{
				if (options.left == null) options.left = 15
				if (options.top == null) options.top = 15
			}
			
			if (options.resizable == null) options.resizable = true
			if (options.scrollbars == null) options.scrollbars = true
			if (options.location == null) options.location = false
			if (options.personalbar == null) options.menubar = false
			if (options.menubar == null) options.location = false
			if (options.toolbar == null) options.toolbar = false
			if (options.status == null) options.status = false
			
			var sOptions = ''
			for (var key in options)
			{
				sOptions += key + '=' + fnOptionValue(key) + ','
			}
			sOptions = sOptions.slice(0, -2)
			function fnOptionValue(key)
			{
				if (typeof(options[key]) == 'boolean')
					return options[key] ? 'yes' : 'no'
				else
					return options[key]
			}
			
			var oWinCur = (window.dialogArguments && dialogArguments.window) ? dialogArguments.window : window
			var oWin = oWinCur.open(workspace.dealiasUrl(url), sWindowName, sOptions);
					
			if (oWin) oWin.focus()

			return oWin

		}
		
		function fnLegacy(url, x , y, menu, toolbar, status)
		{
			return fnUrlOptions(url, {width: x, height: y, menubar: menu, toolbar: toolbar, status: status})			
		}
	}

	function getMaxWindowOptions()
	{
		return {left:5, top:5, width: window.screen.availWidth - 10, height: window.screen.availHeight - 10}
	}

	function newMaxWindow(url)
	{				
		getNewWindow(url, getMaxWindowOptions())
	}

	function newPopup(style)
	{
		if (!style) style = "border:solid black 1px; margin:0; overflow:hidden";

		var oPopup = window.createPopup()
		var oPopupDoc = oPopup.document;
		var oPopupWin = oPopupDoc.parentWindow
	  
		oPopupDoc.body.style.cssText = style

		for (var i=0; i < document.styleSheets.length; i++)
		{
			var sheet = oPopupDoc.createStyleSheet(document.styleSheets[i].href)
			if (!sheet.href) sheet.cssText = document.styleSheets[i].cssText
		}

		oPopupWin.workspace = workspace
		oPopupWin.cleanUpItems = new Array()

		function doWorkspaceCleanup()
		{
			var cleanUpItems = oPopupWin.cleanUpItems
			for (var i = 0; i < cleanUpItems.length; i++)
			{
				try
				{	
					oPopupWin.cleanUpItems[i].cleanUp()
				}
				catch(e)
				{}
			}
			oPopupWin.detachEvent("onunload", doWorkspaceCleanup);
		}
		oPopupWin.attachEvent("onunload", doWorkspaceCleanup)

		return oPopup
	}

	function getAncestor(elem, sTagName)
	{
		sTagName = sTagName.toUpperCase()

		while (elem != null)
		{
			elem = elem.parentNode
			if (elem && elem.tagName == sTagName) break;		
		}
		return elem
	}

	function getAncestorOrSelf(elem, sTagName)
	{
		sTagName = sTagName.toUpperCase()

		while (elem != null)
		{
			if (elem.tagName == sTagName) break;		
			elem = elem.parentNode
		}
		return elem
	}

	function getNextNode(elem)
	{
		var elemNext = elem.nextSibling
		while (!elemNext && elem)
		{
			elem = elem.parentNode
			elemNext = elem ? elem.nextSibling : null
		}
		return elemNext
	}
	
	function getNextElem(elem)
	{
		var elemNext = getNextSiblingElem(elem)
		while (!elemNext && elem)
		{
			elem = elem.parentNode
			elemNext = elem ? getNextSiblingElem(elem) : null
		}
		return elemNext
	}
	
	function getFirstChildElem(elem)
	{
		var elemChild = elem.firstChild
		return (elemChild.nodeType != 1) ? getNextSiblingElem(elemChild) : elemChild
	}
	
	function getNextSiblingElem(elem)
	{
		var elemSibling = elem.nextSibling
		while (elemSibling && elemSibling.nodeType !=1)
		{
			elemSibling = elemSibling.nextSibling
		}
	}
		
	function getRelativePos(elem, container)
	{
		if (!container) container = document.body
		
		var oPoint = new Point(elem.offsetLeft, elem.offsetTop)
		
		for (elem = elem.offsetParent; elem != null && elem != container; elem = elem.offsetParent)
			oPoint.x += (elem.offsetLeft - elem.scrollLeft), oPoint.y += (elem.offsetTop - elem.scrollTop)
		
		if (elem) oPoint.x -= elem.scrollLeft, oPoint.y -= elem.scrollTop
		
		return oPoint
	}
	
	function scrollRequired(container, elem)
	{			
		if (elem.offsetTop < container.scrollTop)
			return true;
			
		if (elem.offsetTop + elem.offsetHeight > container.scrollTop + container.clientHeight)
			return true;
	}

	function Point(x, y)
	{
		if (x != null)
		{
			if (y == null)
			{
				if (x.isString)
				{
					var arr = x.split(',')
					x = arr[0].toInt()
					y = arr[1].toInt()
				}
				else
					y = x.y, x = x.x
			}
			
			this.x = x, this.y = y
		}
	}
	Point.prototype.add = function(x, y)
	{
		if (arguments.length == 1) return this.add(x.x, x.y)
		return new Point(this.x + x, this.y + y)		
	}
	Point.prototype.shift = function(x, y)
	{
		this.x += x
		this.y += y
	}
	
	function Size(w, h)
	{
		if (w != null)
		{
			if (h == null)
			{
				if (w.isString)
				{
					var arr = w.split(',')
					w = arr[0].toInt()
					h = arr[1].toInt()
				}
				else
					w = x.w, h = x.h
			}		
			this.w = w, this.h = h
		}
	}
	Size.prototype.add = function(w, h)
	{
		if (arguments.length == 1) return this.add(x.w, x.h)
		return new Point(this.w + w, this.h + h)		
	}
	
	var Alignment = {start:1, adjacent:2, end:3}
	
	function Rectangle()
	{				
		switch(arguments.length)
		{
			case 1: return fnElem.apply(this, arguments);
			case 2: return fnPointSize.apply(this, arguments);
			case 4: return fnCoords.apply(this, arguments);
		}
				
		function fnElem(elem)
		{
			this.x = elem.offsetLeft;
			this.y = elem.offsetTop;
			this.w = elem.offsetWidth;
			this.h = elem.offsetHeight;
		}
		
		function fnPointSize(point, size)
		{
			this.x = point.x
			this.y = point.y
			this.w = size.x
			this.h = size.y
		}
		
		function fnCoords(x, y, w, h)
		{
			this.x = x;
			this.y = y;
			this.w = w;
			this.h = h;
		}
	}
	Rectangle.prototype.getAlignmentWith = function(rect, hAlign, vAlign)
	{
		var retVal = new Point();
		switch(hAlign)
		{
			case Alignment.start: retVal.x = rect.x - this.x; break;
			case Alignment.adjacent: retVal.x = rect.x + rect.w - this.x; break;
			case Alignment.end: retVal.x = rect.x + rect.w - this.x - this.w; break;
		}

		switch(vAlign)
		{
			case Alignment.start: retVal.y = rect.y - this.y; break;
			case Alignment.adjacent: retVal.y = rect.y + rect.h - this.y; break;
			case Alignment.end: retVal.y = rect.y + rect.h - this.y - this.h; break;
		}
		
		return retVal;
	}
	Rectangle.prototype.shift = function(x, y)
	{
		if (arguments.length == 1) y = x.y, x = x.x
		this.x += x
		this.y += y
	}
	Rectangle.prototype.moveTo = function(x, y)
	{
		if (arguments.length == 1) y = x.y, x = x.x
		this.x = x;
		this.y = y;
	}
	Rectangle.prototype.getPos = function()
	{
		return new Point(this.x, this.y);
	}
	Rectangle.prototype.putPos = Rectangle.prototype.moveTo
	Rectangle.prototype.getSize = function()
	{
		return new Size(this.w, this.h);
	}
	Rectangle.prototype.putSize = function(w, h)
	{
		if (arguments.length == 1) h = w.h, w = w.w
		this.w = w; 
		this.h = h;
	}
	Rectangle.Alignment = Alignment;

	function isDescendantOf(elem, ancestor)
	{
		while(elem)
		{
			if(elem == ancestor) return true;
			elem = elem.parentNode;
		}
		return false;	
	}

	var mlScrollerSize = 0;
	var mdivScrollerSize = null
	function getScrollerSize()
	{
		if (mlScrollerSize != 0) return mlScrollerSize
		
		if (mdivScrollerSize == null)
		{			
			mdivScrollerSize = document.createElement('div');
			mdivScrollerSize.style.position = 'absolute';
			mdivScrollerSize.style.top = '-1000px';
			mdivScrollerSize.style.left = '-1000px';
			mdivScrollerSize.style.width = '100px';
			mdivScrollerSize.style.height = '100px';
			mdivScrollerSize.style.overflow = 'auto';

			var inn = document.createElement('div');
			inn.style.width = '2000px';
			inn.style.height = '200px';

			mdivScrollerSize.appendChild(inn);
			document.body.appendChild(mdivScrollerSize);
		}	
		
		mlScrollerSize = mdivScrollerSize.offsetWidth - mdivScrollerSize.clientWidth;
			
		if (mlScrollerSize != 0 ) document.body.removeChild(mdivScrollerSize);

		return mlScrollerSize
	}
	
	function resizeParentIFrame()
	{
    if (window != window.parent) 
    {    
			var parentFrames = window.parent.frames
      var parentFrame = null;
      
      for (var i=0, length = parentFrames.length; i < length; i++)
      {
        // Try block is to prevent cross site scripting issues
				try
				{
					if (parentFrames[i].window == window)
					{
						parentFrame = parentFrames[i];
						break;
					}
				}
				catch(e){}
			}
			
      var bResize = false
      // Try block is to prevent cross site scripting issues
      try
      {
          bResize = (parentFrame && parentFrame.frameElement.getAttribute("autoResize"));
      }
      catch(e){}
            

			if(bResize)
			{
				function getWidthAdjustment(elem)
				{
					var style = elem.currentStyle
					var n = 0
		
					return (isNaN(n = parseInt(style.borderLeftWidth)) ? 0 : n) +
						(isNaN(n = parseInt(style.borderRightWidth)) ? 0 : n)
				}
				
				var fraElement =  parentFrame.frameElement
				var parentElem = fraElement.parentNode
				
				var style = fraElement.style
				
				//style.width = parentElem.offsetWidth - getWidthAdjustment(parentElem)
				/*
				if (fraElement.previousSibling.className == 'bandSeperator')
					style.width = fraElement.previousSibling.offsetWidth
				else
					style.width = "100%"
				*/
				style.height = document.body.scrollHeight;		
			}
		}
	}
	
	function invokeByClass()
	{
	if((/\bEmail\b/).test(this.className))
	    {
	    newEmail(this.innerText)
	    }
	if((/\bPhone\b/).test(this.className))
	    {
	    makeTAPICall(this.innerText)
	    }
	}
	
	function makeTAPICall(phoneNumber)
	{
	    try
	    {
	        var oTAPI = new ActiveXObject("uniTAPI.TAPI")

            oTAPI.dialNumber(phoneNumber)
	    }
	    catch(e)
	    {
	        alert("You do not have the Telephone (TAPI) interface installed");
	    }
	
	}

    function newEmail(emailAddress)
    {
        var mailto_link = 'mailto:' + emailAddress;
        win = workspace.UI.getNewWindow(mailto_link, 'emailWindow');
    }

    // Purpose: Replication of the old 'newForm' function
    function showForm(astrFormName, astrParams)
    {
        var strForm = new String(astrFormName);
        var strParam = (astrParams == null ? null : new String(astrParams));
        var objDialog;
        var objU2;
        var tWin = window;

        while (tWin.parent != tWin)
        {
            tWin = tWin.parent;
        }

        if (tWin.navigator.union2)
        {
            objU2 = tWin.navigator.union2;
        } else
        {
            alert('Cannot connect to Client Components')
            return this;
        }

        var objUF = objU2.uniforms.item(strForm)
        var wNew = showModelessDialog('/forms/form_view.asp', /*this*/null, 'status:no;dialogWidth:' + (objUF.pixelWidth + 5) + 'px;dialogHeight:' + (objUF.pixelHeight + 25) + 'px;scrollbars:no;resizable:yes')

        function fnDialogLoaded()
        {
            wNew.navigator.union2 = objU2
            wNew.loadForm(sForm, sParam)
        }

        this.dialogLoaded = fnDialogLoaded
    }

    // Purpose: Find an array of nodes matching the nodenames provided underneath the root node
    function recursiveFindNodes(nodeNames, node, output)
    {
        if (node != null && nodeNames.length)
        {
            if (node.nodeType == 1)
            {
                for (var i = 0; i < node.childNodes.length; i++)
                {
                    var childNode = node.childNodes[i];
                    if (childNode.nodeType == 1)
                    {
                        var correctNodeName = false;
                        for (var j = 0; j < nodeNames.length; j++)
                        {
                            if (childNode.nodeName.toLowerCase() == nodeNames[j].toLowerCase())
                            {
                                correctNodeName = true;
                                break;
                            }
                        }

                        if (correctNodeName)
                        {
                            output.push(childNode); 
                        }
                        else
                        {
                            recursiveFindNodes(nodeNames, childNode, output);
                        }

                        correctNodeName = j = null;
                    }
                    childNode = null;
                }
                i = null;
            }
        }
    }

    // Purpose: Find a single node matching the id or name provided underneath the root node
    function recursiveFindNode(node, id, name)
    {
        if (typeof id == "undefined")
        {
            id = null;
        }

        if (typeof name == "undefined")
        {
            name = null;
        }

        var outputNode = null;
        if (node != null)
        {
            if (node.nodeType == 1)
            {
                for (var i = 0; i < node.childNodes.length; i++)
                {
                    var childNode = node.childNodes[i];
                    if (childNode.nodeType == 1)
                    {
                        if (childNode.name == name || childNode.id == id)
                        {
                            outputNode = childNode;

                            if (outputNode != null)
                            {
                                break;
                            }
                        }
                        else
                        {
                            outputNode = recursiveFindNode(childNode, id, name);

                            if (outputNode != null)
                            {
                                childNode = null;
                                break;
                            }
                        }
                    }
                    childNode = null;
                }
                i = null;
            }
        }

        return outputNode;
    }

    this.displayXMLBoundForm = displayXMLBoundForm
    this.getNewWindow = getNewWindow
    this.newDialog = function() { getNewWindow.apply(this, arguments); }
    this.newWindow = function() { getNewWindow.apply(this, arguments); }
    this.newForm = showForm;
    this.newMaxWindow = newMaxWindow
    this.newPopup = newPopup
    this.getAncestor = getAncestor
    this.getAncestorOrSelf = getAncestorOrSelf
    this.isDescendantOf = isDescendantOf;
    this.getNextNode = getNextNode
    this.getNextElem = getNextElem
    this.getFirstChildElem = getFirstChildElem
    this.getNextSiblingElem = getNextSiblingElem
    this.getRelativePos = getRelativePos
    this.scrollRequired = scrollRequired
    this.getScrollerSize = getScrollerSize
    this.keyCode = { bs: 8, enter: 13, space: 32, pageUp: 33, pageDown: 34, end: 35, home: 36, left: 37, up: 38, right: 39, down: 40, del: 46 }
    this.buttonCode = { left: 1, right: 2, middle: 3 }
    this.resizeParentIFrame = resizeParentIFrame
    this.Point = Point
    this.Size = Size
    this.Rectangle = Rectangle
    this.invokeByClass = invokeByClass
    this.recursiveFindNodes = recursiveFindNodes;
    this.recursiveFindNode = recursiveFindNode;

}
workspace.UI._construct()

workspace.UI._fixupMozilla = function()
{	
	var masMouseEvents = ["mouseover", "mouseout", "mousemove", "mousedown", "mouseup", "click", "dblclick"]
	var masKeyEvents = ["keydown", "keyup", "keypress"]
	var masNavEvents = ["focus", "blur", "change", "scroll"]
	
	fixupEvent()
	fixupMouseEvent()
	fixupHTMLElement()
	fixupHTMLDocument()
	fixupCSSStyleDeclaration()
	
	var moCompatibleEvents = {}
	
	function addCompatibleEvent(name)
	{
		if (!moCompatibleEvents[name])
		{
			moCompatibleEvents[name] = true;
			window.addEventListener(name, compatibleEvent, true)
		}
	}
	
	function removeCompatibleEvent(name)
	{
		if (moCompatibleEvents[name])
		{
			moCompatibleEvents[name] = false
			window.removeEventListener(name, compatibleEvent, true)
		}
	}
	
	function compatibleEvent(ev) { window.event = ev; }
	
	masMouseEvents.forEach(addCompatibleEvent)
	masKeyEvents.forEach(addCompatibleEvent)
	masNavEvents.forEach(addCompatibleEvent)
	
	workspace.UI.addCompatibleEvent = addCompatibleEvent
	workspace.UI.removeCompatibleEvent = removeCompatibleEvent
	
	function fixupEvent()
	{
		Event.prototype.__defineSetter__("cancelBubble", function(value)
		{
			if (!this._cancelBubble || value) this._cancelBubble = value
			if (value) this.stopPropagation();
		}	)
		Event.prototype.__defineGetter__("cancelBubble", function()
		{
			return this._cancelBubble;
		} )
		Event.prototype.__defineSetter__("returnValue", function(value)
		{
			this._returnValue = value
			if (!value) this.preventDefault();
		} )
		Event.prototype.__defineGetter__("returnValue", function()
		{
			return this._returnValue;
		} )
		Event.prototype.__defineGetter__("srcElement", function() { return this.target; }	)
	}
	
	function fixupMouseEvent()
	{
		MouseEvent.prototype.__defineGetter__("fromElement", function()
		{
			var node = this.type = "mouseover" ? this.relatedTarget : this.type = "mouseout" ? this.target : null;
		  return node ? (node.nodeType == 3 ? node.parentNode : node) : null  ;
			
		} )
		
		MouseEvent.prototype.__defineGetter__("toElement", function()
		{
			var node = this.type = "mouseout" ? this.relatedTarget : this.type = "mouseover" ? this.target : null;
		  return node ? (node.nodeType == 3 ? node.parentNode : node) : null  ;
			
		} )

		MouseEvent.prototype.__defineGetter__("offsetX", function() { return this.layerX; } )
		MouseEvent.prototype.__defineGetter__("offsetY", function() { return this.layerY; } )
	}


	function fixupHTMLElement()
	{ 

		var bCaptureActive = false
		
    function capture(e)
    { 
	    if (bCaptureActive) return 
	    bCaptureActive = true; 
	    
	    e.stopPropagation();
	    if (e.cancelable) e.preventDefault();
	    
	    var eNew = document.createEvent("MouseEvents"); 
	    eNew.initMouseEvent(e.type, e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,  e.button, e.relatedTarget); 
	    window.capturingElement.dispatchEvent(eNew); 
	    
	    bCaptureActive = false; 
    }

		HTMLElement.prototype.setCapture = function()
		{ 
	    if (window.capturingElement) window.capturingElement.releaseCapture
	    
	    window.capturingElement = this; 
	    var bActive = false; 
	    	    
	    for (var i=0; i < masMouseEvents.length; i++)
  			window.addEventListener(masMouseEvents[i], capture, true); 
		}

		HTMLElement.prototype.releaseCapture = function()
		{ 
	    for (var i=0; i < masMouseEvents.length; i++)
				window.removeEventListener(masMouseEvents[i], capture, true); 

	    window.capturingElement = null; 
		} 
	
		HTMLElement.prototype.__defineGetter__("innerText", function () { return this.textContent; })
		
		HTMLElement.prototype.__defineSetter__("innerText", function (inputText) { this.textContent = inputText; })
		
		HTMLElement.prototype.__defineSetter__("outerHTML", function (inputValue)
		{
		   var range = this.ownerDocument.createRange();
		   Range.setStartBefore(this);
		   var df = Range.createContextualFragment(inputValue);
		   this.parentNode.replaceChild(df, this);
		})

		HTMLElement.prototype.__defineGetter__("outerHTML", function ()
		{
			var attrs = this.attributes;
			var str = "<" + this.tagName;

			for (var i = 0; i < attrs.length; i++)
				str += " " + attrs[i].name + "=\"" + attrs[i].value + "\"";

			   
			if (_emptyTags[this.tagName])
				return str + ">";
		   
		   return str + ">" + this.innerHTML + "</" + this.tagName + ">";
		})
				
		HTMLElement.prototype.__defineSetter__("outerText", function (value)
		{
		  var oNode = document.createTextNode(value);		  
		  this.parentNode.replaceNode(oNode, this);
		})

		HTMLElement.prototype.insertAdjacentElement = function(sWhere, oElement)
		{
			switch (sWhere)
			{
				case "beforeBegin":
					this.parentNode.insertBefore(oElement, this);
				break;

				case "afterBegin":
					this.insertBefore(oElement, this.firstChild);
				break;

				case "beforeEnd":
					this.appendChild(oElement);
				break;

				case "afterEnd":
					this.parentNode.insertBefore(oElement, this.nextSibling);
				break;			
			}
		}
		
		HTMLElement.prototype.insertAdjacentHTML = function (sWhere, sText)
		{
		   
			var fragment;   
			var range = this.ownerDocument.createRange();

			switch (sWhere)
			{  
				case "beforeBegin":
					range.setStartBefore(this);
					fragment = range.createContextualFragment(sText);
					this.parentNode.insertBefore(fragment, this);
				break;

				case "afterBegin":
					range.selectNodeContents(this);
					range.collapse(true);
					fragment = range.createContextualFragment(sText);
					this.insertBefore(fragment, this.firstChild);
				break;

				case "beforeEnd":
					range.selectNodeContents(this);
					range.collapse(false);
					fragment = range.createContextualFragment(sText);
					this.appendChild(fragment);
				break;

				case "afterEnd":
					range.setStartAfter(this);
					fragment = range.createContextualFragment(sText);
					this.parentNode.insertBefore(fragment, this.nextSibling);
				break;
		   
		  }   
		}

		HTMLElement.prototype.insertAdjacentText = function (sWhere, sText)
		{
			var oNode = document.createTextNode(sText)
			this.insertAdjacentElement(sWhere, oNode);
		}

		HTMLElement.prototype.__defineGetter__("all", function() { return this.getElementsByTagName("*"); } );
		
		HTMLElement.prototype.__defineGetter__("parentElement", function () 
		{
			if (this.parentNode == this.ownerDocument) return null;
			return this.parentNode;
		})

		HTMLElement.prototype.__defineGetter__("children", function () { return new HTMLNodeList(this, "*"); })
	
		HTMLElement.prototype.__defineGetter__("currentStyle", function () { return window.getComputedStyle(this, ''); })	
		
		function HTMLNodeList(node, XPath)
		{
			var doc = node.ownerDocument == null ? node : node.ownerDocument
			var nsResolver = doc.nsResolver ? doc.nsResolver : doc.nsResolver = document.createNSResolver(doc.documentElement)

			this.result = doc.evaluate(XPath, node, nsResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE , null)
		}
		HTMLNodeList.prototype.__defineGetter__("length", function() { return this.result.snapshotLength; } )
		HTMLNodeList.prototype.item = function(index)
		{
			if (index >= 0 && index < this.result.snapshotLength)
				return this.result.snapshotItem(index)
			else
				return null
		}
	}
	
	function fixupHTMLDocument()
	{
		HTMLDocument.prototype.__defineGetter__("all", function() {return this.getElementsByTagName("*"); } );
	}
	
	function fixupCSSStyleDeclaration()
	{
		CSSStyleDeclaration.prototype.__defineGetter__("pixelLeft", function() { return parseInt(this.left); })
		CSSStyleDeclaration.prototype.__defineSetter__("pixelLeft", function(value) {	this.left = value.toString() + "px"; })
		CSSStyleDeclaration.prototype.__defineGetter__("pixelTop", function() { return parseInt(this.top); })
		CSSStyleDeclaration.prototype.__defineSetter__("pixelTop", function(value) { this.top = value.toString() + "px"; })
		CSSStyleDeclaration.prototype.__defineGetter__("pixelWidth", function() { return parseInt(this.width); })
		CSSStyleDeclaration.prototype.__defineSetter__("pixelWidth", function(value) { this.width = value.toString() + "px"; })
		CSSStyleDeclaration.prototype.__defineGetter__("pixelHeight", function() { return parseInt(this.height); })
		CSSStyleDeclaration.prototype.__defineSetter__("pixelHeight", function(value) { this.height = value.toString() + "px"; })	
	}

}
if (!workspace.isIE) workspace.UI._fixupMozilla()
