package org.apache.jsp.js; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import java.util.*; public final class tooltip_005fjs_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory(); private static java.util.List _jspx_dependants; static { _jspx_dependants = new java.util.ArrayList(5); _jspx_dependants.add("/js/tooltip/domLib.js"); _jspx_dependants.add("/js/tooltip/domTT.js"); _jspx_dependants.add("/js/tooltip/domTT_drag.js"); _jspx_dependants.add("/js/tooltip/alphaAPI.js"); _jspx_dependants.add("/js/tooltip/edealTT.js"); } private javax.el.ExpressionFactory _el_expressionfactory; private org.apache.AnnotationProcessor _jsp_annotationprocessor; public Object getDependants() { return _jspx_dependants; } public void _jspInit() { _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName()); } public void _jspDestroy() { } public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { response.setContentType("text/html;charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write('\n'); out.write('\n'); out.write("/** $Id$ */\n"); out.write("// {{{ license\n"); out.write("\n"); out.write("/*\n"); out.write(" * Copyright 2002-2005 Dan Allen, Mojavelinux.com (dan.allen@mojavelinux.com)\n"); out.write(" *\n"); out.write(" * Licensed under the Apache License, Version 2.0 (the \"License\");\n"); out.write(" * you may not use this file except in compliance with the License.\n"); out.write(" * You may obtain a copy of the License at\n"); out.write(" *\n"); out.write(" * http://www.apache.org/licenses/LICENSE-2.0\n"); out.write(" *\n"); out.write(" * Unless required by applicable law or agreed to in writing, software\n"); out.write(" * distributed under the License is distributed on an \"AS IS\" BASIS,\n"); out.write(" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"); out.write(" * See the License for the specific language governing permissions and\n"); out.write(" * limitations under the License.\n"); out.write(" */\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ intro\n"); out.write("\n"); out.write("/**\n"); out.write(" * Title: DOM Library Core\n"); out.write(" * Version: 0.70\n"); out.write(" *\n"); out.write(" * Summary:\n"); out.write(" * A set of commonly used functions that make it easier to create javascript\n"); out.write(" * applications that rely on the DOM.\n"); out.write(" *\n"); out.write(" * Updated: 2005/05/17\n"); out.write(" *\n"); out.write(" * Maintainer: Dan Allen \n"); out.write(" * Maintainer: Jason Rust \n"); out.write(" *\n"); out.write(" * License: Apache 2.0\n"); out.write(" */\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ global constants (DO NOT EDIT)\n"); out.write("\n"); out.write("// -- Browser Detection --\n"); out.write("var domLib_userAgent = navigator.userAgent.toLowerCase();\n"); out.write("var domLib_isMac = navigator.appVersion.indexOf('Mac') != -1;\n"); out.write("var domLib_isWin = domLib_userAgent.indexOf('windows') != -1;\n"); out.write("// NOTE: could use window.opera for detecting Opera\n"); out.write("var domLib_isOpera = domLib_userAgent.indexOf('opera') != -1;\n"); out.write("var domLib_isOpera7up = domLib_userAgent.match(/opera.(7|8)/i);\n"); out.write("var domLib_isSafari = domLib_userAgent.indexOf('safari') != -1;\n"); out.write("var domLib_isKonq = domLib_userAgent.indexOf('konqueror') != -1;\n"); out.write("// Both konqueror and safari use the khtml rendering engine\n"); out.write("var domLib_isKHTML = (domLib_isKonq || domLib_isSafari || domLib_userAgent.indexOf('khtml') != -1);\n"); out.write("var domLib_isIE = (!domLib_isKHTML && !domLib_isOpera && (domLib_userAgent.indexOf('msie 5') != -1 || domLib_userAgent.indexOf('msie 6') != -1 || domLib_userAgent.indexOf('msie 7') != -1 || domLib_userAgent.indexOf('msie 8') != -1 || domLib_userAgent.indexOf('msie 9') != -1));\n"); out.write("var domLib_isIE5up = domLib_isIE;\n"); out.write("var domLib_isIE50 = (domLib_isIE && domLib_userAgent.indexOf('msie 5.0') != -1);\n"); out.write("var domLib_isIE55 = (domLib_isIE && domLib_userAgent.indexOf('msie 5.5') != -1);\n"); out.write("var domLib_isIE5 = (domLib_isIE50 || domLib_isIE55);\n"); out.write("// safari and konq may use string \"khtml, like gecko\", so check for destinctive /\n"); out.write("var domLib_isGecko = domLib_userAgent.indexOf('gecko/') != -1;\n"); out.write("var domLib_isMacIE = (domLib_isIE && domLib_isMac);\n"); out.write("var domLib_isIE55up = domLib_isIE5up && !domLib_isIE50 && !domLib_isMacIE;\n"); out.write("var domLib_isIE6up = domLib_isIE55up && !domLib_isIE55;\n"); out.write("\n"); out.write("// -- Browser Abilities --\n"); out.write("var domLib_standardsMode = (document.compatMode && document.compatMode == 'CSS1Compat');\n"); out.write("var domLib_useLibrary = (domLib_isOpera7up || domLib_isKHTML || domLib_isIE5up || domLib_isGecko || domLib_isMacIE || document.defaultView);\n"); out.write("// fixed in Konq3.2\n"); out.write("var domLib_hasBrokenTimeout = (domLib_isMacIE || (domLib_isKonq && domLib_userAgent.match(/konqueror\\/3.([2-9])/) == null));\n"); out.write("var domLib_canFade = (domLib_isGecko || domLib_isIE || domLib_isSafari || domLib_isOpera);\n"); out.write("var domLib_canDrawOverSelect = (domLib_isMac || domLib_isOpera || domLib_isGecko);\n"); out.write("var domLib_canDrawOverFlash = (domLib_isMac || domLib_isWin);\n"); out.write("\n"); out.write("// -- Event Variables --\n"); out.write("var domLib_eventTarget = domLib_isIE ? 'srcElement' : 'currentTarget';\n"); out.write("var domLib_eventButton = domLib_isIE ? 'button' : 'which';\n"); out.write("var domLib_eventTo = domLib_isIE ? 'toElement' : 'relatedTarget';\n"); out.write("var domLib_stylePointer = domLib_isIE ? 'hand' : 'pointer';\n"); out.write("// NOTE: a bug exists in Opera that prevents maxWidth from being set to 'none', so we make it huge\n"); out.write("var domLib_styleNoMaxWidth = domLib_isOpera ? '10000px' : 'none';\n"); out.write("var domLib_hidePosition = '-1000px';\n"); out.write("var domLib_scrollbarWidth = 14;\n"); out.write("var domLib_autoId = 1;\n"); out.write("var domLib_zIndex = 100;\n"); out.write("\n"); out.write("// -- Detection --\n"); out.write("var domLib_collisionElements;\n"); out.write("var domLib_collisionsCached = false;\n"); out.write("\n"); out.write("var domLib_timeoutStateId = 0;\n"); out.write("var domLib_timeoutStates = new Hash();\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ DOM enhancements\n"); out.write("\n"); out.write("if (!document.ELEMENT_NODE)\n"); out.write("{\n"); out.write("\tdocument.ELEMENT_NODE = 1;\n"); out.write("\tdocument.ATTRIBUTE_NODE = 2;\n"); out.write("\tdocument.TEXT_NODE = 3;\n"); out.write("\tdocument.DOCUMENT_NODE = 9;\n"); out.write("\tdocument.DOCUMENT_FRAGMENT_NODE = 11;\n"); out.write("}\n"); out.write("\n"); out.write("function domLib_clone(obj)\n"); out.write("{\n"); out.write("\tvar copy = {};\n"); out.write("\tfor (var i in obj)\n"); out.write("\t{\n"); out.write("\t\tvar value = obj[i];\n"); out.write("\t\ttry\n"); out.write("\t\t{\n"); out.write("\t\t\tif (value != null && typeof(value) == 'object' && value != window && !value.nodeType)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tcopy[i] = domLib_clone(value);\n"); out.write("\t\t\t}\n"); out.write("\t\t\telse\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tcopy[i] = value;\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\t\tcatch(e)\n"); out.write("\t\t{\n"); out.write("\t\t\tcopy[i] = value;\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\treturn copy;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ class Hash()\n"); out.write("\n"); out.write("function Hash()\n"); out.write("{\n"); out.write("\tthis.length = 0;\n"); out.write("\tthis.numericLength = 0; \n"); out.write("\tthis.elementData = [];\n"); out.write("\tfor (var i = 0; i < arguments.length; i += 2)\n"); out.write("\t{\n"); out.write("\t\tif (typeof(arguments[i + 1]) != 'undefined')\n"); out.write("\t\t{\n"); out.write("\t\t\tthis.elementData[arguments[i]] = arguments[i + 1];\n"); out.write("\t\t\tthis.length++;\n"); out.write("\t\t\tif (arguments[i] == parseInt(arguments[i])) \n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tthis.numericLength++;\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// using prototype as opposed to inner functions saves on memory \n"); out.write("Hash.prototype.get = function(in_key)\n"); out.write("{\n"); out.write("\tif (typeof(this.elementData[in_key]) != 'undefined') {\n"); out.write("\t\treturn this.elementData[in_key];\n"); out.write("\t}\n"); out.write("\n"); out.write("\treturn null;\n"); out.write("}\n"); out.write("\n"); out.write("Hash.prototype.set = function(in_key, in_value)\n"); out.write("{\n"); out.write("\tif (typeof(in_value) != 'undefined')\n"); out.write("\t{\n"); out.write("\t\tif (typeof(this.elementData[in_key]) == 'undefined')\n"); out.write("\t\t{\n"); out.write("\t\t\tthis.length++;\n"); out.write("\t\t\tif (in_key == parseInt(in_key)) \n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tthis.numericLength++;\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\treturn this.elementData[in_key] = in_value;\n"); out.write("\t}\n"); out.write("\n"); out.write("\treturn false;\n"); out.write("}\n"); out.write("\n"); out.write("Hash.prototype.remove = function(in_key)\n"); out.write("{\n"); out.write("\tvar tmp_value;\n"); out.write("\tif (typeof(this.elementData[in_key]) != 'undefined')\n"); out.write("\t{\n"); out.write("\t\tthis.length--;\n"); out.write("\t\tif (in_key == parseInt(in_key)) \n"); out.write("\t\t{\n"); out.write("\t\t\tthis.numericLength--;\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\ttmp_value = this.elementData[in_key];\n"); out.write("\t\tdelete this.elementData[in_key];\n"); out.write("\t}\n"); out.write("\n"); out.write("\treturn tmp_value;\n"); out.write("}\n"); out.write("\n"); out.write("Hash.prototype.size = function()\n"); out.write("{\n"); out.write("\treturn this.length;\n"); out.write("}\n"); out.write("\n"); out.write("Hash.prototype.has = function(in_key)\n"); out.write("{\n"); out.write("\treturn typeof(this.elementData[in_key]) != 'undefined';\n"); out.write("}\n"); out.write("\n"); out.write("Hash.prototype.find = function(in_obj)\n"); out.write("{\n"); out.write("\tfor (var tmp_key in this.elementData) \n"); out.write("\t{\n"); out.write("\t\tif (this.elementData[tmp_key] == in_obj) \n"); out.write("\t\t{\n"); out.write("\t\t\treturn tmp_key;\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\treturn null;\n"); out.write("}\n"); out.write("\n"); out.write("Hash.prototype.merge = function(in_hash)\n"); out.write("{\n"); out.write("\tfor (var tmp_key in in_hash.elementData) \n"); out.write("\t{\n"); out.write("\t\tif (typeof(this.elementData[tmp_key]) == 'undefined') \n"); out.write("\t\t{\n"); out.write("\t\t\tthis.length++;\n"); out.write("\t\t\tif (tmp_key == parseInt(tmp_key)) \n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tthis.numericLength++;\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tthis.elementData[tmp_key] = in_hash.elementData[tmp_key];\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("Hash.prototype.compare = function(in_hash)\n"); out.write("{\n"); out.write("\tif (this.length != in_hash.length) \n"); out.write("\t{\n"); out.write("\t\treturn false;\n"); out.write("\t}\n"); out.write("\n"); out.write("\tfor (var tmp_key in this.elementData) \n"); out.write("\t{\n"); out.write("\t\tif (this.elementData[tmp_key] != in_hash.elementData[tmp_key]) \n"); out.write("\t\t{\n"); out.write("\t\t\treturn false;\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\t\n"); out.write("\treturn true;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domLib_isDescendantOf()\n"); out.write("\n"); out.write("function domLib_isDescendantOf(in_object, in_ancestor, in_bannedTags)\n"); out.write("{\n"); out.write("\tif (in_object == null)\n"); out.write("\t{\n"); out.write("\t\treturn false;\n"); out.write("\t}\n"); out.write("\n"); out.write("\tif (in_object == in_ancestor)\n"); out.write("\t{\n"); out.write("\t\treturn true;\n"); out.write("\t}\n"); out.write("\n"); out.write("\tif (typeof(in_bannedTags) != 'undefined' &&\n"); out.write("\t\t(',' + in_bannedTags.join(',') + ',').indexOf(',' + in_object.tagName + ',') != -1)\n"); out.write("\t{\n"); out.write("\t\treturn false;\n"); out.write("\t}\n"); out.write("\n"); out.write("\twhile (in_object != document.documentElement)\n"); out.write("\t{\n"); out.write("\t\ttry\n"); out.write("\t\t{\n"); out.write("\t\t\tif ((tmp_object = in_object.offsetParent) && tmp_object == in_ancestor)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\treturn true;\n"); out.write("\t\t\t}\n"); out.write("\t\t\telse if ((tmp_object = in_object.parentNode) == in_ancestor)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\treturn true;\n"); out.write("\t\t\t}\n"); out.write("\t\t\telse\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tin_object = tmp_object;\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\t\t// in case we get some wierd error, assume we left the building\n"); out.write("\t\tcatch(e)\n"); out.write("\t\t{\n"); out.write("\t\t\treturn false;\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\treturn false;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domLib_detectCollisions()\n"); out.write("\n"); out.write("/**\n"); out.write(" * For any given target element, determine if elements on the page\n"); out.write(" * are colliding with it that do not obey the rules of z-index.\n"); out.write(" */\n"); out.write("function domLib_detectCollisions(in_object, in_recover, in_useCache)\n"); out.write("{\n"); out.write("\t// the reason for the cache is that if the root menu is built before\n"); out.write("\t// the page is done loading, then it might not find all the elements.\n"); out.write("\t// so really the only time you don't use cache is when building the\n"); out.write("\t// menu as part of the page load\n"); out.write("\tif (!domLib_collisionsCached)\n"); out.write("\t{\n"); out.write("\t\tvar tags = [];\n"); out.write("\n"); out.write("\t\tif (!domLib_canDrawOverFlash)\n"); out.write("\t\t{\n"); out.write("\t\t\ttags[tags.length] = 'object';\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tif (!domLib_canDrawOverSelect)\n"); out.write("\t\t{\n"); out.write("\t\t\ttags[tags.length] = 'select';\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tdomLib_collisionElements = domLib_getElementsByTagNames(tags, true);\n"); out.write("\t\tdomLib_collisionsCached = in_useCache;\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// if we don't have a tip, then unhide selects\n"); out.write("\tif (in_recover)\n"); out.write("\t{\n"); out.write("\t\tfor (var cnt = 0; cnt < domLib_collisionElements.length; cnt++)\n"); out.write("\t\t{\n"); out.write("\t\t\tvar thisElement = domLib_collisionElements[cnt];\n"); out.write("\n"); out.write("\t\t\tif (!thisElement.hideList)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tthisElement.hideList = new Hash();\n"); out.write("\t\t\t}\n"); out.write("\n"); out.write("\t\t\tthisElement.hideList.remove(in_object.id);\n"); out.write("\t\t\tif (!thisElement.hideList.length)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tdomLib_collisionElements[cnt].style.visibility = 'visible';\n"); out.write("\t\t\t\tif (domLib_isKonq)\n"); out.write("\t\t\t\t{\n"); out.write("\t\t\t\t\tdomLib_collisionElements[cnt].style.display = '';\n"); out.write("\t\t\t\t}\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\treturn;\n"); out.write("\t}\n"); out.write("\telse if (domLib_collisionElements.length == 0)\n"); out.write("\t{\n"); out.write("\t\treturn;\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// okay, we have a tip, so hunt and destroy\n"); out.write("\tvar objectOffsets = domLib_getOffsets(in_object);\n"); out.write("\n"); out.write("\tfor (var cnt = 0; cnt < domLib_collisionElements.length; cnt++)\n"); out.write("\t{\n"); out.write("\t\tvar thisElement = domLib_collisionElements[cnt];\n"); out.write("\n"); out.write("\t\t// if collision element is in active element, move on\n"); out.write("\t\t// WARNING: is this too costly?\n"); out.write("\t\tif (domLib_isDescendantOf(thisElement, in_object))\n"); out.write("\t\t{\n"); out.write("\t\t\tcontinue;\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\t// konqueror only has trouble with multirow selects\n"); out.write("\t\tif (domLib_isKonq &&\n"); out.write("\t\t\tthisElement.tagName == 'SELECT' &&\n"); out.write("\t\t\t(thisElement.size <= 1 && !thisElement.multiple))\n"); out.write("\t\t{\n"); out.write("\t\t\tcontinue;\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tif (!thisElement.hideList)\n"); out.write("\t\t{\n"); out.write("\t\t\tthisElement.hideList = new Hash();\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tvar selectOffsets = domLib_getOffsets(thisElement); \n"); out.write("\t\tvar center2centerDistance = Math.sqrt(Math.pow(selectOffsets.get('leftCenter') - objectOffsets.get('leftCenter'), 2) + Math.pow(selectOffsets.get('topCenter') - objectOffsets.get('topCenter'), 2));\n"); out.write("\t\tvar radiusSum = selectOffsets.get('radius') + objectOffsets.get('radius');\n"); out.write("\t\t// the encompassing circles are overlapping, get in for a closer look\n"); out.write("\t\tif (center2centerDistance < radiusSum)\n"); out.write("\t\t{\n"); out.write("\t\t\t// tip is left of select\n"); out.write("\t\t\tif ((objectOffsets.get('leftCenter') <= selectOffsets.get('leftCenter') && objectOffsets.get('right') < selectOffsets.get('left')) ||\n"); out.write("\t\t\t// tip is right of select\n"); out.write("\t\t\t\t(objectOffsets.get('leftCenter') > selectOffsets.get('leftCenter') && objectOffsets.get('left') > selectOffsets.get('right')) ||\n"); out.write("\t\t\t// tip is above select\n"); out.write("\t\t\t\t(objectOffsets.get('topCenter') <= selectOffsets.get('topCenter') && objectOffsets.get('bottom') < selectOffsets.get('top')) ||\n"); out.write("\t\t\t// tip is below select\n"); out.write("\t\t\t\t(objectOffsets.get('topCenter') > selectOffsets.get('topCenter') && objectOffsets.get('top') > selectOffsets.get('bottom')))\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tthisElement.hideList.remove(in_object.id);\n"); out.write("\t\t\t\tif (!thisElement.hideList.length)\n"); out.write("\t\t\t\t{\n"); out.write("\t\t\t\t\tthisElement.style.visibility = 'visible';\n"); out.write("\t\t\t\t\tif (domLib_isKonq)\n"); out.write("\t\t\t\t\t{\n"); out.write("\t\t\t\t\t\tthisElement.style.display = '';\n"); out.write("\t\t\t\t\t}\n"); out.write("\t\t\t\t}\n"); out.write("\t\t\t}\n"); out.write("\t\t\telse\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tthisElement.hideList.set(in_object.id, true);\n"); out.write("\t\t\t\tthisElement.style.visibility = 'hidden';\n"); out.write("\t\t\t\tif (domLib_isKonq)\n"); out.write("\t\t\t\t{\n"); out.write("\t\t\t\t\tthisElement.style.display = 'none';\n"); out.write("\t\t\t\t}\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domLib_getOffsets()\n"); out.write("\n"); out.write("function domLib_getOffsets(in_object, in_preserveScroll)\n"); out.write("{\n"); out.write("\tif (typeof(in_preserveScroll) == 'undefined') {\n"); out.write("\t\tin_preserveScroll = false;\n"); out.write("\t}\n"); out.write("\n"); out.write("\tvar originalObject = in_object;\n"); out.write("\tvar originalWidth = in_object.offsetWidth;\n"); out.write("\tvar originalHeight = in_object.offsetHeight;\n"); out.write("\tvar offsetLeft = 0;\n"); out.write("\tvar offsetTop = 0;\n"); out.write("\n"); out.write("\twhile (in_object)\n"); out.write("\t{\n"); out.write("\t\toffsetLeft += in_object.offsetLeft;\n"); out.write("\t\toffsetTop += in_object.offsetTop;\n"); out.write("\t\tin_object = in_object.offsetParent;\n"); out.write("\t\t// consider scroll offset of parent elements\n"); out.write("\t\tif (in_object && !in_preserveScroll)\n"); out.write("\t\t{\n"); out.write("\t\t\toffsetLeft -= in_object.scrollLeft;\n"); out.write("\t\t\toffsetTop -= in_object.scrollTop;\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// MacIE misreports the offsets (even with margin: 0 in body{}), still not perfect\n"); out.write("\tif (domLib_isMacIE) {\n"); out.write("\t\toffsetLeft += 10;\n"); out.write("\t\toffsetTop += 10;\n"); out.write("\t}\n"); out.write("\n"); out.write("\treturn new Hash(\n"); out.write("\t\t'left',\t\toffsetLeft,\n"); out.write("\t\t'top',\t\toffsetTop,\n"); out.write("\t\t'right',\toffsetLeft + originalWidth,\n"); out.write("\t\t'bottom',\toffsetTop + originalHeight,\n"); out.write("\t\t'leftCenter',\toffsetLeft + originalWidth/2,\n"); out.write("\t\t'topCenter',\toffsetTop + originalHeight/2,\n"); out.write("\t\t'radius',\tMath.max(originalWidth, originalHeight) \n"); out.write("\t);\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domLib_setTimeout()\n"); out.write("\n"); out.write("function domLib_setTimeout(in_function, in_timeout, in_args)\n"); out.write("{\n"); out.write("\tif (typeof(in_args) == 'undefined')\n"); out.write("\t{\n"); out.write("\t\tin_args = [];\n"); out.write("\t}\n"); out.write("\n"); out.write("\tif (in_timeout == -1)\n"); out.write("\t{\n"); out.write("\t\t// timeout event is disabled\n"); out.write("\t\treturn 0;\n"); out.write("\t}\n"); out.write("\telse if (in_timeout == 0)\n"); out.write("\t{\n"); out.write("\t\tin_function(in_args);\n"); out.write("\t\treturn 0;\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// must make a copy of the arguments so that we release the reference\n"); out.write("\tvar args = domLib_clone(in_args);\n"); out.write("\n"); out.write("\tif (!domLib_hasBrokenTimeout)\n"); out.write("\t{\n"); out.write("\t\treturn setTimeout(function() { in_function(args); }, in_timeout);\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\tvar id = domLib_timeoutStateId++;\n"); out.write("\t\tvar data = new Hash();\n"); out.write("\t\tdata.set('function', in_function);\n"); out.write("\t\tdata.set('args', args);\n"); out.write("\t\tdomLib_timeoutStates.set(id, data);\n"); out.write("\n"); out.write("\t\tdata.set('timeoutId', setTimeout('domLib_timeoutStates.get(' + id + ').get(\\'function\\')(domLib_timeoutStates.get(' + id + ').get(\\'args\\')); domLib_timeoutStates.remove(' + id + ');', in_timeout));\n"); out.write("\t\treturn id;\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domLib_clearTimeout()\n"); out.write("\n"); out.write("function domLib_clearTimeout(in_id)\n"); out.write("{\n"); out.write("\tif (!domLib_hasBrokenTimeout)\n"); out.write("\t{\n"); out.write("\t\tif (in_id > 0) {\n"); out.write("\t\t\tclearTimeout(in_id);\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\tif (domLib_timeoutStates.has(in_id))\n"); out.write("\t\t{\n"); out.write("\t\t\tclearTimeout(domLib_timeoutStates.get(in_id).get('timeoutId'))\n"); out.write("\t\t\tdomLib_timeoutStates.remove(in_id);\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domLib_getEventPosition()\n"); out.write("\n"); out.write("function domLib_getEventPosition(in_eventObj)\n"); out.write("{\n"); out.write("\tvar eventPosition = new Hash('x', 0, 'y', 0, 'scrollX', 0, 'scrollY', 0);\n"); out.write("\n"); out.write("\t// IE varies depending on standard compliance mode\n"); out.write("\tif (domLib_isIE)\n"); out.write("\t{\n"); out.write("\t\tvar doc = (domLib_standardsMode ? document.documentElement : document.body);\n"); out.write("\t\t// NOTE: events may fire before the body has been loaded\n"); out.write("\t\tif (doc)\n"); out.write("\t\t{\n"); out.write("\t\t\teventPosition.set('x', in_eventObj.clientX + doc.scrollLeft);\n"); out.write("\t\t\teventPosition.set('y', in_eventObj.clientY + doc.scrollTop);\n"); out.write("\t\t\teventPosition.set('scrollX', doc.scrollLeft);\n"); out.write("\t\t\teventPosition.set('scrollY', doc.scrollTop);\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\teventPosition.set('x', in_eventObj.pageX);\n"); out.write("\t\teventPosition.set('y', in_eventObj.pageY);\n"); out.write("\t\teventPosition.set('scrollX', in_eventObj.pageX - in_eventObj.clientX);\n"); out.write("\t\teventPosition.set('scrollY', in_eventObj.pageY - in_eventObj.clientY);\n"); out.write("\t}\n"); out.write("\n"); out.write("\treturn eventPosition;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domLib_cancelBubble()\n"); out.write("\n"); out.write("function domLib_cancelBubble(in_event)\n"); out.write("{\n"); out.write("\tvar eventObj = in_event ? in_event : window.event;\n"); out.write("\teventObj.cancelBubble = true;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domLib_getIFrameReference()\n"); out.write("\n"); out.write("function domLib_getIFrameReference(in_frame)\n"); out.write("{\n"); out.write("\tif (domLib_isGecko || domLib_isIE)\n"); out.write("\t{\n"); out.write("\t\treturn in_frame.frameElement;\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\t// we could either do it this way or require an id on the frame\n"); out.write("\t\t// equivalent to the name\n"); out.write("\t\tvar name = in_frame.name;\n"); out.write("\t\tif (!name || !in_frame.parent)\n"); out.write("\t\t{\n"); out.write("\t\t\treturn null;\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tvar candidates = in_frame.parent.document.getElementsByTagName('iframe');\n"); out.write("\t\tfor (var i = 0; i < candidates.length; i++)\n"); out.write("\t\t{\n"); out.write("\t\t\tif (candidates[i].name == name)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\treturn candidates[i];\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\treturn null;\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domLib_getElementsByClass()\n"); out.write("\n"); out.write("function domLib_getElementsByClass(in_class)\n"); out.write("{\n"); out.write("\tvar elements = domLib_isIE5 ? document.all : document.getElementsByTagName('*');\t\n"); out.write("\tvar matches = [];\t\n"); out.write("\tvar cnt = 0;\n"); out.write("\tfor (var i = 0; i < elements.length; i++)\n"); out.write("\t{\n"); out.write("\t\tif ((\" \" + elements[i].className + \" \").indexOf(\" \" + in_class + \" \") != -1)\n"); out.write("\t\t{\n"); out.write("\t\t\tmatches[cnt++] = elements[i];\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\treturn matches;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domLib_getElementsByTagNames()\n"); out.write("\n"); out.write("function domLib_getElementsByTagNames(in_list, in_excludeHidden)\n"); out.write("{\n"); out.write("\tvar elements = [];\n"); out.write("\tfor (var i = 0; i < in_list.length; i++)\n"); out.write("\t{\n"); out.write("\t\tvar matches = document.getElementsByTagName(in_list[i]);\n"); out.write("\t\tfor (var j = 0; j < matches.length; j++)\n"); out.write("\t\t{\n"); out.write("\t\t\t// skip objects that have nested embeds, or else we get \"flashing\"\n"); out.write("\t\t\tif (matches[j].tagName == 'OBJECT' && domLib_isGecko)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tvar kids = matches[j].childNodes;\n"); out.write("\t\t\t\tvar skip = false;\n"); out.write("\t\t\t\tfor (var k = 0; k < kids.length; k++)\n"); out.write("\t\t\t\t{\n"); out.write("\t\t\t\t\tif (kids[k].tagName == 'EMBED')\n"); out.write("\t\t\t\t\t{\n"); out.write("\t\t\t\t\t\tskip = true;\n"); out.write("\t\t\t\t\t\tbreak;\n"); out.write("\t\t\t\t\t}\n"); out.write("\t\t\t\t}\n"); out.write("\t\t\t\tif (skip) continue;\n"); out.write("\t\t\t}\n"); out.write("\n"); out.write("\t\t\tif (in_excludeHidden && domLib_getComputedStyle(matches[j], 'visibility') == 'hidden')\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tcontinue;\n"); out.write("\t\t\t}\n"); out.write("\n"); out.write("\t\t\telements[elements.length] = matches[j];\t\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\treturn elements;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domLib_getComputedStyle()\n"); out.write("\n"); out.write("function domLib_getComputedStyle(in_obj, in_property)\n"); out.write("{\n"); out.write("\tif (domLib_isIE)\n"); out.write("\t{\n"); out.write("\t\tvar humpBackProp = in_property.replace(/-(.)/, function (a, b) { return b.toUpperCase(); });\n"); out.write("\t\treturn eval('in_obj.currentStyle.' + humpBackProp);\n"); out.write("\t}\n"); out.write("\t// getComputedStyle() is broken in konqueror, so let's go for the style object\n"); out.write("\telse if (domLib_isKonq)\n"); out.write("\t{\n"); out.write("\t\t//var humpBackProp = in_property.replace(/-(.)/, function (a, b) { return b.toUpperCase(); });\n"); out.write("\t\treturn eval('in_obj.style.' + in_property);\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\treturn document.defaultView.getComputedStyle(in_obj, null).getPropertyValue(in_property);\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ makeTrue()\n"); out.write("\n"); out.write("function makeTrue()\n"); out.write("{\n"); out.write("\treturn true;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ makeFalse()\n"); out.write("\n"); out.write("function makeFalse()\n"); out.write("{\n"); out.write("\treturn false;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write('\n'); out.write('\n'); out.write("/** $Id$ */\n"); out.write("// {{{ license\n"); out.write("\n"); out.write("/*\n"); out.write(" * Copyright 2002-2005 Dan Allen, Mojavelinux.com (dan.allen@mojavelinux.com)\n"); out.write(" *\n"); out.write(" * Licensed under the Apache License, Version 2.0 (the \"License\");\n"); out.write(" * you may not use this file except in compliance with the License.\n"); out.write(" * You may obtain a copy of the License at\n"); out.write(" *\n"); out.write(" * http://www.apache.org/licenses/LICENSE-2.0\n"); out.write(" *\n"); out.write(" * Unless required by applicable law or agreed to in writing, software\n"); out.write(" * distributed under the License is distributed on an \"AS IS\" BASIS,\n"); out.write(" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"); out.write(" * See the License for the specific language governing permissions and\n"); out.write(" * limitations under the License.\n"); out.write(" */\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ intro\n"); out.write("\n"); out.write("/**\n"); out.write(" * Title: DOM Tooltip Library\n"); out.write(" * Version: 0.7.3\n"); out.write(" *\n"); out.write(" * Summary:\n"); out.write(" * Allows developers to add custom tooltips to the webpages. Tooltips are\n"); out.write(" * generated using the domTT_activate() function and customized by setting\n"); out.write(" * a handful of options.\n"); out.write(" *\n"); out.write(" * Maintainer: Dan Allen \n"); out.write(" * Contributors:\n"); out.write(" * \t\tJosh Gross \n"); out.write(" *\t\tJason Rust \n"); out.write(" *\n"); out.write(" * License: Apache 2.0\n"); out.write(" * However, if you use this library, you earn the position of official bug\n"); out.write(" * reporter :) Please post questions or problem reports to the newsgroup:\n"); out.write(" *\n"); out.write(" * http://groups-beta.google.com/group/dom-tooltip\n"); out.write(" *\n"); out.write(" * If you are doing this for commercial work, perhaps you could send me a few\n"); out.write(" * Starbucks Coffee gift dollars or PayPal bucks to encourage future\n"); out.write(" * developement (NOT REQUIRED). E-mail me for my snail mail address.\n"); out.write("\n"); out.write(" *\n"); out.write(" * Homepage: http://www.mojavelinux.com/projects/domtooltip/\n"); out.write(" *\n"); out.write(" * Newsgroup: http://groups-beta.google.com/group/dom-tooltip\n"); out.write(" *\n"); out.write(" * Freshmeat Project: http://freshmeat.net/projects/domtt/?topic_id=92\n"); out.write(" *\n"); out.write(" * Updated: 2005/07/16\n"); out.write(" *\n"); out.write(" * Supported Browsers:\n"); out.write(" * Mozilla (Gecko), IE 5.5+, IE on Mac, Safari, Konqueror, Opera 7\n"); out.write(" *\n"); out.write(" * Usage:\n"); out.write(" * Please see the HOWTO documentation.\n"); out.write("**/\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ settings (editable)\n"); out.write("\n"); out.write("// IE mouse events seem to be off by 2 pixels\n"); out.write("var domTT_offsetX = (domLib_isIE ? -2 : 0);\n"); out.write("var domTT_offsetY = (domLib_isIE ? 4 : 2);\n"); out.write("var domTT_direction = 'southeast';\n"); out.write("var domTT_mouseHeight = domLib_isIE ? 13 : 19;\n"); out.write("var domTT_closeLink = 'X';\n"); out.write("var domTT_closeAction = 'hide';\n"); out.write("var domTT_activateDelay = 500;\n"); out.write("var domTT_maxWidth = false;\n"); out.write("var domTT_styleClass = 'domTT';\n"); out.write("var domTT_fade = 'neither';\n"); out.write("var domTT_lifetime = 0;\n"); out.write("var domTT_grid = 0;\n"); out.write("var domTT_trailDelay = 200;\n"); out.write("var domTT_useGlobalMousePosition = true;\n"); out.write("var domTT_postponeActivation = false;\n"); out.write("var domTT_tooltipIdPrefix = '[domTT]';\n"); out.write("var domTT_screenEdgeDetection = true;\n"); out.write("var domTT_screenEdgePadding = 4;\n"); out.write("var domTT_oneOnly = false;\n"); out.write("var domTT_cloneNodes = false;\n"); out.write("var domTT_detectCollisions = true;\n"); out.write("var domTT_bannedTags = ['OPTION'];\n"); out.write("var domTT_draggable = false;\n"); out.write("if (typeof(domTT_dragEnabled) == 'undefined')\n"); out.write("{\n"); out.write("\tdomTT_dragEnabled = false;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ globals (DO NOT EDIT)\n"); out.write("\n"); out.write("var domTT_predefined = new Hash();\n"); out.write("// tooltips are keyed on both the tip id and the owner id,\n"); out.write("// since events can originate on either object\n"); out.write("var domTT_tooltips = new Hash();\n"); out.write("var domTT_lastOpened = 0;\n"); out.write("var domTT_documentLoaded = false;\n"); out.write("var domTT_mousePosition = null;\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ document.onmousemove\n"); out.write("\n"); out.write("if (domLib_useLibrary && domTT_useGlobalMousePosition)\n"); out.write("{\n"); out.write("\tdocument.onmousemove = function(in_event)\n"); out.write("\t{\n"); out.write("\t\tif (typeof(in_event) == 'undefined') { in_event = window.event; }\n"); out.write("\n"); out.write("\t\tdomTT_mousePosition = domLib_getEventPosition(in_event);\n"); out.write("\t\tif (domTT_dragEnabled && domTT_dragMouseDown)\n"); out.write("\t\t{\n"); out.write("\t\t\tdomTT_dragUpdate(in_event);\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_activate()\n"); out.write("\n"); out.write("function domTT_activate(in_this, in_event)\n"); out.write("{\n"); out.write("\tif (!domLib_useLibrary || (domTT_postponeActivation && !domTT_documentLoaded)) { return false; }\n"); out.write("\n"); out.write("\t// make sure in_event is set (for IE, some cases we have to use window.event)\n"); out.write("\tif (typeof(in_event) == 'undefined') { in_event = window.event;\t}\n"); out.write("\n"); out.write("\t// don't allow tooltips on banned tags (such as OPTION)\n"); out.write("\tif (in_event != null) {\n"); out.write("\t\tvar target = in_event.srcElement ? in_event.srcElement : in_event.target;\n"); out.write("\t\tif (target != null && (',' + domTT_bannedTags.join(',') + ',').indexOf(',' + target.tagName + ',') != -1)\n"); out.write("\t\t{\n"); out.write("\t\t\treturn false;\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\tvar owner = document.body;\n"); out.write("\t// we have an active event so get the owner\n"); out.write("\tif (in_event != null && in_event.type.match(/key|mouse|click|contextmenu/i))\n"); out.write("\t{\n"); out.write("\t\t// make sure we have nothing higher than the body element\n"); out.write("\t\tif (in_this.nodeType && in_this.nodeType != document.DOCUMENT_NODE)\n"); out.write("\t\t{\n"); out.write("\t\t\towner = in_this;\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\t// non active event (make sure we were passed a string id)\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\tif (typeof(in_this) != 'object' && !(owner = domTT_tooltips.get(in_this)))\n"); out.write("\t\t{\n"); out.write("\t\t\t// NOTE: two steps to avoid \"flashing\" in gecko\n"); out.write("\t\t\tvar embryo = document.createElement('div');\n"); out.write("\t\t\towner = document.body.appendChild(embryo);\n"); out.write("\t\t\towner.style.display = 'none';\n"); out.write("\t\t\towner.id = in_this;\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// make sure the owner has a unique id\n"); out.write("\tif (!owner.id)\n"); out.write("\t{\n"); out.write("\t\towner.id = '__autoId' + domLib_autoId++;\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// see if we should only be opening one tip at a time\n"); out.write("\t// NOTE: this is not \"perfect\" yet since it really steps on any other\n"); out.write("\t// tip working on fade out or delayed close, but it get's the job done\n"); out.write("\tif (domTT_oneOnly && domTT_lastOpened)\n"); out.write("\t{\n"); out.write("\t\tdomTT_deactivate(domTT_lastOpened);\n"); out.write("\t}\n"); out.write("\n"); out.write("\tdomTT_lastOpened = owner.id;\n"); out.write("\n"); out.write("\tvar tooltip = domTT_tooltips.get(owner.id);\n"); out.write("\tif (tooltip)\n"); out.write("\t{\n"); out.write("\t\tif (tooltip.get('eventType') != in_event.type)\n"); out.write("\t\t{\n"); out.write("\t\t\tif (tooltip.get('type') == 'greasy')\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\ttooltip.set('closeAction', 'destroy');\n"); out.write("\t\t\t\tdomTT_deactivate(owner.id);\n"); out.write("\t\t\t}\n"); out.write("\t\t\telse if (tooltip.get('status') != 'inactive')\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\treturn owner.id;\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\t\telse\n"); out.write("\t\t{\n"); out.write("\t\t\tif (tooltip.get('status') == 'inactive')\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\ttooltip.set('status', 'pending');\n"); out.write("\t\t\t\ttooltip.set('activateTimeout', domLib_setTimeout(domTT_runShow, tooltip.get('delay'), [owner.id, in_event]));\n"); out.write("\n"); out.write("\t\t\t\treturn owner.id;\n"); out.write("\t\t\t}\n"); out.write("\t\t\t// either pending or active, let it be\n"); out.write("\t\t\telse\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\treturn owner.id;\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// setup the default options hash\n"); out.write("\tvar options = new Hash(\n"); out.write("\t\t'caption',\t\t'',\n"); out.write("\t\t'content',\t\t'',\n"); out.write("\t\t'clearMouse',\ttrue,\n"); out.write("\t\t'closeAction',\tdomTT_closeAction,\n"); out.write("\t\t'closeLink',\tdomTT_closeLink,\n"); out.write("\t\t'delay',\t\tdomTT_activateDelay,\n"); out.write("\t\t'direction',\tdomTT_direction,\n"); out.write("\t\t'draggable',\tdomTT_draggable,\n"); out.write("\t\t'fade',\t\t\tdomTT_fade,\n"); out.write("\t\t'fadeMax',\t\t100,\n"); out.write("\t\t'grid',\t\t\tdomTT_grid,\n"); out.write("\t\t'id',\t\t\tdomTT_tooltipIdPrefix + owner.id,\n"); out.write("\t\t'inframe',\t\tfalse,\n"); out.write("\t\t'lifetime',\t\tdomTT_lifetime,\n"); out.write("\t\t'offsetX',\t\tdomTT_offsetX,\n"); out.write("\t\t'offsetY',\t\tdomTT_offsetY,\n"); out.write("\t\t'parent',\t\tdocument.body,\n"); out.write("\t\t'position',\t\t'absolute',\n"); out.write("\t\t'styleClass',\tdomTT_styleClass,\n"); out.write("\t\t'type',\t\t\t'greasy',\n"); out.write("\t\t'trail',\t\tfalse,\n"); out.write("\t\t'lazy',\t\t\tfalse\n"); out.write("\t);\n"); out.write("\n"); out.write("\t// load in the options from the function call\n"); out.write("\tfor (var i = 2; i < arguments.length; i += 2)\n"); out.write("\t{\n"); out.write("\t\t// load in predefined\n"); out.write("\t\tif (arguments[i] == 'predefined')\n"); out.write("\t\t{\n"); out.write("\t\t\tvar predefinedOptions = domTT_predefined.get(arguments[i + 1]);\n"); out.write("\t\t\tfor (var j in predefinedOptions.elementData)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\toptions.set(j, predefinedOptions.get(j));\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\t\t// set option\n"); out.write("\t\telse\n"); out.write("\t\t{\n"); out.write("\t\t\toptions.set(arguments[i], arguments[i + 1]);\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\toptions.set('eventType', in_event != null ? in_event.type : null);\n"); out.write("\n"); out.write("\t// immediately set the status text if provided\n"); out.write("\tif (options.has('statusText'))\n"); out.write("\t{\n"); out.write("\t\ttry { window.status = options.get('statusText'); } catch(e) {}\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// if we didn't give content...assume we just wanted to change the status and return\n"); out.write("\tif (!options.has('content') || options.get('content') == '' || options.get('content') == null)\n"); out.write("\t{\n"); out.write("\t\tif (typeof(owner.onmouseout) != 'function')\n"); out.write("\t\t{\n"); out.write("\t\t\towner.onmouseout = function(in_event) { domTT_mouseout(this, in_event); };\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\treturn owner.id;\n"); out.write("\t}\n"); out.write("\n"); out.write("\toptions.set('owner', owner);\n"); out.write("\n"); out.write("\tdomTT_create(options);\n"); out.write("\n"); out.write("\t// determine the show delay\n"); out.write("\toptions.set('delay', (in_event != null && in_event.type.match(/click|mousedown|contextmenu/i)) ? 0 : parseInt(options.get('delay')));\n"); out.write("\tdomTT_tooltips.set(owner.id, options);\n"); out.write("\tdomTT_tooltips.set(options.get('id'), options);\n"); out.write("\toptions.set('status', 'pending');\n"); out.write("\toptions.set('activateTimeout', domLib_setTimeout(domTT_runShow, options.get('delay'), [owner.id, in_event]));\n"); out.write("\n"); out.write("\treturn owner.id;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_create()\n"); out.write("\n"); out.write("function domTT_create(in_options)\n"); out.write("{\n"); out.write("\tvar tipOwner = in_options.get('owner');\n"); out.write("\tvar parentObj = in_options.get('parent');\n"); out.write("\tvar parentDoc = parentObj.ownerDocument || parentObj.document;\n"); out.write("\n"); out.write("\t// create the tooltip and hide it\n"); out.write("\t// NOTE: two steps to avoid \"flashing\" in gecko\n"); out.write("\tvar embryo = parentDoc.createElement('div');\n"); out.write("\tvar tipObj = parentObj.appendChild(embryo);\n"); out.write("\ttipObj.style.position = 'absolute';\n"); out.write("\ttipObj.style.left = '0px';\n"); out.write("\ttipObj.style.top = '0px';\n"); out.write("\ttipObj.style.visibility = 'hidden';\n"); out.write("\ttipObj.id = in_options.get('id');\n"); out.write("\ttipObj.className = in_options.get('styleClass');\n"); out.write("\n"); out.write("\tvar contentBlock;\n"); out.write("\tvar tableLayout = false;\n"); out.write("\n"); out.write("\tif (in_options.get('caption') || (in_options.get('type') == 'sticky' && in_options.get('caption') !== false))\n"); out.write("\t{\n"); out.write("\t\ttableLayout = true;\n"); out.write("\t\t// layout the tip with a hidden formatting table\n"); out.write("\t\tvar tipLayoutTable = tipObj.appendChild(parentDoc.createElement('table'));\n"); out.write("\t\ttipLayoutTable.style.borderCollapse = 'collapse';\n"); out.write("\t\tif (domLib_isKHTML)\n"); out.write("\t\t{\n"); out.write("\t\t\ttipLayoutTable.cellSpacing = 0;\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tvar tipLayoutTbody = tipLayoutTable.appendChild(parentDoc.createElement('tbody'));\n"); out.write("\n"); out.write("\t\tvar numCaptionCells = 0;\n"); out.write("\t\tvar captionRow = tipLayoutTbody.appendChild(parentDoc.createElement('tr'));\n"); out.write("\t\tvar captionCell = captionRow.appendChild(parentDoc.createElement('td'));\n"); out.write("\t\tcaptionCell.style.padding = '0px';\n"); out.write("\t\tvar caption = captionCell.appendChild(parentDoc.createElement('div'));\n"); out.write("\t\tcaption.className = 'caption';\n"); out.write("\t\tif (domLib_isIE50)\n"); out.write("\t\t{\n"); out.write("\t\t\tcaption.style.height = '100%';\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tif (in_options.get('caption').nodeType)\n"); out.write("\t\t{\n"); out.write("\t\t\tcaption.appendChild(domTT_cloneNodes ? in_options.get('caption').cloneNode(1) : in_options.get('caption'));\n"); out.write("\t\t}\n"); out.write("\t\telse\n"); out.write("\t\t{\n"); out.write("\t\t\tcaption.innerHTML = in_options.get('caption');\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tif (in_options.get('type') == 'sticky')\n"); out.write("\t\t{\n"); out.write("\t\t\tvar numCaptionCells = 2;\n"); out.write("\t\t\tvar closeLinkCell = captionRow.appendChild(parentDoc.createElement('td'));\n"); out.write("\t\t\tcloseLinkCell.style.padding = '0px';\n"); out.write("\t\t\tvar closeLink = closeLinkCell.appendChild(parentDoc.createElement('div'));\n"); out.write("\t\t\tcloseLink.className = 'caption';\n"); out.write("\t\t\tif (domLib_isIE50)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tcloseLink.style.height = '100%';\n"); out.write("\t\t\t}\n"); out.write("\n"); out.write("\t\t\tcloseLink.style.textAlign = 'right';\n"); out.write("\t\t\tcloseLink.style.cursor = domLib_stylePointer;\n"); out.write("\t\t\t// merge the styles of the two cells\n"); out.write("\t\t\tcloseLink.style.borderLeftWidth = caption.style.borderRightWidth = '0px';\n"); out.write("\t\t\tcloseLink.style.paddingLeft = caption.style.paddingRight = '0px';\n"); out.write("\t\t\tcloseLink.style.marginLeft = caption.style.marginRight = '0px';\n"); out.write("\t\t\tif (in_options.get('closeLink').nodeType)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tcloseLink.appendChild(in_options.get('closeLink').cloneNode(1));\n"); out.write("\t\t\t}\n"); out.write("\t\t\telse\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tcloseLink.innerHTML = in_options.get('closeLink');\n"); out.write("\t\t\t}\n"); out.write("\n"); out.write("\t\t\tcloseLink.onclick = function()\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tdomTT_deactivate(tipOwner.id);\n"); out.write("\t\t\t};\n"); out.write("\t\t\tcloseLink.onmousedown = function(in_event)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tif (typeof(in_event) == 'undefined') { in_event = window.event; }\n"); out.write("\t\t\t\tin_event.cancelBubble = true;\n"); out.write("\t\t\t};\n"); out.write("\t\t\t// MacIE has to have a newline at the end and must be made with createTextNode()\n"); out.write("\t\t\tif (domLib_isMacIE)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tcloseLinkCell.appendChild(parentDoc.createTextNode(\"\\n\"));\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\t// MacIE has to have a newline at the end and must be made with createTextNode()\n"); out.write("\t\tif (domLib_isMacIE)\n"); out.write("\t\t{\n"); out.write("\t\t\tcaptionCell.appendChild(parentDoc.createTextNode(\"\\n\"));\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tvar contentRow = tipLayoutTbody.appendChild(parentDoc.createElement('tr'));\n"); out.write("\t\tvar contentCell = contentRow.appendChild(parentDoc.createElement('td'));\n"); out.write("\t\tcontentCell.style.padding = '0px';\n"); out.write("\t\tif (numCaptionCells)\n"); out.write("\t\t{\n"); out.write("\t\t\tif (domLib_isIE || domLib_isOpera)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tcontentCell.colSpan = numCaptionCells;\n"); out.write("\t\t\t}\n"); out.write("\t\t\telse\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tcontentCell.setAttribute('colspan', numCaptionCells);\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tcontentBlock = contentCell.appendChild(parentDoc.createElement('div'));\n"); out.write("\t\tif (domLib_isIE50)\n"); out.write("\t\t{\n"); out.write("\t\t\tcontentBlock.style.height = '100%';\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\tcontentBlock = tipObj.appendChild(parentDoc.createElement('div'));\n"); out.write("\t}\n"); out.write("\n"); out.write("\tcontentBlock.className = 'contents';\n"); out.write("\n"); out.write("\tvar content = in_options.get('content');\n"); out.write("\t// allow content has a function to return the actual content\n"); out.write("\tif (typeof(content) == 'function') {\n"); out.write("\t\tcontent = content(in_options.get('id'));\n"); out.write("\t}\n"); out.write("\n"); out.write("\tif (content != null && content.nodeType)\n"); out.write("\t{\n"); out.write("\t\tcontentBlock.appendChild(domTT_cloneNodes ? content.cloneNode(1) : content);\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\tcontentBlock.innerHTML = content;\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// adjust the width if specified\n"); out.write("\tif (in_options.has('width'))\n"); out.write("\t{\n"); out.write("\t\ttipObj.style.width = parseInt(in_options.get('width')) + 'px';\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// check if we are overridding the maxWidth\n"); out.write("\t// if the browser supports maxWidth, the global setting will be ignored (assume stylesheet)\n"); out.write("\tvar maxWidth = domTT_maxWidth;\n"); out.write("\tif (in_options.has('maxWidth'))\n"); out.write("\t{\n"); out.write("\t\tif ((maxWidth = in_options.get('maxWidth')) === false)\n"); out.write("\t\t{\n"); out.write("\t\t\ttipObj.style.maxWidth = domLib_styleNoMaxWidth;\n"); out.write("\t\t}\n"); out.write("\t\telse\n"); out.write("\t\t{\n"); out.write("\t\t\tmaxWidth = parseInt(in_options.get('maxWidth'));\n"); out.write("\t\t\ttipObj.style.maxWidth = maxWidth + 'px';\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// HACK: fix lack of maxWidth in CSS for KHTML and IE\n"); out.write("\tif (maxWidth !== false && (domLib_isIE || domLib_isKHTML) && tipObj.offsetWidth > maxWidth)\n"); out.write("\t{\n"); out.write("\t\ttipObj.style.width = maxWidth + 'px';\n"); out.write("\t}\n"); out.write("\n"); out.write("\tin_options.set('offsetWidth', tipObj.offsetWidth);\n"); out.write("\tin_options.set('offsetHeight', tipObj.offsetHeight);\n"); out.write("\n"); out.write("\t// konqueror miscalcuates the width of the containing div when using the layout table based on the\n"); out.write("\t// border size of the containing div\n"); out.write("\tif (domLib_isKonq && tableLayout && !tipObj.style.width)\n"); out.write("\t{\n"); out.write("\t\tvar left = document.defaultView.getComputedStyle(tipObj, '').getPropertyValue('border-left-width');\n"); out.write("\t\tvar right = document.defaultView.getComputedStyle(tipObj, '').getPropertyValue('border-right-width');\n"); out.write("\t\t\n"); out.write("\t\tleft = left.substring(left.indexOf(':') + 2, left.indexOf(';'));\n"); out.write("\t\tright = right.substring(right.indexOf(':') + 2, right.indexOf(';'));\n"); out.write("\t\tvar correction = 2 * ((left ? parseInt(left) : 0) + (right ? parseInt(right) : 0));\n"); out.write("\t\ttipObj.style.width = (tipObj.offsetWidth - correction) + 'px';\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// if a width is not set on an absolutely positioned object, both IE and Opera\n"); out.write("\t// will attempt to wrap when it spills outside of body...we cannot have that\n"); out.write("\tif (domLib_isIE || domLib_isOpera)\n"); out.write("\t{\n"); out.write("\t\tif (!tipObj.style.width)\n"); out.write("\t\t{\n"); out.write("\t\t\t// HACK: the correction here is for a border\n"); out.write("\t\t\ttipObj.style.width = (tipObj.offsetWidth - 2) + 'px';\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\t// HACK: the correction here is for a border\n"); out.write("\t\ttipObj.style.height = (tipObj.offsetHeight - 2) + 'px';\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// store placement offsets from event position\n"); out.write("\tvar offsetX, offsetY;\n"); out.write("\n"); out.write("\t// tooltip floats\n"); out.write("\tif (in_options.get('position') == 'absolute' && !(in_options.has('x') && in_options.has('y')))\n"); out.write("\t{\n"); out.write("\t\t// determine the offset relative to the pointer\n"); out.write("\t\tswitch (in_options.get('direction'))\n"); out.write("\t\t{\n"); out.write("\t\t\tcase 'northeast':\n"); out.write("\t\t\t\toffsetX = in_options.get('offsetX');\n"); out.write("\t\t\t\toffsetY = 0 - tipObj.offsetHeight - in_options.get('offsetY');\n"); out.write("\t\t\tbreak;\n"); out.write("\t\t\tcase 'northwest':\n"); out.write("\t\t\t\toffsetX = 0 - tipObj.offsetWidth - in_options.get('offsetX');\n"); out.write("\t\t\t\toffsetY = 0 - tipObj.offsetHeight - in_options.get('offsetY');\n"); out.write("\t\t\tbreak;\n"); out.write("\t\t\tcase 'north':\n"); out.write("\t\t\t\toffsetX = 0 - parseInt(tipObj.offsetWidth/2);\n"); out.write("\t\t\t\toffsetY = 0 - tipObj.offsetHeight - in_options.get('offsetY');\n"); out.write("\t\t\tbreak;\n"); out.write("\t\t\tcase 'southwest':\n"); out.write("\t\t\t\toffsetX = 0 - tipObj.offsetWidth - in_options.get('offsetX');\n"); out.write("\t\t\t\toffsetY = in_options.get('offsetY');\n"); out.write("\t\t\tbreak;\n"); out.write("\t\t\tcase 'southeast':\n"); out.write("\t\t\t\toffsetX = in_options.get('offsetX');\n"); out.write("\t\t\t\toffsetY = in_options.get('offsetY');\n"); out.write("\t\t\tbreak;\n"); out.write("\t\t\tcase 'south':\n"); out.write("\t\t\t\toffsetX = 0 - parseInt(tipObj.offsetWidth/2);\n"); out.write("\t\t\t\toffsetY = in_options.get('offsetY');\n"); out.write("\t\t\tbreak;\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\t// if we are in an iframe, get the offsets of the iframe in the parent document\n"); out.write("\t\tif (in_options.get('inframe'))\n"); out.write("\t\t{\n"); out.write("\t\t\tvar iframeObj = domLib_getIFrameReference(window);\n"); out.write("\t\t\tif (iframeObj)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tvar frameOffsets = domLib_getOffsets(iframeObj);\n"); out.write("\t\t\t\toffsetX += frameOffsets.get('left');\n"); out.write("\t\t\t\toffsetY += frameOffsets.get('top');\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\t// tooltip is fixed\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\toffsetX = 0;\n"); out.write("\t\toffsetY = 0;\n"); out.write("\t\tin_options.set('trail', false);\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// set the direction-specific offsetX/Y\n"); out.write("\tin_options.set('offsetX', offsetX);\n"); out.write("\tin_options.set('offsetY', offsetY);\n"); out.write("\tif (in_options.get('clearMouse') && in_options.get('direction').indexOf('south') != -1)\n"); out.write("\t{\n"); out.write("\t\tin_options.set('mouseOffset', domTT_mouseHeight);\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\tin_options.set('mouseOffset', 0);\n"); out.write("\t}\n"); out.write("\n"); out.write("\tif (domLib_canFade && typeof(Fadomatic) == 'function')\n"); out.write("\t{\n"); out.write("\t\tif (in_options.get('fade') != 'neither')\n"); out.write("\t\t{\n"); out.write("\t\t\tvar fadeHandler = new Fadomatic(tipObj, 10, 0, 0, in_options.get('fadeMax'));\n"); out.write("\t\t\tin_options.set('fadeHandler', fadeHandler);\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\tin_options.set('fade', 'neither');\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// setup mouse events\n"); out.write("\tif (in_options.get('trail') && typeof(tipOwner.onmousemove) != 'function')\n"); out.write("\t{\n"); out.write("\t\ttipOwner.onmousemove = function(in_event) { domTT_mousemove(this, in_event); };\n"); out.write("\t}\n"); out.write("\n"); out.write("\tif (typeof(tipOwner.onmouseout) != 'function')\n"); out.write("\t{\n"); out.write("\t\ttipOwner.onmouseout = function(in_event) { domTT_mouseout(this, in_event); };\n"); out.write("\t}\n"); out.write("\n"); out.write("\tif (in_options.get('type') == 'sticky')\n"); out.write("\t{\n"); out.write("\t\tif (in_options.get('position') == 'absolute' && domTT_dragEnabled && in_options.get('draggable'))\n"); out.write("\t\t{\n"); out.write("\t\t\tif (domLib_isIE)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tcaptionRow.onselectstart = function() { return false; };\n"); out.write("\t\t\t}\n"); out.write("\n"); out.write("\t\t\t// setup drag\n"); out.write("\t\t\tcaptionRow.onmousedown = function(in_event) { domTT_dragStart(tipObj, in_event); };\n"); out.write("\t\t\tcaptionRow.onmousemove = function(in_event) { domTT_dragUpdate(in_event); };\n"); out.write("\t\t\tcaptionRow.onmouseup = function() { domTT_dragStop(); };\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\telse if (in_options.get('type') == 'velcro')\n"); out.write("\t{\n"); out.write("\t\t/* can use once we have deactivateDelay\n"); out.write("\t\ttipObj.onmouseover = function(in_event)\n"); out.write("\t\t{\n"); out.write("\t\t\tif (typeof(in_event) == 'undefined') { in_event = window.event; }\n"); out.write("\t\t\tvar tooltip = domTT_tooltips.get(tipObj.id);\n"); out.write("\t\t\tif (in_options.get('lifetime')) {\n"); out.write("\t\t\t\tdomLib_clearTimeout(in_options.get('lifetimeTimeout');\n"); out.write("\t\t\t}\n"); out.write("\t\t};\n"); out.write("\t\t*/\n"); out.write("\t\ttipObj.onmouseout = function(in_event)\n"); out.write("\t\t{\n"); out.write("\t\t\tif (typeof(in_event) == 'undefined') { in_event = window.event; }\n"); out.write("\t\t\tif (!domLib_isDescendantOf(in_event[domLib_eventTo], tipObj, domTT_bannedTags)) {\n"); out.write("\t\t\t\tdomTT_deactivate(tipOwner.id);\n"); out.write("\t\t\t}\n"); out.write("\t\t};\n"); out.write("\t\t// NOTE: this might interfere with links in the tip\n"); out.write("\t\ttipObj.onclick = function(in_event)\n"); out.write("\t\t{\n"); out.write("\t\t\tdomTT_deactivate(tipOwner.id);\n"); out.write("\t\t};\n"); out.write("\t}\n"); out.write("\n"); out.write("\tif (in_options.get('position') == 'relative')\n"); out.write("\t{\n"); out.write("\t\ttipObj.style.position = 'relative';\n"); out.write("\t}\n"); out.write("\n"); out.write("\tin_options.set('node', tipObj);\n"); out.write("\tin_options.set('status', 'inactive');\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_show()\n"); out.write("\n"); out.write("// in_id is either tip id or the owner id\n"); out.write("function domTT_show(in_id, in_event)\n"); out.write("{\n"); out.write("\n"); out.write("\t// should always find one since this call would be cancelled if tip was killed\n"); out.write("\tvar tooltip = domTT_tooltips.get(in_id);\n"); out.write("\tvar status = tooltip.get('status');\n"); out.write("\tvar tipObj = tooltip.get('node');\n"); out.write("\n"); out.write("\tif (tooltip.get('position') == 'absolute')\n"); out.write("\t{\n"); out.write("\t\tvar mouseX, mouseY;\n"); out.write("\n"); out.write("\t\tif (tooltip.has('x') && tooltip.has('y'))\n"); out.write("\t\t{\n"); out.write("\t\t\tmouseX = tooltip.get('x');\n"); out.write("\t\t\tmouseY = tooltip.get('y');\n"); out.write("\t\t}\n"); out.write("\t\telse if (!domTT_useGlobalMousePosition || domTT_mousePosition == null || status == 'active' || tooltip.get('delay') == 0)\n"); out.write("\t\t{\n"); out.write("\t\t\tvar eventPosition = domLib_getEventPosition(in_event);\n"); out.write("\t\t\tvar eventX = eventPosition.get('x');\n"); out.write("\t\t\tvar eventY = eventPosition.get('y');\n"); out.write("\t\t\tif (tooltip.get('inframe'))\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\teventX -= eventPosition.get('scrollX');\n"); out.write("\t\t\t\teventY -= eventPosition.get('scrollY');\n"); out.write("\t\t\t}\n"); out.write("\n"); out.write("\t\t\t// only move tip along requested trail axis when updating position\n"); out.write("\t\t\tif (status == 'active' && tooltip.get('trail') !== true)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tvar trail = tooltip.get('trail');\n"); out.write("\t\t\t\tif (trail == 'x')\n"); out.write("\t\t\t\t{\n"); out.write("\t\t\t\t\tmouseX = eventX;\n"); out.write("\t\t\t\t\tmouseY = tooltip.get('mouseY');\n"); out.write("\t\t\t\t}\n"); out.write("\t\t\t\telse if (trail == 'y')\n"); out.write("\t\t\t\t{\n"); out.write("\t\t\t\t\tmouseX = tooltip.get('mouseX');\n"); out.write("\t\t\t\t\tmouseY = eventY;\n"); out.write("\t\t\t\t}\n"); out.write("\t\t\t}\n"); out.write("\t\t\telse\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tmouseX = eventX;\n"); out.write("\t\t\t\tmouseY = eventY;\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\t\telse\n"); out.write("\t\t{\n"); out.write("\t\t\tmouseX = domTT_mousePosition.get('x');\n"); out.write("\t\t\tmouseY = domTT_mousePosition.get('y');\n"); out.write("\t\t\tif (tooltip.get('inframe'))\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tmouseX -= domTT_mousePosition.get('scrollX');\n"); out.write("\t\t\t\tmouseY -= domTT_mousePosition.get('scrollY');\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\t// we are using a grid for updates\n"); out.write("\t\tif (tooltip.get('grid'))\n"); out.write("\t\t{\n"); out.write("\t\t\t// if this is not a mousemove event or it is a mousemove event on an active tip and\n"); out.write("\t\t\t// the movement is bigger than the grid\n"); out.write("\t\t\tif (in_event.type != 'mousemove' || (status == 'active' && (Math.abs(tooltip.get('lastX') - mouseX) > tooltip.get('grid') || Math.abs(tooltip.get('lastY') - mouseY) > tooltip.get('grid'))))\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\ttooltip.set('lastX', mouseX);\n"); out.write("\t\t\t\ttooltip.set('lastY', mouseY);\n"); out.write("\t\t\t}\n"); out.write("\t\t\t// did not satisfy the grid movement requirement\n"); out.write("\t\t\telse\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\treturn false;\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\t// mouseX and mouseY store the last acknowleged mouse position,\n"); out.write("\t\t// good for trailing on one axis\n"); out.write("\t\ttooltip.set('mouseX', mouseX);\n"); out.write("\t\ttooltip.set('mouseY', mouseY);\n"); out.write("\n"); out.write("\t\tvar coordinates;\n"); out.write("\t\tif (domTT_screenEdgeDetection)\n"); out.write("\t\t{\n"); out.write("\t\t\tcoordinates = domTT_correctEdgeBleed(\n"); out.write("\t\t\t\ttooltip.get('offsetWidth'),\n"); out.write("\t\t\t\ttooltip.get('offsetHeight'),\n"); out.write("\t\t\t\tmouseX,\n"); out.write("\t\t\t\tmouseY,\n"); out.write("\t\t\t\ttooltip.get('offsetX'),\n"); out.write("\t\t\t\ttooltip.get('offsetY'),\n"); out.write("\t\t\t\ttooltip.get('mouseOffset'),\n"); out.write("\t\t\t\ttooltip.get('inframe') ? window.parent : window\n"); out.write("\t\t\t);\n"); out.write("\t\t}\n"); out.write("\t\telse\n"); out.write("\t\t{\n"); out.write("\t\t\tcoordinates = {\n"); out.write("\t\t\t\t'x' : mouseX + tooltip.get('offsetX'),\n"); out.write("\t\t\t\t'y' : mouseY + tooltip.get('offsetY') + tooltip.get('mouseOffset')\n"); out.write("\t\t\t};\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\t// update the position\n"); out.write("\t\ttipObj.style.left = coordinates.x + 'px';\n"); out.write("\t\ttipObj.style.top = coordinates.y + 'px';\n"); out.write("\n"); out.write("\t\t// increase the tip zIndex so it goes over previously shown tips\n"); out.write("\t\ttipObj.style.zIndex = domLib_zIndex++;\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// if tip is not active, active it now and check for a fade in\n"); out.write("\tif (status == 'pending')\n"); out.write("\t{\n"); out.write("\t\t// unhide the tooltip\n"); out.write("\t\ttooltip.set('status', 'active');\n"); out.write("\t\ttipObj.style.display = '';\n"); out.write("\t\ttipObj.style.visibility = 'visible';\n"); out.write("\n"); out.write("\t\tvar fade = tooltip.get('fade');\n"); out.write("\t\tif (fade != 'neither')\n"); out.write("\t\t{\n"); out.write("\t\t\tvar fadeHandler = tooltip.get('fadeHandler');\n"); out.write("\t\t\tif (fade == 'out' || fade == 'both')\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tfadeHandler.haltFade();\n"); out.write("\t\t\t\tif (fade == 'out')\n"); out.write("\t\t\t\t{\n"); out.write("\t\t\t\t\tfadeHandler.halt();\n"); out.write("\t\t\t\t}\n"); out.write("\t\t\t}\n"); out.write("\n"); out.write("\t\t\tif (fade == 'in' || fade == 'both')\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tfadeHandler.fadeIn();\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tif (tooltip.get('type') == 'greasy' && tooltip.get('lifetime') != 0)\n"); out.write("\t\t{\n"); out.write("\t\t\ttooltip.set('lifetimeTimeout', domLib_setTimeout(domTT_runDeactivate, tooltip.get('lifetime'), [tipObj.id]));\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\tif (tooltip.get('position') == 'absolute' && domTT_detectCollisions)\n"); out.write("\t{\n"); out.write("\t\t// utilize original collision element cache\n"); out.write("\t\tdomLib_detectCollisions(tipObj, false, true);\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_close()\n"); out.write("\n"); out.write("// in_handle can either be an child object of the tip, the tip id or the owner id\n"); out.write("function domTT_close(in_handle)\n"); out.write("{\n"); out.write("\tvar id;\n"); out.write("\tif (typeof(in_handle) == 'object' && in_handle.nodeType)\n"); out.write("\t{\n"); out.write("\t\tvar obj = in_handle;\n"); out.write("\t\twhile (!obj.id || !domTT_tooltips.get(obj.id))\n"); out.write("\t\t{\n"); out.write("\t\t\tobj = obj.parentNode;\n"); out.write("\t\n"); out.write("\t\t\tif (obj.nodeType != document.ELEMENT_NODE) { return; }\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tid = obj.id;\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\tid = in_handle;\n"); out.write("\t}\n"); out.write("\n"); out.write("\tdomTT_deactivate(id);\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_closeAll()\n"); out.write("\n"); out.write("// run through the tooltips and close them all\n"); out.write("function domTT_closeAll()\n"); out.write("{\n"); out.write("\t// NOTE: this will iterate 2x # of tooltips\n"); out.write("\tfor (var id in domTT_tooltips.elementData) {\n"); out.write("\t\tdomTT_close(id);\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_deactivate()\n"); out.write("\n"); out.write("// in_id is either the tip id or the owner id\n"); out.write("function domTT_deactivate(in_id)\n"); out.write("{\n"); out.write("\tvar tooltip = domTT_tooltips.get(in_id);\n"); out.write("\tif (tooltip)\n"); out.write("\t{\n"); out.write("\t\tvar status = tooltip.get('status');\n"); out.write("\t\tif (status == 'pending')\n"); out.write("\t\t{\n"); out.write("\t\t\t// cancel the creation of this tip if it is still pending\n"); out.write("\t\t\tdomLib_clearTimeout(tooltip.get('activateTimeout'));\n"); out.write("\t\t\ttooltip.set('status', 'inactive');\n"); out.write("\t\t}\n"); out.write("\t\telse if (status == 'active')\n"); out.write("\t\t{\n"); out.write("\t\t\tif (tooltip.get('lifetime'))\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tdomLib_clearTimeout(tooltip.get('lifetimeTimeout'));\n"); out.write("\t\t\t}\n"); out.write("\n"); out.write("\t\t\tvar tipObj = tooltip.get('node');\n"); out.write("\t\t\tif (tooltip.get('closeAction') == 'hide')\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tvar fade = tooltip.get('fade');\n"); out.write("\t\t\t\tif (fade != 'neither')\n"); out.write("\t\t\t\t{\n"); out.write("\t\t\t\t\tvar fadeHandler = tooltip.get('fadeHandler');\n"); out.write("\t\t\t\t\tif (fade == 'out' || fade == 'both')\n"); out.write("\t\t\t\t\t{\n"); out.write("\t\t\t\t\t\tfadeHandler.fadeOut();\n"); out.write("\t\t\t\t\t}\n"); out.write("\t\t\t\t\telse\n"); out.write("\t\t\t\t\t{\n"); out.write("\t\t\t\t\t\tfadeHandler.hide();\n"); out.write("\t\t\t\t\t}\n"); out.write("\t\t\t\t}\n"); out.write("\t\t\t\telse\n"); out.write("\t\t\t\t{\n"); out.write("\t\t\t\t\ttipObj.style.display = 'none';\n"); out.write("\t\t\t\t}\n"); out.write("\t\t\t}\n"); out.write("\t\t\telse\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\ttooltip.get('parent').removeChild(tipObj);\n"); out.write("\t\t\t\tdomTT_tooltips.remove(tooltip.get('owner').id);\n"); out.write("\t\t\t\tdomTT_tooltips.remove(tooltip.get('id'));\n"); out.write("\t\t\t}\n"); out.write("\n"); out.write("\t\t\ttooltip.set('status', 'inactive');\n"); out.write("\t\t\tif (domTT_detectCollisions) {\n"); out.write("\t\t\t\t// unhide all of the selects that are owned by this object\n"); out.write("\t\t\t\t// utilize original collision element cache\n"); out.write("\t\t\t\tdomLib_detectCollisions(tipObj, true, true); \n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_mouseout()\n"); out.write("\n"); out.write("function domTT_mouseout(in_owner, in_event)\n"); out.write("{\n"); out.write("\tif (!domLib_useLibrary) { return false; }\n"); out.write("\n"); out.write("\tif (typeof(in_event) == 'undefined') { in_event = window.event;\t}\n"); out.write("\n"); out.write("\tvar toChild = domLib_isDescendantOf(in_event[domLib_eventTo], in_owner, domTT_bannedTags);\n"); out.write("\tvar tooltip = domTT_tooltips.get(in_owner.id);\n"); out.write("\tif (tooltip && (tooltip.get('type') == 'greasy' || tooltip.get('status') != 'active'))\n"); out.write("\t{\n"); out.write("\t\t// deactivate tip if exists and we moved away from the owner\n"); out.write("\t\tif (!toChild)\n"); out.write("\t\t{\n"); out.write("\t\t\tdomTT_deactivate(in_owner.id);\n"); out.write("\t\t\ttry { window.status = window.defaultStatus; } catch(e) {}\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\telse if (!toChild)\n"); out.write("\t{\n"); out.write("\t\ttry { window.status = window.defaultStatus; } catch(e) {}\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_mousemove()\n"); out.write("\n"); out.write("function domTT_mousemove(in_owner, in_event)\n"); out.write("{\n"); out.write("\tif (!domLib_useLibrary) { return false; }\n"); out.write("\n"); out.write("\tif (typeof(in_event) == 'undefined') { in_event = window.event;\t}\n"); out.write("\n"); out.write("\tvar tooltip = domTT_tooltips.get(in_owner.id);\n"); out.write("\tif (tooltip && tooltip.get('trail') && tooltip.get('status') == 'active')\n"); out.write("\t{\n"); out.write("\t\t// see if we are trailing lazy\n"); out.write("\t\tif (tooltip.get('lazy'))\n"); out.write("\t\t{\n"); out.write("\t\t\tdomLib_setTimeout(domTT_runShow, domTT_trailDelay, [in_owner.id, in_event]);\n"); out.write("\t\t}\n"); out.write("\t\telse\n"); out.write("\t\t{\n"); out.write("\t\t\tdomTT_show(in_owner.id, in_event);\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_addPredefined()\n"); out.write("\n"); out.write("function domTT_addPredefined(in_id)\n"); out.write("{\n"); out.write("\tvar options = new Hash();\n"); out.write("\tfor (var i = 1; i < arguments.length; i += 2)\n"); out.write("\t{\n"); out.write("\t\toptions.set(arguments[i], arguments[i + 1]);\n"); out.write("\t}\n"); out.write("\n"); out.write("\tdomTT_predefined.set(in_id, options);\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_correctEdgeBleed()\n"); out.write("\n"); out.write("function domTT_correctEdgeBleed(in_width, in_height, in_x, in_y, in_offsetX, in_offsetY, in_mouseOffset, in_window)\n"); out.write("{\n"); out.write("\tvar win, doc;\n"); out.write("\tvar bleedRight, bleedBottom;\n"); out.write("\tvar pageHeight, pageWidth, pageYOffset, pageXOffset;\n"); out.write("\n"); out.write("\tvar x = in_x + in_offsetX;\n"); out.write("\tvar y = in_y + in_offsetY + in_mouseOffset;\n"); out.write("\n"); out.write("\twin = (typeof(in_window) == 'undefined' ? window : in_window);\n"); out.write("\n"); out.write("\t// Gecko and IE swaps values of clientHeight, clientWidth properties when\n"); out.write("\t// in standards compliance mode from documentElement to document.body\n"); out.write("\tdoc = ((domLib_standardsMode && (domLib_isIE || domLib_isGecko)) ? win.document.documentElement : win.document.body);\n"); out.write("\n"); out.write("\t// for IE in compliance mode\n"); out.write("\tif (domLib_isIE)\n"); out.write("\t{\n"); out.write("\t\tpageHeight = doc.clientHeight;\n"); out.write("\t\tpageWidth = doc.clientWidth;\n"); out.write("\t\tpageYOffset = doc.scrollTop;\n"); out.write("\t\tpageXOffset = doc.scrollLeft;\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\tpageHeight = doc.clientHeight;\n"); out.write("\t\tpageWidth = doc.clientWidth;\n"); out.write("\n"); out.write("\t\tif (domLib_isKHTML)\n"); out.write("\t\t{\n"); out.write("\t\t\tpageHeight = win.innerHeight;\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tpageYOffset = win.pageYOffset;\n"); out.write("\t\tpageXOffset = win.pageXOffset;\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// we are bleeding off the right, move tip over to stay on page\n"); out.write("\t// logic: take x position, add width and subtract from effective page width\n"); out.write("\tif ((bleedRight = (x - pageXOffset) + in_width - (pageWidth - domTT_screenEdgePadding)) > 0)\n"); out.write("\t{\n"); out.write("\t\tx -= bleedRight;\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// we are bleeding to the left, move tip over to stay on page\n"); out.write("\t// if tip doesn't fit, we will go back to bleeding off the right\n"); out.write("\t// logic: take x position and check if less than edge padding\n"); out.write("\tif ((x - pageXOffset) < domTT_screenEdgePadding)\n"); out.write("\t{\n"); out.write("\t\tx = domTT_screenEdgePadding + pageXOffset;\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// if we are bleeding off the bottom, flip to north\n"); out.write("\t// logic: take y position, add height and subtract from effective page height\n"); out.write("\tif ((bleedBottom = (y - pageYOffset) + in_height - (pageHeight - domTT_screenEdgePadding)) > 0)\n"); out.write("\t{\n"); out.write("\t\ty = in_y - in_height - in_offsetY;\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// if we are bleeding off the top, flip to south\n"); out.write("\t// if tip doesn't fit, we will go back to bleeding off the bottom\n"); out.write("\t// logic: take y position and check if less than edge padding\n"); out.write("\tif ((y - pageYOffset) < domTT_screenEdgePadding)\n"); out.write("\t{\n"); out.write("\t\ty = in_y + domTT_mouseHeight + in_offsetY;\n"); out.write("\t}\n"); out.write("\n"); out.write("\treturn {'x' : x, 'y' : y};\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_isActive()\n"); out.write("\n"); out.write("// in_id is either the tip id or the owner id\n"); out.write("function domTT_isActive(in_id)\n"); out.write("{\n"); out.write("\tvar tooltip = domTT_tooltips.get(in_id);\n"); out.write("\tif (!tooltip || tooltip.get('status') != 'active')\n"); out.write("\t{\n"); out.write("\t\treturn false;\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\treturn true;\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_runXXX()\n"); out.write("\n"); out.write("// All of these domMenu_runXXX() methods are used by the event handling sections to\n"); out.write("// avoid the circular memory leaks caused by inner functions\n"); out.write("function domTT_runDeactivate(args) { domTT_deactivate(args[0]); }\n"); out.write("function domTT_runShow(args) { domTT_show(args[0], args[1]); }\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_replaceTitles()\n"); out.write("\n"); out.write("function domTT_replaceTitles(in_decorator)\n"); out.write("{\n"); out.write("\tvar elements = domLib_getElementsByClass('tooltip');\n"); out.write("\tfor (var i = 0; i < elements.length; i++)\n"); out.write("\t{\n"); out.write("\t\tif (elements[i].title)\n"); out.write("\t\t{\n"); out.write("\t\t\tvar content;\n"); out.write("\t\t\tif (typeof(in_decorator) == 'function')\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tcontent = in_decorator(elements[i]);\n"); out.write("\t\t\t}\n"); out.write("\t\t\telse\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tcontent = elements[i].title;\n"); out.write("\t\t\t}\n"); out.write("\n"); out.write("\t\t\tcontent = content.replace(new RegExp('\\'', 'g'), '\\\\\\'');\n"); out.write("\t\t\telements[i].onmouseover = new Function('in_event', \"domTT_activate(this, in_event, 'content', '\" + content + \"')\");\n"); out.write("\t\t\telements[i].title = '';\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_update()\n"); out.write("\n"); out.write("// Allow authors to update the contents of existing tips using the DOM\n"); out.write("// Unfortunately, the tip must already exist, or else no work is done.\n"); out.write("// TODO: make getting at content or caption cleaner\n"); out.write("function domTT_update(handle, content, type)\n"); out.write("{\n"); out.write("\t// type defaults to 'content', can also be 'caption'\n"); out.write("\tif (typeof(type) == 'undefined')\n"); out.write("\t{\n"); out.write("\t\ttype = 'content';\n"); out.write("\t}\n"); out.write("\n"); out.write("\tvar tip = domTT_tooltips.get(handle);\n"); out.write("\tif (!tip)\n"); out.write("\t{\n"); out.write("\t\treturn;\n"); out.write("\t}\n"); out.write("\n"); out.write("\tvar tipObj = tip.get('node');\n"); out.write("\tvar updateNode;\n"); out.write("\tif (type == 'content')\n"); out.write("\t{\n"); out.write("\t\t//
...\n"); out.write("\t\tupdateNode = tipObj.firstChild;\n"); out.write("\t\tif (updateNode.className != 'contents')\n"); out.write("\t\t{\n"); out.write("\t\t\t// ...
...\n"); out.write("\t\t\tupdateNode = updateNode.firstChild.firstChild.nextSibling.firstChild.firstChild;\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\telse\n"); out.write("\t{\n"); out.write("\t\tupdateNode = tipObj.firstChild;\n"); out.write("\t\tif (updateNode.className == 'contents')\n"); out.write("\t\t{\n"); out.write("\t\t\t// missing caption\n"); out.write("\t\t\treturn;\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\t//
...\n"); out.write("\t\tupdateNode = updateNode.firstChild.firstChild.firstChild.firstChild;\n"); out.write("\t}\n"); out.write("\n"); out.write("\t// TODO: allow for a DOM node as content\n"); out.write("\tupdateNode.innerHTML = content;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write('\n'); out.write('\n'); out.write("/** $Id$ */\n"); out.write("// {{{ license\n"); out.write("\n"); out.write("/*\n"); out.write(" * Copyright 2002-2005 Dan Allen, Mojavelinux.com (dan.allen@mojavelinux.com)\n"); out.write(" *\n"); out.write(" * Licensed under the Apache License, Version 2.0 (the \"License\");\n"); out.write(" * you may not use this file except in compliance with the License.\n"); out.write(" * You may obtain a copy of the License at\n"); out.write(" *\n"); out.write(" * http://www.apache.org/licenses/LICENSE-2.0\n"); out.write(" *\n"); out.write(" * Unless required by applicable law or agreed to in writing, software\n"); out.write(" * distributed under the License is distributed on an \"AS IS\" BASIS,\n"); out.write(" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"); out.write(" * See the License for the specific language governing permissions and\n"); out.write(" * limitations under the License.\n"); out.write(" */\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ globals (DO NOT EDIT)\n"); out.write("\n"); out.write("var domTT_dragEnabled = true;\n"); out.write("var domTT_currentDragTarget;\n"); out.write("var domTT_dragMouseDown;\n"); out.write("var domTT_dragOffsetLeft;\n"); out.write("var domTT_dragOffsetTop;\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_dragStart()\n"); out.write("\n"); out.write("function domTT_dragStart(in_this, in_event)\n"); out.write("{\n"); out.write("\tif (typeof(in_event) == 'undefined') { in_event = window.event; }\n"); out.write("\n"); out.write("\tvar eventButton = in_event[domLib_eventButton];\n"); out.write("\tif (eventButton != 1 && !domLib_isKHTML)\n"); out.write("\t{\n"); out.write("\t\treturn;\n"); out.write("\t}\n"); out.write("\n"); out.write("\tdomTT_currentDragTarget = in_this;\n"); out.write("\tin_this.style.cursor = 'move';\n"); out.write("\n"); out.write("\t// upgrade our z-index\n"); out.write("\tin_this.style.zIndex = ++domLib_zIndex;\n"); out.write("\n"); out.write("\tvar eventPosition = domLib_getEventPosition(in_event);\n"); out.write("\n"); out.write("\tvar targetPosition = domLib_getOffsets(in_this);\n"); out.write("\tdomTT_dragOffsetLeft = eventPosition.get('x') - targetPosition.get('left');\n"); out.write("\tdomTT_dragOffsetTop = eventPosition.get('y') - targetPosition.get('top');\n"); out.write("\tdomTT_dragMouseDown = true;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_dragUpdate()\n"); out.write("\n"); out.write("function domTT_dragUpdate(in_event)\n"); out.write("{\n"); out.write("\tif (domTT_dragMouseDown)\n"); out.write("\t{\n"); out.write("\t\tif (domLib_isGecko)\n"); out.write("\t\t{\n"); out.write("\t\t\twindow.getSelection().removeAllRanges()\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tif (domTT_useGlobalMousePosition && domTT_mousePosition != null)\n"); out.write("\t\t{\n"); out.write("\t\t\tvar eventPosition = domTT_mousePosition;\n"); out.write("\t\t}\n"); out.write("\t\telse\n"); out.write("\t\t{\n"); out.write("\t\t\tif (typeof(in_event) == 'undefined') { in_event = window.event; }\n"); out.write("\t\t\tvar eventPosition = domLib_getEventPosition(in_event);\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\tdomTT_currentDragTarget.style.left = (eventPosition.get('x') - domTT_dragOffsetLeft) + 'px';\n"); out.write("\t\tdomTT_currentDragTarget.style.top = (eventPosition.get('y') - domTT_dragOffsetTop) + 'px';\n"); out.write("\n"); out.write("\t\t// update the collision detection\n"); out.write("\t\tdomLib_detectCollisions(domTT_currentDragTarget);\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ domTT_dragStop()\n"); out.write("\n"); out.write("function domTT_dragStop()\n"); out.write("{\n"); out.write("\tif (domTT_dragMouseDown) {\n"); out.write("\t\tdomTT_dragMouseDown = false; \n"); out.write("\t\tdomTT_currentDragTarget.style.cursor = 'default';\n"); out.write("\t\tdomTT_currentDragTarget = null;\n"); out.write("\t\tif (domLib_isGecko)\n"); out.write("\t\t{\n"); out.write("\t\t\twindow.getSelection().removeAllRanges()\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write('\n'); out.write('\n'); out.write("/** $Id$ */\n"); out.write("// {{{ license\n"); out.write("\n"); out.write("/*\n"); out.write(" * Copyright 2002-2005 Dan Allen, Mojavelinux.com (dan.allen@mojavelinux.com)\n"); out.write(" *\n"); out.write(" * Licensed under the Apache License, Version 2.0 (the \"License\");\n"); out.write(" * you may not use this file except in compliance with the License.\n"); out.write(" * You may obtain a copy of the License at\n"); out.write(" *\n"); out.write(" * http://www.apache.org/licenses/LICENSE-2.0\n"); out.write(" *\n"); out.write(" * Unless required by applicable law or agreed to in writing, software\n"); out.write(" * distributed under the License is distributed on an \"AS IS\" BASIS,\n"); out.write(" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"); out.write(" * See the License for the specific language governing permissions and\n"); out.write(" * limitations under the License.\n"); out.write(" */\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ intro\n"); out.write("\n"); out.write("/**\n"); out.write(" * Title: alphaAPI\n"); out.write(" * Original Author: chrisken\n"); out.write(" * Original Url: http://www.cs.utexas.edu/users/chrisken/alphaapi.html\n"); out.write(" *\n"); out.write(" * Modified by Dan Allen \n"); out.write(" * Note: When the stopAlpha is reached and it is equal to 0, the element's\n"); out.write(" * style is set to display: none to fix a bug in domTT\n"); out.write(" */\n"); out.write("\n"); out.write("// }}}\n"); out.write("function alphaAPI(element, fadeInDelay, fadeOutDelay, startAlpha, stopAlpha, offsetTime, deltaAlpha)\n"); out.write("{\n"); out.write("\t// {{{ properties\n"); out.write("\n"); out.write("\tthis.element = typeof(element) == 'object' ? element : document.getElementById(element);\n"); out.write("\tthis.fadeInDelay = fadeInDelay || 40;\n"); out.write("\tthis.fadeOutDelay = fadeOutDelay || this.fadeInDelay;\n"); out.write("\tthis.startAlpha = startAlpha;\n"); out.write("\tthis.stopAlpha = stopAlpha;\n"); out.write("\t// make sure a filter exists so an error is not thrown\n"); out.write("\tif (typeof(this.element.filters) == 'object')\n"); out.write("\t{\n"); out.write("\t\tif (typeof(this.element.filters.alpha) == 'undefined')\n"); out.write("\t\t{\n"); out.write("\t\t\tthis.element.style.filter += 'alpha(opacity=100)';\n"); out.write("\t\t}\n"); out.write("\t}\n"); out.write("\n"); out.write("\tthis.offsetTime = (offsetTime || 0) * 1000;\n"); out.write("\tthis.deltaAlpha = deltaAlpha || 10;\n"); out.write("\tthis.timer = null;\n"); out.write("\tthis.paused = false;\n"); out.write("\tthis.started = false;\n"); out.write("\tthis.cycle = false;\n"); out.write("\tthis.command = function() {};\n"); out.write(" return this;\n"); out.write("\n"); out.write("\t// }}}\n"); out.write("}\n"); out.write("\n"); out.write("// use prototype methods to save memory\n"); out.write("// {{{ repeat()\n"); out.write("\n"); out.write("alphaAPI.prototype.repeat = function(repeat)\n"); out.write("{\n"); out.write(" this.cycle = repeat ? true : false;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ setAlphaBy()\n"); out.write("\n"); out.write("alphaAPI.prototype.setAlphaBy = function(deltaAlpha)\n"); out.write("{\n"); out.write(" this.setAlpha(this.getAlpha() + deltaAlpha);\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ toggle()\n"); out.write("\n"); out.write("alphaAPI.prototype.toggle = function()\n"); out.write("{\n"); out.write(" if (!this.started)\n"); out.write(" {\n"); out.write(" this.start();\n"); out.write(" }\n"); out.write(" else if (this.paused)\n"); out.write(" {\n"); out.write(" this.unpause();\n"); out.write(" }\n"); out.write(" else\n"); out.write(" {\n"); out.write(" this.pause();\n"); out.write(" }\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ timeout()\n"); out.write("\n"); out.write("alphaAPI.prototype.timeout = function(command, delay)\n"); out.write("{\n"); out.write(" this.command = command;\n"); out.write(" this.timer = setTimeout(command, delay);\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ setAlpha()\n"); out.write("\n"); out.write("alphaAPI.prototype.setAlpha = function(opacity)\n"); out.write("{\n"); out.write(" if (typeof(this.element.filters) == 'object')\n"); out.write(" {\n"); out.write(" this.element.filters.alpha.opacity = opacity;\n"); out.write(" }\n"); out.write(" else if (this.element.style.setProperty)\n"); out.write(" {\n"); out.write(" this.element.style.setProperty('opacity', opacity / 100, '');\n"); out.write("\t\t// handle the case of mozilla < 1.7\n"); out.write(" this.element.style.setProperty('-moz-opacity', opacity / 100, '');\n"); out.write("\t\t// handle the case of old kthml\n"); out.write(" this.element.style.setProperty('-khtml-opacity', opacity / 100, '');\n"); out.write(" }\n"); out.write("}\t\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ getAlpha()\n"); out.write("\n"); out.write("alphaAPI.prototype.getAlpha = function()\n"); out.write("{\n"); out.write(" if (typeof(this.element.filters) == 'object')\n"); out.write(" {\n"); out.write(" return this.element.filters.alpha.opacity;\n"); out.write(" }\n"); out.write(" else if (this.element.style.getPropertyValue)\n"); out.write(" {\n"); out.write("\t\tvar opacityValue = this.element.style.getPropertyValue('opacity');\n"); out.write("\t\t// handle the case of mozilla < 1.7\n"); out.write("\t\tif (opacityValue == '')\n"); out.write("\t\t{\n"); out.write("\t\t\topacityValue = this.element.style.getPropertyValue('-moz-opacity');\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t\t// handle the case of old khtml\n"); out.write("\t\tif (opacityValue == '')\n"); out.write("\t\t{\n"); out.write("\t\t\topacityValue = this.element.style.getPropertyValue('-khtml-opacity');\n"); out.write("\t\t}\n"); out.write("\n"); out.write(" return opacityValue * 100;\n"); out.write(" }\n"); out.write("\n"); out.write(" return 100;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ start()\n"); out.write("\n"); out.write("alphaAPI.prototype.start = function()\n"); out.write("{\n"); out.write(" this.started = true;\n"); out.write(" this.setAlpha(this.startAlpha);\n"); out.write(" // determine direction\n"); out.write(" if (this.startAlpha > this.stopAlpha)\n"); out.write(" {\n"); out.write(" var instance = this;\n"); out.write(" this.timeout(function() { instance.fadeOut(); }, this.offsetTime);\n"); out.write(" }\n"); out.write(" else\n"); out.write(" {\n"); out.write(" var instance = this;\n"); out.write(" this.timeout(function() { instance.fadeIn(); }, this.offsetTime);\n"); out.write(" }\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ stop()\n"); out.write("\n"); out.write("alphaAPI.prototype.stop = function()\n"); out.write("{\n"); out.write(" this.started = false;\n"); out.write(" this.setAlpha(this.stopAlpha);\n"); out.write("\tif (this.stopAlpha == 0)\n"); out.write("\t{\n"); out.write("\t\tthis.element.style.display = 'none';\n"); out.write("\t}\n"); out.write("\n"); out.write(" this.stopTimer();\n"); out.write(" this.command = function() {};\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ reset()\n"); out.write("\n"); out.write("alphaAPI.prototype.reset = function()\n"); out.write("{\n"); out.write(" this.started = false;\n"); out.write(" this.setAlpha(this.startAlpha);\n"); out.write(" this.stopTimer();\n"); out.write(" this.command = function() {};\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ pause()\n"); out.write("\n"); out.write("alphaAPI.prototype.pause = function()\n"); out.write("{\n"); out.write(" this.paused = true;\n"); out.write(" this.stopTimer();\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ unpause()\n"); out.write("\n"); out.write("alphaAPI.prototype.unpause = function()\n"); out.write("{\n"); out.write(" this.paused = false;\n"); out.write(" if (!this.started)\n"); out.write(" { \n"); out.write(" this.start();\n"); out.write(" }\n"); out.write(" else\n"); out.write(" {\n"); out.write(" this.command(); \n"); out.write(" }\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ stopTimer()\n"); out.write("\n"); out.write("alphaAPI.prototype.stopTimer = function()\n"); out.write("{\n"); out.write(" clearTimeout(this.timer);\n"); out.write(" this.timer = null;\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ fadeOut()\n"); out.write("\n"); out.write("alphaAPI.prototype.fadeOut = function()\n"); out.write("{\n"); out.write(" this.stopTimer();\n"); out.write(" if (this.getAlpha() > this.stopAlpha)\n"); out.write(" {\n"); out.write(" this.setAlphaBy(-1 * this.deltaAlpha);\n"); out.write(" var instance = this;\n"); out.write(" this.timeout(function() { instance.fadeOut(); }, this.fadeOutDelay);\n"); out.write(" }\n"); out.write(" else\n"); out.write(" {\n"); out.write(" if (this.cycle)\n"); out.write(" {\n"); out.write(" var instance = this;\n"); out.write(" this.timeout(function() { instance.fadeIn(); }, this.fadeInDelay);\n"); out.write(" }\n"); out.write(" else\n"); out.write(" {\n"); out.write("\t\t\tif (this.stopAlpha == 0)\n"); out.write("\t\t\t{\n"); out.write("\t\t\t\tthis.element.style.display = 'none';\n"); out.write("\t\t\t}\n"); out.write(" this.started = false;\n"); out.write(" }\n"); out.write(" }\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write("// {{{ fadeIn()\n"); out.write("\n"); out.write("alphaAPI.prototype.fadeIn = function()\n"); out.write("{\n"); out.write(" this.stopTimer();\n"); out.write(" if (this.getAlpha() < this.startAlpha)\n"); out.write(" {\n"); out.write(" this.setAlphaBy(this.deltaAlpha);\n"); out.write(" var instance = this;\n"); out.write(" this.timeout(function() { instance.fadeIn(); }, this.fadeInDelay);\n"); out.write(" }\n"); out.write(" else\n"); out.write(" {\n"); out.write(" if (this.cycle)\n"); out.write(" {\n"); out.write(" var instance = this;\n"); out.write(" this.timeout(function() { instance.fadeOut(); }, this.fadeOutDelay);\n"); out.write(" }\n"); out.write(" else\n"); out.write(" {\n"); out.write(" this.started = false;\n"); out.write(" }\n"); out.write(" }\n"); out.write("}\n"); out.write("\n"); out.write("// }}}\n"); out.write('\n'); out.write('\n'); out.write("var domTT_classPrefix = 'domTTOverlib';\n"); out.write("\n"); out.write("function tooltip(link, event, content, caption) {\n"); out.write("\tif (content && caption) {\n"); out.write("\t\tdomTT_activate(link, event, 'caption', caption, 'content', content, 'trail', 'x');\n"); out.write("\t} else if (content) {\n"); out.write("\t\tdomTT_activate(link, event, 'content', content, 'trail', 'x');\n"); out.write("\t} else {\n"); out.write("\t\treturn false;\n"); out.write("\t}\n"); out.write("}\n"); out.write("\n"); out.write("function stickyTooltip (link, event, content, caption) {\n"); out.write("\tif (content && caption) {\n"); out.write("\t\treturn domTT_activate(link, event, 'caption', caption, 'content', content, 'type', 'sticky', 'draggable', true);\n"); out.write("\t} else if (content) {\n"); out.write("\t\treturn domTT_activate(link, event, 'content', content, 'type', 'sticky', 'draggable', true);\n"); out.write("\t} else {\n"); out.write("\t\treturn false;\n"); out.write("\t}\n"); out.write("}"); out.write('\n'); } catch (Throwable t) { if (!(t instanceof SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { out.clearBuffer(); } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else log(t.getMessage(), t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } }