/* 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($){ // store a copy of the core height and width methods var height = $.fn.height, width = $.fn.width; $.fn.extend({ /** * If used on document, returns the document's height (innerHeight) * If used on window, returns the viewport's (window) height * See core docs on height() to see what happens when used on an element. * * @example $("#testdiv").height() * @result 200 * * @example $(document).height() * @result 800 * * @example $(window).height() * @result 400 * * @name height * @type Object * @cat Plugins/Dimensions */ height: function() { if ( this[0] == window ) return self.innerHeight || $.boxModel && document.documentElement.clientHeight || document.body.clientHeight; if ( this[0] == document ) return Math.max( document.body.scrollHeight, document.body.offsetHeight ); return height.apply(this, arguments); }, /** * If used on document, returns the document's width (innerWidth) * If used on window, returns the viewport's (window) width * See core docs on height() to see what happens when used on an element. * * @example $("#testdiv").width() * @result 200 * * @example $(document).width() * @result 800 * * @example $(window).width() * @result 400 * * @name width * @type Object * @cat Plugins/Dimensions */ width: function() { if ( this[0] == window ) return self.innerWidth || $.boxModel && document.documentElement.clientWidth || document.body.clientWidth; if ( this[0] == document ) return Math.max( document.body.scrollWidth, document.body.offsetWidth ); return width.apply(this, arguments); }, /** * Returns the inner height value (without border) for the first matched element. * If used on document, returns the document's height (innerHeight) * If used on window, returns the viewport's (window) height * * @example $("#testdiv").innerHeight() * @result 800 * * @name innerHeight * @type Number * @cat Plugins/Dimensions */ innerHeight: function() { return this[0] == window || this[0] == document ? this.height() : this.is(':visible') ? this[0].offsetHeight - num(this, 'borderTopWidth') - num(this, 'borderBottomWidth') : this.height() + num(this, 'paddingTop') + num(this, 'paddingBottom'); }, /** * Returns the inner width value (without border) for the first matched element. * If used on document, returns the document's Width (innerWidth) * If used on window, returns the viewport's (window) width * * @example $("#testdiv").innerWidth() * @result 1000 * * @name innerWidth * @type Number * @cat Plugins/Dimensions */ innerWidth: function() { return this[0] == window || this[0] == document ? this.width() : this.is(':visible') ? this[0].offsetWidth - num(this, 'borderLeftWidth') - num(this, 'borderRightWidth') : this.width() + num(this, 'paddingLeft') + num(this, 'paddingRight'); }, /** * Returns the outer height value (including border) for the first matched element. * Cannot be used on document or window. * * @example $("#testdiv").outerHeight() * @result 1000 * * @name outerHeight * @type Number * @cat Plugins/Dimensions */ outerHeight: function() { return this[0] == window || this[0] == document ? this.height() : this.is(':visible') ? this[0].offsetHeight : this.height() + num(this,'borderTopWidth') + num(this, 'borderBottomWidth') + num(this, 'paddingTop') + num(this, 'paddingBottom'); }, /** * Returns the outer width value (including border) for the first matched element. * Cannot be used on document or window. * * @example $("#testdiv").outerHeight() * @result 1000 * * @name outerHeight * @type Number * @cat Plugins/Dimensions */ outerWidth: function() { return this[0] == window || this[0] == document ? this.width() : this.is(':visible') ? this[0].offsetWidth : this.width() + num(this, 'borderLeftWidth') + num(this, 'borderRightWidth') + num(this, 'paddingLeft') + num(this, 'paddingRight'); }, /** * Returns how many pixels the user has scrolled to the right (scrollLeft). * Works on containers with overflow: auto and window/document. * * @example $("#testdiv").scrollLeft() * @result 100 * * @name scrollLeft * @type Number * @cat Plugins/Dimensions */ /** * Sets the scrollLeft property and continues the chain. * Works on containers with overflow: auto and window/document. * * @example $("#testdiv").scrollLeft(10).scrollLeft() * @result 10 * * @name scrollLeft * @param Number value A positive number representing the desired scrollLeft. * @type jQuery * @cat Plugins/Dimensions */ scrollLeft: function(val) { if ( val != undefined ) // set the scroll left return this.each(function() { if (this == window || this == document) window.scrollTo( val, $(window).scrollTop() ); else this.scrollLeft = val; }); // return the scroll left offest in pixels if ( this[0] == window || this[0] == document ) return self.pageXOffset || $.boxModel && document.documentElement.scrollLeft || document.body.scrollLeft; return this[0].scrollLeft; }, /** * Returns how many pixels the user has scrolled to the bottom (scrollTop). * Works on containers with overflow: auto and window/document. * * @example $("#testdiv").scrollTop() * @result 100 * * @name scrollTop * @type Number * @cat Plugins/Dimensions */ /** * Sets the scrollTop property and continues the chain. * Works on containers with overflow: auto and window/document. * * @example $("#testdiv").scrollTop(10).scrollTop() * @result 10 * * @name scrollTop * @param Number value A positive number representing the desired scrollTop. * @type jQuery * @cat Plugins/Dimensions */ scrollTop: function(val) { if ( val != undefined ) // set the scroll top return this.each(function() { if (this == window || this == document) window.scrollTo( $(window).scrollLeft(), val ); else this.scrollTop = val; }); // return the scroll top offset in pixels if ( this[0] == window || this[0] == document ) return self.pageYOffset || $.boxModel && document.documentElement.scrollTop || document.body.scrollTop; return this[0].scrollTop; }, /** * Returns the top and left positioned offset in pixels. * The positioned offset is the offset between a positioned * parent and the element itself. * * @example $("#testdiv").position() * @result { top: 100, left: 100 } * * @name position * @param Map options Optional settings to configure the way the offset is calculated. * @option Boolean margin Should the margin of the element be included in the calculations? False by default. * @option Boolean border Should the border of the element be included in the calculations? False by default. * @option Boolean padding Should the padding of the element be included in the calculations? False by default. * @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the * chain will not be broken and the result will be assigned to this object. * @type Object * @cat Plugins/Dimensions */ position: function(options, returnObject) { var elem = this[0], parent = elem.parentNode, op = elem.offsetParent, options = $.extend({ margin: false, border: false, padding: false, scroll: false }, options || {}), x = elem.offsetLeft, y = elem.offsetTop, sl = elem.scrollLeft, st = elem.scrollTop; // Mozilla and IE do not add the border if ($.browser.mozilla || $.browser.msie) { // add borders to offset x += num(elem, 'borderLeftWidth'); y += num(elem, 'borderTopWidth'); } if ($.browser.mozilla) { do { // Mozilla does not add the border for a parent that has overflow set to anything but visible if ($.browser.mozilla && parent != elem && $.css(parent, 'overflow') != 'visible') { x += num(parent, 'borderLeftWidth'); y += num(parent, 'borderTopWidth'); } if (parent == op) break; // break if we are already at the offestParent } while ((parent = parent.parentNode) && (parent.tagName.toLowerCase() != 'body' || parent.tagName.toLowerCase() != 'html')); } var returnValue = handleOffsetReturn(elem, options, x, y, sl, st); if (returnObject) { $.extend(returnObject, returnValue); return this; } else { return returnValue; } }, /** * Returns the location of the element in pixels from the top left corner of the viewport. * * For accurate readings make sure to use pixel values for margins, borders and padding. * * Known issues: * - Issue: A div positioned relative or static without any content before it and its parent will report an offsetTop of 0 in Safari * Workaround: Place content before the relative div ... and set height and width to 0 and overflow to hidden * * @example $("#testdiv").offset() * @result { top: 100, left: 100, scrollTop: 10, scrollLeft: 10 } * * @example $("#testdiv").offset({ scroll: false }) * @result { top: 90, left: 90 } * * @example var offset = {} * $("#testdiv").offset({ scroll: false }, offset) * @result offset = { top: 90, left: 90 } * * @name offset * @param Map options Optional settings to configure the way the offset is calculated. * @option Boolean margin Should the margin of the element be included in the calculations? True by default. * @option Boolean border Should the border of the element be included in the calculations? False by default. * @option Boolean padding Should the padding of the element be included in the calculations? False by default. * @option Boolean scroll Should the scroll offsets of the parent elements be included in the calculations? True by default. * When true it adds the totla scroll offets of all parents to the total offset and also adds two properties * to the returned object, scrollTop and scrollLeft. * @options Boolean lite Will use offsetLite instead of offset when set to true. False by default. * @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the * chain will not be broken and the result will be assigned to this object. * @type Object * @cat Plugins/Dimensions */ offset: function(options, returnObject) { var x = 0, y = 0, sl = 0, st = 0, elem = this[0], parent = this[0], op, parPos, elemPos = $.css(elem, 'position'), mo = $.browser.mozilla, ie = $.browser.msie, sf = $.browser.safari, oa = $.browser.opera, absparent = false, relparent = false, options = $.extend({ margin: true, border: false, padding: false, scroll: true, lite: false }, options || {}); // Use offsetLite if lite option is true if (options.lite) return this.offsetLite(options, returnObject); if (elem.tagName.toLowerCase() == 'body') { // Safari is the only one to get offsetLeft and offsetTop properties of the body "correct" // Except they all mess up when the body is positioned absolute or relative x = elem.offsetLeft; y = elem.offsetTop; // Mozilla ignores margin and subtracts border from body element if (mo) { x += num(elem, 'marginLeft') + (num(elem, 'borderLeftWidth')*2); y += num(elem, 'marginTop') + (num(elem, 'borderTopWidth') *2); } else // Opera ignores margin if (oa) { x += num(elem, 'marginLeft'); y += num(elem, 'marginTop'); } else // IE does not add the border in Standards Mode if (ie && jQuery.boxModel) { x += num(elem, 'borderLeftWidth'); y += num(elem, 'borderTopWidth'); } } else { do { parPos = $.css(parent, 'position'); x += parent.offsetLeft; y += parent.offsetTop; // Mozilla and IE do not add the border if (mo || ie) { // add borders to offset x += num(parent, 'borderLeftWidth'); y += num(parent, 'borderTopWidth'); // Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent if (mo && parPos == 'absolute') absparent = true; // IE does not include the border on the body if an element is position static and without an absolute or relative parent if (ie && parPos == 'relative') relparent = true; } op = parent.offsetParent; if (options.scroll || mo) { do { if (options.scroll) { // get scroll offsets sl += parent.scrollLeft; st += parent.scrollTop; } // Mozilla does not add the border for a parent that has overflow set to anything but visible if (mo && parent != elem && $.css(parent, 'overflow') != 'visible') { x += num(parent, 'borderLeftWidth'); y += num(parent, 'borderTopWidth'); } parent = parent.parentNode; } while (parent != op); } parent = op; if (parent.tagName.toLowerCase() == 'body' || parent.tagName.toLowerCase() == 'html') { // Safari and IE Standards Mode doesn't add the body margin for elments positioned with static or relative if ((sf || (ie && $.boxModel)) && elemPos != 'absolute' && elemPos != 'fixed') { x += num(parent, 'marginLeft'); y += num(parent, 'marginTop'); } // Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent // IE does not include the border on the body if an element is positioned static and without an absolute or relative parent if ( (mo && !absparent && elemPos != 'fixed') || (ie && elemPos == 'static' && !relparent) ) { x += num(parent, 'borderLeftWidth'); y += num(parent, 'borderTopWidth'); } break; // Exit the loop } } while (parent); } var returnValue = handleOffsetReturn(elem, options, x, y, sl, st); if (returnObject) { $.extend(returnObject, returnValue); return this; } else { return returnValue; } }, /** * Returns the location of the element in pixels from the top left corner of the viewport. * This method is much faster than offset but not as accurate. This method can be invoked * by setting the lite option to true in the offset method. * * @name offsetLite * @param Map options Optional settings to configure the way the offset is calculated. * @option Boolean margin Should the margin of the element be included in the calculations? True by default. * @option Boolean border Should the border of the element be included in the calculations? False by default. * @option Boolean padding Should the padding of the element be included in the calculations? False by default. * @option Boolean scroll Should the scroll offsets of the parent elements be included in the calculations? True by default. * When true it adds the totla scroll offets of all parents to the total offset and also adds two properties * to the returned object, scrollTop and scrollLeft. * @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the * chain will not be broken and the result will be assigned to this object. * @type Object * @cat Plugins/Dimensions */ offsetLite: function(options, returnObject) { var x = 0, y = 0, sl = 0, st = 0, parent = this[0], op, options = $.extend({ margin: true, border: false, padding: false, scroll: true }, options || {}); do { x += parent.offsetLeft; y += parent.offsetTop; op = parent.offsetParent; if (options.scroll) { // get scroll offsets do { sl += parent.scrollLeft; st += parent.scrollTop; parent = parent.parentNode; } while(parent != op); } parent = op; } while (parent && parent.tagName.toLowerCase() != 'body' && parent.tagName.toLowerCase() != 'html'); var returnValue = handleOffsetReturn(this[0], options, x, y, sl, st); if (returnObject) { $.extend(returnObject, returnValue); return this; } else { return returnValue; } } }); /** * Handles converting a CSS Style into an Integer. * @private */ var num = function(el, prop) { return parseInt($.css(el.jquery?el[0]:el,prop))||0; }; /** * Handles the return value of the offset and offsetLite methods. * @private */ var handleOffsetReturn = function(elem, options, x, y, sl, st) { if ( !options.margin ) { x -= num(elem, 'marginLeft'); y -= num(elem, 'marginTop'); } // Safari and Opera do not add the border for the element if ( options.border && ($.browser.safari || $.browser.opera) ) { x += num(elem, 'borderLeftWidth'); y += num(elem, 'borderTopWidth'); } else if ( !options.border && !($.browser.safari || $.browser.opera) ) { x -= num(elem, 'borderLeftWidth'); y -= num(elem, 'borderTopWidth'); } if ( options.padding ) { x += num(elem, 'paddingLeft'); y += num(elem, 'paddingTop'); } // do not include scroll offset on the element if ( options.scroll ) { sl -= elem.scrollLeft; st -= elem.scrollTop; } return options.scroll ? { top: y - st, left: x - sl, scrollTop: st, scrollLeft: sl } : { top: y, left: x }; }; })(jQuery);/** * jQuery.ScrollTo - Easy element scrolling using jQuery. * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * Date: 2/19/2008 * @author Ariel Flesler * @version 1.3.3 */ ;(function($){var o=$.scrollTo=function(a,b,c){o.window().scrollTo(a,b,c)};o.defaults={axis:'y',duration:1};o.window=function(){return $($.browser.safari?'body':'html')};$.fn.scrollTo=function(l,m,n){if(typeof m=='object'){n=m;m=0}n=$.extend({},o.defaults,n);m=m||n.speed||n.duration;n.queue=n.queue&&n.axis.length>1;if(n.queue)m/=2;n.offset=j(n.offset);n.over=j(n.over);return this.each(function(){var a=this,b=$(a),t=l,c,d={},w=b.is('html,body');switch(typeof t){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(t)){t=j(t);break}t=$(t,this);case'object':if(t.is||t.style)c=(t=$(t)).offset()}$.each(n.axis.split(''),function(i,f){var P=f=='x'?'Left':'Top',p=P.toLowerCase(),k='scroll'+P,e=a[k],D=f=='x'?'Width':'Height';if(c){d[k]=c[p]+(w?0:e-b.offset()[p]);if(n.margin){d[k]-=parseInt(t.css('margin'+P))||0;d[k]-=parseInt(t.css('border'+P+'Width'))||0}d[k]+=n.offset[p]||0;if(n.over[p])d[k]+=t[D.toLowerCase()]()*n.over[p]}else d[k]=t[p];if(/^\d+$/.test(d[k]))d[k]=d[k]<=0?0:Math.min(d[k],h(D));if(!i&&n.queue){if(e!=d[k])g(n.onAfterFirst);delete d[k]}});g(n.onAfter);function g(a){b.animate(d,m,n.easing,a&&function(){a.call(this,l)})};function h(D){var b=w?$.browser.opera?document.body:document.documentElement:a;return b['scroll'+D]-b['client'+D]}})};function j(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);/** * jQuery.LocalScroll - Animated scrolling navigation, using anchors. * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com * Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php). * Date: 2/3/2008 * @author Ariel Flesler * @version 1.2.3 **/ ;(function($){var g=location.href.replace(/#.*/,''),a=$.localScroll=function(a){$('body').localScroll(a)};a.defaults={duration:1e3,axis:'y',event:'click',stop:true};a.hash=function(b){b=$.extend({},a.defaults,b);b.hash=false;if(location.hash)setTimeout(function(){scroll(0,location,b)},0)};$.fn.localScroll=function(b){b=$.extend({},a.defaults,b);return(b.persistent||b.lazy)?this.bind(b.event,function(e){var a=e.target;a=$([a,a.parentNode]).filter(filter)[0];a&&scroll(e,a,b)}):this.find('a').filter(filter).bind(b.event,function(e){scroll(e,this,b)}).end().end();function filter(){var c=this;return!!c.href&&!!c.hash&&c.href.replace(c.hash,'')==g&&(!b.filter||$(c).is(b.filter))}};function scroll(e,a,c){var d=a.hash.slice(1),b=document.getElementById(d)||document.getElementsByName(d)[0];if(b){e&&e.preventDefault();var f=$(c.target||$.scrollTo.window());if(c.lock&&f.is(':animated'))return;if(c.onBefore)c.onBefore.call(a,e,b,f);if(c.stop)f.queue('fx',[]).stop();f.scrollTo(b,c);if(c.hash)f.queue(function(){location=a.hash})}}})(jQuery);(function($) { $.ec = $.ec || {}; //Add the 'ec' scope $.extend($.ec, { save: function(el, set) { for(var i=0;i'); var wrapper = el.parent(); if (el.css('position') == 'static'){ wrapper.css({position: 'relative'}); el.css({position: 'relative'}); } else { var top = parseInt(el.css('top'), 10); if (top.constructor != Number) top = 'auto'; var left = parseInt(el.css('left'), 10); if (left.constructor != Number) left = 'auto'; wrapper.css({ position: el.css('position'), top: top, left: left, zIndex: el.css('z-index') }).show(); el.css({position: 'relative', top:0, left:0}); } wrapper.css(props); return wrapper; }, removeWrapper: function(el) { if (el.parent().attr('id') == 'fxWrapper') return el.parent().replaceWith(el); return el; }, setTransition: function(el, list, factor, val) { val = val || {}; $.each(list,function(i, x){ unit = el.cssUnit(x); if (unit[0] > 0) val[x] = unit[0] * factor + unit[1]; }); return val; }, animateClass: function(value, duration, easing, callback) { var cb = (typeof easing == "function" ? easing : (callback ? callback : null)); var ea = (typeof easing == "object" ? easing : null); this.each(function() { var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || ''; if(typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */ if(value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; } //Let's get a style offset var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle)); if(value.add) that.addClass(value.add); if(value.remove) that.removeClass(value.remove); var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle)); if(value.add) that.removeClass(value.add); if(value.remove) that.addClass(value.remove); // The main function to form the object for animation for(var n in newStyle) { if( typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */ && n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */ && newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */ && (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */ && (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */ ) offset[n] = newStyle[n]; } that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object // Change style attribute back to original. For stupid IE, we need to clear the damn object. if(typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr); if(value.add) $(this).addClass(value.add); if(value.remove) $(this).removeClass(value.remove); if(cb) cb.apply(this, arguments); }); }); } }); //Extend the methods of jQuery $.fn.extend({ //Save old methods _show: $.fn.show, _hide: $.fn.hide, _toggle: $.fn.toggle, _addClass: $.fn.addClass, _removeClass: $.fn.removeClass, _toggleClass: $.fn.toggleClass, // New ec methods effect: function(fx,o,speed,callback) { return $.ec[fx] ? $.ec[fx].call(this, {method: fx, options: o || {}, duration: speed, callback: callback }) : null; }, show: function() { if(!arguments[0] || (arguments[0].constructor == Number || /(slow|fast)/.test(arguments[0]))) return this._show.apply(this, arguments); else { var o = arguments[1] || {}; o['mode'] = 'show'; return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]); } }, hide: function() { if(!arguments[0] || (arguments[0].constructor == Number || /(slow|fast)/.test(arguments[0]))) return this._hide.apply(this, arguments); else { var o = arguments[1] || {}; o['mode'] = 'hide'; return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]); } }, toggle: function(){ if(!arguments[0] || (arguments[0].constructor == Number || /(slow|fast)/.test(arguments[0]))) return this._toggle.apply(this, arguments); else { var o = arguments[1] || {}; o['mode'] = 'toggle'; return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]); } }, addClass: function(classNames,speed,easing,callback) { return speed ? $.ec.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames); }, removeClass: function(classNames,speed,easing,callback) { return speed ? $.ec.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames); }, toggleClass: function(classNames,speed,easing,callback) { return speed ? $.ec.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames); }, morph: function(remove,add,speed,easing,callback) { return $.ec.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]); }, switchClass: function() { this.morph.apply(this, arguments); }, // helper functions cssUnit: function(key) { var style = this.css(key), val = []; $.each( ['em','px','%','pt'], function(i, unit){ if(style.indexOf(unit) > 0) val = [parseFloat(style), unit]; }); return val; } }); /* * jQuery Color Animations * Copyright 2007 John Resig * Released under the MIT and GPL licenses. */ // We override the animation for all of these color styles jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){ jQuery.fx.step[attr] = function(fx){ if ( fx.state == 0 ) { fx.start = getColor( fx.elem, attr ); fx.end = getRGB( fx.end ); } fx.elem.style[attr] = "rgb(" + [ Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) ].join(",") + ")"; } }); // Color Conversion functions from highlightFade // By Blair Mitchelmore // http://jquery.offput.ca/highlightFade/ // Parse strings looking for color tuples [255,255,255] function getRGB(color) { var result; // Check if we're already dealing with an array of colors if ( color && color.constructor == Array && color.length == 3 ) return color; // Look for rgb(num,num,num) if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])]; // Look for rgb(num%,num%,num%) if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; // Look for #a0b1c2 if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; // Look for #fff if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 if (result = /rgba\(0, 0, 0, 0\)/.exec(color)) return colors['transparent'] // Otherwise, we're most likely dealing with a named color return colors[jQuery.trim(color).toLowerCase()]; } function getColor(elem, attr) { var color; do { color = jQuery.curCSS(elem, attr); // Keep going until we find an element that has color, or we hit the body if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") ) break; attr = "backgroundColor"; } while ( elem = elem.parentNode ); return getRGB(color); }; // Some named colors to work with // From Interface by Stefan Petre // http://interface.eyecon.ro/ var colors = { aqua:[0,255,255], azure:[240,255,255], beige:[245,245,220], black:[0,0,0], blue:[0,0,255], brown:[165,42,42], cyan:[0,255,255], darkblue:[0,0,139], darkcyan:[0,139,139], darkgrey:[169,169,169], darkgreen:[0,100,0], darkkhaki:[189,183,107], darkmagenta:[139,0,139], darkolivegreen:[85,107,47], darkorange:[255,140,0], darkorchid:[153,50,204], darkred:[139,0,0], darksalmon:[233,150,122], darkviolet:[148,0,211], fuchsia:[255,0,255], gold:[255,215,0], green:[0,128,0], indigo:[75,0,130], khaki:[240,230,140], lightblue:[173,216,230], lightcyan:[224,255,255], lightgreen:[144,238,144], lightgrey:[211,211,211], lightpink:[255,182,193], lightyellow:[255,255,224], lime:[0,255,0], magenta:[255,0,255], maroon:[128,0,0], navy:[0,0,128], olive:[128,128,0], orange:[255,165,0], pink:[255,192,203], purple:[128,0,128], violet:[128,0,128], red:[255,0,0], silver:[192,192,192], white:[255,255,255], yellow:[255,255,0], transparent: [255,255,255] }; })(jQuery);(function($) { $.ec.slide = function(o) { return this.queue(function() { // Create element var el = $(this), props = ['position','top','left']; // Set options var mode = $.ec.setMode(el, o.options.mode || 'show'); // Set Mode var direction = o.options.direction || 'left'; // Default Direction // Adjust $.ec.save(el, props); el.show(); // Save & Show $.ec.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true})); if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift // Animation var animation = {}; animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; // Animate el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { if(mode == 'hide') el.hide(); // Hide $.ec.restore(el, props); $.ec.removeWrapper(el); // Restore if(o.callback) o.callback.apply(this, arguments); // Callback el.dequeue(); }}); }); }; })(jQuery);/** * -------------------------------------------------------------------- * jQuery-Plugin "pngFix" * Version: 1.1, 11.09.2007 * by Andreas Eberhard, andreas.eberhard@gmail.com * http://jquery.andreaseberhard.de/ * * Copyright (c) 2007 Andreas Eberhard * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php) * * Changelog: * 11.09.2007 Version 1.1 * - removed noConflict * - added png-support for input type=image * - 01.08.2007 CSS background-image support extension added by Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com * 31.05.2007 initial Version 1.0 * -------------------------------------------------------------------- * @example $(function(){$(document).pngFix();}); * @desc Fixes all PNG's in the document on document.ready * * jQuery(function(){jQuery(document).pngFix();}); * @desc Fixes all PNG's in the document on document.ready when using noConflict * * @example $(function(){$('div.examples').pngFix();}); * @desc Fixes all PNG's within div with class examples * * @example $(function(){$('div.examples').pngFix( { blankgif:'ext.gif' } );}); * @desc Fixes all PNG's within div with class examples, provides blank gif for input with png * -------------------------------------------------------------------- */ (function($) { jQuery.fn.pngFix = function(settings) { // Settings settings = jQuery.extend({ blankgif: 'blank.gif' }, settings); var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1); var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1); if (jQuery.browser.msie && (ie55 || ie6)) { //fix images with png-source jQuery(this).find("img[@src$=.png]").each(function() { jQuery(this).attr('width',jQuery(this).width()); jQuery(this).attr('height',jQuery(this).height()); var prevStyle = ''; var strNewHTML = ''; var imgId = (jQuery(this).attr('id')) ? 'id="' + jQuery(this).attr('id') + '" ' : ''; var imgClass = (jQuery(this).attr('class')) ? 'class="' + jQuery(this).attr('class') + '" ' : ''; var imgTitle = (jQuery(this).attr('title')) ? 'title="' + jQuery(this).attr('title') + '" ' : ''; var imgAlt = (jQuery(this).attr('alt')) ? 'alt="' + jQuery(this).attr('alt') + '" ' : ''; var imgAlign = (jQuery(this).attr('align')) ? 'float:' + jQuery(this).attr('align') + ';' : ''; var imgHand = (jQuery(this).parent().attr('href')) ? 'cursor:hand;' : ''; if (this.style.border) { prevStyle += 'border:'+this.style.border+';'; this.style.border = ''; } if (this.style.padding) { prevStyle += 'padding:'+this.style.padding+';'; this.style.padding = ''; } if (this.style.margin) { prevStyle += 'margin:'+this.style.margin+';'; this.style.margin = ''; } var imgStyle = (this.style.cssText); strNewHTML += ''; if (prevStyle != ''){ strNewHTML = '' + strNewHTML + ''; } jQuery(this).hide(); jQuery(this).after(strNewHTML); }); // fix css background pngs jQuery(this).find("*").each(function(){ var bgIMG = jQuery(this).css('background-image'); if(bgIMG.indexOf(".png")!=-1){ var iebg = bgIMG.split('url("')[1].split('")')[0]; jQuery(this).css('background-image', 'none'); jQuery(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "',sizingMethod='scale')"; } }); //fix input with png-source jQuery(this).find("input[@src$=.png]").each(function() { var bgIMG = jQuery(this).attr('src'); jQuery(this).get(0).runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + bgIMG + '\', sizingMethod=\'scale\');'; jQuery(this).attr('src', settings.blankgif) }); } return jQuery; }; })(jQuery); /* * Facebox (for jQuery) * version: 1.2 (05/05/2008) * @requires jQuery v1.2 or later * * Examples at http://famspam.com/facebox/ * * Licensed under the MIT: * http://www.opensource.org/licenses/mit-license.php * * Copyright 2007, 2008 Chris Wanstrath [ chris@ozmm.org ] * * Usage: * * jQuery(document).ready(function() { * jQuery('a[rel*=facebox]').facebox() * }) * * Terms * Loads the #terms div in the box * * Terms * Loads the terms.html page in the box * * Terms * Loads the terms.png image in the box * * * You can also use it programmatically: * * jQuery.facebox('some html') * * The above will open a facebox with "some html" as the content. * * jQuery.facebox(function($) { * $.get('blah.html', function(data) { $.facebox(data) }) * }) * * The above will show a loading screen before the passed function is called, * allowing for a better ajaxy experience. * * The facebox function can also display an ajax page or image: * * jQuery.facebox({ ajax: 'remote.html' }) * jQuery.facebox({ image: 'dude.jpg' }) * * Want to close the facebox? Trigger the 'close.facebox' document event: * * jQuery(document).trigger('close.facebox') * * Facebox also has a bunch of other hooks: * * loading.facebox * beforeReveal.facebox * reveal.facebox (aliased as 'afterReveal.facebox') * init.facebox * * Simply bind a function to any of these hooks: * * $(document).bind('reveal.facebox', function() { ...stuff to do after the facebox and contents are revealed... }) * */ (function($) { $.facebox = function(data, klass) { $.facebox.loading() if (data.ajax) fillFaceboxFromAjax(data.ajax) else if (data.image) fillFaceboxFromImage(data.image) else if (data.div) fillFaceboxFromHref(data.div) else if ($.isFunction(data)) data.call($) else $.facebox.reveal(data, klass) } /* * Public, $.facebox methods */ $.extend($.facebox, { settings: { opacity : 0, overlay : true, loadingImage : 'http://www.theappletree.com.au/~iagorg/images/facebox/loading.gif', closeImage : 'http://www.theappletree.com.au/~iagorg/images/facebox/closelabel.gif', imageTypes : [ 'png', 'jpg', 'jpeg', 'gif' ], faceboxHtml : '\ ' }, loading: function() { init() if ($('#facebox .loading').length == 1) return true showOverlay() $('#facebox .content').empty() $('#facebox .body').children().hide().end(). append('
') $('#facebox').css({ top: getPageScroll()[1] + (getPageHeight() / 10), left: 385.5 }).show() $(document).bind('keydown.facebox', function(e) { if (e.keyCode == 27) $.facebox.close() return true }) $(document).trigger('loading.facebox') }, reveal: function(data, klass) { $(document).trigger('beforeReveal.facebox') if (klass) $('#facebox .content').addClass(klass) $('#facebox .content').append(data) $('#facebox .loading').remove() $('#facebox .body').children().fadeIn('normal') $('#facebox').css('left', $(window).width() / 2 - ($('#facebox table').width() / 2)) $(document).trigger('reveal.facebox').trigger('afterReveal.facebox') }, close: function() { $(document).trigger('close.facebox') return false } }) /* * Public, $.fn methods */ $.fn.facebox = function(settings) { init(settings) function clickHandler() { $.facebox.loading(true) // support for rel="facebox.inline_popup" syntax, to add a class // also supports deprecated "facebox[.inline_popup]" syntax var klass = this.rel.match(/facebox\[?\.(\w+)\]?/) if (klass) klass = klass[1] fillFaceboxFromHref(this.href, klass) return false } return this.click(clickHandler) } /* * Private methods */ // called one time to setup facebox on this page function init(settings) { if ($.facebox.settings.inited) return true else $.facebox.settings.inited = true $(document).trigger('init.facebox') makeCompatible() var imageTypes = $.facebox.settings.imageTypes.join('|') $.facebox.settings.imageTypesRegexp = new RegExp('\.' + imageTypes + '$', 'i') if (settings) $.extend($.facebox.settings, settings) $('body').append($.facebox.settings.faceboxHtml) var preload = [ new Image(), new Image() ] preload[0].src = $.facebox.settings.closeImage preload[1].src = $.facebox.settings.loadingImage $('#facebox').find('.b:first, .bl, .br, .tl, .tr').each(function() { preload.push(new Image()) preload.slice(-1).src = $(this).css('background-image').replace(/url\((.+)\)/, '$1') }) $('#facebox .close').click($.facebox.close) $('#facebox .close_image').attr('src', $.facebox.settings.closeImage) } // getPageScroll() by quirksmode.com function getPageScroll() { var xScroll, yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; xScroll = self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict yScroll = document.documentElement.scrollTop; xScroll = document.documentElement.scrollLeft; } else if (document.body) {// all other Explorers yScroll = document.body.scrollTop; xScroll = document.body.scrollLeft; } return new Array(xScroll,yScroll) } // Adapted from getPageSize() by quirksmode.com function getPageHeight() { var windowHeight if (self.innerHeight) { // all except Explorer windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowHeight = document.body.clientHeight; } return windowHeight } // Backwards compatibility function makeCompatible() { var $s = $.facebox.settings $s.loadingImage = $s.loading_image || $s.loadingImage $s.closeImage = $s.close_image || $s.closeImage $s.imageTypes = $s.image_types || $s.imageTypes $s.faceboxHtml = $s.facebox_html || $s.faceboxHtml } // Figures out what you want to display and displays it // formats are: // div: #id // image: blah.extension // ajax: anything else function fillFaceboxFromHref(href, klass) { // div if (href.match(/#/)) { var url = window.location.href.split('#')[0] var target = href.replace(url,'') $.facebox.reveal($(target).clone().show(), klass) // image } else if (href.match($.facebox.settings.imageTypesRegexp)) { fillFaceboxFromImage(href, klass) // ajax } else { fillFaceboxFromAjax(href, klass) } } function fillFaceboxFromImage(href, klass) { var image = new Image() image.onload = function() { $.facebox.reveal('
', klass) } image.src = href } function fillFaceboxFromAjax(href, klass) { $.get(href, function(data) { $.facebox.reveal(data, klass) }) } function skipOverlay() { return $.facebox.settings.overlay == false || $.facebox.settings.opacity === null } function showOverlay() { if (skipOverlay()) return if ($('facebox_overlay').length == 0) $("body").append('
') $('#facebox_overlay').hide().addClass("facebox_overlayBG") .css('opacity', $.facebox.settings.opacity) .click(function() { $(document).trigger('close.facebox') }) .fadeIn(200) return false } function hideOverlay() { if (skipOverlay()) return $('#facebox_overlay').fadeOut(200, function(){ $("#facebox_overlay").removeClass("facebox_overlayBG") $("#facebox_overlay").addClass("facebox_hide") $("#facebox_overlay").remove() }) return false } /* * Bindings */ $(document).bind('close.facebox', function() { $(document).unbind('keydown.facebox') $('#facebox').fadeOut(function() { $('#facebox .content').removeClass().addClass('content') hideOverlay() $('#facebox .loading').remove() }) }) })(jQuery); $(document).ready(function() { // Controls the toggle of the search bar $("div#searchbar").addClass('ie-off'); $("button#sb-search").click(function(){ $("div#searchcontent").slideToggle("slow", function(){ $(this).toggleClass('IE-On'); if($("button#sb-search").hasClass('closeme')){ $("button#sb-search").removeClass('closeme'); } else { $("button#sb-search").addClass('closeme'); $("input#searchinput").focus(); } }); }); // Members login popup box, facebook style $('a[rel*=facebox]').facebox(); // Fixin' some PNG's $(document).pngFix(); jQuery(function( $ ){ $.localScroll(); }); });