/* *********************************************************
T O O L T I P   C O N T R O L   V E R S I O N   2
Autor: Denis Kleber
Copyright (C) 2004 United Planet GmbH, Freiburg
All rights reserved.


------------------------------------
How to use: 
------------------------------------
Initialisierung:
	var myToolTip = new upToolTip("myToolTip");

Positionierung:
	default: "dynamic", current mouse position
	myToolTip.positionHandling = "bottom-right";	(rechte untere Bildschirmecke)

mit Fader:
	l_aFaderParams = new Array();
	l_aFaderParams.direction="bottom";
	l_aFaderParams.steps=20;
	myToolTip.initFader(l_aFaderParams);

Transparenzeffekt:
	myToolTip.lOpacity = 90;	0-100 (0=hidden)

Schliessen Schaltfläche:
	myToolTip.showCloseButton(true);

Anzeigen:	
	myToolTip.quickView("Title", "Hallo Welt!");
	 oder ...
	myToolTip.quickView(null, "Hallo Welt!");	// Titelzeile wird nicht aufgebaut, ausser showCloseButton wurde auf true gesetzt

Anzeigen + Anpassen der Anzeige (advanced):
	//*** Nachricht initialisieren
	contentKey = myToolTip.addContentById(null,l_strOut,10000); // titel, text, id
	 oder ...
	contentKey = myToolTip.addContent(null,l_strOut); // titel, text
	//*** Layout der Nachricht anpassen
	myToolTip.setContentAttribute(contentKey, "styleHeaderTable",	"border-bottom : 0px solid gray;border-top : 1px solid gray;border-left : 1px solid gray;border-right : 1px solid gray;background-color : #50A8FF;")
	myToolTip.setContentAttribute(contentKey, "styleHeaderCell",	"text-decoration : none;font-family : Arial;font-size : 9px;color : #0000ff;text-align : right;height:10px;")
	myToolTip.setContentAttribute(contentKey, "styleContentTable","border-bottom : 1px solid gray;border-top : 1px solid gray;border-left : 1px solid gray;border-right : 1px solid gray;background-color : #50A8FF;")
	myToolTip.setContentAttribute(contentKey, "styleContentCell",	"font-family : Arial;font-size : 12px;color : #0000ff;")
	//*** Nachricht anzeigen
	myToolTip.show(contentKey);

Ausblenden: 
	myToolTip.close();

********************************************************** */

var MouseX = 0;
var MouseY = 0;
var isNetscape = false;
var isMSIE = false;

function upTooltipContent()
//	*********************************************
//	upTooltipContent
//	*********************************************
{
	this.key				= null;			// integer
	this.width				= "250";			// string
	this.heigth				= "100";			// string
	this.styleHeaderTable	= "border-bottom : 0px solid gray;border-top : 1px solid gray;border-left : 1px solid gray;border-right : 1px solid gray;background-color : #FFFFDB;";	// string
	this.styleHeaderCell	= "vertical-align : middle;font-weight : 700;font-family : Arial;font-size : 12px;color : Gray;";	// string
	this.styleHeaderLink	= "text-decoration : none;font-family : Arial;font-size : 9px;color : Gray;text-align : right;height:10px;";	// string
	this.styleContentTable	= "border-bottom : 1px solid gray;border-top : 1px solid gray;border-left : 1px solid gray;border-right : 1px solid gray;background-color : #FFFFDB;";	// string
	this.styleContentCell	= "font-family : Arial;font-size : 12px;color : #000000;";
	this.text				= "";			// string
	this.title				= null;			// string
}

function upToolTip(strObjectName, strLayerName)
//	*********************************************
//	upToolTip
//	Parameter:	Objekname und Layername (optional)
//	*********************************************
{
	//***	auswertung der parameter  ***
	this.objectName = strObjectName;
	if(strLayerName!=null)
		this.strLayerName = strLayerName;
	else
		this.strLayerName = "containerTooltip";	// default tooltip container
		
	//***	browser infos	***
	this.getBrowserInfos = funcGetBrowserInfos;
	this.getBrowserInfos();
	
	
	//***	defaults intern ***
	this.strTooltipOnLoad = '';
	this.oLayer = null;
	this.bLayer = false;
	this.oFader = new upFader();
	this.oFader.oToolTip = this;
	this.bFade = false;
	this.aFaderProps = null;
	this.aWindowRegion;
	this.lLastKey = '';
	this.aContentArray = new Array(); 
	this.lContentKey = 0;
	this.bShowHeader = false;
	this.bCloseButton = false;
	this.container = getElementByName(this.strLayerName);
	
	//***	funktionen	intern ***
	this._init = funcInitTooltip;
	this._hide = funcHideTooltip;	
	this._moveTo = funcMoveTooltipTo;
	this._show = _funcShowTooltip;
	this._releaseMouse = funcReleaseMouseTooltip;
	this._catchMouse = funcCatchMouseTooltip;
	this._setContent = funcSetContentTooltip;
	this._isVisible = funcIsVisibleTooltip;
	this._getRegion = funcGetRegionTooltip;
	this._getWindowRegion = funcGetWindowRegionTooltip;
	this._getWindowScrollY = funcGetWindowScrollYTooltip;
	this._getWindowScrollX = funcGetWindowScrollXTooltip;
	this._calcPositionXYWH = funcCalcPositionXYWH;
	this._resetDivFixedPos = funcResetDivFixedPos;
	this.setOpacity = funcSetOpacity;
	
	//***	variablen ÖFFENTLICH	***
	this.positionHandling = "dynamic";	// bottom-right
	this.enableDragAndDrop = false;
	this.fixedPos = false;
	this.lOpacity = 90;				// zwischen 0 - 100
	
	//***	funktionen	ÖFFENTLICH ***
	this.initFader = funcInitFader;
	this.close = funcCloseTooltip;
	this.addContent = funcAddContentTooltip_byText;		// by text
	this.addContentById = funcAddContentTooltip_byTextId	// by text and id
	this.addObject = funcAddContentTooltip_byObject;	// by object
	this.getContentObject = funcGetContentObjectTooltip;
	this.show = funcShowTooltip;
	this.quickView = funcQuickViewTooltip;
	this.oDefaultTooltipContent = funcTooltipContent;
	this.reset = funcResetTooltip;
	this.showCloseButton = funcShowCloseButtonTooltip;
	this.setContentAttribute = setContentAttributeTooltip;
	
	this._init();
}

function setContentAttributeTooltip(p_lKey,p_strName,p_strValue)
{
	if(this.aContentArray && this.aContentArray[p_lKey])
	{
		this.aContentArray[p_lKey][p_strName]=p_strValue;
	}
}

function funcTooltipContent()
//	*********************************************
//	default TooltipContent des aktuellen 
//	Tooltip-Objektes
//	*********************************************
{
}
funcTooltipContent.prototype = new upTooltipContent();


function funcInitTooltip() 
//	*********************************************
//	initialisiert das Tooltip (im Onload der Seite)
//	*********************************************
{
	this._releaseMouse();
	this._catchMouse();
}	

//*** MouseEvents ***
	
function funcCatchMouseTooltip()
//	*********************************************
//	Mauskoordinaten bei Bewegung abfangen
//	*********************************************
{	
	if(isNetscape)
	{
		window.captureEvents(Event.MOUSEMOVE);
   		window.onmousemove=MouseMove;
	}
	if(isMSIE){document.onmousemove=MouseMove;}
}

function funcInitFader(p_aParams)
//	*********************************************
//	initialisiert den Fader
//	Parameter:	Array mit Richtung (string) und Schrittzahl (integer)
//	*********************************************
{
	if(p_aParams)
	{
		this.bFade = true;
		this.aFaderProps = new Array();
		this.aFaderProps.strDirection = p_aParams.direction;
		this.aFaderProps.lSteps = p_aParams.steps;
	}
}

function funcReleaseMouseTooltip()
//	*********************************************
//	
//	*********************************************
{
	if(isNetscape){window.releaseEvents(Event.MOUSEMOVE);}
	if(isMSIE){document.onmousemove="";}
}

function _funcShowTooltip()
//	*********************************************
//	macht den Tooltip Container sichtbar
//	*********************************************
{
	oLayer = getElementByName(this.strLayerName)
	if(typeof oLayer != "undefined")
	{
		if(Browser.ns4) 
			oLayer.visibility = "visible";
		else if (oLayer.style) 
			oLayer.style.visibility = "visible";
	}
	this.setOpacity(this.lOpacity);
	//window.setTimeout("window.defaultStatus = getEltWidth(getElementByName('HelpLayer'));",500);	
}

function funcHideTooltip()
//	*********************************************
//	macht den Tooltip Container unsichtbar
//	*********************************************
{			
	oLayer = getElementByName(this.strLayerName);
	if(typeof oLayer != "undefined")
	{	
		if(Browser.ns4) 
			oLayer.visibility = "hidden";
		else if (oLayer.style) 
			oLayer.style.visibility = "hidden";
	}
}

function funcIsVisibleTooltip()
//	*********************************************
//	prüft ob Tooltip Container sichtbar ist
//	Return:	True / False
//	*********************************************
{					
	oLayer = getElementByName(this.strLayerName)
	if(typeof oLayer != "undefined")
	{	
		return(oLayer.style.visibility=="visible")
	}	
}

function funcMoveTooltipTo(p_aParams)
//	*********************************************
//	Paramter: Array mit X und Y Koordinaten
//	plaziert den Div-Container
//	*********************************************
{
	if(typeof oLayer != "undefined")
	{
		if(isNetscape){
			oLayer.style.top=(p_aParams.lPosY);
			oLayer.style.left=(p_aParams.lPosX);
		}
		
		if(isMSIE){
			oLayer.style.top=(p_aParams.lPosY);
			oLayer.style.left=(p_aParams.lPosX);
		}
	}
}

function funcSetContentTooltip(p_strContent)
//	*********************************************
//	setzt den übergebenen Inhalt in den Div-Container
//	*********************************************
{		
	oLayer = getElementByName(this.strLayerName);
	if(typeof oLayer != "undefined")
	{			
		oLayer.innerHTML = p_strContent;
	}
	
}

function funcGetRegionTooltip() 
//	*********************************************
//	Return:		.left, .right, .top, .down, .height, .width
//	*********************************************
{
	c=new Array();
	oLayer = getElementByName(this.strLayerName)
	if(typeof oLayer != "undefined")
	{
		if(isNetscape)
		{
			if((typeof oLayer.offsetWidth != "undefined") && (typeof oLayer.offsetHeight != "undefined") )
			{
				c.height=oLayer.offsetHeight;
				c.width=oLayer.offsetWidth;
			}
			else
			{
				c.left=oLayer.left;
				if(typeof c.left != "undefined")
				{
					c.right=c.left+oLayer.clip.width;
					c.top=oLayer.top;
					c.down=c.top+oLayer.clip.height;
					c.height=oLayer.height;
					c.width=oLayer.clip.width;
				}
			}
		}
		if(isMSIE)
		{
			//c.left=this.d.all[p_strLayerName].offsetLeft;
			c.left=parseInt(oLayer.style.left);
			c.right=c.left+oLayer.offsetWidth;
			//c.top=this.d.all[p_strLayerName].offsetTop;
			c.top=parseInt(oLayer.style.top);
			c.down=c.top+oLayer.offsetHeight;
			c.width=oLayer.offsetWidth;
			c.height=oLayer.offsetHeight;
		}
		this.LayerRegion = c;
	}
}

function funcGetWindowRegionTooltip() 
//	*********************************************
//	Return:		Array mit Höhe und Breite
//	*********************************************
{	
	c=new Array();
	if(this.ns4up) 
	{
		c.height=self.innerHeight;
		c.width=self.innerWidth-10;
	} 
	else if(this.ns4)
	{
		c.height=window.innerHeight;
		c.width=window.innerWidth;
	}
	else if(this.ie4up) 
	{
		c.width=document.body.clientWidth;
		c.height=document.body.clientHeight;
	}
	else if(this.iedom)
	{
		c.width=document.body.clientWidth+document.body.scrollLeft;
		c.height=document.body.clientHeight+document.body.scrollTop;
	}
	this.aWindowRegion = c;
}

function funcGetWindowScrollYTooltip() 
//	*********************************************
//	Return:		YOffset
//	*********************************************
{
	if(isNetscape)
	{
		return window.pageYOffset;
               
	}
	if(isMSIE)
	{
		return document.body.scrollTop;
	}
}

function funcGetWindowScrollXTooltip() 
//	*********************************************
//	Return:		XOffset
//	*********************************************
{
	if(isNetscape)
	{
		return window.pageXOffset;
	}
	if(isMSIE)
	{
		return document.body.scrollLeft;
	}
}

function funcGetContentObjectTooltip(p_lKey)
//	*********************************************
//	Parameter:	p_lKey - Content Key
//	Return:		TooltipContent Objekt
//	*********************************************
{
	if(this.aContentArray && this.aContentArray[p_lKey])
	{
		return this.aContentArray[p_lKey];
	}
	else
	{
		return null;
	}
}

function funcAddContentTooltip_byText(p_strTitle, p_strText)
//	*********************************************
//	Parameter:	p_strText - Text zum Anzeigen
//	Return:		contentKey
//	*********************************************
{
	var newTooltipContent = new this.oDefaultTooltipContent();
	this.lContentKey++;
	
	if(!p_strText || p_strText==null)
		p_strText="";
	
	if(p_strTitle != null)
	{
		newTooltipContent.title = p_strTitle;
		this.bShowHeader = true;
	}
		
	newTooltipContent.text = p_strText;
	
	this.aContentArray[this.lContentKey] = newTooltipContent;
	return this.lContentKey;
}

function funcAddContentTooltip_byTextId(p_strTitle, p_strText, p_lId)
//	*********************************************
//	Parameter:	p_strText - Text zum Anzeigen
//	Return:		contentKey
//	*********************************************
{
	var newTooltipContent = new this.oDefaultTooltipContent();

	if(!p_strText || p_strText==null)
		p_strText="";
	
	if(p_strTitle != null)
	{
		newTooltipContent.title = p_strTitle;
		this.bShowHeader = true;
	}
	
	newTooltipContent.text = p_strText;
	
	this.aContentArray[p_lId] = newTooltipContent;
	return p_lId;
}

function funcAddContentTooltip_byObject(p_oTooltipContent)
//	*********************************************
//	Parameter:	p_oTooltipContent - TooltipContent Objekt
//	Return:		true / false
//	*********************************************
{
	if(p_oTooltipContent!=null)
	{
		this.aContentArray[p_oTooltipContent.key] = p_oTooltipContent;
		if(p_oTooltipContent.title!=null)
			this.bShowHeader = true;
		return true;
	}
	else
	{
		return false;
	}
}


function funcShowTooltip(p_lKey)
//	*********************************************
//	Parameter:	p_lKey - TooltipContent Key
//	Return:		true / false
//	*********************************************
{
	if(p_lKey==null)
		return false;
		
	oLayer = getElementByName(this.strLayerName)
	
	if( p_lKey != this.lLastKey )
	{
		this.lLastKey = p_lKey;
		
		if(this._isVisible())
			this.close(); 
			
		theText				= this.aContentArray[p_lKey].text;
		theTitle			= this.aContentArray[p_lKey].title;
		theWidth			= this.aContentArray[p_lKey].width;
		theHeight			= this.aContentArray[p_lKey].height;
		theStyleHeaderTable	= this.aContentArray[p_lKey].styleHeaderTable;
		theStyleHeaderCell	= this.aContentArray[p_lKey].styleHeaderCell;
		theStyleHeaderLink	= this.aContentArray[p_lKey].styleHeaderLink;
		theStyleContentTable= this.aContentArray[p_lKey].styleContentTable;
		theStyleContentCell	= this.aContentArray[p_lKey].styleContentCell;
		theLayerContent = "";
		
		if(this.bShowHeader)
		{
			theLayerContent += "<table style=\"" + theStyleHeaderTable + "\" cellspacing=\"1\" cellpadding=\"1\" width=\""+theWidth+"\">";
			theLayerContent += "<tr>";
			if(theTitle!=null)
			{
				theLayerContent += "<td width=\"99%\" style=\"" + theStyleHeaderCell + "text-align : left;\">";
				theLayerContent += theTitle;
				theLayerContent += "</td>";
			}
			// buttons
			theLayerContent += "<td width=\"1%\" style=\"" + theStyleHeaderCell + "text-align : right;\">";
			if(this.bCloseButton)theLayerContent += "<a href=\"#\" style=\"" + theStyleHeaderLink + "\" onclick=\"" + this.objectName + ".close();\"><img src=\"images/assets/common/close_small.png\" width=\"9\" height=\"9\" border=\"0\"></a>"
			theLayerContent += "</td>";
			theLayerContent += "</tr>";
			theLayerContent += "</table>";
		}
		theLayerContent += "<table style=\"" + theStyleContentTable + "\" cellspacing=\"2\" cellpadding=\"2\" width=\""+theWidth+"\">";
		theLayerContent += "<tr><td style=\"" + theStyleContentCell + "\" height=\""+theHeight+"\">";
		theLayerContent += theText;
		theLayerContent += "</td></tr></table>";
		
		this._setContent(theLayerContent);
		
		l_aLayerParams = this._calcPositionXYWH();
		if(typeof l_aLayerParams != 'object')
			return false;
			
		this._moveTo(l_aLayerParams);        
		
		if(this.bFade && this.aFaderProps != null && typeof this.aFaderProps != "undefined")
		{
			this._show();
			if(this.positionHandling == "bottom-right" && this.aFaderProps.strDirection == "top-left" && !this.ie4up)
				this.aFaderProps.strDirection = "bottom-right";
		
			this.oFader.fade(oLayer.id, this.aFaderProps.strDirection, this.aFaderProps.lSteps, null, [l_aLayerParams.lPosX, l_aLayerParams.lPosY,l_aLayerParams.lWidth,l_aLayerParams.lHeight]);
		}
		else
		{
			this._show();
		}
		
		if(this.enableDragAndDrop)
		{
			if(dd && dd.elements && typeof dd.elements == "object" && dd.elements[oLayer.id])
			{
				dd.elements[oLayer.id].moveBy(l_aLayerParams.lPosX,l_aLayerParams.lPosY)
				dd.elements[oLayer.id].x = l_aLayerParams.lPosX;
				dd.elements[oLayer.id].y = l_aLayerParams.lPosY;
				dd.elements[oLayer.id].w = l_aLayerParams.lWidth;
				dd.elements[oLayer.id].h = l_aLayerParams.lHeight;
			}
		}
		else if(this.fixedPos && !this.bFade)
		{
			oLayer = getElementByName(this.strLayerName)
			oLayer.style.position = "relative";
			this.layerTopOffset = parseInt(oLayer.style.top) - document.body.scrollTop;
			window.setInterval(this.objectName + "._resetDivFixedPos()",20);
		}
		
	}
	return true;
}


function funcQuickViewTooltip(p_strTitle, p_strText)
//	*********************************************
//	fasst die funktionen addContent() und show()
//	zu einem vorgang zusammen
//
//	Parameter:	p_Param - Text zum Anzeigen
//				oder
//				Array mit: .title, .text
//	Return:		true false
//	*********************************************
{
	
	contentKey = this.addContentById(p_strTitle,p_strText,10000);
	
	return this.show(contentKey);

}

function funcCalcPositionXYWH()
//	*********************************************
//	fasst die funktionen addContent() und show()
//	zu einem vorgang zusammen
//
//	Parameter:	p_strText - Text zum Anzeigen
//	Return:		true false
//	*********************************************
{
	l_aReturn = new Array();
	
	this._getWindowRegion();
	this._getRegion();
	
	windowWidth = this.aWindowRegion.width + this._getWindowScrollX();
	windowHeight = this.aWindowRegion.height + this._getWindowScrollY();
	layerWidth = this.LayerRegion.width;
	layerHeight = this.LayerRegion.height;

	if(this.positionHandling == "dynamic")
	{
		//correction of position
		var X = MouseX;
		var Y = MouseY;
		   
		//Coords Correction for MSIE
		if(isMSIE)
		{       
			Y += this._getWindowScrollY();
			X += this._getWindowScrollX();    
		}
		
		// Coords Correction for offsetHeight/offsetWidth
		if((typeof this.aWindowRegion.width != "undefined") && (typeof this.aWindowRegion.height != "undefined") )
		{
			// sometimes mozilla returns 0
			if(layerWidth==null || layerWidth==0 || layerWidth=="") layerWidth=theWidth;
			if(windowWidth < (layerWidth+X))
			{
				X = (X - layerWidth);
			}
			if(windowHeight < (layerHeight+Y) && Y > windowHeight/2 )
				Y = (Y - layerHeight);			
		}
		l_aReturn.lPosX		= X;
		l_aReturn.lPosY		= Y;
		l_aReturn.lWidth	= layerWidth;
		l_aReturn.lHeight	= layerHeight;
	}
	else if(this.positionHandling = "bottom-right" )
	{
		X = this.aWindowRegion.width - layerWidth;
		Y = this.aWindowRegion.height - layerHeight;
				
		l_aReturn.lPosX = X;
		l_aReturn.lPosY = Y;
		l_aReturn.lWidth	= layerWidth;
		l_aReturn.lHeight	= layerHeight;
	}
	else
	{
		return null;
	}	
	return l_aReturn;
}

function funcResetDivFixedPos()
{
	oLayer = getElementByName(this.strLayerName)
	var pxTop = parseInt(this.layerTopOffset) + parseInt(document.body.scrollTop);
	var pxLeft = parseInt(this.layerLeftOffset) + parseInt(document.body.scrollLeft);
	oLayer.style.top = pxTop;
	oLayer.style.left = pxLeft;
}

function funcCloseTooltip(p_bReset)
//	*********************************************
//	schliesst das Tooltip
//	*********************************************
{
	this.lLastKey = '';
	this._hide();	
	if(p_bReset)
		this.reset();
}

function funcResetTooltip()
//	*********************************************
//	setzt das Tooltip zurück
//	*********************************************
{
	this.lLastKey = '';
	this.aContentArray = new Array(); 
	this.lContentKey = 0;
}

//	*********************************************
//	global tooltip functions
//	*********************************************
function MouseMove(e)
{
	if(isNetscape)
	{
		MouseX=e.layerX;
		MouseY=e.layerY;
	}
	if(isMSIE)
	{
		MouseX=event.clientX;
		MouseY=event.clientY;
	}
	//window.defaultStatus = "m.position:" + MouseX + "-" + MouseY;
}

function stringToNumber(s)
//	*********************************************
//	returns 0 if there is NaN returned, 
//	or number is part of a string, like 100px...
//	*********************************************
{
        return parseInt(('0' + s), 10)
}

function getElementByName(p_strName) 
{ 
	return Browser.getRef(p_strName);
}


//	*********************************************
//	returns Browser Infos
//	*********************************************
function funcGetBrowserInfos()
{
	if(Browser.ie4 || Browser.ie5 || Browser.ie6up )
		isMSIE = true;
		
	if(Browser.ns4)
		isNetscape = true;
	
	if(Browser.dom && !isMSIE)
		isNetscape = true;
	
	this.ns4up		= (document.layers) ? 1 : 0;  
	this.ie4up		= (document.all) ? 1 : 0;
	this.iedom		= document.all||document.getElementById;
	this.ns4		= (document.layers)? true : false;
	this.ie4		= (document.all && !this.ie4) ? true : false;
	this.ie5		= (document.all && this.ie4)? true : false;
	this.ns6		= (this.ie4 && navigator.appName.indexOf("Netscape") >= 0) ? true : false;
	this.w3c		= (document.getElementById) ? true : false;
	this.iedom		= document.all||document.getElementById;	
}

function funcSetOpacity(p_lOpacity)
//	*********************************************
//	returns Browser Infos
//	*********************************************
{
	if(this.container)
	{
		this.container.style.filter="Alpha(opacity="+p_lOpacity+")";
		this.container.style.MozOpacity=p_lOpacity/100;
	}
}

function funcShowCloseButtonTooltip(p_bShow)
{
	this.bCloseButton = p_bShow;
	if(p_bShow)
	{
		this.bShowHeader = true;
	}
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

/*	***************************************************************************************
	F A D E R
	United Planet GmbH, Denis Kleber
	
	
	Parameter:
	 p_Container	- 	object: DivContainer reference, or 
	 					string: DivContainer id
	 p_strDir		- 	fade direction
	 p_lSteps		-	fade steps
	 p_lMs			-	fade interval
	 p_aRect		-	DivContainer PositionArray
	 
	Example:
	 ...
	 <body onload="new upFader().fade('meincontainer', 'bottom-right', null, null, [100,100,350,250]);">
	 <script language="JavaScript" src="fader.js"></script>
	 <div id="meincontainer" style="POSITION: absolute;border: 1px solid Black;BACKGROUND-COLOR: #eeeeee;visibility:hidden">
	 ...
***************************************************************************************   */
function upFader()
{
	this.oToolTip = null;
	this.ns4up		= (document.layers) ? 1 : 0;  
	this.ie4up		= (document.all) ? 1 : 0;
	this.iedom		= document.all||document.getElementById;
}


var FADE_ARRAY = new Array(); 
function fade (p_Container, p_strDir, p_lSteps, p_lMs, p_aRect) 
{
	this.objectId		= FADE_ARRAY.length;
	FADE_ARRAY[this.objectId] = this;
	
	this._fade			= _funcFade;
	this.setClip		= funcSetClip;
	this.setLocation	= funcSetLocation;
	this.setVisibility	= funcSetVisibility;
	this.getObject		= funcGetObject;
	this.setOpacity		= funcSetOpacity;

	eval("obj=this");
	this.obj = obj;
	
	if( !this.ns4up && !this.ie4up && !this.iedom)
		return false;
		
	if(p_Container!=null)
		if(typeof p_Container == "object")
		{
			this.container = p_Container;
		}
		else
		{
			this.container = this.getObject(p_Container);
		}
	else
	{
		return false;
	}
	this.fadeSteps 	= (p_lSteps!=null)? p_lSteps: 20;
	this.fadeMS 		= (p_lMs!=null)? p_lMs:15;
	this.fadeDir		= p_strDir;
	
	// clear old window timer
	if(this.fadeTimer != null) 
	{
		window.clearTimeout(this.fadeTimer);
	}
	if(!this.fadeCounter && p_aRect != null && p_aRect.length == 4) 
	{	
		this.fadeOrgX  	= p_aRect[0];
		this.fadeOrgY  	= p_aRect[1];
		this.fadeOrgWidth 	= p_aRect[2];
		this.fadeOrgHeight	= p_aRect[3];
	}
	/*else if(if(!this.fadeCounter && p_aRect == null)
	{
		this.fadeOrgX  	= this.container.style.left;
		this.fadeOrgY  	= this.container.style.top;
		this.fadeOrgWidth 	= this.container.style.width;
		this.fadeOrgHeight	= this.container.style.height;
	}*/
	else
		return false;
	
	this.fadeCounter = this.fadeSteps;
	this.setClip([0,0,0,0]);
	this.setOpacity(0);
	this.setVisibility(true);
	this.fadeTimer = window.setTimeout("FADE_ARRAY[" + this.objectId + "]._fade()", this.fadeMS);

	this.opacitySteps = this.oToolTip.lOpacity/this.fadeCounter;
	this.currOpacity=0;
	window.status ="";
	//if(Neufenster.scrollbars &amp;&amp; Neufenster.scrollbars.visible == false)
	//window.body.scrollbars.visible=false;
	//document.body.style.overflow="hidden";
	this.scrollLeft = document.body.scrollLeft;
	this.scrollTop = document.body.scrollTop;
	//document.body.scrollLeft = 0;
	//document.body.scrollTop = 0;
	//parent.document.getElementById("appMain").scrolling = "no";
	//document.body.scrollbars.visible=false
	//document.body.style.overflow='hidden';
	//alert(parent.document.getElementById("appMain").scrolling)
	//alert(document.getElementById("appMain").name);
	//alert(oHtmlRoot.oUp.oRegistry.oFrameReg[FRAME_APPMAIN].oUp)
	//oHtmlRoot.oUp.oRegistry.oFrameReg["appMain"].scrolling = "no";
}
upFader.prototype.fade = fade;


function _funcFade() 
{

	var steps	= this.fadeSteps;
	var x 		= this.fadeOrgX;
	var y 		= this.fadeOrgY;
	var w 		= this.fadeOrgWidth;
	var h 		= this.fadeOrgHeight;
	
	if (this.fadeCounter == 0) 
	{
		this.setClip([0, w, h,0]);
		this.setOpacity(this.oToolTip.lOpacity);
		document.body.scrollLeft = this.scrollLeft;
		document.body.scrollTop = this.scrollTop;
		
		if(this.oToolTip && this.oToolTip.fixedPos && !this.oToolTip.enableDragAndDrop)
		{
			oLayer = getElementByName(this.oToolTip.strLayerName)
			//oLayer.style.position = "relative";
			this.oToolTip.layerTopOffset = parseInt(oLayer.style.top) - document.body.scrollTop;
			this.oToolTip.layerLeftOffset = parseInt(oLayer.style.left) - document.body.scrollLeft;
			//window.setInterval(this.oToolTip.objectName + "._resetDivFixedPos()",20);
		}
		
		return;
	}
	else 
	{
		this.fadeCounter--;
		//this.setVisibility(true);
		switch(this.fadeDir) {
			case "bottom":
				this.setClip([h * this.fadeCounter / steps, w, h, 0]);
				this.setLocation(x,y - h * this.fadeCounter / steps);
				break;
			case "top":
				this.setClip([0, w, h * (steps - this.fadeCounter) / steps, 0]);
				this.setLocation(x,y + h * this.fadeCounter / steps);
				break;
			case "right":
				this.setClip([0, w, h,w * this.fadeCounter / steps]);
				this.setLocation(x - w * this.fadeCounter / steps,y);
				break;
			case "left":
				this.setClip([0, w * (steps - this.fadeCounter) / steps, h, 0]);
				this.setLocation(x + w * this.fadeCounter / steps,y);
				break;
			case "bottom-right":
				this.setClip([h * this.fadeCounter / steps, w, h, w * this.fadeCounter / steps]);
				this.setLocation(x - w * this.fadeCounter / steps,y - h * this.fadeCounter / steps);
				break;
			case "bottom-left":
				this.setClip([h * this.fadeCounter / steps, w * (steps - this.fadeCounter) / steps, h, 0]);
				this.setLocation(x + w * this.fadeCounter / steps,y - h * this.fadeCounter / steps);
				break;
			case "top-left":
				this.setClip([0, w * (steps - this.fadeCounter) / steps, h * (steps - this.fadeCounter) / steps, 0]);
				this.setLocation(x + w * this.fadeCounter / steps,y + h * this.fadeCounter / steps);
				//this.setLocation(x,y);
				break;
			case "top-right":
				this.setClip([0, w, h * (steps - this.fadeCounter) / steps, w * this.fadeCounter / steps]);
				this.setLocation(x - w * this.fadeCounter / steps,y + h * this.fadeCounter / steps);
		}	
		//** SCROLLING START	
		document.body.scrollLeft = this.scrollLeft;
		document.body.scrollTop = this.scrollTop;
		
		//document.body.style.overflow='hidden';
		//** SCROLLING END
		this.currOpacity+=this.opacitySteps;
		this.setOpacity( this.currOpacity );
		
		this.fadeTimer = window.setTimeout("FADE_ARRAY[" + this.objectId + "]._fade()", this.fadeMS);
	
	}
}

function funcSetClip(p_aClip) 
{	
	if(p_aClip.length == 4)
	{
		if(this.ns4up)
		{
			this.container.style.clip.top		= p_aClip[0];
			this.container.style.clip.right		= p_aClip[1];
			this.container.style.clip.bottom	= p_aClip[2];
			this.container.style.clip.left		= p_aClip[3];
		}
		else
		{
			this.container.style.clip="rect("+p_aClip[0]+"px "+p_aClip[1]+"px "+p_aClip[2]+"px "+p_aClip[3]+"px)";
		}
	}
	else
		return false;
}

function funcSetLocation(x,y)
{
	this.container.style.top = y;
	this.container.style.left = x;
}

function funcSetVisibility(p_bVisible)
{
	if(this.ns4up)
	{
		var vis = (p_bVisible?'visible':'hidden');
		this.container.visibility = vis;
	}
	else
	{
		var vis = (p_bVisible?'visible':'hidden');
		this.container.style.visibility = vis;
	}
}

function funcGetObject(p_strName)
{
	if(this.ns4up)
	{
		return document.layers[p_strName]
	}
	else if(this.ie4up||this.iedom)
	{
		if(this.ie4)
		{
			return document.all[p_strName];
		}
		else
		{
			ret = document.getElementById(p_strName)
			return ret;
		}
	}
}

