// espace wz_tooltip
// **** espace ***
// Multi-select list function
function _toggle(id, separator, force_hidden) {
  var el = $(id)
  var ieframe = $('ie' + id)
  if ((force_hidden === true) || (el.style.visibility == 'visible')) {
    el.style.visibility = 'hidden'
    ieframe.style.display = 'none'
  }
  else {
    var input = $(id + '_values')
		var coords = Position.cumulativeOffset(input)
		var fleft = coords[0] - 28
		var ftop = coords[1] - 24
    el.style.top=(ftop) + 'px'
    el.style.left=fleft + 'px'
    el.style.visibility = 'visible'

    // See dotnetjunkies.com/WebLog/jking/archive/2003/10/30/2975.aspx
    ieframe.style.width = el.offsetWidth
    ieframe.style.height = el.offsetHeight
    ieframe.style.top = el.style.top
    ieframe.style.left = el.style.left
    ieframe.style.zIndex = el.style.zIndex - 1
    ieframe.style.display = 'block'
  }

  updateList(id, separator)
  return(false)
}

function checkem(name, bool) {
  var count = 0
  var id = name + count
  var el = $(id)
  while (el != null) {
    el.checked = bool
    count++
    id = name + count
    el = $(id)
  }
  return(false)
}

function updateList(name, separator) {
  var count = 0
  var values = ''
  var string = ''
  var id = name + '0'
  var el = $(id)
  while (el != null) {
    if (el.checked) {
      string += (string != '' ? separator : '') + el.getAttribute('xstring')
    }

    count++
    id = name + count
    el = $(id)
  }

  var input_id = name + '_values'
  el = $(input_id)
  el.value = string
  el.title = string
}

var ua = navigator.userAgent.toLowerCase()
var isSafari = (ua.indexOf('safari') != - 1)
var isMacIE = (ua.indexOf('msie') != - 1) && (ua.indexOf('mac_') != - 1)

// Get the top coord of the element
function getRealTop(el) {
  var yPos = el.offsetTop - (el.scrollTop ? el.scrollTop : 0) + (isSafari || isMacIE ? 0 : getScrollTop())
  tempEl = el.offsetParent
  while (tempEl != null) {
    yPos += tempEl.offsetTop - (tempEl.parentNode.scrollTop == null ? 0 : tempEl.parentNode.scrollTop)
    tempEl = tempEl.offsetParent
  }
  return(yPos)
}

// Get the left coord of the element
function getRealLeft(el) {
  var xPos = el.offsetLeft
  tempEl = el.offsetParent
  while (tempEl != null) {
    xPos += tempEl.offsetLeft
    tempEl = tempEl.offsetParent
  }
  return(xPos)
}

// See www.quirksmode.org/viewport/compatibility.html
function getScrollTop() {
  var y
  if (self.pageYOffset) // all except Explorer
    {
      y = self.pageYOffset;
    }
  else if (document.documentElement && document.documentElement.scrollTop)
    // Explorer 6 Strict
    {
      y = document.documentElement.scrollTop;
    }
  else if (document.body) // all other Explorers
    {
      y = document.body.scrollTop;
    }

  return(y)
}

/* Cookie functions from www.netspade.com/articles/2005/11/16/javascript-cookies/ */
/*
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/*
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

/*
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name, path, domain) {
    if (getCookie(name)) {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}

// Check if a number is between two others
// Display a message if not and return false
function cknum(id, min, max, name) {
	var field = document.getElementById(id)
	var val = field.value
	if (val == '') {
		val = 0
	}
	if (!isInt(val)) {
		alert(name + ' must be a whole number between ' + min + ' and ' + max)
		field.focus()
		return(true)
	}
	if (val < min) {
		alert(name + ' must be at least ' + min)
		field.focus()
		return(true)
	}
	if (val > max) {
		alert(name + ' must be less than or equal to ' + max)
		field.focus()
		return(true)
	}
	return(false)
}

// Return true if parm is an integer
function isInt(str) {
	var i = parseInt(str)
	if (isNaN(i)) {
		return(false)
	}
	i = i.toString ()
	if (i != str)
		return(false)
	return(true)
}

// Check if a number is between two others
// Display a message if not and return false
function ckdec(id, min, max, name) {
	var field = document.getElementById(id)
	var val = field.value
	if (val == '') {
		field.value = 0
		return(false)
	}
	if (!isFloat(val)) {
		alert(name + ' must be a number between ' + min + ' and ' + max)
		field.focus()
		return(true)
	}
	if (val < min) {
		alert(name + ' must be at least ' + min)
		field.focus()
		return(true)
	}
	if (val > max) {
		alert(name + ' must be less than or equal to ' + max)
		field.focus()
		return(true)
	}
	return(false)
}

// Return true if parm is a float
function isFloat(str) {
	return(str == String(str).match(/[+-]{0,1}\d*\.{0,1}\d*/)[0]);
}

// Validate a 'date field'
// DD, MMxDD, MMxDDxYY, MMxDDxYYYY, YYYYxMMxDD, TOD(AY), 
// TOM(ORROW), Y(ESTERDAY)
//    where x is any non-numeric, printable character
// if 'required' is true, a date is required
//    otherwise an empty field is OK
// if 'asSqlDate' is true, date will be formatted as YYYY-MM-DD
//    otherwise it will be formatted as MM/DD/YYYY
function checkDate(field, required, asSqlDate) {

   asSqlDate = false

   err = ''
   val = field.value.toUpperCase()
   today = new Date()

   if ((val == '') && (required != true))
      return true

   if ((val.length >= 3) && (val.substring(0, 3) == 'TOD')) {
      day = today.getDate()
      month = today.getMonth() + 1
      year = today.getYear()
   } else if ((val.length >= 3) && (val.substring(0, 3) == 'TOM')) {
      date = new Date(today.getTime() + 86400000)
      day = date.getDate()
      month = date.getMonth() + 1
      year = date.getYear() 
   } else if (val.substring(0, 1) == 'Y') {
      date = new Date(today.getTime() - 86400000)
      day = date.getDate()
      month = date.getMonth() + 1
      year = date.getYear() 
   } else {

         // Month (or day or year)

      pos = 0  
      a = ''
      ch = val.substring(pos, pos+1)
      while ((ch >= '0') & (ch <= '9')) {
         a = a + ch
         pos += 1 
         ch = val.substring(pos, pos+1)
      }
      pos += 1

         // Day (or month)

      b = ''
      ch = val.substring(pos, pos+1)
      while ((ch >= '0') & (ch <= '9')) {
         b = b + ch
         pos += 1 
         ch = val.substring(pos, pos+1)
      }
      pos += 1

         // Year (or month)
   
      c = ''
      ch = val.substring(pos, pos+1)
      while ((ch >= '0') & (ch <= '9')) {
         c = c + ch
         pos += 1 
         ch = val.substring(pos, pos+1)
      }

         // Which format -> DD, MM/DD(/YYYY) or YYYY-MM-DD)

      if ((b == '') && (c == '')) {
         day = (a == '') ? 0 : parseInt(a, 10)
         month = today.getMonth() + 1
         year = today.getYear()
         if (year < 1900)
            year += 1900
      }
      else {
         a = (a == '') ? 0 : parseInt(a, 10)
         if (a > 12) {
            year = a
            month = (b == '') ? 0 : parseInt(b, 10)
            day = (c == '') ? 0 : parseInt(c, 10)
         }
         else {
            month = a
            day = (b == '') ? 0 : parseInt(b, 10)
            year = (c == '') ? -1 : parseInt(c, 10)
         }
      }
   }

      // Fill in this year if left out

   if (year == -1) {
      year = today.getYear()
      if (year < 1900)
         year += 1900
   }
   if (year < 100) {
      if (year < 50)
         year = 2000 + year
      else
        year = 1900 + year
   }

      // Check 'em

   if (month < 1 || month > 12)
      err = 'Bad month'
   if (day < 1 || day > 31)
      err = 'Bad day'
   if (year < 0)
      err = 'Bad year'
   if (month == 4 || month == 6 || month == 9 || month == 11) {
      if (day == 31)
         err = 'Bad day'
   }
   if (month == 2) {
      var g = parseInt(year / 4)
      if (isNaN(g)) {
         err = 'Bad year'
      }
      if (day > 29)
         err = 'Bad day'
      if (day == 29 && ((year / 4) != parseInt(year / 4)))
         err = 'Bad day'
   }
   if (year < 999)
      err = 'Bad year'
   if (year > 9999)
      err = 'Bad year'

      // Is it OK?
   if (err != '') {
      if (val == '')
         alert('Date Required')
      else
         if (confirm('Invalid Date.\n\nClick OK for help\nor Cancel to fix the date.'))
            alert('Dates may be entered in any of the following formats:\n\nDD, MM/DD, MM/DD/YY, MM/DD/YYYY, YYYY/MM/DD, TODAY, TOMORROW, YESTERDAY')

      field.focus()
      return false
   }
   else {
      if (asSqlDate)
         field.value = year + '-' + (month < 10 ? '0' + month : month) + '-' + 
                                    (day < 10 ? '0' + day : day)
      else
         field.value = month + '/' + day + '/' + year
      return true
   }
}

// Validate a 'time field'
// H H:M H:Ma H:Mp Noon Midnight NOW
// if 'required' is true, a time is required
//    otherwise an empty field is OK
function checkTime(field, required) {

   err = ''
   val = field.value.toLowerCase()

   if ((val == '') && (required != true))
      return true

   // Now
   if (val.substr(0, 3) == 'now') {
      d = new Date()
      min = d.getMinutes()
      if (min < 10) {
         min = '0' + min
      }
      hour = d.getHours()
      val = hour + ':' + min

      if (hour > 11)
         val = val + " pm"
      else
         val = val + " am"
   }

   // Midnight
   if (val.substring(0, 1) == 'm') {
      hour = '12'
      minute = '00'
      aorp = 'a'
   }
   // Noon
   else if (val.substring(0, 1) == 'n') {
      hour = '12'
      minute = '00'
      aorp = 'p'
   } else {

         // Hour

      pos = 0  
      hour = ''
      ch = val.substring(pos, pos+1)
      while ((ch >= '0') & (ch <= '9')) {
         hour = hour + ch
         pos += 1 
         ch = val.substring(pos, pos+1)
      }
      if ((ch != 'a') && (ch != 'p'))
         pos += 1

         // Minute

      minute = ''
      ch = val.substring(pos, pos+1)
      while ((ch >= '0') & (ch <= '9')) {
         minute = minute + ch
         pos += 1 
         ch = val.substring(pos, pos+1)
      }
      if (minute == '')
         minute = '00'
      if (minute.length == 1)
         minute = minute + '0'

         // am or pm
   
      aorp = ''
      ch = val.substring(pos, pos+1)
      while ((pos <= val.length) && (aorp == '')) {
         pos += 1
         if ((ch == 'a') || (ch == 'p'))
            aorp = ch
         ch = val.substring(pos, pos+1)
      }
      if (aorp == '') {
         if ((hour >= 7) && (hour <= 11))
            aorp = 'a'
         else
            aorp = 'p'
      }
   }

      // Check 'em

   if (hour == 24) {
      hour = 12
      aorp = 'a'
   }
   if (hour > 12) {
      hour = hour - 12
      aorp = 'p'
   }

   if (hour < 1 || hour > 24)
      err = 'Bad hour'
   if (minute < 0 || minute > 59)
      err = 'Bad minute'

      // Is it OK?

   if (err != '') {
      if (val == '')
         alert('Time Required')
      else {
         if (confirm('Invalid Time.\n\nClick OK for help\nor Cancel to fix the date.'))
            alert('Times may be entered in any of the following formats:\n\nHH, HH:MM, HH:MMa, HH:MMp, Noon, Midnight, NOW')
      }
      field.focus()
      return false
   }
   else {
      field.value = hour + ':' + minute + ' ' + aorp + 'm'
      return true
   }
}

// Limit the size of a textarea
function tasize(field, max) {
   if (field.value.length > max) {
      field.value = field.value.substr(0, max)
      return false }
   else
      return true
}

// Keep the session alive
// This checks to make sure the setTimeout() calls don't cascade (why do they?!?)
var next_keep_alive = 0
function keepalive() {
	var now = Date.parse(Date())
	if (now > next_keep_alive) {
		var offset = 1 * 60 * 1000
		setTimeout('keepalive()', offset)
		next_keep_alive = now + (offset * 0.95)
		document.getElementById('keepalive').src = '/jslib/keepalive.php?' + next_keep_alive
	}
}

// Set the selected value
// Select the first one if the value was not found
function set_select_value(select, value) {
	var options = select.options
	var set = false
	for (var i=options.length-1; i>=0; i--) {
		if (options[i].value == value) {
			options[i].selected = true
			set = true
		}
	}

	if (!set) {
		options[0].selected = true
	}
}

// Garrett Murphey
// http://gmurphey.com/
// Distributed under the Creative Commons Attribution-Sharealike License
// http://creativecommons.org/licenses/by-sa/2.5/
function align(e, position) {
	e = $(e);
	var container = Try.these(
		function () { return e.parentNode },
		function () { return e.parentElement },
		function () { return false });
	if (container != false) {
		var dimensions = Element.getDimensions(e);
		// Removed this line... interferes with 'display: none' to get Scriptaculous effects to work
		// e.removeAttribute('style');
		Element.setStyle(container, { position: 'relative' });
		for (var name in position) {
			if (name == 'hAlign') {
				switch (position[name]) {
					case 'left':	Element.setStyle(e, { 
										position: 'absolute', 
										left: 0 
									});
									break;
					case 'center':	Element.setStyle(e, { 
										position: 'absolute', 
										left: '50%', 
										marginLeft: ((dimensions.width / 2) * -1) + 'px' 
									});
									break;
					case 'middle':	Element.setStyle(e, { 
										position: 'absolute', 
										left: '50%', 
										marginLeft: ((dimensions.width / 2) * -1) + 'px' 
									});
									break;
					case 'right':	Element.setStyle(e, { 
										position: 'absolute', 
										right: 0 
									});
									break;
				}
			} else if (name == 'vAlign') {
				switch (position[name]) {
					case 'top':		Element.setStyle(e, { 
										position: 'absolute', 
										top: 0 
									});
									break;
					case 'center':	Element.setStyle(e, { 
										position: 'absolute', 
										top: '50%', 
										marginTop: ((dimensions.height / 2) * -1) + 'px' 
									});
									break;
					case 'middle':	Element.setStyle(e, { 
										position: 'absolute', 
										top: '50%', 
										marginTop: ((dimensions.height / 2) * -1) + 'px' 
									});
									break;
					case 'bottom':	Element.setStyle(e, { 
										position: 'absolute', 
										bottom: 0 
									});
									break;
				}
			}
		}
	}
	return e;
}
// **** wz_tooltip ***
/* This notice must be untouched at all times.

wz_tooltip.js    v. 3.31

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

Copyright (c) 2002-2004 Walter Zorn. All rights reserved.
Created 1. 12. 2002 by Walter Zorn (Web: http://www.walterzorn.com )
Last modified: 22. 6. 2005

Cross-browser tooltips working even in Opera 5 and 6,
as well as in NN 4, Gecko-Browsers, IE4+, Opera 7 and Konqueror.
No onmouseouts required.
Appearance of tooltips can be individually configured
via commands within the onmouseovers.

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
*/



////////////////  GLOBAL TOOPTIP CONFIGURATION  /////////////////////
var ttBgColor      = "#e6ecff";
var ttBgImg        = "";           // path to background image;
var ttBorderColor  = "#003399";
var ttBorderWidth  = 1;
var ttDelay        = 500;          // time span until tooltip shows up [milliseconds]
var ttFontColor    = "#000066";
var ttFontFace     = "arial,helvetica,sans-serif";
var ttFontSize     = "11px";
var ttFontWeight   = "normal";     // alternative is "bold";
var ttOffsetX      = 12;            // horizontal offset of left-top corner from mousepointer
var ttOffsetY      = 15;           // vertical offset                   "
var ttOpacity      = 100;          // opacity of tooltip in percent (must be integer between 0 and 100)
var ttPadding      = 3;            // spacing between border and content
var ttShadowColor  = "";
var ttShadowWidth  = 0;
var ttTemp         = 0;            // time span after which the tooltip disappears; 0 (zero) means "infinite timespan"
var ttTextAlign    = "left";
var ttTitleColor   = "#ffffff";    // color of caption text
var ttWidth        = 300;
////////////////////  END OF TOOLTIP CONFIG  ////////////////////////



//////////////  TAGS WITH TOOLTIP FUNCTIONALITY  ////////////////////
// List may be extended or shortened:
var tt_tags = new Array("a","area","b","big","caption","center","code","dd","div","dl","dt","em","h1","h2","h3","h4","h5","h6","i","img","input","li","map","ol","p","pre","s","small","span","strike","strong","sub","sup","table","td","th","tr","tt","u","var","ul","layer");
/////////////////////////////////////////////////////////////////////



///////// DON'T CHANGE ANYTHING BELOW THIS LINE /////////////////////
var tt_obj,                // current tooltip
tt_ifrm,                   // iframe to cover windowed controls in IE
tt_objW = 0, tt_objH = 0,  // width and height of tt_obj
tt_objX = 0, tt_objY = 0,
tt_offX = 0, tt_offY = 0,
xlim = 0, ylim = 0,        // right and bottom borders of visible client area
tt_sup = false,            // true if T_ABOVE cmd
tt_sticky = false,         // tt_obj sticky?
tt_wait = false,
tt_act = false,            // tooltip visibility flag
tt_sub = false,            // true while tooltip below mousepointer
tt_u = "undefined",
tt_mf,                     // stores previous mousemove evthandler
// Opera: disable href when hovering <a>
tt_tag = null;             // stores hovered dom node, href and previous statusbar txt


var tt_db = (document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body? document.body : null,
tt_n = navigator.userAgent.toLowerCase(),
tt_nv = navigator.appVersion;
// Browser flags
var tt_op = !!(window.opera && document.getElementById),
tt_op6 = tt_op && !document.defaultView,
tt_op7 = tt_op && !tt_op6,
tt_ie = tt_n.indexOf("msie") != -1 && document.all && tt_db && !tt_op,
tt_ie6 = tt_ie && parseFloat(tt_nv.substring(tt_nv.indexOf("MSIE")+5)) >= 5.5;
tt_n4 = (document.layers && typeof document.classes != tt_u),
tt_n6 = (!tt_op && document.defaultView && typeof document.defaultView.getComputedStyle != tt_u),
tt_w3c = !tt_ie && !tt_n6 && !tt_op && document.getElementById;

function tt_Int(t_x)
{
	var t_y;
	return isNaN(t_y = parseInt(t_x))? 0 : t_y;
}
function wzReplace(t_x, t_y)
{
	var t_ret = "",
	t_str = this,
	t_xI;
	while((t_xI = t_str.indexOf(t_x)) != -1)
	{
		t_ret += t_str.substring(0, t_xI) + t_y;
		t_str = t_str.substring(t_xI + t_x.length);
	}
	return t_ret+t_str;
}
String.prototype.wzReplace = wzReplace;
function tt_N4Tags(tagtyp, t_d, t_y)
{
	t_d = t_d || document;
	t_y = t_y || new Array();
	var t_x = (tagtyp=="a")? t_d.links : t_d.layers;
	for(var z = t_x.length; z--;) t_y[t_y.length] = t_x[z];
	for(z = t_d.layers.length; z--;) t_y = tt_N4Tags(tagtyp, t_d.layers[z].document, t_y);
	return t_y;
}
function tt_Htm(tt, t_id, txt)
{
	var t_bgc = (typeof tt.T_BGCOLOR != tt_u)? tt.T_BGCOLOR : ttBgColor,
	t_bgimg   = (typeof tt.T_BGIMG != tt_u)? tt.T_BGIMG : ttBgImg,
	t_bc      = (typeof tt.T_BORDERCOLOR != tt_u)? tt.T_BORDERCOLOR : ttBorderColor,
	t_bw      = (typeof tt.T_BORDERWIDTH != tt_u)? tt.T_BORDERWIDTH : ttBorderWidth,
	t_ff      = (typeof tt.T_FONTFACE != tt_u)? tt.T_FONTFACE : ttFontFace,
	t_fc      = (typeof tt.T_FONTCOLOR != tt_u)? tt.T_FONTCOLOR : ttFontColor,
	t_fsz     = (typeof tt.T_FONTSIZE != tt_u)? tt.T_FONTSIZE : ttFontSize,
	t_fwght   = (typeof tt.T_FONTWEIGHT != tt_u)? tt.T_FONTWEIGHT : ttFontWeight,
	t_opa     = (typeof tt.T_OPACITY != tt_u)? tt.T_OPACITY : ttOpacity,
	t_padd    = (typeof tt.T_PADDING != tt_u)? tt.T_PADDING : ttPadding,
	t_shc     = (typeof tt.T_SHADOWCOLOR != tt_u)? tt.T_SHADOWCOLOR : (ttShadowColor || 0),
	t_shw     = (typeof tt.T_SHADOWWIDTH != tt_u)? tt.T_SHADOWWIDTH : (ttShadowWidth || 0),
	t_algn    = (typeof tt.T_TEXTALIGN != tt_u)? tt.T_TEXTALIGN : ttTextAlign,
	t_tit     = (typeof tt.T_TITLE != tt_u)? tt.T_TITLE : "",
	t_titc    = (typeof tt.T_TITLECOLOR != tt_u)? tt.T_TITLECOLOR : ttTitleColor,
	t_w       = (typeof tt.T_WIDTH != tt_u)? tt.T_WIDTH  : ttWidth;
	if (t_shc || t_shw)
	{
		t_shc = t_shc || "#cccccc";
		t_shw = t_shw || 5;
	}
	if (tt_n4 && (t_fsz == "10px" || t_fsz == "11px")) t_fsz = "12px";

	var t_optx = (tt_n4? '' : tt_n6? ('-moz-opacity:'+(t_opa/100.0)) : tt_ie? ('filter:Alpha(opacity='+t_opa+')') : ('opacity:'+(t_opa/100.0))) + ';';
	var t_y = '<div id="'+t_id+'" style="position:absolute;z-index:1010;';
	t_y += 'left:0px;top:0px;width:'+(t_w+t_shw)+'px;visibility:'+(tt_n4? 'hide' : 'hidden')+';'+t_optx+'">' +
		'<table border="0" cellpadding="0" cellspacing="0"'+(t_bc? (' bgcolor="'+t_bc+'"') : '')+' width="'+t_w+'">';
	if (t_tit)
	{
		t_y += '<tr><td style="padding-left:3px;padding-right:3px;" align="'+t_algn+'"><font color="'+t_titc+'" face="'+t_ff+'" ' +
			'style="color:'+t_titc+';font-family:'+t_ff+';font-size:'+t_fsz+';"><b>' +
			(tt_n4? '&nbsp;' : '')+t_tit+'<\/b><\/font><\/td><\/tr>';
	}
	t_y += '<tr><td><table border="0" cellpadding="'+t_padd+'" cellspacing="'+t_bw+'" width="100%">' +
		'<tr><td'+(t_bgc? (' bgcolor="'+t_bgc+'"') : '')+(t_bgimg? ' background="'+t_bgimg+'"' : '')+' style="text-align:'+t_algn+';';
	if (tt_n6) t_y += 'padding:'+t_padd+'px;';
	t_y += '" align="'+t_algn+'"><font color="'+t_fc+'" face="'+t_ff+'"' +
		' style="color:'+t_fc+';font-family:'+t_ff+';font-size:'+t_fsz+';font-weight:'+t_fwght+';">';
	if (t_fwght == 'bold') t_y += '<b>';
	t_y += txt;
	if (t_fwght == 'bold') t_y += '<\/b>';
	t_y += '<\/font><\/td><\/tr><\/table><\/td><\/tr><\/table>';
	if (t_shw)
	{
		var t_spct = Math.round(t_shw*1.3);
		if (tt_n4)
		{
			t_y += '<layer bgcolor="'+t_shc+'" left="'+t_w+'" top="'+t_spct+'" width="'+t_shw+'" height="0"><\/layer>' +
				'<layer bgcolor="'+t_shc+'" left="'+t_spct+'" align="bottom" width="'+(t_w-t_spct)+'" height="'+t_shw+'"><\/layer>';
		}
		else
		{
			t_optx = tt_n6? '-moz-opacity:0.85;' : tt_ie? 'filter:Alpha(opacity=85);' : 'opacity:0.85;';
			t_y += '<div id="'+t_id+'R" style="position:absolute;background:'+t_shc+';left:'+t_w+'px;top:'+t_spct+'px;width:'+t_shw+'px;height:1px;overflow:hidden;'+t_optx+'"><\/div>' +
				'<div style="position:relative;background:'+t_shc+';left:'+t_spct+'px;top:0px;width:'+(t_w-t_spct)+'px;height:'+t_shw+'px;overflow:hidden;'+t_optx+'"><\/div>';
		}
	}
	return(t_y+'<\/div>' +
		(tt_ie ? '<iframe id="TTiEiFrM" src="javascript:false" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:none;"><\/iframe>' : ''));
}
function tt_EvX(t_e)
{
	var t_y = tt_Int(t_e.pageX || t_e.clientX || 0) +
		tt_Int(tt_ie? tt_db.scrollLeft : 0) +
		tt_offX;
	if (t_y > xlim) t_y = xlim;
	var t_scr = tt_Int(window.pageXOffset || (tt_db? tt_db.scrollLeft : 0) || 0);
	if (t_y < t_scr) t_y = t_scr;
	return t_y;
}
function tt_EvY(t_e)
{
	var t_y = tt_Int(t_e.pageY || t_e.clientY || 0) +
		tt_Int(tt_ie? tt_db.scrollTop : 0);
	if (tt_sup) t_y -= (tt_objH + tt_offY - 15);
	else if (t_y > ylim || !tt_sub && t_y > ylim-24)
	{
		t_y -= (tt_objH + 5);
		tt_sub = false;
	}
	else
	{
		t_y += tt_offY;
		tt_sub = true;
	}
	return t_y;
}
function tt_ReleasMov()
{
	if (document.onmousemove == tt_Move)
	{
		if (!tt_mf && document.releaseEvents) document.releaseEvents(Event.MOUSEMOVE);
		document.onmousemove = tt_mf;
	}
}
function tt_ShowIfrm(t_x)
{
	if (!tt_ie6 || !tt_obj) return;
	tt_ifrm = document.getElementById("TTiEiFrM");
	//tt_obj.style.display = t_x? "block" : "none";
	if (t_x)
	{
		tt_ifrm.style.width = tt_objW+'px';
		tt_ifrm.style.height = tt_objH+'px';
		tt_ifrm.style.zIndex = tt_obj.style.zIndex - 1;
		tt_ifrm.style.display = "block";
	}
	else tt_ifrm.style.display = "none";
}
function tt_GetDiv(t_id)
{
	return(
		tt_n4? (document.layers[t_id] || null)
		: tt_ie? (document.all[t_id] || null)
		: (document.getElementById(t_id) || null)
	);
}
function tt_GetDivW()
{
	return tt_Int(
		tt_n4? tt_obj.clip.width
		: (tt_obj.style.pixelWidth || tt_obj.offsetWidth)
	);
}
function tt_GetDivH()
{
	return tt_Int(
		tt_n4? tt_obj.clip.height
		: (tt_obj.style.pixelHeight || tt_obj.offsetHeight)
	);
}

// Compat with DragDrop Lib: Ensure that z-index of tooltip is lifted beyond toplevel dragdrop element
function tt_SetDivZ()
{
	var t_i = tt_obj.style || tt_obj;
	if (window.dd && dd.z)
		t_i.zIndex = Math.max(dd.z+1, t_i.zIndex);
}
function tt_SetDivPos(t_x, t_y)
{
	var t_i = tt_obj.style || tt_obj;
	var t_px = (tt_op6 || tt_n4)? '' : 'px';
	t_i.left = (tt_objX = t_x) + t_px;
	t_i.top = (tt_objY = t_y) + t_px;
	if (tt_ifrm)
	{
		tt_ifrm.style.left = t_i.left;
		tt_ifrm.style.top = t_i.top;
	}
}
function tt_ShowDiv(t_x)
{
	if (tt_n4) tt_obj.visibility = t_x? 'show' : 'hide';
	else tt_obj.style.visibility = t_x? 'visible' : 'hidden';
	tt_act = t_x;
	tt_ShowIfrm(t_x);
}
function tt_OpDeHref(t_e)
{
	if (t_e && t_e.target.hasAttribute("href"))
	{
		tt_tag = t_e.target;
		tt_tag.t_href = tt_tag.getAttribute("href");
		tt_tag.removeAttribute("href");
		tt_tag.style.cursor = "hand";
		tt_tag.onmousedown = tt_OpReHref;
		tt_tag.stats = window.status;
		window.status = tt_tag.t_href;
	}
}
function tt_OpReHref()
{
	if (tt_tag)
	{
		tt_tag.setAttribute("href", tt_tag.t_href);
		window.status = tt_tag.stats;
		tt_tag = null;
	}
}
function tt_Show(t_e, t_id, t_sup, t_delay, t_fix, t_left, t_offx, t_offy, t_static, t_sticky, t_temp)
{
	if (tt_obj) tt_Hide();
	tt_mf = document.onmousemove || null;
	if (window.dd && (window.DRAG && tt_mf == DRAG || window.RESIZE && tt_mf == RESIZE)) return;
	var t_uf = document.onmouseup || null, t_sh, t_h;
	if (tt_mf && t_uf) t_uf(t_e);

	tt_obj = tt_GetDiv(t_id);
	if (tt_obj)
	{
		t_e = t_e || window.event;
		tt_sub = !(tt_sup = t_sup);
		tt_sticky = t_sticky;
		tt_objW = tt_GetDivW();
		tt_objH = tt_GetDivH();
		tt_offX = t_left? -(tt_objW+t_offx) : t_offx;
		tt_offY = t_offy;
		if (tt_op7) tt_OpDeHref(t_e);
		if (tt_n4)
		{
			if (tt_obj.document.layers.length)
			{
				t_sh = tt_obj.document.layers[0];
				t_sh.clip.height = tt_objH - Math.round(t_sh.clip.width*1.3);
			}
		}
		else
		{
			t_sh = tt_GetDiv(t_id+'R');
			if (t_sh)
			{
				t_h = tt_objH - tt_Int(t_sh.style.pixelTop || t_sh.style.top || 0);
				if (typeof t_sh.style.pixelHeight != tt_u) t_sh.style.pixelHeight = t_h;
				else t_sh.style.height = t_h+'px';
			}
		}

		xlim = tt_Int((tt_db && tt_db.clientWidth)? tt_db.clientWidth : window.innerWidth) +
			tt_Int(window.pageXOffset || (tt_db? tt_db.scrollLeft : 0) || 0) -
			tt_objW -
			(tt_n4? 21 : 0);
		ylim = tt_Int(window.innerHeight || tt_db.clientHeight) +
			tt_Int(window.pageYOffset || (tt_db? tt_db.scrollTop : 0) || 0) -
			tt_objH - tt_offY;

		tt_SetDivZ();
		if (t_fix) tt_SetDivPos(tt_Int((t_fix = t_fix.split(','))[0]), tt_Int(t_fix[1]));
		else tt_SetDivPos(tt_EvX(t_e), tt_EvY(t_e));

		var t_txt = 'tt_ShowDiv(\'true\');';
		if (t_sticky) t_txt += '{'+
				'tt_ReleasMov();'+
				'window.tt_upFunc = document.onmouseup || null;'+
				'if (document.captureEvents) document.captureEvents(Event.MOUSEUP);'+
				'document.onmouseup = new Function("window.setTimeout(\'tt_Hide();\', 10);");'+
			'}';
		else if (t_static) t_txt += 'tt_ReleasMov();';
		if (t_temp > 0) t_txt += 'window.tt_rtm = window.setTimeout(\'tt_sticky = false; tt_Hide();\','+t_temp+');';
		window.tt_rdl = window.setTimeout(t_txt, t_delay);

		if (!t_fix)
		{
			if (document.captureEvents) document.captureEvents(Event.MOUSEMOVE);
			document.onmousemove = tt_Move;
		}
	}
}
var tt_area = false;
function tt_Move(t_ev)
{
	if (!tt_obj) return;
	if (tt_n6 || tt_w3c)
	{
		if (tt_wait) return;
		tt_wait = true;
		setTimeout('tt_wait = false;', 5);
	}
	var t_e = t_ev || window.event;
	tt_SetDivPos(tt_EvX(t_e), tt_EvY(t_e));
	if (tt_op6)
	{
		if (tt_area && t_e.target.tagName != 'AREA') tt_Hide();
		else if (t_e.target.tagName == 'AREA') tt_area = true;
	}
}
function tt_Hide()
{
	if (window.tt_obj)
	{
		if (window.tt_rdl) window.clearTimeout(tt_rdl);
		if (!tt_sticky || !tt_act)
		{
			if (window.tt_rtm) window.clearTimeout(tt_rtm);
			tt_ShowDiv(false);
			tt_SetDivPos(-tt_objW, -tt_objH);
			tt_obj = null;
			if (typeof window.tt_upFunc != tt_u) document.onmouseup = window.tt_upFunc;
		}
		tt_sticky = false;
		if (tt_op6 && tt_area) tt_area = false;
		tt_ReleasMov();
		if (tt_op7) tt_OpReHref();
	}
}
function tt_Init()
{
	if (!(tt_op || tt_n4 || tt_n6 || tt_ie || tt_w3c)) return;

	var htm = tt_n4? '<div style="position:absolute;"><\/div>' : '',
	tags,
	t_tj,
	over,
	esc = 'return escape(';
	var i = tt_tags.length; while(i--)
	{
		tags = tt_ie? (document.all.tags(tt_tags[i]) || 1)
			: document.getElementsByTagName? (document.getElementsByTagName(tt_tags[i]) || 1)
			: (!tt_n4 && tt_tags[i]=="a")? document.links
			: 1;
		if (tt_n4 && (tt_tags[i] == "a" || tt_tags[i] == "layer")) tags = tt_N4Tags(tt_tags[i]);
		var j = tags.length; while(j--)
		{
			if (typeof (t_tj = tags[j]).onmouseover == "function" && t_tj.onmouseover.toString().indexOf(esc) != -1 && !tt_n6 || tt_n6 && (over = t_tj.getAttribute("onmouseover")) && over.indexOf(esc) != -1)
			{
				if (over) t_tj.onmouseover = new Function(over);
				var txt = unescape(t_tj.onmouseover());
				htm += tt_Htm(
					t_tj,
					"tOoLtIp"+i+""+j,
					txt.wzReplace("& ","&")
				);

				t_tj.onmouseover = new Function('e',
					'tt_Show(e,'+
					'"tOoLtIp' +i+''+j+ '",'+
					(typeof t_tj.T_ABOVE != tt_u)+','+
					((typeof t_tj.T_DELAY != tt_u)? t_tj.T_DELAY : ttDelay)+','+
					((typeof t_tj.T_FIX != tt_u)? '"'+t_tj.T_FIX+'"' : '""')+','+
					(typeof t_tj.T_LEFT != tt_u)+','+
					((typeof t_tj.T_OFFSETX != tt_u)? t_tj.T_OFFSETX : ttOffsetX)+','+
					((typeof t_tj.T_OFFSETY != tt_u)? t_tj.T_OFFSETY : ttOffsetY)+','+
					(typeof t_tj.T_STATIC != tt_u)+','+
					(typeof t_tj.T_STICKY != tt_u)+','+
					((typeof t_tj.T_TEMP != tt_u)? t_tj.T_TEMP : ttTemp)+
					');'
				);
				t_tj.onmouseout = tt_Hide;
				if (t_tj.alt) t_tj.alt = "";
				if (t_tj.title) t_tj.title = "";
			}
		}
	}
	document.write(htm);
}
tt_Init();

