/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-06-22 04:38:37 +0200 (Fr, 22 Jun 2007) $
 * $Rev: 2141 $
 *
 * Version: 1.0b2
 */
(function(f){var u=f.fn.height,r=f.fn.width;f.fn.extend({height:function(){if(this[0]==window)return self.innerHeight||f.boxModel&&document.documentElement.clientHeight||document.body.clientHeight;if(this[0]==document)return Math.max(document.body.scrollHeight,document.body.offsetHeight);return u.apply(this,arguments)},width:function(){if(this[0]==window)return self.innerWidth||f.boxModel&&document.documentElement.clientWidth||document.body.clientWidth;if(this[0]==document)return Math.max(document.body.scrollWidth,document.body.offsetWidth);return r.apply(this,arguments)},innerHeight:function(){return this[0]==window||this[0]==document?this.height():this.is(':visible')?this[0].offsetHeight-d(this,'borderTopWidth')-d(this,'borderBottomWidth'):this.height()+d(this,'paddingTop')+d(this,'paddingBottom')},innerWidth:function(){return this[0]==window||this[0]==document?this.width():this.is(':visible')?this[0].offsetWidth-d(this,'borderLeftWidth')-d(this,'borderRightWidth'):this.width()+d(this,'paddingLeft')+d(this,'paddingRight')},outerHeight:function(){return this[0]==window||this[0]==document?this.height():this.is(':visible')?this[0].offsetHeight:this.height()+d(this,'borderTopWidth')+d(this,'borderBottomWidth')+d(this,'paddingTop')+d(this,'paddingBottom')},outerWidth:function(){return this[0]==window||this[0]==document?this.width():this.is(':visible')?this[0].offsetWidth:this.width()+d(this,'borderLeftWidth')+d(this,'borderRightWidth')+d(this,'paddingLeft')+d(this,'paddingRight')},scrollLeft:function(c){if(c!=undefined)return this.each(function(){if(this==window||this==document)window.scrollTo(c,f(window).scrollTop());else this.scrollLeft=c});if(this[0]==window||this[0]==document)return self.pageXOffset||f.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft;return this[0].scrollLeft},scrollTop:function(c){if(c!=undefined)return this.each(function(){if(this==window||this==document)window.scrollTo(f(window).scrollLeft(),c);else this.scrollTop=c});if(this[0]==window||this[0]==document)return self.pageYOffset||f.boxModel&&document.documentElement.scrollTop||document.body.scrollTop;return this[0].scrollTop},position:function(c,g){var e=this[0],h=e.parentNode,l=e.offsetParent,c=f.extend({margin:false,border:false,padding:false,scroll:false},c||{}),k=e.offsetLeft,b=e.offsetTop,a=e.scrollLeft,i=e.scrollTop;if(f.browser.mozilla||f.browser.msie){k+=d(e,'borderLeftWidth');b+=d(e,'borderTopWidth')}if(f.browser.mozilla){do{if(f.browser.mozilla&&h!=e&&f.css(h,'overflow')!='visible'){k+=d(h,'borderLeftWidth');b+=d(h,'borderTopWidth')}if(h==l)break}while((h=h.parentNode)&&(h.tagName.toLowerCase()!='body'||h.tagName.toLowerCase()!='html'))}var n=v(e,c,k,b,a,i);if(g){f.extend(g,n);return this}else{return n}},offset:function(c,g){var e=0,h=0,l=0,k=0,b=this[0],a=this[0],i,n,o=f.css(b,'position'),m=f.browser.mozilla,p=f.browser.msie,w=f.browser.safari,j=f.browser.opera,s=false,t=false,c=f.extend({margin:true,border:false,padding:false,scroll:true,lite:false},c||{});if(c.lite)return this.offsetLite(c,g);if(b.tagName.toLowerCase()=='body'){e=b.offsetLeft;h=b.offsetTop;if(m){e+=d(b,'marginLeft')+(d(b,'borderLeftWidth')*2);h+=d(b,'marginTop')+(d(b,'borderTopWidth')*2)}else if(j){e+=d(b,'marginLeft');h+=d(b,'marginTop')}else if(p&&jQuery.boxModel){e+=d(b,'borderLeftWidth');h+=d(b,'borderTopWidth')}}else{do{n=f.css(a,'position');e+=a.offsetLeft;h+=a.offsetTop;if(m||p){e+=d(a,'borderLeftWidth');h+=d(a,'borderTopWidth');if(m&&n=='absolute')s=true;if(p&&n=='relative')t=true}i=a.offsetParent;if(c.scroll||m){do{if(c.scroll){l+=a.scrollLeft;k+=a.scrollTop}if(m&&a!=b&&f.css(a,'overflow')!='visible'){e+=d(a,'borderLeftWidth');h+=d(a,'borderTopWidth')}a=a.parentNode}while(a!=i)}a=i;if(a.tagName.toLowerCase()=='body'||a.tagName.toLowerCase()=='html'){if((w||(p&&f.boxModel))&&o!='absolute'&&o!='fixed'){e+=d(a,'marginLeft');h+=d(a,'marginTop')}if((m&&!s&&o!='fixed')||(p&&o=='static'&&!t)){e+=d(a,'borderLeftWidth');h+=d(a,'borderTopWidth')}break}}while(a)}var q=v(b,c,e,h,l,k);if(g){f.extend(g,q);return this}else{return q}},offsetLite:function(c,g){var e=0,h=0,l=0,k=0,b=this[0],a,c=f.extend({margin:true,border:false,padding:false,scroll:true},c||{});do{e+=b.offsetLeft;h+=b.offsetTop;a=b.offsetParent;if(c.scroll){do{l+=b.scrollLeft;k+=b.scrollTop;b=b.parentNode}while(b!=a)}b=a}while(b&&b.tagName.toLowerCase()!='body'&&b.tagName.toLowerCase()!='html');var i=v(this[0],c,e,h,l,k);if(g){f.extend(g,i);return this}else{return i}}});var d=function(c,g){return parseInt(f.css(c.jquery?c[0]:c,g))||0};var v=function(c,g,e,h,l,k){if(!g.margin){e-=d(c,'marginLeft');h-=d(c,'marginTop')}if(g.border&&(f.browser.safari||f.browser.opera)){e+=d(c,'borderLeftWidth');h+=d(c,'borderTopWidth')}else if(!g.border&&!(f.browser.safari||f.browser.opera)){e-=d(c,'borderLeftWidth');h-=d(c,'borderTopWidth')}if(g.padding){e+=d(c,'paddingLeft');h+=d(c,'paddingTop')}if(g.scroll){l-=c.scrollLeft;k-=c.scrollTop}return g.scroll?{top:h-k,left:e-l,scrollTop:k,scrollLeft:l}:{top:h,left:e}}})(jQuery);(function(b){var a={},i,n,o,m=b.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),p=false;b.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){b.tooltip.blocked=!b.tooltip.blocked}};b.fn.extend({tooltip:function(c){c=b.extend({},b.tooltip.defaults,c);w(c);return this.each(function(){b.data(this,"tooltip",c);this.tOpacity=a.parent.css("opacity");this.tooltipText=this.title;b(this).removeAttr("title");this.alt=""}).mouseover(t).mouseout(r).click(r)},fixPNG:m?function(){return this.each(function(){var g=b(this).css('backgroundImage');if(g.match(/^url\(["']?(.*\.png)["']?\)$/i)){g=RegExp.$1;b(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+g+"')"}).each(function(){var c=b(this).css('position');if(c!='absolute'&&c!='relative')b(this).css('position','relative')})}})}:function(){return this},unfixPNG:m?function(){return this.each(function(){b(this).css({'filter':'',backgroundImage:''})})}:function(){return this},hideWhenEmpty:function(){return this.each(function(){b(this)[b(this).html()?"show":"hide"]()})},url:function(){return this.attr('href')||this.attr('src')}});function w(c){if(a.parent)return;a.parent=b('<div id="'+c.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if(b.fn.bgiframe)a.parent.bgiframe();a.title=b('h3',a.parent);a.body=b('div.body',a.parent);a.url=b('div.url',a.parent)}function j(c){return b.data(c,"tooltip")}function s(c){if(j(this).delay)o=setTimeout(q,j(this).delay);else q();p=!!j(this).track;b(document.body).bind('mousemove',f);f(c)}function t(){if(b.tooltip.blocked||this==i||(!this.tooltipText&&!j(this).bodyHandler))return;i=this;n=this.tooltipText;if(j(this).bodyHandler){a.title.hide();var c=j(this).bodyHandler.call(this);if(c.nodeType||c.jquery){a.body.empty().append(c)}else{a.body.html(c)}a.body.show()}else if(j(this).showBody){var g=n.split(j(this).showBody);a.title.html(g.shift()).show();a.body.empty();for(var e=0,h;(h=g[e]);e++){if(e>0)a.body.append("<br/>");a.body.append(h)}a.body.hideWhenEmpty()}else{a.title.html(n).show();a.body.hide()}if(j(this).showURL&&b(this).url())a.url.html(b(this).url().replace('http://','')).show();else a.url.hide();a.parent.addClass(j(this).extraClass);if(j(this).fixPNG)a.parent.fixPNG();s.apply(this,arguments)}function q(){o=null;if((!m||!b.fn.bgiframe)&&j(i).fade){if(a.parent.is(":animated"))a.parent.stop().show().fadeTo(j(i).fade,i.tOpacity);else a.parent.is(':visible')?a.parent.fadeTo(j(i).fade,i.tOpacity):a.parent.fadeIn(j(i).fade)}else{a.parent.show()}f()}function f(c){if(b.tooltip.blocked)return;if(c&&c.target.tagName=="OPTION"){return}if(!p&&a.parent.is(":visible")){b(document.body).unbind('mousemove',f)}if(i==null){b(document.body).unbind('mousemove',f);return}a.parent.removeClass("viewport-right").removeClass("viewport-bottom");var g=a.parent[0].offsetLeft;var e=a.parent[0].offsetTop;if(c){g=c.pageX+j(i).left;e=c.pageY+j(i).top;var h='auto';if(j(i).positionLeft){h=b(window).width()-g;g='auto'}a.parent.css({left:g,right:h,top:e})}var l=u(),k=a.parent[0];if(l.x+l.cx<k.offsetLeft+k.offsetWidth){g-=k.offsetWidth+20+j(i).left;a.parent.css({left:g+'px'}).addClass("viewport-right")}if(l.y+l.cy<k.offsetTop+k.offsetHeight){e-=k.offsetHeight+20+j(i).top;a.parent.css({top:e+'px'}).addClass("viewport-bottom")}}function u(){return{x:b(window).scrollLeft(),y:b(window).scrollTop(),cx:b(window).width(),cy:b(window).height()}}function r(c){if(b.tooltip.blocked)return;if(o)clearTimeout(o);i=null;var g=j(this);function e(){a.parent.removeClass(g.extraClass).hide().css("opacity","")}if((!m||!b.fn.bgiframe)&&g.fade){if(a.parent.is(':animated'))a.parent.stop().fadeTo(g.fade,0,e);else a.parent.stop().fadeOut(g.fade,e)}else e();if(j(this).fixPNG)a.parent.unfixPNG()}})(jQuery);
