diff --git a/pacotes/balloon-tooltips/htdocs/balloons.html b/pacotes/balloon-tooltips/htdocs/balloons.html new file mode 100644 index 0000000..099e3f6 --- /dev/null +++ b/pacotes/balloon-tooltips/htdocs/balloons.html @@ -0,0 +1,258 @@ + + + Balloon Tooltips + + + + + + + + + + +
+ + + +
+ +

+The balloon.js package is written in object-oriented JavaScript and allows you to add configurable balloon tooltips +(AKA popup balloons, bubbles, rollover tooltips etc., etc.) to your website. It is generic and is portable to most web sites. +

+The balloons are dynamically sized in both the vertical and horizontal dimensions and the left/right/up/down orientation +is calculated automatically based on the position of the cursor. Balloon contents can be provided locally in your own HTML or remotely via AJAX. +This package is open source and free to all as long as the copyright notice is retained. See below for demonstrations and documentation. +

+ + +
+

Demo:

+
+ + + + + + + + + + + + + + + + + + + + +
Demonstration:mouse over this box +click me +plainer balloon
fading balloonfading box +sticky box
Documentation: + +http://gmod.org/wiki/Popup_Balloons +
Download: + +balloons.tar.gz + +or for windows users... + + +balloons.zip + + +
+
+
+
+ + + + + + +

+This is an example of a simple balloon message + +

+ <span onmouseover="balloon.showTooltip(event,'I am a simple message...')">message</span>
+
+ +This is an example of the same message with a different balloon style + +
+ onmouseover="tooltip.showTooltip(event,'I am a simple message...')">message</span>
+
+ +This is an example of the same message with a box style + +
+ onmouseover="box.showTooltip(event,'I am a simple message...')">message</span>
+
+ +

+ +

+Roll over +this text for an example of HTML-formatted text loaded from a hidden <div> element. +

+ onmouseover="balloon.showTooltip(event,'load:lorem1')"
+ ...
+ <div id="lorem1" style="display:none">
+   Lorem ipsum dolor sit amet, <b><i>consectetuer adipiscing elit</b></i>. Vestibulum iaculis,
+   ligula quis fringilla volutpat, metus mi molestie lorem, <span style="color:red">quis accumsan pede
+    turpis nec metus.</span> Lorem ipsum dolor sit amet, consectetuer adipiscing elit.'
+ </div>
+
+
+ + +Adding a third argument makes the tooltip sticky. +
+ onmouseover="balloon.showTooltip(event,'load:lorem2',1)"
+
+ +A fourth argument will set the width (Example: +300px sticky balloon) +     Try a plain version + +
+ onmouseover="balloon.showTooltip(event,'load:lorem2',1,300)"
+
+ +Now let's try that with a +sticky box. + +
+ onmouseover="box.showTooltip(event,'load:lorem2',1,300)"
+
+ +The height can also be specified with a fifth argument (Example: +250px x 250px sticky balloon) + +
+ onmouseover="balloon.showTooltip(event,'load:lorem2',1,250,250)"
+
+ + +If the balloon contents are too large for the specified dimensions, you will scrollbars for sticky balloons +and clipping for non-sticky balloons. + +
+ onmouseover="balloon.showTooltip(event,'load:lorem2',1,150,150)"
+
+ +

+ +

+Here is an example of a tooltip balloon that is populated by an + +image. +

+ onmouseover="balloon.showTooltip(event,'<img height=150 src=\'images/balloons.png\' />')"
+
+

+ + + +

+This creates a sticky balloon whose contents are from an external website. + +What's new at the NY Post?
+ +Note: This requires an embedded iframe because it is an external website. +

+<span onmouseover="balloon.showTooltip(event,'<iframe style=\'width:300;height:290\'                                                                                                                       frameborder=0 src=\'http://m.nypost.com\'></iframe>',1)">
+What's new at the NY Post?</span>
+
+
+Ajax methods are also available. +

+ + diff --git a/pacotes/balloon-tooltips/htdocs/images/GBubble/balloon.png b/pacotes/balloon-tooltips/htdocs/images/GBubble/balloon.png new file mode 100644 index 0000000..6f3d80f Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GBubble/balloon.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/GBubble/balloon_ie.png b/pacotes/balloon-tooltips/htdocs/images/GBubble/balloon_ie.png new file mode 100644 index 0000000..b31b08c Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GBubble/balloon_ie.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/GBubble/close.png b/pacotes/balloon-tooltips/htdocs/images/GBubble/close.png new file mode 100644 index 0000000..5c70f8f Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GBubble/close.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/GBubble/down_left.png b/pacotes/balloon-tooltips/htdocs/images/GBubble/down_left.png new file mode 100644 index 0000000..3da4f37 Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GBubble/down_left.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/GBubble/down_right.png b/pacotes/balloon-tooltips/htdocs/images/GBubble/down_right.png new file mode 100644 index 0000000..37cce24 Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GBubble/down_right.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/GBubble/up_left.png b/pacotes/balloon-tooltips/htdocs/images/GBubble/up_left.png new file mode 100644 index 0000000..e0a15a7 Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GBubble/up_left.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/GBubble/up_right.png b/pacotes/balloon-tooltips/htdocs/images/GBubble/up_right.png new file mode 100644 index 0000000..6afa80b Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GBubble/up_right.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/GPlain/balloon.png b/pacotes/balloon-tooltips/htdocs/images/GPlain/balloon.png new file mode 100644 index 0000000..86e2fb3 Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GPlain/balloon.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/GPlain/close.png b/pacotes/balloon-tooltips/htdocs/images/GPlain/close.png new file mode 100644 index 0000000..5c70f8f Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GPlain/close.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/GPlain/down_left.png b/pacotes/balloon-tooltips/htdocs/images/GPlain/down_left.png new file mode 100644 index 0000000..37dd43d Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GPlain/down_left.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/GPlain/down_right.png b/pacotes/balloon-tooltips/htdocs/images/GPlain/down_right.png new file mode 100644 index 0000000..77252ea Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GPlain/down_right.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/GPlain/up_left.png b/pacotes/balloon-tooltips/htdocs/images/GPlain/up_left.png new file mode 100644 index 0000000..4f9aeb6 Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GPlain/up_left.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/GPlain/up_right.png b/pacotes/balloon-tooltips/htdocs/images/GPlain/up_right.png new file mode 100644 index 0000000..1e60833 Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/GPlain/up_right.png differ diff --git a/pacotes/balloon-tooltips/htdocs/images/balloons.png b/pacotes/balloon-tooltips/htdocs/images/balloons.png new file mode 100644 index 0000000..9f5a767 Binary files /dev/null and b/pacotes/balloon-tooltips/htdocs/images/balloons.png differ diff --git a/pacotes/balloon-tooltips/htdocs/js/balloon.config.js b/pacotes/balloon-tooltips/htdocs/js/balloon.config.js new file mode 100644 index 0000000..1c53fd4 --- /dev/null +++ b/pacotes/balloon-tooltips/htdocs/js/balloon.config.js @@ -0,0 +1,100 @@ +/* + +This file contains the default configuration options for balloon tooltips. +Default options can be edited in this file or changed after the Balloon object is +initiliazed as follows: + + var balloon = new Balloon; + balloon.fontColor = 'black'; + balloon.fontFamily = 'Arial, sans-serif'; + balloon.fontSize = '12pt'; + etc... + +*/ + +// This function adds the default configuration and also custom +// configuration sets, specified in 'case' stanzas +BalloonConfig = function(balloon, set) { + set = set || ''; + + //////////////////////////////////////////////////////////////// + // The default "base" config applied to all balloon objects. // + // See http://gmod.org/wiki/Popup_Balloons#Customization for // + // details about config options // + // // + // values can be overriden in custom config cases (see below) // + //////////////////////////////////////////////////////////////// + if (!balloon.configured || set == 'GBubble' || set == 'GBox') { // + balloon.fontColor = 'black'; // + balloon.fontFamily = 'Arial, sans-serif'; // + balloon.fontSize = '12pt'; // + balloon.minWidth = 100; // + balloon.maxWidth = 400; // + balloon.delayTime = 750; // + balloon.vOffset = 10; // + balloon.hOffset = 10; // + balloon.stem = true; // + balloon.images = i3GEO.configura.locaplic+'/pacotes/balloon-tooltips/htdocs/images/GBubble'; // + balloon.ieImage = 'balloon_ie.png'; // + balloon.balloonImage = 'balloon.png'; // + balloon.upLeftStem = 'up_left.png'; // + balloon.downLeftStem = 'down_left.png'; // + balloon.upRightStem = 'up_right.png'; // + balloon.downRightStem = 'down_right.png'; // + balloon.closeButton = 'close.png'; // + balloon.closeButtonWidth = 16; // + balloon.allowAJAX = false; // + balloon.allowIframes = false; // + balloon.trackCursor = true; // + balloon.shadow = 20; // + balloon.padding = 10; // + balloon.stemHeight = 32; // + balloon.stemOverlap = 3; // + balloon.vOffset = 1; // + balloon.hOffset = 1; // + balloon.opacity = 0.9; // + balloon.configured = set || true; // + } // + //////////////////////////////////////////////////////////////// + + + //////////////////////////////////////////////////////////////// + // Custom configuration options -- Add a case below for your // + // config set (default sets: GBox, GPlain, and GFade) // + //////////////////////////////////////////////////////////////// + switch(set) { + + // A formatted box (no background image) + case('GBoxxxx') : + balloon.bgColor = 'whitesmoke'; + balloon.borderStyle = '2px solid gray'; + //balloon.images = i3GEO.configura.locaplic+'/pacotes/balloon-tooltips/htdocs/images/GPlain'; + balloon.padding = 5; + balloon.shadow = 0; + balloon.stem = true; //original é false edmar + balloon.opacity = 0.8; + balloon.hOffset = 1; + balloon.vOffset = 1; + balloon.allowFade = false; + break; + + // A simpler balloon + case('GPlain') : + balloon.padding = 5; + balloon.images = i3GEO.configura.locaplic+'/pacotes/balloon-tooltips/htdocs/images/GPlain'; + balloon.ieImage = null; + balloon.shadow = 0; + balloon.stemHeight = 15; + balloon.stemOverlap = 1; + balloon.opacity = 0.85; + break; + + // The default cartoon bubble with a fade-in effect + case('GFade') : + balloon.allowFade = true; + balloon.fadeIn = 1000; + balloon.faedOut = 200; + break; + } +} + diff --git a/pacotes/balloon-tooltips/htdocs/js/balloon.config.js~ b/pacotes/balloon-tooltips/htdocs/js/balloon.config.js~ new file mode 100644 index 0000000..e53ab2d --- /dev/null +++ b/pacotes/balloon-tooltips/htdocs/js/balloon.config.js~ @@ -0,0 +1,100 @@ +/* + +This file contains the default configuration options for balloon tooltips. +Default options can be edited in this file or changed after the Balloon object is +initiliazed as follows: + + var balloon = new Balloon; + balloon.fontColor = 'black'; + balloon.fontFamily = 'Arial, sans-serif'; + balloon.fontSize = '12pt'; + etc... + +*/ + +// This function adds the default configuration and also custom +// configuration sets, specified in 'case' stanzas +BalloonConfig = function(balloon, set) { + set = set || ''; + + //////////////////////////////////////////////////////////////// + // The default "base" config applied to all balloon objects. // + // See http://gmod.org/wiki/Popup_Balloons#Customization for // + // details about config options // + // // + // values can be overriden in custom config cases (see below) // + //////////////////////////////////////////////////////////////// + if (!balloon.configured || set == 'GBubble' || set == 'GBox') { // + balloon.fontColor = 'black'; // + balloon.fontFamily = 'Arial, sans-serif'; // + balloon.fontSize = '12pt'; // + balloon.minWidth = 100; // + balloon.maxWidth = 400; // + balloon.delayTime = 750; // + balloon.vOffset = 10; // + balloon.hOffset = 10; // + balloon.stem = true; // + balloon.images = i3GEO.configura.locaplic+'/pacotes/balloon-tooltips/htdocs/images/GBubble'; // + balloon.ieImage = 'balloon_ie.png'; // + balloon.balloonImage = 'balloon.png'; // + balloon.upLeftStem = 'up_left.png'; // + balloon.downLeftStem = 'down_left.png'; // + balloon.upRightStem = 'up_right.png'; // + balloon.downRightStem = 'down_right.png'; // + balloon.closeButton = 'close.png'; // + balloon.closeButtonWidth = 16; // + balloon.allowAJAX = false; // + balloon.allowIframes = false; // + balloon.trackCursor = false; // + balloon.shadow = 20; // + balloon.padding = 10; // + balloon.stemHeight = 32; // + balloon.stemOverlap = 3; // + balloon.vOffset = 1; // + balloon.hOffset = 1; // + balloon.opacity = 0.9; // + balloon.configured = set || true; // + } // + //////////////////////////////////////////////////////////////// + + + //////////////////////////////////////////////////////////////// + // Custom configuration options -- Add a case below for your // + // config set (default sets: GBox, GPlain, and GFade) // + //////////////////////////////////////////////////////////////// + switch(set) { + + // A formatted box (no background image) + case('GBoxxxx') : + balloon.bgColor = 'whitesmoke'; + balloon.borderStyle = '2px solid gray'; + //balloon.images = i3GEO.configura.locaplic+'/pacotes/balloon-tooltips/htdocs/images/GPlain'; + balloon.padding = 5; + balloon.shadow = 0; + balloon.stem = true; //original é false edmar + balloon.opacity = 0.8; + balloon.hOffset = 1; + balloon.vOffset = 1; + balloon.allowFade = false; + break; + + // A simpler balloon + case('GPlain') : + balloon.padding = 5; + balloon.images = i3GEO.configura.locaplic+'/pacotes/balloon-tooltips/htdocs/images/GPlain'; + balloon.ieImage = null; + balloon.shadow = 0; + balloon.stemHeight = 15; + balloon.stemOverlap = 1; + balloon.opacity = 0.85; + break; + + // The default cartoon bubble with a fade-in effect + case('GFade') : + balloon.allowFade = true; + balloon.fadeIn = 1000; + balloon.faedOut = 200; + break; + } +} + diff --git a/pacotes/balloon-tooltips/htdocs/js/balloon.js b/pacotes/balloon-tooltips/htdocs/js/balloon.js new file mode 100644 index 0000000..24f9e4d --- /dev/null +++ b/pacotes/balloon-tooltips/htdocs/js/balloon.js @@ -0,0 +1,1166 @@ +/* + * balloon.js -- a DHTML library for balloon tooltips + * + * $Id: balloon.js 22300 2009-12-01 09:40:39Z sheldon_mckay $ + * + * See http://www.gmod.org/wiki/index.php/Popup_Balloons + * for documentation. + * + * Copyright (c) 2007-2009 Sheldon McKay, Cold Spring Harbor Laboratory + * + * This balloon tooltip package and associated files not otherwise copyrighted are + * distributed under the MIT-style license: + * + * http://opensource.org/licenses/mit-license.php + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +// These global variables are necessary to avoid losing scope when +// setting the balloon timeout and for inter-object communication +var currentBalloonClass; +var balloonIsVisible; +var balloonIsSticky; +var balloonInvisibleSelects; +var balloonIsSuppressed; +var tooltipIsSuppressed; + + +////////////////////////////////////////////////////////////////////////// +// This is constructor that is called to initialize the Balloon object // +////////////////////////////////////////////////////////////////////////// +var Balloon = function () { + // Cursor tracking enabled by default + this.trackCursor = true; + + // Track the cursor every time the mouse moves + document.onmousemove = this.setActiveCoordinates; + + // scrolling aborts visible balloons + var myObject = this.isIE() ? window : document; + myObject.onscroll = function(){Balloon.prototype.nukeTooltip()}; + + // make balloons go away if the page is unloading or waiting + // to unload. + window.onbeforeunload = function(){ + Balloon.prototype.nukeTooltip(); + balloonIsSuppressed = true; + }; + + // for IE, the balloons can't start until the page is finished loading + // set a flag that will get toggled when loading is finished + if (this.isIE()) { + this.suppress = true; + } + + return this; +} + +////////////////////////////////////////////////////////////////////////// +// This is the method that is called on mouseover. It has a built-in // +// delay time to avoid balloons popping up on rapid mouseover events // +////////////////////////////////////////////////////////////////////////// +Balloon.prototype.showTooltip = function(evt,caption,sticky,width,height) { + // If the objext is not configured by now, fall back to default + if (!this.configured) { + BalloonConfig(this,'GBubble'); + } + + // Cursor tracking halts after one of these vertical + // or horizontal thresholds are reached + this.stopTrackingX = this.trackCursor ? 100 : 10; + this.stopTrackingY = this.trackCursor ? 50 : 10; + + // Awful IE bug, page load aborts if the balloon is fired + // before the page is fully loaded. + if (this.isIE() && document.readyState.match(/complete/i)) { + this.suppress = false; + } + + // All balloons have been suppressed, go no further + if (this.suppress || balloonIsSuppressed) { + return false; + } + + // Non-sticky balloons suppressed + if (tooltipIsSuppressed && !sticky) { + return false; + } + + // We use 1-100 scale for opacity internally + if (this.opacity && this.opacity < 1) { + this.opacity = parseInt(parseFloat(this.opacity) * 100); + } + else if (this.opacity && this.opacity == 1) { + this.opacity = 100; + } + else if (!this.opacity) { + this.opacity == 100; + } + + // Sorry Konqueror, no fade-in or translucency for you! + if (this.isKonqueror()) { + this.allowFade = false; + this.opacity = 100; + } + + // With IE, fading and translucency are not very compatible + // use opaque balloons if fadein is enabled + if (this.isIE() && this.allowFade) { + this.opacity = 100; + } + + // Check for mouseover (vs. mousedown or click) + var mouseOver = true; + try{ + var mouseOver = evt.type.match('mouseover','i'); + }catch(e){} + + // if the firing event is a click, fade-in and a non-sticky balloon make no sense + if (!mouseOver) { + sticky = true; + this.fadeOK = false; + // case where hover and click events both trigger balloons + if (balloonIsVisible) { + this.hideTooltip(); + } + } + else { + this.fadeOK = this.allowFade; + } + + // Don't fire on mouseover if a non-sticky balloon is visible + if (balloonIsVisible && !balloonIsSticky && mouseOver) { + return false; + } + + // Don't start a non-sticky balloon if a sticky one is visible + if (balloonIsVisible && balloonIsSticky && !sticky) { + return false; + } + + // Ignore repeated firing of mouseover->mouseout events on + // the same element (Safari) + + try{ + var el = this.getEventTarget(evt); + }catch(e){var el = evt;} + + if (sticky && mouseOver && this.isSameElement(el,this.currentElement)) { + return false; + } + this.currentElement = el; + + // remember the coordinates of the element + this.elCoords = this.getLoc(el,'region'); + + // attach a mouseout event handler to the target element + if (!sticky) { + var mouseoutFunc = el.onmouseout; + var closeBalloon = function() { + Balloon.prototype.hideTooltip(); + // fall through to any onmouseout event specified elsewhere + if (mouseoutFunc) { + mouseoutFunc(); + } + } + if (!mouseOver) { + el.onmouseup = function() {return false}; + } + //el.onmouseout = closeBalloon; + } + + balloonIsSticky = sticky; + + this.hideTooltip(); + + // request the contents synchronously (ie wait for result) + this.currentHelpText = this.getAndCheckContents(caption); + + // no contents? abort. + if (!this.currentHelpText) { + return false; + } + + this.width = width; + this.height = height; + this.actualWidth = null; + + // make sure old balloons are removed + this.hideTooltip(); + + // Put the balloon contents and images into a visible (but offscreen) + // element so they will be preloaded and have a layout to + // calculate the balloon dimensions + this.container = document.createElement('div'); + this.container.id = 'balloonPreloadContainer'; + document.body.appendChild(this.container); + this.setStyle(this.container,'position','absolute'); + this.setStyle(this.container,'top',-8888); + this.setStyle(this.container,'font-family',this.fontFamily); + this.setStyle(this.container,'font-size',this.fontSize); + + // protect escaped '&' + this.currentHelpText = this.currentHelpText.replace(/\&/g, '&amp'); + this.container.innerHTML = unescape(this.currentHelpText); + + // make sure balloon image path is complete + if (this.images) { + + // main background image + this.balloonImage = this.balloonImage ? this.images +'/'+ this.balloonImage : false; + this.ieImage = this.ieImage ? this.images +'/'+ this.ieImage : false; + + // optional stems + this.upLeftStem = this.upLeftStem ? this.images +'/'+ this.upLeftStem : false; + this.upRightStem = this.upRightStem ? this.images +'/'+ this.upRightStem : false; + this.downLeftStem = this.downLeftStem ? this.images +'/'+ this.downLeftStem : false; + this.downRightStem = this.downRightStem ? this.images +'/'+ this.downRightStem : false; + + this.closeButton = this.closeButton ? this.images +'/'+ this.closeButton : false; + + this.images = false; + } + + // The PNG alpha channels (shadow transparency) are not + // handled properly by IE < 6. Also, if opacity is set to + // < 1 (translucent balloons), any version of IE does not + // handle the image properly. + // Google chrome is a bit dodgey too + // If there is an IE image provided, use that instead. + if (this.ieImage && (this.isIE() || this.isChrome())) { + if (this.isOldIE() || this.opacity || this.allowFade) { + this.balloonImage = this.ieImage; + } + } + + // preload balloon images + if (!this.preloadedImages) { + var images = new Array(this.balloonImage, this.closeButton); + if (this.ieImage) { + images.push(this.ieImage); + } + if (this.stem) { + images.push(this.upLeftStem,this.upRightStem,this.downLeftStem,this.downRightStem); + } + var len = images.length; + for (var i=0;i pageMid ? 'up' : 'down'; + var hOrient = self.activeRight > pageCen ? 'left' : 'right'; + + // get the preloaded balloon contents + var helpText = self.container.innerHTML; + self.actualWidth = self.getLoc(self.container,'width'); + if (!isNaN(self.actualWidth)) { + self.actualWidth += 10; + } + self.parent.removeChild(self.container); + var wrapper = document.createElement('div'); + wrapper.id = 'contentWrapper'; + self.contents.appendChild(wrapper); + wrapper.innerHTML = helpText; + + // how and where to draw the balloon + self.setBalloonStyle(vOrient,hOrient,pageWidth,pageLeft); + + // close control for balloon or box + if (balloonIsSticky) { + self.addCloseButton(); + } + + balloonIsVisible = true; + self.pending = false; + + // in IE < 7, hide elements + self.showHide(); + + self.startX = self.activeLeft; + self.startY = self.activeTop; + self.fade(0,self.opacity,self.fadeIn); +} + +Balloon.prototype.addCloseButton = function () { + var self = currentBalloonClass; + var margin = Math.round(self.padding/2); + var closeWidth = self.closeButtonWidth || 16; + var balloonTop = self.getLoc('visibleBalloonElement','y1') + margin + self.shadow; + var BalloonLeft = self.getLoc('topRight','x2') - self.closeButtonWidth - self.shadow - margin; + var closeButton = document.getElementById('closeButton'); + + if (!closeButton) { + closeButton = new Image; + closeButton.setAttribute('id','closeButton'); + closeButton.setAttribute('src',self.closeButton); + closeButton.onclick = function() { + Balloon.prototype.nukeTooltip(); + }; + self.setStyle(closeButton,'position','absolute'); + document.body.appendChild(closeButton); + } + + // I have no idea why + if (self.isIE()) { + BalloonLeft = BalloonLeft - 5; + } + + self.setStyle(closeButton,'top',balloonTop); + self.setStyle(closeButton,'left',BalloonLeft); + self.setStyle(closeButton,'display','inline'); + self.setStyle(closeButton,'cursor','pointer'); + self.setStyle(closeButton,'z-index',999999999); +} + +// use a fresh object every time to make sure style +// is not polluted +Balloon.prototype.makeBalloon = function() { + var self = currentBalloonClass; + + var balloon = document.getElementById('visibleBalloonElement'); + if (balloon) { + self.hideTooltip(); + } + + balloon = document.createElement('div'); + balloon.setAttribute('id','visibleBalloonElement'); + self.parent.appendChild(balloon); + self.activeBalloon = balloon; + + self.parts = new Array(); + var parts = new Array('contents','topRight','bottomRight','bottomLeft'); + for (var i=0;i self.maxWidth) { + self.setStyle(balloon,'width',self.maxWidth); + self.setStyle('contentWrapper','width',self.maxWidth-fullPadding); + } + // not too small... + if (!self.width && self.minWidth && outerWidth < self.minWidth) { + self.setStyle(balloon,'width',self.minWidth); + self.setStyle('contentWrapper','width',self.minWidth-fullPadding); + } + + self.setStyle('contents','z-index',2); + self.setStyle('contents','color',self.fontColor); + self.setStyle('contents','font-family',self.fontFamily); + self.setStyle('contents','font-size',self.fontSize); + self.setStyle('contents','background','url('+self.balloonImage+') top left no-repeat'); + self.setStyle('contents','padding-top',fullPadding); + self.setStyle('contents','padding-left',fullPadding); + + self.setStyle('bottomRight','background','url('+self.balloonImage+') bottom right no-repeat'); + self.setStyle('bottomRight','position','absolute'); + self.setStyle('bottomRight','right',0-fullPadding); + self.setStyle('bottomRight','bottom',0-fullPadding); + self.setStyle('bottomRight','height',fullPadding); + self.setStyle('bottomRight','width',fullPadding); + self.setStyle('bottomRight','z-index',-1); + + self.setStyle('topRight','background','url('+self.balloonImage+') top right no-repeat'); + self.setStyle('topRight','position','absolute'); + self.setStyle('topRight','right',0-fullPadding); + self.setStyle('topRight','top',0); + self.setStyle('topRight','width',fullPadding); + + self.setStyle('bottomLeft','background','url('+self.balloonImage+') bottom left no-repeat'); + self.setStyle('bottomLeft','position','absolute'); + self.setStyle('bottomLeft','left',0); + self.setStyle('bottomLeft','bottom',0-fullPadding); + self.setStyle('bottomLeft','height',fullPadding); + self.setStyle('bottomLeft','z-index',-1); + + if (this.stem) { + var stem = document.createElement('img'); + self.setStyle(stem,'position','absolute'); + balloon.appendChild(stem); + + if (vOrient == 'up' && hOrient == 'left') { + stem.src = self.upLeftStem; + var height = self.stemHeight + insidePadding - self.stemOverlap; + self.setStyle(stem,'bottom',0-height); + self.setStyle(stem,'right',0); + } + else if (vOrient == 'down' && hOrient == 'left') { + stem.src = self.downLeftStem; + var height = self.stemHeight - (self.shadow + self.stemOverlap); + self.setStyle(stem,'top',0-height); + self.setStyle(stem,'right',0); + } + else if (vOrient == 'up' && hOrient == 'right') { + stem.src = self.upRightStem; + var height = self.stemHeight + insidePadding - self.stemOverlap; + self.setStyle(stem,'bottom',0-height); + self.setStyle(stem,'left',self.shadow); + } + else if (vOrient == 'down' && hOrient == 'right') { + stem.src = self.downRightStem; + var height = self.stemHeight - (self.shadow + self.stemOverlap); + self.setStyle(stem,'top',0-height); + self.setStyle(stem,'left',self.shadow); + } + if (self.fadeOK && self.isIE()) { + self.parts.push(stem); + } + } + + if (self.allowFade) { + self.setOpacity(1); + } + else if (self.opacity) { + self.setOpacity(self.opacity); + } + + // flip left or right, as required + if (hOrient == 'left') { + var pageWidth = self.pageRight - self.pageLeft; + var activeRight = pageWidth - self.activeLeft; + self.setStyle(balloon,'right',activeRight); + } + else { + var activeLeft = self.activeRight - self.xOffset; + self.setStyle(balloon,'left',activeLeft); + } + + // oversized contents? Scrollbars for sticky balloons, clipped for non-sticky + var overflow = balloonIsSticky ? 'auto' : 'hidden'; + self.setStyle('contentWrapper','overflow',overflow); + + // a bit of room for the closebutton + if (balloonIsSticky) { + self.setStyle('contentWrapper','margin-right',self.closeButtonWidth); + } + + // Make sure the balloon is not offscreen horizontally. + // We handle vertical sanity checking later, after the final + // layout is set. + var balloonLeft = self.getLoc(balloon,'x1'); + var balloonRight = self.getLoc(balloon,'x2'); + var scrollBar = 20; + + if (hOrient == 'right' && balloonRight > (self.pageRight - fullPadding)) { + var width = (self.pageRight - balloonLeft) - fullPadding - scrollBar; + self.setStyle(balloon,'width',width); + self.setStyle('contentWrapper','width',width-fullPadding); + } + else if (hOrient == 'left' && balloonLeft < (self.pageLeft + fullPadding)) { + var width = (balloonRight - self.pageLeft) - fullPadding; + self.setStyle(balloon,'width',width); + self.setStyle('contentWrapper','width',width-fullPadding); + } + + // Get the width/height for the right and bottom outlines + var balloonWidth = self.getLoc(balloon,'width'); + var balloonHeight = self.getLoc(balloon,'height'); + + // IE7 quirk -- look for unwanted overlap cause by an off by 1px error + var vOverlap = self.isOverlap('topRight','bottomRight'); + var hOverlap = self.isOverlap('bottomLeft','bottomRight'); + if (vOverlap) { + self.setStyle('topRight','height',balloonHeight-vOverlap[1]); + } + if (hOverlap) { + self.setStyle('bottomLeft','width',balloonWidth-hOverlap[0]); + } + + // vertical position of the balloon + if (vOrient == 'up') { + var activeTop = self.activeTop - balloonHeight; + self.setStyle(balloon,'top',activeTop); + } + else { + var activeTop = self.activeBottom; + self.setStyle(balloon,'top',activeTop); + } + + // Make sure the balloon is vertically contained in the window + var balloonTop = self.getLoc(balloon,'y1'); + var balloonBottom = self.height ? balloonTop + self.height : self.getLoc(balloon,'y2'); + var deltaTop = balloonTop < self.pageTop ? self.pageTop - balloonTop : 0; + var deltaBottom = balloonBottom > self.pageBottom ? balloonBottom - self.pageBottom : 0; + + if (vOrient == 'up' && deltaTop) { + var newHeight = balloonHeight - deltaTop; + if (newHeight > (self.padding*2)) { + self.setStyle('contentWrapper','height',newHeight-fullPadding); + self.setStyle(balloon,'top',self.pageTop+self.padding); + self.setStyle(balloon,'height',newHeight); + } + } + if (vOrient == 'down' && deltaBottom) { + var newHeight = balloonHeight - deltaBottom - scrollBar; + if (newHeight > (self.padding*2) + scrollBar) { + self.setStyle('contentWrapper','height',newHeight-fullPadding); + self.setStyle(balloon,'height',newHeight); + } + } + + // If we have an iframe, make sure it fits properly + var iframe = balloon.getElementsByTagName('iframe'); + if (iframe[0]) { + iframe = iframe[0]; + var w = self.getLoc('contentWrapper','width'); + if (balloonIsSticky && !this.isIE()) { + w -= self.closeButtonWidth; + } + var h = self.getLoc('contentWrapper','height'); + self.setStyle(iframe,'width',w); + self.setStyle(iframe,'height',h); + self.setStyle('contentWrapper','overflow','hidden'); + } + + // Make edges match the main balloon body + self.setStyle('topRight','height', self.getLoc(balloon,'height')); + self.setStyle('bottomLeft','width', self.getLoc(balloon,'width')); + + self.hOrient = hOrient; + self.vOrient = vOrient; +} + + +// Fade method adapted from an example on +// http://brainerror.net/scripts/javascript/blendtrans/ +Balloon.prototype.fade = function(opacStart, opacEnd, millisec) { + var self = currentBalloonClass || new Balloon; + if (!millisec || !self.allowFade) { + return false; + } + + opacEnd = opacEnd || 100; + + //speed for each frame + var speed = Math.round(millisec / 100); + var timer = 0; + for(o = opacStart; o <= opacEnd; o++) { + self.timeoutFade = setTimeout('Balloon.prototype.setOpacity('+o+')',(timer*speed)); + timer++; + } +} + +Balloon.prototype.setOpacity = function(opc) { + var self = currentBalloonClass; + if (!self || !opc) return false; + + var o = parseFloat(opc/100); + + // opacity handled differently for IE + var parts = self.isIE() ? self.parts : [self.activeBalloon]; + + var len = parts.length; + for (var i=0;i self.elCoords.right + || XY[1] < self.elCoords.top || XY[1] > self.elCoords.bottom ) { + //self.hideTooltip(); + } + + // In some cases , such as elements in image maps or big elements, + // we need to kill the balloon if the mouse has strayed too far. + if (deltaX > self.stopTrackingX || deltaY > self.stopTrackingY) { + //self.hideTooltip(); + } + else if (self.trackCursor) { + var b = self.activeBalloon; + var bwidth = self.getLoc(b,'width'); + var bheight = self.getLoc(b,'height'); + var btop = self.getLoc(b,'y1'); + var bleft = self.getLoc(b,'x1'); + + if (self.hOrient == 'right') { + self.setStyle(b,'left',self.activeRight); + } + else if (self.hOrient == 'left') { + self.setStyle(b,'right',null); + var newLeft = self.activeLeft - bwidth; + self.setStyle(b,'left',newLeft); + } + + if (self.vOrient == 'up') { + self.setStyle(b,'top',self.activeTop - bheight); + } + else if (self.vOrient == 'down') { + self.setStyle(b,'top',self.activeBottom); + } + } + } + + return true; +} + +//// +// event XY and getEventTarget Functions based on examples by Peter-Paul +// Koch http://www.quirksmode.org/js/events_properties.html +Balloon.prototype.eventXY = function(event) { + var XY = new Array(2); + var e = event || window.event; + if (!e) { + return false; + } + if (e.pageX || e.pageY) { + XY[0] = e.pageX; + XY[1] = e.pageY; + return XY; + } + else if ( e.clientX || e.clientY ) { + XY[0] = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; + XY[1] = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; + return XY; + } +} + +Balloon.prototype.getEventTarget = function(event) { + var targ; + var e = event || window.event; + if (e.target) targ = e.target; + else if (e.srcElement) targ = e.srcElement; + if (targ.nodeType == 3) targ = targ.parentNode; // Safari + return targ; +} +//// + + +Balloon.prototype.setStyle = function(el,att,val) { + if (!el) { + return false; + } + if (typeof(el) != 'object') { + el = document.getElementById(el); + } + if (!el) { + return false; + } + + var v = val; + + if (val && att.match(/left|top|bottom|right|width|height|padding|margin/)) { + val = new String(val); + if (!val.match(/auto/)) { + val += 'px'; + } + } + + + // z-index does not work as expected + if (att == 'z-index') { + if (el.style) { + el.style.zIndex = parseInt(val); + } + } + else { + // Oh just shut up, IE + if (this.isIE() && att.match(/^left|right|top|bottom$/) && !parseInt(val) && val != 0) { + val = null; + } + + YAHOO.util.Dom.setStyle(el,att,val); + } +} + +// Uses YAHOO's region class for element coordinates +Balloon.prototype.getLoc = function(el,request) { + var region = YAHOO.util.Dom.getRegion(el); + + switch(request) { + case ('y1') : return parseInt(region.top); + case ('y2') : return parseInt(region.bottom); + case ('x1') : return parseInt(region.left); + case ('x2') : return parseInt(region.right); + case ('width') : return (parseInt(region.right) - parseInt(region.left)); + case ('height') : return (parseInt(region.bottom) - parseInt(region.top)); + case ('region') : return region; + } + + return region; +} + +// We don't know if numbers are overridden with strings +// so play it safe +Balloon.prototype.parseIntAll = function() { + this.padding = parseInt(this.padding); + this.shadow = parseInt(this.shadow); + this.stemHeight = parseInt(this.stemHeight); + this.stemOverlap = parseInt(this.stemOverlap); + this.vOffset = parseInt(this.vOffset); + this.delayTime = parseInt(this.delayTime); + this.width = parseInt(this.width); + this.maxWidth = parseInt(this.maxWidth); + this.minWidth = parseInt(this.minWidth); + this.fadeIn = parseInt(this.fadeIn) || 1000; +} + + +// show/hide select elements in older IE +// plus user-defined elements +Balloon.prototype.showHide = function(visible) { + var self = currentBalloonClass || new Balloon; + + // IE z-index bug fix (courtesy of Lincoln Stein) + if (self.isOldIE()) { + var balloonContents = document.getElementById('contentWrapper'); + if (!visible && balloonContents) { + var balloonSelects = balloonContents.getElementsByTagName('select'); + var myHash = new Object(); + for (var i=0; i elements '+notAllowed); + return null; + } + + // request the contents + this.currentHelpText = this.getContents(caption); + this.loadedFromElement = false; + + return this.currentHelpText;; +} + + +/////////////////////////////////////////////////////// +// AJAX widget to fill the balloons +// requires prototype.js +/////////////////////////////////////////////////////// +Balloon.prototype.getContents = function(section) { + + // just pass it back if no AJAX handler is required. + if (!this.helpUrl && !this.activeUrl) return section; + + // or if the contents are already loaded from another element + if (this.loadedFromElement) return section; + + // inline URL takes precedence + var url = this.activeUrl || this.helpUrl; + url += this.activeUrl ? '' : '?section='+section; + + // activeUrl is meant to be single-use only + this.activeUrl = null; + + var ajax; + if (window.XMLHttpRequest) { + ajax = new XMLHttpRequest(); + } else { + ajax = new ActiveXObject("Microsoft.XMLHTTP"); + } + + if (ajax) { + ajax.open("GET", url, false); + ajax.onreadystatechange=function() { + //alert(ajax.readyState); + }; + try { + ajax.send(null); + } + catch (e) { + // alert(e); + } + var txt = this.escapeHTML ? escape(ajax.responseText) : ajax.responseText; + return txt || section; + } + else { + return section; + } +} + + +// test for internet explorer +Balloon.prototype.isIE = function() { + return document.all && !window.opera; +} + +// test for internet explorer (but not IE7) +Balloon.prototype.isOldIE = function() { + if (navigator.appVersion.indexOf("MSIE") == -1) return false; + var temp=navigator.appVersion.split("MSIE"); + return parseFloat(temp[1]) < 7; +} + +// test for Konqueror +Balloon.prototype.isKonqueror = function() { + return navigator.userAgent.toLowerCase().indexOf( 'konqueror' ) != -1; +} + +// and Google chrome +Balloon.prototype.isChrome = function() { + return navigator.userAgent.toLowerCase().indexOf('chrome') > -1; +} \ No newline at end of file diff --git a/pacotes/balloon-tooltips/htdocs/js/box.js b/pacotes/balloon-tooltips/htdocs/js/box.js new file mode 100644 index 0000000..4d2d53a --- /dev/null +++ b/pacotes/balloon-tooltips/htdocs/js/box.js @@ -0,0 +1,217 @@ +/* + This is a subclass of balloon.js -- uses a simple box rather than a + a balloon/bubble image. It can have a background image and a styled + bgcolor and border but is otherwise meant to be simple and lightweight. +*/ + +////////////////////////////////////////////////////////////////////////// +// This is constructor that is called to initialize the Balloon object // +////////////////////////////////////////////////////////////////////////// +var Box = function () { + // Track the cursor every time the mouse moves + document.onmousemove = this.setActiveCoordinates; + + // scrolling aborts unsticky box + document.onscroll = Balloon.prototype.hideTooltip; + + // go away if the page is unloading or waiting + // to unload. + window.onbeforeunload = function(){ + Balloon.prototype.nukeTooltip; + balloonIsSuppressed = true; + }; + + // for IE, the box can't start until the page is finished loading + // set a flag that will get toggled when loading is finished + if (this.isIE()) { + this.suppress = true; + } + + return this; +} + +// Inherit from Balloon class +Box.prototype = new Balloon(); + + +// Make the box element -- this overrides the parent method +Box.prototype.makeBalloon = function() { + var self = currentBalloonClass; + + // use ID 'visibleBalloonElement' for consistency with parent class + var box = document.getElementById('visibleBalloonElement'); + if (box) self.parent.removeChild(box); + box = document.createElement('div'); + box.setAttribute('id','visibleBalloonElement'); + self.parent.appendChild(box); + self.activeBalloon = box; + + var contents = document.createElement('div'); + contents.setAttribute('id','contents'); + box.appendChild(contents); + self.contents = contents; + self.parts = new Array(box); + + self.setStyle(contents,'z-index',2); + self.setStyle(contents,'color',self.fontColor); + self.setStyle(contents,'font-family',self.fontFamily); + self.setStyle(contents,'font-size',self.fontSize); + + if (balloonIsSticky) { + self.setStyle(contents,'margin-right',10); + } + else if (self.displayTime) { + self.timeoutAutoClose = window.setTimeout(this.hideTooltip,self.displayTime); + } + + return box; +} + +// Set the box style -- overrides the parent method +Box.prototype.setBalloonStyle = function(vOrient,hOrient) { + var self = currentBalloonClass; + var box = self.activeBalloon; + + self.shadow = 0; + self.stem = false; + self.stemHeight = 0; + + self.setStyle(box,'background',self.bgColor); + self.setStyle(box,'border',self.borderStyle); + self.setStyle(box,'position','absolute'); + self.setStyle(box,'padding',self.padding); + self.setStyle(box,'top',-9999); + self.setStyle(box,'z-index',1000000); + + // If width and/or height are specified, harden the + // box at those dimensions, but not if the space needed + // is less tha the space that would be used. + if (self.width) { + var widthUsed = self.getLoc('contents','width') + 20; + var newWidth = widthUsed > self.width ? self.width : widthUsed; + self.setStyle('contents','width',newWidth); + } + if (self.height) { + var heightUsed = self.getLoc('contents','height') + 20; + var newHeight = heightUsed > self.height ? self.height : heightUsed; + self.setStyle('contents','height',newHeight+(2*self.padding)); + } + + // flip left or right, as required + if (hOrient == 'left') { + var pageWidth = self.pageRight - self.pageLeft; + var activeRight = pageWidth - self.activeLeft; + self.setStyle(box,'right',activeRight); + } + else { + self.setStyle(box,'left',self.activeRight - self.xOffset); + } + + if (!self.width) { + var width = self.getLoc('contents','width'); + if (self.isIE()) width += self.padding; + if (width > self.maxWidth) width = self.maxWidth + self.padding; + if (width < self.minWidth) width = self.minWidth; + self.setStyle(box,'width',width); + } + + var overflow = balloonIsSticky ? 'auto' : 'hidden'; + self.setStyle('contents','overflow',overflow); + + // Make sure the box is not offscreen horizontally. + // We handle vertical sanity checking later, after the final + // layout is set. + var boxLeft = self.getLoc(box,'x1'); + var boxRight = self.getLoc(box,'x2'); + var scrollBar = 20; + + if (hOrient == 'right' && boxRight > (self.pageRight - self.padding)) { + self.setStyle('contents','width',(self.pageRight - boxLeft) - self.padding - scrollBar); + } + else if (hOrient == 'left' && boxLeft < (self.pageLeft + self.padding)) { + self.setStyle('contents','width',(boxRight - self.pageLeft) - self.padding); + } + + // Get the width/height for the right and bottom outlines + var boxWidth = self.getLoc(box,'width'); + var boxHeight = self.getLoc(box,'height'); + + if (self.allowFade) { + self.setOpacity(0.01); + } + else { + self.setOpacity(self.opacity); + } + + if (!(self.activeTop && self.activeBottom)) { + self.setActiveCoordinates(); + } + + if (vOrient == 'up') { + var activeTop = self.activeTop - boxHeight; + self.setStyle(box,'top',activeTop); + } + else if (vOrient == 'down') { + var activeTop = self.activeBottom; + self.setStyle(box,'top',activeTop); + } + self.setStyle(box,'display','inline'); + + // Make sure the box is vertically contained in the window + var boxTop = self.getLoc(box,'y1'); + var boxBottom = self.getLoc(box,'y2'); + var deltaTop = boxTop < self.pageTop ? self.pageTop - boxTop : 0; + var deltaBottom = boxBottom > self.pageBottom ? boxBottom - self.pageBottom : 0; + + if (vOrient == 'up' && deltaTop) { + var newHeight = boxHeight - deltaTop; + if (newHeight > (self.padding*2)) { + self.setStyle('contents','height',newHeight); + self.setStyle(box,'top',self.pageTop+self.padding); + self.setStyle(box,'height',newHeight); + } + } + + if (vOrient == 'down' && deltaBottom) { + var newHeight = boxHeight - deltaBottom - scrollBar; + if (newHeight > (self.padding*2) + scrollBar) { + self.setStyle('contents','height',newHeight); + self.setStyle(box,'height',newHeight); + } + } + + self.hOrient = hOrient; + self.vOrient = vOrient; +} + + +Box.prototype.addCloseButton = function () { + var self = currentBalloonClass; + var margin = Math.round(self.padding/2); + var closeWidth = self.closeButtonWidth || 16; + var balloonTop = self.getLoc('visibleBalloonElement','y1') + margin; + var balloonRight = self.getLoc('visibleBalloonElement','x2') - margin - self.closeButtonWidth; + var closeButton = document.getElementById('closeButton'); + + + if (!closeButton) { + closeButton = new Image; + closeButton.setAttribute('id','closeButton'); + closeButton.setAttribute('src',self.closeButton); + closeButton.onclick = function() { + Balloon.prototype.nukeTooltip(); + }; + self.setStyle(closeButton,'position','absolute'); + document.body.appendChild(closeButton); + } + + if (self.isIE()) { + balloonRight -= self.padding; + } + + self.setStyle(closeButton,'top',balloonTop); + self.setStyle(closeButton,'left',balloonRight); + self.setStyle(closeButton,'display','inline'); + self.setStyle(closeButton,'cursor','pointer'); + self.setStyle(closeButton,'z-index',999999999); +} diff --git a/pacotes/balloon-tooltips/htdocs/js/yahoo-dom-event.js b/pacotes/balloon-tooltips/htdocs/js/yahoo-dom-event.js new file mode 100644 index 0000000..1ee394d --- /dev/null +++ b/pacotes/balloon-tooltips/htdocs/js/yahoo-dom-event.js @@ -0,0 +1,197 @@ +/* +Copyright (c) 2007, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.3.0 +*/ + +if(typeof YAHOO=="undefined"){var YAHOO={};} +YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);} +s.push(COMMA);} +if(s.length>1){s.pop();} +s.push("]");}else{s.push("{");for(i in o){if(l.hasOwnProperty(o,i)){s.push(i+ARROW);if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);} +s.push(COMMA);}} +if(s.length>1){s.pop();} +s.push("}");} +return s.join("");},substitute:function(s,o,f){var i,j,k,key,v,meta,l=YAHOO.lang,saved=[],token,DUMP='dump',SPACE=' ',LBRACE='{',RBRACE='}';for(;;){i=s.lastIndexOf(LBRACE);if(i<0){break;} +j=s.indexOf(RBRACE,i);if(i+1>=j){break;} +token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k);} +v=o[key];if(f){v=f(key,v,meta);} +if(l.isObject(v)){if(l.isArray(v)){v=l.dump(v,parseInt(meta,10));}else{meta=meta||"";var dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4);} +if(v.toString===Object.prototype.toString||dump>-1){v=l.dump(v,parseInt(meta,10));}else{v=v.toString();}}}else if(!l.isString(v)&&!l.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token;} +s=s.substring(0,i)+v+s.substring(j+1);} +for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g");} +return s;},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"");}catch(e){return s;}},merge:function(){var o={},a=arguments,i;for(i=0;i=this.left&®ion.right<=this.right&®ion.top>=this.top&®ion.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(YAHOO.lang.isArray(x)){y=x[1];x=x[0];} +this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.3.0",build:"442"}); +YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){} +var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");} +if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);} +this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();} +var found=false;for(var i=0,len=this.subscribers.length;i0){param=args[0];} +ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);} +if(false===ret){if(!this.silent){} +return false;}}} +if(rebuild){var newlist=[],subs=this.subscribers;for(i=0,len=subs.length;i=0){cacheItem=listeners[index];} +if(!el||!cacheItem){return false;} +if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i0);} +var notAvail=[];var executeItem=function(el,item){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}} +item.fn.call(scope,item.obj);};var i,len,item,el;for(i=0,len=onAvailStack.length;i0){for(var i=0,len=searchList.length;i0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);} +j=j-1;} +l=null;EU.clearCache();} +for(i=0,len=legacyEvents.length;i<'+'/script>');el=document.getElementById("_yui_eu_dr");} +if(el){el.onreadystatechange=function(){if("complete"===this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};}else{} +el=null;}else if(EU.webkit){EU._drwatch=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._drwatch);EU._drwatch=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);} +EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();} +YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];} +subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var evts=this.__yui_events;if(p_type){var ce=evts[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}}else{for(var i in evts){var ret=true;if(YAHOO.lang.hasOwnProperty(evts,i)){ret=ret&&evts[i].unsubscribe(p_fn,p_obj);}} +return ret;} +return false;},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=(opts.silent);var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);} +this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i