/* This notice must be untouched at all times.
Copyright (c) 2002-2008 Walter Zorn. All rights reserved.

wz_tooltip.js	 v. 5.31

The latest version is available at
http://www.walterzorn.com
or http://www.devira.com
or http://www.walterzorn.de

Created 1.12.2002 by Walter Zorn (Web: http://www.walterzorn.com )
Last modified: 7.11.2008

Easy-to-use cross-browser tooltips.
Just include the script at the beginning of the <body> section, and invoke
Tip('Tooltip text') to show and UnTip() to hide the tooltip, from the desired
HTML eventhandlers. Example:
<a onmouseover="Tip('Some text')" onmouseout="UnTip()" href="index.htm">My home page</a>
No container DIV required.
By default, width and height of tooltips are automatically adapted to content.
Is even capable of dynamically converting arbitrary HTML elements to tooltips
by calling TagToTip('ID_of_HTML_element_to_be_converted') instead of Tip(),
which means you can put important, search-engine-relevant stuff into tooltips.
Appearance & behaviour of tooltips can be individually configured
via commands passed to Tip() or TagToTip().

Tab Width: 4
LICENSE: LGPL

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (LGPL) as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

For more details on the GNU Lesser General Public License,
see http://www.gnu.org/copyleft/lesser.html
*/

var configSE = new Object();
var SE_Debug	= true		// false or true - recommended: false once you release your page to the public
var SE_Enabled	= true		// Allows to (temporarily) suppress tooltips, e.g. by providing the user with a button that sets this global variable to false
var TagsToTipSE	= true		// false or true - if true, HTML elements to be converted to tooltips via TagToTip() are automatically hidden;
							// if false, you should hide those HTML elements yourself

//===================  GLOBAL TOOLTIP CONFIGURATION  =========================//
// For each of the following config variables there exists a command, which is
// just the variablename in uppercase, to be passed to Tip() or TagToTip() to
// configure tooltips individually. Individual commands override global
// configuration. Order of commands is arbitrary.
// Example: onmouseover="Tip('Tooltip text', LEFT, true, BGCOLOR, '#FF9900', FADEIN, 400)"

configSE. Above			= true		// false or true - tooltip above mousepointer
configSE. BgColor			= '#FFFFFF'	// Background colour (HTML colour value, in quotes)
configSE. BgImg			= ''		// Path to background image, none if empty string ''
configSE. BorderColor		= '#dddddd'
configSE. BorderStyle		= 'solid'	// Any permitted CSS value, but I recommend 'solid', 'dotted' or 'dashed'
configSE. BorderWidth		= 1
configSE. CenterMouse		= true		// false or true - center the tip horizontally below (or above) the mousepointer
configSE. ClickClose		= false		// false or true - close tooltip if the user clicks somewhere
configSE. ClickSticky		= false		// false or true - make tooltip sticky if user left-clicks on the hovered element while the tooltip is active
configSE. CloseBtn		= true		// false or true - closebutton in titlebar
configSE. CloseBtnColors	= ['#FFCC00', '#FFFFFF', '#F0891B', '#FFFFFF']	// [Background, text, hovered background, hovered text] - use empty strings '' to inherit title colours
configSE. CloseBtnText	= '&nbsp;X&nbsp;'	// Close button text (may also be an image tag)
configSE. CopyContent		= true		// When converting a HTML element to a tooltip, copy only the element's content, rather than converting the element by its own
configSE. Delay			= 0		// Time span in ms until tooltip shows up
configSE. Duration		= 0			// Time span in ms after which the tooltip disappears; 0 for infinite duration, < 0 for delay in ms _after_ the onmouseout until the tooltip disappears
configSE. Exclusive		= false		// false or true - no other tooltip can appear until the current one has actively been closed
configSE. FadeIn			= 0		// Fade-in duration in ms, e.g. 400; 0 for no animation
configSE. FadeOut			= 0
configSE. FadeInterval	= 30		// Duration of each fade step in ms (recommended: 30) - shorter is smoother but causes more CPU-load
configSE. Fix				= null		//  null Fixated position, two modes. Mode 1: x- an y-coordinates in brackets, e.g. [210, 480]. Mode 2: Show tooltip at a position related to an HTML element: [ID of HTML element, x-offset, y-offset from HTML element], e.g. ['SomeID', 10, 30]. Value null (default) for no fixated positioning.
configSE. FollowMouse		= false		// false or true - tooltip follows the mouse
configSE. FontColor		= '#000044'
configSE. FontFace		= 'Arial,Helvetica,Verdana,Geneva,sans-serif'
configSE. FontSize		= '8pt'		// E.g. '9pt' or '12px' - unit is mandatory
configSE. FontWeight		= 'normal'	// 'normal' or 'bold';
configSE. Height			= 0			// Tooltip height; 0 for automatic adaption to tooltip content, < 0 (e.g. -100) for a maximum for automatic adaption
configSE. JumpHorz		= false		// false or true - jump horizontally to other side of mouse if tooltip would extend past clientarea boundary
configSE. JumpVert		= false		// false or true - jump vertically		"
configSE. Left			= false		// false or true - tooltip on the left of the mouse
configSE. OffsetX			= 0		// Horizontal offset of left-top corner from mousepointer
configSE. OffsetY			= 10			// Vertical offset
configSE. Opacity			= 100		// Integer between 0 and 100 - opacity of tooltip in percent
configSE. Padding			= 10			// Spacing between border and content
configSE. Shadow			= false		// false or true
configSE. ShadowColor		= '#C0C0C0'
configSE. ShadowWidth		= 5
configSE. Sticky			= true		// false or true - fixate tip, ie. don't follow the mouse and don't hide on mouseout
configSE. TextAlign		= 'left'	// 'left', 'right' or 'justify'
configSE. Title			= 'zuletzt gew&auml;hlter Standort'		// Default title text applied to all tips (no default title: empty string '')
configSE. TitleAlign		= 'left'	// 'left' or 'right' - text alignment inside the title bar
configSE. TitleBgColor	= '#000000'		// If empty string '', BorderColor will be used
configSE. TitleFontColor	= '#FFFFFF'	// Color of title text - if '', BgColor (of tooltip body) will be used
configSE. TitleFontFace	= ''		// If '' use FontFace (boldified)
configSE. TitleFontSize	= ''		// If '' use FontSize
configSE. TitlePadding	= 5
configSE. Width		= 220			// Tooltip width; 0 for automatic adaption to tooltip content; < -1 (e.g. -240) for a maximum width for that automatic adaption;
									// -1: tooltip width confined to the width required for the titlebar
//=======  END OF TOOLTIP CONFIG, DO NOT CHANGE ANYTHING BELOW  ==============//




//=====================  PUBLIC  =============================================//
function TipSE()
{
	SE_Tip(arguments, null);
}
function TagToTipSE()
{
	var t2t = SE_GetElt(arguments[0]);
	if(t2t)
		SE_Tip(arguments, t2t);
}
function UnTipSE()
{
	SE_OpReHref();
	if(SE_aV[DURATION] < 0 && (SE_iState & 0x2))
		SE_tDurt.Timer("SE_HideInit()", -SE_aV[DURATION], true);
	else if(!(SE_aV[STICKY] && (SE_iState & 0x2)))
		SE_HideInit();
}



//==================  PUBLIC PLUGIN API	 =====================================//
// Extension eventhandlers currently supported:
// OnLoadConfig, OnCreateContentString, OnSubDivsCreated, OnShow, OnMoveBefore,
// OnMoveAfter, OnHideInit, OnHide, OnKill

var SE_aElt = new Array(10), // Container DIV, outer title & body DIVs, inner title & body TDs, closebutton SPAN, shadow DIVs, and IFRAME to cover windowed elements in IE
SE_aV = new Array(),	// Caches and enumerates config data for currently active tooltip
SE_sContent,			// Inner tooltip text or HTML
SE_t2t, SE_t2tDad,		// Tag converted to tip, and its DOM parent element
SE_musX, SE_musY,
SE_over,
SE_x, SE_y, SE_w, SE_h; // Position, width and height of currently displayed tooltip

function SE_Extension()
{
	SE_ExtCmdEnum();
	SE_aExt[SE_aExt.length] = this;
	return this;
}
function SE_SetTipPos(x, y)
{
	var css = SE_aElt[0].style;

	SE_x = x;
	SE_y = y;
	css.left = x + "px";
	css.top = y + "px";
	if(SE_ie56)
	{
		var ifrm = SE_aElt[SE_aElt.length - 1];
		if(ifrm)
		{
			ifrm.style.left = css.left;
			ifrm.style.top = css.top;
		}
	}
}
function SE_HideInit()
{
	if(SE_iState)
	{
		SE_ExtCallFncs(0, "HideInit");
		SE_iState &= ~(0x4 | 0x8);
		if(SE_flagOpa && SE_aV[FADEOUT])
		{
			SE_tFade.EndTimer();
			if(SE_opa)
			{
				var n = Math.round(SE_aV[FADEOUT] / (SE_aV[FADEINTERVAL] * (SE_aV[OPACITY] / SE_opa)));
				SE_Fade(SE_opa, SE_opa, 0, n);
				return;
			}
		}
		SE_tHide.Timer("SE_Hide();", 1, false);
	}
}
function SE_Hide()
{
	if(SE_db && SE_iState)
	{
		SE_OpReHref();
		if(SE_iState & 0x2)
		{
			SE_aElt[0].style.visibility = "hidden";
			SE_ExtCallFncs(0, "Hide");
		}
		SE_tShow.EndTimer();
		SE_tHide.EndTimer();
		SE_tDurt.EndTimer();
		SE_tFade.EndTimer();
		if(!SE_op && !SE_ie)
		{
			SE_tWaitMov.EndTimer();
			SE_bWait = false;
		}
		if(SE_aV[CLICKCLOSE] || SE_aV[CLICKSTICKY])
			SE_RemEvtFnc(document, "mouseup", SE_OnLClick);
		SE_ExtCallFncs(0, "Kill");
		// In case of a TagToTip tip, hide converted DOM node and
		// re-insert it into DOM
		if(SE_t2t && !SE_aV[COPYCONTENT])
			SE_UnEl2Tip();
		SE_iState = 0;
		SE_over = null;
		SE_ResetMainDiv();
		if(SE_aElt[SE_aElt.length - 1])
			SE_aElt[SE_aElt.length - 1].style.display = "none";
	}
}
function SE_GetElt(id)
{
	return(document.getElementById ? document.getElementById(id)
			: document.all ? document.all[id]
			: null);
}
function SE_GetDivW(el)
{
	return(el ? (el.offsetWidth || el.style.pixelWidth || 0) : 0);
}
function SE_GetDivH(el)
{
	return(el ? (el.offsetHeight || el.style.pixelHeight || 0) : 0);
}
function SE_GetScrollX()
{
	return(window.pageXOffset || (SE_db ? (SE_db.scrollLeft || 0) : 0));
}
function SE_GetScrollY()
{
	return(window.pageYOffset || (SE_db ? (SE_db.scrollTop || 0) : 0));
}
function SE_GetClientW()
{
	return SE_GetWndCliSiz("Width");
}
function SE_GetClientH()
{
	return SE_GetWndCliSiz("Height");
}
function SE_GetEvtX(e)
{
	return (e ? ((typeof(e.pageX) != SE_u) ? e.pageX : (e.clientX + SE_GetScrollX())) : 0);
}
function SE_GetEvtY(e)
{
	return (e ? ((typeof(e.pageY) != SE_u) ? e.pageY : (e.clientY + SE_GetScrollY())) : 0);
}
function SE_AddEvtFnc(el, sEvt, PFnc)
{
	if(el)
	{
		if(el.addEventListener)
			el.addEventListener(sEvt, PFnc, false);
		else
			el.attachEvent("on" + sEvt, PFnc);
	}
}
function SE_RemEvtFnc(el, sEvt, PFnc)
{
	if(el)
	{
		if(el.removeEventListener)
			el.removeEventListener(sEvt, PFnc, false);
		else
			el.detachEvent("on" + sEvt, PFnc);
	}
}
function SE_GetDad(el)
{
	return(el.parentNode || el.parentElement || el.offsetParent);
}
function SE_MovDomNode(el, dadFrom, dadTo)
{
	if(dadFrom)
		dadFrom.removeChild(el);
	if(dadTo)
		dadTo.appendChild(el);
}

//======================  PRIVATE  ===========================================//
var SE_aExt = new Array(),	// Array of extension objects

SE_db, SE_op, SE_ie, SE_ie56, SE_bBoxOld,	// Browser flags
SE_body,
SE_ovr_,				// HTML element the mouse is currently over
SE_flagOpa,				// Opacity support: 1=IE, 2=Khtml, 3=KHTML, 4=Moz, 5=W3C
SE_maxPosX, SE_maxPosY,
SE_iState = 0,			// Tooltip active |= 1, shown |= 2, move with mouse |= 4, exclusive |= 8
SE_opa,					// Currently applied opacity
SE_bJmpVert, SE_bJmpHorz,// Tip temporarily on other side of mouse
SE_elDeHref,			// The tag from which we've removed the href attribute
// Timer
SE_tShow = new Number(0), SE_tHide = new Number(0), SE_tDurt = new Number(0),
SE_tFade = new Number(0), SE_tWaitMov = new Number(0),
SE_bWait = false,
SE_u = "undefined";


function SE_Init()
{
	SE_MkCmdEnum();
	// Send old browsers instantly to hell
	if(!SE_Browser() || !SE_MkMainDiv())
		return;
	SE_IsW3cBox();
	SE_OpaSupport();
	SE_AddEvtFnc(document, "mousemove", SE_Move);
	// In Debug mode we search for TagToTip() calls in order to notify
	// the user if they've forgotten to set the TagsToTip config flag
	if(TagsToTip || SE_Debug)
		SE_SetOnloadFnc();
	// Ensure the tip be hidden when the page unloads
	SE_AddEvtFnc(window, "unload", SE_Hide);
}
// Creates command names by translating config variable names to upper case
function SE_MkCmdEnum()
{
	var n = 0;
	for(var i in configSE)
		eval("window." + i.toString().toUpperCase() + " = " + n++);
	SE_aV.length = n;
}
function SE_Browser()
{
	var n, nv, n6, w3c;

	n = navigator.userAgent.toLowerCase(),
	nv = navigator.appVersion;
	SE_op = (document.defaultView && typeof(eval("w" + "indow" + "." + "o" + "p" + "er" + "a")) != SE_u);
	SE_ie = n.indexOf("msie") != -1 && document.all && !SE_op;
	if(SE_ie)
	{
		var ieOld = (!document.compatMode || document.compatMode == "BackCompat");
		SE_db = !ieOld ? document.documentElement : (document.body || null);
		if(SE_db)
			SE_ie56 = parseFloat(nv.substring(nv.indexOf("MSIE") + 5)) >= 5.5
					&& typeof document.body.style.maxHeight == SE_u;
	}
	else
	{
		SE_db = document.documentElement || document.body ||
				(document.getElementsByTagName ? document.getElementsByTagName("body")[0]
				: null);
		if(!SE_op)
		{
			n6 = document.defaultView && typeof document.defaultView.getComputedStyle != SE_u;
			w3c = !n6 && document.getElementById;
		}
	}
	SE_body = (document.getElementsByTagName ? document.getElementsByTagName("body")[0]
				: (document.body || null));
	if(SE_ie || n6 || SE_op || w3c)
	{
		if(SE_body && SE_db)
		{
			if(document.attachEvent || document.addEventListener)
				return true;
		}
		else
			SE_Err("wz_tooltip.js must be included INSIDE the body section,"
					+ " immediately after the opening <body> tag.", false);
	}
	SE_db = null;
	return false;
}
function SE_MkMainDiv()
{
	// Create the tooltip DIV
	if(SE_body.insertAdjacentHTML)
		SE_body.insertAdjacentHTML("afterBegin", SE_MkMainDivHtm());
	else if(typeof SE_body.innerHTML != SE_u && document.createElement && SE_body.appendChild)
		SE_body.appendChild(SE_MkMainDivDom());
	if(window.SE_GetMainDivRefs /* FireFox Alzheimer */ && SE_GetMainDivRefs())
		return true;
	SE_db = null;
	return false;
}
function SE_MkMainDivHtm()
{
	return(
		'<div id="2WzTtDiV"></div>' +
		(SE_ie56 ? ('<iframe id="2WzTtIfRm" src="javascript:false" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:none;"></iframe>')
		: '')
	);
}
function SE_MkMainDivDom()
{
	var el = document.createElement("div");
	if(el)
		el.id = "2WzTtDiV";
	return el;
}
function SE_GetMainDivRefs()
{
	SE_aElt[0] = SE_GetElt("2WzTtDiV");
	if(SE_ie56 && SE_aElt[0])
	{
		SE_aElt[SE_aElt.length - 1] = SE_GetElt("2WzTtIfRm");
		if(!SE_aElt[SE_aElt.length - 1])
			SE_aElt[0] = null;
	}
	if(SE_aElt[0])
	{
		var css = SE_aElt[0].style;

		css.visibility = "hidden";
		css.position = "absolute";
		css.overflow = "hidden";
		return true;
	}
	return false;
}
function SE_ResetMainDiv()
{
	SE_SetTipPos(0, 0);
	SE_aElt[0].innerHTML = "";
	SE_aElt[0].style.width = "0px";
	SE_h = 0;
}
function SE_IsW3cBox()
{
	var css = SE_aElt[0].style;

	css.padding = "10px";
	css.width = "40px";
	SE_bBoxOld = (SE_GetDivW(SE_aElt[0]) == 40);
	css.padding = "0px";
	SE_ResetMainDiv();
}
function SE_OpaSupport()
{
	var css = SE_body.style;

	SE_flagOpa = (typeof(css.KhtmlOpacity) != SE_u) ? 2
				: (typeof(css.KHTMLOpacity) != SE_u) ? 3
				: (typeof(css.MozOpacity) != SE_u) ? 4
				: (typeof(css.opacity) != SE_u) ? 5
				: (typeof(css.filter) != SE_u) ? 1
				: 0;
}
// Ported from http://dean.edwards.name/weblog/2006/06/again/
// (Dean Edwards et al.)
function SE_SetOnloadFnc()
{
	SE_AddEvtFnc(document, "DOMContentLoaded", SE_HideSrcTags);
	SE_AddEvtFnc(window, "load", SE_HideSrcTags);
	if(SE_body.attachEvent)
		SE_body.attachEvent("onreadystatechange",
			function() {
				if(SE_body.readyState == "complete")
					SE_HideSrcTags();
			} );
	if(/WebKit|KHTML/i.test(navigator.userAgent))
	{
		var t = setInterval(function() {
					if(/loaded|complete/.test(document.readyState))
					{
						clearInterval(t);
						SE_HideSrcTags();
					}
				}, 10);
	}
}
function SE_HideSrcTags()
{
	if(!window.SE_HideSrcTags || window.SE_HideSrcTags.done)
		return;
	window.SE_HideSrcTags.done = true;
	if(!SE_HideSrcTagsRecurs(SE_body))
		SE_Err("There are HTML elements to be converted to tooltips.\nIf you"
				+ " want these HTML elements to be automatically hidden, you"
				+ " must edit wz_tooltip.js, and set TagsToTip in the global"
				+ " tooltip configuration to true.", true);
}
function SE_HideSrcTagsRecurs(dad)
{
	var ovr, asT2t;
	// Walk the DOM tree for tags that have an onmouseover or onclick attribute
	// containing a TagToTip('...') call.
	// (.childNodes first since .children is bugous in Safari)
	var a = dad.childNodes || dad.children || null;

	for(var i = a ? a.length : 0; i;)
	{--i;
		if(!SE_HideSrcTagsRecurs(a[i]))
			return false;
		ovr = a[i].getAttribute ? (a[i].getAttribute("onmouseover") || a[i].getAttribute("onclick"))
				: (typeof a[i].onmouseover == "function") ? (a[i].onmouseover || a[i].onclick)
				: null;
		if(ovr)
		{
			asT2t = ovr.toString().match(/TagToTip\s*\(\s*'[^'.]+'\s*[\),]/);
			if(asT2t && asT2t.length)
			{
				if(!SE_HideSrcTag(asT2t[0]))
					return false;
			}
		}
	}
	return true;
}
function SE_HideSrcTag(sT2t)
{
	var id, el;

	// The ID passed to the found TagToTip() call identifies an HTML element
	// to be converted to a tooltip, so hide that element
	id = sT2t.replace(/.+'([^'.]+)'.+/, "$1");
	el = SE_GetElt(id);
	if(el)
	{
		if(SE_Debug && !TagsToTip)
			return false;
		else
			el.style.display = "none";
	}
	else
		SE_Err("Invalid ID\n'" + id + "'\npassed to TagToTip()."
				+ " There exists no HTML element with that ID.", true);
	return true;
}
function SE_Tip(arg, t2t)
{
	if(!SE_db || (SE_iState & 0x8))
		return;
	if(SE_iState)
		SE_Hide();
	if(!SE_Enabled)
		return;
	SE_t2t = t2t;
	if(!SE_ReadCmds(arg))
		return;
	SE_iState = 0x1 | 0x4;
	SE_AdaptconfigSE1();
	SE_MkTipContent(arg);
	SE_MkTipSubDivs();
	SE_FormatTip();
	SE_bJmpVert = false;
	SE_bJmpHorz = false;
	SE_maxPosX = SE_GetClientW() + SE_GetScrollX() - SE_w - 1;
	SE_maxPosY = SE_GetClientH() + SE_GetScrollY() - SE_h - 1;
	SE_AdaptconfigSE2();
	// Ensure the tip be shown and positioned before the first onmousemove
	SE_OverInit();
	SE_ShowInit();
	SE_Move();
}
function SE_ReadCmds(a)
{
	var i;

	// First load the global config values, to initialize also values
	// for which no command is passed
	i = 0;
	for(var j in configSE)
		SE_aV[i++] = configSE[j];
	// Then replace each cached config value for which a command is
	// passed (ensure the # of command args plus value args be even)
	if(a.length & 1)
	{
		for(i = a.length - 1; i > 0; i -= 2)
			SE_aV[a[i - 1]] = a[i];
		return true;
	}
	SE_Err("Incorrect call of Tip() or TagToTip().\n"
			+ "Each command must be followed by a value.", true);
	return false;
}
function SE_AdaptconfigSE1()
{
	SE_ExtCallFncs(0, "LoadConfig");
	// Inherit unspecified title formattings from body
	if(!SE_aV[TITLEBGCOLOR].length)
		SE_aV[TITLEBGCOLOR] = SE_aV[BORDERCOLOR];
	if(!SE_aV[TITLEFONTCOLOR].length)
		SE_aV[TITLEFONTCOLOR] = SE_aV[BGCOLOR];
	if(!SE_aV[TITLEFONTFACE].length)
		SE_aV[TITLEFONTFACE] = SE_aV[FONTFACE];
	if(!SE_aV[TITLEFONTSIZE].length)
		SE_aV[TITLEFONTSIZE] = SE_aV[FONTSIZE];
	if(SE_aV[CLOSEBTN])
	{
		// Use title colours for non-specified closebutton colours
		if(!SE_aV[CLOSEBTNCOLORS])
			SE_aV[CLOSEBTNCOLORS] = new Array("", "", "", "");
		for(var i = 4; i;)
		{--i;
			if(!SE_aV[CLOSEBTNCOLORS][i].length)
				SE_aV[CLOSEBTNCOLORS][i] = (i & 1) ? SE_aV[TITLEFONTCOLOR] : SE_aV[TITLEBGCOLOR];
		}
		// Enforce titlebar be shown
		if(!SE_aV[TITLE].length)
			SE_aV[TITLE] = " ";
	}
	// Circumvents broken display of images and fade-in flicker in Geckos < 1.8
	if(SE_aV[OPACITY] == 100 && typeof SE_aElt[0].style.MozOpacity != SE_u && !Array.every)
		SE_aV[OPACITY] = 99;
	// Smartly shorten the delay for fade-in tooltips
	if(SE_aV[FADEIN] && SE_flagOpa && SE_aV[DELAY] > 100)
		SE_aV[DELAY] = Math.max(SE_aV[DELAY] - SE_aV[FADEIN], 100);
}
function SE_AdaptconfigSE2()
{
	if(SE_aV[CENTERMOUSE])
	{
		SE_aV[OFFSETX] -= ((SE_w - (SE_aV[SHADOW] ? SE_aV[SHADOWWIDTH] : 0)) >> 1);
		SE_aV[JUMPHORZ] = false;
	}
}
// Expose content globally so extensions can modify it
function SE_MkTipContent(a)
{
	if(SE_t2t)
	{
		if(SE_aV[COPYCONTENT])
			SE_sContent = SE_t2t.innerHTML;
		else
			SE_sContent = "";
	}
	else
		SE_sContent = a[0];
	SE_ExtCallFncs(0, "CreateContentString");
}
function SE_MkTipSubDivs()
{
	var sCss = 'position:relative;margin:0px;padding:0px;border-width:0px;left:0px;top:0px;line-height:normal;width:auto;',
	sTbTrTd = ' cellspacing="0" cellpadding="0" border="0" style="' + sCss + '"><tbody style="' + sCss + '"><tr><td ';

	SE_aElt[0].style.width = SE_GetClientW() + "px";
	SE_aElt[0].innerHTML =
		(''
		+ (SE_aV[TITLE].length ?
			('<div id="2WzTiTl" style="position:relative;z-index:1;">'
			+ '<table id="2WzTiTlTb"' + sTbTrTd + 'id="2WzTiTlI" style="' + sCss + '">'
			+ SE_aV[TITLE]
			+ '</td>'
			+ (SE_aV[CLOSEBTN] ?
				('<td align="right" style="' + sCss
				+ 'text-align:right;">'
				+ '<span id="2WzClOsE" style="position:relative;left:2px;padding-left:2px;padding-right:2px;'
				+ 'cursor:' + (SE_ie ? 'hand' : 'pointer')
				+ ';" onmouseover="SE_OnCloseBtnOver(1)" onmouseout="SE_OnCloseBtnOver(0)" onclick="SE_HideInit()">'
				+ SE_aV[CLOSEBTNTEXT]
				+ '</span></td>')
				: '')
			+ '</tr></tbody></table></div>')
			: '')
		+ '<div id="2WzBoDy" style="position:relative;z-index:0;">'
		+ '<table' + sTbTrTd + 'id="2WzBoDyI" style="' + sCss + '">'
		+ SE_sContent
		+ '</td></tr></tbody></table></div>'
		+ (SE_aV[SHADOW]
			? ('<div id="2WzTtShDwR" style="position:absolute;overflow:hidden;"></div>'
				+ '<div id="2WzTtShDwB" style="position:relative;overflow:hidden;"></div>')
			: '')
		);
	SE_GetSubDivRefs();
	// Convert DOM node to tip
	if(SE_t2t && !SE_aV[COPYCONTENT])
		SE_El2Tip();
	SE_ExtCallFncs(0, "SubDivsCreated");
}
function SE_GetSubDivRefs()
{
	var aId = new Array("2WzTiTl", "2WzTiTlTb", "2WzTiTlI", "2WzClOsE", "2WzBoDy", "2WzBoDyI", "2WzTtShDwB", "2WzTtShDwR");

	for(var i = aId.length; i; --i)
		SE_aElt[i] = SE_GetElt(aId[i - 1]);
}
function SE_FormatTip()
{
	var css, w, h, pad = SE_aV[PADDING], padT, wBrd = SE_aV[BORDERWIDTH],
	iOffY, iOffSh, iAdd = (pad + wBrd) << 1;

	//--------- Title DIV ----------
	if(SE_aV[TITLE].length)
	{
		padT = SE_aV[TITLEPADDING];
		css = SE_aElt[1].style;
		css.background = SE_aV[TITLEBGCOLOR];
		css.paddingTop = css.paddingBottom = padT + "px";
		css.paddingLeft = css.paddingRight = (padT + 2) + "px";
		css = SE_aElt[3].style;
		css.color = SE_aV[TITLEFONTCOLOR];
		if(SE_aV[WIDTH] == -1)
			css.whiteSpace = "nowrap";
		css.fontFamily = SE_aV[TITLEFONTFACE];
		css.fontSize = SE_aV[TITLEFONTSIZE];
		css.fontWeight = "bold";
		css.textAlign = SE_aV[TITLEALIGN];
		// Close button DIV
		if(SE_aElt[4])
		{
			css = SE_aElt[4].style;
			css.background = SE_aV[CLOSEBTNCOLORS][0];
			css.color = SE_aV[CLOSEBTNCOLORS][1];
			css.fontFamily = SE_aV[TITLEFONTFACE];
			css.fontSize = SE_aV[TITLEFONTSIZE];
			css.fontWeight = "bold";
		}
		if(SE_aV[WIDTH] > 0)
			SE_w = SE_aV[WIDTH];
		else
		{
			SE_w = SE_GetDivW(SE_aElt[3]) + SE_GetDivW(SE_aElt[4]);
			// Some spacing between title DIV and closebutton
			if(SE_aElt[4])
				SE_w += pad;
			// Restrict auto width to max width
			if(SE_aV[WIDTH] < -1 && SE_w > -SE_aV[WIDTH])
				SE_w = -SE_aV[WIDTH];
		}
		// Ensure the top border of the body DIV be covered by the title DIV
		iOffY = -wBrd;
	}
	else
	{
		SE_w = 0;
		iOffY = 0;
	}

	//-------- Body DIV ------------
	css = SE_aElt[5].style;
	css.top = iOffY + "px";
	if(wBrd)
	{
		css.borderColor = SE_aV[BORDERCOLOR];
		css.borderStyle = SE_aV[BORDERSTYLE];
		css.borderWidth = wBrd + "px";
	}
	if(SE_aV[BGCOLOR].length)
		css.background = SE_aV[BGCOLOR];
	if(SE_aV[BGIMG].length)
		css.backgroundImage = "url(" + SE_aV[BGIMG] + ")";
	css.padding = pad + "px";
	css.textAlign = SE_aV[TEXTALIGN];
	if(SE_aV[HEIGHT])
	{
		css.overflow = "auto";
		if(SE_aV[HEIGHT] > 0)
			css.height = (SE_aV[HEIGHT] + iAdd) + "px";
		else
			SE_h = iAdd - SE_aV[HEIGHT];
	}
	// TD inside body DIV
	css = SE_aElt[6].style;
	css.color = SE_aV[FONTCOLOR];
	css.fontFamily = SE_aV[FONTFACE];
	css.fontSize = SE_aV[FONTSIZE];
	css.fontWeight = SE_aV[FONTWEIGHT];
	css.textAlign = SE_aV[TEXTALIGN];
	if(SE_aV[WIDTH] > 0)
		w = SE_aV[WIDTH];
	// Width like title (if existent)
	else if(SE_aV[WIDTH] == -1 && SE_w)
		w = SE_w;
	else
	{
		// Measure width of the body's inner TD, as some browsers would expand
		// the container and outer body DIV to 100%
		w = SE_GetDivW(SE_aElt[6]);
		// Restrict auto width to max width
		if(SE_aV[WIDTH] < -1 && w > -SE_aV[WIDTH])
			w = -SE_aV[WIDTH];
	}
	if(w > SE_w)
		SE_w = w;
	SE_w += iAdd;

	//--------- Shadow DIVs ------------
	if(SE_aV[SHADOW])
	{
		SE_w += SE_aV[SHADOWWIDTH];
		iOffSh = Math.floor((SE_aV[SHADOWWIDTH] * 4) / 3);
		// Bottom shadow
		css = SE_aElt[7].style;
		css.top = iOffY + "px";
		css.left = iOffSh + "px";
		css.width = (SE_w - iOffSh - SE_aV[SHADOWWIDTH]) + "px";
		css.height = SE_aV[SHADOWWIDTH] + "px";
		css.background = SE_aV[SHADOWCOLOR];
		// Right shadow
		css = SE_aElt[8].style;
		css.top = iOffSh + "px";
		css.left = (SE_w - SE_aV[SHADOWWIDTH]) + "px";
		css.width = SE_aV[SHADOWWIDTH] + "px";
		css.background = SE_aV[SHADOWCOLOR];
	}
	else
		iOffSh = 0;

	//-------- Container DIV -------
	SE_SetTipOpa(SE_aV[FADEIN] ? 0 : SE_aV[OPACITY]);
	SE_FixSize(iOffY, iOffSh);
}
// Fixate the size so it can't dynamically change while the tooltip is moving.
function SE_FixSize(iOffY, iOffSh)
{
	var wIn, wOut, h, add, pad = SE_aV[PADDING], wBrd = SE_aV[BORDERWIDTH], i;

	SE_aElt[0].style.width = SE_w + "px";
	SE_aElt[0].style.pixelWidth = SE_w;
	wOut = SE_w - ((SE_aV[SHADOW]) ? SE_aV[SHADOWWIDTH] : 0);
	// Body
	wIn = wOut;
	if(!SE_bBoxOld)
		wIn -= (pad + wBrd) << 1;
	SE_aElt[5].style.width = wIn + "px";
	// Title
	if(SE_aElt[1])
	{
		wIn = wOut - ((SE_aV[TITLEPADDING] + 2) << 1);
		if(!SE_bBoxOld)
			wOut = wIn;
		SE_aElt[1].style.width = wOut + "px";
		SE_aElt[2].style.width = wIn + "px";
	}
	// Max height specified
	if(SE_h)
	{
		h = SE_GetDivH(SE_aElt[5]);
		if(h > SE_h)
		{
			if(!SE_bBoxOld)
				SE_h -= (pad + wBrd) << 1;
			SE_aElt[5].style.height = SE_h + "px";
		}
	}
	SE_h = SE_GetDivH(SE_aElt[0]) + iOffY;
	// Right shadow
	if(SE_aElt[8])
		SE_aElt[8].style.height = (SE_h - iOffSh) + "px";
	i = SE_aElt.length - 1;
	if(SE_aElt[i])
	{
		SE_aElt[i].style.width = SE_w + "px";
		SE_aElt[i].style.height = SE_h + "px";
	}
}
function SE_DeAlt(el)
{
	var aKid;

	if(el)
	{
		if(el.alt)
			el.alt = "";
		if(el.title)
			el.title = "";
		aKid = el.childNodes || el.children || null;
		if(aKid)
		{
			for(var i = aKid.length; i;)
				SE_DeAlt(aKid[--i]);
		}
	}
}
// This hack removes the native tooltips over links in Opera
function SE_OpDeHref(el)
{
	if(!SE_op)
		return;
	if(SE_elDeHref)
		SE_OpReHref();
	while(el)
	{
		if(el.hasAttribute && el.hasAttribute("href"))
		{
			el.t_href = el.getAttribute("href");
			el.t_stats = window.status;
			el.removeAttribute("href");
			el.style.cursor = "hand";
			SE_AddEvtFnc(el, "mousedown", SE_OpReHref);
			window.status = el.t_href;
			SE_elDeHref = el;
			break;
		}
		el = SE_GetDad(el);
	}
}
function SE_OpReHref()
{
	if(SE_elDeHref)
	{
		SE_elDeHref.setAttribute("href", SE_elDeHref.t_href);
		SE_RemEvtFnc(SE_elDeHref, "mousedown", SE_OpReHref);
		window.status = SE_elDeHref.t_stats;
		SE_elDeHref = null;
	}
}
function SE_El2Tip()
{
	var css = SE_t2t.style;

	// Store previous positioning
	SE_t2t.t_cp = css.position;
	SE_t2t.t_cl = css.left;
	SE_t2t.t_ct = css.top;
	SE_t2t.t_cd = css.display;
	// Store the tag's parent element so we can restore that DOM branch
	// when the tooltip is being hidden
	SE_t2tDad = SE_GetDad(SE_t2t);
	SE_MovDomNode(SE_t2t, SE_t2tDad, SE_aElt[6]);
	css.display = "block";
	css.position = "static";
	css.left = css.top = css.marginLeft = css.marginTop = "0px";
}
function SE_UnEl2Tip()
{
	// Restore positioning and display
	var css = SE_t2t.style;

	css.display = SE_t2t.t_cd;
	SE_MovDomNode(SE_t2t, SE_GetDad(SE_t2t), SE_t2tDad);
	css.position = SE_t2t.t_cp;
	css.left = SE_t2t.t_cl;
	css.top = SE_t2t.t_ct;
	SE_t2tDad = null;
}
function SE_OverInit()
{
	if(window.event)
		SE_over = window.event.target || window.event.srcElement;
	else
		SE_over = SE_ovr_;
	SE_DeAlt(SE_over);
	SE_OpDeHref(SE_over);
}
function SE_ShowInit()
{
	SE_tShow.Timer("SE_Show()", SE_aV[DELAY], true);
	if(SE_aV[CLICKCLOSE] || SE_aV[CLICKSTICKY])
		SE_AddEvtFnc(document, "mouseup", SE_OnLClick);
}
function SE_Show()
{
	var css = SE_aElt[0].style;

	// Override the z-index of the topmost wz_dragdrop.js D&D item
	css.zIndex = Math.max((window.dd && dd.z) ? (dd.z + 2) : 0, 1010);
	if(SE_aV[STICKY] || !SE_aV[FOLLOWMOUSE])
		SE_iState &= ~0x4;
	if(SE_aV[EXCLUSIVE])
		SE_iState |= 0x8;
	if(SE_aV[DURATION] > 0)
		SE_tDurt.Timer("SE_HideInit()", SE_aV[DURATION], true);
	SE_ExtCallFncs(0, "Show")
	css.visibility = "visible";
	SE_iState |= 0x2;
	if(SE_aV[FADEIN])
		SE_Fade(0, 0, SE_aV[OPACITY], Math.round(SE_aV[FADEIN] / SE_aV[FADEINTERVAL]));
	SE_ShowIfrm();
}
function SE_ShowIfrm()
{
	if(SE_ie56)
	{
		var ifrm = SE_aElt[SE_aElt.length - 1];
		if(ifrm)
		{
			var css = ifrm.style;
			css.zIndex = SE_aElt[0].style.zIndex - 1;
			css.display = "block";
		}
	}
}
function SE_Move(e)
{
	if(e)
		SE_ovr_ = e.target || e.srcElement;
	e = e || window.event;
	if(e)
	{
		SE_musX = SE_GetEvtX(e);
		SE_musY = SE_GetEvtY(e);
	}
	if(SE_iState & 0x4)
	{
		// Prevent jam of mousemove events
		if(!SE_op && !SE_ie)
		{
			if(SE_bWait)
				return;
			SE_bWait = true;
			SE_tWaitMov.Timer("SE_bWait = false;", 1, true);
		}
		if(SE_aV[FIX])
		{
			SE_iState &= ~0x4;
			SE_PosFix();
		}
		else if(!SE_ExtCallFncs(e, "MoveBefore"))
			SE_SetTipPos(SE_Pos(0), SE_Pos(1));
		SE_ExtCallFncs([SE_musX, SE_musY], "MoveAfter")
	}
}
function SE_Pos(iDim)
{
	var iX, bJmpMod, cmdAlt, cmdOff, cx, iMax, iScrl, iMus, bJmp;

	// Map values according to dimension to calculate
	if(iDim)
	{
		bJmpMod = SE_aV[JUMPVERT];
		cmdAlt = ABOVE;
		cmdOff = OFFSETY;
		cx = SE_h;
		iMax = SE_maxPosY;
		iScrl = SE_GetScrollY();
		iMus = SE_musY;
		bJmp = SE_bJmpVert;
	}
	else
	{
		bJmpMod = SE_aV[JUMPHORZ];
		cmdAlt = LEFT;
		cmdOff = OFFSETX;
		cx = SE_w;
		iMax = SE_maxPosX;
		iScrl = SE_GetScrollX();
		iMus = SE_musX;
		bJmp = SE_bJmpHorz;
	}
	if(bJmpMod)
	{
		if(SE_aV[cmdAlt] && (!bJmp || SE_CalcPosAlt(iDim) >= iScrl + 16))
			iX = SE_PosAlt(iDim);
		else if(!SE_aV[cmdAlt] && bJmp && SE_CalcPosDef(iDim) > iMax - 16)
			iX = SE_PosAlt(iDim);
		else
			iX = SE_PosDef(iDim);
	}
	else
	{
		iX = iMus;
		if(SE_aV[cmdAlt])
			iX -= cx + SE_aV[cmdOff] - (SE_aV[SHADOW] ? SE_aV[SHADOWWIDTH] : 0);
		else
			iX += SE_aV[cmdOff];
	}
	// Prevent tip from extending past clientarea boundary
	if(iX > iMax)
		iX = bJmpMod ? SE_PosAlt(iDim) : iMax;
	// In case of insufficient space on both sides, ensure the left/upper part
	// of the tip be visible
	if(iX < iScrl)
		iX = bJmpMod ? SE_PosDef(iDim) : iScrl;
	return iX;
}
function SE_PosDef(iDim)
{
	if(iDim)
		SE_bJmpVert = SE_aV[ABOVE];
	else
		SE_bJmpHorz = SE_aV[LEFT];
	return SE_CalcPosDef(iDim);
}
function SE_PosAlt(iDim)
{
	if(iDim)
		SE_bJmpVert = !SE_aV[ABOVE];
	else
		SE_bJmpHorz = !SE_aV[LEFT];
	return SE_CalcPosAlt(iDim);
}
function SE_CalcPosDef(iDim)
{
	return iDim ? (SE_musY + SE_aV[OFFSETY]) : (SE_musX + SE_aV[OFFSETX]);
}
function SE_CalcPosAlt(iDim)
{
	var cmdOff = iDim ? OFFSETY : OFFSETX;
	var dx = SE_aV[cmdOff] - (SE_aV[SHADOW] ? SE_aV[SHADOWWIDTH] : 0);
	if(SE_aV[cmdOff] > 0 && dx <= 0)
		dx = 1;
	return((iDim ? (SE_musY - SE_h) : (SE_musX - SE_w)) - dx);
}
function SE_PosFix()
{
	var iX, iY;

	if(typeof(SE_aV[FIX][0]) == "number")
	{
		iX = SE_aV[FIX][0];
		iY = SE_aV[FIX][1];
	}
	else
	{
		if(typeof(SE_aV[FIX][0]) == "string")
			el = SE_GetElt(SE_aV[FIX][0]);
		// First slot in array is direct reference to HTML element
		else
			el = SE_aV[FIX][0];
		iX = SE_aV[FIX][1];
		iY = SE_aV[FIX][2];
		// By default, vert pos is related to bottom edge of HTML element
		if(!SE_aV[ABOVE] && el)
			iY += SE_GetDivH(el);
		for(; el; el = el.offsetParent)
		{
			iX += el.offsetLeft || 0;
			iY += el.offsetTop || 0;
		}
	}
	// For a fixed tip positioned above the mouse, use the bottom edge as anchor
	// (recommended by Christophe Rebeschini, 31.1.2008)
	if(SE_aV[ABOVE])
		iY -= SE_h;
	SE_SetTipPos(iX, iY);
}
function SE_Fade(a, now, z, n)
{
	if(n)
	{
		now += Math.round((z - now) / n);
		if((z > a) ? (now >= z) : (now <= z))
			now = z;
		else
			SE_tFade.Timer(
				"SE_Fade("
				+ a + "," + now + "," + z + "," + (n - 1)
				+ ")",
				SE_aV[FADEINTERVAL],
				true
			);
	}
	now ? SE_SetTipOpa(now) : SE_Hide();
}
function SE_SetTipOpa(opa)
{
	// To circumvent the opacity nesting flaws of IE, we set the opacity
	// for each sub-DIV separately, rather than for the container DIV.
	SE_SetOpa(SE_aElt[5], opa);
	if(SE_aElt[1])
		SE_SetOpa(SE_aElt[1], opa);
	if(SE_aV[SHADOW])
	{
		opa = Math.round(opa * 0.8);
		SE_SetOpa(SE_aElt[7], opa);
		SE_SetOpa(SE_aElt[8], opa);
	}
}
function SE_OnCloseBtnOver(iOver)
{
	var css = SE_aElt[4].style;

	iOver <<= 1;
	css.background = SE_aV[CLOSEBTNCOLORS][iOver];
	css.color = SE_aV[CLOSEBTNCOLORS][iOver + 1];
}
function SE_OnLClick(e)
{
	//  Ignore right-clicks
	e = e || window.event;
	if(!((e.button && e.button & 2) || (e.which && e.which == 3)))
	{
		if(SE_aV[CLICKSTICKY] && (SE_iState & 0x4))
		{
			SE_aV[STICKY] = true;
			SE_iState &= ~0x4;
		}
		else if(SE_aV[CLICKCLOSE])
			SE_HideInit();
	}
}
function SE_Int(x)
{
	var y;

	return(isNaN(y = parseInt(x)) ? 0 : y);
}
Number.prototype.Timer = function(s, iT, bUrge)
{
	if(!this.value || bUrge)
		this.value = window.setTimeout(s, iT);
}
Number.prototype.EndTimer = function()
{
	if(this.value)
	{
		window.clearTimeout(this.value);
		this.value = 0;
	}
}
function SE_GetWndCliSiz(s)
{
	var db, y = window["inner" + s], sC = "client" + s, sN = "number";
	if(typeof y == sN)
	{
		var y2;
		return(
			// Gecko or Opera with scrollbar
			// ... quirks mode
			((db = document.body) && typeof(y2 = db[sC]) == sN && y2 &&  y2 <= y) ? y2 
			// ... strict mode
			: ((db = document.documentElement) && typeof(y2 = db[sC]) == sN && y2 && y2 <= y) ? y2
			// No scrollbar, or clientarea size == 0, or other browser (KHTML etc.)
			: y
		);
	}
	// IE
	return(
		// document.documentElement.client+s functional, returns > 0
		((db = document.documentElement) && (y = db[sC])) ? y
		// ... not functional, in which case document.body.client+s 
		// is the clientarea size, fortunately
		: document.body[sC]
	);
}
function SE_SetOpa(el, opa)
{
	var css = el.style;

	SE_opa = opa;
	if(SE_flagOpa == 1)
	{
		if(opa < 100)
		{
			// Hacks for bugs of IE:
			// 1.) Once a CSS filter has been applied, fonts are no longer
			// anti-aliased, so we store the previous 'non-filter' to be
			// able to restore it
			if(typeof(el.filtNo) == SE_u)
				el.filtNo = css.filter;
			// 2.) A DIV cannot be made visible in a single step if an
			// opacity < 100 has been applied while the DIV was hidden
			var bVis = css.visibility != "hidden";
			// 3.) In IE6, applying an opacity < 100 has no effect if the
			//	   element has no layout (position, size, zoom, ...)
			css.zoom = "100%";
			if(!bVis)
				css.visibility = "visible";
			css.filter = "alpha(opacity=" + opa + ")";
			if(!bVis)
				css.visibility = "hidden";
		}
		else if(typeof(el.filtNo) != SE_u)
			// Restore 'non-filter'
			css.filter = el.filtNo;
	}
	else
	{
		opa /= 100.0;
		switch(SE_flagOpa)
		{
		case 2:
			css.KhtmlOpacity = opa; break;
		case 3:
			css.KHTMLOpacity = opa; break;
		case 4:
			css.MozOpacity = opa; break;
		case 5:
			css.opacity = opa; break;
		}
	}
}
function SE_Err(sErr, bIfDebug)
{
	if(SE_Debug || !bIfDebug)
		alert("Tooltip Script Error Message:\n\n" + sErr);
}

//============  EXTENSION (PLUGIN) MANAGER  ===============//
function SE_ExtCmdEnum()
{
	var s;

	// Add new command(s) to the commands enum
	for(var i in configSE)
	{
		s = "window." + i.toString().toUpperCase();
		if(eval("typeof(" + s + ") == SE_u"))
		{
			eval(s + " = " + SE_aV.length);
			SE_aV[SE_aV.length] = null;
		}
	}
}
function SE_ExtCallFncs(arg, sFnc)
{
	var b = false;
	for(var i = SE_aExt.length; i;)
	{--i;
		var fnc = SE_aExt[i]["On" + sFnc];
		// Call the method the extension has defined for this event
		if(fnc && fnc(arg))
			b = true;
	}
	return b;
}

SE_Init();



