  var g_markerId = 0;
		var g_ptToPx = 4.8;
		
		var g_wfix=0;
		
  function setOuterHTML( o, html ) 
  {
	   o.parentNode.replaceChild( dressHtml(html),o );
  }
  function getOuterHTML(o)
		{		   
					var att = o.attributes;
					var tag = "<" + o.nodeName;
					for ( i=att.length-1; i >=0 ; i--)
					{					  
					  tag += " " + att[i].nodeName + "='" +att[i].nodeValue + "'" ;
					}
					tag += ">";
					return tag + o.innerHTML + "</" + o.nodeName + ">";
		}		
  
  function insertAdjacentHTML( o, where, html ) 
  { 
    switch ( where.toLowerCase() )
	   {
	     case 'beforebegin' : o.parentNode.insertBefore( dressHtml(html), o ); break; 
	     case 'afterbegin' : o.childNodes.item(0).parentNode.insertBefore( dressHtml(html), o.childNodes.item(0) ); break;
	     case 'beforeend' : o.appendChild( dressHtml(html) ); break;
      case 'afterend' : o.parentNode.insertBefore( dressHtml(html), o.nextSibling ); break;
	   }
				try 
				{
			   var el = document.getElementById('mark'+g_markerId);	
			   el.parentNode.insertBefore(el.firstChild, el);
			   el.parentNode.removeChild(el);				
				}catch(e){}//try and cleanup, required by spellchecker plugin.
  }    
  
  function dressHtml( html )
  {
	   g_markerId++;
    var marker = document.createElement("span");
	   marker.id="mark"+g_markerId;		
	   marker.style.display="inline";
    marker.innerHTML=html;	  
	   return marker;
  }
		
		function addProMoveHandler(where, name) 
		{ 
		  if ( document.all.view.elements.tabSummary.value == "true" )
				{
					 g_proDiv = parent.document.getElementById( "ProMenu_"+name.split('tabSummaryFrame')[1]+"_Div" );				
		    parent.addToGlobalEventHandler( "onmousemove", where, "document.getElementById(name).contentWindow.moveProcess(e)" );
				}else
				{
					 g_proDiv = document.getElementById( "ProMenu_"+document.getElementById('view').elements.genFormPk.value+"_Div" );				
				  addToGlobalEventHandler( "onmousemove", where, "moveProcess(e)" );
				}
		}
		
 	function swapNode(n1,n2) 
		{ 
		  var rns = n1.parentNode.replaceChild( n2.cloneNode(true), n1 );
		  n2.parentNode.replaceChild( rns, n2 );
		}
				
		var g_trg;  var g_zIdx = 0;		
		function efp(x,y,from)
		{
			 if (!from)from=g_d;
				efpi(from,x,y);
				return g_trg;
		}
		function efpi(from, x,y)
		{
				var n,i;
				for(i=0;i<from.childNodes.length;i++)
				{ n=from.childNodes[i];
						if( n.nodeType != Node.TEXT_NODE && n.style.display != 'none' )
						{
								var sx = getElementPosX(n);  var sy = getElementPosY(n);
								var ex = sx + n.offsetWidth; var ey = sy + n.offsetHeight;
								if ( x > sx && x < ex && y > sy && y < ey ) 
								{
										if (n.style.position != 'absolute')
										{
												g_trg=n;
												efpi(n,x,y);
										} else if ( n.style.visibility=='visible' && (n.style.zIndex && n.style.zIndex >= g_zIdx) || (!n.style.zIndex && g_zIdx < 1) )
										{
												g_trg=n;
												if ( n.style.zIndex ) g_zIdx = n.style.zIndex;
												efpi(n,x,y);
										}
								}
						}
				}
		}
		function cs(n,p) { return g_d.defaultView.getComputedStyle(n, "").getPropertyValue(p);	}
		
		function srcE(e) { try{return e.target;}catch(e){return false;} }
		
		function getCompStyle(o,s) { return g_d.defaultView.getComputedStyle(o, "").getPropertyValue(s); }
		
		function rn(o) { o.parentNode.removeChild(o);	}
		
		function innerText(o) 
		{
			  var html = o.innerHTML;
					html = html.replace(/&nbsp;/, '');
					if ( html.indexOf('<') > -1 ) return html.substring(0, html.indexOf('<'));
					return html;
		}
		
		function doc( o ) { return o.ownerDocument; }
		function win( o ) { return o.ownerDocument.defaultView; }
		
  function onpropertychange(property, oldval, newval) 
  { 
    var d = this.ownerDocument;
    if ( d.getElementById(this.id).changfunc && d.getElementById(this.id).changfunc == 'true' ) return this.value;
    d.getElementById(this.id).changfunc='true';
    d.getElementById(this.id).value=newval;
	  	eval( this.getAttribute('onpropertychange') );
	  	d.getElementById(this.id).changfunc='false';
				return this.value;//actually sets the field based on the return type( ARRRGGG ), so not officially set until after method returns.
  }		
		
		function evtTxt() { return "e"; }
			
		function clientTop(o)	{ return o.offsetTop;	}
		function clientLeft(o) { return o.offsetLeft; }		