diff --git a/Makefile b/Makefile index 16a15ba1..55f78960 100644 --- a/Makefile +++ b/Makefile @@ -4,97 +4,87 @@ BUILD_DIR = build PREFIX = . DIST_DIR = ${PREFIX}/dist -PLUGINS = ${SRC_DIR}/ajax.js\ - ${SRC_DIR}/tips.js\ - ${SRC_DIR}/imagemap.js\ - ${SRC_DIR}/svg.js\ - ${SRC_DIR}/modal.js\ - ${SRC_DIR}/bgiframe.js +PLUGINS = $(shell ls -p ${SRC_DIR} | grep / | xargs) +PLUGINS_JS = $(if ${PLUGINS},$(shell find ${PLUGINS:%=${SRC_DIR}/%/} -name "*.js" 2> /dev/null),"") +PLUGINS_CSS = $(if ${PLUGINS},$(shell find ${PLUGINS:%=${SRC_DIR}/%/} -name "*.css" 2> /dev/null),"") + +EXTRA_CSS = ${SRC_DIR}/styles.css\ + ${SRC_DIR}/extra.css JS_MODULES = ${SRC_DIR}/header.txt\ ${SRC_DIR}/intro.js\ ${SRC_DIR}/core.js\ - ${PLUGINS}\ + ${PLUGINS_JS}\ ${SRC_DIR}/outro.js CSS_MODULES = ${SRC_DIR}/header.txt\ ${SRC_DIR}/core.css\ - ${SRC_DIR}/tips.css\ - ${SRC_DIR}/modal.css\ - ${SRC_DIR}/styles.css\ - ${SRC_DIR}/extra.css + ${PLUGINS_CSS}\ + ${EXTRA_CSS} QTIP = ${DIST_DIR}/jquery.qtip.js QTIP_MIN = ${DIST_DIR}/jquery.qtip.min.js -QTIP_PACK = ${DIST_DIR}/jquery.qtip.pack.js QTIP_CSS = ${DIST_DIR}/jquery.qtip.css QTIP_CSS_MIN = ${DIST_DIR}/jquery.qtip.min.css QTIP_VER = `cat version.txt` VER = sed s/@VERSION/${QTIP_VER}/ -JS_ENGINE ?= `which node nodejs` -COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe -MINIFIER = java -Xmx96m -jar ${BUILD_DIR}/yuicompressor.jar -PACKER = java -jar ${BUILD_DIR}/js.jar ${BUILD_DIR}/packer.js +JS_ENGINE = `which nodejs` +JS_LINT = ${JS_ENGINE} $(BUILD_DIR)/jslint-check.js +JS_MINIFIER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --extra +CSS_MINIFIER = java -Xmx96m -jar ${BUILD_DIR}/yuicompressor.jar DATE=`git log --pretty=format:'%ad' -1` -all: clean qtip lint css min pack - @@echo "qTip build complete." +all: clean qtip lint css min + @@echo ${PLUGIN_JS} + @@echo "qTip2 built successfully!\n" ${DIST_DIR}: @@mkdir -p ${DIST_DIR} -qtip: ${DIST_DIR} ${QTIP} - -${QTIP}: ${JS_MODULES} +qtip: ${DIST_DIR} ${JS_MODULES} @@mkdir -p ${DIST_DIR} - @@echo "Building" ${QTIP} + @@echo "Building qTip2... Success!" + @@echo "\tEnabled plugins: " $(if ${PLUGINS},"${PLUGINS:%/=%}", "None") "\n" + @@cat ${JS_MODULES} | \ sed 's/Date:./&'"${DATE}"'/' | \ ${VER} > ${QTIP}; -min: ${QTIP_MIN} +css: ${DIST_DIR} ${CSS_MODULES} + @@echo -n "Building CSS... " + @@cat ${CSS_MODULES} | \ + sed 's/Date:./&'"${DATE}"'/' | \ + ${VER} > ${QTIP_CSS}; + @@echo "Success!" -${QTIP_MIN}: ${QTIP} ${QTIP_CSS} +min: qtip css @@if test ! -z ${JS_ENGINE}; then \ - echo "Building" ${QTIP_MIN}; \ + echo -n "Minifying JS... "; \ head -18 ${QTIP} > ${QTIP_MIN}; \ - ${COMPILER} ${QTIP} > ${QTIP_MIN}.tmp; \ + ${JS_MINIFIER} ${QTIP} > ${QTIP_MIN}.tmp; \ sed '$ s#^\( \*/\)\(.\+\)#\1\n\2;#' ${QTIP_MIN}.tmp > ${QTIP_MIN}; \ rm -rf $(QTIP_MIN).tmp; \ + echo "Success!"; \ else \ echo "You must have NodeJS installed in order to minify qTip JS."; \ fi - @@echo "Building" ${QTIP_CSS_MIN} - @@${MINIFIER} ${QTIP_CSS} --type css -o ${QTIP_CSS_MIN} - -pack: ${QTIP_MIN} - @@echo "Building" ${QTIP_PACK} - - @@head -18 ${QTIP} > ${QTIP_PACK} - @@${PACKER} ${QTIP_MIN} ${QTIP_PACK}.tmp - @@cat ${QTIP_PACK}.tmp >> ${QTIP_PACK} && rm ${QTIP_PACK}.tmp - -css: ${QTIP_CSS} - -${QTIP_CSS}: ${DIST_DIR} ${CSS_MODULES} - @@echo "Building" ${QTIP_CSS} - @@cat ${CSS_MODULES} | \ - sed 's/Date:./&'"${DATE}"'/' | \ - ${VER} > ${QTIP_CSS}; + @@echo -n "Minifying CSS... " + @@${CSS_MINIFIER} ${QTIP_CSS} --type css -o ${QTIP_CSS_MIN} + @@echo "Success!" -lint: ${QTIP} +lint: qtip @@if test ! -z ${JS_ENGINE}; then \ - echo "Checking jQuery against JSLint..."; \ - ${JS_ENGINE} $(BUILD_DIR)/jslint-check.js; \ + echo -n "Checking against JSLint... "; \ + ${JS_LINT}; \ else \ echo "You must have NodeJS installed in order to test qTip against JSLint."; \ fi clean: - @@echo "Removing distribution directory:" ${DIST_DIR} + @@echo "Removing distribution directory:" ${DIST_DIR} "\n" @@rm -rf ${DIST_DIR} diff --git a/README.md b/README.md index 4f9d12c5..81e7d032 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Pre-compiled scripts -------------------- -If you're not interested in compiling your own version of qTip2, you can grab the pre-compiled scripts from the +If you're not interested in compiling your own version of qTip2, you can grab the pre-compiled scripts from the [dist](http://github.com/Craga89/qTip2/tree/master/dist/) directory and get started quickly. If you want more options over what plugins are included in your build, take a look below. @@ -45,8 +45,7 @@ You can also create each individually using these commands: make qtip # Build non-minified qTip2 source make css # Build CSS files - make min # Build minified JS and CSS - make pack # Build minified and packed qTip2 JS (smallest filesize!) + make min # Build minified JS and CSS (Smaller filesize) To build and test the source code against JSLint type this: @@ -57,6 +56,13 @@ Finally, you can remove all the built files using the command: make clean +Submitting a pull request to the qTip2 repository +------------------------------------------------- +If you're planning on submitting a pull request to the GitHub repository, you'll need to make sure your local git repo rebuilds the `dist/` directory on each commit. To do this, +simply copy the `hooks` folder into the `.git` directory. Inside here is a pre-commit script that will run `make` for you prior to each commit call. Make sure to make MAke installed as +detailed above + + Building to a different directory --------------------------------- If you want to build qTip2 to a directory that is different from the default location, you can specify the PREFIX @@ -67,21 +73,21 @@ With this example, the output files would end up in `/home/craig/qtip/dist/`. Choosing which features are included in your qTip2 build -------------------------------------------------------- -By default qTip2 is built with all plugins built into the file. You can see an example of this in the [dist](http://github.com/Craga89/qTip2/tree/master/dist/) -directory files. If you want more control over what plugins are included, you can do so by adding some extra parameters to your build commands. +By default qTip2 is built with all plugins enabled. You can see an example of this in the [dist](http://github.com/Craga89/qTip2/tree/master/dist/jquery.qtip.js) file. +If you want more control over what plugins are included, you can do so by adding some extra parameters to your build commands. For example, if you plan on using only the tips plugin, you'd specify the plugins variable as so: - make PLUGINS="src/tips.js" [command] - + make PLUGINS="tips" [command] + Notice the only thing that was added was the PLUGINS parameter. This tells the compiler which files to include in the final qTip2 build. You can specify multiple -plugins by separating them wit a space: +plugins by separating them with a space: + + make PLUGINS="tips ajax modal" [command] - make PLUGINS="src/tips.js src/ajax.js src/modal.js" [command] - By default all plugins are included in the build, so the regular `[make all]` command is actually equivilent to: - make PLUGINS="src/ajax.js src/tips.js src/imagemap.js src/svg.js src/modal.js src/bgiframe.js" [command] + make PLUGINS="ajax tips imagemap svg modal bgiframe" [command] * Note: The above was correct at the time of writing. Subsequent revisions may change file names or add new plugins, so checkout the Makefile for a full up-to-date list of all plugins* diff --git a/build/jslint-check.js b/build/jslint-check.js index c08f6f64..05cfad25 100755 --- a/build/jslint-check.js +++ b/build/jslint-check.js @@ -31,5 +31,5 @@ if ( found > 0 ) { print( "\n" + found + " Error(s) found.\n" ); } else { - print( "JSLint check passed.\n" ); + print( "Success!\n" ); } diff --git a/build/packer.js b/build/packer.js deleted file mode 100644 index 432b9660..00000000 --- a/build/packer.js +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env rhino -/* - * script to compress a javascript file. - * - * Usage: ./packer.js infile.js outfile.js - * - * Derived from the WSH version of 'packer' by - * Dean Edwards (http://dean.edwards.name/packer/) - * - * Converted to run within a shell and rhino environment - * by David McNab - * - * Requirements: you need rhino and java installed - * - * Note - for dojo users, the compressed script gets a couple of paths - * wrong - if you symlink your js/dojo/src directory to src in the toplevel - * server directory, all should be fine. - * - * For me, it's compressing a >200k dojo.js file to about 117k - * - * Released under the original author's Creative Commons license: - * http://creativecommons.org/licenses/by/2.5/ - */ - -// uplift shell args -var argv = new Array() -for (i in arguments) { - argv.push(arguments[i]); -} - -// get the input file, toss it into the big ugly black box, -// and save the output - -function main() { - - if (argv.length < 2) { - print("usage: infile.js outfile.js"); - } else { - inpath = argv[0]; - outpath = argv[1]; - - codeRaw = readFile(inpath); - codeComp = pack(codeRaw, 62, 1, 0); - writer = java.io.FileWriter(outpath); - writer.write(codeComp); - writer.close(); - } -} - -// what follows is Dean Edward's compressed/obfuscated implementation -// of his compressor/obfuscator - -// don't look below this point if your value your sanity!! - - - - - - - - - - - - - - - -function ICommon(that){if(that!=null){that.inherit=Common.prototype.inherit;that.specialize=Common.prototype.specialize}return that};ICommon.specialize=function(p,c){if(!p)p={};if(!c)c=p.constructor;if(c=={}.constructor)c=new Function("this.inherit()");c.valueOf=new Function("return this");c.valueOf.prototype=new this.valueOf;c.valueOf.prototype.specialize(p);c.prototype=new c.valueOf;c.valueOf.prototype.constructor=c.prototype.constructor=c;c.ancestor=this;c.specialize=arguments.callee;c.ancestorOf=this.ancestorOf;return c};ICommon.valueOf=new Function("return this");ICommon.valueOf.prototype={constructor:ICommon,inherit:function(){return arguments.callee.caller.ancestor.apply(this,arguments)},specialize:function(that){if(this==this.constructor.prototype&&this.constructor.specialize){return this.constructor.valueOf.prototype.specialize(that)}for(var i in that){switch(i){case"constructor":case"toString":case"valueOf":continue}if(typeof that[i]=="function"&&that[i]!=this[i]){that[i].ancestor=this[i]}this[i]=that[i]}if(that.toString!=this.toString&&that.toString!={}.toString){that.toString.ancestor=this.toString;this.toString=that.toString}return this}};function Common(){};this.Common=ICommon.specialize({constructor:Common,toString:function(){return"[common "+(this.constructor.className||"Object")+"]"},instanceOf:function(klass){return this.constructor==klass||klass.ancestorOf(this.constructor)}});Common.className="Common";Common.ancestor=null;Common.ancestorOf=function(klass){while(klass&&klass.ancestor!=this)klass=klass.ancestor;return Boolean(klass)};Common.valueOf.ancestor=ICommon;function ParseMaster(){var E=0,R=1,L=2;var G=/\(/g,S=/\$\d/,I=/^\$\d+$/,T=/(['"])\1\+(.*)\+\1\1$/,ES=/\\./g,Q=/'/,DE=/\x01[^\x01]*\x01/g;var self=this;this.add=function(e,r){if(!r)r="";var l=(_14(String(e)).match(G)||"").length+1;if(S.test(r)){if(I.test(r)){r=parseInt(r.slice(1))-1}else{var i=l;var q=Q.test(_14(r))?'"':"'";while(i)r=r.split("$"+i--).join(q+"+a[o+"+i+"]+"+q);r=new Function("a,o","return"+q+r.replace(T,"$1")+q)}}_31(e||"/^$/",r,l)};this.exec=function(s){_3.length=0;return _28(_5(s,this.escapeChar).replace(new RegExp(_1,this.ignoreCase?"gi":"g"),_29),this.escapeChar).replace(DE,"")};this.reset=function(){_1.length=0};var _3=[];var _1=[];var _30=function(){return"("+String(this[E]).slice(1,-1)+")"};_1.toString=function(){return this.join("|")};function _31(){arguments.toString=_30;_1[_1.length]=arguments}function _29(){if(!arguments[0])return"";var i=1,j=0,p;while(p=_1[j++]){if(arguments[i]){var r=p[R];switch(typeof r){case"function":return r(arguments,i);case"number":return arguments[r+i]}var d=(arguments[i].indexOf(self.escapeChar)==-1)?"":"\x01"+arguments[i]+"\x01";return d+r}else i+=p[L]}};function _5(s,e){return e?s.replace(new RegExp("\\"+e+"(.)","g"),function(m,c){_3[_3.length]=c;return e}):s};function _28(s,e){var i=0;return e?s.replace(new RegExp("\\"+e,"g"),function(){return e+(_3[i++]||"")}):s};function _14(s){return s.replace(ES,"")}};ParseMaster.prototype={constructor:ParseMaster,ignoreCase:false,escapeChar:""};function pack(_7,_0,_2,_8){var I="$1";_7+="\n";_0=Math.min(parseInt(_0),95);function _15(s){var i,p;for(i=0;(p=_6[i]);i++){s=p(s)}return s};var _25=function(p,a,c,k,e,d){while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p};var _26=function(){if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1}};var _6=[];function _4(p){_6[_6.length]=p};function _18(s){var p=new ParseMaster;p.escapeChar="\\";p.add(/'[^'\n\r]*'/,I);p.add(/"[^"\n\r]*"/,I);p.add(/\/\/[^\n\r]*[\n\r]/," ");p.add(/\/\*[^*]*\*+([^\/][^*]*\*+)*\//," ");p.add(/\s+(\/[^\/\n\r\*][^\/\n\r]*\/g?i?)/,"$2");p.add(/[^\w\x24\/'"*)\?:]\/[^\/\n\r\*][^\/\n\r]*\/g?i?/,I);if(_8)p.add(/;;;[^\n\r]+[\n\r]/);p.add(/\(;;\)/,I);p.add(/;+\s*([};])/,"$2");s=p.exec(s);p.add(/(\b|\x24)\s+(\b|\x24)/,"$2 $3");p.add(/([+\-])\s+([+\-])/,"$2 $3");p.add(/\s+/,"");return p.exec(s)};function _17(s){var p=new ParseMaster;p.add(/((\x24+)([a-zA-Z_]+))(\d*)/,function(m,o){var l=m[o+2].length;var s=l-Math.max(l-m[o+3].length,0);return m[o+1].substr(s,l)+m[o+4]});var r=/\b_[A-Za-z\d]\w*/;var k=_13(s,_9(r),_21);var e=k.e;p.add(r,function(m,o){return e[m[o]]});return p.exec(s)};function _16(s){if(_0>62)s=_20(s);var p=new ParseMaster;var e=_12(_0);var r=(_0>62)?/\w\w+/ :/\w+/;k=_13(s,_9(r),e);var e=k.e;p.add(r,function(m,o){return e[m[o]]});return s&&_27(p.exec(s),k)};function _13(s,r,e){var a=s.match(r);var so=[];var en={};var pr={};if(a){var u=[];var p={};var v={};var c={};var i=a.length,j=0,w;do{w="$"+a[--i];if(!c[w]){c[w]=0;u[j]=w;p["$"+(v[j]=e(j))]=j++}c[w]++}while(i);i=u.length;do{w=u[--i];if(p[w]!=null){so[p[w]]=w.slice(1);pr[p[w]]=true;c[w]=0}}while(i);u.sort(function(m1,m2){return c[m2]-c[m1]});j=0;do{if(so[i]==null)so[i]=u[j++].slice(1);en[so[i]]=v[i]}while(++i62?_11:_12(a);e=String(e).replace(/_0/g,"a").replace(/arguments\.callee/g,"e");var i="c"+(a>10?".toString(a)":"");if(_2){var d=_19(_26);if(_0>62)d=d.replace(/\\\\w/g,"[\\xa1-\\xff]");else if(a<36)d=d.replace(E,i);if(!c)d=d.replace(_10("(c)\\s*=\\s*1"),"$1=0")}var u=String(_25);if(_2){u=u.replace(/\{/,"{"+d+";")}u=u.replace(/"/g,"'");if(_0>62){u=u.replace(/'\\\\b'\s*\+|\+\s*'\\\\b'/g,"")}if(a>36||_0>62||_2){u=u.replace(/\{/,"{e="+e+";")}else{u=u.replace(E,i)}u=pack(u,0,false,true);var p=[p,a,c,k];if(_2){p=p.concat(0,"{}")}return"eval("+u+"("+p+"))\n"};function _12(a){return a>10?a>36?a>62?_11:_22:_23:_24};var _24=function(c){return c};var _23=function(c){return c.toString(36)};var _22=function(c){return(c<_0?'':arguments.callee(parseInt(c/_0)))+((c=c%_0)>35?String.fromCharCode(c+29):c.toString(36))};var _11=function(c){return(c<_0?'':arguments.callee(c/_0))+String.fromCharCode(c%_0+161)};var _21=function(c){return"_"+c};function _5(s){return s.replace(/([\\'])/g,"\\$1")};function _20(s){return s.replace(/[\xa1-\xff]/g,function(m){return"\\x"+m.charCodeAt(0).toString(16)})};function _10(s,f){return new RegExp(s.replace(/\$/g,"\\$"),f)};function _19(f){with(String(f))return slice(indexOf("{")+1,lastIndexOf("}"))};function _9(r){return new RegExp(String(r).slice(1,-1),"g")};_4(_18);if(_8)_4(_17);if(_0)_4(_16);return _15(_7)}; - -var VERSION = '1.0.0'; -var AUTHOR = 'Rob Seiler'; /* seiler@elr.com.au */ - -/* Show help if needed - eg 0 command line arguments */ -function JS_Help () { - WScript.Echo ('Compress and encode a Javascript source file using Dean Edwards "Packer"'); - WScript.Echo (' Version : ' + VERSION); - WScript.Echo (' Syntax : program sourcefile [_encoding] [_fastDecode] [_specialChars]\n'); -} - -/* Main program: Get arguments; read input file; output packed string */ -function oldmain() { - var params = []; - params = JS_getArgs(); - params[1] = (typeof(params[1]) == 'undefined') ? 62 : params[1]; // -dean : changed defaults - params[2] = (typeof(params[2]) == 'undefined') ? 1 : params[2]; - params[3] = (typeof(params[3]) == 'undefined') ? 0 : params[3]; - if (params[0] > '') { - var $script = JS_readFile(params[0]); - if ($script > '') { - $script = pack($script, params[1], params[2], params[3]); /* Returns the Dean Edwards "packed" string */ - WScript.Echo ($script); - } - else {JS_Help();} - } - else {JS_Help();} -} - -main() - diff --git a/dist/comment b/dist/comment new file mode 100644 index 00000000..aa065bfa --- /dev/null +++ b/dist/comment @@ -0,0 +1 @@ +Changed old modal selector to new filter \ No newline at end of file diff --git a/dist/jquery.qtip.basic.js b/dist/jquery.qtip.basic.js index 234f7d3b..3aaeda8e 100644 --- a/dist/jquery.qtip.basic.js +++ b/dist/jquery.qtip.basic.js @@ -9,7 +9,7 @@ * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License * -* Date: Thu Aug 18 20:10:43 2011 +0100 +* Date: Fri Aug 19 08:14:39 2011 +0100 */ /*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */ diff --git a/dist/jquery.qtip.css b/dist/jquery.qtip.css index 093d69c8..ce5985bb 100644 --- a/dist/jquery.qtip.css +++ b/dist/jquery.qtip.css @@ -9,7 +9,7 @@ * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License * -* Date: Thu Aug 18 20:10:43 2011 +0100 +* Date: Fri Aug 19 08:14:39 2011 +0100 */ /* Core qTip styles */ @@ -138,6 +138,29 @@ color: #111; } +/* Modal plugin */ +#qtip-overlay{ + position: fixed; + left: -10000em; + top: -10000em; +} + + /* Applied to modals with show.modal.blur set to true */ + #qtip-overlay.blurs{ cursor: pointer; } + + /* Change opacity of overlay here */ + #qtip-overlay div{ + position: absolute; + left: 0; top: 0; + width: 100%; height: 100%; + + background-color: black; + + opacity: 0.7; + filter:alpha(opacity=70); + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; + } + /* Tips plugin */ .ui-tooltip .ui-tooltip-tip{ margin: 0 auto; @@ -163,29 +186,6 @@ .ui-tooltip .ui-tooltip-tip canvas{ top: 0; left: 0; } -/* Modal plugin */ -#qtip-overlay{ - position: fixed; - left: -10000em; - top: -10000em; -} - - /* Applied to modals with show.modal.blur set to true */ - #qtip-overlay.blurs{ cursor: pointer; } - - /* Change opacity of overlay here */ - #qtip-overlay div{ - position: absolute; - left: 0; top: 0; - width: 100%; height: 100%; - - background-color: black; - - opacity: 0.7; - filter:alpha(opacity=70); - -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; - } - /*! Light tooltip style */ .ui-tooltip-light .ui-tooltip-titlebar, .ui-tooltip-light .ui-tooltip-content{ diff --git a/dist/jquery.qtip.js b/dist/jquery.qtip.js index 95fdcda0..b70b270f 100644 --- a/dist/jquery.qtip.js +++ b/dist/jquery.qtip.js @@ -9,7 +9,7 @@ * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License * -* Date: Thu Aug 18 20:10:43 2011 +0100 +* Date: Fri Aug 19 08:14:39 2011 +0100 */ /*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */ @@ -2049,717 +2049,478 @@ $.extend(TRUE, QTIP.defaults, { } }); -// Tip coordinates calculator -function calculateTip(corner, width, height) -{ - var width2 = Math.ceil(width / 2), height2 = Math.ceil(height / 2), - - // Define tip coordinates in terms of height and width values - tips = { - bottomright: [[0,0], [width,height], [width,0]], - bottomleft: [[0,0], [width,0], [0,height]], - topright: [[0,height], [width,0], [width,height]], - topleft: [[0,0], [0,height], [width,height]], - topcenter: [[0,height], [width2,0], [width,height]], - bottomcenter: [[0,0], [width,0], [width2,height]], - rightcenter: [[0,0], [width,height2], [0,height]], - leftcenter: [[width,0], [width,height], [0,height2]] - }; - - // Set common side shapes - tips.lefttop = tips.bottomright; tips.righttop = tips.bottomleft; - tips.leftbottom = tips.topright; tips.rightbottom = tips.topleft; - - return tips[ corner.string() ]; -} - - -function Tip(qTip, command) +/* + * BGIFrame adaption (http://plugins.jquery.com/project/bgiframe) + * Special thanks to Brandon Aaron + */ +function BGIFrame(api) { var self = this, - opts = qTip.options.style.tip, - elems = qTip.elements, + elems = api.elements, tooltip = elems.tooltip, - cache = { - top: 0, - left: 0, - corner: '' - }, - size = { - width: opts.width, - height: opts.height - }, - color = { }, - border = opts.border || 0, - namespace = '.qtip-tip', - hasCanvas = !!($('')[0] || {}).getContext; - - self.corner = NULL; - self.mimic = NULL; - self.border = border; - self.offset = opts.offset; - self.size = size; + namespace = '.bgiframe-' + api.id; - // Add new option checks for the plugin - qTip.checks.tip = { - '^position.my|style.tip.(corner|mimic|border)$': function() { - // Make sure a tip can be drawn - if(!self.init()) { - self.destroy(); - } + $.extend(self, { + init: function() + { + // Create the BGIFrame element + elems.bgiframe = $(''); - // Reposition the tooltip - qTip.reposition(); - }, - '^style.tip.(height|width)$': function() { - // Re-set dimensions and redraw the tip - size = { - width: opts.width, - height: opts.height - }; - self.create(); - self.update(); + // Append the new element to the tooltip + elems.bgiframe.appendTo(tooltip); - // Reposition the tooltip - qTip.reposition(); + // Update BGIFrame on tooltip move + tooltip.bind('tooltipmove'+namespace, self.adjust); }, - '^content.title.text|style.(classes|widget)$': function() { - if(elems.tip) { - self.update(); - } - } - }; - - function reposition(event, api, pos, viewport) { - if(!elems.tip) { return; } - - var newCorner = $.extend({}, self.corner), - adjust = pos.adjusted, - method = qTip.options.position.adjust.method.split(' '), - horizontal = method[0], - vertical = method[1] || method[0], - shift = { left: FALSE, top: FALSE, x: 0, y: 0 }, - offset, css = {}, props; - - // Make sure our tip position isn't fixed e.g. doesn't adjust with viewport - if(self.corner.fixed !== TRUE) { - // Horizontal - Shift or flip method - if(horizontal === 'shift' && newCorner.precedance === 'x' && adjust.left && newCorner.y !== 'center') { - newCorner.precedance = newCorner.precedance === 'x' ? 'y' : 'x'; - } - else if(horizontal === 'flip' && adjust.left){ - newCorner.x = newCorner.x === 'center' ? (adjust.left > 0 ? 'left' : 'right') : (newCorner.x === 'left' ? 'right' : 'left'); - } - - // Vertical - Shift or flip method - if(vertical === 'shift' && newCorner.precedance === 'y' && adjust.top && newCorner.x !== 'center') { - newCorner.precedance = newCorner.precedance === 'y' ? 'x' : 'y'; - } - else if(vertical === 'flip' && adjust.top) { - newCorner.y = newCorner.y === 'center' ? (adjust.top > 0 ? 'top' : 'bottom') : (newCorner.y === 'top' ? 'bottom' : 'top'); - } - // Update and redraw the tip if needed (check cached details of last drawn tip) - if(newCorner.string() !== cache.corner && (cache.top !== adjust.top || cache.left !== adjust.left)) { - self.update(newCorner, FALSE); - } - } + adjust: function() + { + var dimensions = api.get('dimensions'), // Determine current tooltip dimensions + plugin = api.plugins.tip, + tip = elems.tip, + tipAdjust, offset; - // Setup tip offset properties - offset = self.position(newCorner, adjust); - if(offset.right !== undefined) { offset.left = -offset.right; } - if(offset.bottom !== undefined) { offset.top = -offset.bottom; } - offset.user = Math.max(0, opts.offset); + // Adjust border offset + offset = parseInt(tooltip.css('border-left-width'), 10) || 0; + offset = { left: -offset, top: -offset }; - // Viewport "shift" specific adjustments - if(shift.left = (horizontal === 'shift' && !!adjust.left)) { - if(newCorner.x === 'center') { - css['margin-left'] = shift.x = offset['margin-left'] - adjust.left; + // Adjust for tips plugin + if(plugin && tip) { + tipAdjust = (plugin.corner.precedance === 'x') ? ['width', 'left'] : ['height', 'top']; + offset[ tipAdjust[1] ] -= tip[ tipAdjust[0] ](); } - else { - props = offset.right !== undefined ? - [ adjust.left, -offset.left ] : [ -adjust.left, offset.left ]; - if( (shift.x = Math.max(props[0], props[1])) > props[0] ) { - pos.left -= adjust.left; - shift.left = FALSE; - } - - css[ offset.right !== undefined ? 'right' : 'left' ] = shift.x; - } - } - if(shift.top = (vertical === 'shift' && !!adjust.top)) { - if(newCorner.y === 'center') { - css['margin-top'] = shift.y = offset['margin-top'] - adjust.top; - } - else { - props = offset.bottom !== undefined ? - [ adjust.top, -offset.top ] : [ -adjust.top, offset.top ]; + // Update bgiframe + elems.bgiframe.css(offset).css(dimensions); + }, - if( (shift.y = Math.max(props[0], props[1])) > props[0] ) { - pos.top -= adjust.top; - shift.top = FALSE; - } + destroy: function() + { + // Remove iframe + elems.bgiframe.remove(); - css[ offset.bottom !== undefined ? 'bottom' : 'top' ] = shift.y; - } + // Remove bound events + tooltip.unbind(namespace); } + }); - /* - * If the tip is adjusted in both dimensions, or in a - * direction that would cause it to be anywhere but the - * outer border, hide it! - */ - elems.tip.css(css).toggle( - !((shift.x && shift.y) || (newCorner.x === 'center' && shift.y) || (newCorner.y === 'center' && shift.x)) - ); - - // Adjust position to accomodate tip dimensions - pos.left -= offset.left.charAt ? offset.user : horizontal !== 'shift' || shift.top || !shift.left && !shift.top ? offset.left : 0; - pos.top -= offset.top.charAt ? offset.user : vertical !== 'shift' || shift.left || !shift.left && !shift.top ? offset.top : 0; - - // Cache details - cache.left = adjust.left; cache.top = adjust.top; - cache.corner = newCorner.string(); - } - - /* border width calculator */ - function borderWidth(corner, side, backup) { - side = !side ? corner[corner.precedance] : side; - - var isFluid = tooltip.hasClass(fluidClass), - isTitleTop = elems.titlebar && corner.y === 'top', - elem = isTitleTop ? elems.titlebar : elems.content, - css = 'border-' + side + '-width', - val; - - // Grab the border-width value (add fluid class if needed) - tooltip.addClass(fluidClass); - val = parseInt(elem.css(css), 10); - val = (backup ? val || parseInt(tooltip.css(css), 10) : val) || 0; - tooltip.toggleClass(fluidClass, isFluid); - - return val; - } - - function borderRadius(corner) { - var isTitleTop = elems.titlebar && corner.y === 'top', - elem = isTitleTop ? elems.titlebar : elems.content, - moz = $.browser.mozilla, - prefix = moz ? '-moz-' : $.browser.webkit ? '-webkit-' : '', - side = corner.y + (moz ? '' : '-') + corner.x, - css = prefix + (moz ? 'border-radius-' + side : 'border-' + side + '-radius'); - - return parseInt(elem.css(css), 10) || parseInt(tooltip.css(css), 10) || 0; - } - - function calculateSize(corner) { - var y = corner.precedance === 'y', - width = size [ y ? 'width' : 'height' ], - height = size [ y ? 'height' : 'width' ], - isCenter = corner.string().indexOf('center') > -1, - base = width * (isCenter ? 0.5 : 1), - pow = Math.pow, - round = Math.round, - bigHyp, ratio, result, - - smallHyp = Math.sqrt( pow(base, 2) + pow(height, 2) ), - - hyp = [ - (border / base) * smallHyp, (border / height) * smallHyp - ]; - hyp[2] = Math.sqrt( pow(hyp[0], 2) - pow(border, 2) ); - hyp[3] = Math.sqrt( pow(hyp[1], 2) - pow(border, 2) ); - - bigHyp = smallHyp + hyp[2] + hyp[3] + (isCenter ? 0 : hyp[0]); - ratio = bigHyp / smallHyp; + self.init(); +} - result = [ round(ratio * height), round(ratio * width) ]; - return { height: result[ y ? 0 : 1 ], width: result[ y ? 1 : 0 ] }; +PLUGINS.bgiframe = function(api) +{ + var browser = $.browser, + self = api.plugins.bgiframe; + + // Proceed only if the browser is IE6 and offending elements are present + if($('select, object').length < 1 || !(browser.msie && browser.version.charAt(0) === '6')) { + return FALSE; } - $.extend(self, { - init: function() - { - var enabled = self.detectCorner() && (hasCanvas || $.browser.msie); - - // Determine tip corner and type - if(enabled) { - // Create a new tip and draw it - self.create(); - self.update(); - - // Bind update events - tooltip.unbind(namespace).bind('tooltipmove'+namespace, reposition); - } - - return enabled; - }, + return 'object' === typeof self ? self : (api.plugins.bgiframe = new BGIFrame(api)); +}; - detectCorner: function() - { - var corner = opts.corner, - posOptions = qTip.options.position, - at = posOptions.at, - my = posOptions.my.string ? posOptions.my.string() : posOptions.my; +// Plugin needs to be initialized on render +PLUGINS.bgiframe.initialize = 'render'; - // Detect corner and mimic properties - if(corner === FALSE || (my === FALSE && at === FALSE)) { - return FALSE; - } - else { - if(corner === TRUE) { - self.corner = new PLUGINS.Corner(my); - } - else if(!corner.string) { - self.corner = new PLUGINS.Corner(corner); - self.corner.fixed = TRUE; - } - } +PLUGINS.imagemap = function(area, corner) +{ + if(!area.jquery) { area = $(area); } - return self.corner.string() !== 'centercenter'; + var shape = area.attr('shape').toLowerCase(), + baseCoords = area.attr('coords').split(','), + coords = [], + image = $('img[usemap="#'+area.parent('map').attr('name')+'"]'), + imageOffset = image.offset(), + result = { + width: 0, height: 0, + offset: { top: 1e10, right: 0, bottom: 0, left: 1e10 } }, + i = 0, next = 0; - detectColours: function() { - var i, fill, border, - tip = elems.tip.css({ backgroundColor: '', border: '' }), - corner = self.corner, - precedance = corner[ corner.precedance ], + // POLY area coordinate calculator + // Special thanks to Ed Cradock for helping out with this. + // Uses a binary search algorithm to find suitable coordinates. + function polyCoordinates(result, coords) + { + var i = 0, + compareX = 1, compareY = 1, + realX = 0, realY = 0, + newWidth = result.width, + newHeight = result.height; - borderSide = 'border-' + precedance + '-color', - borderSideCamel = 'border' + precedance.charAt(0) + precedance.substr(1) + 'Color', + // Use a binary search algorithm to locate most suitable coordinate (hopefully) + while(newWidth > 0 && newHeight > 0 && compareX > 0 && compareY > 0) + { + newWidth = Math.floor(newWidth / 2); + newHeight = Math.floor(newHeight / 2); - invalid = /rgba?\(0, 0, 0(, 0)?\)|transparent/i, - backgroundColor = 'background-color', - transparent = 'transparent', + if(corner.x === 'left'){ compareX = newWidth; } + else if(corner.x === 'right'){ compareX = result.width - newWidth; } + else{ compareX += Math.floor(newWidth / 2); } - bodyBorder = $(document.body).css('color'), - contentColour = qTip.elements.content.css('color'), + if(corner.y === 'top'){ compareY = newHeight; } + else if(corner.y === 'bottom'){ compareY = result.height - newHeight; } + else{ compareY += Math.floor(newHeight / 2); } - useTitle = elems.titlebar && (corner.y === 'top' || (corner.y === 'center' && tip.position().top + (size.height / 2) + opts.offset < elems.titlebar.outerHeight(1))), - colorElem = useTitle ? elems.titlebar : elems.content; + i = coords.length; while(i--) + { + if(coords.length < 2){ break; } - // Apply the fluid class so we can see our CSS values properly - tooltip.addClass(fluidClass); + realX = coords[i][0] - result.offset.left; + realY = coords[i][1] - result.offset.top; - // Detect tip colours from CSS styles - color.fill = fill = tip.css(backgroundColor); - color.border = border = tip[0].style[ borderSideCamel ] || tip.css(borderSide) || tooltip.css(borderSide); - - // Make sure colours are valid - if(!fill || invalid.test(fill)) { - color.fill = colorElem.css(backgroundColor) || transparent; - if(invalid.test(color.fill)) { - color.fill = tooltip.css(backgroundColor) || fill; - } - } - if(!border || invalid.test(border) || border === bodyBorder) { - color.border = colorElem.css(borderSide) || transparent; - if(invalid.test(color.border) || color.border === contentColour) { - color.border = border; + if((corner.x === 'left' && realX >= compareX) || + (corner.x === 'right' && realX <= compareX) || + (corner.x === 'center' && (realX < compareX || realX > (result.width - compareX))) || + (corner.y === 'top' && realY >= compareY) || + (corner.y === 'bottom' && realY <= compareY) || + (corner.y === 'center' && (realY < compareY || realY > (result.height - compareY)))) { + coords.splice(i, 1); } } + } - // Reset background and border colours - $('*', tip).add(tip).css(backgroundColor, transparent).css('border', ''); + return { left: coords[0][0], top: coords[0][1] }; + } - // Remove fluid class - tooltip.removeClass(fluidClass); - }, + // Make sure we account for padding and borders on the image + imageOffset.left += Math.ceil((image.outerWidth() - image.width()) / 2); + imageOffset.top += Math.ceil((image.outerHeight() - image.height()) / 2); - create: function() + // Parse coordinates into proper array + if(shape === 'poly') { + i = baseCoords.length; while(i--) { - var width = size.width, - height = size.height, - vml; - - // Remove previous tip element if present - if(elems.tip) { elems.tip.remove(); } - - // Create tip element and prepend to the tooltip - elems.tip = $('
', { 'class': 'ui-tooltip-tip' }).css({ width: width, height: height }).prependTo(tooltip); + next = [ parseInt(baseCoords[--i], 10), parseInt(baseCoords[i+1], 10) ]; - // Create tip drawing element(s) - if(hasCanvas) { - // save() as soon as we create the canvas element so FF2 doesn't bork on our first restore()! - $('').appendTo(elems.tip)[0].getContext('2d').save(); - } - else { - vml = ''; - elems.tip.html(vml + vml); - } - }, + if(next[0] > result.offset.right){ result.offset.right = next[0]; } + if(next[0] < result.offset.left){ result.offset.left = next[0]; } + if(next[1] > result.offset.bottom){ result.offset.bottom = next[1]; } + if(next[1] < result.offset.top){ result.offset.top = next[1]; } - update: function(corner, position) - { - var tip = elems.tip, - inner = tip.children(), - width = size.width, - height = size.height, - regular = 'px solid ', - transparent = 'px dashed transparent', // Dashed IE6 border-transparency hack. Awesome! - mimic = opts.mimic, - round = Math.round, - precedance, context, coords, translate, newSize; + coords.push(next); + } + } + else { + coords = $.map(baseCoords, function(coord){ return parseInt(coord, 10); }); + } - // Re-determine tip if not already set - if(!corner) { corner = self.corner; } + // Calculate details + switch(shape) + { + case 'rect': + result = { + width: Math.abs(coords[2] - coords[0]), + height: Math.abs(coords[3] - coords[1]), + offset: { left: coords[0], top: coords[1] } + }; + break; - // Use corner property if we detect an invalid mimic value - if(mimic === FALSE) { mimic = corner; } + case 'circle': + result = { + width: coords[2] + 2, + height: coords[2] + 2, + offset: { left: coords[0], top: coords[1] } + }; + break; - // Otherwise inherit mimic properties from the corner object as necessary - else { - mimic = new PLUGINS.Corner(mimic); - mimic.precedance = corner.precedance; + case 'poly': + $.extend(result, { + width: Math.abs(result.offset.right - result.offset.left), + height: Math.abs(result.offset.bottom - result.offset.top) + }); - if(mimic.x === 'inherit') { mimic.x = corner.x; } - else if(mimic.y === 'inherit') { mimic.y = corner.y; } - else if(mimic.x === mimic.y) { - mimic[ corner.precedance ] = corner[ corner.precedance ]; - } + if(corner.string() === 'centercenter') { + result.offset = { + left: result.offset.left + (result.width / 2), + top: result.offset.top + (result.height / 2) + }; + } + else { + result.offset = polyCoordinates(result, coords.slice()); } - precedance = mimic.precedance; - // Update our colours - self.detectColours(); + result.width = result.height = 0; + break; + } - // Detect border width, taking into account colours - if(color.border !== 'transparent' && color.border !== '#123456') { - // Grab border width - border = borderWidth(corner, NULL, TRUE); + // Add image position to offset coordinates + result.offset.left += imageOffset.left; + result.offset.top += imageOffset.top; - // If border width isn't zero, use border color as fill (1.0 style tips) - if(opts.border === 0 && border > 0) { color.fill = color.border; } + return result; +}; - // Set border width (use detected border width if opts.border is true) - self.border = border = opts.border !== TRUE ? opts.border : border; - } +function Modal(api) +{ + var self = this, + options = api.options.show.modal, + elems = api.elements, + tooltip = elems.tooltip, + overlaySelector = '#qtip-overlay', + globalNamespace = '.qtipmodal', + namespace = globalNamespace + api.id, + attr = 'is-modal-qtip', + docBody = $(document.body), + overlay; - // Border colour was invalid, set border to zero - else { self.border = border = 0; } + // Setup option set checks + api.checks.modal = { + '^show.modal.(on|blur)$': function() { + // Initialise + self.init(); + + // Show the modal if not visible already and tooltip is visible + elems.overlay.toggle( tooltip.is(':visible') ); + } + }; - // Calculate coordinates - coords = calculateTip(mimic, width , height); + $.extend(self, { + init: function() + { + // If modal is disabled... return + if(!options.on) { return self; } - // Determine tip size - self.size = newSize = calculateSize(corner); - tip.css(newSize); + // Create the overlay if needed + overlay = self.create(); - // Calculate tip translation - if(corner.precedance === 'y') { - translate = [ - round(mimic.x === 'left' ? border : mimic.x === 'right' ? newSize.width - width - border : (newSize.width - width) / 2), - round(mimic.y === 'top' ? newSize.height - height : 0) - ]; - } - else { - translate = [ - round(mimic.x === 'left' ? newSize.width - width : 0), - round(mimic.y === 'top' ? border : mimic.y === 'bottom' ? newSize.height - height - border : (newSize.height - height) / 2) - ]; - } + // Add unique attribute so we can grab modal tooltips easily via a selector + tooltip.attr(attr, TRUE) - // Canvas drawing implementation - if(hasCanvas) { - // Set the canvas size using calculated size - inner.attr(newSize); - - // Grab canvas context and clear/save it - context = inner[0].getContext('2d'); - context.restore(); context.save(); - context.clearRect(0,0,3000,3000); - - // Translate origin - context.translate(translate[0], translate[1]); + .css('z-index', PLUGINS.modal.zindex + $(selector+'['+attr+']').length) + + // Remove previous bound events in globalNamespace + .unbind(globalNamespace).unbind(namespace) + + // Apply our show/hide/focus modal events + .bind('tooltipshow'+globalNamespace+' tooltiphide'+globalNamespace, function(event, api, duration) { + var oEvent = event.originalEvent; - // Draw the tip - context.beginPath(); - context.moveTo(coords[0][0], coords[0][1]); - context.lineTo(coords[1][0], coords[1][1]); - context.lineTo(coords[2][0], coords[2][1]); - context.closePath(); - context.fillStyle = color.fill; - context.strokeStyle = color.border; - context.lineWidth = border * 2; - context.lineJoin = 'miter'; - context.miterLimit = 100; - if(border) { context.stroke(); } - context.fill(); - } + // Make sure mouseout doesn't trigger a hide when showing the modal and mousing onto backdrop + if(oEvent && event.type === 'tooltiphide' && /mouse(leave|enter)/.test(oEvent.type) && $(oEvent.relatedTarget).closest(overlay[0]).length) { + event.preventDefault(); + } + else { + self[ event.type.replace('tooltip', '') ](event, duration); + } + }) - // VML (IE Proprietary implementation) - else { - // Setup coordinates string - coords = 'm' + coords[0][0] + ',' + coords[0][1] + ' l' + coords[1][0] + - ',' + coords[1][1] + ' ' + coords[2][0] + ',' + coords[2][1] + ' xe'; + // Adjust modal z-index on tooltip focus + .bind('tooltipfocus'+globalNamespace, function(event) { + // If focus was cancelled before it reearch us, don't do anything + if(event.isDefaultPrevented()) { return; } - // Setup VML-specific offset for pixel-perfection - translate[2] = border && /^(r|b)/i.test(corner.string()) ? - parseFloat($.browser.version, 10) === 8 ? 2 : 1 : 0; + var qtips = $(selector).filter('['+attr+']'), - // Set initial CSS - inner.css({ - antialias: ''+(mimic.string().indexOf('center') > -1), - left: translate[0] - (translate[2] * Number(precedance === 'x')), - top: translate[1] - (translate[2] * Number(precedance === 'y')), - width: width + border, - height: height + border - }) - .each(function(i) { - var $this = $(this); + // Keep the modal's lower than other, regular qtips + newIndex = PLUGINS.modal.zindex + qtips.length, + curIndex = parseInt(tooltip[0].style.zIndex, 10); - // Set shape specific attributes - $this[ $this.prop ? 'prop' : 'attr' ]({ - coordsize: (width+border) + ' ' + (height+border), - path: coords, - fillcolor: color.fill, - filled: !!i, - stroked: !!!i - }) - .css({ display: border || i ? 'block' : 'none' }); + // Set overlay z-index + overlay[0].style.zIndex = newIndex; - // Check if border is enabled and add stroke element - if(!i && $this.html() === '') { - $this.html( - '' - ); + // Reduce modal z-index's and keep them properly ordered + qtips.each(function() { + if(this.style.zIndex > curIndex) { + this.style.zIndex -= 1; } }); - } - // Position if needed - if(position !== FALSE) { self.position(corner); } - }, + // Fire blur event for focused tooltip + qtips.end().filter('.' + focusClass).qtip('blur', event.originalEvent); - // Tip positioning method - position: function(corner) - { - var tip = elems.tip, - position = {}, - userOffset = Math.max(0, opts.offset), - precedance, dimensions, corners; + // Set the new z-index + tooltip.addClass(focusClass)[0].style.zIndex = newIndex; - // Return if tips are disabled or tip is not yet rendered - if(opts.corner === FALSE || !tip) { return FALSE; } + // Prevent default handling + event.preventDefault(); + }) - // Inherit corner if not provided - corner = corner || self.corner; - precedance = corner.precedance; + // Focus any other visible modals when this one hides + .bind('tooltiphide'+globalNamespace, function(event) { + $('[' + attr + ']').filter(':visible').not(tooltip).last().qtip('focus', event); + }); - // Determine which tip dimension to use for adjustment - dimensions = calculateSize(corner); + // Apply keyboard "Escape key" close handler + if(options.escape) { + $(window).unbind(namespace).bind('keydown'+namespace, function(event) { + if(event.keyCode === 27 && tooltip.hasClass(focusClass)) { + api.hide(event); + } + }); + } - // Setup corners and offset array - corners = [ corner.x, corner.y ]; - if(precedance === 'x') { corners.reverse(); } + // Apply click handler for blur option + if(options.blur) { + elems.overlay.unbind(namespace).bind('click'+namespace, function(event) { + if(tooltip.hasClass(focusClass)) { api.hide(event); } + }); + } - // Calculate tip position - $.each(corners, function(i, side) { - var b, br; + return self; + }, - if(side === 'center') { - b = precedance === 'y' ? 'left' : 'top'; - position[ b ] = '50%'; - position['margin-' + b] = -Math.round(dimensions[ precedance === 'y' ? 'width' : 'height' ] / 2) + userOffset; - } - else { - b = borderWidth(corner, side, TRUE); - br = borderRadius(corner); - - position[ side ] = i ? - border ? borderWidth(corner, side) : 0 : - userOffset + (br > b ? br : 0); - } - }); + create: function() + { + var elem = $(overlaySelector); - // Adjust for tip dimensions - position[ corner[precedance] ] -= dimensions[ precedance === 'x' ? 'width' : 'height' ]; + // Return if overlay is already rendered + if(elem.length) { elems.overlay = elem; return elem; } - // Set and return new position - tip.css({ top: '', bottom: '', left: '', right: '', margin: '' }).css(position); - return position; - }, - - destroy: function() - { - // Remov tip and bound events - if(elems.tip) { elems.tip.remove(); } - tooltip.unbind(namespace); - } - }); - - self.init(); -} + // Create document overlay + overlay = elems.overlay = $('
', { + id: overlaySelector.substr(1), + html: '
', + mousedown: function() { return FALSE; } + }) + .insertBefore( $(selector).first() ); -PLUGINS.tip = function(api) -{ - var self = api.plugins.tip; - - return 'object' === typeof self ? self : (api.plugins.tip = new Tip(api)); -}; + // Update position on window resize or scroll + $(window).unbind(globalNamespace).bind('resize'+globalNamespace, function() { + overlay.css({ + height: $(window).height(), + width: $(window).width() + }); + }) + .triggerHandler('resize'); -// Initialize tip on render -PLUGINS.tip.initialize = 'render'; + return overlay; + }, -// Setup plugin sanitization options -PLUGINS.tip.sanitize = function(options) -{ - var style = options.style, opts; - if(style && 'tip' in style) { - opts = options.style.tip; - if(typeof opts !== 'object'){ options.style.tip = { corner: opts }; } - if(!(/string|boolean/i).test(typeof opts.corner)) { opts.corner = TRUE; } - if(typeof opts.width !== 'number'){ delete opts.width; } - if(typeof opts.height !== 'number'){ delete opts.height; } - if(typeof opts.border !== 'number' && opts.border !== TRUE){ delete opts.border; } - if(typeof opts.offset !== 'number'){ delete opts.offset; } - } -}; + toggle: function(event, state, duration) + { + // Make sure default event hasn't been prevented + if(event && event.isDefaultPrevented()) { return self; } -// Extend original qTip defaults -$.extend(TRUE, QTIP.defaults, { - style: { - tip: { - corner: TRUE, - mimic: FALSE, - width: 6, - height: 6, - border: TRUE, - offset: 0 - } - } -}); + var effect = options.effect, + type = state ? 'show': 'hide', + visible = overlay.is(':visible'), + modals = $('[' + attr + ']').filter(':visible').not(tooltip), + zindex; -PLUGINS.imagemap = function(area, corner) -{ - if(!area.jquery) { area = $(area); } + // Create our overlay if it isn't present already + if(!overlay) { overlay = self.create(); } - var shape = area.attr('shape').toLowerCase(), - baseCoords = area.attr('coords').split(','), - coords = [], - image = $('img[usemap="#'+area.parent('map').attr('name')+'"]'), - imageOffset = image.offset(), - result = { - width: 0, height: 0, - offset: { top: 1e10, right: 0, bottom: 0, left: 1e10 } - }, - i = 0, next = 0; + // Prevent modal from conflicting with show.solo, and don't hide backdrop is other modals are visible + if((overlay.is(':animated') && visible === state) || (!state && modals.length)) { return self; } - // POLY area coordinate calculator - // Special thanks to Ed Cradock for helping out with this. - // Uses a binary search algorithm to find suitable coordinates. - function polyCoordinates(result, coords) - { - var i = 0, - compareX = 1, compareY = 1, - realX = 0, realY = 0, - newWidth = result.width, - newHeight = result.height; + // State specific... + if(state) { + // Set position + overlay.css({ left: 0, top: 0 }); - // Use a binary search algorithm to locate most suitable coordinate (hopefully) - while(newWidth > 0 && newHeight > 0 && compareX > 0 && compareY > 0) - { - newWidth = Math.floor(newWidth / 2); - newHeight = Math.floor(newHeight / 2); + // Toggle backdrop cursor style on show + overlay.toggleClass('blurs', options.blur); - if(corner.x === 'left'){ compareX = newWidth; } - else if(corner.x === 'right'){ compareX = result.width - newWidth; } - else{ compareX += Math.floor(newWidth / 2); } + // Make sure we can't focus anything outside the tooltip + docBody.delegate('*', 'focusin'+namespace, function(event) { + if($(event.target).closest(selector)[0] !== tooltip[0]) { + $('a, :input, img', tooltip).add(tooltip).focus(); + } + }); + } + else { + // Undelegate focus handler + docBody.undelegate('*', 'focusin'+namespace); + } - if(corner.y === 'top'){ compareY = newHeight; } - else if(corner.y === 'bottom'){ compareY = result.height - newHeight; } - else{ compareY += Math.floor(newHeight / 2); } + // Stop all animations + overlay.stop(TRUE, FALSE); - i = coords.length; while(i--) - { - if(coords.length < 2){ break; } + // Use custom function if provided + if($.isFunction(effect)) { + effect.call(overlay, state); + } - realX = coords[i][0] - result.offset.left; - realY = coords[i][1] - result.offset.top; + // If no effect type is supplied, use a simple toggle + else if(effect === FALSE) { + overlay[ type ](); + } - if((corner.x === 'left' && realX >= compareX) || - (corner.x === 'right' && realX <= compareX) || - (corner.x === 'center' && (realX < compareX || realX > (result.width - compareX))) || - (corner.y === 'top' && realY >= compareY) || - (corner.y === 'bottom' && realY <= compareY) || - (corner.y === 'center' && (realY < compareY || realY > (result.height - compareY)))) { - coords.splice(i, 1); - } + // Use basic fade function + else { + overlay.fadeTo( parseInt(duration, 10) || 90, state ? 1 : 0, function() { + if(!state) { $(this).hide(); } + }); } - } - return { left: coords[0][0], top: coords[0][1] }; - } + // Reset position on hide + if(!state) { + overlay.queue(function(next) { + overlay.css({ left: '', top: '' }); + next(); + }); + } - // Make sure we account for padding and borders on the image - imageOffset.left += Math.ceil((image.outerWidth() - image.width()) / 2); - imageOffset.top += Math.ceil((image.outerHeight() - image.height()) / 2); + return self; + }, - // Parse coordinates into proper array - if(shape === 'poly') { - i = baseCoords.length; while(i--) + show: function(event, duration) { return self.toggle(event, TRUE, duration); }, + hide: function(event, duration) { return self.toggle(event, FALSE, duration); }, + + destroy: function() { - next = [ parseInt(baseCoords[--i], 10), parseInt(baseCoords[i+1], 10) ]; + var delBlanket = overlay; - if(next[0] > result.offset.right){ result.offset.right = next[0]; } - if(next[0] < result.offset.left){ result.offset.left = next[0]; } - if(next[1] > result.offset.bottom){ result.offset.bottom = next[1]; } - if(next[1] < result.offset.top){ result.offset.top = next[1]; } + if(delBlanket) { + // Check if any other modal tooltips are present + delBlanket = $('[' + attr + ']').not(tooltip).length < 1; - coords.push(next); + // Remove overlay if needed + if(delBlanket) { + elems.overlay.remove(); + $(window).unbind(globalNamespace); + } + else { + elems.overlay.unbind(globalNamespace+api.id); + } + + // Undelegate focus handler + docBody.undelegate('*', 'focusin'+namespace); + } + + // Remove bound events + return tooltip.removeAttr(attr).unbind(globalNamespace); } - } - else { - coords = $.map(baseCoords, function(coord){ return parseInt(coord, 10); }); - } + }); - // Calculate details - switch(shape) - { - case 'rect': - result = { - width: Math.abs(coords[2] - coords[0]), - height: Math.abs(coords[3] - coords[1]), - offset: { left: coords[0], top: coords[1] } - }; - break; + self.init(); +} - case 'circle': - result = { - width: coords[2] + 2, - height: coords[2] + 2, - offset: { left: coords[0], top: coords[1] } - }; - break; +PLUGINS.modal = function(api) { + var self = api.plugins.modal; - case 'poly': - $.extend(result, { - width: Math.abs(result.offset.right - result.offset.left), - height: Math.abs(result.offset.bottom - result.offset.top) - }); + return 'object' === typeof self ? self : (api.plugins.modal = new Modal(api)); +}; - if(corner.string() === 'centercenter') { - result.offset = { - left: result.offset.left + (result.width / 2), - top: result.offset.top + (result.height / 2) - }; - } - else { - result.offset = polyCoordinates(result, coords.slice()); - } +// Plugin needs to be initialized on render +PLUGINS.modal.initialize = 'render'; - result.width = result.height = 0; - break; +// Setup sanitiztion rules +PLUGINS.modal.sanitize = function(opts) { + if(opts.show) { + if(typeof opts.show.modal !== 'object') { opts.show.modal = { on: !!opts.show.modal }; } + else if(typeof opts.show.modal.on === 'undefined') { opts.show.modal.on = TRUE; } } +}; - // Add image position to offset coordinates - result.offset.left += imageOffset.left; - result.offset.top += imageOffset.top; +// Base z-index for all modal tooltips (use qTip core z-index as a base) +PLUGINS.modal.zindex = QTIP.zindex -= 200; - return result; -}; +// Extend original api defaults +$.extend(TRUE, QTIP.defaults, { + show: { + modal: { + on: FALSE, + effect: TRUE, + blur: TRUE, + escape: TRUE + } + } +}); PLUGINS.svg = function(svg, corner) { @@ -2804,349 +2565,588 @@ PLUGINS.svg = function(svg, corner) return result; }; -function Modal(api) +// Tip coordinates calculator +function calculateTip(corner, width, height) +{ + var width2 = Math.ceil(width / 2), height2 = Math.ceil(height / 2), + + // Define tip coordinates in terms of height and width values + tips = { + bottomright: [[0,0], [width,height], [width,0]], + bottomleft: [[0,0], [width,0], [0,height]], + topright: [[0,height], [width,0], [width,height]], + topleft: [[0,0], [0,height], [width,height]], + topcenter: [[0,height], [width2,0], [width,height]], + bottomcenter: [[0,0], [width,0], [width2,height]], + rightcenter: [[0,0], [width,height2], [0,height]], + leftcenter: [[width,0], [width,height], [0,height2]] + }; + + // Set common side shapes + tips.lefttop = tips.bottomright; tips.righttop = tips.bottomleft; + tips.leftbottom = tips.topright; tips.rightbottom = tips.topleft; + + return tips[ corner.string() ]; +} + + +function Tip(qTip, command) { var self = this, - options = api.options.show.modal, - elems = api.elements, + opts = qTip.options.style.tip, + elems = qTip.elements, tooltip = elems.tooltip, - overlaySelector = '#qtip-overlay', - globalNamespace = '.qtipmodal', - namespace = globalNamespace + api.id, - attr = 'is-modal-qtip', - docBody = $(document.body), - overlay; + cache = { + top: 0, + left: 0, + corner: '' + }, + size = { + width: opts.width, + height: opts.height + }, + color = { }, + border = opts.border || 0, + namespace = '.qtip-tip', + hasCanvas = !!($('')[0] || {}).getContext; - // Setup option set checks - api.checks.modal = { - '^show.modal.(on|blur)$': function() { - // Initialise - self.init(); - - // Show the modal if not visible already and tooltip is visible - elems.overlay.toggle( tooltip.is(':visible') ); + self.corner = NULL; + self.mimic = NULL; + self.border = border; + self.offset = opts.offset; + self.size = size; + + // Add new option checks for the plugin + qTip.checks.tip = { + '^position.my|style.tip.(corner|mimic|border)$': function() { + // Make sure a tip can be drawn + if(!self.init()) { + self.destroy(); + } + + // Reposition the tooltip + qTip.reposition(); + }, + '^style.tip.(height|width)$': function() { + // Re-set dimensions and redraw the tip + size = { + width: opts.width, + height: opts.height + }; + self.create(); + self.update(); + + // Reposition the tooltip + qTip.reposition(); + }, + '^content.title.text|style.(classes|widget)$': function() { + if(elems.tip) { + self.update(); + } } }; + function reposition(event, api, pos, viewport) { + if(!elems.tip) { return; } + + var newCorner = $.extend({}, self.corner), + adjust = pos.adjusted, + method = qTip.options.position.adjust.method.split(' '), + horizontal = method[0], + vertical = method[1] || method[0], + shift = { left: FALSE, top: FALSE, x: 0, y: 0 }, + offset, css = {}, props; + + // Make sure our tip position isn't fixed e.g. doesn't adjust with viewport + if(self.corner.fixed !== TRUE) { + // Horizontal - Shift or flip method + if(horizontal === 'shift' && newCorner.precedance === 'x' && adjust.left && newCorner.y !== 'center') { + newCorner.precedance = newCorner.precedance === 'x' ? 'y' : 'x'; + } + else if(horizontal === 'flip' && adjust.left){ + newCorner.x = newCorner.x === 'center' ? (adjust.left > 0 ? 'left' : 'right') : (newCorner.x === 'left' ? 'right' : 'left'); + } + + // Vertical - Shift or flip method + if(vertical === 'shift' && newCorner.precedance === 'y' && adjust.top && newCorner.x !== 'center') { + newCorner.precedance = newCorner.precedance === 'y' ? 'x' : 'y'; + } + else if(vertical === 'flip' && adjust.top) { + newCorner.y = newCorner.y === 'center' ? (adjust.top > 0 ? 'top' : 'bottom') : (newCorner.y === 'top' ? 'bottom' : 'top'); + } + + // Update and redraw the tip if needed (check cached details of last drawn tip) + if(newCorner.string() !== cache.corner && (cache.top !== adjust.top || cache.left !== adjust.left)) { + self.update(newCorner, FALSE); + } + } + + // Setup tip offset properties + offset = self.position(newCorner, adjust); + if(offset.right !== undefined) { offset.left = -offset.right; } + if(offset.bottom !== undefined) { offset.top = -offset.bottom; } + offset.user = Math.max(0, opts.offset); + + // Viewport "shift" specific adjustments + if(shift.left = (horizontal === 'shift' && !!adjust.left)) { + if(newCorner.x === 'center') { + css['margin-left'] = shift.x = offset['margin-left'] - adjust.left; + } + else { + props = offset.right !== undefined ? + [ adjust.left, -offset.left ] : [ -adjust.left, offset.left ]; + + if( (shift.x = Math.max(props[0], props[1])) > props[0] ) { + pos.left -= adjust.left; + shift.left = FALSE; + } + + css[ offset.right !== undefined ? 'right' : 'left' ] = shift.x; + } + } + if(shift.top = (vertical === 'shift' && !!adjust.top)) { + if(newCorner.y === 'center') { + css['margin-top'] = shift.y = offset['margin-top'] - adjust.top; + } + else { + props = offset.bottom !== undefined ? + [ adjust.top, -offset.top ] : [ -adjust.top, offset.top ]; + + if( (shift.y = Math.max(props[0], props[1])) > props[0] ) { + pos.top -= adjust.top; + shift.top = FALSE; + } + + css[ offset.bottom !== undefined ? 'bottom' : 'top' ] = shift.y; + } + } + + /* + * If the tip is adjusted in both dimensions, or in a + * direction that would cause it to be anywhere but the + * outer border, hide it! + */ + elems.tip.css(css).toggle( + !((shift.x && shift.y) || (newCorner.x === 'center' && shift.y) || (newCorner.y === 'center' && shift.x)) + ); + + // Adjust position to accomodate tip dimensions + pos.left -= offset.left.charAt ? offset.user : horizontal !== 'shift' || shift.top || !shift.left && !shift.top ? offset.left : 0; + pos.top -= offset.top.charAt ? offset.user : vertical !== 'shift' || shift.left || !shift.left && !shift.top ? offset.top : 0; + + // Cache details + cache.left = adjust.left; cache.top = adjust.top; + cache.corner = newCorner.string(); + } + + /* border width calculator */ + function borderWidth(corner, side, backup) { + side = !side ? corner[corner.precedance] : side; + + var isFluid = tooltip.hasClass(fluidClass), + isTitleTop = elems.titlebar && corner.y === 'top', + elem = isTitleTop ? elems.titlebar : elems.content, + css = 'border-' + side + '-width', + val; + + // Grab the border-width value (add fluid class if needed) + tooltip.addClass(fluidClass); + val = parseInt(elem.css(css), 10); + val = (backup ? val || parseInt(tooltip.css(css), 10) : val) || 0; + tooltip.toggleClass(fluidClass, isFluid); + + return val; + } + + function borderRadius(corner) { + var isTitleTop = elems.titlebar && corner.y === 'top', + elem = isTitleTop ? elems.titlebar : elems.content, + moz = $.browser.mozilla, + prefix = moz ? '-moz-' : $.browser.webkit ? '-webkit-' : '', + side = corner.y + (moz ? '' : '-') + corner.x, + css = prefix + (moz ? 'border-radius-' + side : 'border-' + side + '-radius'); + + return parseInt(elem.css(css), 10) || parseInt(tooltip.css(css), 10) || 0; + } + + function calculateSize(corner) { + var y = corner.precedance === 'y', + width = size [ y ? 'width' : 'height' ], + height = size [ y ? 'height' : 'width' ], + isCenter = corner.string().indexOf('center') > -1, + base = width * (isCenter ? 0.5 : 1), + pow = Math.pow, + round = Math.round, + bigHyp, ratio, result, + + smallHyp = Math.sqrt( pow(base, 2) + pow(height, 2) ), + + hyp = [ + (border / base) * smallHyp, (border / height) * smallHyp + ]; + hyp[2] = Math.sqrt( pow(hyp[0], 2) - pow(border, 2) ); + hyp[3] = Math.sqrt( pow(hyp[1], 2) - pow(border, 2) ); + + bigHyp = smallHyp + hyp[2] + hyp[3] + (isCenter ? 0 : hyp[0]); + ratio = bigHyp / smallHyp; + + result = [ round(ratio * height), round(ratio * width) ]; + return { height: result[ y ? 0 : 1 ], width: result[ y ? 1 : 0 ] }; + } + $.extend(self, { init: function() { - // If modal is disabled... return - if(!options.on) { return self; } - - // Create the overlay if needed - overlay = self.create(); + var enabled = self.detectCorner() && (hasCanvas || $.browser.msie); - // Add unique attribute so we can grab modal tooltips easily via a selector - tooltip.attr(attr, TRUE) + // Determine tip corner and type + if(enabled) { + // Create a new tip and draw it + self.create(); + self.update(); - .css('z-index', PLUGINS.modal.zindex + $(selector+'['+attr+']').length) + // Bind update events + tooltip.unbind(namespace).bind('tooltipmove'+namespace, reposition); + } - // Remove previous bound events in globalNamespace - .unbind(globalNamespace).unbind(namespace) + return enabled; + }, - // Apply our show/hide/focus modal events - .bind('tooltipshow'+globalNamespace+' tooltiphide'+globalNamespace, function(event, api, duration) { - var oEvent = event.originalEvent; - - // Make sure mouseout doesn't trigger a hide when showing the modal and mousing onto backdrop - if(oEvent && event.type === 'tooltiphide' && /mouse(leave|enter)/.test(oEvent.type) && $(oEvent.relatedTarget).closest(overlay[0]).length) { - event.preventDefault(); + detectCorner: function() + { + var corner = opts.corner, + posOptions = qTip.options.position, + at = posOptions.at, + my = posOptions.my.string ? posOptions.my.string() : posOptions.my; + + // Detect corner and mimic properties + if(corner === FALSE || (my === FALSE && at === FALSE)) { + return FALSE; + } + else { + if(corner === TRUE) { + self.corner = new PLUGINS.Corner(my); } - else { - self[ event.type.replace('tooltip', '') ](event, duration); + else if(!corner.string) { + self.corner = new PLUGINS.Corner(corner); + self.corner.fixed = TRUE; } - }) - - // Adjust modal z-index on tooltip focus - .bind('tooltipfocus'+globalNamespace, function(event) { - // If focus was cancelled before it reearch us, don't do anything - if(event.isDefaultPrevented()) { return; } - - var qtips = $(selector).filter('['+attr+']'), + } - // Keep the modal's lower than other, regular qtips - newIndex = PLUGINS.modal.zindex + qtips.length, - curIndex = parseInt(tooltip[0].style.zIndex, 10); + return self.corner.string() !== 'centercenter'; + }, - // Set overlay z-index - overlay[0].style.zIndex = newIndex; + detectColours: function() { + var i, fill, border, + tip = elems.tip.css({ backgroundColor: '', border: '' }), + corner = self.corner, + precedance = corner[ corner.precedance ], - // Reduce modal z-index's and keep them properly ordered - qtips.each(function() { - if(this.style.zIndex > curIndex) { - this.style.zIndex -= 1; - } - }); + borderSide = 'border-' + precedance + '-color', + borderSideCamel = 'border' + precedance.charAt(0) + precedance.substr(1) + 'Color', - // Fire blur event for focused tooltip - qtips.end().filter('.' + focusClass).qtip('blur', event.originalEvent); + invalid = /rgba?\(0, 0, 0(, 0)?\)|transparent/i, + backgroundColor = 'background-color', + transparent = 'transparent', - // Set the new z-index - tooltip.addClass(focusClass)[0].style.zIndex = newIndex; + bodyBorder = $(document.body).css('color'), + contentColour = qTip.elements.content.css('color'), - // Prevent default handling - event.preventDefault(); - }) + useTitle = elems.titlebar && (corner.y === 'top' || (corner.y === 'center' && tip.position().top + (size.height / 2) + opts.offset < elems.titlebar.outerHeight(1))), + colorElem = useTitle ? elems.titlebar : elems.content; - // Focus any other visible modals when this one hides - .bind('tooltiphide'+globalNamespace, function(event) { - $('[' + attr + ']').filter(':visible').not(tooltip).last().qtip('focus', event); - }); + // Apply the fluid class so we can see our CSS values properly + tooltip.addClass(fluidClass); - // Apply keyboard "Escape key" close handler - if(options.escape) { - $(window).unbind(namespace).bind('keydown'+namespace, function(event) { - if(event.keyCode === 27 && tooltip.hasClass(focusClass)) { - api.hide(event); - } - }); + // Detect tip colours from CSS styles + color.fill = fill = tip.css(backgroundColor); + color.border = border = tip[0].style[ borderSideCamel ] || tip.css(borderSide) || tooltip.css(borderSide); + + // Make sure colours are valid + if(!fill || invalid.test(fill)) { + color.fill = colorElem.css(backgroundColor) || transparent; + if(invalid.test(color.fill)) { + color.fill = tooltip.css(backgroundColor) || fill; + } } - - // Apply click handler for blur option - if(options.blur) { - elems.overlay.unbind(namespace).bind('click'+namespace, function(event) { - if(tooltip.hasClass(focusClass)) { api.hide(event); } - }); + if(!border || invalid.test(border) || border === bodyBorder) { + color.border = colorElem.css(borderSide) || transparent; + if(invalid.test(color.border) || color.border === contentColour) { + color.border = border; + } } - return self; + // Reset background and border colours + $('*', tip).add(tip).css(backgroundColor, transparent).css('border', ''); + + // Remove fluid class + tooltip.removeClass(fluidClass); }, create: function() { - var elem = $(overlaySelector); - - // Return if overlay is already rendered - if(elem.length) { elems.overlay = elem; return elem; } + var width = size.width, + height = size.height, + vml; - // Create document overlay - overlay = elems.overlay = $('
', { - id: overlaySelector.substr(1), - html: '
', - mousedown: function() { return FALSE; } - }) - .insertBefore( $(selector).first() ); + // Remove previous tip element if present + if(elems.tip) { elems.tip.remove(); } - // Update position on window resize or scroll - $(window).unbind(globalNamespace).bind('resize'+globalNamespace, function() { - overlay.css({ - height: $(window).height(), - width: $(window).width() - }); - }) - .triggerHandler('resize'); + // Create tip element and prepend to the tooltip + elems.tip = $('
', { 'class': 'ui-tooltip-tip' }).css({ width: width, height: height }).prependTo(tooltip); - return overlay; + // Create tip drawing element(s) + if(hasCanvas) { + // save() as soon as we create the canvas element so FF2 doesn't bork on our first restore()! + $('').appendTo(elems.tip)[0].getContext('2d').save(); + } + else { + vml = ''; + elems.tip.html(vml + vml); + } }, - toggle: function(event, state, duration) + update: function(corner, position) { - // Make sure default event hasn't been prevented - if(event && event.isDefaultPrevented()) { return self; } + var tip = elems.tip, + inner = tip.children(), + width = size.width, + height = size.height, + regular = 'px solid ', + transparent = 'px dashed transparent', // Dashed IE6 border-transparency hack. Awesome! + mimic = opts.mimic, + round = Math.round, + precedance, context, coords, translate, newSize; - var effect = options.effect, - type = state ? 'show': 'hide', - visible = overlay.is(':visible'), - modals = $('[' + attr + ']').filter(':visible').not(tooltip), - zindex; + // Re-determine tip if not already set + if(!corner) { corner = self.corner; } - // Create our overlay if it isn't present already - if(!overlay) { overlay = self.create(); } + // Use corner property if we detect an invalid mimic value + if(mimic === FALSE) { mimic = corner; } - // Prevent modal from conflicting with show.solo, and don't hide backdrop is other modals are visible - if((overlay.is(':animated') && visible === state) || (!state && modals.length)) { return self; } + // Otherwise inherit mimic properties from the corner object as necessary + else { + mimic = new PLUGINS.Corner(mimic); + mimic.precedance = corner.precedance; - // State specific... - if(state) { - // Set position - overlay.css({ left: 0, top: 0 }); + if(mimic.x === 'inherit') { mimic.x = corner.x; } + else if(mimic.y === 'inherit') { mimic.y = corner.y; } + else if(mimic.x === mimic.y) { + mimic[ corner.precedance ] = corner[ corner.precedance ]; + } + } + precedance = mimic.precedance; - // Toggle backdrop cursor style on show - overlay.toggleClass('blurs', options.blur); + // Update our colours + self.detectColours(); - // Make sure we can't focus anything outside the tooltip - docBody.delegate('*', 'focusin'+namespace, function(event) { - if($(event.target).closest(selector)[0] !== tooltip[0]) { - $('a, :input, img', tooltip).add(tooltip).focus(); - } - }); + // Detect border width, taking into account colours + if(color.border !== 'transparent' && color.border !== '#123456') { + // Grab border width + border = borderWidth(corner, NULL, TRUE); + + // If border width isn't zero, use border color as fill (1.0 style tips) + if(opts.border === 0 && border > 0) { color.fill = color.border; } + + // Set border width (use detected border width if opts.border is true) + self.border = border = opts.border !== TRUE ? opts.border : border; + } + + // Border colour was invalid, set border to zero + else { self.border = border = 0; } + + // Calculate coordinates + coords = calculateTip(mimic, width , height); + + // Determine tip size + self.size = newSize = calculateSize(corner); + tip.css(newSize); + + // Calculate tip translation + if(corner.precedance === 'y') { + translate = [ + round(mimic.x === 'left' ? border : mimic.x === 'right' ? newSize.width - width - border : (newSize.width - width) / 2), + round(mimic.y === 'top' ? newSize.height - height : 0) + ]; } else { - // Undelegate focus handler - docBody.undelegate('*', 'focusin'+namespace); + translate = [ + round(mimic.x === 'left' ? newSize.width - width : 0), + round(mimic.y === 'top' ? border : mimic.y === 'bottom' ? newSize.height - height - border : (newSize.height - height) / 2) + ]; + } + + // Canvas drawing implementation + if(hasCanvas) { + // Set the canvas size using calculated size + inner.attr(newSize); + + // Grab canvas context and clear/save it + context = inner[0].getContext('2d'); + context.restore(); context.save(); + context.clearRect(0,0,3000,3000); + + // Translate origin + context.translate(translate[0], translate[1]); + + // Draw the tip + context.beginPath(); + context.moveTo(coords[0][0], coords[0][1]); + context.lineTo(coords[1][0], coords[1][1]); + context.lineTo(coords[2][0], coords[2][1]); + context.closePath(); + context.fillStyle = color.fill; + context.strokeStyle = color.border; + context.lineWidth = border * 2; + context.lineJoin = 'miter'; + context.miterLimit = 100; + if(border) { context.stroke(); } + context.fill(); } - // Stop all animations - overlay.stop(TRUE, FALSE); + // VML (IE Proprietary implementation) + else { + // Setup coordinates string + coords = 'm' + coords[0][0] + ',' + coords[0][1] + ' l' + coords[1][0] + + ',' + coords[1][1] + ' ' + coords[2][0] + ',' + coords[2][1] + ' xe'; - // Use custom function if provided - if($.isFunction(effect)) { - effect.call(overlay, state); - } + // Setup VML-specific offset for pixel-perfection + translate[2] = border && /^(r|b)/i.test(corner.string()) ? + parseFloat($.browser.version, 10) === 8 ? 2 : 1 : 0; - // If no effect type is supplied, use a simple toggle - else if(effect === FALSE) { - overlay[ type ](); - } + // Set initial CSS + inner.css({ + antialias: ''+(mimic.string().indexOf('center') > -1), + left: translate[0] - (translate[2] * Number(precedance === 'x')), + top: translate[1] - (translate[2] * Number(precedance === 'y')), + width: width + border, + height: height + border + }) + .each(function(i) { + var $this = $(this); - // Use basic fade function - else { - overlay.fadeTo( parseInt(duration, 10) || 90, state ? 1 : 0, function() { - if(!state) { $(this).hide(); } - }); - } + // Set shape specific attributes + $this[ $this.prop ? 'prop' : 'attr' ]({ + coordsize: (width+border) + ' ' + (height+border), + path: coords, + fillcolor: color.fill, + filled: !!i, + stroked: !!!i + }) + .css({ display: border || i ? 'block' : 'none' }); - // Reset position on hide - if(!state) { - overlay.queue(function(next) { - overlay.css({ left: '', top: '' }); - next(); + // Check if border is enabled and add stroke element + if(!i && $this.html() === '') { + $this.html( + '' + ); + } }); } - return self; + // Position if needed + if(position !== FALSE) { self.position(corner); } }, - show: function(event, duration) { return self.toggle(event, TRUE, duration); }, - hide: function(event, duration) { return self.toggle(event, FALSE, duration); }, - - destroy: function() + // Tip positioning method + position: function(corner) { - var delBlanket = overlay; - - if(delBlanket) { - // Check if any other modal tooltips are present - delBlanket = $('[' + attr + ']').not(tooltip).length < 1; - - // Remove overlay if needed - if(delBlanket) { - elems.overlay.remove(); - $(window).unbind(globalNamespace); - } - else { - elems.overlay.unbind(globalNamespace+api.id); - } - - // Undelegate focus handler - docBody.undelegate('*', 'focusin'+namespace); - } - - // Remove bound events - return tooltip.removeAttr(attr).unbind(globalNamespace); - } - }); - - self.init(); -} - -PLUGINS.modal = function(api) { - var self = api.plugins.modal; - - return 'object' === typeof self ? self : (api.plugins.modal = new Modal(api)); -}; - -// Plugin needs to be initialized on render -PLUGINS.modal.initialize = 'render'; - -// Setup sanitiztion rules -PLUGINS.modal.sanitize = function(opts) { - if(opts.show) { - if(typeof opts.show.modal !== 'object') { opts.show.modal = { on: !!opts.show.modal }; } - else if(typeof opts.show.modal.on === 'undefined') { opts.show.modal.on = TRUE; } - } -}; - -// Base z-index for all modal tooltips (use qTip core z-index as a base) -PLUGINS.modal.zindex = QTIP.zindex -= 200; - -// Extend original api defaults -$.extend(TRUE, QTIP.defaults, { - show: { - modal: { - on: FALSE, - effect: TRUE, - blur: TRUE, - escape: TRUE - } - } -}); + var tip = elems.tip, + position = {}, + userOffset = Math.max(0, opts.offset), + precedance, dimensions, corners; -/* - * BGIFrame adaption (http://plugins.jquery.com/project/bgiframe) - * Special thanks to Brandon Aaron - */ -function BGIFrame(api) -{ - var self = this, - elems = api.elements, - tooltip = elems.tooltip, - namespace = '.bgiframe-' + api.id; + // Return if tips are disabled or tip is not yet rendered + if(opts.corner === FALSE || !tip) { return FALSE; } - $.extend(self, { - init: function() - { - // Create the BGIFrame element - elems.bgiframe = $(''); + // Inherit corner if not provided + corner = corner || self.corner; + precedance = corner.precedance; - // Append the new element to the tooltip - elems.bgiframe.appendTo(tooltip); + // Determine which tip dimension to use for adjustment + dimensions = calculateSize(corner); - // Update BGIFrame on tooltip move - tooltip.bind('tooltipmove'+namespace, self.adjust); - }, + // Setup corners and offset array + corners = [ corner.x, corner.y ]; + if(precedance === 'x') { corners.reverse(); } - adjust: function() - { - var dimensions = api.get('dimensions'), // Determine current tooltip dimensions - plugin = api.plugins.tip, - tip = elems.tip, - tipAdjust, offset; + // Calculate tip position + $.each(corners, function(i, side) { + var b, br; - // Adjust border offset - offset = parseInt(tooltip.css('border-left-width'), 10) || 0; - offset = { left: -offset, top: -offset }; + if(side === 'center') { + b = precedance === 'y' ? 'left' : 'top'; + position[ b ] = '50%'; + position['margin-' + b] = -Math.round(dimensions[ precedance === 'y' ? 'width' : 'height' ] / 2) + userOffset; + } + else { + b = borderWidth(corner, side, TRUE); + br = borderRadius(corner); + + position[ side ] = i ? + border ? borderWidth(corner, side) : 0 : + userOffset + (br > b ? br : 0); + } + }); - // Adjust for tips plugin - if(plugin && tip) { - tipAdjust = (plugin.corner.precedance === 'x') ? ['width', 'left'] : ['height', 'top']; - offset[ tipAdjust[1] ] -= tip[ tipAdjust[0] ](); - } + // Adjust for tip dimensions + position[ corner[precedance] ] -= dimensions[ precedance === 'x' ? 'width' : 'height' ]; - // Update bgiframe - elems.bgiframe.css(offset).css(dimensions); + // Set and return new position + tip.css({ top: '', bottom: '', left: '', right: '', margin: '' }).css(position); + return position; }, - + destroy: function() { - // Remove iframe - elems.bgiframe.remove(); - - // Remove bound events + // Remov tip and bound events + if(elems.tip) { elems.tip.remove(); } tooltip.unbind(namespace); } }); - + self.init(); } -PLUGINS.bgiframe = function(api) +PLUGINS.tip = function(api) { - var browser = $.browser, - self = api.plugins.bgiframe; + var self = api.plugins.tip; - // Proceed only if the browser is IE6 and offending elements are present - if($('select, object').length < 1 || !(browser.msie && browser.version.charAt(0) === '6')) { - return FALSE; - } + return 'object' === typeof self ? self : (api.plugins.tip = new Tip(api)); +}; - return 'object' === typeof self ? self : (api.plugins.bgiframe = new BGIFrame(api)); +// Initialize tip on render +PLUGINS.tip.initialize = 'render'; + +// Setup plugin sanitization options +PLUGINS.tip.sanitize = function(options) +{ + var style = options.style, opts; + if(style && 'tip' in style) { + opts = options.style.tip; + if(typeof opts !== 'object'){ options.style.tip = { corner: opts }; } + if(!(/string|boolean/i).test(typeof opts.corner)) { opts.corner = TRUE; } + if(typeof opts.width !== 'number'){ delete opts.width; } + if(typeof opts.height !== 'number'){ delete opts.height; } + if(typeof opts.border !== 'number' && opts.border !== TRUE){ delete opts.border; } + if(typeof opts.offset !== 'number'){ delete opts.offset; } + } }; -// Plugin needs to be initialized on render -PLUGINS.bgiframe.initialize = 'render'; +// Extend original qTip defaults +$.extend(TRUE, QTIP.defaults, { + style: { + tip: { + corner: TRUE, + mimic: FALSE, + width: 6, + height: 6, + border: TRUE, + offset: 0 + } + } +}); }(jQuery, window)); \ No newline at end of file diff --git a/dist/jquery.qtip.min.css b/dist/jquery.qtip.min.css index 6b0daf7c..5be1510c 100644 --- a/dist/jquery.qtip.min.css +++ b/dist/jquery.qtip.min.css @@ -1 +1 @@ -.ui-tooltip,.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;z-index:15000;}.ui-tooltip-fluid{display:block;visibility:hidden;position:static!important;float:left!important;}.ui-tooltip-content{position:relative;padding:5px 9px;overflow:hidden;border-width:1px;border-style:solid;text-align:left;word-wrap:break-word;overflow:hidden;}.ui-tooltip-titlebar{position:relative;min-height:14px;padding:5px 35px 5px 10px;overflow:hidden;border-width:1px 1px 0;border-style:solid;font-weight:bold;}.ui-tooltip-titlebar+.ui-tooltip-content{border-top-width:0!important;}/*!Default close button class */ .ui-tooltip-titlebar .ui-state-default{position:absolute;right:4px;top:50%;margin-top:-9px;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;}* html .ui-tooltip-titlebar .ui-state-default{top:16px;}.ui-tooltip-titlebar .ui-icon,.ui-tooltip-icon .ui-icon{display:block;text-indent:-1000em;}.ui-tooltip-icon,.ui-tooltip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.ui-tooltip-icon .ui-icon{width:18px;height:14px;text-align:center;text-indent:0;font:normal bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em;}/*!Default tooltip style */ .ui-tooltip-default .ui-tooltip-titlebar,.ui-tooltip-default .ui-tooltip-content{border-color:#F1D031;background-color:#FFFFA3;color:#555;}.ui-tooltip-default .ui-tooltip-titlebar{background-color:#FFEF93;}.ui-tooltip-default .ui-tooltip-icon{border-color:#CCC;background:#F1F1F1;color:#777;}.ui-tooltip-default .ui-tooltip-titlebar .ui-state-hover{border-color:#AAA;color:#111;}.ui-tooltip .ui-tooltip-tip{margin:0 auto;overflow:hidden;background:transparent!important;border:0 dashed transparent!important;z-index:10;}.ui-tooltip .ui-tooltip-tip,.ui-tooltip .ui-tooltip-tip *{position:absolute;line-height:.1px!important;font-size:.1px!important;color:#123456;background:transparent;border:0 dashed transparent;}.ui-tooltip .ui-tooltip-tip canvas{top:0;left:0;}#qtip-overlay{position:fixed;left:-10000em;top:-10000em;}#qtip-overlay.blurs{cursor:pointer;}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:black;opacity:.7;filter:alpha(opacity=70);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";}/*!Light tooltip style */ .ui-tooltip-light .ui-tooltip-titlebar,.ui-tooltip-light .ui-tooltip-content{border-color:#E2E2E2;color:#454545;}.ui-tooltip-light .ui-tooltip-content{background-color:white;}.ui-tooltip-light .ui-tooltip-titlebar{background-color:#f1f1f1;}/*!Dark tooltip style */ .ui-tooltip-dark .ui-tooltip-titlebar,.ui-tooltip-dark .ui-tooltip-content{border-color:#303030;color:#f3f3f3;}.ui-tooltip-dark .ui-tooltip-content{background-color:#505050;}.ui-tooltip-dark .ui-tooltip-titlebar{background-color:#404040;}.ui-tooltip-dark .ui-tooltip-icon{border-color:#444;}.ui-tooltip-dark .ui-tooltip-titlebar .ui-state-hover{border-color:#303030;}/*!Cream tooltip style */ .ui-tooltip-cream .ui-tooltip-titlebar,.ui-tooltip-cream .ui-tooltip-content{border-color:#F9E98E;color:#A27D35;}.ui-tooltip-cream .ui-tooltip-content{background-color:#FBF7AA;}.ui-tooltip-cream .ui-tooltip-titlebar{background-color:#F0DE7D;}.ui-tooltip-cream .ui-state-default .ui-tooltip-icon{background-position:-82px 0;}/*!Red tooltip style */ .ui-tooltip-red .ui-tooltip-titlebar,.ui-tooltip-red .ui-tooltip-content{border-color:#D95252;color:#912323;}.ui-tooltip-red .ui-tooltip-content{background-color:#F78B83;}.ui-tooltip-red .ui-tooltip-titlebar{background-color:#F06D65;}.ui-tooltip-red .ui-state-default .ui-tooltip-icon{background-position:-102px 0;}.ui-tooltip-red .ui-tooltip-icon{border-color:#D95252;}.ui-tooltip-red .ui-tooltip-titlebar .ui-state-hover{border-color:#D95252;}/*!Green tooltip style */ .ui-tooltip-green .ui-tooltip-titlebar,.ui-tooltip-green .ui-tooltip-content{border-color:#90D93F;color:#3F6219;}.ui-tooltip-green .ui-tooltip-content{background-color:#CAED9E;}.ui-tooltip-green .ui-tooltip-titlebar{background-color:#B0DE78;}.ui-tooltip-green .ui-state-default .ui-tooltip-icon{background-position:-42px 0;}/*!Blue tooltip style */ .ui-tooltip-blue .ui-tooltip-titlebar,.ui-tooltip-blue .ui-tooltip-content{border-color:#ADD9ED;color:#5E99BD;}.ui-tooltip-blue .ui-tooltip-content{background-color:#E5F6FE;}.ui-tooltip-blue .ui-tooltip-titlebar{background-color:#D0E9F5;}.ui-tooltip-blue .ui-state-default .ui-tooltip-icon{background-position:-2px 0;}/*!Add shadows to your tooltips in:FF3+,Chrome 2+,Opera 10.6+,IE6+,Safari 2+*/ .ui-tooltip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,0.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,0.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,0.15);}.ui-tooltip-shadow .ui-tooltip-titlebar,.ui-tooltip-shadow .ui-tooltip-content{filter:progid:DXImageTransform.Microsoft.Shadow(Color='gray',Direction=135,Strength=3);-ms-filter:"progid:DXImageTransform.Microsoft.Shadow(Color='gray',Direction=135,Strength=3)";_margin-bottom:-3px;.margin-bottom:-3px;}/*!Add rounded corners to your tooltips in:FF3+,Chrome 2+,Opera 10.6+,IE9+,Safari 2+*/ .ui-tooltip-rounded,.ui-tooltip-rounded .ui-tooltip-content,.ui-tooltip-tipsy,.ui-tooltip-tipsy .ui-tooltip-content,.ui-tooltip-youtube,.ui-tooltip-youtube .ui-tooltip-content{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.ui-tooltip-rounded .ui-tooltip-titlebar,.ui-tooltip-tipsy .ui-tooltip-titlebar,.ui-tooltip-youtube .ui-tooltip-titlebar{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0;}.ui-tooltip-rounded .ui-tooltip-titlebar+.ui-tooltip-content,.ui-tooltip-tipsy .ui-tooltip-titlebar+.ui-tooltip-content,.ui-tooltip-youtube .ui-tooltip-titlebar+.ui-tooltip-content{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0 0 5px 5px;border-radius:0 0 5px 5px;}/*!Youtube tooltip style */ .ui-tooltip-youtube{-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;}.ui-tooltip-youtube .ui-tooltip-titlebar,.ui-tooltip-youtube .ui-tooltip-content{_margin-bottom:0;.margin-bottom:0;background:transparent;background:rgba(0,0,0,0.85);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000)";color:white;border-color:#CCC;}.ui-tooltip-youtube .ui-tooltip-icon{border-color:#222;}.ui-tooltip-youtube .ui-tooltip-titlebar .ui-state-hover{border-color:#303030;}.ui-tooltip-jtools{background:#232323;background:rgba(0,0,0,0.7);background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333;}.ui-tooltip-jtools .ui-tooltip-titlebar{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A)";}.ui-tooltip-jtools .ui-tooltip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323)";}.ui-tooltip-jtools .ui-tooltip-titlebar,.ui-tooltip-jtools .ui-tooltip-content{background:transparent;color:white;border:0 dashed transparent;}.ui-tooltip-jtools .ui-tooltip-icon{border-color:#555;}.ui-tooltip-jtools .ui-tooltip-titlebar .ui-state-hover{border-color:#333;}.ui-tooltip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,0.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,0.4);box-shadow:4px 4px 5px rgba(0,0,0,0.4);}.ui-tooltip-cluetip .ui-tooltip-titlebar{background-color:#87876A;color:white;border:0 dashed transparent;}.ui-tooltip-cluetip .ui-tooltip-content{background-color:#D9D9C2;color:#111;border:0 dashed transparent;}.ui-tooltip-cluetip .ui-tooltip-icon{border-color:#808064;}.ui-tooltip-cluetip .ui-tooltip-titlebar .ui-state-hover{border-color:#696952;color:#696952;}.ui-tooltip-tipsy{border:0;}.ui-tooltip-tipsy .ui-tooltip-titlebar,.ui-tooltip-tipsy .ui-tooltip-content{_margin-bottom:0;.margin-bottom:0;background:transparent;background:rgba(0,0,0,.87);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000)";color:white;border:0 transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:bold;line-height:16px;text-shadow:0 1px black;}.ui-tooltip-tipsy .ui-tooltip-titlebar{padding:6px 35px 0 10;}.ui-tooltip-tipsy .ui-tooltip-content{padding:6px 10;}.ui-tooltip-tipsy .ui-tooltip-icon{border-color:#222;text-shadow:none;}.ui-tooltip-tipsy .ui-tooltip-titlebar .ui-state-hover{border-color:#303030;}.ui-tooltip-tipped .ui-tooltip-titlebar,.ui-tooltip-tipped .ui-tooltip-content{border:3px solid #959FA9;filter:none;-ms-filter:none;}.ui-tooltip-tipped .ui-tooltip-titlebar{background:#3A79B8;background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D)";color:white;font-weight:normal;font-family:serif;border-bottom-width:0;-moz-border-radius:3px 3px 0 0;-webkit-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;}.ui-tooltip-tipped .ui-tooltip-content{background-color:#F9F9F9;color:#454545;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;}.ui-tooltip-tipped .ui-tooltip-icon{border:2px solid #285589;background:#285589;}.ui-tooltip-tipped .ui-tooltip-icon .ui-icon{background-color:#FBFBFB;color:#555;}.ui-tooltip:not(.ie9haxors) div.ui-tooltip-content,.ui-tooltip:not(.ie9haxors) div.ui-tooltip-titlebar{filter:none;-ms-filter:none;} \ No newline at end of file +.ui-tooltip,.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;z-index:15000;}.ui-tooltip-fluid{display:block;visibility:hidden;position:static!important;float:left!important;}.ui-tooltip-content{position:relative;padding:5px 9px;overflow:hidden;border-width:1px;border-style:solid;text-align:left;word-wrap:break-word;overflow:hidden;}.ui-tooltip-titlebar{position:relative;min-height:14px;padding:5px 35px 5px 10px;overflow:hidden;border-width:1px 1px 0;border-style:solid;font-weight:bold;}.ui-tooltip-titlebar+.ui-tooltip-content{border-top-width:0!important;}/*!Default close button class */ .ui-tooltip-titlebar .ui-state-default{position:absolute;right:4px;top:50%;margin-top:-9px;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;}* html .ui-tooltip-titlebar .ui-state-default{top:16px;}.ui-tooltip-titlebar .ui-icon,.ui-tooltip-icon .ui-icon{display:block;text-indent:-1000em;}.ui-tooltip-icon,.ui-tooltip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.ui-tooltip-icon .ui-icon{width:18px;height:14px;text-align:center;text-indent:0;font:normal bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em;}/*!Default tooltip style */ .ui-tooltip-default .ui-tooltip-titlebar,.ui-tooltip-default .ui-tooltip-content{border-color:#F1D031;background-color:#FFFFA3;color:#555;}.ui-tooltip-default .ui-tooltip-titlebar{background-color:#FFEF93;}.ui-tooltip-default .ui-tooltip-icon{border-color:#CCC;background:#F1F1F1;color:#777;}.ui-tooltip-default .ui-tooltip-titlebar .ui-state-hover{border-color:#AAA;color:#111;}#qtip-overlay{position:fixed;left:-10000em;top:-10000em;}#qtip-overlay.blurs{cursor:pointer;}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:black;opacity:.7;filter:alpha(opacity=70);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";}.ui-tooltip .ui-tooltip-tip{margin:0 auto;overflow:hidden;background:transparent!important;border:0 dashed transparent!important;z-index:10;}.ui-tooltip .ui-tooltip-tip,.ui-tooltip .ui-tooltip-tip *{position:absolute;line-height:.1px!important;font-size:.1px!important;color:#123456;background:transparent;border:0 dashed transparent;}.ui-tooltip .ui-tooltip-tip canvas{top:0;left:0;}/*!Light tooltip style */ .ui-tooltip-light .ui-tooltip-titlebar,.ui-tooltip-light .ui-tooltip-content{border-color:#E2E2E2;color:#454545;}.ui-tooltip-light .ui-tooltip-content{background-color:white;}.ui-tooltip-light .ui-tooltip-titlebar{background-color:#f1f1f1;}/*!Dark tooltip style */ .ui-tooltip-dark .ui-tooltip-titlebar,.ui-tooltip-dark .ui-tooltip-content{border-color:#303030;color:#f3f3f3;}.ui-tooltip-dark .ui-tooltip-content{background-color:#505050;}.ui-tooltip-dark .ui-tooltip-titlebar{background-color:#404040;}.ui-tooltip-dark .ui-tooltip-icon{border-color:#444;}.ui-tooltip-dark .ui-tooltip-titlebar .ui-state-hover{border-color:#303030;}/*!Cream tooltip style */ .ui-tooltip-cream .ui-tooltip-titlebar,.ui-tooltip-cream .ui-tooltip-content{border-color:#F9E98E;color:#A27D35;}.ui-tooltip-cream .ui-tooltip-content{background-color:#FBF7AA;}.ui-tooltip-cream .ui-tooltip-titlebar{background-color:#F0DE7D;}.ui-tooltip-cream .ui-state-default .ui-tooltip-icon{background-position:-82px 0;}/*!Red tooltip style */ .ui-tooltip-red .ui-tooltip-titlebar,.ui-tooltip-red .ui-tooltip-content{border-color:#D95252;color:#912323;}.ui-tooltip-red .ui-tooltip-content{background-color:#F78B83;}.ui-tooltip-red .ui-tooltip-titlebar{background-color:#F06D65;}.ui-tooltip-red .ui-state-default .ui-tooltip-icon{background-position:-102px 0;}.ui-tooltip-red .ui-tooltip-icon{border-color:#D95252;}.ui-tooltip-red .ui-tooltip-titlebar .ui-state-hover{border-color:#D95252;}/*!Green tooltip style */ .ui-tooltip-green .ui-tooltip-titlebar,.ui-tooltip-green .ui-tooltip-content{border-color:#90D93F;color:#3F6219;}.ui-tooltip-green .ui-tooltip-content{background-color:#CAED9E;}.ui-tooltip-green .ui-tooltip-titlebar{background-color:#B0DE78;}.ui-tooltip-green .ui-state-default .ui-tooltip-icon{background-position:-42px 0;}/*!Blue tooltip style */ .ui-tooltip-blue .ui-tooltip-titlebar,.ui-tooltip-blue .ui-tooltip-content{border-color:#ADD9ED;color:#5E99BD;}.ui-tooltip-blue .ui-tooltip-content{background-color:#E5F6FE;}.ui-tooltip-blue .ui-tooltip-titlebar{background-color:#D0E9F5;}.ui-tooltip-blue .ui-state-default .ui-tooltip-icon{background-position:-2px 0;}/*!Add shadows to your tooltips in:FF3+,Chrome 2+,Opera 10.6+,IE6+,Safari 2+*/ .ui-tooltip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,0.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,0.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,0.15);}.ui-tooltip-shadow .ui-tooltip-titlebar,.ui-tooltip-shadow .ui-tooltip-content{filter:progid:DXImageTransform.Microsoft.Shadow(Color='gray',Direction=135,Strength=3);-ms-filter:"progid:DXImageTransform.Microsoft.Shadow(Color='gray',Direction=135,Strength=3)";_margin-bottom:-3px;.margin-bottom:-3px;}/*!Add rounded corners to your tooltips in:FF3+,Chrome 2+,Opera 10.6+,IE9+,Safari 2+*/ .ui-tooltip-rounded,.ui-tooltip-rounded .ui-tooltip-content,.ui-tooltip-tipsy,.ui-tooltip-tipsy .ui-tooltip-content,.ui-tooltip-youtube,.ui-tooltip-youtube .ui-tooltip-content{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.ui-tooltip-rounded .ui-tooltip-titlebar,.ui-tooltip-tipsy .ui-tooltip-titlebar,.ui-tooltip-youtube .ui-tooltip-titlebar{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0;}.ui-tooltip-rounded .ui-tooltip-titlebar+.ui-tooltip-content,.ui-tooltip-tipsy .ui-tooltip-titlebar+.ui-tooltip-content,.ui-tooltip-youtube .ui-tooltip-titlebar+.ui-tooltip-content{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0 0 5px 5px;border-radius:0 0 5px 5px;}/*!Youtube tooltip style */ .ui-tooltip-youtube{-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;}.ui-tooltip-youtube .ui-tooltip-titlebar,.ui-tooltip-youtube .ui-tooltip-content{_margin-bottom:0;.margin-bottom:0;background:transparent;background:rgba(0,0,0,0.85);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000)";color:white;border-color:#CCC;}.ui-tooltip-youtube .ui-tooltip-icon{border-color:#222;}.ui-tooltip-youtube .ui-tooltip-titlebar .ui-state-hover{border-color:#303030;}.ui-tooltip-jtools{background:#232323;background:rgba(0,0,0,0.7);background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333;}.ui-tooltip-jtools .ui-tooltip-titlebar{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A)";}.ui-tooltip-jtools .ui-tooltip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323)";}.ui-tooltip-jtools .ui-tooltip-titlebar,.ui-tooltip-jtools .ui-tooltip-content{background:transparent;color:white;border:0 dashed transparent;}.ui-tooltip-jtools .ui-tooltip-icon{border-color:#555;}.ui-tooltip-jtools .ui-tooltip-titlebar .ui-state-hover{border-color:#333;}.ui-tooltip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,0.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,0.4);box-shadow:4px 4px 5px rgba(0,0,0,0.4);}.ui-tooltip-cluetip .ui-tooltip-titlebar{background-color:#87876A;color:white;border:0 dashed transparent;}.ui-tooltip-cluetip .ui-tooltip-content{background-color:#D9D9C2;color:#111;border:0 dashed transparent;}.ui-tooltip-cluetip .ui-tooltip-icon{border-color:#808064;}.ui-tooltip-cluetip .ui-tooltip-titlebar .ui-state-hover{border-color:#696952;color:#696952;}.ui-tooltip-tipsy{border:0;}.ui-tooltip-tipsy .ui-tooltip-titlebar,.ui-tooltip-tipsy .ui-tooltip-content{_margin-bottom:0;.margin-bottom:0;background:transparent;background:rgba(0,0,0,.87);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000)";color:white;border:0 transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:bold;line-height:16px;text-shadow:0 1px black;}.ui-tooltip-tipsy .ui-tooltip-titlebar{padding:6px 35px 0 10;}.ui-tooltip-tipsy .ui-tooltip-content{padding:6px 10;}.ui-tooltip-tipsy .ui-tooltip-icon{border-color:#222;text-shadow:none;}.ui-tooltip-tipsy .ui-tooltip-titlebar .ui-state-hover{border-color:#303030;}.ui-tooltip-tipped .ui-tooltip-titlebar,.ui-tooltip-tipped .ui-tooltip-content{border:3px solid #959FA9;filter:none;-ms-filter:none;}.ui-tooltip-tipped .ui-tooltip-titlebar{background:#3A79B8;background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D)";color:white;font-weight:normal;font-family:serif;border-bottom-width:0;-moz-border-radius:3px 3px 0 0;-webkit-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;}.ui-tooltip-tipped .ui-tooltip-content{background-color:#F9F9F9;color:#454545;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;}.ui-tooltip-tipped .ui-tooltip-icon{border:2px solid #285589;background:#285589;}.ui-tooltip-tipped .ui-tooltip-icon .ui-icon{background-color:#FBFBFB;color:#555;}.ui-tooltip:not(.ie9haxors) div.ui-tooltip-content,.ui-tooltip:not(.ie9haxors) div.ui-tooltip-titlebar{filter:none;-ms-filter:none;} \ No newline at end of file diff --git a/dist/jquery.qtip.min.js b/dist/jquery.qtip.min.js index 6c273497..4a595d79 100644 --- a/dist/jquery.qtip.min.js +++ b/dist/jquery.qtip.min.js @@ -9,5 +9,5 @@ * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License * -* Date: Thu Aug 18 20:10:43 2011 +0100 -*//*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true *//*global window: false, jQuery: false, console: false */(function(a,b,c){function E(b){var c=this,d=b.elements,e=d.tooltip,f=".bgiframe-"+b.id;a.extend(c,{init:function(){d.bgiframe=a(''),d.bgiframe.appendTo(e),e.bind("tooltipmove"+f,c.adjust)},adjust:function(){var a=b.get("dimensions"),c=b.plugins.tip,f=d.tip,g,h;h=parseInt(e.css("border-left-width"),10)||0,h={left:-h,top:-h},c&&f&&(g=c.corner.precedance==="x"?["width","left"]:["height","top"],h[g[1]]-=f[g[0]]()),d.bgiframe.css(h).css(a)},destroy:function(){d.bgiframe.remove(),e.unbind(f)}}),c.init()}function D(c){var f=this,g=c.options.show.modal,i=c.elements,j=i.tooltip,k="#qtip-overlay",l=".qtipmodal",m=l+c.id,o="is-modal-qtip",q=a(document.body),r;c.checks.modal={"^show.modal.(on|blur)$":function(){f.init(),i.overlay.toggle(j.is(":visible"))}},a.extend(f,{init:function(){if(!g.on)return f;r=f.create(),j.attr(o,d).css("z-index",h.modal.zindex+a(n+"["+o+"]").length).unbind(l).unbind(m).bind("tooltipshow"+l+" tooltiphide"+l,function(b,c,d){var e=b.originalEvent;e&&b.type==="tooltiphide"&&/mouse(leave|enter)/.test(e.type)&&a(e.relatedTarget).closest(r[0]).length?b.preventDefault():f[b.type.replace("tooltip","")](b,d)}).bind("tooltipfocus"+l,function(b){if(!b.isDefaultPrevented()){var c=a(n).filter("["+o+"]"),d=h.modal.zindex+c.length,e=parseInt(j[0].style.zIndex,10);r[0].style.zIndex=d,c.each(function(){this.style.zIndex>e&&(this.style.zIndex-=1)}),c.end().filter("."+p).qtip("blur",b.originalEvent),j.addClass(p)[0].style.zIndex=d,b.preventDefault()}}).bind("tooltiphide"+l,function(b){a("["+o+"]").filter(":visible").not(j).last().qtip("focus",b)}),g.escape&&a(b).unbind(m).bind("keydown"+m,function(a){a.keyCode===27&&j.hasClass(p)&&c.hide(a)}),g.blur&&i.overlay.unbind(m).bind("click"+m,function(a){j.hasClass(p)&&c.hide(a)});return f},create:function(){var c=a(k);if(c.length){i.overlay=c;return c}r=i.overlay=a("
",{id:k.substr(1),html:"
",mousedown:function(){return e}}).insertBefore(a(n).first()),a(b).unbind(l).bind("resize"+l,function(){r.css({height:a(b).height(),width:a(b).width()})}).triggerHandler("resize");return r},toggle:function(b,c,h){if(b&&b.isDefaultPrevented())return f;var i=g.effect,k=c?"show":"hide",l=r.is(":visible"),p=a("["+o+"]").filter(":visible").not(j),s;r||(r=f.create());if(r.is(":animated")&&l===c||!c&&p.length)return f;c?(r.css({left:0,top:0}),r.toggleClass("blurs",g.blur),q.delegate("*","focusin"+m,function(b){a(b.target).closest(n)[0]!==j[0]&&a("a, :input, img",j).add(j).focus()})):q.undelegate("*","focusin"+m),r.stop(d,e),a.isFunction(i)?i.call(r,c):i===e?r[k]():r.fadeTo(parseInt(h,10)||90,c?1:0,function(){c||a(this).hide()}),c||r.queue(function(a){r.css({left:"",top:""}),a()});return f},show:function(a,b){return f.toggle(a,d,b)},hide:function(a,b){return f.toggle(a,e,b)},destroy:function(){var d=r;d&&(d=a("["+o+"]").not(j).length<1,d?(i.overlay.remove(),a(b).unbind(l)):i.overlay.unbind(l+c.id),q.undelegate("*","focusin"+m));return j.removeAttr(o).unbind(l)}}),f.init()}function C(b,g){function w(a){var b=a.precedance==="y",c=n[b?"width":"height"],d=n[b?"height":"width"],e=a.string().indexOf("center")>-1,f=c*(e?.5:1),g=Math.pow,h=Math.round,i,j,k,l=Math.sqrt(g(f,2)+g(d,2)),m=[p/f*l,p/d*l];m[2]=Math.sqrt(g(m[0],2)-g(p,2)),m[3]=Math.sqrt(g(m[1],2)-g(p,2)),i=l+m[2]+m[3]+(e?0:m[0]),j=i/l,k=[h(j*d),h(j*c)];return{height:k[b?0:1],width:k[b?1:0]}}function v(b){var c=k.titlebar&&b.y==="top",d=c?k.titlebar:k.content,e=a.browser.mozilla,f=e?"-moz-":a.browser.webkit?"-webkit-":"",g=b.y+(e?"":"-")+b.x,h=f+(e?"border-radius-"+g:"border-"+g+"-radius");return parseInt(d.css(h),10)||parseInt(l.css(h),10)||0}function u(a,b,c){b=b?b:a[a.precedance];var d=l.hasClass(r),e=k.titlebar&&a.y==="top",f=e?k.titlebar:k.content,g="border-"+b+"-width",h;l.addClass(r),h=parseInt(f.css(g),10),h=(c?h||parseInt(l.css(g),10):h)||0,l.toggleClass(r,d);return h}function t(f,g,h,l){if(k.tip){var n=a.extend({},i.corner),o=h.adjusted,p=b.options.position.adjust.method.split(" "),q=p[0],r=p[1]||p[0],s={left:e,top:e,x:0,y:0},t,u={},v;i.corner.fixed!==d&&(q==="shift"&&n.precedance==="x"&&o.left&&n.y!=="center"?n.precedance=n.precedance==="x"?"y":"x":q==="flip"&&o.left&&(n.x=n.x==="center"?o.left>0?"left":"right":n.x==="left"?"right":"left"),r==="shift"&&n.precedance==="y"&&o.top&&n.x!=="center"?n.precedance=n.precedance==="y"?"x":"y":r==="flip"&&o.top&&(n.y=n.y==="center"?o.top>0?"top":"bottom":n.y==="top"?"bottom":"top"),n.string()!==m.corner&&(m.top!==o.top||m.left!==o.left)&&i.update(n,e)),t=i.position(n,o),t.right!==c&&(t.left=-t.right),t.bottom!==c&&(t.top=-t.bottom),t.user=Math.max(0,j.offset);if(s.left=q==="shift"&&!!o.left)n.x==="center"?u["margin-left"]=s.x=t["margin-left"]-o.left:(v=t.right!==c?[o.left,-t.left]:[-o.left,t.left],(s.x=Math.max(v[0],v[1]))>v[0]&&(h.left-=o.left,s.left=e),u[t.right!==c?"right":"left"]=s.x);if(s.top=r==="shift"&&!!o.top)n.y==="center"?u["margin-top"]=s.y=t["margin-top"]-o.top:(v=t.bottom!==c?[o.top,-t.top]:[-o.top,t.top],(s.y=Math.max(v[0],v[1]))>v[0]&&(h.top-=o.top,s.top=e),u[t.bottom!==c?"bottom":"top"]=s.y);k.tip.css(u).toggle(!(s.x&&s.y||n.x==="center"&&s.y||n.y==="center"&&s.x)),h.left-=t.left.charAt?t.user:q!=="shift"||s.top||!s.left&&!s.top?t.left:0,h.top-=t.top.charAt?t.user:r!=="shift"||s.left||!s.left&&!s.top?t.top:0,m.left=o.left,m.top=o.top,m.corner=n.string()}}var i=this,j=b.options.style.tip,k=b.elements,l=k.tooltip,m={top:0,left:0,corner:""},n={width:j.width,height:j.height},o={},p=j.border||0,q=".qtip-tip",s=!!(a("")[0]||{}).getContext;i.corner=f,i.mimic=f,i.border=p,i.offset=j.offset,i.size=n,b.checks.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){i.init()||i.destroy(),b.reposition()},"^style.tip.(height|width)$":function(){n={width:j.width,height:j.height},i.create(),i.update(),b.reposition()},"^content.title.text|style.(classes|widget)$":function(){k.tip&&i.update()}},a.extend(i,{init:function(){var b=i.detectCorner()&&(s||a.browser.msie);b&&(i.create(),i.update(),l.unbind(q).bind("tooltipmove"+q,t));return b},detectCorner:function(){var a=j.corner,c=b.options.position,f=c.at,g=c.my.string?c.my.string():c.my;if(a===e||g===e&&f===e)return e;a===d?i.corner=new h.Corner(g):a.string||(i.corner=new h.Corner(a),i.corner.fixed=d);return i.corner.string()!=="centercenter"},detectColours:function(){var c,d,e,f=k.tip.css({backgroundColor:"",border:""}),g=i.corner,h=g[g.precedance],m="border-"+h+"-color",p="border"+h.charAt(0)+h.substr(1)+"Color",q=/rgba?\(0, 0, 0(, 0)?\)|transparent/i,s="background-color",t="transparent",u=a(document.body).css("color"),v=b.elements.content.css("color"),w=k.titlebar&&(g.y==="top"||g.y==="center"&&f.position().top+n.height/2+j.offset",{"class":"ui-tooltip-tip"}).css({width:b,height:c}).prependTo(l),s?a("").appendTo(k.tip)[0].getContext("2d").save():(d='',k.tip.html(d+d))},update:function(b,c){var g=k.tip,l=g.children(),m=n.width,q=n.height,r="px solid ",t="px dashed transparent",v=j.mimic,x=Math.round,y,z,A,C,D;b||(b=i.corner),v===e?v=b:(v=new h.Corner(v),v.precedance=b.precedance,v.x==="inherit"?v.x=b.x:v.y==="inherit"?v.y=b.y:v.x===v.y&&(v[b.precedance]=b[b.precedance])),y=v.precedance,i.detectColours(),o.border!=="transparent"&&o.border!=="#123456"?(p=u(b,f,d),j.border===0&&p>0&&(o.fill=o.border),i.border=p=j.border!==d?j.border:p):i.border=p=0,A=B(v,m,q),i.size=D=w(b),g.css(D),b.precedance==="y"?C=[x(v.x==="left"?p:v.x==="right"?D.width-m-p:(D.width-m)/2),x(v.y==="top"?D.height-q:0)]:C=[x(v.x==="left"?D.width-m:0),x(v.y==="top"?p:v.y==="bottom"?D.height-q-p:(D.height-q)/2)],s?(l.attr(D),z=l[0].getContext("2d"),z.restore(),z.save(),z.clearRect(0,0,3e3,3e3),z.translate(C[0],C[1]),z.beginPath(),z.moveTo(A[0][0],A[0][1]),z.lineTo(A[1][0],A[1][1]),z.lineTo(A[2][0],A[2][1]),z.closePath(),z.fillStyle=o.fill,z.strokeStyle=o.border,z.lineWidth=p*2,z.lineJoin="miter",z.miterLimit=100,p&&z.stroke(),z.fill()):(A="m"+A[0][0]+","+A[0][1]+" l"+A[1][0]+","+A[1][1]+" "+A[2][0]+","+A[2][1]+" xe",C[2]=p&&/^(r|b)/i.test(b.string())?parseFloat(a.browser.version,10)===8?2:1:0,l.css({antialias:""+(v.string().indexOf("center")>-1),left:C[0]-C[2]*Number(y==="x"),top:C[1]-C[2]*Number(y==="y"),width:m+p,height:q+p}).each(function(b){var c=a(this);c[c.prop?"prop":"attr"]({coordsize:m+p+" "+(q+p),path:A,fillcolor:o.fill,filled:!!b,stroked:!b}).css({display:p||b?"block":"none"}),!b&&c.html()===""&&c.html('')})),c!==e&&i.position(b)},position:function(b){var c=k.tip,f={},g=Math.max(0,j.offset),h,l,m;if(j.corner===e||!c)return e;b=b||i.corner,h=b.precedance,l=w(b),m=[b.x,b.y],h==="x"&&m.reverse(),a.each(m,function(a,c){var e,i;c==="center"?(e=h==="y"?"left":"top",f[e]="50%",f["margin-"+e]=-Math.round(l[h==="y"?"width":"height"]/2)+g):(e=u(b,c,d),i=v(b),f[c]=a?p?u(b,c):0:g+(i>e?i:0))}),f[b[h]]-=l[h==="x"?"width":"height"],c.css({top:"",bottom:"",left:"",right:"",margin:""}).css(f);return f},destroy:function(){k.tip&&k.tip.remove(),l.unbind(q)}}),i.init()}function B(a,b,c){var d=Math.ceil(b/2),e=Math.ceil(c/2),f={bottomright:[[0,0],[b,c],[b,0]],bottomleft:[[0,0],[b,0],[0,c]],topright:[[0,c],[b,0],[b,c]],topleft:[[0,0],[0,c],[b,c]],topcenter:[[0,c],[d,0],[b,c]],bottomcenter:[[0,0],[b,0],[d,c]],rightcenter:[[0,0],[b,e],[0,c]],leftcenter:[[b,0],[b,c],[0,e]]};f.lefttop=f.bottomright,f.righttop=f.bottomleft,f.leftbottom=f.topright,f.rightbottom=f.topleft;return f[a.string()]}function A(b){var c=this,f=b.elements.tooltip,g=b.options.content.ajax,h=".qtip-ajax",i=/)<[^<]*)*<\/script>/gi,j=d;b.checks.ajax={"^content.ajax":function(a,b,d){b==="ajax"&&(g=d),b==="once"?c.init():g&&g.url?c.load():f.unbind(h)}},a.extend(c,{init:function(){g&&g.url&&f.unbind(h)[g.once?"one":"bind"]("tooltipshow"+h,c.load);return c},load:function(d,h){function p(a,c,d){b.set("content.text",c+": "+d)}function o(c){l&&(c=a("
").append(c.replace(i,"")).find(l)),b.set("content.text",c)}function n(){m&&(f.css("visibility",""),h=e),a.isFunction(g.complete)&&g.complete.apply(this,arguments)}if(d&&d.isDefaultPrevented())return c;var j=g.url.indexOf(" "),k=g.url,l,m=g.once&&!g.loading&&h;m&&f.css("visibility","hidden"),j>-1&&(l=k.substr(j),k=k.substr(0,j)),a.ajax(a.extend({success:o,error:p,context:b},g,{url:k,complete:n}));return c}}),c.init()}function z(b,c){var i,j,k,l,m,n=a(this),o=a(document.body),p=this===document?o:n,q=n.metadata?n.metadata(c.metadata):f,r=c.metadata.type==="html5"&&q?q[c.metadata.name]:f,s=n.data(c.metadata.name||"qtipopts");try{s=typeof s==="string"?(new Function("return "+s))():s}catch(t){w("Unable to parse HTML5 attribute data: "+s)}l=a.extend(d,{},g.defaults,c,typeof s==="object"?x(s):f,x(r||q)),j=l.position,l.id=b;if("boolean"===typeof l.content.text){k=n.attr(l.content.attr);if(l.content.attr!==e&&k)l.content.text=k;else{w("Unable to locate content for tooltip! Aborting render of tooltip on element: ",n);return e}}j.container===e&&(j.container=o),j.target===e&&(j.target=p),l.show.target===e&&(l.show.target=p),l.show.solo===d&&(l.show.solo=o),l.hide.target===e&&(l.hide.target=p),l.position.viewport===d&&(l.position.viewport=j.container),j.at=new h.Corner(j.at),j.my=new h.Corner(j.my);if(a.data(this,"qtip"))if(l.overwrite)n.qtip("destroy");else if(l.overwrite===e)return e;l.suppress&&(m=a.attr(this,"title"))&&a(this).removeAttr("title").attr(u,m),i=new y(n,l,b,!!k),a.data(this,"qtip",i),n.bind("remove.qtip",function(){i.destroy()});return i}function y(s,t,w,y){function R(){var c=[t.show.target[0],t.hide.target[0],z.rendered&&G.tooltip[0],t.position.container[0],t.position.viewport[0],b,document];z.rendered?a([]).pushStack(a.grep(c,function(a){return typeof a==="object"})).unbind(F):t.show.target.unbind(F+"-create")}function Q(){function p(a){E.is(":visible")&&z.reposition(a)}function o(a){if(E.hasClass(m))return e;clearTimeout(z.timers.inactive),z.timers.inactive=setTimeout(function(){z.hide(a)},t.hide.inactive)}function l(b){if(E.hasClass(m)||C||D)return e;var d=a(b.relatedTarget||b.target),g=d.closest(n)[0]===E[0],h=d[0]===f.show[0];clearTimeout(z.timers.show),clearTimeout(z.timers.hide);c.target==="mouse"&&g||t.hide.fixed&&(/mouse(out|leave|move)/.test(b.type)&&(g||h))?(b.preventDefault(),b.stopImmediatePropagation()):t.hide.delay>0?z.timers.hide=setTimeout(function(){z.hide(b)},t.hide.delay):z.hide(b)}function k(a){if(E.hasClass(m))return e;f.show.trigger("qtip-"+w+"-inactive"),clearTimeout(z.timers.show),clearTimeout(z.timers.hide);var b=function(){z.toggle(d,a)};t.show.delay>0?z.timers.show=setTimeout(b,t.show.delay):b()}var c=t.position,f={show:t.show.target,hide:t.hide.target,viewport:a(c.viewport),document:a(document),window:a(b)},h={show:a.trim(""+t.show.event).split(" "),hide:a.trim(""+t.hide.event).split(" ")},j=a.browser.msie&&parseInt(a.browser.version,10)===6;E.bind("mouseenter"+F+" mouseleave"+F,function(a){var b=a.type==="mouseenter";b&&z.focus(a),E.toggleClass(q,b)}),t.hide.fixed&&(f.hide=f.hide.add(E),E.bind("mouseover"+F,function(){E.hasClass(m)||clearTimeout(z.timers.hide)})),/mouse(out|leave)/i.test(t.hide.event)?t.hide.leave==="window"&&f.window.bind("mouseout"+F,function(a){/select|option/.test(a.target)&&!a.relatedTarget&&z.hide(a)}):/mouse(over|enter)/i.test(t.show.event)&&f.hide.bind("mouseleave"+F,function(a){clearTimeout(z.timers.show)}),(""+t.hide.event).indexOf("unfocus")>-1&&f.document.bind("mousedown"+F,function(b){var c=a(b.target),d=!E.hasClass(m)&&E.is(":visible");c[0]!==E[0]&&c.parents(n).length===0&&c.add(s).length>1&&z.hide(b)}),"number"===typeof t.hide.inactive&&(f.show.bind("qtip-"+w+"-inactive",o),a.each(g.inactiveEvents,function(a,b){f.hide.add(G.tooltip).bind(b+F+"-inactive",o)})),a.each(h.hide,function(b,c){var d=a.inArray(c,h.show),e=a(f.hide);d>-1&&e.add(f.show).length===e.length||c==="unfocus"?(f.show.bind(c+F,function(a){E.is(":visible")?l(a):k(a)}),delete h.show[d]):f.hide.bind(c+F,l)}),a.each(h.show,function(a,b){f.show.bind(b+F,k)}),"number"===typeof t.hide.distance&&f.show.add(E).bind("mousemove"+F,function(a){var b=H.origin||{},c=t.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&z.hide(a)}),c.target==="mouse"&&(f.show.bind("mousemove"+F,function(a){i={pageX:a.pageX,pageY:a.pageY,type:"mousemove"}}),c.adjust.mouse&&(t.hide.event&&E.bind("mouseleave"+F,function(a){(a.relatedTarget||a.target)!==f.show[0]&&z.hide(a)}),f.document.bind("mousemove"+F,function(a){!E.hasClass(m)&&E.is(":visible")&&z.reposition(a||i)}))),(c.adjust.resize||f.viewport.length)&&(a.event.special.resize?f.viewport:f.window).bind("resize"+F,p),(f.viewport.length||j&&E.css("position")==="fixed")&&f.viewport.bind("scroll"+F,p)}function P(b,d){function g(b){function i(c){c&&(delete h[c.src],clearTimeout(z.timers.img[c.src]),a(c).unbind(F)),a.isEmptyObject(h)&&(z.redraw(),d!==e&&z.reposition(H.event),b())}var g,h={};if((g=f.find("img:not([height]):not([width])")).length===0)return i();g.each(function(b,d){h[d.src]===c&&(function e(){if(d.height||d.width)return i(d);z.timers.img[d.src]=setTimeout(e,700)}(),a(d).bind("error"+F+" load"+F,function(){i(this)}),h[d.src]=d)})}var f=G.content;if(!z.rendered||!b)return e;a.isFunction(b)&&(b=b.call(s,H.event,z)||""),b.jquery&&b.length>0?f.empty().append(b.css({display:"block"})):f.html(b),z.rendered<0?E.queue("fx",g):(D=0,g(a.noop));return z}function O(b,c){var d=G.title;if(!z.rendered||!b)return e;a.isFunction(b)&&(b=b.call(s,H.event,z));if(b===e)return K(e);b.jquery&&b.length>0?d.empty().append(b.css({display:"block"})):d.html(b),z.redraw(),c!==e&&z.rendered&&E.is(":visible")&&z.reposition(H.event)}function N(a){var b=G.button,c=G.title;if(!z.rendered)return e;a?(c||M(),L()):b.remove()}function M(){var b=B+"-title";G.titlebar&&K(),G.titlebar=a("
",{"class":k+"-titlebar "+(t.style.widget?"ui-widget-header":"")}).append(G.title=a("
",{id:b,"class":k+"-title","aria-atomic":d})).insertBefore(G.content),t.content.title.button?L():z.rendered&&z.redraw()}function L(){var b=t.content.title.button,c=typeof b==="string",d=c?b:"Close tooltip";G.button&&G.button.remove(),b.jquery?G.button=b:G.button=a("",{"class":"ui-state-default "+(t.style.widget?"":k+"-icon"),title:d,"aria-label":d}).prepend(a("",{"class":"ui-icon ui-icon-close",html:"×"})),G.button.appendTo(G.titlebar).attr("role","button").hover(function(b){a(this).toggleClass("ui-state-hover",b.type==="mouseenter")}).click(function(a){E.hasClass(m)||z.hide(a);return e}).bind("mousedown keydown mouseup keyup mouseout",function(b){a(this).toggleClass("ui-state-active ui-state-focus",b.type.substr(-4)==="down")}),z.redraw()}function K(a){G.title&&(G.titlebar.remove(),G.titlebar=G.title=G.button=f,a!==e&&z.reposition())}function J(){var a=t.style.widget;E.toggleClass(l,a).toggleClass(o,!a),G.content.toggleClass(l+"-content",a),G.titlebar&&G.titlebar.toggleClass(l+"-header",a),G.button&&G.button.toggleClass(k+"-icon",!a)}function I(a){var b=0,c,d=t,e=a.split(".");while(d=d[e[b++]])b0&&!a("#"+i).length&&(E[0].id=i,G.content[0].id=i+"-content",G.title[0].id=i+"-title")},"^content.text$":function(a,b,c){P(c)},"^content.title.text$":function(a,b,c){if(!c)return K();!G.title&&c&&M(),O(c)},"^content.title.button$":function(a,b,c){N(c)},"^position.(my|at)$":function(a,b,c){"string"===typeof c&&(a[b]=new h.Corner(c))},"^position.container$":function(a,b,c){z.rendered&&E.appendTo(c)},"^show.ready$":function(){z.rendered?z.toggle(d):z.render(1)},"^style.classes$":function(a,b,c){E.attr("class",k+" qtip ui-helper-reset "+c)},"^style.widget|content.title":J,"^events.(render|show|move|hide|focus|blur)$":function(b,c,d){E[(a.isFunction(d)?"":"un")+"bind"]("tooltip"+c,d)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){var a=t.position;E.attr("tracking",a.target==="mouse"&&a.adjust.mouse),R(),Q()}},a.extend(z,{render:function(b){if(z.rendered)return z;var c=t.content.title.text,f=t.position,g=a.Event("tooltiprender");a.attr(s[0],"aria-describedby",B),E=G.tooltip=a("
",{id:B,"class":k+" qtip ui-helper-reset "+o+" "+t.style.classes,width:t.style.width||"",height:t.style.height||"",tracking:f.target==="mouse"&&f.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":e,"aria-describedby":B+"-content","aria-hidden":d}).toggleClass(m,H.disabled).data("qtip",z).appendTo(t.position.container).append(G.content=a("
",{"class":k+"-content",id:B+"-content","aria-atomic":d})),z.rendered=-1,D=1,C=1,c&&(M(),O(c,e)),P(t.content.text,e),z.rendered=d,J(),a.each(t.events,function(b,c){a.isFunction(c)&&E.bind(b==="toggle"?"tooltipshow tooltiphide":"tooltip"+b,c)}),a.each(h,function(){this.initialize==="render"&&this(z)}),Q(),E.queue("fx",function(a){g.originalEvent=H.event,E.trigger(g,[z]),D=0,C=0,z.redraw(),(t.show.ready||b)&&z.toggle(d,H.event),a()});return z},get:function(a){var b,c;switch(a.toLowerCase()){case"dimensions":b={height:E.outerHeight(),width:E.outerWidth()};break;case"offset":b=h.offset(E,t.position.container);break;default:c=I(a.toLowerCase()),b=c[0][c[1]],b=b.precedance?b.string():b}return b},set:function(b,c){function m(a,b){var c,d,e;for(c in k)for(d in k[c])if(e=(new RegExp(d,"i")).exec(a))b.push(e),k[c][d].apply(z,b)}var g=/^position\.(my|at|adjust|target|container)|style|content|show\.ready/i,h=/^content\.(title|attr)|style/i,i=e,j=e,k=z.checks,l;"string"===typeof b?(l=b,b={},b[l]=c):b=a.extend(d,{},b),a.each(b,function(c,d){var e=I(c.toLowerCase()),f;f=e[0][e[1]],e[0][e[1]]="object"===typeof d&&d.nodeType?a(d):d,b[c]=[e[0],e[1],d,f],i=g.test(c)||i,j=h.test(c)||j}),x(t),C=D=1,a.each(b,m),C=D=0,E.is(":visible")&&z.rendered&&(i&&z.reposition(t.position.target==="mouse"?f:H.event),j&&z.redraw());return z},toggle:function(b,c){function q(){b?(a.browser.msie&&E[0].style.removeAttribute("filter"),E.css("overflow",""),"string"===typeof h.autofocus&&a(h.autofocus,E).focus(),p=a.Event("tooltipvisible"),p.originalEvent=c?H.event:f,E.trigger(p,[z])):E.css({display:"",visibility:"",opacity:"",left:"",top:""})}if(!z.rendered)if(b)z.render(1);else return z;var g=b?"show":"hide",h=t[g],j=E.is(":visible"),k=!c||t[g].target.length<2||H.target[0]===c.target,l=t.position,m=t.content,o,p;(typeof b).search("boolean|number")&&(b=!j);if(!E.is(":animated")&&j===b&&k)return z;if(c){if(/over|enter/.test(c.type)&&/out|leave/.test(H.event.type)&&c.target===t.show.target[0]&&E.has(c.relatedTarget).length)return z;H.event=a.extend({},c)}p=a.Event("tooltip"+g),p.originalEvent=c?H.event:f,E.trigger(p,[z,90]);if(p.isDefaultPrevented())return z;a.attr(E[0],"aria-hidden",!b),b?(H.origin=a.extend({},i),z.focus(c),a.isFunction(m.text)&&P(m.text,e),a.isFunction(m.title.text)&&O(m.title.text,e),!v&&l.target==="mouse"&&l.adjust.mouse&&(a(document).bind("mousemove.qtip",function(a){i={pageX:a.pageX,pageY:a.pageY,type:"mousemove"}}),v=d),z.reposition(c),h.solo&&a(n,h.solo).not(E).qtip("hide",p)):(clearTimeout(z.timers.show),delete H.origin,v&&!a(n+'[tracking="true"]:visible',h.solo).not(E).length&&(a(document).unbind("mousemove.qtip"),v=e),z.blur(c)),k&&E.stop(0,1),h.effect===e?(E[g](),q.call(E)):a.isFunction(h.effect)?(h.effect.call(E,z),E.queue("fx",function(a){q(),a()})):E.fadeTo(90,b?1:0,q),b&&h.target.trigger("qtip-"+w+"-inactive");return z},show:function(a){return z.toggle(d,a)},hide:function(a){return z.toggle(e,a)},focus:function(b){if(!z.rendered)return z;var c=a(n),d=parseInt(E[0].style.zIndex,10),e=g.zindex+c.length,f=a.extend({},b),h,i;E.hasClass(p)||(i=a.Event("tooltipfocus"),i.originalEvent=f,E.trigger(i,[z,e]),i.isDefaultPrevented()||(d!==e&&(c.each(function(){this.style.zIndex>d&&(this.style.zIndex=this.style.zIndex-1)}),c.filter("."+p).qtip("blur",f)),E.addClass(p)[0].style.zIndex=e));return z},blur:function(b){var c=a.extend({},b),d;E.removeClass(p),d=a.Event("tooltipblur"),d.originalEvent=c,E.trigger(d,[z]);return z},reposition:function(c,d){if(!z.rendered||C)return z;C=1;var f=t.position.target,g=t.position,j=g.my,l=g.at,m=g.adjust,n=m.method.split(" "),o=E.outerWidth(),p=E.outerHeight(),q=0,r=0,s=a.Event("tooltipmove"),u=E.css("position")==="fixed",v=g.viewport,w={left:0,top:0},x=z.plugins.tip,y={horizontal:n[0],vertical:n[1]||n[0],left:function(a){var b=y.horizontal==="shift",c=v.offset.left+v.scrollLeft,d=j.x==="left"?o:j.x==="right"?-o:-o/2,e=l.x==="left"?q:l.x==="right"?-q:-q/2,f=x&&x.size?x.size.width||0:0,g=x&&x.corner&&x.corner.precedance==="x"&&!b?f:0,h=c-a+g,i=a+o-v.width-c+g,k=d-(j.precedance==="x"||j.x===j.y?e:0),n=j.x==="center";b?(g=x&&x.corner&&x.corner.precedance==="y"?f:0,k=(j.x==="left"?1:-1)*d-g,w.left+=h>0?h:i>0?-i:0,w.left=Math.max(v.offset.left+(g&&x.corner.x==="center"?x.offset:0),a-k,Math.min(Math.max(v.offset.left+v.width,a+k),w.left))):(h>0&&(j.x!=="left"||i>0)?w.left-=k+(n?0:2*m.x):i>0&&(j.x!=="right"||h>0)&&(w.left-=n?-k:k+2*m.x),w.left!==a&&n&&(w.left-=m.x),w.lefti&&(w.left=a));return w.left-a},top:function(a){var b=y.vertical==="shift",c=v.offset.top+v.scrollTop,d=j.y==="top"?p:j.y==="bottom"?-p:-p/2,e=l.y==="top"?r:l.y==="bottom"?-r:-r/2,f=x&&x.size?x.size.height||0:0,g=x&&x.corner&&x.corner.precedance==="y"&&!b?f:0,h=c-a+g,i=a+p-v.height-c+g,k=d-(j.precedance==="y"||j.x===j.y?e:0),n=j.y==="center";b?(g=x&&x.corner&&x.corner.precedance==="x"?f:0,k=(j.y==="top"?1:-1)*d-g,w.top+=h>0?h:i>0?-i:0,w.top=Math.max(v.offset.top+(g&&x.corner.x==="center"?x.offset:0),a-k,Math.min(Math.max(v.offset.top+v.height,a+k),w.top))):(h>0&&(j.y!=="top"||i>0)?w.top-=k+(n?0:2*m.y):i>0&&(j.y!=="bottom"||h>0)&&(w.top-=n?-k:k+2*m.y),w.top!==a&&n&&(w.top-=m.y),w.top<0&&-w.top>i&&(w.top=a));return w.top-a}};if(a.isArray(f)&&f.length===2)l={x:"left",y:"top"},w={left:f[0],top:f[1]};else if(f==="mouse"&&(c&&c.pageX||H.event.pageX))l={x:"left",y:"top"},c=(c&&(c.type==="resize"||c.type==="scroll")?H.event:c&&c.pageX&&c.type==="mousemove"?c:i&&i.pageX&&(m.mouse||!c||!c.pageX)?{pageX:i.pageX,pageY:i.pageY}:!m.mouse&&H.origin&&H.origin.pageX?H.origin:c)||c||H.event||i||{},w={top:c.pageY,left:c.pageX};else{f==="event"?c&&c.target&&c.type!=="scroll"&&c.type!=="resize"?f=H.target=a(c.target):f=H.target:H.target=a(f),f=a(f).eq(0);if(f.length===0)return z;f[0]===document||f[0]===b?(q=h.iOS?b.innerWidth:f.width(),r=h.iOS?b.innerHeight:f.height(),f[0]===b&&(w={top:!u||h.iOS?(v||f).scrollTop():0,left:!u||h.iOS?(v||f).scrollLeft():0})):f.is("area")&&h.imagemap?w=h.imagemap(f,l):f[0].namespaceURI==="http://www.w3.org/2000/svg"&&h.svg?w=h.svg(f,l):(q=f.outerWidth(),r=f.outerHeight(),w=h.offset(f,g.container,u)),w.offset&&(q=w.width,r=w.height,w=w.offset),w.left+=l.x==="right"?q:l.x==="center"?q/2:0,w.top+=l.y==="bottom"?r:l.y==="center"?r/2:0}w.left+=m.x+(j.x==="right"?-o:j.x==="center"?-o/2:0),w.top+=m.y+(j.y==="bottom"?-p:j.y==="center"?-p/2:0),v.jquery&&f[0]!==b&&f[0]!==A&&y.vertical+y.horizontal!=="nonenone"?(v={elem:v,height:v[(v[0]===b?"h":"outerH")+"eight"](),width:v[(v[0]===b?"w":"outerW")+"idth"](),scrollLeft:u?0:v.scrollLeft(),scrollTop:u?0:v.scrollTop(),offset:v.offset()||{left:0,top:0}},w.adjusted={left:y.horizontal!=="none"?y.left(w.left):0,top:y.vertical!=="none"?y.top(w.top):0}):w.adjusted={left:0,top:0},E.attr("class",function(b,c){return a.attr(this,"class").replace(/ui-tooltip-pos-\w+/i,"")}).addClass(k+"-pos-"+j.abbreviation()),s.originalEvent=a.extend({},c),E.trigger(s,[z,w,v.elem||v]);if(s.isDefaultPrevented())return z;delete w.adjusted,d===e||isNaN(w.left)||isNaN(w.top)||f==="mouse"||!a.isFunction(g.effect)?E.css(w):a.isFunction(g.effect)&&(g.effect.call(E,z,a.extend({},w)),E.queue(function(b){a(this).css({opacity:"",height:""}),a.browser.msie&&this.style.removeAttribute("filter"),b()})),C=0;return z},redraw:function(){if(z.rendered<1||D)return z;var a=t.position.container,b,c,d,e;D=1,t.style.height&&E.css("height",t.style.height),t.style.width?E.css("width",t.style.width):(E.css("width","").addClass(r),c=E.width()+1,d=E.css("max-width")||"",e=E.css("min-width")||"",b=(d+e).indexOf("%")>-1?a.width()/100:0,d=(d.indexOf("%")>-1?b:1)*parseInt(d,10)||c,e=(e.indexOf("%")>-1?b:1)*parseInt(e,10)||0,c=d+e?Math.min(Math.max(c,e),d):c,E.css("width",Math.round(c)).removeClass(r)),D=0;return z},disable:function(b){"boolean"!==typeof b&&(b=!E.hasClass(m)&&!H.disabled),z.rendered?(E.toggleClass(m,b),a.attr(E[0],"aria-disabled",b)):H.disabled=!!b;return z},enable:function(){return z.disable(e)},destroy:function(){var b=s[0],c=a.attr(b,u);z.rendered&&(E.remove(),a.each(z.plugins,function(){this.destroy&&this.destroy()})),clearTimeout(z.timers.show),clearTimeout(z.timers.hide),R(),a.removeData(b,"qtip"),t.suppress&&c&&(a.attr(b,"title",c),s.removeAttr(u)),s.removeAttr("aria-describedby").unbind(".qtip"),delete j[z.id];return s}})}function x(b){var c;if(!b||"object"!==typeof b)return e;"object"!==typeof b.metadata&&(b.metadata={type:b.metadata});if("content"in b){if("object"!==typeof b.content||b.content.jquery)b.content={text:b.content};c=b.content.text||e,!a.isFunction(c)&&(!c&&!c.attr||c.length<1||"object"===typeof c&&!c.jquery)&&(b.content.text=e),"title"in b.content&&("object"!==typeof b.content.title&&(b.content.title={text:b.content.title}),c=b.content.title.text||e,!a.isFunction(c)&&(!c&&!c.attr||c.length<1||"object"===typeof c&&!c.jquery)&&(b.content.title.text=e))}"position"in b&&("object"!==typeof b.position&&(b.position={my:b.position,at:b.position})),"show"in b&&("object"!==typeof b.show&&(b.show.jquery?b.show={target:b.show}:b.show={event:b.show})),"hide"in b&&("object"!==typeof b.hide&&(b.hide.jquery?b.hide={target:b.hide}:b.hide={event:b.hide})),"style"in b&&("object"!==typeof b.style&&(b.style={classes:b.style})),a.each(h,function(){this.sanitize&&this.sanitize(b)});return b}function w(){w.history=w.history||[],w.history.push(arguments);if("object"===typeof console){var a=console[console.warn?"warn":"log"],b=Array.prototype.slice.call(arguments),c;typeof arguments[0]==="string"&&(b[0]="qTip2: "+b[0]),c=a.apply?a.apply(console,b):a(b)}}"use strict";var d=!0,e=!1,f=null,g,h,i,j={},k="ui-tooltip",l="ui-widget",m="ui-state-disabled",n="div.qtip."+k,o=k+"-default",p=k+"-focus",q=k+"-hover",r=k+"-fluid",s="-31000px",t="_replacedByqTip",u="oldtitle",v;g=a.fn.qtip=function(b,h,i){var j=(""+b).toLowerCase(),k=f,l=j==="disable"?[d]:a.makeArray(arguments).slice(1),m=l[l.length-1],n=this[0]?a.data(this[0],"qtip"):f;if(!arguments.length&&n||j==="api")return n;if("string"===typeof b){this.each(function(){var b=a.data(this,"qtip");if(!b)return d;m&&m.timeStamp&&(b.cache.event=m);if(j!=="option"&&j!=="options"||!h)b[j]&&b[j].apply(b[j],l);else if(a.isPlainObject(h)||i!==c)b.set(h,i);else{k=b.get(h);return e}});return k!==f?k:this}if("object"===typeof b||!arguments.length){n=x(a.extend(d,{},b));return g.bind.call(this,n,m)}},g.bind=function(b,f){return this.each(function(k){function r(b){function d(){p.render(typeof b==="object"||l.show.ready),m.show.add(m.hide).unbind(o)}if(p.cache.disabled)return e;p.cache.event=a.extend({},b),p.cache.target=b?a(b.target):[c],l.show.delay>0?(clearTimeout(p.timers.show),p.timers.show=setTimeout(d,l.show.delay),n.show!==n.hide&&m.hide.bind(n.hide,function(){clearTimeout(p.timers.show)})):d()}var l,m,n,o,p,q;q=a.isArray(b.id)?b.id[k]:b.id,q=!q||q===e||q.length<1||j[q]?g.nextid++:j[q]=q,o=".qtip-"+q+"-create",p=z.call(this,q,b);if(p===e)return d;l=p.options,a.each(h,function(){this.initialize==="initialize"&&this(p)}),m={show:l.show.target,hide:l.hide.target},n={show:a.trim(""+l.show.event).replace(/ /g,o+" ")+o,hide:a.trim(""+l.hide.event).replace(/ /g,o+" ")+o},/mouse(over|enter)/i.test(n.show)&&!/mouse(out|leave)/i.test(n.hide)&&(n.hide+=" mouseleave"+o),m.show.bind("mousemove"+o,function(a){i={pageX:a.pageX,pageY:a.pageY,type:"mousemove"}}),m.show.bind(n.show,r),(l.show.ready||l.prerender)&&r(f)})},h=g.plugins={Corner:function(a){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,"center").toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.precedance=a.charAt(0).search(/^(t|b)/)>-1?"y":"x",this.string=function(){return this.precedance==="y"?this.y+this.x:this.x+this.y},this.abbreviation=function(){var a=this.x.substr(0,1),b=this.y.substr(0,1);return a===b?a:a==="c"||a!=="c"&&b!=="c"?b+a:a+b}},offset:function(c,d,e){function l(a,b){f.left+=b*a.scrollLeft(),f.top+=b*a.scrollTop()}var f=c.offset(),g=d,i=0,j=document.body,k;if(g){do{g.css("position")!=="static"&&(k=g[0]===j?{left:parseInt(g.css("left"),10)||0,top:parseInt(g.css("top"),10)||0}:g.position(),f.left-=k.left+(parseInt(g.css("borderLeftWidth"),10)||0)+(parseInt(g.css("marginLeft"),10)||0),f.top-=k.top+(parseInt(g.css("borderTopWidth"),10)||0),i++);if(g[0]===j)break}while(g=g.offsetParent());d[0]!==j&&i>1&&l(d,1),(h.iOS<4.1&&h.iOS>3.1||!h.iOS&&e)&&l(a(b),-1)}return f},iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_","."))||e,fn:{attr:function(b,c){if(this.length){var d=this[0],e="title",f=a.data(d,"qtip");if(b===e&&"object"===typeof f&&f.options.suppress){if(arguments.length<2)return a.attr(d,u);f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",c);return this.attr(u,c)}}return a.fn["attr"+t].apply(this,arguments)},clone:function(b){var c=a([]),d="title",e=a.fn["clone"+t].apply(this,arguments);b||e.filter("["+u+"]").attr("title",function(){return a.attr(this,u)}).removeAttr(u);return e},remove:a.ui?f:function(b,c){a(this).each(function(){c||(!b||a.filter(b,[this]).length)&&a("*",this).add(this).each(function(){a(this).triggerHandler("remove")})})}}},a.each(h.fn,function(b,c){if(!c)return d;var e=a.fn[b+t]=a.fn[b];a.fn[b]=function(){return c.apply(this,arguments)||e.apply(this,arguments)}}),g.version="2.0.0pre",g.nextid=0,g.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),g.zindex=15e3,g.defaults={prerender:e,id:e,overwrite:d,suppress:d,content:{text:d,attr:"title",title:{text:e,button:e}},position:{my:"top left",at:"bottom right",target:e,container:e,viewport:e,adjust:{x:0,y:0,mouse:d,resize:d,method:"flip flip"},effect:function(b,c,d){a(this).animate(c,{duration:200,queue:e})}},show:{target:e,event:"mouseenter",effect:d,delay:90,solo:e,ready:e,autofocus:e},hide:{target:e,event:"mouseleave",effect:d,delay:0,fixed:e,inactive:e,leave:"window",distance:e},style:{classes:"",widget:e,width:e,height:e},events:{render:f,move:f,show:f,hide:f,toggle:f,visible:f,focus:f,blur:f}},h.ajax=function(a){var b=a.plugins.ajax;return"object"===typeof b?b:a.plugins.ajax=new A(a)},h.ajax.initialize="render",h.ajax.sanitize=function(a){var b=a.content,c;b&&"ajax"in b&&(c=b.ajax,typeof c!=="object"&&(c=a.content.ajax={url:c}),"boolean"!==typeof c.once&&c.once&&(c.once=!!c.once))},a.extend(d,g.defaults,{content:{ajax:{loading:d,once:d}}}),h.tip=function(a){var b=a.plugins.tip;return"object"===typeof b?b:a.plugins.tip=new C(a)},h.tip.initialize="render",h.tip.sanitize=function(a){var b=a.style,c;b&&"tip"in b&&(c=a.style.tip,typeof c!=="object"&&(a.style.tip={corner:c}),/string|boolean/i.test(typeof c.corner)||(c.corner=d),typeof c.width!=="number"&&delete c.width,typeof c.height!=="number"&&delete c.height,typeof c.border!=="number"&&c.border!==d&&delete c.border,typeof c.offset!=="number"&&delete c.offset)},a.extend(d,g.defaults,{style:{tip:{corner:d,mimic:e,width:6,height:6,border:d,offset:0}}}),h.imagemap=function(b,c){function l(a,b){var d=0,e=1,f=1,g=0,h=0,i=a.width,j=a.height;while(i>0&&j>0&&e>0&&f>0){i=Math.floor(i/2),j=Math.floor(j/2),c.x==="left"?e=i:c.x==="right"?e=a.width-i:e+=Math.floor(i/2),c.y==="top"?f=j:c.y==="bottom"?f=a.height-j:f+=Math.floor(j/2),d=b.length;while(d--){if(b.length<2)break;g=b[d][0]-a.offset.left,h=b[d][1]-a.offset.top,(c.x==="left"&&g>=e||c.x==="right"&&g<=e||c.x==="center"&&(ga.width-e)||c.y==="top"&&h>=f||c.y==="bottom"&&h<=f||c.y==="center"&&(ha.height-f))&&b.splice(d,1)}}return{left:b[0][0],top:b[0][1]}}b.jquery||(b=a(b));var d=b.attr("shape").toLowerCase(),e=b.attr("coords").split(","),f=[],g=a('img[usemap="#'+b.parent("map").attr("name")+'"]'),h=g.offset(),i={width:0,height:0,offset:{top:1e10,right:0,bottom:0,left:1e10}},j=0,k=0;h.left+=Math.ceil((g.outerWidth()-g.width())/2),h.top+=Math.ceil((g.outerHeight()-g.height())/2);if(d==="poly"){j=e.length;while(j--)k=[parseInt(e[--j],10),parseInt(e[j+1],10)],k[0]>i.offset.right&&(i.offset.right=k[0]),k[0]i.offset.bottom&&(i.offset.bottom=k[1]),k[1]-1,f=c*(e?.5:1),g=Math.pow,h=Math.round,i,j,k,l=Math.sqrt(g(f,2)+g(d,2)),m=[p/f*l,p/d*l];m[2]=Math.sqrt(g(m[0],2)-g(p,2)),m[3]=Math.sqrt(g(m[1],2)-g(p,2)),i=l+m[2]+m[3]+(e?0:m[0]),j=i/l,k=[h(j*d),h(j*c)];return{height:k[b?0:1],width:k[b?1:0]}}function v(b){var c=k.titlebar&&b.y==="top",d=c?k.titlebar:k.content,e=a.browser.mozilla,f=e?"-moz-":a.browser.webkit?"-webkit-":"",g=b.y+(e?"":"-")+b.x,h=f+(e?"border-radius-"+g:"border-"+g+"-radius");return parseInt(d.css(h),10)||parseInt(l.css(h),10)||0}function u(a,b,c){b=b?b:a[a.precedance];var d=l.hasClass(r),e=k.titlebar&&a.y==="top",f=e?k.titlebar:k.content,g="border-"+b+"-width",h;l.addClass(r),h=parseInt(f.css(g),10),h=(c?h||parseInt(l.css(g),10):h)||0,l.toggleClass(r,d);return h}function t(f,g,h,l){if(k.tip){var n=a.extend({},i.corner),o=h.adjusted,p=b.options.position.adjust.method.split(" "),q=p[0],r=p[1]||p[0],s={left:e,top:e,x:0,y:0},t,u={},v;i.corner.fixed!==d&&(q==="shift"&&n.precedance==="x"&&o.left&&n.y!=="center"?n.precedance=n.precedance==="x"?"y":"x":q==="flip"&&o.left&&(n.x=n.x==="center"?o.left>0?"left":"right":n.x==="left"?"right":"left"),r==="shift"&&n.precedance==="y"&&o.top&&n.x!=="center"?n.precedance=n.precedance==="y"?"x":"y":r==="flip"&&o.top&&(n.y=n.y==="center"?o.top>0?"top":"bottom":n.y==="top"?"bottom":"top"),n.string()!==m.corner&&(m.top!==o.top||m.left!==o.left)&&i.update(n,e)),t=i.position(n,o),t.right!==c&&(t.left=-t.right),t.bottom!==c&&(t.top=-t.bottom),t.user=Math.max(0,j.offset);if(s.left=q==="shift"&&!!o.left)n.x==="center"?u["margin-left"]=s.x=t["margin-left"]-o.left:(v=t.right!==c?[o.left,-t.left]:[-o.left,t.left],(s.x=Math.max(v[0],v[1]))>v[0]&&(h.left-=o.left,s.left=e),u[t.right!==c?"right":"left"]=s.x);if(s.top=r==="shift"&&!!o.top)n.y==="center"?u["margin-top"]=s.y=t["margin-top"]-o.top:(v=t.bottom!==c?[o.top,-t.top]:[-o.top,t.top],(s.y=Math.max(v[0],v[1]))>v[0]&&(h.top-=o.top,s.top=e),u[t.bottom!==c?"bottom":"top"]=s.y);k.tip.css(u).toggle(!(s.x&&s.y||n.x==="center"&&s.y||n.y==="center"&&s.x)),h.left-=t.left.charAt?t.user:q!=="shift"||s.top||!s.left&&!s.top?t.left:0,h.top-=t.top.charAt?t.user:r!=="shift"||s.left||!s.left&&!s.top?t.top:0,m.left=o.left,m.top=o.top,m.corner=n.string()}}var i=this,j=b.options.style.tip,k=b.elements,l=k.tooltip,m={top:0,left:0,corner:""},n={width:j.width,height:j.height},o={},p=j.border||0,q=".qtip-tip",s=!!(a("")[0]||{}).getContext;i.mimic=i.corner=f,i.border=p,i.offset=j.offset,i.size=n,b.checks.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){i.init()||i.destroy(),b.reposition()},"^style.tip.(height|width)$":function(){n={width:j.width,height:j.height},i.create(),i.update(),b.reposition()},"^content.title.text|style.(classes|widget)$":function(){k.tip&&i.update()}},a.extend(i,{init:function(){var b=i.detectCorner()&&(s||a.browser.msie);b&&(i.create(),i.update(),l.unbind(q).bind("tooltipmove"+q,t));return b},detectCorner:function(){var a=j.corner,c=b.options.position,f=c.at,g=c.my.string?c.my.string():c.my;if(a===e||g===e&&f===e)return e;a===d?i.corner=new h.Corner(g):a.string||(i.corner=new h.Corner(a),i.corner.fixed=d);return i.corner.string()!=="centercenter"},detectColours:function(){var c,d,e,f=k.tip.css({backgroundColor:"",border:""}),g=i.corner,h=g[g.precedance],m="border-"+h+"-color",p="border"+h.charAt(0)+h.substr(1)+"Color",q=/rgba?\(0, 0, 0(, 0)?\)|transparent/i,s="background-color",t="transparent",u=a(document.body).css("color"),v=b.elements.content.css("color"),w=k.titlebar&&(g.y==="top"||g.y==="center"&&f.position().top+n.height/2+j.offset",{"class":"ui-tooltip-tip"}).css({width:b,height:c}).prependTo(l),s?a("").appendTo(k.tip)[0].getContext("2d").save():(d='',k.tip.html(d+d))},update:function(b,c){var g=k.tip,l=g.children(),m=n.width,q=n.height,r="px solid ",t="px dashed transparent",v=j.mimic,x=Math.round,y,z,A,B,C;b||(b=i.corner),v===e?v=b:(v=new h.Corner(v),v.precedance=b.precedance,v.x==="inherit"?v.x=b.x:v.y==="inherit"?v.y=b.y:v.x===v.y&&(v[b.precedance]=b[b.precedance])),y=v.precedance,i.detectColours(),o.border!=="transparent"&&o.border!=="#123456"?(p=u(b,f,d),j.border===0&&p>0&&(o.fill=o.border),i.border=p=j.border!==d?j.border:p):i.border=p=0,A=D(v,m,q),i.size=C=w(b),g.css(C),b.precedance==="y"?B=[x(v.x==="left"?p:v.x==="right"?C.width-m-p:(C.width-m)/2),x(v.y==="top"?C.height-q:0)]:B=[x(v.x==="left"?C.width-m:0),x(v.y==="top"?p:v.y==="bottom"?C.height-q-p:(C.height-q)/2)],s?(l.attr(C),z=l[0].getContext("2d"),z.restore(),z.save(),z.clearRect(0,0,3e3,3e3),z.translate(B[0],B[1]),z.beginPath(),z.moveTo(A[0][0],A[0][1]),z.lineTo(A[1][0],A[1][1]),z.lineTo(A[2][0],A[2][1]),z.closePath(),z.fillStyle=o.fill,z.strokeStyle=o.border,z.lineWidth=p*2,z.lineJoin="miter",z.miterLimit=100,p&&z.stroke(),z.fill()):(A="m"+A[0][0]+","+A[0][1]+" l"+A[1][0]+","+A[1][1]+" "+A[2][0]+","+A[2][1]+" xe",B[2]=p&&/^(r|b)/i.test(b.string())?parseFloat(a.browser.version,10)===8?2:1:0,l.css({antialias:""+(v.string().indexOf("center")>-1),left:B[0]-B[2]*Number(y==="x"),top:B[1]-B[2]*Number(y==="y"),width:m+p,height:q+p}).each(function(b){var c=a(this);c[c.prop?"prop":"attr"]({coordsize:m+p+" "+(q+p),path:A,fillcolor:o.fill,filled:!!b,stroked:!b}).css({display:p||b?"block":"none"}),!b&&c.html()===""&&c.html('')})),c!==e&&i.position(b)},position:function(b){var c=k.tip,f={},g=Math.max(0,j.offset),h,l,m;if(j.corner===e||!c)return e;b=b||i.corner,h=b.precedance,l=w(b),m=[b.x,b.y],h==="x"&&m.reverse(),a.each(m,function(a,c){var e,i;c==="center"?(e=h==="y"?"left":"top",f[e]="50%",f["margin-"+e]=-Math.round(l[h==="y"?"width":"height"]/2)+g):(e=u(b,c,d),i=v(b),f[c]=a?p?u(b,c):0:g+(i>e?i:0))}),f[b[h]]-=l[h==="x"?"width":"height"],c.css({top:"",bottom:"",left:"",right:"",margin:""}).css(f);return f},destroy:function(){k.tip&&k.tip.remove(),l.unbind(q)}}),i.init()}function D(a,b,c){var d=Math.ceil(b/2),e=Math.ceil(c/2),f={bottomright:[[0,0],[b,c],[b,0]],bottomleft:[[0,0],[b,0],[0,c]],topright:[[0,c],[b,0],[b,c]],topleft:[[0,0],[0,c],[b,c]],topcenter:[[0,c],[d,0],[b,c]],bottomcenter:[[0,0],[b,0],[d,c]],rightcenter:[[0,0],[b,e],[0,c]],leftcenter:[[b,0],[b,c],[0,e]]};f.lefttop=f.bottomright,f.righttop=f.bottomleft,f.leftbottom=f.topright,f.rightbottom=f.topleft;return f[a.string()]}function C(c){var f=this,g=c.options.show.modal,i=c.elements,j=i.tooltip,k="#qtip-overlay",l=".qtipmodal",m=l+c.id,o="is-modal-qtip",q=a(document.body),r;c.checks.modal={"^show.modal.(on|blur)$":function(){f.init(),i.overlay.toggle(j.is(":visible"))}},a.extend(f,{init:function(){if(!g.on)return f;r=f.create(),j.attr(o,d).css("z-index",h.modal.zindex+a(n+"["+o+"]").length).unbind(l).unbind(m).bind("tooltipshow"+l+" tooltiphide"+l,function(b,c,d){var e=b.originalEvent;e&&b.type==="tooltiphide"&&/mouse(leave|enter)/.test(e.type)&&a(e.relatedTarget).closest(r[0]).length?b.preventDefault():f[b.type.replace("tooltip","")](b,d)}).bind("tooltipfocus"+l,function(b){if(!b.isDefaultPrevented()){var c=a(n).filter("["+o+"]"),d=h.modal.zindex+c.length,e=parseInt(j[0].style.zIndex,10);r[0].style.zIndex=d,c.each(function(){this.style.zIndex>e&&(this.style.zIndex-=1)}),c.end().filter("."+p).qtip("blur",b.originalEvent),j.addClass(p)[0].style.zIndex=d,b.preventDefault()}}).bind("tooltiphide"+l,function(b){a("["+o+"]").filter(":visible").not(j).last().qtip("focus",b)}),g.escape&&a(b).unbind(m).bind("keydown"+m,function(a){a.keyCode===27&&j.hasClass(p)&&c.hide(a)}),g.blur&&i.overlay.unbind(m).bind("click"+m,function(a){j.hasClass(p)&&c.hide(a)});return f},create:function(){var c=a(k);if(c.length)return i.overlay=c;r=i.overlay=a("
",{id:k.substr(1),html:"
",mousedown:function(){return e}}).insertBefore(a(n).first()),a(b).unbind(l).bind("resize"+l,function(){r.css({height:a(b).height(),width:a(b).width()})}).triggerHandler("resize");return r},toggle:function(b,c,h){if(b&&b.isDefaultPrevented())return f;var i=g.effect,k=c?"show":"hide",l=r.is(":visible"),p=a("["+o+"]").filter(":visible").not(j),s;r||(r=f.create());if(r.is(":animated")&&l===c||!c&&p.length)return f;c?(r.css({left:0,top:0}),r.toggleClass("blurs",g.blur),q.delegate("*","focusin"+m,function(b){a(b.target).closest(n)[0]!==j[0]&&a("a, :input, img",j).add(j).focus()})):q.undelegate("*","focusin"+m),r.stop(d,e),a.isFunction(i)?i.call(r,c):i===e?r[k]():r.fadeTo(parseInt(h,10)||90,c?1:0,function(){c||a(this).hide()}),c||r.queue(function(a){r.css({left:"",top:""}),a()});return f},show:function(a,b){return f.toggle(a,d,b)},hide:function(a,b){return f.toggle(a,e,b)},destroy:function(){var d=r;d&&(d=a("["+o+"]").not(j).length<1,d?(i.overlay.remove(),a(b).unbind(l)):i.overlay.unbind(l+c.id),q.undelegate("*","focusin"+m));return j.removeAttr(o).unbind(l)}}),f.init()}function B(b){var c=this,d=b.elements,e=d.tooltip,f=".bgiframe-"+b.id;a.extend(c,{init:function(){d.bgiframe=a(''),d.bgiframe.appendTo(e),e.bind("tooltipmove"+f,c.adjust)},adjust:function(){var a=b.get("dimensions"),c=b.plugins.tip,f=d.tip,g,h;h=parseInt(e.css("border-left-width"),10)||0,h={left:-h,top:-h},c&&f&&(g=c.corner.precedance==="x"?["width","left"]:["height","top"],h[g[1]]-=f[g[0]]()),d.bgiframe.css(h).css(a)},destroy:function(){d.bgiframe.remove(),e.unbind(f)}}),c.init()}function A(b){var c=this,f=b.elements.tooltip,g=b.options.content.ajax,h=".qtip-ajax",i=/)<[^<]*)*<\/script>/gi,j=d;b.checks.ajax={"^content.ajax":function(a,b,d){b==="ajax"&&(g=d),b==="once"?c.init():g&&g.url?c.load():f.unbind(h)}},a.extend(c,{init:function(){g&&g.url&&f.unbind(h)[g.once?"one":"bind"]("tooltipshow"+h,c.load);return c},load:function(d,h){function p(a,c,d){b.set("content.text",c+": "+d)}function o(c){l&&(c=a("
").append(c.replace(i,"")).find(l)),b.set("content.text",c)}function n(){m&&(f.css("visibility",""),h=e),a.isFunction(g.complete)&&g.complete.apply(this,arguments)}if(d&&d.isDefaultPrevented())return c;var j=g.url.indexOf(" "),k=g.url,l,m=g.once&&!g.loading&&h;m&&f.css("visibility","hidden"),j>-1&&(l=k.substr(j),k=k.substr(0,j)),a.ajax(a.extend({success:o,error:p,context:b},g,{url:k,complete:n}));return c}}),c.init()}function z(b,c){var i,j,k,l,m,n=a(this),o=a(document.body),p=this===document?o:n,q=n.metadata?n.metadata(c.metadata):f,r=c.metadata.type==="html5"&&q?q[c.metadata.name]:f,s=n.data(c.metadata.name||"qtipopts");try{s=typeof s==="string"?(new Function("return "+s))():s}catch(t){w("Unable to parse HTML5 attribute data: "+s)}l=a.extend(d,{},g.defaults,c,typeof s==="object"?x(s):f,x(r||q)),j=l.position,l.id=b;if("boolean"===typeof l.content.text){k=n.attr(l.content.attr);if(l.content.attr!==e&&k)l.content.text=k;else{w("Unable to locate content for tooltip! Aborting render of tooltip on element: ",n);return e}}j.container===e&&(j.container=o),j.target===e&&(j.target=p),l.show.target===e&&(l.show.target=p),l.show.solo===d&&(l.show.solo=o),l.hide.target===e&&(l.hide.target=p),l.position.viewport===d&&(l.position.viewport=j.container),j.at=new h.Corner(j.at),j.my=new h.Corner(j.my);if(a.data(this,"qtip"))if(l.overwrite)n.qtip("destroy");else if(l.overwrite===e)return e;l.suppress&&(m=a.attr(this,"title"))&&a(this).removeAttr("title").attr(u,m),i=new y(n,l,b,!!k),a.data(this,"qtip",i),n.bind("remove.qtip",function(){i.destroy()});return i}function y(s,t,w,y){function R(){var c=[t.show.target[0],t.hide.target[0],z.rendered&&G.tooltip[0],t.position.container[0],t.position.viewport[0],b,document];z.rendered?a([]).pushStack(a.grep(c,function(a){return typeof a==="object"})).unbind(F):t.show.target.unbind(F+"-create")}function Q(){function p(a){E.is(":visible")&&z.reposition(a)}function o(a){if(E.hasClass(m))return e;clearTimeout(z.timers.inactive),z.timers.inactive=setTimeout(function(){z.hide(a)},t.hide.inactive)}function l(b){if(E.hasClass(m)||C||D)return e;var d=a(b.relatedTarget||b.target),g=d.closest(n)[0]===E[0],h=d[0]===f.show[0];clearTimeout(z.timers.show),clearTimeout(z.timers.hide);c.target==="mouse"&&g||t.hide.fixed&&(/mouse(out|leave|move)/.test(b.type)&&(g||h))?(b.preventDefault(),b.stopImmediatePropagation()):t.hide.delay>0?z.timers.hide=setTimeout(function(){z.hide(b)},t.hide.delay):z.hide(b)}function k(a){if(E.hasClass(m))return e;f.show.trigger("qtip-"+w+"-inactive"),clearTimeout(z.timers.show),clearTimeout(z.timers.hide);var b=function(){z.toggle(d,a)};t.show.delay>0?z.timers.show=setTimeout(b,t.show.delay):b()}var c=t.position,f={show:t.show.target,hide:t.hide.target,viewport:a(c.viewport),document:a(document),window:a(b)},h={show:a.trim(""+t.show.event).split(" "),hide:a.trim(""+t.hide.event).split(" ")},j=a.browser.msie&&parseInt(a.browser.version,10)===6;E.bind("mouseenter"+F+" mouseleave"+F,function(a){var b=a.type==="mouseenter";b&&z.focus(a),E.toggleClass(q,b)}),t.hide.fixed&&(f.hide=f.hide.add(E),E.bind("mouseover"+F,function(){E.hasClass(m)||clearTimeout(z.timers.hide)})),/mouse(out|leave)/i.test(t.hide.event)?t.hide.leave==="window"&&f.window.bind("mouseout"+F,function(a){/select|option/.test(a.target)&&!a.relatedTarget&&z.hide(a)}):/mouse(over|enter)/i.test(t.show.event)&&f.hide.bind("mouseleave"+F,function(a){clearTimeout(z.timers.show)}),(""+t.hide.event).indexOf("unfocus")>-1&&f.document.bind("mousedown"+F,function(b){var c=a(b.target),d=!E.hasClass(m)&&E.is(":visible");c[0]!==E[0]&&c.parents(n).length===0&&c.add(s).length>1&&z.hide(b)}),"number"===typeof t.hide.inactive&&(f.show.bind("qtip-"+w+"-inactive",o),a.each(g.inactiveEvents,function(a,b){f.hide.add(G.tooltip).bind(b+F+"-inactive",o)})),a.each(h.hide,function(b,c){var d=a.inArray(c,h.show),e=a(f.hide);d>-1&&e.add(f.show).length===e.length||c==="unfocus"?(f.show.bind(c+F,function(a){E.is(":visible")?l(a):k(a)}),delete h.show[d]):f.hide.bind(c+F,l)}),a.each(h.show,function(a,b){f.show.bind(b+F,k)}),"number"===typeof t.hide.distance&&f.show.add(E).bind("mousemove"+F,function(a){var b=H.origin||{},c=t.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&z.hide(a)}),c.target==="mouse"&&(f.show.bind("mousemove"+F,function(a){i={pageX:a.pageX,pageY:a.pageY,type:"mousemove"}}),c.adjust.mouse&&(t.hide.event&&E.bind("mouseleave"+F,function(a){(a.relatedTarget||a.target)!==f.show[0]&&z.hide(a)}),f.document.bind("mousemove"+F,function(a){!E.hasClass(m)&&E.is(":visible")&&z.reposition(a||i)}))),(c.adjust.resize||f.viewport.length)&&(a.event.special.resize?f.viewport:f.window).bind("resize"+F,p),(f.viewport.length||j&&E.css("position")==="fixed")&&f.viewport.bind("scroll"+F,p)}function P(b,d){function g(b){function i(c){c&&(delete h[c.src],clearTimeout(z.timers.img[c.src]),a(c).unbind(F)),a.isEmptyObject(h)&&(z.redraw(),d!==e&&z.reposition(H.event),b())}var g,h={};if((g=f.find("img:not([height]):not([width])")).length===0)return i();g.each(function(b,d){h[d.src]===c&&(function e(){if(d.height||d.width)return i(d);z.timers.img[d.src]=setTimeout(e,700)}(),a(d).bind("error"+F+" load"+F,function(){i(this)}),h[d.src]=d)})}var f=G.content;if(!z.rendered||!b)return e;a.isFunction(b)&&(b=b.call(s,H.event,z)||""),b.jquery&&b.length>0?f.empty().append(b.css({display:"block"})):f.html(b),z.rendered<0?E.queue("fx",g):(D=0,g(a.noop));return z}function O(b,c){var d=G.title;if(!z.rendered||!b)return e;a.isFunction(b)&&(b=b.call(s,H.event,z));if(b===e)return K(e);b.jquery&&b.length>0?d.empty().append(b.css({display:"block"})):d.html(b),z.redraw(),c!==e&&z.rendered&&E.is(":visible")&&z.reposition(H.event)}function N(a){var b=G.button,c=G.title;if(!z.rendered)return e;a?(c||M(),L()):b.remove()}function M(){var b=B+"-title";G.titlebar&&K(),G.titlebar=a("
",{"class":k+"-titlebar "+(t.style.widget?"ui-widget-header":"")}).append(G.title=a("
",{id:b,"class":k+"-title","aria-atomic":d})).insertBefore(G.content),t.content.title.button?L():z.rendered&&z.redraw()}function L(){var b=t.content.title.button,c=typeof b==="string",d=c?b:"Close tooltip";G.button&&G.button.remove(),b.jquery?G.button=b:G.button=a("",{"class":"ui-state-default "+(t.style.widget?"":k+"-icon"),title:d,"aria-label":d}).prepend(a("",{"class":"ui-icon ui-icon-close",html:"×"})),G.button.appendTo(G.titlebar).attr("role","button").hover(function(b){a(this).toggleClass("ui-state-hover",b.type==="mouseenter")}).click(function(a){E.hasClass(m)||z.hide(a);return e}).bind("mousedown keydown mouseup keyup mouseout",function(b){a(this).toggleClass("ui-state-active ui-state-focus",b.type.substr(-4)==="down")}),z.redraw()}function K(a){G.title&&(G.titlebar.remove(),G.titlebar=G.title=G.button=f,a!==e&&z.reposition())}function J(){var a=t.style.widget;E.toggleClass(l,a).toggleClass(o,!a),G.content.toggleClass(l+"-content",a),G.titlebar&&G.titlebar.toggleClass(l+"-header",a),G.button&&G.button.toggleClass(k+"-icon",!a)}function I(a){var b=0,c,d=t,e=a.split(".");while(d=d[e[b++]])b0&&!a("#"+i).length&&(E[0].id=i,G.content[0].id=i+"-content",G.title[0].id=i+"-title")},"^content.text$":function(a,b,c){P(c)},"^content.title.text$":function(a,b,c){if(!c)return K();!G.title&&c&&M(),O(c)},"^content.title.button$":function(a,b,c){N(c)},"^position.(my|at)$":function(a,b,c){"string"===typeof c&&(a[b]=new h.Corner(c))},"^position.container$":function(a,b,c){z.rendered&&E.appendTo(c)},"^show.ready$":function(){z.rendered?z.toggle(d):z.render(1)},"^style.classes$":function(a,b,c){E.attr("class",k+" qtip ui-helper-reset "+c)},"^style.widget|content.title":J,"^events.(render|show|move|hide|focus|blur)$":function(b,c,d){E[(a.isFunction(d)?"":"un")+"bind"]("tooltip"+c,d)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){var a=t.position;E.attr("tracking",a.target==="mouse"&&a.adjust.mouse),R(),Q()}},a.extend(z,{render:function(b){if(z.rendered)return z;var c=t.content.title.text,f=t.position,g=a.Event("tooltiprender");a.attr(s[0],"aria-describedby",B),E=G.tooltip=a("
",{id:B,"class":k+" qtip ui-helper-reset "+o+" "+t.style.classes,width:t.style.width||"",height:t.style.height||"",tracking:f.target==="mouse"&&f.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":e,"aria-describedby":B+"-content","aria-hidden":d}).toggleClass(m,H.disabled).data("qtip",z).appendTo(t.position.container).append(G.content=a("
",{"class":k+"-content",id:B+"-content","aria-atomic":d})),z.rendered=-1,C=D=1,c&&(M(),O(c,e)),P(t.content.text,e),z.rendered=d,J(),a.each(t.events,function(b,c){a.isFunction(c)&&E.bind(b==="toggle"?"tooltipshow tooltiphide":"tooltip"+b,c)}),a.each(h,function(){this.initialize==="render"&&this(z)}),Q(),E.queue("fx",function(a){g.originalEvent=H.event,E.trigger(g,[z]),C=D=0,z.redraw(),(t.show.ready||b)&&z.toggle(d,H.event),a()});return z},get:function(a){var b,c;switch(a.toLowerCase()){case"dimensions":b={height:E.outerHeight(),width:E.outerWidth()};break;case"offset":b=h.offset(E,t.position.container);break;default:c=I(a.toLowerCase()),b=c[0][c[1]],b=b.precedance?b.string():b}return b},set:function(b,c){function m(a,b){var c,d,e;for(c in k)for(d in k[c])if(e=(new RegExp(d,"i")).exec(a))b.push(e),k[c][d].apply(z,b)}var g=/^position\.(my|at|adjust|target|container)|style|content|show\.ready/i,h=/^content\.(title|attr)|style/i,i=e,j=e,k=z.checks,l;"string"===typeof b?(l=b,b={},b[l]=c):b=a.extend(d,{},b),a.each(b,function(c,d){var e=I(c.toLowerCase()),f;f=e[0][e[1]],e[0][e[1]]="object"===typeof d&&d.nodeType?a(d):d,b[c]=[e[0],e[1],d,f],i=g.test(c)||i,j=h.test(c)||j}),x(t),C=D=1,a.each(b,m),C=D=0,E.is(":visible")&&z.rendered&&(i&&z.reposition(t.position.target==="mouse"?f:H.event),j&&z.redraw());return z},toggle:function(b,c){function q(){b?(a.browser.msie&&E[0].style.removeAttribute("filter"),E.css("overflow",""),"string"===typeof h.autofocus&&a(h.autofocus,E).focus(),p=a.Event("tooltipvisible"),p.originalEvent=c?H.event:f,E.trigger(p,[z])):E.css({display:"",visibility:"",opacity:"",left:"",top:""})}if(!z.rendered)if(b)z.render(1);else return z;var g=b?"show":"hide",h=t[g],j=E.is(":visible"),k=!c||t[g].target.length<2||H.target[0]===c.target,l=t.position,m=t.content,o,p;(typeof b).search("boolean|number")&&(b=!j);if(!E.is(":animated")&&j===b&&k)return z;if(c){if(/over|enter/.test(c.type)&&/out|leave/.test(H.event.type)&&c.target===t.show.target[0]&&E.has(c.relatedTarget).length)return z;H.event=a.extend({},c)}p=a.Event("tooltip"+g),p.originalEvent=c?H.event:f,E.trigger(p,[z,90]);if(p.isDefaultPrevented())return z;a.attr(E[0],"aria-hidden",!b),b?(H.origin=a.extend({},i),z.focus(c),a.isFunction(m.text)&&P(m.text,e),a.isFunction(m.title.text)&&O(m.title.text,e),!v&&l.target==="mouse"&&l.adjust.mouse&&(a(document).bind("mousemove.qtip",function(a){i={pageX:a.pageX,pageY:a.pageY,type:"mousemove"}}),v=d),z.reposition(c),h.solo&&a(n,h.solo).not(E).qtip("hide",p)):(clearTimeout(z.timers.show),delete H.origin,v&&!a(n+'[tracking="true"]:visible',h.solo).not(E).length&&(a(document).unbind("mousemove.qtip"),v=e),z.blur(c)),k&&E.stop(0,1),h.effect===e?(E[g](),q.call(E)):a.isFunction(h.effect)?(h.effect.call(E,z),E.queue("fx",function(a){q(),a()})):E.fadeTo(90,b?1:0,q),b&&h.target.trigger("qtip-"+w+"-inactive");return z},show:function(a){return z.toggle(d,a)},hide:function(a){return z.toggle(e,a)},focus:function(b){if(!z.rendered)return z;var c=a(n),d=parseInt(E[0].style.zIndex,10),e=g.zindex+c.length,f=a.extend({},b),h,i;E.hasClass(p)||(i=a.Event("tooltipfocus"),i.originalEvent=f,E.trigger(i,[z,e]),i.isDefaultPrevented()||(d!==e&&(c.each(function(){this.style.zIndex>d&&(this.style.zIndex=this.style.zIndex-1)}),c.filter("."+p).qtip("blur",f)),E.addClass(p)[0].style.zIndex=e));return z},blur:function(b){var c=a.extend({},b),d;E.removeClass(p),d=a.Event("tooltipblur"),d.originalEvent=c,E.trigger(d,[z]);return z},reposition:function(c,d){if(!z.rendered||C)return z;C=1;var f=t.position.target,g=t.position,j=g.my,l=g.at,m=g.adjust,n=m.method.split(" "),o=E.outerWidth(),p=E.outerHeight(),q=0,r=0,s=a.Event("tooltipmove"),u=E.css("position")==="fixed",v=g.viewport,w={left:0,top:0},x=z.plugins.tip,y={horizontal:n[0],vertical:n[1]||n[0],left:function(a){var b=y.horizontal==="shift",c=v.offset.left+v.scrollLeft,d=j.x==="left"?o:j.x==="right"?-o:-o/2,e=l.x==="left"?q:l.x==="right"?-q:-q/2,f=x&&x.size?x.size.width||0:0,g=x&&x.corner&&x.corner.precedance==="x"&&!b?f:0,h=c-a+g,i=a+o-v.width-c+g,k=d-(j.precedance==="x"||j.x===j.y?e:0),n=j.x==="center";b?(g=x&&x.corner&&x.corner.precedance==="y"?f:0,k=(j.x==="left"?1:-1)*d-g,w.left+=h>0?h:i>0?-i:0,w.left=Math.max(v.offset.left+(g&&x.corner.x==="center"?x.offset:0),a-k,Math.min(Math.max(v.offset.left+v.width,a+k),w.left))):(h>0&&(j.x!=="left"||i>0)?w.left-=k+(n?0:2*m.x):i>0&&(j.x!=="right"||h>0)&&(w.left-=n?-k:k+2*m.x),w.left!==a&&n&&(w.left-=m.x),w.lefti&&(w.left=a));return w.left-a},top:function(a){var b=y.vertical==="shift",c=v.offset.top+v.scrollTop,d=j.y==="top"?p:j.y==="bottom"?-p:-p/2,e=l.y==="top"?r:l.y==="bottom"?-r:-r/2,f=x&&x.size?x.size.height||0:0,g=x&&x.corner&&x.corner.precedance==="y"&&!b?f:0,h=c-a+g,i=a+p-v.height-c+g,k=d-(j.precedance==="y"||j.x===j.y?e:0),n=j.y==="center";b?(g=x&&x.corner&&x.corner.precedance==="x"?f:0,k=(j.y==="top"?1:-1)*d-g,w.top+=h>0?h:i>0?-i:0,w.top=Math.max(v.offset.top+(g&&x.corner.x==="center"?x.offset:0),a-k,Math.min(Math.max(v.offset.top+v.height,a+k),w.top))):(h>0&&(j.y!=="top"||i>0)?w.top-=k+(n?0:2*m.y):i>0&&(j.y!=="bottom"||h>0)&&(w.top-=n?-k:k+2*m.y),w.top!==a&&n&&(w.top-=m.y),w.top<0&&-w.top>i&&(w.top=a));return w.top-a}};if(a.isArray(f)&&f.length===2)l={x:"left",y:"top"},w={left:f[0],top:f[1]};else if(f==="mouse"&&(c&&c.pageX||H.event.pageX))l={x:"left",y:"top"},c=(c&&(c.type==="resize"||c.type==="scroll")?H.event:c&&c.pageX&&c.type==="mousemove"?c:i&&i.pageX&&(m.mouse||!c||!c.pageX)?{pageX:i.pageX,pageY:i.pageY}:!m.mouse&&H.origin&&H.origin.pageX?H.origin:c)||c||H.event||i||{},w={top:c.pageY,left:c.pageX};else{f==="event"?c&&c.target&&c.type!=="scroll"&&c.type!=="resize"?f=H.target=a(c.target):f=H.target:H.target=a(f),f=a(f).eq(0);if(f.length===0)return z;f[0]===document||f[0]===b?(q=h.iOS?b.innerWidth:f.width(),r=h.iOS?b.innerHeight:f.height(),f[0]===b&&(w={top:!u||h.iOS?(v||f).scrollTop():0,left:!u||h.iOS?(v||f).scrollLeft():0})):f.is("area")&&h.imagemap?w=h.imagemap(f,l):f[0].namespaceURI==="http://www.w3.org/2000/svg"&&h.svg?w=h.svg(f,l):(q=f.outerWidth(),r=f.outerHeight(),w=h.offset(f,g.container,u)),w.offset&&(q=w.width,r=w.height,w=w.offset),w.left+=l.x==="right"?q:l.x==="center"?q/2:0,w.top+=l.y==="bottom"?r:l.y==="center"?r/2:0}w.left+=m.x+(j.x==="right"?-o:j.x==="center"?-o/2:0),w.top+=m.y+(j.y==="bottom"?-p:j.y==="center"?-p/2:0),v.jquery&&f[0]!==b&&f[0]!==A&&y.vertical+y.horizontal!=="nonenone"?(v={elem:v,height:v[(v[0]===b?"h":"outerH")+"eight"](),width:v[(v[0]===b?"w":"outerW")+"idth"](),scrollLeft:u?0:v.scrollLeft(),scrollTop:u?0:v.scrollTop(),offset:v.offset()||{left:0,top:0}},w.adjusted={left:y.horizontal!=="none"?y.left(w.left):0,top:y.vertical!=="none"?y.top(w.top):0}):w.adjusted={left:0,top:0},E.attr("class",function(b,c){return a.attr(this,"class").replace(/ui-tooltip-pos-\w+/i,"")}).addClass(k+"-pos-"+j.abbreviation()),s.originalEvent=a.extend({},c),E.trigger(s,[z,w,v.elem||v]);if(s.isDefaultPrevented())return z;delete w.adjusted,d===e||isNaN(w.left)||isNaN(w.top)||f==="mouse"||!a.isFunction(g.effect)?E.css(w):a.isFunction(g.effect)&&(g.effect.call(E,z,a.extend({},w)),E.queue(function(b){a(this).css({opacity:"",height:""}),a.browser.msie&&this.style.removeAttribute("filter"),b()})),C=0;return z},redraw:function(){if(z.rendered<1||D)return z;var a=t.position.container,b,c,d,e;D=1,t.style.height&&E.css("height",t.style.height),t.style.width?E.css("width",t.style.width):(E.css("width","").addClass(r),c=E.width()+1,d=E.css("max-width")||"",e=E.css("min-width")||"",b=(d+e).indexOf("%")>-1?a.width()/100:0,d=(d.indexOf("%")>-1?b:1)*parseInt(d,10)||c,e=(e.indexOf("%")>-1?b:1)*parseInt(e,10)||0,c=d+e?Math.min(Math.max(c,e),d):c,E.css("width",Math.round(c)).removeClass(r)),D=0;return z},disable:function(b){"boolean"!==typeof b&&(b=!E.hasClass(m)&&!H.disabled),z.rendered?(E.toggleClass(m,b),a.attr(E[0],"aria-disabled",b)):H.disabled=!!b;return z},enable:function(){return z.disable(e)},destroy:function(){var b=s[0],c=a.attr(b,u);z.rendered&&(E.remove(),a.each(z.plugins,function(){this.destroy&&this.destroy()})),clearTimeout(z.timers.show),clearTimeout(z.timers.hide),R(),a.removeData(b,"qtip"),t.suppress&&c&&(a.attr(b,"title",c),s.removeAttr(u)),s.removeAttr("aria-describedby").unbind(".qtip"),delete j[z.id];return s}})}function x(b){var c;if(!b||"object"!==typeof b)return e;"object"!==typeof b.metadata&&(b.metadata={type:b.metadata});if("content"in b){if("object"!==typeof b.content||b.content.jquery)b.content={text:b.content};c=b.content.text||e,!a.isFunction(c)&&(!c&&!c.attr||c.length<1||"object"===typeof c&&!c.jquery)&&(b.content.text=e),"title"in b.content&&("object"!==typeof b.content.title&&(b.content.title={text:b.content.title}),c=b.content.title.text||e,!a.isFunction(c)&&(!c&&!c.attr||c.length<1||"object"===typeof c&&!c.jquery)&&(b.content.title.text=e))}"position"in b&&("object"!==typeof b.position&&(b.position={my:b.position,at:b.position})),"show"in b&&("object"!==typeof b.show&&(b.show.jquery?b.show={target:b.show}:b.show={event:b.show})),"hide"in b&&("object"!==typeof b.hide&&(b.hide.jquery?b.hide={target:b.hide}:b.hide={event:b.hide})),"style"in b&&("object"!==typeof b.style&&(b.style={classes:b.style})),a.each(h,function(){this.sanitize&&this.sanitize(b)});return b}function w(){w.history=w.history||[],w.history.push(arguments);if("object"===typeof console){var a=console[console.warn?"warn":"log"],b=Array.prototype.slice.call(arguments),c;typeof arguments[0]==="string"&&(b[0]="qTip2: "+b[0]),c=a.apply?a.apply(console,b):a(b)}}"use strict";var d=!0,e=!1,f=null,g,h,i,j={},k="ui-tooltip",l="ui-widget",m="ui-state-disabled",n="div.qtip."+k,o=k+"-default",p=k+"-focus",q=k+"-hover",r=k+"-fluid",s="-31000px",t="_replacedByqTip",u="oldtitle",v;g=a.fn.qtip=function(b,h,i){var j=(""+b).toLowerCase(),k=f,l=j==="disable"?[d]:a.makeArray(arguments).slice(1),m=l[l.length-1],n=this[0]?a.data(this[0],"qtip"):f;if(!arguments.length&&n||j==="api")return n;if("string"===typeof b){this.each(function(){var b=a.data(this,"qtip");if(!b)return d;m&&m.timeStamp&&(b.cache.event=m);if(j!=="option"&&j!=="options"||!h)b[j]&&b[j].apply(b[j],l);else if(a.isPlainObject(h)||i!==c)b.set(h,i);else{k=b.get(h);return e}});return k!==f?k:this}if("object"===typeof b||!arguments.length){n=x(a.extend(d,{},b));return g.bind.call(this,n,m)}},g.bind=function(b,f){return this.each(function(k){function r(b){function d(){p.render(typeof b==="object"||l.show.ready),m.show.add(m.hide).unbind(o)}if(p.cache.disabled)return e;p.cache.event=a.extend({},b),p.cache.target=b?a(b.target):[c],l.show.delay>0?(clearTimeout(p.timers.show),p.timers.show=setTimeout(d,l.show.delay),n.show!==n.hide&&m.hide.bind(n.hide,function(){clearTimeout(p.timers.show)})):d()}var l,m,n,o,p,q;q=a.isArray(b.id)?b.id[k]:b.id,q=!q||q===e||q.length<1||j[q]?g.nextid++:j[q]=q,o=".qtip-"+q+"-create",p=z.call(this,q,b);if(p===e)return d;l=p.options,a.each(h,function(){this.initialize==="initialize"&&this(p)}),m={show:l.show.target,hide:l.hide.target},n={show:a.trim(""+l.show.event).replace(/ /g,o+" ")+o,hide:a.trim(""+l.hide.event).replace(/ /g,o+" ")+o},/mouse(over|enter)/i.test(n.show)&&!/mouse(out|leave)/i.test(n.hide)&&(n.hide+=" mouseleave"+o),m.show.bind("mousemove"+o,function(a){i={pageX:a.pageX,pageY:a.pageY,type:"mousemove"}}),m.show.bind(n.show,r),(l.show.ready||l.prerender)&&r(f)})},h=g.plugins={Corner:function(a){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,"center").toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.precedance=a.charAt(0).search(/^(t|b)/)>-1?"y":"x",this.string=function(){return this.precedance==="y"?this.y+this.x:this.x+this.y},this.abbreviation=function(){var a=this.x.substr(0,1),b=this.y.substr(0,1);return a===b?a:a==="c"||a!=="c"&&b!=="c"?b+a:a+b}},offset:function(c,d,e){function l(a,b){f.left+=b*a.scrollLeft(),f.top+=b*a.scrollTop()}var f=c.offset(),g=d,i=0,j=document.body,k;if(g){do{g.css("position")!=="static"&&(k=g[0]===j?{left:parseInt(g.css("left"),10)||0,top:parseInt(g.css("top"),10)||0}:g.position(),f.left-=k.left+(parseInt(g.css("borderLeftWidth"),10)||0)+(parseInt(g.css("marginLeft"),10)||0),f.top-=k.top+(parseInt(g.css("borderTopWidth"),10)||0),++i);if(g[0]===j)break}while(g=g.offsetParent());d[0]!==j&&i>1&&l(d,1),(h.iOS<4.1&&h.iOS>3.1||!h.iOS&&e)&&l(a(b),-1)}return f},iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_","."))||e,fn:{attr:function(b,c){if(this.length){var d=this[0],e="title",f=a.data(d,"qtip");if(b===e&&"object"===typeof f&&f.options.suppress){if(arguments.length<2)return a.attr(d,u);f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",c);return this.attr(u,c)}}return a.fn["attr"+t].apply(this,arguments)},clone:function(b){var c=a([]),d="title",e=a.fn["clone"+t].apply(this,arguments);b||e.filter("["+u+"]").attr("title",function(){return a.attr(this,u)}).removeAttr(u);return e},remove:a.ui?f:function(b,c){a(this).each(function(){c||(!b||a.filter(b,[this]).length)&&a("*",this).add(this).each(function(){a(this).triggerHandler("remove")})})}}},a.each(h.fn,function(b,c){if(!c)return d;var e=a.fn[b+t]=a.fn[b];a.fn[b]=function(){return c.apply(this,arguments)||e.apply(this,arguments)}}),g.version="2.0.0pre",g.nextid=0,g.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),g.zindex=15e3,g.defaults={prerender:e,id:e,overwrite:d,suppress:d,content:{text:d,attr:"title",title:{text:e,button:e}},position:{my:"top left",at:"bottom right",target:e,container:e,viewport:e,adjust:{x:0,y:0,mouse:d,resize:d,method:"flip flip"},effect:function(b,c,d){a(this).animate(c,{duration:200,queue:e})}},show:{target:e,event:"mouseenter",effect:d,delay:90,solo:e,ready:e,autofocus:e},hide:{target:e,event:"mouseleave",effect:d,delay:0,fixed:e,inactive:e,leave:"window",distance:e},style:{classes:"",widget:e,width:e,height:e},events:{render:f,move:f,show:f,hide:f,toggle:f,visible:f,focus:f,blur:f}},h.ajax=function(a){var b=a.plugins.ajax;return"object"===typeof b?b:a.plugins.ajax=new A(a)},h.ajax.initialize="render",h.ajax.sanitize=function(a){var b=a.content,c;b&&"ajax"in b&&(c=b.ajax,typeof c!=="object"&&(c=a.content.ajax={url:c}),"boolean"!==typeof c.once&&c.once&&(c.once=!!c.once))},a.extend(d,g.defaults,{content:{ajax:{loading:d,once:d}}}),h.bgiframe=function(b){var c=a.browser,d=b.plugins.bgiframe;if(a("select, object").length<1||(!c.msie||c.version.charAt(0)!=="6"))return e;return"object"===typeof d?d:b.plugins.bgiframe=new B(b)},h.bgiframe.initialize="render",h.imagemap=function(b,c){function l(a,b){var d=0,e=1,f=1,g=0,h=0,i=a.width,j=a.height;while(i>0&&j>0&&e>0&&f>0){i=Math.floor(i/2),j=Math.floor(j/2),c.x==="left"?e=i:c.x==="right"?e=a.width-i:e+=Math.floor(i/2),c.y==="top"?f=j:c.y==="bottom"?f=a.height-j:f+=Math.floor(j/2),d=b.length;while(d--){if(b.length<2)break;g=b[d][0]-a.offset.left,h=b[d][1]-a.offset.top,(c.x==="left"&&g>=e||c.x==="right"&&g<=e||c.x==="center"&&(ga.width-e)||c.y==="top"&&h>=f||c.y==="bottom"&&h<=f||c.y==="center"&&(ha.height-f))&&b.splice(d,1)}}return{left:b[0][0],top:b[0][1]}}b.jquery||(b=a(b));var d=b.attr("shape").toLowerCase(),e=b.attr("coords").split(","),f=[],g=a('img[usemap="#'+b.parent("map").attr("name")+'"]'),h=g.offset(),i={width:0,height:0,offset:{top:1e10,right:0,bottom:0,left:1e10}},j=0,k=0;h.left+=Math.ceil((g.outerWidth()-g.width())/2),h.top+=Math.ceil((g.outerHeight()-g.height())/2);if(d==="poly"){j=e.length;while(j--)k=[parseInt(e[--j],10),parseInt(e[j+1],10)],k[0]>i.offset.right&&(i.offset.right=k[0]),k[0]i.offset.bottom&&(i.offset.bottom=k[1]),k[1]35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(7(a,b,c){7 E(b){U c=X,d=b.37,e=d.1A,f=".26-"+b.1z;a.1t(c,{25:7(){d.26=a(\'<5O 21="1E-1A-26" 8p="0" 8h="-1" 34="8i:\\\'\\\';" 17="2L:35; 19:4V; z-5l:-1; 24:8d(4v=0); -89-24:"8b:8k.8F.8m(8o=0)";">\'),d.26.3o(e),e.1b("4p"+f,c.1U)},1U:7(){U a=b.4E("5i"),c=b.1N.1h,f=d.1h,g,h;h=1y(e.15("1i-S-11"),10)||0,h={S:-h,9:-h},c&&f&&(g=c.1g.1k==="x"?["11","S"]:["14","9"],h[g[1]]-=f[g[0]]()),d.26.15(h).15(a)},2p:7(){d.26.20(),e.1v(f)}}),c.25()}7 D(c){U f=X,g=c.2i.V.1B,i=c.37,j=i.1A,k="#1j-2P",l=".8q",m=l+c.1z,o="1J-1B-1j",q=a(1H.3s),r;c.2Z.1B={"^V.1B.(2U|2b)$":7(){f.25(),i.2P.1P(j.1J(":1K"))}},a.1t(f,{25:7(){Y(!g.2U)T f;r=f.2t(),j.1d(o,d).15("z-5l",h.1B.2W+a(n+"["+o+"]").1a).1v(l).1v(m).1b("4h"+l+" 3K"+l,7(b,c,d){U e=b.2z;e&&b.1x==="3K"&&/1q(2v|3O)/.1C(e.1x)&&a(e.3j).4d(r[0]).1a?b.4e():f[b.1x.2m("1A","")](b,d)}).1b("5r"+l,7(b){Y(!b.3b()){U c=a(n).24("["+o+"]"),d=h.1B.2W+c.1a,e=1y(j[0].17.2e,10);r[0].17.2e=d,c.1u(7(){X.17.2e>e&&(X.17.2e-=1)}),c.8r().24("."+p).1j("2b",b.2z),j.3c(p)[0].17.2e=d,b.4e()}}).1b("3K"+l,7(b){a("["+o+"]").24(":1K").2R(j).8s().1j("28",b)}),g.58&&a(b).1v(m).1b("59"+m,7(a){a.8t===27&&j.1Q(p)&&c.W(a)}),g.2b&&i.2P.1v(m).1b("4n"+m,7(a){j.1Q(p)&&c.W(a)});T f},2t:7(){U c=a(k);Y(c.1a){i.2P=c;T c}r=i.2P=a("<2g />",{1z:k.2T(1),2N:"<2g>",3E:7(){T e}}).54(a(n).8u()),a(b).1v(l).1b("2G"+l,7(){r.15({14:a(b).14(),11:a(b).11()})}).5h("2G");T r},1P:7(b,c,h){Y(b&&b.3b())T f;U i=g.22,k=c?"V":"W",l=r.1J(":1K"),p=a("["+o+"]").24(":1K").2R(j),s;r||(r=f.2t());Y(r.1J(":5k")&&l===c||!c&&p.1a)T f;c?(r.15({S:0,9:0}),r.1S("8v",g.2b),q.8x("*","4G"+m,7(b){a(b.16).4d(n)[0]!==j[0]&&a("a, :8z, 33",j).2n(j).28()})):q.5Q("*","4G"+m),r.5o(d,e),a.1L(i)?i.2j(r,c):i===e?r[k]():r.4Q(1y(h,10)||3Y,c?1:0,7(){c||a(X).W()}),c||r.3d(7(a){r.15({S:"",9:""}),a()});T f},V:7(a,b){T f.1P(a,d,b)},W:7(a,b){T f.1P(a,e,b)},2p:7(){U d=r;d&&(d=a("["+o+"]").2R(j).1a<1,d?(i.2P.20(),a(b).1v(l)):i.2P.1v(l+c.1z),q.5Q("*","4G"+m));T j.3q(o).1v(l)}}),f.25()}7 C(b,g){7 w(a){U b=a.1k==="y",c=n[b?"11":"14"],d=n[b?"14":"11"],e=a.1r().2S("1m")>-1,f=c*(e?.5:1),g=1e.8D,h=1e.3X,i,j,k,l=1e.4H(g(f,2)+g(d,2)),m=[p/f*l,p/d*l];m[2]=1e.4H(g(m[0],2)-g(p,2)),m[3]=1e.4H(g(m[1],2)-g(p,2)),i=l+m[2]+m[3]+(e?0:m[0]),j=i/l,k=[h(j*d),h(j*c)];T{14:k[b?0:1],11:k[b?1:0]}}7 v(b){U c=k.1F&&b.y==="9",d=c?k.1F:k.13,e=a.2o.7y,f=e?"-5T-":a.2o.5x?"-5x-":"",g=b.y+(e?"":"-")+b.x,h=f+(e?"1i-4I-"+g:"1i-"+g+"-4I");T 1y(d.15(h),10)||1y(l.15(h),10)||0}7 u(a,b,c){b=b?b:a[a.1k];U d=l.1Q(r),e=k.1F&&a.y==="9",f=e?k.1F:k.13,g="1i-"+b+"-11",h;l.3c(r),h=1y(f.15(g),10),h=(c?h||1y(l.15(g),10):h)||0,l.1S(r,d);T h}7 t(f,g,h,l){Y(k.1h){U n=a.1t({},i.1g),o=h.3U,p=b.2i.19.1U.4w.2M(" "),q=p[0],r=p[1]||p[0],s={S:e,9:e,x:0,y:0},t,u={},v;i.1g.2D!==d&&(q==="2A"&&n.1k==="x"&&o.S&&n.y!=="1m"?n.1k=n.1k==="x"?"y":"x":q==="3V"&&o.S&&(n.x=n.x==="1m"?o.S>0?"S":"1o":n.x==="S"?"1o":"S"),r==="2A"&&n.1k==="y"&&o.9&&n.x!=="1m"?n.1k=n.1k==="y"?"x":"y":r==="3V"&&o.9&&(n.y=n.y==="1m"?o.9>0?"9":"1p":n.y==="9"?"1p":"9"),n.1r()!==m.1g&&(m.9!==o.9||m.S!==o.S)&&i.3B(n,e)),t=i.19(n,o),t.1o!==c&&(t.S=-t.1o),t.1p!==c&&(t.9=-t.1p),t.4b=1e.2f(0,j.12);Y(s.S=q==="2A"&&!!o.S)n.x==="1m"?u["2Y-S"]=s.x=t["2Y-S"]-o.S:(v=t.1o!==c?[o.S,-t.S]:[-o.S,t.S],(s.x=1e.2f(v[0],v[1]))>v[0]&&(h.S-=o.S,s.S=e),u[t.1o!==c?"1o":"S"]=s.x);Y(s.9=r==="2A"&&!!o.9)n.y==="1m"?u["2Y-9"]=s.y=t["2Y-9"]-o.9:(v=t.1p!==c?[o.9,-t.9]:[-o.9,t.9],(s.y=1e.2f(v[0],v[1]))>v[0]&&(h.9-=o.9,s.9=e),u[t.1p!==c?"1p":"9"]=s.y);k.1h.15(u).1P(!(s.x&&s.y||n.x==="1m"&&s.y||n.y==="1m"&&s.x)),h.S-=t.S.3v?t.4b:q!=="2A"||s.9||!s.S&&!s.9?t.S:0,h.9-=t.9.3v?t.4b:r!=="2A"||s.S||!s.S&&!s.9?t.9:0,m.S=o.S,m.9=o.9,m.1g=n.1r()}}U i=X,j=b.2i.17.1h,k=b.37,l=k.1A,m={9:0,S:0,1g:""},n={11:j.11,14:j.14},o={},p=j.1i||0,q=".1j-1h",s=!!(a("<4W />")[0]||{}).44;i.1g=f,i.3N=f,i.1i=p,i.12=j.12,i.2X=n,b.2Z.1h={"^19.23|17.1h.(1g|3N|1i)$":7(){i.25()||i.2p(),b.29()},"^17.1h.(14|11)$":7(){n={11:j.11,14:j.14},i.2t(),i.3B(),b.29()},"^13.1c.1n|17.(3u|2s)$":7(){k.1h&&i.3B()}},a.1t(i,{25:7(){U b=i.4J()&&(s||a.2o.3i);b&&(i.2t(),i.3B(),l.1v(q).1b("4p"+q,t));T b},4J:7(){U a=j.1g,c=b.2i.19,f=c.2x,g=c.23.1r?c.23.1r():c.23;Y(a===e||g===e&&f===e)T e;a===d?i.1g=1M h.2J(g):a.1r||(i.1g=1M h.2J(a),i.1g.2D=d);T i.1g.1r()!=="5L"},4K:7(){U c,d,e,f=k.1h.15({5V:"",1i:""}),g=i.1g,h=g[g.1k],m="1i-"+h+"-3k",p="1i"+h.3v(0)+h.2T(1)+"5W",q=/6G?\\(0, 0, 0(, 0)?\\)|42/i,s="6V-3k",t="42",u=a(1H.3s).15("3k"),v=b.37.13.15("3k"),w=k.1F&&(g.y==="9"||g.y==="1m"&&f.19().9+n.14/2+j.12",{"21":"1E-1A-1h"}).15({11:b,14:c}).5Z(l),s?a("<4W />").3o(k.1h)[0].44("2d").4M():(d=\'<4C:49 61="0,0" 17="2L:4T-35; 19:4V; 4S:2I(#3m#5K);">\',k.1h.2N(d+d))},3B:7(b,c){U g=k.1h,l=g.62(),m=n.11,q=n.14,r="45 65 ",t="45 66 42",v=j.3N,x=1e.3X,y,z,A,C,D;b||(b=i.1g),v===e?v=b:(v=1M h.2J(v),v.1k=b.1k,v.x==="3T"?v.x=b.x:v.y==="3T"?v.y=b.y:v.x===v.y&&(v[b.1k]=b[b.1k])),y=v.1k,i.4K(),o.1i!=="42"&&o.1i!=="#67"?(p=u(b,f,d),j.1i===0&&p>0&&(o.2H=o.1i),i.1i=p=j.1i!==d?j.1i:p):i.1i=p=0,A=B(v,m,q),i.2X=D=w(b),g.15(D),b.1k==="y"?C=[x(v.x==="S"?p:v.x==="1o"?D.11-m-p:(D.11-m)/2),x(v.y==="9"?D.14-q:0)]:C=[x(v.x==="S"?D.11-m:0),x(v.y==="9"?p:v.y==="1p"?D.14-q-p:(D.14-q)/2)],s?(l.1d(D),z=l[0].44("2d"),z.68(),z.4M(),z.69(0,0,4O,4O),z.6a(C[0],C[1]),z.6c(),z.6d(A[0][0],A[0][1]),z.4N(A[1][0],A[1][1]),z.4N(A[2][0],A[2][1]),z.6e(),z.8C=o.2H,z.6f=o.1i,z.6g=p*2,z.6h="5J",z.8y=5I,p&&z.5N(),z.2H()):(A="m"+A[0][0]+","+A[0][1]+" l"+A[1][0]+","+A[1][1]+" "+A[2][0]+","+A[2][1]+" 6i",C[2]=p&&/^(r|b)/i.1C(b.1r())?5g(a.2o.3Q,10)===8?2:1:0,l.15({6j:""+(v.1r().2S("1m")>-1),S:C[0]-C[2]*5S(y==="x"),9:C[1]-C[2]*5S(y==="y"),11:m+p,14:q+p}).1u(7(b){U c=a(X);c[c.4P?"4P":"1d"]({6l:m+p+" "+(q+p),6m:A,6n:o.2H,6o:!!b,6p:!b}).15({2L:p||b?"35":"4u"}),!b&&c.2N()===""&&c.2N(\'<4C:5N 6q="\'+p*2+\'45" 3k="\'+o.1i+\'" 6r="6s" 6t="5J" 17="4S:2I(#3m#5K); 2L:4T-35;" />\')})),c!==e&&i.19(b)},19:7(b){U c=k.1h,f={},g=1e.2f(0,j.12),h,l,m;Y(j.1g===e||!c)T e;b=b||i.1g,h=b.1k,l=w(b),m=[b.x,b.y],h==="x"&&m.6u(),a.1u(m,7(a,c){U e,i;c==="1m"?(e=h==="y"?"S":"9",f[e]="50%",f["2Y-"+e]=-1e.3X(l[h==="y"?"11":"14"]/2)+g):(e=u(b,c,d),i=v(b),f[c]=a?p?u(b,c):0:g+(i>e?i:0))}),f[b[h]]-=l[h==="x"?"11":"14"],c.15({9:"",1p:"",S:"",1o:"",2Y:""}).15(f);T f},2p:7(){k.1h&&k.1h.20(),l.1v(q)}}),i.25()}7 B(a,b,c){U d=1e.3F(b/2),e=1e.3F(c/2),f={5C:[[0,0],[b,c],[b,0]],5z:[[0,0],[b,0],[0,c]],4Y:[[0,c],[b,0],[b,c]],4Z:[[0,0],[0,c],[b,c]],6v:[[0,c],[d,0],[b,c]],86:[[0,0],[b,0],[d,c]],6w:[[0,0],[b,e],[0,c]],6x:[[b,0],[b,c],[0,e]]};f.6y=f.5C,f.6z=f.5z,f.6B=f.4Y,f.6C=f.4Z;T f[a.1r()]}7 A(b){U c=X,f=b.37.1A,g=b.2i.13.1G,h=".1j-1G",i=/<4x\\b[^<]*(?:(?!<\\/4x>)<[^<]*)*<\\/4x>/4X,j=d;b.2Z.1G={"^13.1G":7(a,b,d){b==="1G"&&(g=d),b==="2u"?c.25():g&&g.2I?c.40():f.1v(h)}},a.1t(c,{25:7(){g&&g.2I&&f.1v(h)[g.2u?"6D":"1b"]("4h"+h,c.40);T c},40:7(d,h){7 p(a,c,d){b.3p("13.1n",c+": "+d)}7 o(c){l&&(c=a("<2g/>").3r(c.2m(i,"")).5j(l)),b.3p("13.1n",c)}7 n(){m&&(f.15("46",""),h=e),a.1L(g.47)&&g.47.2l(X,1R)}Y(d&&d.3b())T c;U j=g.2I.2S(" "),k=g.2I,l,m=g.2u&&!g.5P&&h;m&&f.15("46","43"),j>-1&&(l=k.2T(j),k=k.2T(0,j)),a.1G(a.1t({6E:o,52:p,6F:b},g,{2I:k,47:n}));T c}}),c.25()}7 z(b,c){U i,j,k,l,m,n=a(X),o=a(1H.3s),p=X===1H?o:n,q=n.2q?n.2q(c.2q):f,r=c.2q.1x==="6H"&&q?q[c.2q.4f]:f,s=n.2y(c.2q.4f||"6I");6J{s=18 s==="1r"?(1M 7M("T "+s))():s}6K(t){w("5m 5q 6L 6M 7I 2y: "+s)}l=a.1t(d,{},g.3x,c,18 s==="1l"?x(s):f,x(r||q)),j=l.19,l.1z=b;Y("3A"===18 l.13.1n){k=n.1d(l.13.1d);Y(l.13.1d!==e&&k)l.13.1n=k;2E{w("5m 5q 6P 13 4i 1A! 7E 1V 6R 1A 2U 6T: ",n);T e}}j.1Y===e&&(j.1Y=o),j.16===e&&(j.16=p),l.V.16===e&&(l.V.16=p),l.V.3e===d&&(l.V.3e=o),l.W.16===e&&(l.W.16=p),l.19.1T===d&&(l.19.1T=j.1Y),j.2x=1M h.2J(j.2x),j.23=1M h.2J(j.23);Y(a.2y(X,"1j"))Y(l.4r)n.1j("2p");2E Y(l.4r===e)T e;l.3P&&(m=a.1d(X,"1c"))&&a(X).3q("1c").1d(u,m),i=1M y(n,l,b,!!k),a.2y(X,"1j",i),n.1b("20.1j",7(){i.2p()});T i}7 y(s,t,w,y){7 R(){U c=[t.V.16[0],t.W.16[0],z.1s&&G.1A[0],t.19.1Y[0],t.19.1T[0],b,1H];z.1s?a([]).6U(a.7A(c,7(a){T 18 a==="1l"})).1v(F):t.V.16.1v(F+"-2t")}7 Q(){7 p(a){E.1J(":1K")&&z.29(a)}7 o(a){Y(E.1Q(m))T e;1O(z.1w.2c),z.1w.2c=3l(7(){z.W(a)},t.W.2c)}7 l(b){Y(E.1Q(m)||C||D)T e;U d=a(b.3j||b.16),g=d.4d(n)[0]===E[0],h=d[0]===f.V[0];1O(z.1w.V),1O(z.1w.W);c.16==="1q"&&g||t.W.2D&&(/1q(3D|2v|4a)/.1C(b.1x)&&(g||h))?(b.4e(),b.6X()):t.W.2B>0?z.1w.W=3l(7(){z.W(b)},t.W.2B):z.W(b)}7 k(a){Y(E.1Q(m))T e;f.V.2C("1j-"+w+"-2c"),1O(z.1w.V),1O(z.1w.W);U b=7(){z.1P(d,a)};t.V.2B>0?z.1w.V=3l(b,t.V.2B):b()}U c=t.19,f={V:t.V.16,W:t.W.16,1T:a(c.1T),1H:a(1H),31:a(b)},h={V:a.41(""+t.V.1f).2M(" "),W:a.41(""+t.W.1f).2M(" ")},j=a.2o.3i&&1y(a.2o.3Q,10)===6;E.1b("3z"+F+" 38"+F,7(a){U b=a.1x==="3z";b&&z.28(a),E.1S(q,b)}),t.W.2D&&(f.W=f.W.2n(E),E.1b("6Z"+F,7(){E.1Q(m)||1O(z.1w.W)})),/1q(3D|2v)/i.1C(t.W.1f)?t.W.2v==="31"&&f.31.1b("5a"+F,7(a){/56|4U/.1C(a.16)&&!a.3j&&z.W(a)}):/1q(4D|3O)/i.1C(t.V.1f)&&f.W.1b("38"+F,7(a){1O(z.1w.V)}),(""+t.W.1f).2S("51")>-1&&f.1H.1b("3E"+F,7(b){U c=a(b.16),d=!E.1Q(m)&&E.1J(":1K");c[0]!==E[0]&&c.70(n).1a===0&&c.2n(s).1a>1&&z.W(b)}),"2O"===18 t.W.2c&&(f.V.1b("1j-"+w+"-2c",o),a.1u(g.5n,7(a,b){f.W.2n(G.1A).1b(b+F+"-2c",o)})),a.1u(h.W,7(b,c){U d=a.71(c,h.V),e=a(f.W);d>-1&&e.2n(f.V).1a===e.1a||c==="51"?(f.V.1b(c+F,7(a){E.1J(":1K")?l(a):k(a)}),2k h.V[d]):f.W.1b(c+F,l)}),a.1u(h.V,7(a,b){f.V.1b(b+F,k)}),"2O"===18 t.W.3M&&f.V.2n(E).1b("1W"+F,7(a){U b=H.3a||{},c=t.W.3M,d=1e.3y;(d(a.1D-b.1D)>=c||d(a.1X-b.1X)>=c)&&z.W(a)}),c.16==="1q"&&(f.V.1b("1W"+F,7(a){i={1D:a.1D,1X:a.1X,1x:"1W"}}),c.1U.1q&&(t.W.1f&&E.1b("38"+F,7(a){(a.3j||a.16)!==f.V[0]&&z.W(a)}),f.1H.1b("1W"+F,7(a){!E.1Q(m)&&E.1J(":1K")&&z.29(a||i)}))),(c.1U.2G||f.1T.1a)&&(a.1f.7s.2G?f.1T:f.31).1b("2G"+F,p),(f.1T.1a||j&&E.15("19")==="2D")&&f.1T.1b("4q"+F,p)}7 P(b,d){7 g(b){7 i(c){c&&(2k h[c.34],1O(z.1w.33[c.34]),a(c).1v(F)),a.72(h)&&(z.2Q(),d!==e&&z.29(H.1f),b())}U g,h={};Y((g=f.5j("33:2R([14]):2R([11])")).1a===0)T i();g.1u(7(b,d){h[d.34]===c&&(7 e(){Y(d.14||d.11)T i(d);z.1w.33[d.34]=3l(e,7p)}(),a(d).1b("52"+F+" 40"+F,7(){i(X)}),h[d.34]=d)})}U f=G.13;Y(!z.1s||!b)T e;a.1L(b)&&(b=b.2j(s,H.1f,z)||""),b.2a&&b.1a>0?f.57().3r(b.15({2L:"35"})):f.2N(b),z.1s<0?E.3d("4o",g):(D=0,g(a.76));T z}7 O(b,c){U d=G.1c;Y(!z.1s||!b)T e;a.1L(b)&&(b=b.2j(s,H.1f,z));Y(b===e)T K(e);b.2a&&b.1a>0?d.57().3r(b.15({2L:"35"})):d.2N(b),z.2Q(),c!==e&&z.1s&&E.1J(":1K")&&z.29(H.1f)}7 N(a){U b=G.1I,c=G.1c;Y(!z.1s)T e;a?(c||M(),L()):b.20()}7 M(){U b=B+"-1c";G.1F&&K(),G.1F=a("<2g />",{"21":k+"-1F "+(t.17.2s?"1E-2s-5b":"")}).3r(G.1c=a("<2g />",{1z:b,"21":k+"-1c","1Z-4g":d})).54(G.13),t.13.1c.1I?L():z.1s&&z.2Q()}7 L(){U b=t.13.1c.1I,c=18 b==="1r",d=c?b:"7g 1A";G.1I&&G.1I.20(),b.2a?G.1I=b:G.1I=a("",{"21":"1E-3h-3m "+(t.17.2s?"":k+"-3H"),1c:d,"1Z-79":d}).7b(a("<7c />",{"21":"1E-3H 1E-3H-7d",2N:"&7f;"})),G.1I.3o(G.1F).1d("5e","1I").4j(7(b){a(X).1S("1E-3h-4j",b.1x==="3z")}).4n(7(a){E.1Q(m)||z.W(a);T e}).1b("3E 59 5s 7j 5a",7(b){a(X).1S("1E-3h-7l 1E-3h-28",b.1x.2T(-4)==="7m")}),z.2Q()}7 K(a){G.1c&&(G.1F.20(),G.1F=G.1c=G.1I=f,a!==e&&z.29())}7 J(){U a=t.17.2s;E.1S(l,a).1S(o,!a),G.13.1S(l+"-13",a),G.1F&&G.1F.1S(l+"-5b",a),G.1I&&G.1I.1S(k+"-3H",!a)}7 I(a){U b=0,c,d=t,e=a.2M(".");3t(d=d[e[b++]])b0&&!a("#"+i).1a&&(E[0].1z=i,G.13[0].1z=i+"-13",G.1c[0].1z=i+"-1c")},"^13.1n$":7(a,b,c){P(c)},"^13.1c.1n$":7(a,b,c){Y(!c)T K();!G.1c&&c&&M(),O(c)},"^13.1c.1I$":7(a,b,c){N(c)},"^19.(23|2x)$":7(a,b,c){"1r"===18 c&&(a[b]=1M h.2J(c))},"^19.1Y$":7(a,b,c){z.1s&&E.3o(c)},"^V.3f$":7(){z.1s?z.1P(d):z.1V(1)},"^17.3u$":7(a,b,c){E.1d("21",k+" 1j 1E-5c-5d "+c)},"^17.2s|13.1c":J,"^4F.(1V|V|4a|W|28|2b)$":7(b,c,d){E[(a.1L(d)?"":"7t")+"1b"]("1A"+c,d)},"^(V|W|19).(1f|16|2D|2c|2v|3M|1T|1U)":7(){U a=t.19;E.1d("4m",a.16==="1q"&&a.1U.1q),R(),Q()}},a.1t(z,{1V:7(b){Y(z.1s)T z;U c=t.13.1c.1n,f=t.19,g=a.39("7v");a.1d(s[0],"1Z-4z",B),E=G.1A=a("<2g/>",{1z:B,"21":k+" 1j 1E-5c-5d "+o+" "+t.17.3u,11:t.17.11||"",14:t.17.14||"",4m:f.16==="1q"&&f.1U.1q,5e:"7w","1Z-7x":"7z","1Z-4g":e,"1Z-4z":B+"-13","1Z-43":d}).1S(m,H.2K).2y("1j",z).3o(t.19.1Y).3r(G.13=a("<2g />",{"21":k+"-13",1z:B+"-13","1Z-4g":d})),z.1s=-1,D=1,C=1,c&&(M(),O(c,e)),P(t.13.1n,e),z.1s=d,J(),a.1u(t.4F,7(b,c){a.1L(c)&&E.1b(b==="1P"?"4h 3K":"1A"+b,c)}),a.1u(h,7(){X.2V==="1V"&&X(z)}),Q(),E.3d("4o",7(a){g.2z=H.1f,E.2C(g,[z]),D=0,C=0,z.2Q(),(t.V.3f||b)&&z.1P(d,H.1f),a()});T z},4E:7(a){U b,c;5v(a.2r()){3w"5i":b={14:E.3n(),11:E.3I()};3g;3w"12":b=h.12(E,t.19.1Y);3g;3m:c=I(a.2r()),b=c[0][c[1]],b=b.1k?b.1r():b}T b},3p:7(b,c){7 m(a,b){U c,d,e;4i(c 2h k)4i(d 2h k[c])Y(e=(1M 7B(d,"i")).55(a))b.4k(e),k[c][d].2l(z,b)}U g=/^19\\.(23|2x|1U|16|1Y)|17|13|V\\.3f/i,h=/^13\\.(1c|1d)|17/i,i=e,j=e,k=z.2Z,l;"1r"===18 b?(l=b,b={},b[l]=c):b=a.1t(d,{},b),a.1u(b,7(c,d){U e=I(c.2r()),f;f=e[0][e[1]],e[0][e[1]]="1l"===18 d&&d.7C?a(d):d,b[c]=[e[0],e[1],d,f],i=g.1C(c)||i,j=h.1C(c)||j}),x(t),C=D=1,a.1u(b,m),C=D=0,E.1J(":1K")&&z.1s&&(i&&z.29(t.19.16==="1q"?f:H.1f),j&&z.2Q());T z},1P:7(b,c){7 q(){b?(a.2o.3i&&E[0].17.5H("24"),E.15("7D",""),"1r"===18 h.4A&&a(h.4A,E).28(),p=a.39("7F"),p.2z=c?H.1f:f,E.2C(p,[z])):E.15({2L:"",46:"",4v:"",S:"",9:""})}Y(!z.1s)Y(b)z.1V(1);2E T z;U g=b?"V":"W",h=t[g],j=E.1J(":1K"),k=!c||t[g].16.1a<2||H.16[0]===c.16,l=t.19,m=t.13,o,p;(18 b).5w("3A|2O")&&(b=!j);Y(!E.1J(":5k")&&j===b&&k)T z;Y(c){Y(/4D|3O/.1C(c.1x)&&/3D|2v/.1C(H.1f.1x)&&c.16===t.V.16[0]&&E.7G(c.3j).1a)T z;H.1f=a.1t({},c)}p=a.39("1A"+g),p.2z=c?H.1f:f,E.2C(p,[z,3Y]);Y(p.3b())T z;a.1d(E[0],"1Z-43",!b),b?(H.3a=a.1t({},i),z.28(c),a.1L(m.1n)&&P(m.1n,e),a.1L(m.1c.1n)&&O(m.1c.1n,e),!v&&l.16==="1q"&&l.1U.1q&&(a(1H).1b("1W.1j",7(a){i={1D:a.1D,1X:a.1X,1x:"1W"}}),v=d),z.29(c),h.3e&&a(n,h.3e).2R(E).1j("W",p)):(1O(z.1w.V),2k H.3a,v&&!a(n+\'[4m="7J"]:1K\',h.3e).2R(E).1a&&(a(1H).1v("1W.1j"),v=e),z.2b(c)),k&&E.5o(0,1),h.22===e?(E[g](),q.2j(E)):a.1L(h.22)?(h.22.2j(E,z),E.3d("4o",7(a){q(),a()})):E.4Q(3Y,b?1:0,q),b&&h.16.2C("1j-"+w+"-2c");T z},V:7(a){T z.1P(d,a)},W:7(a){T z.1P(e,a)},28:7(b){Y(!z.1s)T z;U c=a(n),d=1y(E[0].17.2e,10),e=g.2W+c.1a,f=a.1t({},b),h,i;E.1Q(p)||(i=a.39("5r"),i.2z=f,E.2C(i,[z,e]),i.3b()||(d!==e&&(c.1u(7(){X.17.2e>d&&(X.17.2e=X.17.2e-1)}),c.24("."+p).1j("2b",f)),E.3c(p)[0].17.2e=e));T z},2b:7(b){U c=a.1t({},b),d;E.4y(p),d=a.39("7L"),d.2z=c,E.2C(d,[z]);T z},29:7(c,d){Y(!z.1s||C)T z;C=1;U f=t.19.16,g=t.19,j=g.23,l=g.2x,m=g.1U,n=m.4w.2M(" "),o=E.3I(),p=E.3n(),q=0,r=0,s=a.39("4p"),u=E.15("19")==="2D",v=g.1T,w={S:0,9:0},x=z.1N.1h,y={3R:n[0],3S:n[1]||n[0],S:7(a){U b=y.3R==="2A",c=v.12.S+v.36,d=j.x==="S"?o:j.x==="1o"?-o:-o/2,e=l.x==="S"?q:l.x==="1o"?-q:-q/2,f=x&&x.2X?x.2X.11||0:0,g=x&&x.1g&&x.1g.1k==="x"&&!b?f:0,h=c-a+g,i=a+o-v.11-c+g,k=d-(j.1k==="x"||j.x===j.y?e:0),n=j.x==="1m";b?(g=x&&x.1g&&x.1g.1k==="y"?f:0,k=(j.x==="S"?1:-1)*d-g,w.S+=h>0?h:i>0?-i:0,w.S=1e.2f(v.12.S+(g&&x.1g.x==="1m"?x.12:0),a-k,1e.3W(1e.2f(v.12.S+v.11,a+k),w.S))):(h>0&&(j.x!=="S"||i>0)?w.S-=k+(n?0:2*m.x):i>0&&(j.x!=="1o"||h>0)&&(w.S-=n?-k:k+2*m.x),w.S!==a&&n&&(w.S-=m.x),w.Si&&(w.S=a));T w.S-a},9:7(a){U b=y.3S==="2A",c=v.12.9+v.30,d=j.y==="9"?p:j.y==="1p"?-p:-p/2,e=l.y==="9"?r:l.y==="1p"?-r:-r/2,f=x&&x.2X?x.2X.14||0:0,g=x&&x.1g&&x.1g.1k==="y"&&!b?f:0,h=c-a+g,i=a+p-v.14-c+g,k=d-(j.1k==="y"||j.x===j.y?e:0),n=j.y==="1m";b?(g=x&&x.1g&&x.1g.1k==="x"?f:0,k=(j.y==="9"?1:-1)*d-g,w.9+=h>0?h:i>0?-i:0,w.9=1e.2f(v.12.9+(g&&x.1g.x==="1m"?x.12:0),a-k,1e.3W(1e.2f(v.12.9+v.14,a+k),w.9))):(h>0&&(j.y!=="9"||i>0)?w.9-=k+(n?0:2*m.y):i>0&&(j.y!=="1p"||h>0)&&(w.9-=n?-k:k+2*m.y),w.9!==a&&n&&(w.9-=m.y),w.9<0&&-w.9>i&&(w.9=a));T w.9-a}};Y(a.5R(f)&&f.1a===2)l={x:"S",y:"9"},w={S:f[0],9:f[1]};2E Y(f==="1q"&&(c&&c.1D||H.1f.1D))l={x:"S",y:"9"},c=(c&&(c.1x==="2G"||c.1x==="4q")?H.1f:c&&c.1D&&c.1x==="1W"?c:i&&i.1D&&(m.1q||!c||!c.1D)?{1D:i.1D,1X:i.1X}:!m.1q&&H.3a&&H.3a.1D?H.3a:c)||c||H.1f||i||{},w={9:c.1X,S:c.1D};2E{f==="1f"?c&&c.16&&c.1x!=="4q"&&c.1x!=="2G"?f=H.16=a(c.16):f=H.16:H.16=a(f),f=a(f).7O(0);Y(f.1a===0)T z;f[0]===1H||f[0]===b?(q=h.2w?b.7P:f.11(),r=h.2w?b.7Q:f.14(),f[0]===b&&(w={9:!u||h.2w?(v||f).30():0,S:!u||h.2w?(v||f).36():0})):f.1J("7R")&&h.48?w=h.48(f,l):f[0].7T==="7U://7V.7W.7X/7Y/3L"&&h.3L?w=h.3L(f,l):(q=f.3I(),r=f.3n(),w=h.12(f,g.1Y,u)),w.12&&(q=w.11,r=w.14,w=w.12),w.S+=l.x==="1o"?q:l.x==="1m"?q/2:0,w.9+=l.y==="1p"?r:l.y==="1m"?r/2:0}w.S+=m.x+(j.x==="1o"?-o:j.x==="1m"?-o/2:0),w.9+=m.y+(j.y==="1p"?-p:j.y==="1m"?-p/2:0),v.2a&&f[0]!==b&&f[0]!==A&&y.3S+y.3R!=="7Z"?(v={5E:v,14:v[(v[0]===b?"h":"80")+"82"](),11:v[(v[0]===b?"w":"83")+"84"](),36:u?0:v.36(),30:u?0:v.30(),12:v.12()||{S:0,9:0}},w.3U={S:y.3R!=="4u"?y.S(w.S):0,9:y.3S!=="4u"?y.9(w.9):0}):w.3U={S:0,9:0},E.1d("21",7(b,c){T a.1d(X,"21").2m(/1E-1A-5D-\\w+/i,"")}).3c(k+"-5D-"+j.5y()),s.2z=a.1t({},c),E.2C(s,[z,w,v.5E||v]);Y(s.3b())T z;2k w.3U,d===e||5G(w.S)||5G(w.9)||f==="1q"||!a.1L(g.22)?E.15(w):a.1L(g.22)&&(g.22.2j(E,z,a.1t({},w)),E.3d(7(b){a(X).15({4v:"",14:""}),a.2o.3i&&X.17.5H("24"),b()})),C=0;T z},2Q:7(){Y(z.1s<1||D)T z;U a=t.19.1Y,b,c,d,e;D=1,t.17.14&&E.15("14",t.17.14),t.17.11?E.15("11",t.17.11):(E.15("11","").3c(r),c=E.11()+1,d=E.15("2f-11")||"",e=E.15("3W-11")||"",b=(d+e).2S("%")>-1?a.11()/5I:0,d=(d.2S("%")>-1?b:1)*1y(d,10)||c,e=(e.2S("%")>-1?b:1)*1y(e,10)||0,c=d+e?1e.3W(1e.2f(c,e),d):c,E.15("11",1e.3X(c)).4y(r)),D=0;T z},4c:7(b){"3A"!==18 b&&(b=!E.1Q(m)&&!H.2K),z.1s?(E.1S(m,b),a.1d(E[0],"1Z-2K",b)):H.2K=!!b;T z},88:7(){T z.4c(e)},2p:7(){U b=s[0],c=a.1d(b,u);z.1s&&(E.20(),a.1u(z.1N,7(){X.2p&&X.2p()})),1O(z.1w.V),1O(z.1w.W),R(),a.8a(b,"1j"),t.3P&&c&&(a.1d(b,"1c",c),s.3q(u)),s.3q("1Z-4z").1v(".1j"),2k j[z.1z];T s}})}7 x(b){U c;Y(!b||"1l"!==18 b)T e;"1l"!==18 b.2q&&(b.2q={1x:b.2q});Y("13"2h b){Y("1l"!==18 b.13||b.13.2a)b.13={1n:b.13};c=b.13.1n||e,!a.1L(c)&&(!c&&!c.1d||c.1a<1||"1l"===18 c&&!c.2a)&&(b.13.1n=e),"1c"2h b.13&&("1l"!==18 b.13.1c&&(b.13.1c={1n:b.13.1c}),c=b.13.1c.1n||e,!a.1L(c)&&(!c&&!c.1d||c.1a<1||"1l"===18 c&&!c.2a)&&(b.13.1c.1n=e))}"19"2h b&&("1l"!==18 b.19&&(b.19={23:b.19,2x:b.19})),"V"2h b&&("1l"!==18 b.V&&(b.V.2a?b.V={16:b.V}:b.V={1f:b.V})),"W"2h b&&("1l"!==18 b.W&&(b.W.2a?b.W={16:b.W}:b.W={1f:b.W})),"17"2h b&&("1l"!==18 b.17&&(b.17={3u:b.17})),a.1u(h,7(){X.3C&&X.3C(b)});T b}7 w(){w.4B=w.4B||[],w.4B.4k(1R);Y("1l"===18 3Z){U a=3Z[3Z.5M?"5M":"8c"],b=8e.8f.4t.2j(1R),c;18 1R[0]==="1r"&&(b[0]="8g: "+b[0]),c=a.2l?a.2l(3Z,b):a(b)}}"8j 8l";U d=!0,e=!1,f=8n,g,h,i,j={},k="1E-1A",l="1E-2s",m="1E-3h-2K",n="2g.1j."+k,o=k+"-3m",p=k+"-28",q=k+"-4j",r=k+"-8A",s="-8B",t="8E",u="5U",v;g=a.2F.1j=7(b,h,i){U j=(""+b).2r(),k=f,l=j==="4c"?[d]:a.5X(1R).4t(1),m=l[l.1a-1],n=X[0]?a.2y(X[0],"1j"):f;Y(!1R.1a&&n||j==="5Y")T n;Y("1r"===18 b){X.1u(7(){U b=a.2y(X,"1j");Y(!b)T d;m&&m.60&&(b.32.1f=m);Y(j!=="4U"&&j!=="2i"||!h)b[j]&&b[j].2l(b[j],l);2E Y(a.63(h)||i!==c)b.3p(h,i);2E{k=b.4E(h);T e}});T k!==f?k:X}Y("1l"===18 b||!1R.1a){n=x(a.1t(d,{},b));T g.1b.2j(X,n,m)}},g.1b=7(b,f){T X.1u(7(k){7 r(b){7 d(){p.1V(18 b==="1l"||l.V.3f),m.V.2n(m.W).1v(o)}Y(p.32.2K)T e;p.32.1f=a.1t({},b),p.32.16=b?a(b.16):[c],l.V.2B>0?(1O(p.1w.V),p.1w.V=3l(d,l.V.2B),n.V!==n.W&&m.W.1b(n.W,7(){1O(p.1w.V)})):d()}U l,m,n,o,p,q;q=a.5R(b.1z)?b.1z[k]:b.1z,q=!q||q===e||q.1a<1||j[q]?g.4l++:j[q]=q,o=".1j-"+q+"-2t",p=z.2j(X,q,b);Y(p===e)T d;l=p.2i,a.1u(h,7(){X.2V==="2V"&&X(p)}),m={V:l.V.16,W:l.W.16},n={V:a.41(""+l.V.1f).2m(/ /g,o+" ")+o,W:a.41(""+l.W.1f).2m(/ /g,o+" ")+o},/1q(4D|3O)/i.1C(n.V)&&!/1q(3D|2v)/i.1C(n.W)&&(n.W+=" 38"+o),m.V.1b("1W"+o,7(a){i={1D:a.1D,1X:a.1X,1x:"1W"}}),m.V.1b(n.V,r),(l.V.3f||l.5u)&&r(f)})},h=g.1N={2J:7(a){a=(""+a).2m(/([A-Z])/," $1").2m(/6A/4X,"1m").2r(),X.x=(a.4s(/S|1o/i)||a.4s(/1m/)||["3T"])[0].2r(),X.y=(a.4s(/9|1p|1m/i)||["3T"])[0].2r(),X.1k=a.3v(0).5w(/^(t|b)/)>-1?"y":"x",X.1r=7(){T X.1k==="y"?X.y+X.x:X.x+X.y},X.5y=7(){U a=X.x.2T(0,1),b=X.y.2T(0,1);T a===b?a:a==="c"||a!=="c"&&b!=="c"?b+a:a+b}},12:7(c,d,e){7 l(a,b){f.S+=b*a.36(),f.9+=b*a.30()}U f=c.12(),g=d,i=0,j=1H.3s,k;Y(g){6N{g.15("19")!=="6O"&&(k=g[0]===j?{S:1y(g.15("S"),10)||0,9:1y(g.15("9"),10)||0}:g.19(),f.S-=k.S+(1y(g.15("6Q"),10)||0)+(1y(g.15("6S"),10)||0),f.9-=k.9+(1y(g.15("6W"),10)||0),i++);Y(g[0]===j)3g}3t(g=g.6Y());d[0]!==j&&i>1&&l(d,1),(h.2w<4.1&&h.2w>3.1||!h.2w&&e)&&l(a(b),-1)}T f},2w:5g((""+(/53.*73 ([0-75]{1,3})|(53 77).*78.*7a/i.55(7e.7h)||[0,""])[1]).2m("5t","7k").2m("7n","."))||e,2F:{1d:7(b,c){Y(X.1a){U d=X[0],e="1c",f=a.2y(d,"1j");Y(b===e&&"1l"===18 f&&f.2i.3P){Y(1R.1a<2)T a.1d(d,u);f&&f.2i.13.1d===e&&f.32.1d&&f.3p("13.1n",c);T X.1d(u,c)}}T a.2F["1d"+t].2l(X,1R)},5f:7(b){U c=a([]),d="1c",e=a.2F["5f"+t].2l(X,1R);b||e.24("["+u+"]").1d("1c",7(){T a.1d(X,u)}).3q(u);T e},20:a.1E?f:7(b,c){a(X).1u(7(){c||(!b||a.24(b,[X]).1a)&&a("*",X).2n(X).1u(7(){a(X).5h("20")})})}}},a.1u(h.2F,7(b,c){Y(!c)T d;U e=a.2F[b+t]=a.2F[b];a.2F[b]=7(){T c.2l(X,1R)||e.2l(X,1R)}}),g.3Q="2.0.7H",g.4l=0,g.5n="4n 7K 3E 5s 1W 38 3z".2M(" "),g.2W=7N,g.3x={5u:e,1z:e,4r:d,3P:d,13:{1n:d,1d:"1c",1c:{1n:e,1I:e}},19:{23:"9 S",2x:"1p 1o",16:e,1Y:e,1T:e,1U:{x:0,y:0,1q:d,2G:d,4w:"3V 3V"},22:7(b,c,d){a(X).85(c,{87:5A,3d:e})}},V:{16:e,1f:"3z",22:d,2B:3Y,3e:e,3f:e,4A:e},W:{16:e,1f:"38",22:d,2B:0,2D:e,2c:e,2v:"31",3M:e},17:{3u:"",2s:e,11:e,14:e},4F:{1V:f,4a:f,V:f,W:f,1P:f,1K:f,28:f,2b:f}},h.1G=7(a){U b=a.1N.1G;T"1l"===18 b?b:a.1N.1G=1M A(a)},h.1G.2V="1V",h.1G.3C=7(a){U b=a.13,c;b&&"1G"2h b&&(c=b.1G,18 c!=="1l"&&(c=a.13.1G={2I:c}),"3A"!==18 c.2u&&c.2u&&(c.2u=!!c.2u))},a.1t(d,g.3x,{13:{1G:{5P:d,2u:d}}}),h.1h=7(a){U b=a.1N.1h;T"1l"===18 b?b:a.1N.1h=1M C(a)},h.1h.2V="1V",h.1h.3C=7(a){U b=a.17,c;b&&"1h"2h b&&(c=a.17.1h,18 c!=="1l"&&(a.17.1h={1g:c}),/1r|3A/i.1C(18 c.1g)||(c.1g=d),18 c.11!=="2O"&&2k c.11,18 c.14!=="2O"&&2k c.14,18 c.1i!=="2O"&&c.1i!==d&&2k c.1i,18 c.12!=="2O"&&2k c.12)},a.1t(d,g.3x,{17:{1h:{1g:d,3N:e,11:6,14:6,1i:d,12:0}}}),h.48=7(b,c){7 l(a,b){U d=0,e=1,f=1,g=0,h=0,i=a.11,j=a.14;3t(i>0&&j>0&&e>0&&f>0){i=1e.3G(i/2),j=1e.3G(j/2),c.x==="S"?e=i:c.x==="1o"?e=a.11-i:e+=1e.3G(i/2),c.y==="9"?f=j:c.y==="1p"?f=a.14-j:f+=1e.3G(j/2),d=b.1a;3t(d--){Y(b.1a<2)3g;g=b[d][0]-a.12.S,h=b[d][1]-a.12.9,(c.x==="S"&&g>=e||c.x==="1o"&&g<=e||c.x==="1m"&&(ga.11-e)||c.y==="9"&&h>=f||c.y==="1p"&&h<=f||c.y==="1m"&&(ha.14-f))&&b.74(d,1)}}T{S:b[0][0],9:b[0][1]}}b.2a||(b=a(b));U d=b.1d("49").2r(),e=b.1d("7i").2M(","),f=[],g=a(\'33[7r="#\'+b.7u("5p").1d("4f")+\'"]\'),h=g.12(),i={11:0,14:0,12:{9:3J,1o:0,1p:0,S:3J}},j=0,k=0;h.S+=1e.3F((g.3I()-g.11())/2),h.9+=1e.3F((g.3n()-g.14())/2);Y(d==="5F"){j=e.1a;3t(j--)k=[1y(e[--j],10),1y(e[j+1],10)],k[0]>i.12.1o&&(i.12.1o=k[0]),k[0]i.12.1p&&(i.12.1p=k[1]),k[1]