
// usage: log('inside coolFunc', this, arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  arguments.callee = arguments.callee.caller;  
  if(this.console) console.log( Array.prototype.slice.call(arguments) );
};
// make it safe to use console.log always
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});


// place any jQuery/helper plugins in here, instead of separate, slower script files.


/*
    Pulled from: jquery.bookmarks.js
	click handler for SexyBookmarks
	Credit: Phong Thai Cao - http://www.JavaScriptBank.com
	Please keep this creadit when you use this code
*/
jQuery(document).ready(function() {

	// xhtml 1.0 strict way of using target _blank
	jQuery('.sexy-bookmarks a.external').attr("target", "_blank");

	// this block sets the auto vertical expand when there are more than 
	// one row of bookmarks.
	var sexyBaseHeight=jQuery('.sexy-bookmarks').height();
	var sexyFullHeight=jQuery('.sexy-bookmarks ul.socials').height();
	if (sexyFullHeight>sexyBaseHeight) {
		jQuery('.sexy-bookmarks-expand').hover(
			function() {
				jQuery(this).animate({
						height: sexyFullHeight+'px'
				}, {duration: 400, queue: false});
			},
			function() {
				jQuery(this).animate({
						height: sexyBaseHeight+'px'
				}, {duration: 400, queue: false});
			}
		);
	}
	// autocentering
	if (jQuery('.sexy-bookmarks-center') || jQuery('.sexy-bookmarks-spaced')) {
		var sexyFullWidth=jQuery('.sexy-bookmarks').width();
		var sexyBookmarkWidth=jQuery('.sexy-bookmarks:first ul.socials li').width();
		var sexyBookmarkCount=jQuery('.sexy-bookmarks:first ul.socials li').length;
		var numPerRow=Math.floor(sexyFullWidth/sexyBookmarkWidth);
		var sexyRowWidth=Math.min(numPerRow, sexyBookmarkCount)*sexyBookmarkWidth;
		
		if (jQuery('.sexy-bookmarks-spaced').length>0) {
			var sexyLeftMargin=Math.floor((sexyFullWidth-sexyRowWidth)/(Math.min(numPerRow, sexyBookmarkCount)+1));
			jQuery('.sexy-bookmarks ul.socials li').css('margin-left', sexyLeftMargin+'px');
		} else if (jQuery('.sexy-bookmarks-center'.length>0)) {
			var sexyLeftMargin=(sexyFullWidth-sexyRowWidth)/2;
			jQuery('.sexy-bookmarks-center').css('margin-left', sexyLeftMargin+'px');
		}
		
	}
	
	/*
		click handler for SexyBookmarks
		Credit: Cao Phong - http://www.JavaScriptBank.com
		Please keep this creadit when you use this code
	*/
	jQuery('.sexy-bookmarks a.external').click(function() {
		var url = encodeURIComponent(window.location.href), desc = '';
		if( jQuery('p.sexy-bookmarks-content').length ) {
			desc = encodeURIComponent(jQuery('p.sexy-bookmarks-content').text());
		}
		switch(this.parentNode.className) {
			case 'sexy-twittley':
				this.href += '?title=' + document.title + '&url=' + url + '&desc=' + desc + '&pcat=Internet&tags=';
				break;
			case 'sexy-digg':
				this.href += '?phase=2&title=' + document.title + '&url=' + url + '&desc=' + desc;
				break;
			case 'sexy-twitter':
				this.href += '?status=RT+@your_twitter_id:+' + document.title + '+-+' + url;
				break;
			case 'sexy-scriptstyle':
				this.href += '?title=' + document.title + '&url=' + url;
				break;
			case 'sexy-reddit':
				this.href += '?title=' + document.title + '&url=' + url;
				break;
			case 'sexy-delicious':
				this.href += '?title=' + document.title + '&url=' + url;
				break;
			case 'sexy-stumbleupon':
				this.href += '?title=' + document.title + '&url=' + url;
				break;
			case 'sexy-mixx':
				this.href += '?title=' + document.title + '&page_url=' + url + '&desc=' + desc;
				break;
			case 'sexy-technorati':
				this.href += '?add=' + url;
				break;
			case 'sexy-blinklist':
				this.href += '?Action=Blink/addblink.php&Title=' + document.title + '&Url=' + url;
				break;
			case 'sexy-diigo':
				this.href += '?title=' + document.title + '&url=' + url + '&desc=' + desc;
				break;
			case 'sexy-yahoobuzz':
				this.href += '?submitHeadline=' + document.title + '&submitUrl=' + url + '&submitSummary=' + desc + '&submitCategory=science&submitAssetType=text';
				break;
			case 'sexy-myspace':
				this.href += '?t=' + document.title + '&u=' + url;
				break;
			case 'sexy-facebook':
				this.href += '?t=' + document.title + '&u=' + url;
				break;
			case 'sexy-designfloat':
				this.href += '?title=' + document.title + '&url=' + url;
				break;
			case 'sexy-devmarks':
				this.href += '?posttitle=' + document.title + '&posturl=' + url + '&posttext=' + desc;
				break;
			case 'sexy-newsvine':
				this.href += '?h=' + document.title + '&u=' + url;
				break;
			case 'sexy-google':
				this.href += '?op=add&title=' + document.title + '&bkmk=' + url;
				break;
		}
	})
});


/**
* Pulled from: jquery.cookie.js
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/

/**
* Create a cookie with the given name and value and other optional parameters.
*
* @example $.cookie('the_cookie', 'the_value');
* @desc Set the value of a cookie.
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
* @desc Create a cookie with all available options.
* @example $.cookie('the_cookie', 'the_value');
* @desc Create a session cookie.
* @example $.cookie('the_cookie', null);
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
*       used when the cookie was set.
*
* @param String name The name of the cookie.
* @param String value The value of the cookie.
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
*                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
*                             If set to null or omitted, the cookie will be a session cookie and will not be retained
*                             when the the browser exits.
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
*                        require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/

/**
* Get the value of a cookie with the given name.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String name The name of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
jQuery.cookie = function (name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};


/*
* Pulled from: jquery.easing.js
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
* 
* Open source under the BSD License. 
* 
* Copyright © 2008 George McGinley Smith
* All rights reserved.
* 
* Redistribution and use in source and binary forms, with or without modification, 
* are permitted provided that the following conditions are met:
* 
* Redistributions of source code must retain the above copyright notice, this list of 
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list 
* of conditions and the following disclaimer in the documentation and/or other materials 
* provided with the distribution.
* 
* Neither the name of the author nor the names of contributors may be used to endorse 
* or promote products derived from this software without specific prior written permission.
* 
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
*  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
*  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
*  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
* OF THE POSSIBILITY OF SUCH DAMAGE. 
*
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend(jQuery.easing,
{
    def: 'easeOutQuad',
    swing: function (x, t, b, c, d) {
        //alert(jQuery.easing.default);
        return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
    },
    easeInQuad: function (x, t, b, c, d) {
        return c * (t /= d) * t + b;
    },
    easeOutQuad: function (x, t, b, c, d) {
        return -c * (t /= d) * (t - 2) + b;
    },
    easeInOutQuad: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t + b;
        return -c / 2 * ((--t) * (t - 2) - 1) + b;
    },
    easeInCubic: function (x, t, b, c, d) {
        return c * (t /= d) * t * t + b;
    },
    easeOutCubic: function (x, t, b, c, d) {
        return c * ((t = t / d - 1) * t * t + 1) + b;
    },
    easeInOutCubic: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
        return c / 2 * ((t -= 2) * t * t + 2) + b;
    },
    easeInQuart: function (x, t, b, c, d) {
        return c * (t /= d) * t * t * t + b;
    },
    easeOutQuart: function (x, t, b, c, d) {
        return -c * ((t = t / d - 1) * t * t * t - 1) + b;
    },
    easeInOutQuart: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;
        return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
    },
    easeInQuint: function (x, t, b, c, d) {
        return c * (t /= d) * t * t * t * t + b;
    },
    easeOutQuint: function (x, t, b, c, d) {
        return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
    },
    easeInOutQuint: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;
        return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
    },
    easeInSine: function (x, t, b, c, d) {
        return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;
    },
    easeOutSine: function (x, t, b, c, d) {
        return c * Math.sin(t / d * (Math.PI / 2)) + b;
    },
    easeInOutSine: function (x, t, b, c, d) {
        return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
    },
    easeInExpo: function (x, t, b, c, d) {
        return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
    },
    easeOutExpo: function (x, t, b, c, d) {
        return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
    },
    easeInOutExpo: function (x, t, b, c, d) {
        if (t == 0) return b;
        if (t == d) return b + c;
        if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
        return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
    },
    easeInCirc: function (x, t, b, c, d) {
        return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;
    },
    easeOutCirc: function (x, t, b, c, d) {
        return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;
    },
    easeInOutCirc: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
        return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;
    },
    easeInElastic: function (x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
    },
    easeOutElastic: function (x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
    },
    easeInOutElastic: function (x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (!p) p = d * (.3 * 1.5);
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
        return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
    },
    easeInBack: function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        return c * (t /= d) * t * ((s + 1) * t - s) + b;
    },
    easeOutBack: function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
    },
    easeInOutBack: function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
        return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
    },
    easeInBounce: function (x, t, b, c, d) {
        return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b;
    },
    easeOutBounce: function (x, t, b, c, d) {
        if ((t /= d) < (1 / 2.75)) {
            return c * (7.5625 * t * t) + b;
        } else if (t < (2 / 2.75)) {
            return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
        } else if (t < (2.5 / 2.75)) {
            return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
        } else {
            return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
        }
    },
    easeInOutBounce: function (x, t, b, c, d) {
        if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;
        return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b;
    }
});

/*
*
* TERMS OF USE - EASING EQUATIONS
* 
* Open source under the BSD License. 
* 
* Copyright © 2001 Robert Penner
* All rights reserved.
* 
* Redistribution and use in source and binary forms, with or without modification, 
* are permitted provided that the following conditions are met:
* 
* Redistributions of source code must retain the above copyright notice, this list of 
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list 
* of conditions and the following disclaimer in the documentation and/or other materials 
* provided with the distribution.
* 
* Neither the name of the author nor the names of contributors may be used to endorse 
* or promote products derived from this software without specific prior written permission.
* 
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
*  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
*  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
*  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
* OF THE POSSIBILITY OF SUCH DAMAGE. 
*
*/


/**
 * Pulled from: jquery.em.js
 * @projectDescription Monitor Font Size Changes with jQuery
 *
 * @version 1.0
 * @author Dave Cardwell
 *
 * jQuery-Em - $Revision: 24 $ ($Date: 2007-08-19 11:24:56 +0100 (Sun, 19 Aug 2007) $)
 * http://davecardwell.co.uk/javascript/jquery/plugins/jquery-em/
 *
 * Copyright ©2007 Dave Cardwell <http://davecardwell.co.uk/>
 *
 * Released under the MIT licence:
 * http://www.opensource.org/licenses/mit-license.php
 */

// Upon $(document).ready()…
jQuery(function($) {
    // Configuration…
    var eventName = 'emchange';
    
    
    // Set up default options.
    $.em = $.extend({
        /**
         * The jQuery-Em version string.
         *
         * @example $.em.version;
         * @desc '1.0a'
         *
         * @property
         * @name version
         * @type String
         * @cat Plugins/Em
         */
        version: '1.0',
        
        /**
         * The number of milliseconds to wait when polling for changes to the
         * font size.
         *
         * @example $.em.delay = 400;
         * @desc Defaults to 200.
         *
         * @property
         * @name delay
         * @type Number
         * @cat Plugins/Em
         */
        delay: 200,
        
        /**
         * The element used to detect changes to the font size.
         *
         * @example $.em.element = $('<div />')[0];
         * @desc Default is an empty, absolutely positioned, 100em-wide <div>.
         *
         * @private
         * @property
         * @name element
         * @type Element
         * @cat Plugins/Em
         */
        element: $('<div />').css({ left:     '-100em',
                                    position: 'absolute',
                                    width:    '100em' })
                             .prependTo('body')[0],
        
        /**
         * The action to perform when a change in the font size is detected.
         *
         * @example $.em.action = function() { ... }
         * @desc The default action is to trigger a global “emchange” event.
         * You probably shouldn’t change this behaviour as other plugins may
         * rely on it, but the option is here for completion.
         *
         * @example $(document).bind('emchange', function(e, cur, prev) {...})
         * @desc Any functions triggered on this event are passed the current
         * font size, and last known font size as additional parameters.
         *
         * @private
         * @property
         * @name action
         * @type Function
         * @cat Plugins/Em
         * @see current
         * @see previous
         */
        action: function() {
            var currentWidth = $.em.element.offsetWidth / 100;
            
            // If the font size has changed since we last checked…
            if ( currentWidth != $.em.current ) {
                /**
                 * The previous pixel value of the user agent’s font size. See
                 * $.em.current for caveats. Will initially be undefined until
                 * the “emchange” event is triggered.
                 *
                 * @example $.em.previous;
                 * @result 16
                 *
                 * @property
                 * @name previous
                 * @type Number
                 * @cat Plugins/Em
                 * @see current
                 */
                $.em.previous = $.em.current;
                
                /**
                 * The current pixel value of the user agent’s font size. As
                 * with $.em.previous, this value *may* be subject to minor
                 * browser rounding errors that mean you might not want to
                 * rely upon it as an absolute value.
                 *
                 * @example $.em.current;
                 * @result 14
                 *
                 * @property
                 * @name current
                 * @type Number
                 * @cat Plugins/Em
                 * @see previous
                 */
                $.em.current = currentWidth;
                
                $.event.trigger(eventName, [$.em.current, $.em.previous]);
            }
        }
    }, $.em );
    
    
    /**
     * Bind a function to the emchange event of each matched element.
     *
     * @example $("p").emchange( function() { alert("Hello"); } );
     *
     * @name emchange
     * @type jQuery
     * @param Function fn A function to bind to the emchange event.
     * @cat Plugins/Em
     */

    /**
     * Trigger the emchange event of each matched element.
     *
     * @example $("p").emchange()
     *
     * @name emchange
     * @type jQuery
     * @cat Plugins/Em
     */
    $.fn[eventName] = function(fn) { return fn ? this.bind(eventName, fn)
                                               : this.trigger(eventName); };
    
    
    // Store the initial pixel value of the user agent’s font size.
    $.em.current = $.em.element.offsetWidth / 100;
    
    /**
     * While polling for font-size changes, $.em.iid stores the intervalID in
     * case you should want to cancel with clearInterval().
     *
     * @example window.clearInterval( $.em.iid );
     * 
     * @property
     * @name iid
     * @type Number
     * @cat Plugins/Em
     */
    $.em.iid = setInterval( $.em.action, $.em.delay );
});


/**
* Pulled from: jquery.fontresizer.js
* jQuery fontscale - A plugin to alter the font size of DOM elements 
* Copyright (c) 2010 Ben Byrne - ben(at)fireflypartners(dot)com | http://www.fireflypartners.com
* Dual licensed under MIT and GPL.
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Date: 07/21/2010
* @author Ben Byrne
* @version 0.2
*
*/

/**
* For complete documentation, visit http://byrnecreative.com/blog/fontscale
* @example $("#fontgrow").fontscale("p","+");
* @desc Bind scaling up the font size of all P elements to the element #fontgrow with default settings.
* @example $("#fontshrink").fontscale("p","-",{unit:"percent",increment:25,useCookie:false,adjustLeading:true});
* @desc Bind scaling down the font size of all P elements to the element #fontshrink with custom settings.
* @example $("#reset").fontscale("p","reset");
* @desc Eliminate all fontscale resizing 
*/

(function ($) {
    $.fn.fontscale = function (selectors, adjustment, parameters) {

        var settings = $.extend($.fn.fontscale.defaults, parameters);

        //only use cookies if we can
        if (!$.isFunction($.cookie)) settings.useCookie = false;

        // if the cookie exists, we're supposed to use it, and we haven't before, then load it 
        if (!settings.cookieLoaded && $.cookie(settings.cookieName) && settings.useCookie) {
            cookieSettings = $.fn.fontscale.readcookie(settings.cookieName);
            //only actually apply the data from the cookie if its unit settings match!
            if (cookieSettings.unit == settings.unit && !settings.cookieLoaded) $.fn.fontscale.scale(selectors, cookieSettings.delta, settings, true);
        }

        this.each(function () {

            // bind to elements
            $(this).bind(settings.event, function () {
                $.fn.fontscale.scale(selectors, adjustment, settings, false);
                if ($.isFunction(settings.onAfter)) settings.onAfter(selectors, adjustment, settings); //is this okay?				
            });
        });

        return this;

    };

    $.fn.fontscale.reset = function (object, settings) {

        //remove any scaling done inline (assumed to be from this plugin)
        $(object).each(function (i) {
            $(this).css('font-size', '');
            if (settings.adjustLeading) $(this).css('line-height', '');
        });

        //if we're using a cookie, reset it too
        if (settings.useCookie) {
            $.fn.fontscale.savecookie("delete", settings);
        }
    }

    $.fn.fontscale.scale = function (object, adj, settings, fromcookie) {

        //make delta an int that changes nothing to start
        var delta = 0;

        if (adj == "+" || adj == "up") {
            //set the delta as an increase
            delta = settings.increment;
        } else if (adj == "-" || adj == "down") {
            //set the delta as a decrease
            delta = settings.increment * -1;
        } else if (adj == "reset") {
            //remove applied changes and do nothing else
            return $.fn.fontscale.reset(object, settings);
        } else if (fromcookie) {
            //get a pre-calibrated delta from the cookie if 
            delta = parseFloat(adj);
            settings.cookieLoaded = true;
        }

        //change the value into a percent if we have to
        if (settings.unit == "percent" && !fromcookie) {
            delta = 1 + (delta / 100);
        }

        $(object).each(function (i) {

            var currentSize = parseInt($(this).css("font-size"));
            var currentLeading = parseInt($(this).css("line-height"));

            if (settings.unit == "percent") {
                $(this).css("font-size", Math.round(currentSize * delta));
                if (settings.adjustLeading) $(this).css("line-height", Math.round(currentLeading * delta));
            } else {
                $(this).css("font-size", currentSize + delta);
                if (settings.adjustLeading) $(this).css("line-height", currentLeading + delta);
            }

        });

        if (settings.useCookie && !fromcookie) $.fn.fontscale.savecookie(delta, settings);

        return;

    };

    $.fn.fontscale.savecookie = function (delta, settings) {

        //delete the cookie if we're performing a reset, do nothing else
        if (delta == "delete") {
            $.cookie(settings.cookieName, null, settings.cookieParams);
            return true;
        }

        if ($.cookie(settings.cookieName)) {
            properties = $.fn.fontscale.readcookie(settings.cookieName);
        } else {
            properties = { "delta": 0 }
        }

        //if we have a cookie that matches, just change the delta
        if (settings.unit == properties.unit) {

            if (settings.unit == "percent") {
                properties.delta = (delta) ? properties.delta * delta : 1;
            } else {
                properties.delta = parseInt(properties.delta) + delta;
            }

            return $.cookie(settings.cookieName, "delta=" + properties.delta + "&unit=" + properties.unit, settings.cookieParams);

            //no cookie that matches, create a new     
        } else {
            $.cookie(settings.cookieName, "delta=" + delta + "&unit=" + settings.unit, settings.cookieParams);
            return true;
        }

    };

    $.fn.fontscale.readcookie = function (the_cookie) {

        val_string = $.cookie(the_cookie);

        var objResult = {};
        $.each(val_string.split("&"), function () {
            var prm = this.split("=");
            objResult[prm[0]] = prm[1];
        });
        return objResult;
    };

})(jQuery);

$.fn.fontscale.defaults = {
    useCookie: true,
    cookieName: 'fontscale',
    cookieParams: {
        expires: 30,
        path: "/"
    },
    increment: 2,
    unit: "px",
    adjustLeading: false,
    event: "click",
    cookieLoaded: false
};


/**
* Pulled from: jquery.imagepreload.js
* jQuery-Plugin "preloadCssImages"
* by Scott Jehl, scott@filamentgroup.com
* http://www.filamentgroup.com
* reference article: http://www.filamentgroup.com/lab/update_automatically_preload_images_from_css_with_jquery/
* demo page: http://www.filamentgroup.com/examples/preloadImages/index_v2.php
* 
* Copyright (c) 2008 Filament Group, Inc
* Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
*
* Version: 5.0, 10.31.2008
* Changelog:
* 	02.20.2008 initial Version 1.0
*    06.04.2008 Version 2.0 : removed need for any passed arguments. Images load from any and all directories.
*    06.21.2008 Version 3.0 : Added options for loading status. Fixed IE abs image path bug (thanks Sam Pohlenz).
*    07.24.2008 Version 4.0 : Added support for @imported CSS (credit: http://marcarea.com/). Fixed support in Opera as well. 
*    10.31.2008 Version: 5.0 : Many feature and performance enhancements from trixta
* --------------------------------------------------------------------
*/

; jQuery.preloadCssImages = function (settings) {
    settings = jQuery.extend({
        statusTextEl: null,
        statusBarEl: null,
        errorDelay: 999, // handles 404-Errors in IE
        simultaneousCacheLoading: 2
    }, settings);
    var allImgs = [],
		loaded = 0,
		imgUrls = [],
		thisSheetRules,
		errorTimer;

    function onImgComplete() {
        clearTimeout(errorTimer);
        if (imgUrls && imgUrls.length && imgUrls[loaded]) {
            loaded++;
            if (settings.statusTextEl) {
                var nowloading = (imgUrls[loaded]) ?
					'Now Loading: <span>' + imgUrls[loaded].split('/')[imgUrls[loaded].split('/').length - 1] :
					'Loading complete'; // wrong status-text bug fixed
                jQuery(settings.statusTextEl).html('<span class="numLoaded">' + loaded + '</span> of <span class="numTotal">' + imgUrls.length + '</span> loaded (<span class="percentLoaded">' + (loaded / imgUrls.length * 100).toFixed(0) + '%</span>) <span class="currentImg">' + nowloading + '</span></span>');
            }
            if (settings.statusBarEl) {
                var barWidth = jQuery(settings.statusBarEl).width();
                jQuery(settings.statusBarEl).css('background-position', -(barWidth - (barWidth * loaded / imgUrls.length).toFixed(0)) + 'px 50%');
            }
            loadImgs();
        }
    }

    function loadImgs() {
        //only load 1 image at the same time / most browsers can only handle 2 http requests, 1 should remain for user-interaction (Ajax, other images, normal page requests...)
        // otherwise set simultaneousCacheLoading to a higher number for simultaneous downloads
        if (imgUrls && imgUrls.length && imgUrls[loaded]) {
            var img = new Image(); //new img obj
            img.src = imgUrls[loaded]; //set src either absolute or rel to css dir
            if (!img.complete) {
                jQuery(img).bind('error load onreadystatechange', onImgComplete);
            } else {
                onImgComplete();
            }
            errorTimer = setTimeout(onImgComplete, settings.errorDelay); // handles 404-Errors in IE
        }
    }

    function parseCSS(sheets, urls) {
        var w3cImport = false,
			imported = [],
			importedSrc = [],
			baseURL;
        var sheetIndex = sheets.length;
        while (sheetIndex--) {//loop through each stylesheet

            var cssPile = ''; //create large string of all css rules in sheet

            if (urls && urls[sheetIndex]) {
                baseURL = urls[sheetIndex];
            } else {
                var csshref = (sheets[sheetIndex].href) ? sheets[sheetIndex].href : 'window.location.href';
                var baseURLarr = csshref.split('/'); //split href at / to make array
                baseURLarr.pop(); //remove file path from baseURL array
                baseURL = baseURLarr.join('/'); //create base url for the images in this sheet (css file's dir)
                if (baseURL) {
                    baseURL += '/'; //tack on a / if needed
                }
            }
            if (sheets[sheetIndex].cssRules || sheets[sheetIndex].rules) {
                thisSheetRules = (sheets[sheetIndex].cssRules) ? //->>> http://www.quirksmode.org/dom/w3c_css.html
					sheets[sheetIndex].cssRules : //w3
					sheets[sheetIndex].rules; //ie 
                var ruleIndex = thisSheetRules.length;
                while (ruleIndex--) {
                    if (thisSheetRules[ruleIndex].style && thisSheetRules[ruleIndex].style.cssText) {
                        var text = thisSheetRules[ruleIndex].style.cssText;
                        if (text.toLowerCase().indexOf('url') != -1) { // only add rules to the string if you can assume, to find an image, speed improvement
                            cssPile += text; // thisSheetRules[ruleIndex].style.cssText instead of thisSheetRules[ruleIndex].cssText is a huge speed improvement
                        }
                    } else if (thisSheetRules[ruleIndex].styleSheet) {
                        imported.push(thisSheetRules[ruleIndex].styleSheet);
                        w3cImport = true;
                    }

                }
            }
            //parse cssPile for image urls
            var tmpImage = cssPile.match(/[^\("]+\.(gif|jpg|jpeg|png)/g); //reg ex to get a string of between a "(" and a ".filename" / '"' for opera-bugfix
            if (tmpImage) {
                var i = tmpImage.length;
                while (i--) { // handle baseUrl here for multiple stylesheets in different folders bug
                    var imgSrc = (tmpImage[i].charAt(0) == '/' || tmpImage[i].match('://')) ? // protocol-bug fixed
						tmpImage[i] :
						baseURL + tmpImage[i];

                    if (jQuery.inArray(imgSrc, imgUrls) == -1) {
                        imgUrls.push(imgSrc);
                    }
                }
            }

            if (!w3cImport && sheets[sheetIndex].imports && sheets[sheetIndex].imports.length) {
                for (var iImport = 0, importLen = sheets[sheetIndex].imports.length; iImport < importLen; iImport++) {
                    var iHref = sheets[sheetIndex].imports[iImport].href;
                    iHref = iHref.split('/');
                    iHref.pop();
                    iHref = iHref.join('/');
                    if (iHref) {
                        iHref += '/'; //tack on a / if needed
                    }
                    var iSrc = (iHref.charAt(0) == '/' || iHref.match('://')) ? // protocol-bug fixed
						iHref :
						baseURL + iHref;

                    importedSrc.push(iSrc);
                    imported.push(sheets[sheetIndex].imports[iImport]);
                }


            }
        } //loop
        if (imported.length) {
            parseCSS(imported, importedSrc);
            return false;
        }
        var downloads = settings.simultaneousCacheLoading;
        while (downloads--) {
            setTimeout(loadImgs, downloads);
        }
    }
    parseCSS(document.styleSheets);
    return imgUrls;
};


/* Pulled From: jquery.imagetick.min.js */
/* JQuery Image Replacement for Radio Button and Select Boxes */

(function ($) {
    $.imageTick = { logging: false }; $.fn.imageTick = function (options, disable) {
        var defaults = { tick_image_path: "", no_tick_image_path: "", image_tick_class: "ticks_" + Math.floor(Math.random() * 999999), img_html: '<img src="%s1" alt="no_tick" class="%s2" id="tick_img_%s3" />', custom_button: false, custom_button_selected_class: 'selected' }; var opt = $.extend({}, defaults, options); opt._tick_img_id_format = 'tick_img_%s'; opt._valid_types = ['checkbox', 'radio']; function log() { $.imageTick.logging && console && console.log && console.log.apply(console, arguments); }
        if (options === 'disabled') {
            if (this.selector.indexOf('#') == -1) { log('COULD NOT DISABLE "' + this.selector + '": You need to specify the id of the <input> when calling disabled true/false.'); return; }
            var $img_id = $('#' + opt._tick_img_id_format.replace('%s', this[0].id)); if (disable) { $(this).attr('disabled', 'disabled'); method_type = 'add'; }
            else { $(this).removeAttr('disabled'); method_type = 'remove'; }
            $img_id[method_type + 'Class']('disabled'); return;
        }
        function imagePathsAreEqual(e) { var current_img_src = e.src.split('/').pop(); var no_tick_path = opt.no_tick_image_path.split('/').pop(); return current_img_src == no_tick_path; }
        function handleClickType(using_custom_button, type, $input_id) {
            if (using_custom_button) {
                if (type == 'radio') { $("." + opt.image_tick_class).removeClass(opt.custom_button_selected_class); }
                $(this).toggleClass(opt.custom_button_selected_class);
            }
            else {
                if (type == 'checkbox') { var img_src = (imagePathsAreEqual(this)) ? opt.tick_image_path : opt.no_tick_image_path; }
                else { $("." + opt.image_tick_class).attr('src', opt.no_tick_image_path); var img_src = opt.tick_image_path; }
                this.src = img_src;
            } 
        }
        return this.each(function () {
            var $obj = $(this); var type = $obj[0].type; if ($.inArray(type, opt._valid_types) == -1) { throw new Error(type + ' is not a valid input type. Must be radio or checkbox.'); }
            var id = $obj[0].id; var $input_id = $('#' + id); var $label = $("label[for='" + id + "']"); var img_id_format = opt._tick_img_id_format.replace('%s', id); var using_custom_btn = $.isFunction(opt.custom_button); var img_html = ''; if (using_custom_btn) { img_html = $(opt.custom_button($label)).attr('id', img_id_format.replace('%s', id)).addClass(opt.image_tick_class); }
            else { img_html = opt.img_html.replace('%s1', opt.no_tick_image_path).replace('%s2', opt.image_tick_class).replace('%s3', id); }
            $obj.before(img_html).hide(); var $img_id = $('#' + img_id_format); if ($input_id[0].disabled) { $img_id.addClass('disabled'); }
            if ($obj[0].checked) {
                if ($img_id[0].src) { $img_id[0].src = opt.tick_image_path; }
                else { $img_id.addClass(opt.custom_button_selected_class); } 
            }
            $img_id.click(function (e) {
                if ($input_id[0].disabled) { return; }
                $input_id.trigger("click"); handleClickType.call(this, using_custom_btn, type, $input_id);
            }); if ($label.length) { $label.click(function (e) { e.preventDefault(); $img_id.trigger('click'); }); } 
        });
    };
})(jQuery);


/* Pulled from Josh's jquery.inputvaluefocus.js 
 * Changes the value of an input box to 'empty' and then back
 */
;(function ($) {
    $.fn.extend({
        focusValue: function() {
            return this.each(function() {
                var _switch = function() {
                    if ($(this).val() == '' || $(this).val() == $(this).data('initial_value')) {
                        var val = $(this).val() == '' ? $(this).data('initial_value') : '';
						$(this).val(val);
                    }
                };
                $(this).data('initial_value', $(this).val());
				$(this).focus(_switch).blur(_switch);
            });
        }
    });
})(window.jQuery);


/**
* Pulled from: jquery.listen.min.js
* jQuery.Listen - Light and fast event handling, using event delegation.
* Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* Date: 3/7/2008
* http://flesler.blogspot.com/2007/10/jquerylisten.html
* @version 1.0.3
*/
; (function ($) { var a = 'indexer', h = $.event, j = h.special, k = $.listen = function (c, d, e, f) { if (typeof d != 'object') { f = e; e = d; d = document } o(c.split(/\s+/), function (a) { a = k.fixes[a] || a; var b = m(d, a) || m(d, a, new n(a, d)); b.append(e, f); b.start() }) }, m = function (b, c, d) { return $.data(b, c + '.' + a, d) }; $.fn[a] = function (a) { return this[0] && m(this[0], a) || null }; $[a] = function (a) { return m(document, a) }; $.extend(k, { regex: /^((?:\w*?|\*))(?:([#.])([\w-]+))?$/, fixes: { focus: 'focusin', blur: 'focusout' }, cache: function (a) { this.caching = a } }); $.each(k.fixes, function (a, b) { j[b] = { setup: function () { if ($.browser.msie) return !1; this.addEventListener(a, j[b].handler, !0) }, teardown: function () { if ($.browser.msie) return !1; this.removeEventListener(a, j[b].handler, !0) }, handler: function (e) { arguments[0] = e = h.fix(e); e.type = b; return h.handle.apply(this, arguments) } } }); $.fn.listen = function (a, b, c) { return this.each(function () { k(a, this, b, c) }) }; function n(a, b) { $.extend(this, { ids: {}, tags: {}, listener: b, event: a }); this.id = n.instances.push(this) }; n.instances = []; n.prototype = { constructor: n, handle: function (e) { var a = e.stopPropagation; e.stopPropagation = function () { e.stopped = 1; a.apply(this, arguments) }; m(this, e.type).parse(e); e.stopPropagation = a; a = e.data = null }, on: 0, bubbles: 0, start: function () { var a = this; if (!a.on) { h.add(a.listener, a.event, a.handle); a.on = 1 } }, stop: function () { var a = this; if (a.on) { h.remove(a.listener, a.event, a.handle); a.on = 0 } }, cache: function (a, b) { return $.data(a, 'listenCache_' + this.id, b) }, parse: function (e) { var z = this, c = e.data || e.target, d = arguments, f; if (!k.caching || !(f = z.cache(c))) { f = []; if (c.id && z.ids[c.id]) p(f, z.ids[c.id]); o([c.nodeName, '*'], function (a) { var b = z.tags[a]; if (b) o((c.className + ' *').split(' '), function (a) { if (a && b[a]) p(f, b[a]) }) }); if (k.caching) z.cache(c, f) } if (f[0]) { o(f, function (a) { if (a.apply(c, d) === !1) { e.preventDefault(); e.stopPropagation() } }) } if (!e.stopped && (c = c.parentNode) && (c.nodeName == 'A' || z.bubbles && c != z.listener)) { e.data = c; z.parse(e) } f = d = c = null }, append: function (f, g) { var z = this; o(f.split(/\s*,\s*/), function (a) { var b = k.regex.exec(a); if (!b) throw '$.listen > "' + a + '" is not a supported selector.'; var c = b[2] == '#' && b[3], d = b[1].toUpperCase() || '*', e = b[3] || '*'; if (c) (z.ids[c] || (z.ids[c] = [])).push(g); else if (d) { d = z.tags[d] = z.tags[d] || {}; (d[e] || (d[e] = [])).push(g) } }) } }; function o(a, b, c) { for (var i = 0, l = a.length; i < l; i++) b.call(c, a[i], i) }; function p(a, b) { a.push.apply(a, b); return a }; $(window).unload(function () { if (typeof n == 'function') o(n.instances, function (b) { b.stop(); $.removeData(b.listener, b.event + '.' + a); b.ids = b.names = b.listener = null }) }) })(jQuery);



/**
 * Pulled from: jquery.localscroll.min.js
 * jQuery.LocalScroll - Animated scrolling navigation, using anchors.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/11/2009
 * @author Ariel Flesler
 * @version 1.2.7
 **/

;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('<a> </a>').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);


/*! 
* Pulled from: jquery.mousewheel.js
* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.4
* 
* Requires: 1.2.2+
*/

(function ($) {

    var types = ['DOMMouseScroll', 'mousewheel'];

    $.event.special.mousewheel = {
        setup: function () {
            if (this.addEventListener) {
                for (var i = types.length; i; ) {
                    this.addEventListener(types[--i], handler, false);
                }
            } else {
                this.onmousewheel = handler;
            }
        },

        teardown: function () {
            if (this.removeEventListener) {
                for (var i = types.length; i; ) {
                    this.removeEventListener(types[--i], handler, false);
                }
            } else {
                this.onmousewheel = null;
            }
        }
    };

    $.fn.extend({
        mousewheel: function (fn) {
            return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
        },

        unmousewheel: function (fn) {
            return this.unbind("mousewheel", fn);
        }
    });


    function handler(event) {
        var orgEvent = event || window.event, args = [].slice.call(arguments, 1), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
        event = $.event.fix(orgEvent);
        event.type = "mousewheel";

        // Old school scrollwheel delta
        if (event.wheelDelta) { delta = event.wheelDelta / 120; }
        if (event.detail) { delta = -event.detail / 3; }

        // New school multidimensional scroll (touchpads) deltas
        deltaY = delta;

        // Gecko
        if (orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) {
            deltaY = 0;
            deltaX = -1 * delta;
        }

        // Webkit
        if (orgEvent.wheelDeltaY !== undefined) { deltaY = orgEvent.wheelDeltaY / 120; }
        if (orgEvent.wheelDeltaX !== undefined) { deltaX = -1 * orgEvent.wheelDeltaX / 120; }

        // Add event and delta to the front of the arguments
        args.unshift(event, delta, deltaX, deltaY);

        return $.event.handle.apply(this, args);
    }

})(jQuery);


/**
* Pulled from: jquery.mwheelintent.js
* @author trixta
* @version 1.2
*/
(function ($) {

    var mwheelI = {
        pos: [-260, -260]
    },
	minDif = 3,
	doc = document,
	root = doc.documentElement,
	body = doc.body,
	longDelay, shortDelay
;

    function unsetPos() {
        if (this === mwheelI.elem) {
            mwheelI.pos = [-260, -260];
            mwheelI.elem = false;
            minDif = 3;
        }
    }

    $.event.special.mwheelIntent = {
        setup: function () {
            var jElm = $(this).bind('mousewheel', $.event.special.mwheelIntent.handler);
            if (this !== doc && this !== root && this !== body) {
                jElm.bind('mouseleave', unsetPos);
            }
            jElm = null;
            return true;
        },
        teardown: function () {
            $(this)
			.unbind('mousewheel', $.event.special.mwheelIntent.handler)
			.unbind('mouseleave', unsetPos)
		;
            return true;
        },
        handler: function (e, d) {
            var pos = [e.clientX, e.clientY];
            if (this === mwheelI.elem || Math.abs(mwheelI.pos[0] - pos[0]) > minDif || Math.abs(mwheelI.pos[1] - pos[1]) > minDif) {
                mwheelI.elem = this;
                mwheelI.pos = pos;
                minDif = 250;

                clearTimeout(shortDelay);
                shortDelay = setTimeout(function () {
                    minDif = 10;
                }, 200);
                clearTimeout(longDelay);
                longDelay = setTimeout(function () {
                    minDif = 3;
                }, 1500);
                e = $.extend({}, e, { type: 'mwheelIntent' });
                return $.event.handle.apply(this, arguments);
            }
        }
    };
    $.fn.extend({
        mwheelIntent: function (fn) {
            return fn ? this.bind("mwheelIntent", fn) : this.trigger("mwheelIntent");
        },

        unmwheelIntent: function (fn) {
            return this.unbind("mwheelIntent", fn);
        }
    });

    $(function () {
        body = doc.body;
        //assume that document is always scrollable, doesn't hurt if not
        $(doc).bind('mwheelIntent.mwheelIntentDefault', $.noop);
    });
})(jQuery);


/*
 * Pulled from: jquery.nivoslider.js
 * jQuery Nivo Slider v2.3
 * http://nivo.dev7studios.com
 *
 * Copyright 2010, Gilbert Pellegrom
 * Free to use and abuse under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * May 2010 - Pick random effect from specified set of effects by toronegro
 * May 2010 - controlNavThumbsFromRel option added by nerd-sh
 * May 2010 - Do not start nivoRun timer if there is only 1 slide by msielski
 * April 2010 - controlNavThumbs option added by Jamie Thompson (http://jamiethompson.co.uk)
 * March 2010 - manualAdvance option added by HelloPablo (http://hellopablo.co.uk)
 */

(function($) {

    var NivoSlider = function(element, options){
		//Defaults are below
		var settings = $.extend({}, $.fn.nivoSlider.defaults, options);

        //Useful variables. Play carefully.
        var vars = {
            currentSlide: 0,
            currentImage: '',
            totalSlides: 0,
            randAnim: '',
            running: false,
            paused: false,
            stop:false
        };
    
        //Get this slider
        var slider = $(element);
        slider.data('nivo:vars', vars);
        slider.css('position','relative');
        slider.addClass('nivoSlider');
        
        //Find our slider children
        var kids = slider.children();
        kids.each(function() {
            var child = $(this);
            var link = '';
            if(!child.is('img')){
                if(child.is('a')){
                    child.addClass('nivo-imageLink');
                    link = child;
                }
                child = child.find('img:first');
            }
            //Get img width & height
            var childWidth = child.width();
            if(childWidth == 0) childWidth = child.attr('width');
            var childHeight = child.height();
            if(childHeight == 0) childHeight = child.attr('height');
            //Resize the slider
            if(childWidth > slider.width()){
                slider.width(childWidth);
            }
            if(childHeight > slider.height()){
                slider.height(childHeight);
            }
            if(link != ''){
                link.css('display','none');
            }
            child.css('display','none');
            vars.totalSlides++;
        });
        
        //Set startSlide
        if(settings.startSlide > 0){
            if(settings.startSlide >= vars.totalSlides) settings.startSlide = vars.totalSlides - 1;
            vars.currentSlide = settings.startSlide;
        }
        
        //Get initial image
        if($(kids[vars.currentSlide]).is('img')){
            vars.currentImage = $(kids[vars.currentSlide]);
        } else {
            vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
        }
        
        //Show initial link
        if($(kids[vars.currentSlide]).is('a')){
            $(kids[vars.currentSlide]).css('display','block');
        }
        
        //Set first background
        slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
        
        //Add initial slices
        for(var i = 0; i < settings.slices; i++){
            var sliceWidth = Math.round(slider.width()/settings.slices);
            if(i == settings.slices-1){
                slider.append(
                    $('<div class="nivo-slice"></div>').css({ left:(sliceWidth*i)+'px', width:(slider.width()-(sliceWidth*i))+'px' })
                );
            } else {
                slider.append(
                    $('<div class="nivo-slice"></div>').css({ left:(sliceWidth*i)+'px', width:sliceWidth+'px' })
                );
            }
        }
        
        //Create caption
        slider.append(
            $('<div class="nivo-caption"><p></p></div>').css({ display:'none', opacity:settings.captionOpacity })
        );			
        //Process initial  caption
        if(vars.currentImage.attr('title') != ''){
            var title = vars.currentImage.attr('title');
            if(title.substr(0,1) == '#') title = $(title).html();
            $('.nivo-caption p', slider).html(title);					
            $('.nivo-caption', slider).fadeIn(settings.animSpeed);
        }
        
        //In the words of Super Mario "let's a go!"
        var timer = 0;
        if(!settings.manualAdvance && kids.length > 1){
            timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
        }

        //Add Direction nav
        if(settings.directionNav){
            slider.append('<div class="nivo-directionNav"><a class="nivo-prevNav">Prev</a><a class="nivo-nextNav">Next</a></div>');
            
            //Hide Direction nav
            if(settings.directionNavHide){
                $('.nivo-directionNav', slider).hide();
                slider.hover(function(){
                    $('.nivo-directionNav', slider).show();
                }, function(){
                    $('.nivo-directionNav', slider).hide();
                });
            }
            
            $('a.nivo-prevNav', slider).live('click', function(){
                if(vars.running) return false;
                clearInterval(timer);
                timer = '';
                vars.currentSlide-=2;
                nivoRun(slider, kids, settings, 'prev');
            });
            
            $('a.nivo-nextNav', slider).live('click', function(){
                if(vars.running) return false;
                clearInterval(timer);
                timer = '';
                nivoRun(slider, kids, settings, 'next');
            });
        }
        
        //Add Control nav
        if(settings.controlNav){
            var nivoControl = $('<div class="nivo-controlNav"></div>');
            slider.append(nivoControl);
            for(var i = 0; i < kids.length; i++){
                if(settings.controlNavThumbs){
                    var child = kids.eq(i);
                    if(!child.is('img')){
                        child = child.find('img:first');
                    }
                    if (settings.controlNavThumbsFromRel) {
                        nivoControl.append('<a class="nivo-control" rel="'+ i +'"><img src="'+ child.attr('rel') + '" alt="" /></a>');
                    } else {
                        nivoControl.append('<a class="nivo-control" rel="'+ i +'"><img src="'+ child.attr('src').replace(settings.controlNavThumbsSearch, settings.controlNavThumbsReplace) +'" alt="" /></a>');
                    }
                } else {
                    nivoControl.append('<a class="nivo-control" rel="'+ i +'">'+ (i + 1) +'</a>');
                }
                
            }
            //Set initial active link
            $('.nivo-controlNav a:eq('+ vars.currentSlide +')', slider).addClass('active');
            
            $('.nivo-controlNav a', slider).live('click', function(){
                if(vars.running) return false;
                if($(this).hasClass('active')) return false;
                clearInterval(timer);
                timer = '';
                slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
                vars.currentSlide = $(this).attr('rel') - 1;
                nivoRun(slider, kids, settings, 'control');
            });
        }
        
        //Keyboard Navigation
        if(settings.keyboardNav){
            $(window).keypress(function(event){
                //Left
                if(event.keyCode == '37'){
                    if(vars.running) return false;
                    clearInterval(timer);
                    timer = '';
                    vars.currentSlide-=2;
                    nivoRun(slider, kids, settings, 'prev');
                }
                //Right
                if(event.keyCode == '39'){
                    if(vars.running) return false;
                    clearInterval(timer);
                    timer = '';
                    nivoRun(slider, kids, settings, 'next');
                }
            });
        }
        
        //For pauseOnHover setting
        if(settings.pauseOnHover){
            slider.hover(function(){
                vars.paused = true;
                clearInterval(timer);
                timer = '';
            }, function(){
                vars.paused = false;
                //Restart the timer
                if(timer == '' && !settings.manualAdvance){
                    timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
                }
            });
        }
        
        //Event when Animation finishes
        slider.bind('nivo:animFinished', function(){ 
            vars.running = false; 
            //Hide child links
            $(kids).each(function(){
                if($(this).is('a')){
                    $(this).css('display','none');
                }
            });
            //Show current link
            if($(kids[vars.currentSlide]).is('a')){
                $(kids[vars.currentSlide]).css('display','block');
            }
            //Restart the timer
            if(timer == '' && !vars.paused && !settings.manualAdvance){
                timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
            }
            //Trigger the afterChange callback
            settings.afterChange.call(this);
        });

        // Private run method
		var nivoRun = function(slider, kids, settings, nudge){
			//Get our vars
			var vars = slider.data('nivo:vars');
            
            //Trigger the lastSlide callback
            if(vars && (vars.currentSlide == vars.totalSlides - 1)){ 
				settings.lastSlide.call(this);
			}
            
            // Stop
			if((!vars || vars.stop) && !nudge) return false;
			
			//Trigger the beforeChange callback
			settings.beforeChange.call(this);
					
			//Set current background before change
			if(!nudge){
				slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
			} else {
				if(nudge == 'prev'){
					slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
				}
				if(nudge == 'next'){
					slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
				}
			}
			vars.currentSlide++;
            //Trigger the slideshowEnd callback
			if(vars.currentSlide == vars.totalSlides){ 
				vars.currentSlide = 0;
				settings.slideshowEnd.call(this);
			}
			if(vars.currentSlide < 0) vars.currentSlide = (vars.totalSlides - 1);
			//Set vars.currentImage
			if($(kids[vars.currentSlide]).is('img')){
				vars.currentImage = $(kids[vars.currentSlide]);
			} else {
				vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
			}
			
			//Set acitve links
			if(settings.controlNav){
				$('.nivo-controlNav a', slider).removeClass('active');
				$('.nivo-controlNav a:eq('+ vars.currentSlide +')', slider).addClass('active');
			}
			
			//Process caption
			if(vars.currentImage.attr('title') != ''){
                var title = vars.currentImage.attr('title');
                if(title.substr(0,1) == '#') title = $(title).html();	
                    
				if($('.nivo-caption', slider).css('display') == 'block'){
					$('.nivo-caption p', slider).fadeOut(settings.animSpeed, function(){
						$(this).html(title);
						$(this).fadeIn(settings.animSpeed);
					});
				} else {
					$('.nivo-caption p', slider).html(title);
				}					
				$('.nivo-caption', slider).fadeIn(settings.animSpeed);
			} else {
				$('.nivo-caption', slider).fadeOut(settings.animSpeed);
			}
			
			//Set new slice backgrounds
			var  i = 0;
			$('.nivo-slice', slider).each(function(){
				var sliceWidth = Math.round(slider.width()/settings.slices);
				$(this).css({ height:'0px', opacity:'0', 
					background: 'url("'+ vars.currentImage.attr('src') +'") no-repeat -'+ ((sliceWidth + (i * sliceWidth)) - sliceWidth) +'px 0%' });
				i++;
			});
			
			if(settings.effect == 'random'){
				var anims = new Array("sliceDownRight","sliceDownLeft","sliceUpRight","sliceUpLeft","sliceUpDown","sliceUpDownLeft","fold","fade");
				vars.randAnim = anims[Math.floor(Math.random()*(anims.length + 1))];
				if(vars.randAnim == undefined) vars.randAnim = 'fade';
			}
            
            //Run random effect from specified set (eg: effect:'fold,fade')
            if(settings.effect.indexOf(',') != -1){
                var anims = settings.effect.split(',');
                vars.randAnim = $.trim(anims[Math.floor(Math.random()*anims.length)]);
            }
		
			//Run effects
			vars.running = true;
			if(settings.effect == 'sliceDown' || settings.effect == 'sliceDownRight' || vars.randAnim == 'sliceDownRight' ||
				settings.effect == 'sliceDownLeft' || vars.randAnim == 'sliceDownLeft'){
				var timeBuff = 0;
				var i = 0;
				var slices = $('.nivo-slice', slider);
				if(settings.effect == 'sliceDownLeft' || vars.randAnim == 'sliceDownLeft') slices = $('.nivo-slice', slider)._reverse();
				slices.each(function(){
					var slice = $(this);
					slice.css('top','0px');
					if(i == settings.slices-1){
						setTimeout(function(){
							slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
						}, (100 + timeBuff));
					} else {
						setTimeout(function(){
							slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed);
						}, (100 + timeBuff));
					}
					timeBuff += 50;
					i++;
				});
			} 
			else if(settings.effect == 'sliceUp' || settings.effect == 'sliceUpRight' || vars.randAnim == 'sliceUpRight' ||
					settings.effect == 'sliceUpLeft' || vars.randAnim == 'sliceUpLeft'){
				var timeBuff = 0;
				var i = 0;
				var slices = $('.nivo-slice', slider);
				if(settings.effect == 'sliceUpLeft' || vars.randAnim == 'sliceUpLeft') slices = $('.nivo-slice', slider)._reverse();
				slices.each(function(){
					var slice = $(this);
					slice.css('bottom','0px');
					if(i == settings.slices-1){
						setTimeout(function(){
							slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
						}, (100 + timeBuff));
					} else {
						setTimeout(function(){
							slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed);
						}, (100 + timeBuff));
					}
					timeBuff += 50;
					i++;
				});
			} 
			else if(settings.effect == 'sliceUpDown' || settings.effect == 'sliceUpDownRight' || vars.randAnim == 'sliceUpDown' || 
					settings.effect == 'sliceUpDownLeft' || vars.randAnim == 'sliceUpDownLeft'){
				var timeBuff = 0;
				var i = 0;
				var v = 0;
				var slices = $('.nivo-slice', slider);
				if(settings.effect == 'sliceUpDownLeft' || vars.randAnim == 'sliceUpDownLeft') slices = $('.nivo-slice', slider)._reverse();
				slices.each(function(){
					var slice = $(this);
					if(i == 0){
						slice.css('top','0px');
						i++;
					} else {
						slice.css('bottom','0px');
						i = 0;
					}
					
					if(v == settings.slices-1){
						setTimeout(function(){
							slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
						}, (100 + timeBuff));
					} else {
						setTimeout(function(){
							slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed);
						}, (100 + timeBuff));
					}
					timeBuff += 50;
					v++;
				});
			} 
			else if(settings.effect == 'fold' || vars.randAnim == 'fold'){
				var timeBuff = 0;
				var i = 0;
				$('.nivo-slice', slider).each(function(){
					var slice = $(this);
					var origWidth = slice.width();
					slice.css({ top:'0px', height:'100%', width:'0px' });
					if(i == settings.slices-1){
						setTimeout(function(){
							slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
						}, (100 + timeBuff));
					} else {
						setTimeout(function(){
							slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed);
						}, (100 + timeBuff));
					}
					timeBuff += 50;
					i++;
				});
			}  
			else if(settings.effect == 'fade' || vars.randAnim == 'fade'){
				var i = 0;
				$('.nivo-slice', slider).each(function(){
					$(this).css('height','100%');
					if(i == settings.slices-1){
						$(this).animate({ opacity:'1.0' }, (settings.animSpeed*2), '', function(){ slider.trigger('nivo:animFinished'); });
					} else {
						$(this).animate({ opacity:'1.0' }, (settings.animSpeed*2));
					}
					i++;
				});
			}
		}
        
        // For debugging
        var trace = function(msg){
            if (this.console && typeof console.log != "undefined")
                console.log(msg);
        }
        
        // Start / Stop
        this.stop = function(){
            if(!$(element).data('nivo:vars').stop){
                $(element).data('nivo:vars').stop = true;
                trace('Stop Slider');
            }
        }
        
        this.start = function(){
            if($(element).data('nivo:vars').stop){
                $(element).data('nivo:vars').stop = false;
                trace('Start Slider');
            }
        }
        
        //Trigger the afterLoad callback
        settings.afterLoad.call(this);
    };
        
    $.fn.nivoSlider = function(options) {
    
        return this.each(function(){
            var element = $(this);
            // Return early if this element already has a plugin instance
            if (element.data('nivoslider')) return;
            // Pass options to plugin constructor
            var nivoslider = new NivoSlider(this, options);
            // Store plugin object in this element's data
            element.data('nivoslider', nivoslider);
        });

	};
	
	//Default settings
	$.fn.nivoSlider.defaults = {
		effect:'random',
		slices:15,
		animSpeed:500,
		pauseTime:3000,
		startSlide:0,
		directionNav:true,
		directionNavHide:true,
		controlNav:true,
		controlNavThumbs:false,
        controlNavThumbsFromRel:false,
		controlNavThumbsSearch:'.jpg',
		controlNavThumbsReplace:'_thumb.jpg',
		keyboardNav:true,
		pauseOnHover:true,
		manualAdvance:false,
		captionOpacity:0.8,
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){},
        lastSlide: function(){},
        afterLoad: function(){}
	};
	
	$.fn._reverse = [].reverse;
	
})(jQuery);


/*
* Pulled from jquery.query.js
*/
/**
 * jQuery.query - Query String Modification and Creation for jQuery
 * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
 * Date: 2009/8/13
 *
 * @author Blair Mitchelmore
 * @version 2.1.7
 *
 **/

new function(settings) { 
  // Various Settings
  var $separator = settings.separator || '&';
  var $spaces = settings.spaces === false ? false : true;
  var $suffix = settings.suffix === false ? '' : '[]';
  var $prefix = settings.prefix === false ? false : true;
  var $hash = $prefix ? settings.hash === true ? "#" : "?" : "";
  var $numbers = settings.numbers === false ? false : true;
  
  jQuery.query = new function() {
    var is = function(o, t) {
      return o != undefined && o !== null && (!!t ? o.constructor == t : true);
    };
    var parse = function(path) {
      var m, rx = /\[([^[]*)\]/g, match = /^([^[]+)(\[.*\])?$/.exec(path), base = match[1], tokens = [];
      while (m = rx.exec(match[2])) tokens.push(m[1]);
      return [base, tokens];
    };
    var set = function(target, tokens, value) {
      var o, token = tokens.shift();
      if (typeof target != 'object') target = null;
      if (token === "") {
        if (!target) target = [];
        if (is(target, Array)) {
          target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));
        } else if (is(target, Object)) {
          var i = 0;
          while (target[i++] != null);
          target[--i] = tokens.length == 0 ? value : set(target[i], tokens.slice(0), value);
        } else {
          target = [];
          target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));
        }
      } else if (token && token.match(/^\s*[0-9]+\s*$/)) {
        var index = parseInt(token, 10);
        if (!target) target = [];
        target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);
      } else if (token) {
        var index = token.replace(/^\s*|\s*$/g, "");
        if (!target) target = {};
        if (is(target, Array)) {
          var temp = {};
          for (var i = 0; i < target.length; ++i) {
            temp[i] = target[i];
          }
          target = temp;
        }
        target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);
      } else {
        return value;
      }
      return target;
    };
    
    var queryObject = function(a) {
      var self = this;
      self.keys = {};
      
      if (a.queryObject) {
        jQuery.each(a.get(), function(key, val) {
          self.SET(key, val);
        });
      } else {
        jQuery.each(arguments, function() {
          var q = "" + this;
          q = q.replace(/^[?#]/,''); // remove any leading ? || #
          q = q.replace(/[;&]$/,''); // remove any trailing & || ;
          if ($spaces) q = q.replace(/[+]/g,' '); // replace +'s with spaces
          
          jQuery.each(q.split(/[&;]/), function(){
            var key = decodeURIComponent(this.split('=')[0] || "");
            var val = decodeURIComponent(this.split('=')[1] || "");
            
            if (!key) return;
            
            if ($numbers) {
              if (/^[+-]?[0-9]+\.[0-9]*$/.test(val)) // simple float regex
                val = parseFloat(val);
              else if (/^[+-]?[0-9]+$/.test(val)) // simple int regex
                val = parseInt(val, 10);
            }
            
            val = (!val && val !== 0) ? true : val;
            
            if (val !== false && val !== true && typeof val != 'number')
              val = val;
            
            self.SET(key, val);
          });
        });
      }
      return self;
    };
    
    queryObject.prototype = {
      queryObject: true,
      has: function(key, type) {
        var value = this.get(key);
        return is(value, type);
      },
      GET: function(key) {
        if (!is(key)) return this.keys;
        var parsed = parse(key), base = parsed[0], tokens = parsed[1];
        var target = this.keys[base];
        while (target != null && tokens.length != 0) {
          target = target[tokens.shift()];
        }
        return typeof target == 'number' ? target : target || "";
      },
      get: function(key) {
        var target = this.GET(key);
        if (is(target, Object))
          return jQuery.extend(true, {}, target);
        else if (is(target, Array))
          return target.slice(0);
        return target;
      },
      SET: function(key, val) {
        var value = !is(val) ? null : val;
        var parsed = parse(key), base = parsed[0], tokens = parsed[1];
        var target = this.keys[base];
        this.keys[base] = set(target, tokens.slice(0), value);
        return this;
      },
      set: function(key, val) {
        return this.copy().SET(key, val);
      },
      REMOVE: function(key) {
        return this.SET(key, null).COMPACT();
      },
      remove: function(key) {
        return this.copy().REMOVE(key);
      },
      EMPTY: function() {
        var self = this;
        jQuery.each(self.keys, function(key, value) {
          delete self.keys[key];
        });
        return self;
      },
      load: function(url) {
        var hash = url.replace(/^.*?[#](.+?)(?:\?.+)?$/, "$1");
        var search = url.replace(/^.*?[?](.+?)(?:#.+)?$/, "$1");
        return new queryObject(url.length == search.length ? '' : search, url.length == hash.length ? '' : hash);
      },
      empty: function() {
        return this.copy().EMPTY();
      },
      copy: function() {
        return new queryObject(this);
      },
      COMPACT: function() {
        function build(orig) {
          var obj = typeof orig == "object" ? is(orig, Array) ? [] : {} : orig;
          if (typeof orig == 'object') {
            function add(o, key, value) {
              if (is(o, Array))
                o.push(value);
              else
                o[key] = value;
            }
            jQuery.each(orig, function(key, value) {
              if (!is(value)) return true;
              add(obj, key, build(value));
            });
          }
          return obj;
        }
        this.keys = build(this.keys);
        return this;
      },
      compact: function() {
        return this.copy().COMPACT();
      },
      toString: function() {
        var i = 0, queryString = [], chunks = [], self = this;
        var encode = function(str) {
          str = str + "";
          if ($spaces) str = str.replace(/ /g, "+");
          return encodeURIComponent(str);
        };
        var addFields = function(arr, key, value) {
          if (!is(value) || value === false) return;
          var o = [encode(key)];
          if (value !== true) {
            o.push("=");
            o.push(encode(value));
          }
          arr.push(o.join(""));
        };
        var build = function(obj, base) {
          var newKey = function(key) {
            return !base || base == "" ? [key].join("") : [base, "[", key, "]"].join("");
          };
          jQuery.each(obj, function(key, value) {
            if (typeof value == 'object') 
              build(value, newKey(key));
            else
              addFields(chunks, newKey(key), value);
          });
        };
        
        build(this.keys);
        
        if (chunks.length > 0) queryString.push($hash);
        queryString.push(chunks.join($separator));
        
        return queryString.join("");
      }
    };
    
    return new queryObject(location.search, location.hash);
  };
}(jQuery.query || {}); // Pass in jQuery.query as settings object


/*
* Pulled from: jquery.reject.js
* jReject (jQuery Browser Rejection Plugin)
* Version 0.7-Beta
* URL: http://jreject.turnwheel.com/
* Description: jReject gives you a customizable and easy solution to reject/allowing specific browsers access to your pages
* Author: Steven Bower (TurnWheel Designs) http://turnwheel.com/
* Copyright: Copyright (c) 2009-2010 Steven Bower under dual MIT/GPL license.
* Depends On: jQuery Browser Plugin (http://jquery.thewikies.com/browser)
*/

(function ($) {
    $.reject = function (opts) {
        var opts = $.extend(true, {
            reject: { // Rejection flags for specific browsers
                all: false, // Covers Everything (Nothing blocked)
                msie5: true, msie6: true // Covers MSIE 5-6 (Blocked by default)
                /*
                Possibilities are endless...

                msie: false,msie5: true,msie6: true,msie7: false,msie8: false, // MSIE Flags (Global, 5-8)
                firefox: false,firefox1: false,firefox2: false,firefox3: false, // Firefox Flags (Global, 1-3)
                konqueror: false,konqueror1: false,konqueror2: false,konqueror3: false, // Konqueror Flags (Global, 1-3)
                chrome: false,chrome1: false,chrome2: false,chrome3: false,chrome4: false, // Chrome Flags (Global, 1-4)
                safari: false,safari2: false,safari3: false,safari4: false, // Safari Flags (Global, 1-4)
                opera: false,opera7: false,opera8: false,opera9: false,opera10: false, // Opera Flags (Global, 7-10)
                gecko: false,webkit: false,trident: false,khtml: false,presto: false, // Rendering Engines (Gecko, Webkit, Trident, KHTML, Presto)
                win: false,mac: false,linux : false,solaris : false,iphone: false, // Operating Systems (Win, Mac, Linux, Solaris, iPhone)
                unknown: false // Unknown covers everything else
                */
            },
            display: [], // What browsers to display and their order (default set below)
            browserInfo: { // Settings for which browsers to display
                firefox: {
                    text: 'Firefox', // Text below the icon
                    url: 'http://www.mozilla.com/firefox/' // URL For icon/text link
                },
                safari: {
                    text: 'Safari',
                    url: 'http://www.apple.com/safari/download/'
                },
                opera: {
                    text: 'Opera',
                    url: 'http://www.opera.com/download/'
                },
                chrome: {
                    text: 'Chrome',
                    url: 'http://www.google.com/chrome/'
                },
                msie: {
                    text: 'Internet Explorer',
                    url: 'http://www.microsoft.com/windows/Internet-explorer/'
                },
                gcf: {
                    text: 'Google Chrome Frame',
                    url: 'http://code.google.com/chrome/chromeframe/',
                    allow: { all: false, msie: true} // This browser option will only be displayed for MSIE
                }
            },
            header: 'Did you know that your Internet Browser is out of date?', // Header of pop-up window
            paragraph1: 'Your browser is out of date, and may not be compatible with our website. A list of the most popular web browsers can be found below.', // Paragraph 1
            paragraph2: 'Just click on the icons to get to the download page', // Paragraph 2
            close: true, // Allow closing of window
            closeMessage: 'By closing this window you acknowledge that your experience on this website may be degraded', // Message displayed below closing link
            closeLink: 'Close This Window', // Text for closing link
            closeURL: '#', // Close URL
            closeESC: true, // Allow closing of window with esc key
            closeCookie: false, // If cookies should be used to remmember if the window was closed (see cookieSettings for more options)
            // Cookie settings are only used if closeCookie is true
            cookieSettings: {
                path: '/', // Path for the cookie to be saved on (should be root domain in most cases)
                expires: 0 // Expiration Date (in seconds), 0 (default) means it ends with the current session
            },
            imagePath: '/image/browsers/', // Path where images are located
            overlayBgColor: '#000', // Background color for overlay
            overlayOpacity: 0.8, // Background transparency (0-1)
            fadeInTime: 'fast', // Fade in time on open ('slow','medium','fast' or integer in ms)
            fadeOutTime: 'fast' // Fade out time on close ('slow','medium','fast' or integer in ms)
        }, opts);

        // Set default browsers to display if not already defined
        if (opts.display.length < 1) opts.display = ['firefox', 'chrome', 'msie', 'safari', 'opera', 'gcf'];

        // beforeRject: Customized Function
        if ($.isFunction(opts.beforeReject)) opts.beforeReject(opts);

        // Disable 'closeESC' if closing is disabled (mutually exclusive)
        if (!opts.close) opts.closeESC = false;

        // This function parses the advanced browser options
        var browserCheck = function (settings) {
            // Check 1: Look for 'all' forced setting
            // Check 2: Operating System (eg. 'win','mac','linux','solaris','iphone')
            // Check 3: Rendering engine (eg. 'webkit', 'gecko', 'trident')
            // Check 4: Browser name (eg. 'firefox','msie','chrome')
            // Check 5: Browser+major version (eg. 'firefox3','msie7','chrome4')
            return (settings['all'] ? true : false) ||
				(settings[$.os.name] ? true : false) ||
				(settings[$.layout.name] ? true : false) ||
				(settings[$.browser.name] ? true : false) ||
				(settings[$.browser.className] ? true : false);
        };

        // Determine if we need to display rejection for this browser, or exit
        if (!browserCheck(opts.reject)) {
            // onFail: Customized Function
            if ($.isFunction(opts.onFail)) opts.onFail(opts);
            return false;
        }

        // If user can close and set to remmember close, initiate cookie functions
        if (opts.close && opts.closeCookie) {
            var COOKIE_NAME = 'jreject-close'; // Local global setting for the name of the cookie used

            // Cookies Function: Handles creating/retrieving/deleting cookies
            // Cookies are only used for opts.closeCookie parameter functionality
            var _cookie = function (name, value) {
                if (typeof value != 'undefined') {
                    var expires = '';

                    // Check if we need to set an expiration date
                    if (opts.cookieSettings.expires != 0) {
                        var date = new Date();
                        date.setTime(date.getTime() + (opts.cookieSettings.expires));
                        var expires = "; expires=" + date.toGMTString();
                    }

                    // Get path from settings
                    var path = opts.cookieSettings.path || '/';

                    // Set Cookie with parameters
                    document.cookie = name + '=' + encodeURIComponent(value == null ? '' : value) + expires + '; path=' + path;
                }
                else { // Get cookie value
                    var cookie, val = null;

                    if (document.cookie && document.cookie != '') {
                        var cookies = document.cookie.split(';');

                        // Loop through all cookie values
                        for (var i = 0; i < cookies.length; ++i) {
                            cookie = $.trim(cookies[i]);

                            // Does this cookie string begin with the name we want?
                            if (cookie.substring(0, name.length + 1) == (name + '=')) {
                                val = decodeURIComponent(cookie.substring(name.length + 1));
                                break;
                            }
                        }
                    }

                    return val; // Return cookie value
                }
            };

            // If cookie is set, return false and don't display rejection
            if (_cookie(COOKIE_NAME) != null) return false;
        }

        // Load background overlay (jr_overlay) + Main wrapper (jr_wrap) +
        // Inner Wrapper (jr_inner) w/ opts.header (jr_header) +
        // opts.paragraph1/opts.paragraph2 if set
        var html = '<div id="jr_overlay"></div><div id="jr_wrap"><div id="jr_inner"><h1 id="jr_header">' + opts.header + '</h1>' +
		(opts.paragraph1 === '' ? '' : '<p>' + opts.paragraph1 + '</p>') + (opts.paragraph2 === '' ? '' : '<p>' + opts.paragraph2 + '</p>') + '<ul>';

        var displayNum = 0; // Tracks number of browsers being displayed
        // Generate the browsers to display
        for (var x in opts.display) {
            var browser = opts.display[x]; // Current Browser
            var info = opts.browserInfo[browser] || false; // Browser Information

            // If no info exists for this browser
            // or if this browser is not suppose to display to this user
            if (!info || (info['allow'] != undefined && !browserCheck(info['allow']))) continue;

            var url = info.url || '#'; // URL to link text/icon to
            // Generate HTML for this browser option
            html += '<li id="jr_' + browser + '"><div class="jr_icon"></div>' +
					'<div><a href="' + url + '">' + (info.text || 'Unknown') + '</a></div></li>';
            ++displayNum; // Increment number of browser being displayed
        }

        // Close list and #jr_list
        html += '</ul><div id="jr_close">' +
        // Display close links/message if set
		(opts.close ? '<a href="' + opts.closeURL + '">' + opts.closeLink + '</a><p>' + opts.closeMessage + '</p>' : '') + '</div>' +
        // Close #jr_inner and #jr_wrap
		'</div></div>';

        var element = $('<div>' + html + '</div>'); // Create element
        var size = _pageSize(); // Get page size
        var scroll = _scrollSize(); // Get page scroll

        // This function handles closing this reject window
        element.bind('closejr', function () { // When clicked, fadeOut and remove all elements
            if (!opts.close) return false; // Make sure the ability to close is set
            if ($.isFunction(opts.beforeClose)) opts.beforeClose(opts); // Customized Function

            $(this).unbind('closejr'); // Remove binding function

            // Fade out background and modal wrapper
            $('#jr_overlay,#jr_wrap').fadeOut(opts.fadeOutTime, function () {
                $(this).remove(); // Remove element from DOM

                // afterClose: Customized Function
                if ($.isFunction(opts.afterClose)) opts.afterClose(opts);
            });

            $('embed, object, select, applet').show(); // Show elements that were hidden

            if (opts.closeCookie) _cookie(COOKIE_NAME, 'true'); // Set close cookie for next run
            return true;
        });

        // Traverse through the DOM and
        // Apply CSS Rules to elements
        element.find('#jr_overlay').css({ // Creates 'background' (div)
            width: size[0],
            height: size[1],
            position: 'absolute',
            top: 0,
            left: 0,
            background: opts.overlayBgColor,
            zIndex: 200,
            opacity: opts.overlayOpacity,
            padding: 0,
            margin: 0
        }).next('#jr_wrap').css({ // Wrapper for our pop-up (div)
            position: 'absolute',
            width: '100%',
            top: scroll[1] + (size[3] / 4),
            left: scroll[0],
            zIndex: 300,
            textAlign: 'center',
            padding: 0,
            margin: 0
        }).children('#jr_inner').css({ // Wrapper for inner centered content (div)
            background: '#FFF',
            border: '1px solid #CCC',
            fontFamily: '"Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif',
            color: '#4F4F4F',
            margin: '0 auto',
            position: 'relative',
            height: 'auto',
            minWidth: displayNum * 100,
            maxWidth: displayNum * 140,
            width: $.layout.name == 'trident' ? displayNum * 155 : 'auto', // min/maxWidth not supported by IE
            padding: 20,
            fontSize: 12
        }).children('#jr_header').css({ // Header (h1)
            display: 'block',
            fontSize: '1.3em',
            marginBottom: '0.5em',
            color: '#333',
            fontFamily: 'Helvetica,Arial,sans-serif',
            fontWeight: 'bold',
            textAlign: 'left',
            padding: 5,
            margin: 0
        }).nextAll('p').css({ // Paragraphs (p)
            textAlign: 'left',
            padding: 5,
            margin: 0
        }).siblings('ul').css({ // Browser list (ul)
            listStyleImage: 'none',
            listStylePosition: 'outside',
            listStyleType: 'none',
            margin: 0,
            padding: 0
        }).children('li').css({ // Browser list items (li)
            background: 'transparent url("' + opts.imagePath + 'background_browser.gif") no-repeat scroll left top',
            cusor: 'pointer',
            'float': 'left',
            width: 120,
            height: 122,
            margin: '0 10px 10px 10px',
            padding: 0,
            textAlign: 'center'
        }).children('.jr_icon').css({ // Icons (div)
            width: 100,
            height: 100,
            margin: '1px auto',
            padding: 0,
            background: 'transparent no-repeat scroll left top',
            cursor: 'pointer'
        }).each(function () { // Dynamically sets the icon background image
            var self = $(this);
            self.css('background', 'transparent url(' + opts.imagePath + 'browser_' + (self.parent('li').attr('id').replace(/jr_/, '')) + '.gif) no-repeat scroll left top');
            self.click(function () {
                window.open($(this).next('div').children('a').attr('href'), 'jr_' + Math.round(Math.random() * 11));
                return false;
            });
        }).siblings('div').css({ // Text under the browser icon (div)
            color: '#808080',
            fontSize: '0.8em',
            height: 18,
            lineHeight: '17px',
            margin: '1px auto',
            padding: 0,
            width: 118,
            textAlign: 'center'
        }).children('a').css({ // Text link (a)
            color: '#333',
            textDecoration: 'none',
            padding: 0,
            margin: 0
        }).hover(function () { // Underline effect (a:hover)
            $(this).css('textDecoration', 'underline');
        }, function () {
            $(this).css('textDecoration', 'none');
        }).click(function () { // Make links open in new window (a)
            window.open($(this).attr('href'), 'jr_' + Math.round(Math.random() * 11));
            return false;
        }).parents('#jr_inner').children('#jr_close').css({ // Close window option (div)
            margin: '0 0 0 50px',
            clear: 'both',
            textAlign: 'left',
            padding: 0,
            margin: 0
        }).children('a').css({ // Close window link (a)
            color: '#000',
            display: 'block',
            width: 'auto',
            margin: 0,
            padding: 0,
            textDecoration: 'underline'
        }).click(function () { // Bind closing event
            $(this).trigger('closejr');

            // If plain anchor is set, return false so there is no page jump
            if (opts.closeURL === '#') return false;
        }).nextAll('p').css({ // Add padding to close link/text
            padding: '10px 0 0 0',
            margin: 0
        });

        // Set focus (fixes ESC key issues with forms and other focus bugs)
        $('#jr_overlay').focus();

        // Hide elements that won't display properly
        $('embed, object, select, applet').hide();

        // Append element to body of document to display
        $('body').append(element.hide().fadeIn(opts.fadeInTime));

        // Handle window resize/scroll events and update overlay dimensions
        $(window).bind('resize scroll', function () {
            var size = _pageSize(); // Get size

            // Update overlay dimensions based on page size
            $('#jr_overlay').css({ width: size[0], height: size[1] });

            var scroll = _scrollSize(); // Get page scroll

            // Update modal position based on scroll
            $('#jr_wrap').css({ top: scroll[1] + (size[3] / 4), left: scroll[0] });
        });

        // Add optional ESC Key functionality
        if (opts.closeESC) {
            $(document).bind('keydown', function (event) {
                // ESC = Keycode 27
                if (event.keyCode == 27) element.trigger('closejr');
            });
        }

        // afterReject: Customized Function
        if ($.isFunction(opts.afterReject)) opts.afterReject(opts);

        return true;
    };

    // Based on compatibility data from quirksmode.com
    var _pageSize = function () {
        var xScroll = window.innerWidth && window.scrollMaxX ? window.innerWidth + window.scrollMaxX :
						(document.body.scrollWidth > document.body.offsetWidth ?
						document.body.scrollWidth : document.body.offsetWidth);

        var yScroll = window.innerHeight && window.scrollMaxY ? window.innerHeight + window.scrollMaxY :
						(document.body.scrollHeight > document.body.offsetHeight ?
						document.body.scrollHeight : document.body.offsetHeight);

        var windowWidth = window.innerWidth ? window.innerWidth :
						(document.documentElement && document.documentElement.clientWidth ?
						document.documentElement.clientWidth : document.body.clientWidth);

        var windowHeight = window.innerHeight ? window.innerHeight :
						(document.documentElement && document.documentElement.clientHeight ?
						document.documentElement.clientHeight : document.body.clientHeight);

        return [
			xScroll < windowWidth ? xScroll : windowWidth, // Page Width
			yScroll < windowHeight ? windowHeight : yScroll, // Page Height
			windowWidth, windowHeight
		];
    };


    // Based on compatibility data from quirksmode.com
    var _scrollSize = function () {
        return [
        // scrollSize X
			window.pageXOffset ? window.pageXOffset : (document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollLeft : document.body.scrollLeft),
        // scrollSize Y
			window.pageYOffset ? window.pageYOffset : (document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop)
		];
    };
})(jQuery);


/*
* Pulled from: jquery.reject.js
* jQuery Browser Plugin
* Version 2.3
* 2008-09-17 19:27:05
* URL: http://jquery.thewikies.com/browser
* Description: jQuery Browser Plugin extends browser detection capabilities and can assign browser selectors to CSS classes.
* Author: Nate Cavanaugh, Minhchau Dang, & Jonathan Neal
* Copyright: Copyright (c) 2008 Jonathan Neal under dual MIT/GPL license.
*/
(function ($) { $.browserTest = function (a, z) { var u = 'unknown', x = 'X', m = function (r, h) { for (var i = 0; i < h.length; i = i + 1) { r = r.replace(h[i][0], h[i][1]); } return r; }, c = function (i, a, b, c) { var r = { name: m((a.exec(i) || [u, u])[1], b) }; r[r.name] = true; r.version = (c.exec(i) || [x, x, x, x])[3]; if (r.name.match(/safari/) && r.version > 400) { r.version = '2.0'; } if (r.name === 'presto') { r.version = ($.browser.version > 9.27) ? 'futhark' : 'linear_b'; } r.versionNumber = parseFloat(r.version, 10) || 0; r.versionX = (r.version !== x) ? (r.version + '').substr(0, 1) : x; r.className = r.name + r.versionX; return r; }; a = (a.match(/Opera|Navigator|Minefield|KHTML|Chrome/) ? m(a, [[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/, ''], ['Chrome Safari', 'Chrome'], ['KHTML', 'Konqueror'], ['Minefield', 'Firefox'], ['Navigator', 'Netscape']]) : a).toLowerCase(); $.browser = $.extend((!z) ? $.browser : {}, c(a, /(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari)/, [], /(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\s|$)/)); $.layout = c(a, /(gecko|konqueror|msie|opera|webkit)/, [['konqueror', 'khtml'], ['msie', 'trident'], ['opera', 'presto']], /(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/); $.os = { name: (/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase()) || [u])[0].replace('sunos', 'solaris') }; if (!z) { $('html').addClass([$.os.name, $.browser.name, $.browser.className, $.layout.name, $.layout.className].join(' ')); } }; $.browserTest(navigator.userAgent); })(jQuery);


/*
* Pulled from: jquery.scrollpane.min.js
* jScrollPane - v2.0.0beta10 - 2011-04-04
* http://jscrollpane.kelvinluck.com/
*
* Copyright (c) 2010 Kelvin Luck
* Dual licensed under the MIT and GPL licenses.
*/
(function (b, a, c) {
    b.fn.jScrollPane = function (f) {
        function d(E, P) {
            var aA, R = this, Z, al, w, an, U, aa, z, r, aB, aG, aw, j, J, i, k, ab, V, ar, Y, u, B, at, ag, ao, H, m, av, az, y, ax, aJ, g, M, ak = true, Q = true, aI = false, l = false, aq = E.clone(false, false).empty(), ad = b.fn.mwheelIntent ? "mwheelIntent.jsp" : "mousewheel.jsp"; aJ = E.css("paddingTop") + " " + E.css("paddingRight") + " " + E.css("paddingBottom") + " " + E.css("paddingLeft"); g = (parseInt(E.css("paddingLeft"), 10) || 0) + (parseInt(E.css("paddingRight"), 10) || 0); function au(aU) { var aS, aT, aN, aP, aO, aL, aK, aR, aQ = false, aM = false; aA = aU; if (Z === c) { aK = E.scrollTop(); aR = E.scrollLeft(); E.css({ overflow: "hidden", padding: 0 }); al = E.innerWidth() + g; w = E.innerHeight(); E.width(al); Z = b('<div class="jspPane" />').css("padding", aJ).append(E.children()); an = b('<div class="jspContainer" />').css({ width: al + "px", height: w + "px" }).append(Z).appendTo(E) } else { E.css("width", ""); aQ = aA.stickToBottom && L(); aM = aA.stickToRight && C(); aL = E.innerWidth() + g != al || E.outerHeight() != w; if (aL) { al = E.innerWidth() + g; w = E.innerHeight(); an.css({ width: al + "px", height: w + "px" }) } if (!aL && M == U && Z.outerHeight() == aa) { E.width(al); return } M = U; Z.css("width", ""); E.width(al); an.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end() } if (aU.contentWidth) { U = aU.contentWidth } else { aS = Z.clone(false, false).css("position", "absolute"); aT = b('<div style="width:1px; position: relative;" />').append(aS); b("body").append(aT); U = Math.max(Z.outerWidth(), aS.outerWidth()); aT.remove() } aa = Z.outerHeight(); z = U / al; r = aa / w; aB = r > 1; aG = z > 1; if (!(aG || aB)) { E.removeClass("jspScrollable"); Z.css({ top: 0, width: an.width() - g }); o(); F(); S(); x(); aj() } else { E.addClass("jspScrollable"); aN = aA.maintainPosition && (J || ab); if (aN) { aP = aE(); aO = aC() } aH(); A(); G(); if (aN) { O(aM ? (U - al) : aP, false); N(aQ ? (aa - w) : aO, false) } K(); ah(); ap(); if (aA.enableKeyboardNavigation) { T() } if (aA.clickOnTrack) { q() } D(); if (aA.hijackInternalLinks) { n() } } if (aA.autoReinitialise && !ax) { ax = setInterval(function () { au(aA) }, aA.autoReinitialiseDelay) } else { if (!aA.autoReinitialise && ax) { clearInterval(ax) } } aK && E.scrollTop(0) && N(aK, false); aR && E.scrollLeft(0) && O(aR, false); E.trigger("jsp-initialised", [aG || aB]) } function aH() { if (aB) { an.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'), b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'), b('<div class="jspDragBottom" />'))), b('<div class="jspCap jspCapBottom" />'))); V = an.find(">.jspVerticalBar"); ar = V.find(">.jspTrack"); aw = ar.find(">.jspDrag"); if (aA.showArrows) { at = b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp", aF(0, -1)).bind("click.jsp", aD); ag = b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp", aF(0, 1)).bind("click.jsp", aD); if (aA.arrowScrollOnHover) { at.bind("mouseover.jsp", aF(0, -1, at)); ag.bind("mouseover.jsp", aF(0, 1, ag)) } am(ar, aA.verticalArrowPositions, at, ag) } u = w; an.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function () { u -= b(this).outerHeight() }); aw.hover(function () { aw.addClass("jspHover") }, function () { aw.removeClass("jspHover") }).bind("mousedown.jsp", function (aK) { b("html").bind("dragstart.jsp selectstart.jsp", aD); aw.addClass("jspActive"); var s = aK.pageY - aw.position().top; b("html").bind("mousemove.jsp", function (aL) { W(aL.pageY - s, false) }).bind("mouseup.jsp mouseleave.jsp", ay); return false }); p() } } function p() { ar.height(u + "px"); J = 0; Y = aA.verticalGutter + ar.outerWidth(); Z.width(al - Y - g); try { if (V.position().left === 0) { Z.css("margin-left", Y + "px") } } catch (s) { } } function A() {
                if (aG) {
                    an.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'), b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'), b('<div class="jspDragRight" />'))), b('<div class="jspCap jspCapRight" />'))); ao = an.find(">.jspHorizontalBar"); H = ao.find(">.jspTrack"); i = H.find(">.jspDrag"); if (aA.showArrows) {
                        az = b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp", aF(-1, 0)).bind("click.jsp", aD);
                        y = b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp", aF(1, 0)).bind("click.jsp", aD); if (aA.arrowScrollOnHover) { az.bind("mouseover.jsp", aF(-1, 0, az)); y.bind("mouseover.jsp", aF(1, 0, y)) } am(H, aA.horizontalArrowPositions, az, y)
                    } i.hover(function () { i.addClass("jspHover") }, function () { i.removeClass("jspHover") }).bind("mousedown.jsp", function (aK) { b("html").bind("dragstart.jsp selectstart.jsp", aD); i.addClass("jspActive"); var s = aK.pageX - i.position().left; b("html").bind("mousemove.jsp", function (aL) { X(aL.pageX - s, false) }).bind("mouseup.jsp mouseleave.jsp", ay); return false }); m = an.innerWidth(); ai()
                } 
            } function ai() { an.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function () { m -= b(this).outerWidth() }); H.width(m + "px"); ab = 0 } function G() { if (aG && aB) { var aK = H.outerHeight(), s = ar.outerWidth(); u -= aK; b(ao).find(">.jspCap:visible,>.jspArrow").each(function () { m += b(this).outerWidth() }); m -= s; w -= s; al -= aK; H.parent().append(b('<div class="jspCorner" />').css("width", aK + "px")); p(); ai() } if (aG) { Z.width((an.outerWidth() - g) + "px") } aa = Z.outerHeight(); r = aa / w; if (aG) { av = Math.ceil(1 / z * m); if (av > aA.horizontalDragMaxWidth) { av = aA.horizontalDragMaxWidth } else { if (av < aA.horizontalDragMinWidth) { av = aA.horizontalDragMinWidth } } i.width(av + "px"); k = m - av; af(ab) } if (aB) { B = Math.ceil(1 / r * u); if (B > aA.verticalDragMaxHeight) { B = aA.verticalDragMaxHeight } else { if (B < aA.verticalDragMinHeight) { B = aA.verticalDragMinHeight } } aw.height(B + "px"); j = u - B; ae(J) } } function am(aL, aN, aK, s) { var aP = "before", aM = "after", aO; if (aN == "os") { aN = /Mac/.test(navigator.platform) ? "after" : "split" } if (aN == aP) { aM = aN } else { if (aN == aM) { aP = aN; aO = aK; aK = s; s = aO } } aL[aP](aK)[aM](s) } function aF(aK, s, aL) { return function () { I(aK, s, this, aL); this.blur(); return false } } function I(aN, aM, aQ, aP) { aQ = b(aQ).addClass("jspActive"); var aO, aL, aK = true, s = function () { if (aN !== 0) { R.scrollByX(aN * aA.arrowButtonSpeed) } if (aM !== 0) { R.scrollByY(aM * aA.arrowButtonSpeed) } aL = setTimeout(s, aK ? aA.initialDelay : aA.arrowRepeatFreq); aK = false }; s(); aO = aP ? "mouseout.jsp" : "mouseup.jsp"; aP = aP || b("html"); aP.bind(aO, function () { aQ.removeClass("jspActive"); aL && clearTimeout(aL); aL = null; aP.unbind(aO) }) } function q() { x(); if (aB) { ar.bind("mousedown.jsp", function (aP) { if (aP.originalTarget === c || aP.originalTarget == aP.currentTarget) { var aN = b(this), aQ = aN.offset(), aO = aP.pageY - aQ.top - J, aL, aK = true, s = function () { var aT = aN.offset(), aU = aP.pageY - aT.top - B / 2, aR = w * aA.scrollPagePercent, aS = j * aR / (aa - w); if (aO < 0) { if (J - aS > aU) { R.scrollByY(-aR) } else { W(aU) } } else { if (aO > 0) { if (J + aS < aU) { R.scrollByY(aR) } else { W(aU) } } else { aM(); return } } aL = setTimeout(s, aK ? aA.initialDelay : aA.trackClickRepeatFreq); aK = false }, aM = function () { aL && clearTimeout(aL); aL = null; b(document).unbind("mouseup.jsp", aM) }; s(); b(document).bind("mouseup.jsp", aM); return false } }) } if (aG) { H.bind("mousedown.jsp", function (aP) { if (aP.originalTarget === c || aP.originalTarget == aP.currentTarget) { var aN = b(this), aQ = aN.offset(), aO = aP.pageX - aQ.left - ab, aL, aK = true, s = function () { var aT = aN.offset(), aU = aP.pageX - aT.left - av / 2, aR = al * aA.scrollPagePercent, aS = k * aR / (U - al); if (aO < 0) { if (ab - aS > aU) { R.scrollByX(-aR) } else { X(aU) } } else { if (aO > 0) { if (ab + aS < aU) { R.scrollByX(aR) } else { X(aU) } } else { aM(); return } } aL = setTimeout(s, aK ? aA.initialDelay : aA.trackClickRepeatFreq); aK = false }, aM = function () { aL && clearTimeout(aL); aL = null; b(document).unbind("mouseup.jsp", aM) }; s(); b(document).bind("mouseup.jsp", aM); return false } }) } } function x() { if (H) { H.unbind("mousedown.jsp") } if (ar) { ar.unbind("mousedown.jsp") } } function ay() { b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp"); if (aw) { aw.removeClass("jspActive") } if (i) { i.removeClass("jspActive") } } function W(s, aK) { if (!aB) { return } if (s < 0) { s = 0 } else { if (s > j) { s = j } } if (aK === c) { aK = aA.animateScroll } if (aK) { R.animate(aw, "top", s, ae) } else { aw.css("top", s); ae(s) } } function ae(aK) { if (aK === c) { aK = aw.position().top } an.scrollTop(0); J = aK; var aN = J === 0, aL = J == j, aM = aK / j, s = -aM * (aa - w); if (ak != aN || aI != aL) { ak = aN; aI = aL; E.trigger("jsp-arrow-change", [ak, aI, Q, l]) } v(aN, aL); Z.css("top", s); E.trigger("jsp-scroll-y", [-s, aN, aL]).trigger("scroll") } function X(aK, s) {
                if (!aG) {
                    return
                } if (aK < 0) { aK = 0 } else { if (aK > k) { aK = k } } if (s === c) { s = aA.animateScroll } if (s) { R.animate(i, "left", aK, af) } else { i.css("left", aK); af(aK) } 
            } function af(aK) { if (aK === c) { aK = i.position().left } an.scrollTop(0); ab = aK; var aN = ab === 0, aM = ab == k, aL = aK / k, s = -aL * (U - al); if (Q != aN || l != aM) { Q = aN; l = aM; E.trigger("jsp-arrow-change", [ak, aI, Q, l]) } t(aN, aM); Z.css("left", s); E.trigger("jsp-scroll-x", [-s, aN, aM]).trigger("scroll") } function v(aK, s) { if (aA.showArrows) { at[aK ? "addClass" : "removeClass"]("jspDisabled"); ag[s ? "addClass" : "removeClass"]("jspDisabled") } } function t(aK, s) { if (aA.showArrows) { az[aK ? "addClass" : "removeClass"]("jspDisabled"); y[s ? "addClass" : "removeClass"]("jspDisabled") } } function N(s, aK) { var aL = s / (aa - w); W(aL * j, aK) } function O(aK, s) { var aL = aK / (U - al); X(aL * k, s) } function ac(aX, aS, aL) { var aP, aM, aN, s = 0, aW = 0, aK, aR, aQ, aU, aT, aV; try { aP = b(aX) } catch (aO) { return } aM = aP.outerHeight(); aN = aP.outerWidth(); an.scrollTop(0); an.scrollLeft(0); while (!aP.is(".jspPane")) { s += aP.position().top; aW += aP.position().left; aP = aP.offsetParent(); if (/^body|html$/i.test(aP[0].nodeName)) { return } } aK = aC(); aQ = aK + w; if (s < aK || aS) { aT = s - aA.verticalGutter } else { if (s + aM > aQ) { aT = s - w + aM + aA.verticalGutter } } if (aT) { N(aT, aL) } aR = aE(); aU = aR + al; if (aW < aR || aS) { aV = aW - aA.horizontalGutter } else { if (aW + aN > aU) { aV = aW - al + aN + aA.horizontalGutter } } if (aV) { O(aV, aL) } } function aE() { return -Z.position().left } function aC() { return -Z.position().top } function L() { var s = aa - w; return (s > 20) && (s - aC() < 10) } function C() { var s = U - al; return (s > 20) && (s - aE() < 10) } function ah() { an.unbind(ad).bind(ad, function (aN, aO, aM, aK) { var aL = ab, s = J; R.scrollBy(aM * aA.mouseWheelSpeed, -aK * aA.mouseWheelSpeed, false); return aL == ab && s == J }) } function o() { an.unbind(ad) } function aD() { return false } function K() { Z.find(":input,a").unbind("focus.jsp").bind("focus.jsp", function (s) { ac(s.target, false) }) } function F() { Z.find(":input,a").unbind("focus.jsp") } function T() { var s, aK, aM = []; aG && aM.push(ao[0]); aB && aM.push(V[0]); Z.focus(function () { E.focus() }); E.attr("tabindex", 0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp", function (aP) { if (aP.target !== this && !(aM.length && b(aP.target).closest(aM).length)) { return } var aO = ab, aN = J; switch (aP.keyCode) { case 40: case 38: case 34: case 32: case 33: case 39: case 37: s = aP.keyCode; aL(); break; case 35: N(aa - w); s = null; break; case 36: N(0); s = null; break } aK = aP.keyCode == s && aO != ab || aN != J; return !aK }).bind("keypress.jsp", function (aN) { if (aN.keyCode == s) { aL() } return !aK }); if (aA.hideFocus) { E.css("outline", "none"); if ("hideFocus" in an[0]) { E.attr("hideFocus", true) } } else { E.css("outline", ""); if ("hideFocus" in an[0]) { E.attr("hideFocus", false) } } function aL() { var aO = ab, aN = J; switch (s) { case 40: R.scrollByY(aA.keyboardSpeed, false); break; case 38: R.scrollByY(-aA.keyboardSpeed, false); break; case 34: case 32: R.scrollByY(w * aA.scrollPagePercent, false); break; case 33: R.scrollByY(-w * aA.scrollPagePercent, false); break; case 39: R.scrollByX(aA.keyboardSpeed, false); break; case 37: R.scrollByX(-aA.keyboardSpeed, false); break } aK = aO != ab || aN != J; return aK } } function S() { E.attr("tabindex", "-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp") } function D() { if (location.hash && location.hash.length > 1) { var aL, aK; try { aL = b(location.hash) } catch (s) { return } if (aL.length && Z.find(location.hash)) { if (an.scrollTop() === 0) { aK = setInterval(function () { if (an.scrollTop() > 0) { ac(location.hash, true); b(document).scrollTop(an.position().top); clearInterval(aK) } }, 50) } else { ac(location.hash, true); b(document).scrollTop(an.position().top) } } } } function aj() { b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack") } function n() { aj(); b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack", function () { var s = this.href.split("#"), aK; if (s.length > 1) { aK = s[1]; if (aK.length > 0 && Z.find("#" + aK).length > 0) { ac("#" + aK, true); return false } } }) } function ap() {
                var aL, aK, aN, aM, aO, s = false; an.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp", function (aP) { var aQ = aP.originalEvent.touches[0]; aL = aE(); aK = aC(); aN = aQ.pageX; aM = aQ.pageY; aO = false; s = true }).bind("touchmove.jsp", function (aS) {
                    if (!s) { return } var aR = aS.originalEvent.touches[0], aQ = ab, aP = J;
                    R.scrollTo(aL + aN - aR.pageX, aK + aM - aR.pageY); aO = aO || Math.abs(aN - aR.pageX) > 5 || Math.abs(aM - aR.pageY) > 5; return aQ == ab && aP == J
                }).bind("touchend.jsp", function (aP) { s = false }).bind("click.jsp-touchclick", function (aP) { if (aO) { aO = false; return false } })
            } function h() { var s = aC(), aK = aE(); E.removeClass("jspScrollable").unbind(".jsp"); E.replaceWith(aq.append(Z.children())); aq.scrollTop(s); aq.scrollLeft(aK) } b.extend(R, { reinitialise: function (aK) { aK = b.extend({}, aA, aK); au(aK) }, scrollToElement: function (aL, aK, s) { ac(aL, aK, s) }, scrollTo: function (aL, s, aK) { O(aL, aK); N(s, aK) }, scrollToX: function (aK, s) { O(aK, s) }, scrollToY: function (s, aK) { N(s, aK) }, scrollToPercentX: function (aK, s) { O(aK * (U - al), s) }, scrollToPercentY: function (aK, s) { N(aK * (aa - w), s) }, scrollBy: function (aK, s, aL) { R.scrollByX(aK, aL); R.scrollByY(s, aL) }, scrollByX: function (s, aL) { var aK = aE() + s, aM = aK / (U - al); X(aM * k, aL) }, scrollByY: function (s, aL) { var aK = aC() + s, aM = aK / (aa - w); W(aM * j, aL) }, positionDragX: function (s, aK) { X(s, aK) }, positionDragY: function (aK, s) { X(aK, s) }, animate: function (aK, aN, s, aM) { var aL = {}; aL[aN] = s; aK.animate(aL, { duration: aA.animateDuration, ease: aA.animateEase, queue: false, step: aM }) }, getContentPositionX: function () { return aE() }, getContentPositionY: function () { return aC() }, getContentWidth: function () { return U }, getContentHeight: function () { return aa }, getPercentScrolledX: function () { return aE() / (U - al) }, getPercentScrolledY: function () { return aC() / (aa - w) }, getIsScrollableH: function () { return aG }, getIsScrollableV: function () { return aB }, getContentPane: function () { return Z }, scrollToBottom: function (s) { W(j, s) }, hijackInternalLinks: function () { n() }, destroy: function () { h() } }); au(P)
        } f = b.extend({}, b.fn.jScrollPane.defaults, f); b.each(["mouseWheelSpeed", "arrowButtonSpeed", "trackClickSpeed", "keyboardSpeed"], function () { f[this] = f[this] || f.speed }); var e; this.each(function () { var g = b(this), h = g.data("jsp"); if (h) { h.reinitialise(f) } else { h = new d(g, f); g.data("jsp", h) } e = e ? e.add(g) : g }); return e
    }; b.fn.jScrollPane.defaults = { showArrows: false, maintainPosition: true, stickToBottom: false, stickToRight: false, clickOnTrack: true, autoReinitialise: false, autoReinitialiseDelay: 500, verticalDragMinHeight: 0, verticalDragMaxHeight: 99999, horizontalDragMinWidth: 0, horizontalDragMaxWidth: 99999, contentWidth: c, animateScroll: false, animateDuration: 300, animateEase: "linear", hijackInternalLinks: false, verticalGutter: 4, horizontalGutter: 4, mouseWheelSpeed: 0, arrowButtonSpeed: 0, arrowRepeatFreq: 50, arrowScrollOnHover: false, trackClickSpeed: 0, trackClickRepeatFreq: 70, verticalArrowPositions: "split", horizontalArrowPositions: "split", enableKeyboardNavigation: true, hideFocus: false, keyboardSpeed: 0, initialDelay: 300, speed: 30, scrollPagePercent: 0.8}
})(jQuery, this);


/**
 * Pulled from: jquery.scrollto.min.js
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/9/2009
 * @author Ariel Flesler
 * @version 1.4.1
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */

; (function ($) { var m = $.scrollTo = function (b, h, f) { $(window).scrollTo(b, h, f) }; m.defaults = { axis: 'xy', duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1 }; m.window = function (b) { return $(window).scrollable() }; $.fn.scrollable = function () { return this.map(function () { var b = this, h = !b.nodeName || $.inArray(b.nodeName.toLowerCase(), ['iframe', '#document', 'html', 'body']) != -1; if (!h) return b; var f = (b.contentWindow || b).document || b.ownerDocument || b; return $.browser.safari || f.compatMode == 'BackCompat' ? f.body : f.documentElement }) }; $.fn.scrollTo = function (l, j, a) { if (typeof j == 'object') { a = j; j = 0 } if (typeof a == 'function') a = { onAfter: a }; if (l == 'max') l = 9e9; a = $.extend({}, m.defaults, a); j = j || a.speed || a.duration; a.queue = a.queue && a.axis.length > 1; if (a.queue) j /= 2; a.offset = n(a.offset); a.over = n(a.over); return this.scrollable().each(function () { var k = this, o = $(k), d = l, p, g = {}, q = o.is('html,body'); switch (typeof d) { case 'number': case 'string': if (/^([+-]=)?\d+(\.\d+)?(px)?$/.test(d)) { d = n(d); break } d = $(d, this); case 'object': if (d.is || d.style) p = (d = $(d)).offset() } $.each(a.axis.split(''), function (b, h) { var f = h == 'x' ? 'Left' : 'Top', i = f.toLowerCase(), c = 'scroll' + f, r = k[c], s = h == 'x' ? 'Width' : 'Height'; if (p) { g[c] = p[i] + (q ? 0 : r - o.offset()[i]); if (a.margin) { g[c] -= parseInt(d.css('margin' + f)) || 0; g[c] -= parseInt(d.css('border' + f + 'Width')) || 0 } g[c] += a.offset[i] || 0; if (a.over[i]) g[c] += d[s.toLowerCase()]() * a.over[i] } else g[c] = d[i]; if (/^\d+$/.test(g[c])) g[c] = g[c] <= 0 ? 0 : Math.min(g[c], u(s)); if (!b && a.queue) { if (r != g[c]) t(a.onAfterFirst); delete g[c] } }); t(a.onAfter); function t(b) { o.animate(g, j, a.easing, b && function () { b.call(this, l, a) }) }; function u(b) { var h = 'scroll' + b; if (!q) return k[h]; var f = 'client' + b, i = k.ownerDocument.documentElement, c = k.ownerDocument.body; return Math.max(i[h], c[h]) - Math.min(i[f], c[f]) } }).end() }; function n(b) { return typeof b == 'object' ? b : { top: b, left: b} } })(jQuery);


/* Pulled From jquery.timers.js
 * JQuery Timer Plugin to simplify the setTimeout and setInterval features of Javascript 
 */

jQuery.fn.extend({
    everyTime: function (interval, label, fn, times, belay) {
        return this.each(function () {
            jQuery.timer.add(this, interval, label, fn, times, belay);
        });
    },
    oneTime: function (interval, label, fn) {
        return this.each(function () {
            jQuery.timer.add(this, interval, label, fn, 1);
        });
    },
    stopTime: function (label, fn) {
        return this.each(function () {
            jQuery.timer.remove(this, label, fn);
        });
    }
});

jQuery.extend({
    timer: {
        guid: 1,
        global: {},
        regex: /^([0-9]+)\s*(.*s)?$/,
        powers: {
            // Yeah this is major overkill...
            'ms': 1,
            'cs': 10,
            'ds': 100,
            's': 1000,
            'das': 10000,
            'hs': 100000,
            'ks': 1000000
        },
        timeParse: function (value) {
            if (value == undefined || value == null)
                return null;
            var result = this.regex.exec(jQuery.trim(value.toString()));
            if (result[2]) {
                var num = parseInt(result[1], 10);
                var mult = this.powers[result[2]] || 1;
                return num * mult;
            } else {
                return value;
            }
        },
        add: function (element, interval, label, fn, times, belay) {
            var counter = 0;

            if (jQuery.isFunction(label)) {
                if (!times)
                    times = fn;
                fn = label;
                label = interval;
            }

            interval = jQuery.timer.timeParse(interval);

            if (typeof interval != 'number' || isNaN(interval) || interval <= 0)
                return;

            if (times && times.constructor != Number) {
                belay = !!times;
                times = 0;
            }

            times = times || 0;
            belay = belay || false;

            if (!element.$timers)
                element.$timers = {};

            if (!element.$timers[label])
                element.$timers[label] = {};

            fn.$timerID = fn.$timerID || this.guid++;

            var handler = function () {
                if (belay && this.inProgress)
                    return;
                this.inProgress = true;
                if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
                    jQuery.timer.remove(element, label, fn);
                this.inProgress = false;
            };

            handler.$timerID = fn.$timerID;

            if (!element.$timers[label][fn.$timerID])
                element.$timers[label][fn.$timerID] = window.setInterval(handler, interval);

            if (!this.global[label])
                this.global[label] = [];
            this.global[label].push(element);

        },
        remove: function (element, label, fn) {
            var timers = element.$timers, ret;

            if (timers) {

                if (!label) {
                    for (label in timers)
                        this.remove(element, label, fn);
                } else if (timers[label]) {
                    if (fn) {
                        if (fn.$timerID) {
                            window.clearInterval(timers[label][fn.$timerID]);
                            delete timers[label][fn.$timerID];
                        }
                    } else {
                        for (var fn in timers[label]) {
                            window.clearInterval(timers[label][fn]);
                            delete timers[label][fn];
                        }
                    }

                    for (ret in timers[label]) break;
                    if (!ret) {
                        ret = null;
                        delete timers[label];
                    }
                }

                for (ret in timers) break;
                if (!ret)
                    element.$timers = null;
            }
        }
    }
});

if (jQuery.browser.msie)
    jQuery(window).one("unload", function () {
        var global = jQuery.timer.global;
        for (var label in global) {
            var els = global[label], i = els.length;
            while (--i)
                jQuery.timer.remove(els[i], label);
        }
    });


/*
    Pulled from: jquery.twitter.js
	jquery.twitter.js v1.5
	Last updated: 08 July 2009

	Created by Damien du Toit
	http://coda.co.za/blog/2008/10/26/jquery-plugin-for-twitter

	Licensed under a Creative Commons Attribution-Non-Commercial 3.0 Unported License
	http://creativecommons.org/licenses/by-nc/3.0/
*/
(function($) {

	$.fn.getTwitter = function(options) {

		$.fn.getTwitter.defaults = {
			userName: null,
			numTweets: 5,
			loaderText: "Loading tweets...",
			slideIn: true,
			slideDuration: 750,
			showHeading: true,
			headingText: "Latest Tweets",
			showProfileLink: true,
			showTimestamp: true
		};

		var o = $.extend({}, $.fn.getTwitter.defaults, options);

		return this.each(function() {
			var c = $(this);

			// hide container element, remove alternative content, and add class
			c.hide().empty().addClass("twitted");

			// add heading to container element
			if (o.showHeading) {
				c.append("<h2>"+o.headingText+"</h2>");
			}

			// add twitter list to container element
			var twitterListHTML = "<ul id=\"twitter_update_list\"><li></li></ul>";
			c.append(twitterListHTML);

			var tl = $("#twitter_update_list");

			// hide twitter list
			tl.hide();

			// add preLoader to container element
			var preLoaderHTML = $("<p class=\"preLoader\">"+o.loaderText+"</p>");
			c.append(preLoaderHTML);

			// add Twitter profile link to container element
			if (o.showProfileLink) {
				var profileLinkHTML = "<p class=\"profileLink\"><a href=\"http://twitter.com/"+o.userName+"\">http://twitter.com/"+o.userName+"</a></p>";
				c.append(profileLinkHTML);
			}

			// show container element
			c.show();

			$.getScript("http://twitter.com/javascripts/blogger.js");
			$.getScript("http://twitter.com/statuses/user_timeline/"+o.userName+".json?callback=twitterCallback2&count="+o.numTweets, function() {
				// remove preLoader from container element
				$(preLoaderHTML).remove();

				// remove timestamp and move to title of list item
				if (!o.showTimestamp) {
					tl.find("li").each(function() {
						var timestampHTML = $(this).children("a");
						var timestamp = timestampHTML.html();
						timestampHTML.remove();
						$(this).attr("title", timestamp);
					});
				}

				// show twitter list
				if (o.slideIn) {
					// a fix for the jQuery slide effect
					// Hat-tip: http://blog.pengoworks.com/index.cfm/2009/4/21/Fixing-jQuerys-slideDown-effect-ie-Jumpy-Animation
					var tlHeight = tl.data("originalHeight");

					// get the original height
					if (!tlHeight) {
						tlHeight = tl.show().height();
						tl.data("originalHeight", tlHeight);
						tl.hide().css({height: 0});
					}

					tl.show().animate({height: tlHeight}, o.slideDuration);
				}
				else {
					tl.show();
				}

				// add unique class to first list item
				tl.find("li:first").addClass("firstTweet");

				// add unique class to last list item
				tl.find("li:last").addClass("lastTweet");
			});
		});
	};
})(jQuery);
