﻿/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: http://fancybox.net
* 
* Copyright (c) 2008 - 2010 Janis Skarnelis
*
* Version: 1.3.1 (05/03/2010)
* Requires: jQuery v1.3+
*
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*/

(function ($) {

    var tmp, loading, overlay, wrap, outer, inner, close, nav_left, nav_right,

		selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],

		ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,

		loadingTimer, loadingFrame = 1,

		start_pos, final_pos, busy = false, shadow = 20, fx = $.extend($('<div/>')[0], { prop: 0 }), titleh = 0,

		isIE6 = !$.support.opacity && !window.XMLHttpRequest,

    /*
    * Private methods 
    */

		fancybox_abort = function () {
		    loading.hide();

		    imgPreloader.onerror = imgPreloader.onload = null;

		    if (ajaxLoader) {
		        ajaxLoader.abort();
		    }

		    tmp.empty();
		},

		fancybox_error = function () {
		    $.fancybox('<p id="fancybox_error">The requested content cannot be loaded.<br />Please try again later.</p>', {
		        'scrolling': 'no',
		        'padding': 20,
		        'transitionIn': 'none',
		        'transitionOut': 'none'
		    });
		},

		fancybox_get_viewport = function () {
		    return [$(window).width(), $(window).height(), $(document).scrollLeft(), $(document).scrollTop()];
		},

		fancybox_get_zoom_to = function () {
		    var view = fancybox_get_viewport(),
				to = {},

				margin = currentOpts.margin,
				resize = currentOpts.autoScale,

				horizontal_space = (shadow + margin) * 2,
				vertical_space = (shadow + margin) * 2,
				double_padding = (currentOpts.padding * 2),

				ratio;

		    if (currentOpts.width.toString().indexOf('%') > -1) {
		        to.width = ((view[0] * parseFloat(currentOpts.width)) / 100) - (shadow * 2);
		        resize = false;

		    } else {
		        to.width = currentOpts.width + double_padding;
		    }

		    if (currentOpts.height.toString().indexOf('%') > -1) {
		        to.height = ((view[1] * parseFloat(currentOpts.height)) / 100) - (shadow * 2);
		        resize = false;

		    } else {
		        to.height = currentOpts.height + double_padding;
		    }

		    if (resize && (to.width > (view[0] - horizontal_space) || to.height > (view[1] - vertical_space))) {
		        if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
		            horizontal_space += double_padding;
		            vertical_space += double_padding;

		            ratio = Math.min(Math.min(view[0] - horizontal_space, currentOpts.width) / currentOpts.width, Math.min(view[1] - vertical_space, currentOpts.height) / currentOpts.height);

		            to.width = Math.round(ratio * (to.width - double_padding)) + double_padding;
		            to.height = Math.round(ratio * (to.height - double_padding)) + double_padding;

		        } else {
		            to.width = Math.min(to.width, (view[0] - horizontal_space));
		            to.height = Math.min(to.height, (view[1] - vertical_space));
		        }
		    }

		    to.top = view[3] + ((view[1] - (to.height + (shadow * 2))) * 0.5);
		    to.left = view[2] + ((view[0] - (to.width + (shadow * 2))) * 0.5);

		    if (currentOpts.autoScale === false) {
		        to.top = Math.max(view[3] + margin, to.top);
		        to.left = Math.max(view[2] + margin, to.left);
		    }

		    return to;
		},

		fancybox_format_title = function (title) {
		    if (title && title.length) {
		        switch (currentOpts.titlePosition) {
		            case 'inside':
		                return title;
		            case 'over':
		                return '<span id="fancybox-title-over">' + title + '</span>';
		            default:
		                return '<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">' + title + '</span><span id="fancybox-title-right"></span></span>';
		        }
		    }

		    return false;
		},

		fancybox_process_title = function () {
		    var title = currentOpts.title,
				width = final_pos.width - (currentOpts.padding * 2),
				titlec = 'fancybox-title-' + currentOpts.titlePosition;

		    $('#fancybox-title').remove();

		    titleh = 0;

		    if (currentOpts.titleShow === false) {
		        return;
		    }

		    title = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(title, currentArray, currentIndex, currentOpts) : fancybox_format_title(title);

		    if (!title || title === '') {
		        return;
		    }

		    $('<div id="fancybox-title" class="' + titlec + '" />').css({
		        'width': width,
		        'paddingLeft': currentOpts.padding,
		        'paddingRight': currentOpts.padding
		    }).html(title).appendTo('body');

		    switch (currentOpts.titlePosition) {
		        case 'inside':
		            titleh = $("#fancybox-title").outerHeight(true) - currentOpts.padding;
		            final_pos.height += titleh;
		            break;

		        case 'over':
		            $('#fancybox-title').css('bottom', currentOpts.padding);
		            break;

		        default:
		            $('#fancybox-title').css('bottom', $("#fancybox-title").outerHeight(true) * -1);
		            break;
		    }

		    $('#fancybox-title').appendTo(outer).hide();
		},

		fancybox_set_navigation = function () {
		    $(document).unbind('keydown.fb').bind('keydown.fb', function (e) {
		        if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
		            e.preventDefault();
		            $.fancybox.close();

		        } else if (e.keyCode == 37) {
		            e.preventDefault();
		            $.fancybox.prev();

		        } else if (e.keyCode == 39) {
		            e.preventDefault();
		            $.fancybox.next();
		        }
		    });

		    if ($.fn.mousewheel) {
		        wrap.unbind('mousewheel.fb');

		        if (currentArray.length > 1) {
		            wrap.bind('mousewheel.fb', function (e, delta) {
		                e.preventDefault();

		                if (busy || delta === 0) {
		                    return;
		                }

		                if (delta > 0) {
		                    $.fancybox.prev();
		                } else {
		                    $.fancybox.next();
		                }
		            });
		        }
		    }

		    if (!currentOpts.showNavArrows) { return; }

		    if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
		        nav_left.show();
		    }

		    if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length - 1)) {
		        nav_right.show();
		    }
		},

		fancybox_preload_images = function () {
		    var href,
				objNext;

		    if ((currentArray.length - 1) > currentIndex) {
		        href = currentArray[currentIndex + 1].href;

		        if (typeof href !== 'undefined' && href.match(imgRegExp)) {
		            objNext = new Image();
		            objNext.src = href;
		        }
		    }

		    if (currentIndex > 0) {
		        href = currentArray[currentIndex - 1].href;

		        if (typeof href !== 'undefined' && href.match(imgRegExp)) {
		            objNext = new Image();
		            objNext.src = href;
		        }
		    }
		},

		_finish = function () {
		    inner.css('overflow', (currentOpts.scrolling == 'auto' ? (currentOpts.type == 'image' || currentOpts.type == 'iframe' || currentOpts.type == 'swf' ? 'hidden' : 'auto') : (currentOpts.scrolling == 'yes' ? 'auto' : 'visible')));

		    if (!$.support.opacity) {
		        inner.get(0).style.removeAttribute('filter');
		        wrap.get(0).style.removeAttribute('filter');
		    }

		    $('#fancybox-title').show();

		    if (currentOpts.hideOnContentClick) {
		        inner.one('click', $.fancybox.close);
		    }
		    if (currentOpts.hideOnOverlayClick) {
		        overlay.one('click', $.fancybox.close);
		    }

		    if (currentOpts.showCloseButton) {
		        close.show();
		    }

		    fancybox_set_navigation();

		    $(window).bind("resize.fb", $.fancybox.center);

		    if (currentOpts.centerOnScroll) {
		        $(window).bind("scroll.fb", $.fancybox.center);
		    } else {
		        $(window).unbind("scroll.fb");
		    }

		    if ($.isFunction(currentOpts.onComplete)) {
		        currentOpts.onComplete(currentArray, currentIndex, currentOpts);
		    }

		    busy = false;

		    fancybox_preload_images();
		},

		fancybox_draw = function (pos) {
		    var width = Math.round(start_pos.width + (final_pos.width - start_pos.width) * pos),
				height = Math.round(start_pos.height + (final_pos.height - start_pos.height) * pos),

				top = Math.round(start_pos.top + (final_pos.top - start_pos.top) * pos),
				left = Math.round(start_pos.left + (final_pos.left - start_pos.left) * pos);

		    wrap.css({
		        'width': width + 'px',
		        'height': height + 'px',
		        'top': top + 'px',
		        'left': left + 'px'
		    });

		    width = Math.max(width - currentOpts.padding * 2, 0);
		    height = Math.max(height - (currentOpts.padding * 2 + (titleh * pos)), 0);

		    inner.css({
		        'width': width + 'px',
		        'height': height + 'px'
		    });

		    if (typeof final_pos.opacity !== 'undefined') {
		        wrap.css('opacity', (pos < 0.5 ? 0.5 : pos));
		    }
		},

		fancybox_get_obj_pos = function (obj) {
		    var pos = obj.offset();

		    pos.top += parseFloat(obj.css('paddingTop')) || 0;
		    pos.left += parseFloat(obj.css('paddingLeft')) || 0;

		    pos.top += parseFloat(obj.css('border-top-width')) || 0;
		    pos.left += parseFloat(obj.css('border-left-width')) || 0;

		    pos.width = obj.width();
		    pos.height = obj.height();

		    return pos;
		},

		fancybox_get_zoom_from = function () {
		    var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
				from = {},
				pos,
				view;

		    if (orig && orig.length) {
		        pos = fancybox_get_obj_pos(orig);

		        from = {
		            width: (pos.width + (currentOpts.padding * 2)),
		            height: (pos.height + (currentOpts.padding * 2)),
		            top: (pos.top - currentOpts.padding - shadow),
		            left: (pos.left - currentOpts.padding - shadow)
		        };

		    } else {
		        view = fancybox_get_viewport();

		        from = {
		            width: 1,
		            height: 1,
		            top: view[3] + view[1] * 0.5,
		            left: view[2] + view[0] * 0.5
		        };
		    }

		    return from;
		},

		fancybox_show = function () {
		    loading.hide();

		    if (wrap.is(":visible") && $.isFunction(currentOpts.onCleanup)) {
		        if (currentOpts.onCleanup(currentArray, currentIndex, currentOpts) === false) {
		            $.event.trigger('fancybox-cancel');

		            busy = false;
		            return;
		        }
		    }

		    currentArray = selectedArray;
		    currentIndex = selectedIndex;
		    currentOpts = selectedOpts;

		    inner.get(0).scrollTop = 0;
		    inner.get(0).scrollLeft = 0;

		    if (currentOpts.overlayShow) {
		        if (isIE6) {
		            $('select:not(#fancybox-tmp select)').filter(function () {
		                return this.style.visibility !== 'hidden';
		            }).css({ 'visibility': 'hidden' }).one('fancybox-cleanup', function () {
		                this.style.visibility = 'inherit';
		            });
		        }

		        overlay.css({
		            'background-color': currentOpts.overlayColor,
		            'opacity': currentOpts.overlayOpacity
		        }).unbind().show();
		    }

		    final_pos = fancybox_get_zoom_to();

		    fancybox_process_title();

		    if (wrap.is(":visible")) {
		        $(close.add(nav_left).add(nav_right)).hide();

		        var pos = wrap.position(),
					equal;

		        start_pos = {
		            top: pos.top,
		            left: pos.left,
		            width: wrap.width(),
		            height: wrap.height()
		        };

		        equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);

		        inner.fadeOut(currentOpts.changeFade, function () {
		            var finish_resizing = function () {
		                inner.html(tmp.contents()).fadeIn(currentOpts.changeFade, _finish);
		            };

		            $.event.trigger('fancybox-change');

		            inner.empty().css('overflow', 'hidden');

		            if (equal) {
		                inner.css({
		                    top: currentOpts.padding,
		                    left: currentOpts.padding,
		                    width: Math.max(final_pos.width - (currentOpts.padding * 2), 1),
		                    height: Math.max(final_pos.height - (currentOpts.padding * 2) - titleh, 1)
		                });

		                finish_resizing();

		            } else {
		                inner.css({
		                    top: currentOpts.padding,
		                    left: currentOpts.padding,
		                    width: Math.max(start_pos.width - (currentOpts.padding * 2), 1),
		                    height: Math.max(start_pos.height - (currentOpts.padding * 2), 1)
		                });

		                fx.prop = 0;

		                $(fx).animate({ prop: 1 }, {
		                    duration: currentOpts.changeSpeed,
		                    easing: currentOpts.easingChange,
		                    step: fancybox_draw,
		                    complete: finish_resizing
		                });
		            }
		        });

		        return;
		    }

		    wrap.css('opacity', 1);

		    if (currentOpts.transitionIn == 'elastic') {
		        start_pos = fancybox_get_zoom_from();

		        inner.css({
		            top: currentOpts.padding,
		            left: currentOpts.padding,
		            width: Math.max(start_pos.width - (currentOpts.padding * 2), 1),
		            height: Math.max(start_pos.height - (currentOpts.padding * 2), 1)
		        })
					.html(tmp.contents());

		        wrap.css(start_pos).show();

		        if (currentOpts.opacity) {
		            final_pos.opacity = 0;
		        }

		        fx.prop = 0;

		        $(fx).animate({ prop: 1 }, {
		            duration: currentOpts.speedIn,
		            easing: currentOpts.easingIn,
		            step: fancybox_draw,
		            complete: _finish
		        });

		    } else {
		        inner.css({
		            top: currentOpts.padding,
		            left: currentOpts.padding,
		            width: Math.max(final_pos.width - (currentOpts.padding * 2), 1),
		            height: Math.max(final_pos.height - (currentOpts.padding * 2) - titleh, 1)
		        })
					.html(tmp.contents());

		        wrap.css(final_pos).fadeIn(currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish);
		    }
		},

		fancybox_process_inline = function () {
		    tmp.width(selectedOpts.width);
		    tmp.height(selectedOpts.height);

		    if (selectedOpts.width == 'auto') {
		        selectedOpts.width = tmp.width();
		    }
		    if (selectedOpts.height == 'auto') {
		        selectedOpts.height = tmp.height();
		    }

		    fancybox_show();
		},

		fancybox_process_image = function () {
		    busy = true;

		    selectedOpts.width = imgPreloader.width;
		    selectedOpts.height = imgPreloader.height;

		    $("<img />").attr({
		        'id': 'fancybox-img',
		        'src': imgPreloader.src,
		        'alt': selectedOpts.title
		    }).appendTo(tmp);

		    fancybox_show();
		},

		fancybox_start = function () {
		    fancybox_abort();

		    var obj = selectedArray[selectedIndex],
				href,
				type,
				title,
				str,
				emb,
				selector,
				data;

		    selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
		    title = obj.title || $(obj).title || selectedOpts.title || '';

		    if (obj.nodeName && !selectedOpts.orig) {
		        selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
		    }

		    if (title === '' && selectedOpts.orig) {
		        title = selectedOpts.orig.attr('alt');
		    }

		    if (obj.nodeName && (/^(?:javascript|#)/i).test(obj.href)) {
		        href = selectedOpts.href || null;
		    } else {
		        href = selectedOpts.href || obj.href || null;
		    }

		    if (selectedOpts.type) {
		        type = selectedOpts.type;

		        if (!href) {
		            href = selectedOpts.content;
		        }

		    } else if (selectedOpts.content) {
		        type = 'html';

		    } else if (href) {
		        if (href.match(imgRegExp)) {
		            type = 'image';

		        } else if (href.match(swfRegExp)) {
		            type = 'swf';

		        } else if ($(obj).hasClass("iframe")) {
		            type = 'iframe';

		        } else if (href.match(/#/)) {
		            obj = href.substr(href.indexOf("#"));

		            type = $(obj).length > 0 ? 'inline' : 'ajax';
		        } else {
		            type = 'ajax';
		        }
		    } else {
		        type = 'inline';
		    }

		    selectedOpts.type = type;
		    selectedOpts.href = href;
		    selectedOpts.title = title;

		    if (selectedOpts.autoDimensions && selectedOpts.type !== 'iframe' && selectedOpts.type !== 'swf') {
		        selectedOpts.width = 'auto';
		        selectedOpts.height = 'auto';
		    }

		    if (selectedOpts.modal) {
		        selectedOpts.overlayShow = true;
		        selectedOpts.hideOnOverlayClick = false;
		        selectedOpts.hideOnContentClick = false;
		        selectedOpts.enableEscapeButton = false;
		        selectedOpts.showCloseButton = false;
		    }

		    if ($.isFunction(selectedOpts.onStart)) {
		        if (selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts) === false) {
		            busy = false;
		            return;
		        }
		    }

		    tmp.css('padding', (shadow + selectedOpts.padding + selectedOpts.margin));

		    $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function () {
		        $(this).replaceWith(inner.children());
		    });

		    switch (type) {
		        case 'html':
		            tmp.html(selectedOpts.content);
		            fancybox_process_inline();
		            break;

		        case 'inline':
		            $('<div class="fancybox-inline-tmp" />').hide().insertBefore($(obj)).bind('fancybox-cleanup', function () {
		                $(this).replaceWith(inner.children());
		            }).bind('fancybox-cancel', function () {
		                $(this).replaceWith(tmp.children());
		            });

		            $(obj).appendTo(tmp);

		            fancybox_process_inline();
		            break;

		        case 'image':
		            busy = false;

		            $.fancybox.showActivity();

		            imgPreloader = new Image();

		            imgPreloader.onerror = function () {
		                fancybox_error();
		            };

		            imgPreloader.onload = function () {
		                imgPreloader.onerror = null;
		                imgPreloader.onload = null;
		                fancybox_process_image();
		            };

		            imgPreloader.src = href;

		            break;

		        case 'swf':
		            str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
		            emb = '';

		            $.each(selectedOpts.swf, function (name, val) {
		                str += '<param name="' + name + '" value="' + val + '"></param>';
		                emb += ' ' + name + '="' + val + '"';
		            });

		            str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';

		            tmp.html(str);

		            fancybox_process_inline();
		            break;

		        case 'ajax':
		            selector = href.split('#', 2);
		            data = selectedOpts.ajax.data || {};

		            if (selector.length > 1) {
		                href = selector[0];

		                if (typeof data == "string") {
		                    data += '&selector=' + selector[1];
		                } else {
		                    data.selector = selector[1];
		                }
		            }

		            busy = false;
		            $.fancybox.showActivity();

		            ajaxLoader = $.ajax($.extend(selectedOpts.ajax, {
		                url: href,
		                data: data,
		                error: fancybox_error,
		                success: function (data, textStatus, XMLHttpRequest) {
		                    if (ajaxLoader.status == 200) {
		                        tmp.html(data);
		                        fancybox_process_inline();
		                    }
		                }
		            }));

		            break;

		        case 'iframe':
		            $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" scrolling="' + selectedOpts.scrolling + '" src="' + selectedOpts.href + '"></iframe>').appendTo(tmp);
		            fancybox_show();
		            break;
		    }
		},

		fancybox_animate_loading = function () {
		    if (!loading.is(':visible')) {
		        clearInterval(loadingTimer);
		        return;
		    }

		    $('div', loading).css('top', (loadingFrame * -40) + 'px');

		    loadingFrame = (loadingFrame + 1) % 12;
		},

		fancybox_init = function () {
		    if ($("#fancybox-wrap").length) {
		        return;
		    }

		    $('body').append(
				tmp = $('<div id="fancybox-tmp"></div>'),
				loading = $('<div id="fancybox-loading"><div></div></div>'),
				overlay = $('<div id="fancybox-overlay"></div>'),
				wrap = $('<div id="fancybox-wrap"></div>')
			);

		    if (!$.support.opacity) {
		        wrap.addClass('fancybox-ie');
		        loading.addClass('fancybox-ie');
		    }

		    outer = $('<div id="fancybox-outer"></div>')
				.append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>')
				.appendTo(wrap);

		    outer.append(
				inner = $('<div id="fancybox-inner"></div>'),
				close = $('<a id="fancybox-close"></a>'),

				nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
				nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
			);

		    close.click($.fancybox.close);
		    loading.click($.fancybox.cancel);

		    nav_left.click(function (e) {
		        e.preventDefault();
		        $.fancybox.prev();
		    });

		    nav_right.click(function (e) {
		        e.preventDefault();
		        $.fancybox.next();
		    });

		    if (isIE6) {
		        overlay.get(0).style.setExpression('height', "document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");
		        loading.get(0).style.setExpression('top', "(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");

		        outer.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>');
		    }
		};

    /*
    * Public methods 
    */

    $.fn.fancybox = function (options) {
        $(this)
			.data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
			.unbind('click.fb').bind('click.fb', function (e) {
			    e.preventDefault();

			    if (busy) {
			        return;
			    }

			    busy = true;

			    $(this).blur();

			    selectedArray = [];
			    selectedIndex = 0;

			    var rel = $(this).attr('rel') || '';

			    if (!rel || rel == '' || rel === 'nofollow') {
			        selectedArray.push(this);

			    } else {
			        selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
			        selectedIndex = selectedArray.index(this);
			    }

			    fancybox_start();

			    return false;
			});

        return this;
    };

    $.fancybox = function (obj) {
        if (busy) {
            return;
        }

        busy = true;

        var opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};

        selectedArray = [];
        selectedIndex = opts.index || 0;

        if ($.isArray(obj)) {
            for (var i = 0, j = obj.length; i < j; i++) {
                if (typeof obj[i] == 'object') {
                    $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
                } else {
                    obj[i] = $({}).data('fancybox', $.extend({ content: obj[i] }, opts));
                }
            }

            selectedArray = jQuery.merge(selectedArray, obj);

        } else {
            if (typeof obj == 'object') {
                $(obj).data('fancybox', $.extend({}, opts, obj));
            } else {
                obj = $({}).data('fancybox', $.extend({ content: obj }, opts));
            }

            selectedArray.push(obj);
        }

        if (selectedIndex > selectedArray.length || selectedIndex < 0) {
            selectedIndex = 0;
        }

        fancybox_start();
    };

    $.fancybox.showActivity = function () {
        clearInterval(loadingTimer);

        loading.show();
        loadingTimer = setInterval(fancybox_animate_loading, 66);
    };

    $.fancybox.hideActivity = function () {
        loading.hide();
    };

    $.fancybox.next = function () {
        return $.fancybox.pos(currentIndex + 1);
    };

    $.fancybox.prev = function () {
        return $.fancybox.pos(currentIndex - 1);
    };

    $.fancybox.pos = function (pos) {
        if (busy) {
            return;
        }

        pos = parseInt(pos, 10);

        if (pos > -1 && currentArray.length > pos) {
            selectedIndex = pos;
            fancybox_start();
        }

        if (currentOpts.cyclic && currentArray.length > 1 && pos < 0) {
            selectedIndex = currentArray.length - 1;
            fancybox_start();
        }

        if (currentOpts.cyclic && currentArray.length > 1 && pos >= currentArray.length) {
            selectedIndex = 0;
            fancybox_start();
        }

        return;
    };

    $.fancybox.cancel = function () {
        if (busy) {
            return;
        }

        busy = true;

        $.event.trigger('fancybox-cancel');

        fancybox_abort();

        if (selectedOpts && $.isFunction(selectedOpts.onCancel)) {
            selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
        }

        busy = false;
    };

    // Note: within an iframe use - parent.$.fancybox.close();
    $.fancybox.close = function () {
        if (busy || wrap.is(':hidden')) {
            return;
        }

        busy = true;

        if (currentOpts && $.isFunction(currentOpts.onCleanup)) {
            if (currentOpts.onCleanup(currentArray, currentIndex, currentOpts) === false) {
                busy = false;
                return;
            }
        }

        fancybox_abort();

        $(close.add(nav_left).add(nav_right)).hide();

        $('#fancybox-title').remove();

        wrap.add(inner).add(overlay).unbind();

        $(window).unbind("resize.fb scroll.fb");
        $(document).unbind('keydown.fb');

        function _cleanup() {
            overlay.fadeOut('fast');

            wrap.hide();

            $.event.trigger('fancybox-cleanup');

            inner.empty();

            if ($.isFunction(currentOpts.onClosed)) {
                currentOpts.onClosed(currentArray, currentIndex, currentOpts);
            }

            currentArray = selectedOpts = [];
            currentIndex = selectedIndex = 0;
            currentOpts = selectedOpts = {};

            busy = false;
        }

        inner.css('overflow', 'hidden');

        if (currentOpts.transitionOut == 'elastic') {
            start_pos = fancybox_get_zoom_from();

            var pos = wrap.position();

            final_pos = {
                top: pos.top,
                left: pos.left,
                width: wrap.width(),
                height: wrap.height()
            };

            if (currentOpts.opacity) {
                final_pos.opacity = 1;
            }

            fx.prop = 1;

            $(fx).animate({ prop: 0 }, {
                duration: currentOpts.speedOut,
                easing: currentOpts.easingOut,
                step: fancybox_draw,
                complete: _cleanup
            });

        } else {
            wrap.fadeOut(currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
        }
    };

    $.fancybox.resize = function () {
        var c, h;

        if (busy || wrap.is(':hidden')) {
            return;
        }

        busy = true;

        c = inner.wrapInner("<div style='overflow:auto'></div>").children();
        h = c.height();

        wrap.css({ height: h + (currentOpts.padding * 2) + titleh });
        inner.css({ height: h });

        c.replaceWith(c.children());

        $.fancybox.center();
    };

    $.fancybox.center = function () {
        busy = true;

        var view = fancybox_get_viewport(),
			margin = currentOpts.margin,
			to = {};

        to.top = view[3] + ((view[1] - ((wrap.height() - titleh) + (shadow * 2))) * 0.5);
        to.left = view[2] + ((view[0] - (wrap.width() + (shadow * 2))) * 0.5);

        to.top = Math.max(view[3] + margin, to.top);
        to.left = Math.max(view[2] + margin, to.left);

        wrap.css(to);

        busy = false;
    };

    $.fn.fancybox.defaults = {
        padding: 10,
        margin: 20,
        opacity: false,
        modal: false,
        cyclic: false,
        scrolling: 'auto', // 'auto', 'yes' or 'no'

        width: 560,
        height: 340,

        autoScale: true,
        autoDimensions: true,
        centerOnScroll: false,

        ajax: {},
        swf: { wmode: 'transparent' },

        hideOnOverlayClick: true,
        hideOnContentClick: false,

        overlayShow: true,
        overlayOpacity: 0.3,
        overlayColor: '#666',

        titleShow: true,
        titlePosition: 'outside', // 'outside', 'inside' or 'over'
        titleFormat: null,

        transitionIn: 'fade', // 'elastic', 'fade' or 'none'
        transitionOut: 'fade', // 'elastic', 'fade' or 'none'

        speedIn: 300,
        speedOut: 300,

        changeSpeed: 300,
        changeFade: 'fast',

        easingIn: 'swing',
        easingOut: 'swing',

        showCloseButton: true,
        showNavArrows: true,
        enableEscapeButton: true,

        onStart: null,
        onCancel: null,
        onComplete: null,
        onCleanup: null,
        onClosed: null
    };

    $(document).ready(function () {
        fancybox_init();
    });

})(jQuery);
/**/
/*! Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
* 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.
*
* Version: 3.0.2
* 
* Requires: 1.2.2+
*/

(function (b) {
    function d(a) { var f = [].slice.call(arguments, 1), e = 0; a = b.event.fix(a || window.event); a.type = "mousewheel"; if (a.wheelDelta) e = a.wheelDelta / 120; if (a.detail) e = -a.detail / 3; f.unshift(a, e); return b.event.handle.apply(this, f) } var c = ["DOMMouseScroll", "mousewheel"]; b.event.special.mousewheel = { setup: function () { if (this.addEventListener) for (var a = c.length; a; ) this.addEventListener(c[--a], d, false); else this.onmousewheel = d }, teardown: function () {
        if (this.removeEventListener) for (var a = c.length; a; ) this.removeEventListener(c[--a],
d, false); else this.onmousewheel = null
    } 
    }; b.fn.extend({ mousewheel: function (a) { return a ? this.bind("mousewheel", a) : this.trigger("mousewheel") }, unmousewheel: function (a) { return this.unbind("mousewheel", a) } })
})(jQuery);
/**/
/* ------------------------------------------------------------------------
Class: prettyPhoto
Use: Lightbox clone for jQuery
Author: Stephane Caron (http://www.no-margin-for-errors.com)
Version: 3.1.2
------------------------------------------------------------------------- */

(function ($) {
    $.prettyPhoto = { version: '3.1.2' }; $.fn.prettyPhoto = function (pp_settings) {
        pp_settings = jQuery.extend({ animation_speed: 'fast', slideshow: 5000, autoplay_slideshow: false, opacity: 0.80, show_title: true, allow_resize: true, default_width: 500, default_height: 344, counter_separator_label: '/', theme: 'pp_default', horizontal_padding: 20, hideflash: false, wmode: 'opaque', autoplay: true, modal: false, deeplinking: true, overlay_gallery: true, keyboard_shortcuts: true, changepicturecallback: function () { }, callback: function () { }, ie6_fallback: true, markup: '<div class="pp_pic_holder"><div class="ppt">&nbsp;</div><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content_container"><div class="pp_left"><div class="pp_right"><div class="pp_content"><div class="pp_loaderIcon"></div><div class="pp_fade"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details"><div class="pp_nav"><a href="#" class="pp_arrow_previous">Previous</a><p class="currentTextHolder">0/0</p><a href="#" class="pp_arrow_next">Next</a></div><p class="pp_description"></p>{pp_social}<a class="pp_close" href="#">Close</a></div></div></div></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div><div class="pp_overlay"></div>', gallery_markup: '<div class="pp_gallery"><a href="#" class="pp_arrow_previous">Previous</a><div><ul>{gallery}</ul></div><a href="#" class="pp_arrow_next">Next</a></div>', image_markup: '<img id="fullResImage" src="{path}" />', flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>', quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>', iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>', inline_markup: '<div class="pp_inline">{content}</div>', custom_markup: '', social_tools: '<div class="pp_social"><div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href=' + location.href + '&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div></div>' }, pp_settings); var matchedObjects = this, percentBased = false, pp_dimensions, pp_open, pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth, windowHeight = $(window).height(), windowWidth = $(window).width(), pp_slideshow; doresize = true, scroll_pos = _get_scroll(); $(window).unbind('resize.prettyphoto').bind('resize.prettyphoto', function () { _center_overlay(); _resize_overlay(); }); if (pp_settings.keyboard_shortcuts) {
            $(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto', function (e) {
                if (typeof $pp_pic_holder != 'undefined') {
                    if ($pp_pic_holder.is(':visible')) {
                        switch (e.keyCode) {
                            case 37: $.prettyPhoto.changePage('previous'); e.preventDefault(); break; case 39: $.prettyPhoto.changePage('next'); e.preventDefault(); break; case 27: if (!settings.modal)
                                    $.prettyPhoto.close(); e.preventDefault(); break;
                        };
                    };
                };
            });
        }; $.prettyPhoto.initialize = function () {
            settings = pp_settings; if (settings.theme == 'pp_default') settings.horizontal_padding = 16; if (settings.ie6_fallback && $.browser.msie && parseInt($.browser.version) == 6) settings.theme = "light_square"; theRel = $(this).attr('rel'); galleryRegExp = /\[(?:.*)\]/; isSet = (galleryRegExp.exec(theRel)) ? true : false; pp_images = (isSet) ? jQuery.map(matchedObjects, function (n, i) { if ($(n).attr('rel').indexOf(theRel) != -1) return $(n).attr('href'); }) : $.makeArray($(this).attr('href')); pp_titles = (isSet) ? jQuery.map(matchedObjects, function (n, i) { if ($(n).attr('rel').indexOf(theRel) != -1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt') : ""; }) : $.makeArray($(this).find('img').attr('alt')); pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function (n, i) { if ($(n).attr('rel').indexOf(theRel) != -1) return ($(n).attr('title')) ? $(n).attr('title') : ""; }) : $.makeArray($(this).attr('title')); set_position = jQuery.inArray($(this).attr('href'), pp_images); rel_index = (isSet) ? set_position : $("a[rel^='" + theRel + "']").index($(this)); _build_overlay(this); if (settings.allow_resize)
                $(window).bind('scroll.prettyphoto', function () { _center_overlay(); }); $.prettyPhoto.open(); return false;
        }
        $.prettyPhoto.open = function (event) {
            if (typeof settings == "undefined") { settings = pp_settings; if ($.browser.msie && $.browser.version == 6) settings.theme = "light_square"; pp_images = $.makeArray(arguments[0]); pp_titles = (arguments[1]) ? $.makeArray(arguments[1]) : $.makeArray(""); pp_descriptions = (arguments[2]) ? $.makeArray(arguments[2]) : $.makeArray(""); isSet = (pp_images.length > 1) ? true : false; set_position = 0; _build_overlay(event.target); }
            if ($.browser.msie && $.browser.version == 6) $('select').css('visibility', 'hidden'); if (settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility', 'hidden'); _checkPosition($(pp_images).size()); $('.pp_loaderIcon').show(); if ($ppt.is(':hidden')) $ppt.css('opacity', 0).show(); $pp_overlay.show().fadeTo(settings.animation_speed, settings.opacity); $pp_pic_holder.find('.currentTextHolder').text((set_position + 1) + settings.counter_separator_label + $(pp_images).size()); if (pp_descriptions[set_position] != "") { $pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position])); } else { $pp_pic_holder.find('.pp_description').hide(); }
            movie_width = (parseFloat(getParam('width', pp_images[set_position]))) ? getParam('width', pp_images[set_position]) : settings.default_width.toString(); movie_height = (parseFloat(getParam('height', pp_images[set_position]))) ? getParam('height', pp_images[set_position]) : settings.default_height.toString(); percentBased = false; if (movie_height.indexOf('%') != -1) { movie_height = parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150); percentBased = true; }
            if (movie_width.indexOf('%') != -1) { movie_width = parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150); percentBased = true; }
            $pp_pic_holder.fadeIn(function () { (settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined") ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html('&nbsp;'); imgPreloader = ""; skipInjection = false; switch (_getFileType(pp_images[set_position])) { case 'image': imgPreloader = new Image(); nextImage = new Image(); if (isSet && set_position < $(pp_images).size() - 1) nextImage.src = pp_images[set_position + 1]; prevImage = new Image(); if (isSet && pp_images[set_position - 1]) prevImage.src = pp_images[set_position - 1]; $pp_pic_holder.find('#pp_full_res')[0].innerHTML = settings.image_markup.replace(/{path}/g, pp_images[set_position]); imgPreloader.onload = function () { pp_dimensions = _fitToViewport(imgPreloader.width, imgPreloader.height); _showContent(); }; imgPreloader.onerror = function () { alert('Image cannot be loaded. Make sure the path is correct and image exist.'); $.prettyPhoto.close(); }; imgPreloader.src = pp_images[set_position]; break; case 'youtube': pp_dimensions = _fitToViewport(movie_width, movie_height); movie = 'http://www.youtube.com/embed/' + getParam('v', pp_images[set_position]); (getParam('rel', pp_images[set_position])) ? movie += "?rel=" + getParam('rel', pp_images[set_position]) : movie += "?rel=1"; if (settings.autoplay) movie += "&autoplay=1"; toInject = settings.iframe_markup.replace(/{width}/g, pp_dimensions['width']).replace(/{height}/g, pp_dimensions['height']).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, movie); break; case 'vimeo': pp_dimensions = _fitToViewport(movie_width, movie_height); movie_id = pp_images[set_position]; var regExp = /http:\/\/(www\.)?vimeo.com\/(\d+)/; var match = movie_id.match(regExp); movie = 'http://player.vimeo.com/video/' + match[2] + '?title=0&amp;byline=0&amp;portrait=0'; if (settings.autoplay) movie += "&autoplay=1;"; vimeo_width = pp_dimensions['width'] + '/embed/?moog_width=' + pp_dimensions['width']; toInject = settings.iframe_markup.replace(/{width}/g, vimeo_width).replace(/{height}/g, pp_dimensions['height']).replace(/{path}/g, movie); break; case 'quicktime': pp_dimensions = _fitToViewport(movie_width, movie_height); pp_dimensions['height'] += 15; pp_dimensions['contentHeight'] += 15; pp_dimensions['containerHeight'] += 15; toInject = settings.quicktime_markup.replace(/{width}/g, pp_dimensions['width']).replace(/{height}/g, pp_dimensions['height']).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, pp_images[set_position]).replace(/{autoplay}/g, settings.autoplay); break; case 'flash': pp_dimensions = _fitToViewport(movie_width, movie_height); flash_vars = pp_images[set_position]; flash_vars = flash_vars.substring(pp_images[set_position].indexOf('flashvars') + 10, pp_images[set_position].length); filename = pp_images[set_position]; filename = filename.substring(0, filename.indexOf('?')); toInject = settings.flash_markup.replace(/{width}/g, pp_dimensions['width']).replace(/{height}/g, pp_dimensions['height']).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, filename + '?' + flash_vars); break; case 'iframe': pp_dimensions = _fitToViewport(movie_width, movie_height); frame_url = pp_images[set_position]; frame_url = frame_url.substr(0, frame_url.indexOf('iframe') - 1); toInject = settings.iframe_markup.replace(/{width}/g, pp_dimensions['width']).replace(/{height}/g, pp_dimensions['height']).replace(/{path}/g, frame_url); break; case 'ajax': doresize = false; pp_dimensions = _fitToViewport(movie_width, movie_height); doresize = true; skipInjection = true; $.get(pp_images[set_position], function (responseHTML) { toInject = settings.inline_markup.replace(/{content}/g, responseHTML); $pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject; _showContent(); }); break; case 'custom': pp_dimensions = _fitToViewport(movie_width, movie_height); toInject = settings.custom_markup; break; case 'inline': myClone = $(pp_images[set_position]).clone().append('<br clear="all" />').css({ 'width': settings.default_width }).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo($('body')).show(); doresize = false; pp_dimensions = _fitToViewport($(myClone).width(), $(myClone).height()); doresize = true; $(myClone).remove(); toInject = settings.inline_markup.replace(/{content}/g, $(pp_images[set_position]).html()); break; }; if (!imgPreloader && !skipInjection) { $pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject; _showContent(); }; }); return false;
        }; $.prettyPhoto.changePage = function (direction) { currentGalleryPage = 0; if (direction == 'previous') { set_position--; if (set_position < 0) set_position = $(pp_images).size() - 1; } else if (direction == 'next') { set_position++; if (set_position > $(pp_images).size() - 1) set_position = 0; } else { set_position = direction; }; rel_index = set_position; if (!doresize) doresize = true; $('.pp_contract').removeClass('pp_contract').addClass('pp_expand'); _hideContent(function () { $.prettyPhoto.open(); }); }; $.prettyPhoto.changeGalleryPage = function (direction) { if (direction == 'next') { currentGalleryPage++; if (currentGalleryPage > totalPage) currentGalleryPage = 0; } else if (direction == 'previous') { currentGalleryPage--; if (currentGalleryPage < 0) currentGalleryPage = totalPage; } else { currentGalleryPage = direction; }; slide_speed = (direction == 'next' || direction == 'previous') ? settings.animation_speed : 0; slide_to = currentGalleryPage * (itemsPerPage * itemWidth); $pp_gallery.find('ul').animate({ left: -slide_to }, slide_speed); }; $.prettyPhoto.startSlideshow = function () { if (typeof pp_slideshow == 'undefined') { $pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function () { $.prettyPhoto.stopSlideshow(); return false; }); pp_slideshow = setInterval($.prettyPhoto.startSlideshow, settings.slideshow); } else { $.prettyPhoto.changePage('next'); }; }
        $.prettyPhoto.stopSlideshow = function () { $pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function () { $.prettyPhoto.startSlideshow(); return false; }); clearInterval(pp_slideshow); pp_slideshow = undefined; }
        $.prettyPhoto.close = function () { if ($pp_overlay.is(":animated")) return; $.prettyPhoto.stopSlideshow(); $pp_pic_holder.stop().find('object,embed').css('visibility', 'hidden'); $('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed, function () { $(this).remove(); }); $pp_overlay.fadeOut(settings.animation_speed, function () { if ($.browser.msie && $.browser.version == 6) $('select').css('visibility', 'visible'); if (settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility', 'visible'); $(this).remove(); $(window).unbind('scroll.prettyphoto'); settings.callback(); doresize = true; pp_open = false; delete settings; }); }; function _showContent() {
            $('.pp_loaderIcon').hide(); projectedTop = scroll_pos['scrollTop'] + ((windowHeight / 2) - (pp_dimensions['containerHeight'] / 2)); if (projectedTop < 0) projectedTop = 0; $ppt.fadeTo(settings.animation_speed, 1); $pp_pic_holder.find('.pp_content').animate({ height: pp_dimensions['contentHeight'], width: pp_dimensions['contentWidth'] }, settings.animation_speed); $pp_pic_holder.animate({ 'top': projectedTop, 'left': (windowWidth / 2) - (pp_dimensions['containerWidth'] / 2), width: pp_dimensions['containerWidth'] }, settings.animation_speed, function () {
                $pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']); $pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); if (isSet && _getFileType(pp_images[set_position]) == "image") { $pp_pic_holder.find('.pp_hoverContainer').show(); } else { $pp_pic_holder.find('.pp_hoverContainer').hide(); }
                if (pp_dimensions['resized']) { $('a.pp_expand,a.pp_contract').show(); } else { $('a.pp_expand').hide(); }
                if (settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow(); if (settings.deeplinking)
                    setHashtag(); settings.changepicturecallback(); pp_open = true;
            }); _insert_gallery();
        }; function _hideContent(callback) { $pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility', 'hidden'); $pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed, function () { $('.pp_loaderIcon').show(); callback(); }); }; function _checkPosition(setCount) { (setCount > 1) ? $('.pp_nav').show() : $('.pp_nav').hide(); }; function _fitToViewport(width, height) { resized = false; _getDimensions(width, height); imageWidth = width, imageHeight = height; if (((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) && doresize && settings.allow_resize && !percentBased) { resized = true, fitting = false; while (!fitting) { if ((pp_containerWidth > windowWidth)) { imageWidth = (windowWidth - 200); imageHeight = (height / width) * imageWidth; } else if ((pp_containerHeight > windowHeight)) { imageHeight = (windowHeight - 200); imageWidth = (width / height) * imageHeight; } else { fitting = true; }; pp_containerHeight = imageHeight, pp_containerWidth = imageWidth; }; _getDimensions(imageWidth, imageHeight); if ((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) { _fitToViewport(pp_containerWidth, pp_containerHeight) }; }; return { width: Math.floor(imageWidth), height: Math.floor(imageHeight), containerHeight: Math.floor(pp_containerHeight), containerWidth: Math.floor(pp_containerWidth) + (settings.horizontal_padding * 2), contentHeight: Math.floor(pp_contentHeight), contentWidth: Math.floor(pp_contentWidth), resized: resized }; }; function _getDimensions(width, height) { width = parseFloat(width); height = parseFloat(height); $pp_details = $pp_pic_holder.find('.pp_details'); $pp_details.width(width); detailsHeight = parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom')); $pp_details = $pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({ 'position': 'absolute', 'top': -10000 }); detailsHeight += $pp_details.height(); detailsHeight = (detailsHeight <= 34) ? 36 : detailsHeight; if ($.browser.msie && $.browser.version == 7) detailsHeight += 8; $pp_details.remove(); $pp_title = $pp_pic_holder.find('.ppt'); $pp_title.width(width); titleHeight = parseFloat($pp_title.css('marginTop')) + parseFloat($pp_title.css('marginBottom')); $pp_title = $pp_title.clone().appendTo($('body')).css({ 'position': 'absolute', 'top': -10000 }); titleHeight += $pp_title.height(); $pp_title.remove(); pp_contentHeight = height + detailsHeight; pp_contentWidth = width; pp_containerHeight = pp_contentHeight + titleHeight + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height(); pp_containerWidth = width; }
        function _getFileType(itemSrc) { if (itemSrc.match(/youtube\.com\/watch/i)) { return 'youtube'; } else if (itemSrc.match(/vimeo\.com/i)) { return 'vimeo'; } else if (itemSrc.match(/\b.mov\b/i)) { return 'quicktime'; } else if (itemSrc.match(/\b.swf\b/i)) { return 'flash'; } else if (itemSrc.match(/\biframe=true\b/i)) { return 'iframe'; } else if (itemSrc.match(/\bajax=true\b/i)) { return 'ajax'; } else if (itemSrc.match(/\bcustom=true\b/i)) { return 'custom'; } else if (itemSrc.substr(0, 1) == '#') { return 'inline'; } else { return 'image'; }; }; function _center_overlay() {
            if (doresize && typeof $pp_pic_holder != 'undefined') {
                scroll_pos = _get_scroll(); contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width(); projectedTop = (windowHeight / 2) + scroll_pos['scrollTop'] - (contentHeight / 2); if (projectedTop < 0) projectedTop = 0; if (contentHeight > windowHeight)
                    return; $pp_pic_holder.css({ 'top': projectedTop, 'left': (windowWidth / 2) + scroll_pos['scrollLeft'] - (contentwidth / 2) });
            };
        }; function _get_scroll() { if (self.pageYOffset) { return { scrollTop: self.pageYOffset, scrollLeft: self.pageXOffset }; } else if (document.documentElement && document.documentElement.scrollTop) { return { scrollTop: document.documentElement.scrollTop, scrollLeft: document.documentElement.scrollLeft }; } else if (document.body) { return { scrollTop: document.body.scrollTop, scrollLeft: document.body.scrollLeft }; }; }; function _resize_overlay() { windowHeight = $(window).height(), windowWidth = $(window).width(); if (typeof $pp_overlay != "undefined") $pp_overlay.height($(document).height()).width(windowWidth); }; function _insert_gallery() { if (isSet && settings.overlay_gallery && _getFileType(pp_images[set_position]) == "image" && (settings.ie6_fallback && !($.browser.msie && parseInt($.browser.version) == 6))) { itemWidth = 52 + 5; navWidth = (settings.theme == "facebook" || settings.theme == "pp_default") ? 50 : 30; itemsPerPage = Math.floor((pp_dimensions['containerWidth'] - 100 - navWidth) / itemWidth); itemsPerPage = (itemsPerPage < pp_images.length) ? itemsPerPage : pp_images.length; totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1; if (totalPage == 0) { navWidth = 0; $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide(); } else { $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show(); }; galleryWidth = itemsPerPage * itemWidth; fullGalleryWidth = pp_images.length * itemWidth; $pp_gallery.css('margin-left', -((galleryWidth / 2) + (navWidth / 2))).find('div:first').width(galleryWidth + 5).find('ul').width(fullGalleryWidth).find('li.selected').removeClass('selected'); goToPage = (Math.floor(set_position / itemsPerPage) < totalPage) ? Math.floor(set_position / itemsPerPage) : totalPage; $.prettyPhoto.changeGalleryPage(goToPage); $pp_gallery_li.filter(':eq(' + set_position + ')').addClass('selected'); } else { $pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave'); } }
        function _build_overlay(caller) {
            settings.markup = settings.markup.replace('{pp_social}', (settings.social_tools) ? settings.social_tools : ''); $('body').append(settings.markup); $pp_pic_holder = $('.pp_pic_holder'), $ppt = $('.ppt'), $pp_overlay = $('div.pp_overlay'); if (isSet && settings.overlay_gallery) {
                currentGalleryPage = 0; toInject = ""; for (var i = 0; i < pp_images.length; i++) {
                    if (!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)) { classname = 'default'; img_src = ''; } else { classname = ''; img_src = pp_images[i]; }
                    toInject += "<li class='" + classname + "'><a href='#'><img src='" + img_src + "' width='50' alt='' /></a></li>";
                }; toInject = settings.gallery_markup.replace(/{gallery}/g, toInject); $pp_pic_holder.find('#pp_full_res').after(toInject); $pp_gallery = $('.pp_pic_holder .pp_gallery'), $pp_gallery_li = $pp_gallery.find('li'); $pp_gallery.find('.pp_arrow_next').click(function () { $.prettyPhoto.changeGalleryPage('next'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_gallery.find('.pp_arrow_previous').click(function () { $.prettyPhoto.changeGalleryPage('previous'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_pic_holder.find('.pp_content').hover(function () { $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn(); }, function () { $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut(); }); itemWidth = 52 + 5; $pp_gallery_li.each(function (i) { $(this).find('a').click(function () { $.prettyPhoto.changePage(i); $.prettyPhoto.stopSlideshow(); return false; }); });
            }; if (settings.slideshow) {
                $pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
                $pp_pic_holder.find('.pp_nav .pp_play').click(function () { $.prettyPhoto.startSlideshow(); return false; });
            }
            $pp_pic_holder.attr('class', 'pp_pic_holder ' + settings.theme); $pp_overlay.css({ 'opacity': 0, 'height': $(document).height(), 'width': $(window).width() }).bind('click', function () { if (!settings.modal) $.prettyPhoto.close(); }); $('a.pp_close').bind('click', function () { $.prettyPhoto.close(); return false; }); $('a.pp_expand').bind('click', function (e) { if ($(this).hasClass('pp_expand')) { $(this).removeClass('pp_expand').addClass('pp_contract'); doresize = false; } else { $(this).removeClass('pp_contract').addClass('pp_expand'); doresize = true; }; _hideContent(function () { $.prettyPhoto.open(); }); return false; }); $pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click', function () { $.prettyPhoto.changePage('previous'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click', function () { $.prettyPhoto.changePage('next'); $.prettyPhoto.stopSlideshow(); return false; }); _center_overlay();
        }; if (!pp_alreadyInitialized && getHashtag()) { pp_alreadyInitialized = true; hashIndex = getHashtag(); hashRel = hashIndex; hashIndex = hashIndex.substring(hashIndex.indexOf('/') + 1, hashIndex.length - 1); hashRel = hashRel.substring(0, hashRel.indexOf('/')); setTimeout(function () { $("a[rel^='" + hashRel + "']:eq(" + hashIndex + ")").trigger('click'); }, 50); }
        return this.unbind('click.prettyphoto').bind('click.prettyphoto', $.prettyPhoto.initialize);
    }; function getHashtag() { url = location.href; hashtag = (url.indexOf('#!') != -1) ? decodeURI(url.substring(url.indexOf('#!') + 2, url.length)) : false; return hashtag; }; function setHashtag() { if (typeof theRel == 'undefined') return; location.hash = '!' + theRel + '/' + rel_index + '/'; }; function getParam(name, url) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = "[\\?&]" + name + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(url); return (results == null) ? "" : results[1]; } 
})(jQuery); var pp_alreadyInitialized = false;
/**/
/*
 * jQuery Timetabs v1
 * http://www.tn34.de
 * Authors: Mario Alves (Javascript), David Hestler (Markup)
 *
 * Copyright 2010, TN34.DE
 * Released under the GPL license.
 * http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Date: Tue Aug 17 12:19:511 2010
 */

(function(jQuery){jQuery.fn.timetabs=function(options){var opt=jQuery.extend({},jQuery.timetabs.defaults,options);return this.each(function(){var gDLIndex=jQuery.timetabs.gDLI.length++;var delayedStartInterval=null;var continueFlag=false;jQuery.timetabs.gDLI[gDLIndex]={selfObj:jQuery(this),self:this,t:'',c:'',cIndex:0,stTime:0,timeOut:0,timeLeft:0};jQuery.timetabs.gDLI[gDLIndex].t=gDLI().selfObj.children('dt');jQuery.timetabs.gDLI[gDLIndex].c=gDLI().selfObj.children('dd');if(gDLI().t.length!==gDLI().c.length)return;jQuery.timetabs.gDLI[gDLIndex].cIndex=((opt.defaultIndex+1)>gDLI().t.length||opt.defaultIndex<0)?0:opt.defaultIndex;switch(opt.animated){case'slide':case'curtain':case'fade':break;default:case false:opt.animated=false;break}if(opt.animated!==false){gDLI().selfObj.find('dd:gt('+gDLI().cIndex+')').hide()}_3(gDLI().cIndex);jQuery(gDLI().t).click(function(e){_3(this,e);e.stopPropagation()});if((isNaN(opt.interval))!==true||parseInt(opt.interval)>0){jQuery(gDLI().t).mouseover(_0).mouseenter(_0).mouseleave(_2);jQuery(gDLI().c).mouseover(_0).mouseenter(_0).mouseleave(_2)}function _4(){clearTimeout(jQuery.timetabs.gDLI[gDLIndex].timeOut);if(delayedStartInterval)clearTimeout(delayedStartInterval);jQuery.timetabs.gDLI[gDLIndex].stTime=new Date().valueOf();jQuery.timetabs.gDLI[gDLIndex].timeOut=setTimeout(function(){_3()},opt.interval);jQuery.timetabs.gDLI[gDLIndex].timeLeft=opt.interval}function _0(){clearTimeout(jQuery.timetabs.gDLI[gDLIndex].timeOut);if(delayedStartInterval)clearTimeout(delayedStartInterval);continueFlag=true;var timeRan=new Date().valueOf()-gDLI().stTime;jQuery.timetabs.gDLI[gDLIndex].timeLeft-=timeRan}function _2(){if(opt.continueOnMouseLeave===true){delayedStartInterval=setTimeout(function(){jQuery.timetabs.gDLI[gDLIndex].timeout=setTimeout(function(){_3()},gDLI().timeLeft)},350)}else{jQuery(gDLI().t).unbind('mouseover',_0).unbind('mouseenter',_0).unbind('mouseleave',_2);jQuery(gDLI().c).unbind('mouseover',_0).unbind('mouseenter',_0).unbind('mouseleave',_2)}}function _3(el,e){clearTimeout(jQuery.timetabs.gDLI[gDLIndex].timeOut);if(delayedStartInterval)clearTimeout(delayedStartInterval);if(typeof el=='number'){var index=el}else if(typeof el=='undefined'){var index=gDLI().cIndex+1}else if(typeof el=='object'){var index=gDLI().selfObj.children('dt').index(el)}else{var index=0}if(index==gDLI().t.length){index=0}if(typeof e!=='undefined'&&jQuery.timetabs.gDLI[gDLIndex].cIndex==index){_1(e);return}opt.beforeChange(gDLI());function tabAnimation(i){switch(opt.animated){case'slide':case'curtain':case'fade':gDLI().selfObj.children('dt.active').removeClass('active');jQuery(gDLI().t.get(i)).addClass('active');break}}switch(opt.animated){case false:tabAnimation(index);gDLI().selfObj.children('.active').removeClass('active');jQuery(gDLI().t.get(index)).addClass('active').next('dd').addClass('active');_1(e);break;case'slide':if(gDLI().selfObj.children('dd.active').length==0){tabAnimation(index);jQuery(gDLI().c.get(index)).addClass('active');_1(e)}else{gDLI().selfObj.children('dd.active').slideUp(opt.animationSpeed,function(){tabAnimation(index);jQuery(gDLI().c.get(index)).slideDown(opt.animationSpeed,function(){_1(e);jQuery(this).addClass('active')});jQuery(this).removeClass('active').hide()})}break;case'curtain':tabAnimation(index);jQuery(gDLI().c.get(index)).css('z-index','10000').slideDown(opt.animationSpeed,function(){gDLI().selfObj.children('dd.active').removeClass('active').hide();_1(e);jQuery(this).css('z-index','1').addClass('active')});break;default:case'fade':tabAnimation(index);jQuery(gDLI().c.get(index)).css('z-index','10000').fadeIn(opt.animationSpeed,function(){gDLI().selfObj.children('dd.active').removeClass('active').hide();_1(e);jQuery(this).css('z-index','1').addClass('active')});break}jQuery.timetabs.gDLI[gDLIndex].cIndex=index;opt.afterChange(gDLI())}function _1(e){if(opt.continueOnMouseLeave===false&&continueFlag===true){return}if(typeof e!=='undefined'&&((isNaN(opt.interval))!==true||parseInt(opt.interval)>0)){gDLI().selfObj.one('mouseleave',function(){_4()})}else _4()}function gDLI(){return jQuery.timetabs.gDLI[gDLIndex]}})};jQuery.timetabs={defaults:{defaultIndex:0,interval:2500,continueOnMouseLeave:true,animated:false,animationSpeed:500,beforeChange:function(){},afterChange:function(){}},gDLI:[]}})(jQuery);
/**/

(function($){$.fn.rssfeed=function(url,options){var defaults={limit:10,header:false,titletag:'',date:false,content:false,snippet:false,showerror:true,errormsg:'',key:null,ssl:false,linktarget:'_blank'};var options=$.extend(defaults,options);return this.each(function(i,e){var $e=$(e);var s='';if(options.ssl)s='s';if(!$e.hasClass('rssFeed'))$e.addClass('rssFeed');if(url==null)return false;var api="http"+s+"://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+encodeURIComponent(url);if(options.limit!=null)api+="&num="+options.limit;if(options.key!=null)api+="&key="+options.key;api+="&output=json_xml"
$.getJSON(api,function(data){if(data.responseStatus==200){_callback(e,data.responseData,options);}else{if(options.showerror)
if(options.errormsg!=''){var msg=options.errormsg;}else{var msg=data.responseDetails;};$(e).html('<div class="rssError"><p>'+msg+'</p></div>');};});});};var _callback=function(e,data,options){var feeds=data.feed;if(!feeds){return false;}
var html='';var row='odd';var xml=getXMLDocument(data.xmlString);var xmlEntries=xml.getElementsByTagName('item');if(options.header)
    html += '<div>' + '<a href="' + feeds.link + '" title="' + feeds.description + '">' + feeds.title + '</a>' + '</div>'; html += '<div>' + '<ul class="blue-arrow">'; for (var i = 0; i < feeds.entries.length; i++) {
    var entry = feeds.entries[i]; var entryDate = new Date(entry.publishedDate); var pubDate = entryDate.toLocaleDateString() + ' ' + entryDate.toLocaleTimeString(); html += '<li>' + '' + options.titletag + '<a href="' + entry.link + '" title="View this feed at ' + feeds.title + '" target="' + options.linktarget + '">' + entry.title + '</a>' + options.titletag + ''
if(options.date)html+='<div>'+pubDate+'</div>'
if(options.content){if(options.snippet&&entry.contentSnippet!=''){var content=entry.contentSnippet;}else{var content=entry.content;}
html+='<p>'+content+'</p>'}
if(xmlEntries.length>0){var xmlMedia=xmlEntries[i].getElementsByTagName('enclosure');if(xmlMedia.length>0){html+='<div class="rssMedia"><div>Media files</div><ul>'
for(var m=0;m<xmlMedia.length;m++){var xmlUrl=xmlMedia[m].getAttribute("url");var xmlType=xmlMedia[m].getAttribute("type");var xmlSize=xmlMedia[m].getAttribute("length");html+='<li><a href="'+xmlUrl+'" title="Download this media">'+xmlUrl.split('/').pop()+'</a> ('+xmlType+', '+formatFilesize(xmlSize)+')</li>';}
html+='</ul></div>'}
html+='</li>';}
if(row=='odd'){row='even';}else{row='odd';}}
html+='</ul>'+'</div>'
$(e).html(html);};function formatFilesize(bytes){var s=['bytes','kb','MB','GB','TB','PB'];var e=Math.floor(Math.log(bytes)/Math.log(1024));return(bytes/Math.pow(1024,Math.floor(e))).toFixed(2)+" "+s[e];}
function getXMLDocument(string){var browser=navigator.appName;var xml;if(browser=='Microsoft Internet Explorer'){xml=new ActiveXObject('Microsoft.XMLDOM');xml.async='false'
xml.loadXML(string);}else{xml=(new DOMParser()).parseFromString(string,'text/xml');}
return xml;}})(jQuery);
/**/
/*
 AnythingSlider v1.5.12 minified using Google Closure Compiler
 By Chris Coyier: http://css-tricks.com
 with major improvements by Doug Neiner: http://pixelgraphics.us/
 based on work by Remy Sharp: http://jqueryfordesigners.com/
*/

(function(c){c.anythingSlider=function(h,i){var a=this;a.$el=c(h).addClass("anythingBase").wrap('<div class="anythingSlider"><div class="anythingWindow" /></div>');a.$el.data("AnythingSlider",a);a.init=function(){a.options=c.extend({},c.anythingSlider.defaults,i);c.isFunction(a.options.onBeforeInitialize)&&a.$el.bind("before_initialize",a.options.onBeforeInitialize);a.$el.trigger("before_initialize",a);a.$wrapper=a.$el.parent().closest("div.anythingSlider").addClass("anythingSlider-"+a.options.theme); a.$window=a.$el.closest("div.anythingWindow");a.$controls=c('<div class="anythingControls"></div>').appendTo(a.options.appendControlsTo!==null&&c(a.options.appendControlsTo).length?c(a.options.appendControlsTo):a.$wrapper);a.win=window;a.$win=c(a.win);a.$nav=c('<ul class="thumbNav" />').appendTo(a.$controls);a.timer=null;a.flag=!1;a.playing=!1;a.slideshow=!1;a.hovered=!1;a.panelSize=[];a.currentPage=a.options.startPanel;a.adjustLimit=a.options.infiniteSlides?0:1;a.options.playRtl&&a.$wrapper.addClass("rtl"); a.easingMargin=a.options.easing.match("swing|linear")?0:100;a.$el.css("margin-left",a.easingMargin+"px");a.original=[a.options.autoPlay,a.options.buildNavigation,a.options.buildArrows];a.updateSlider();a.$lastPage=a.$currentPage;a.runTimes=c("div.anythingSlider").index(a.$wrapper)+1;a.regex=RegExp("panel"+a.runTimes+"-(\\d+)","i");if(!c.isFunction(c.easing[a.options.easing]))a.options.easing="swing";a.options.theme!=="default"&&!c("link[href*="+a.options.theme+"]").length&&c("head").append('<link rel="stylesheet" href="'+ a.options.themeDirectory.replace(/\{themeName\}/g,a.options.theme)+'" type="text/css" />');a.options.pauseOnHover&&a.$wrapper.hover(function(){a.playing&&(a.$el.trigger("slideshow_paused",a),a.clearTimer(!0))},function(){a.playing&&(a.$el.trigger("slideshow_unpaused",a),a.startStop(a.playing,!0))});var b,e=a.options.hashTags?a.gotoHash()||a.options.startPanel:a.options.startPanel;a.setCurrentPage(e,!1);a.slideControls(!1);a.$wrapper.bind("mouseenter mouseleave",function(b){a.hovered=b.type==="mouseenter"? !0:!1;a.slideControls(a.hovered,!1)});a.options.enableKeyboard&&c(document).keyup(function(b){if(a.$wrapper.is(".activeSlider")&&!b.target.tagName.match("TEXTAREA|INPUT|SELECT"))switch(b.which){case 39:a.goForward();break;case 37:a.goBack()}});b="slideshow_paused slideshow_unpaused slide_init slide_begin slideshow_stop slideshow_start initialized swf_completed".split(" ");c.each("onShowPause onShowUnpause onSlideInit onSlideBegin onShowStop onShowStart onInitialized onSWFComplete".split(" "),function(e, f){c.isFunction(a.options[f])&&a.$el.bind(b[e],a.options[f])});c.isFunction(a.options.onSlideComplete)&&a.$el.bind("slide_complete",function(){setTimeout(function(){a.options.onSlideComplete(a)},0)});a.$el.trigger("initialized",a)};a.updateSlider=function(){a.$el.find("li.cloned").remove();a.$nav.empty();a.$items=a.$el.find("> li");a.pages=a.$items.length;a.options.resizeContents&&(a.options.width&&a.$wrapper.add(a.$items).css("width",a.options.width),a.options.height&&a.$wrapper.add(a.$items).css("height", a.options.height));a.pages===1?(a.options.autoPlay=!1,a.options.buildNavigation=!1,a.options.buildArrows=!1,a.$controls.hide(),a.$nav.hide(),a.$forward&&a.$forward.add(a.$back).hide()):(a.options.autoPlay=a.original[0],a.options.buildNavigation=a.original[1],a.options.buildArrows=a.original[2],a.$controls.show(),a.$nav.show(),a.$forward&&a.$forward.add(a.$back).show());a.buildNavigation();if(a.options.autoPlay)a.playing=!a.options.startStopped,a.buildAutoPlay();a.options.buildArrows&&a.buildNextBackButtons(); a.options.infiniteSlides&&(a.$el.prepend(a.$items.filter(":last").clone().addClass("cloned").removeAttr("id")),a.$el.append(a.$items.filter(":first").clone().addClass("cloned").removeAttr("id")),a.$el.find("li.cloned").each(function(){c(this).find("a").attr("disabled","disabled");c(this).find("[id]").removeAttr("id")}));a.$items=a.$el.find("> li").addClass("panel");a.setDimensions();a.options.resizeContents||a.$win.load(function(){a.setDimensions()});if(a.currentPage>a.pages)a.currentPage=a.pages, a.setCurrentPage(a.pages,!1);a.$nav.find("a").eq(a.currentPage-1).addClass("cur");a.$controls.show();a.hasEmb=a.$items.find("embed[src*=youtube]").length;a.hasSwfo=typeof swfobject!=="undefined"&&swfobject.hasOwnProperty("embedSWF")&&c.isFunction(swfobject.embedSWF)?!0:!1;a.hasEmb&&a.hasSwfo&&a.$items.find("embed[src*=youtube]").each(function(b){var e=c(this).parent()[0].tagName==="OBJECT"?c(this).parent():c(this);e.wrap('<div id="ytvideo'+b+'"></div>');swfobject.embedSWF(c(this).attr("src")+"&enablejsapi=1&version=3&playerapiid=ytvideo"+ b,"ytvideo"+b,e.attr("width"),e.attr("height"),"10",null,null,{allowScriptAccess:"always",wmode:a.options.addWmodeToObject,allowfullscreen:!0},{"class":e.attr("class"),style:e.attr("style")},function(){b>=a.hasEmb-1&&a.$el.trigger("swf_completed",a)})});a.$items.find("a").unbind("focus").bind("focus",function(b){a.$items.find(".focusedLink").removeClass("focusedLink");c(this).addClass("focusedLink");var e=c(this).closest(".panel");e.is(".activePage")||(a.gotoPage(a.$items.index(e)),b.preventDefault())})}; a.buildNavigation=function(){var b,e,d;a.options.buildNavigation&&a.pages>1&&a.$items.filter(":not(.cloned)").each(function(f){var g=f+1;e=(g===1?"first":"")+(g===a.pages?"last":"");d=c('<a href="#"></a>').addClass("panel"+g).wrap('<li class="'+e+'" />');a.$nav.append(d.parent());c.isFunction(a.options.navigationFormatter)?(b=a.options.navigationFormatter(g,c(this)),d.html("<span>"+b+"</span>"),parseInt(d.find("span").css("text-indent"),10)<0&&d.addClass(a.options.tooltipClass).attr("title",b)):d.html("<span>"+ g+"</span>");d.bind(a.options.clickControls,function(b){if(!a.flag&&a.options.enableNavigation)a.flag=!0,setTimeout(function(){a.flag=!1},100),a.gotoPage(g),a.options.hashTags&&a.setHash(g);b.preventDefault()})})};a.buildNextBackButtons=function(){if(!a.$forward)a.$forward=c('<span class="arrow forward"><a href="#"><span>'+a.options.forwardText+"</span></a></span>"),a.$back=c('<span class="arrow back"><a href="#"><span>'+a.options.backText+"</span></a></span>"),a.$back.bind(a.options.clickArrows, function(b){a.goBack();b.preventDefault()}),a.$forward.bind(a.options.clickArrows,function(b){a.goForward();b.preventDefault()}),a.$back.add(a.$forward).find("a").bind("focusin focusout",function(){c(this).toggleClass("hover")}),a.$wrapper.prepend(a.$forward).prepend(a.$back),a.$arrowWidth=a.$forward.width()};a.buildAutoPlay=function(){if(!a.$startStop)a.$startStop=c("<a href='#' class='start-stop'></a>").html("<span>"+(a.playing?a.options.stopText:a.options.startText)+"</span>"),a.$controls.prepend(a.$startStop), a.$startStop.bind(a.options.clickSlideshow,function(b){a.options.enablePlay&&(a.startStop(!a.playing),a.playing&&(a.options.playRtl?a.goBack(!0):a.goForward(!0)));b.preventDefault()}).bind("focusin focusout",function(){c(this).toggleClass("hover")}),a.startStop(a.playing)};a.setDimensions=function(){var b,e,d,f,g,h=a.easingMargin,i=a.$window.width(),j=a.$win.width();a.$items.each(function(k){d=c(this).children("*");a.options.resizeContents?(b=parseInt(a.options.width,10)||i,e=parseInt(a.options.height, 10)||a.$window.height(),c(this).css({width:b,height:e}),d.length===1&&(d.css({width:"100%",height:"100%"}),d[0].tagName==="OBJECT"&&d.find("embed").andSelf().attr({width:"100%",height:"100%"}))):(b=c(this).width(),g=b>=j?!0:!1,d.length===1&&g&&(f=d.width()>=j?i:d.width(),c(this).css("width",f),d.css("max-width",f),b=f),b=g?a.options.width||i:b,c(this).css("width",b),e=c(this).outerHeight(),c(this).css("height",e));a.panelSize[k]=[b,e,h];h+=b});a.$el.css("width",h<a.options.maxOverallWidth?h:a.options.maxOverallWidth)}; a.gotoPage=function(b,c,d){if(a.pages!==1){a.$lastPage=a.$currentPage;if(typeof b!=="number")b=a.options.startPage,a.setCurrentPage(a.options.startPage);if(!a.hasEmb||!a.checkVideo(a.playing))b>a.pages+1-a.adjustLimit&&(b=!a.options.infiniteSlides&&!a.options.stopAtEnd?1:a.pages),b<a.adjustLimit&&(b=!a.options.infiniteSlides&&!a.options.stopAtEnd?a.pages:1),a.currentPage=b>a.pages?a.pages:b<1?1:a.currentPage,a.$currentPage=a.$items.eq(a.currentPage-1),a.exactPage=b,a.$el.trigger("slide_init",a),a.slideControls(!0, !1),c!==!0&&(c=!1),(!c||a.options.stopAtEnd&&b===a.pages)&&a.startStop(!1),a.$el.trigger("slide_begin",a),a.options.resizeContents||a.$wrapper.filter(":not(:animated)").animate({width:a.panelSize[a.options.infiniteSlides?b:b-1][0],height:a.panelSize[a.options.infiniteSlides?b:b-1][1]},{queue:!1,duration:a.options.animationTime,easing:a.options.easing}),a.$window.filter(":not(:animated)").animate({scrollLeft:a.panelSize[a.options.infiniteSlides?b:b-1][2]},{queue:!1,duration:a.options.animationTime, easing:a.options.easing,complete:function(){a.endAnimation(b,d)}})}};a.endAnimation=function(b,e){b===0?(a.$window.scrollLeft(a.panelSize[a.pages][2]),b=a.pages):b>a.pages&&(a.$window.scrollLeft(a.panelSize[1][2]),b=1);a.exactPage=b;a.setCurrentPage(b,!1);a.$items.removeClass("activePage").eq(b-a.adjustLimit).addClass("activePage");a.hovered||a.slideControls(!1);if(a.hasEmb){var d=a.$currentPage.find("object[id*=ytvideo], embed[id*=ytvideo]");d.length&&c.isFunction(d[0].getPlayerState)&&d[0].getPlayerState()> 0&&d[0].getPlayerState()!==5&&d[0].playVideo()}a.$el.trigger("slide_complete",a);typeof e==="function"&&e(a);a.options.autoPlayLocked&&!a.playing&&setTimeout(function(){a.startStop(!0)},a.options.resumeDelay-a.options.delay)};a.setCurrentPage=function(b,e){b>a.pages+1-a.adjustLimit&&(b=a.pages-a.adjustLimit);b<a.adjustLimit&&(b=1);a.options.buildNavigation&&(a.$nav.find(".cur").removeClass("cur"),a.$nav.find("a").eq(b-1).addClass("cur"));!a.options.infiniteSlides&&a.options.stopAtEnd&&(a.$wrapper.find("span.forward")[b=== a.pages?"addClass":"removeClass"]("disabled"),a.$wrapper.find("span.back")[b===1?"addClass":"removeClass"]("disabled"),b===a.pages&&a.playing&&a.startStop());e||(a.$wrapper.css({width:a.panelSize[a.options.infiniteSlides?b:b-1][0],height:a.panelSize[a.options.infiniteSlides?b:b-1][1]}),a.$wrapper.scrollLeft(0),a.$window.scrollLeft(a.panelSize[a.options.infiniteSlides?b:b-1][2]));a.currentPage=b;a.$currentPage=a.$items.eq(b).addClass("activePage");a.$wrapper.is(".activeSlider")||(c(".activeSlider").removeClass("activeSlider"), a.$wrapper.addClass("activeSlider"))};a.goForward=function(b){b!==!0&&(b=!1,a.startStop(!1));a.gotoPage(a.currentPage+1,b)};a.goBack=function(b){b!==!0&&(b=!1,a.startStop(!1));a.gotoPage(a.currentPage-1,b)};a.gotoHash=function(){var b=a.win.location.hash.match(a.regex);return b===null?"":parseInt(b[1],10)};a.setHash=function(b){var c="panel"+a.runTimes+"-",d=a.win.location.hash;if(typeof d!=="undefined")a.win.location.hash=d.indexOf(c)>0?d.replace(a.regex,c+b):d+"&"+c+b};a.slideControls=function(b){var c= b?0:a.options.animationTime,d=b?a.options.animationTime:0,f=b?1:0,g=b?0:1;a.options.toggleControls&&a.$controls.stop(!0,!0).delay(c)[b?"slideDown":"slideUp"](a.options.animationTime/2).delay(d);a.options.buildArrows&&a.options.toggleArrows&&(!a.hovered&&a.playing&&(g=1,f=0),a.$forward.stop(!0,!0).delay(c).animate({right:g*a.$arrowWidth,opacity:f},a.options.animationTime/2),a.$back.stop(!0,!0).delay(c).animate({left:g*a.$arrowWidth,opacity:f},a.options.animationTime/2))};a.clearTimer=function(b){if(a.timer&& (a.win.clearInterval(a.timer),!b&&a.slideshow))a.$el.trigger("slideshow_stop",a),a.slideshow=!1};a.startStop=function(b,c){b!==!0&&(b=!1);if(b&&!c)a.$el.trigger("slideshow_start",a),a.slideshow=!0;a.playing=b;a.options.autoPlay&&(a.$startStop.toggleClass("playing",b).html("<span>"+(b?a.options.stopText:a.options.startText)+"</span>"),parseInt(a.$startStop.find("span").css("text-indent"),10)<0&&a.$startStop.addClass(a.options.tooltipClass).attr("title",b?"Stop":"Start"));b?(a.clearTimer(!0),a.timer= a.win.setInterval(function(){if(!a.hasEmb||!a.checkVideo(b))a.options.playRtl?a.goBack(!0):a.goForward(!0)},a.options.delay)):a.clearTimer()};a.checkVideo=function(b){var e,d,f=!1;a.$items.find("object[id*=ytvideo], embed[id*=ytvideo]").each(function(){e=c(this);e.length&&c.isFunction(e[0].getPlayerState)&&(d=e[0].getPlayerState(),b&&(d===1||d>2)&&a.$items.index(e.closest("li.panel"))===a.currentPage&&a.options.resumeOnVideoEnd?f=!0:d>0&&e[0].pauseVideo())});return f};a.init()};c.anythingSlider.defaults= {width:null,height:null,resizeContents:!0,tooltipClass:"tooltip",theme:"default",themeDirectory:"css/theme-{themeName}.css",startPanel:1,hashTags:!0,infiniteSlides:!0,enableKeyboard:!0,buildArrows:!0,toggleArrows:!1,buildNavigation:!0,enableNavigation:!0,toggleControls:!1,appendControlsTo:null,navigationFormatter:null,forwardText:"&raquo;",backText:"&laquo;",enablePlay:!0,autoPlay:!0,autoPlayLocked:!1,startStopped:!1,pauseOnHover:!0,resumeOnVideoEnd:!0,stopAtEnd:!1,playRtl:!1,startText:"Start",stopText:"Stop", delay:3E3,resumeDelay:15E3,animationTime:600,easing:"swing",clickArrows:"click",clickControls:"click focusin",clickSlideshow:"click",addWmodeToObject:"opaque",maxOverallWidth:32766};c.fn.anythingSlider=function(h,i){return this.each(function(){var a,b=c(this).data("AnythingSlider");(typeof h).match("object|undefined")?b?b.updateSlider():new c.anythingSlider(this,h):/\d/.test(h)&&!isNaN(h)&&b&&(a=typeof h==="number"?h:parseInt(c.trim(h),10),a>=1&&a<=b.pages&&b.gotoPage(a,!1,i))})}})(jQuery);
/**/
(function($) {
 
  $.fn.tweet = function(o){
    var s = {
      username: ["Johnesh"],              // [string]   required, unless you want to display our tweets. :) it can be an array, just do ["username1","username2","etc"]
      list: null,                              //[string]   optional name of list belonging to username
      avatar_size: null,                      // [integer]  height and width of avatar if displayed (48px max)
      count: 3,                               // [integer]  how many tweets to display?
      intro_text: null,                       // [string]   do you want text BEFORE your your tweets?
      outro_text: null,                       // [string]   do you want text AFTER your tweets?
      join_text:  null,                       // [string]   optional text in between date and tweet, try setting to "auto"
      auto_join_text_default: "i said,",      // [string]   auto text for non verb: "i said" bullocks
      auto_join_text_ed: "i",                 // [string]   auto text for past tense: "i" surfed
      auto_join_text_ing: "i am",             // [string]   auto tense for present tense: "i was" surfing
      auto_join_text_reply: "i replied to",   // [string]   auto tense for replies: "i replied to" @someone "with"
      auto_join_text_url: "i was looking at", // [string]   auto tense for urls: "i was looking at" http:...
      loading_text: null,                     // [string]   optional loading text, displayed while tweets load
      query: null                             // [string]   optional search query
    };
    
    if(o) $.extend(s, o);
    
    $.fn.extend({
      linkUrl: function() {
        var returning = [];
        var regexp = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;
        this.each(function() {
          returning.push(this.replace(regexp,"<a href=\"$1\">$1</a>"));
        });
        return $(returning);
      },
      linkUser: function() {
        var returning = [];
        var regexp = /[\@]+([A-Za-z0-9-_]+)/gi;
        this.each(function() {
          returning.push(this.replace(regexp,"<a href=\"http://twitter.com/$1\">@$1</a>"));
        });
        return $(returning);
      },
      linkHash: function() {
        var returning = [];
        var regexp = / [\#]+([A-Za-z0-9-_]+)/gi;
        this.each(function() {
          returning.push(this.replace(regexp, ' <a href="http://search.twitter.com/search?q=&tag=$1&lang=all&from='+s.username.join("%2BOR%2B")+'">#$1</a>'));
        });
        return $(returning);
      },
      capAwesome: function() {
        var returning = [];
        this.each(function() {
          returning.push(this.replace(/\b(awesome)\b/gi, '<span class="awesome">$1</span>'));
        });
        return $(returning);
      },
      capEpic: function() {
        var returning = [];
        this.each(function() {
          returning.push(this.replace(/\b(epic)\b/gi, '<span class="epic">$1</span>'));
        });
        return $(returning);
      },
      makeHeart: function() {
        var returning = [];
        this.each(function() {
          returning.push(this.replace(/(&lt;)+[3]/gi, "<tt class='heart'>&#x2665;</tt>"));
        });
        return $(returning);
      }
    });

    function parse_date(date_str) {
      // The non-search twitter APIs return inconsistently-formatted dates, which Date.parse
      // cannot handle in IE. We therefore perform the following transformation:
      // "Wed Apr 29 08:53:31 +0000 2009" => "Wed, Apr 29 2009 08:53:31 +0000"
      return Date.parse(date_str.replace(/^([a-z]{3})( [a-z]{3} \d\d?)(.*)( \d{4})$/i, '$1,$2$4$3'));
    }

    function relative_time(time_value) {
      var parsed_date = parse_date(time_value);
      var relative_to = (arguments.length > 1) ? arguments[1] : new Date();
      var delta = parseInt((relative_to.getTime() - parsed_date) / 1000);
      var pluralize = function (singular, n) {
        return '' + n + ' ' + singular + (n == 1 ? '' : 's');
      };
      if(delta < 60) {
      return 'less than a minute ago';
      } else if(delta < (60*60)) {
      return 'about ' + pluralize("minute", parseInt(delta / 60)) + ' ago';
      } else if(delta < (24*60*60)) {
      return 'about ' + pluralize("hour", parseInt(delta / 3600)) + ' ago';
      } else {
      return 'about ' + pluralize("day", parseInt(delta / 86400)) + ' ago';
      }
    }

    function build_url() {
      var proto = ('https:' == document.location.protocol ? 'https:' : 'http:');
      if (s.list) {
        return proto+"//api.twitter.com/1/"+s.username[0]+"/lists/"+s.list+"/statuses.json?per_page="+s.count+"&callback=?";
      } else if (s.query == null && s.username.length == 1) {
        return proto+'//api.twitter.com/1/statuses/user_timeline.json?screen_name='+s.username[0]+'&count='+s.count+'&callback=?';
      } else {
        var query = (s.query || 'from:'+s.username.join(' OR from:'));
        return proto+'//search.twitter.com/search.json?&q='+escape(query)+'&rpp='+s.count+'&callback=?';
      }
    }

    return this.each(function(i, widget){
      var list = $('<ul class="tweet_list">').appendTo(widget);
      var intro = '<p class="tweet_intro">'+s.intro_text+'</p>';
      var outro = '<p class="tweet_outro">'+s.outro_text+'</p>';
      var loading = $('<p class="loading">'+s.loading_text+'</p>');

      if(typeof(s.username) == "string"){
        s.username = [s.username];
      }

      if (s.loading_text) $(widget).append(loading);
      $.getJSON(build_url(), function(data){
        if (s.loading_text) loading.remove();
        if (s.intro_text) list.before(intro);
        var tweets = (data.results || data);
        $.each(tweets, function(i,item){
          // auto join text based on verb tense and content
          if (s.join_text == "auto") {
            if (item.text.match(/^(@([A-Za-z0-9-_]+)) .*/i)) {
              var join_text = s.auto_join_text_reply;
            } else if (item.text.match(/(^\w+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+) .*/i)) {
              var join_text = s.auto_join_text_url;
            } else if (item.text.match(/^((\w+ed)|just) .*/im)) {
              var join_text = s.auto_join_text_ed;
            } else if (item.text.match(/^(\w*ing) .*/i)) {
              var join_text = s.auto_join_text_ing;
            } else {
              var join_text = s.auto_join_text_default;
            }
          } else {
            var join_text = s.join_text;
          };

          var from_user = item.from_user || item.user.screen_name;
          var profile_image_url = item.profile_image_url || item.user.profile_image_url;
          var join_template = '<span class="tweet_join"> '+join_text+' </span>';
          var join = ((s.join_text) ? join_template : ' ');
          var avatar_template = '<a class="tweet_avatar" href="http://twitter.com/'+from_user+'"><img src="'+profile_image_url+'" height="'+s.avatar_size+'" width="'+s.avatar_size+'" alt="'+from_user+'\'s avatar" title="'+from_user+'\'s avatar" border="0"/></a>';
          var avatar = (s.avatar_size ? avatar_template : '');
          var date = '<span class="tweet_time"><a href="http://twitter.com/'+from_user+'/statuses/'+item.id+'" title="view tweet on twitter">'+relative_time(item.created_at)+'</a></span>';
          var text = '<span class="tweet_text">' +$([item.text]).linkUrl().linkUser().linkHash().makeHeart().capAwesome().capEpic()[0]+ '</span>';

          // until we create a template option, arrange the items below to alter a tweet's display.
          list.append('<li>' + avatar + join + text + date + '</li>');

          list.children('li:first').addClass('tweet_first');
          list.children('li:odd').addClass('tweet_even');
          list.children('li:even').addClass('tweet_odd');
        });
        if (s.outro_text) list.after(outro);
        $(widget).trigger("loaded").trigger((tweets.length == 0 ? "empty" : "full"));
      });

    });
  };
})(jQuery);
/**/
/*!
 * jCarousel - Riding carousels with jQuery
 *   http://sorgalla.com/jcarousel/
 *
 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Built on top of the jQuery library
 *   http://jquery.com
 *
 * Inspired by the "Carousel Component" by Bill Scott
 *   http://billwscott.com/carousel/
 */

(function($) {
    /**
     * Creates a carousel for all matched elements.
     *
     * @example $("#mycarousel").jcarousel();
     * @before <ul id="mycarousel" class="jcarousel-skin-name"><li>First item</li><li>Second item</li></ul>
     * @result
     *
     * <div class="jcarousel-skin-name">
     *   <div class="jcarousel-container">
     *     <div class="jcarousel-clip">
     *       <ul class="jcarousel-list">
     *         <li class="jcarousel-item-1">First item</li>
     *         <li class="jcarousel-item-2">Second item</li>
     *       </ul>
     *     </div>
     *     <div disabled="disabled" class="jcarousel-prev jcarousel-prev-disabled"></div>
     *     <div class="jcarousel-next"></div>
     *   </div>
     * </div>
     *
     * @method jcarousel
     * @return jQuery
     * @param o {Hash|String} A set of key/value pairs to set as configuration properties or a method name to call on a formerly created instance.
     */
    $.fn.jcarousel = function(o) {
        if (typeof o == 'string') {
            var instance = $(this).data('jcarousel'), args = Array.prototype.slice.call(arguments, 1);
            return instance[o].apply(instance, args);
        } else
            return this.each(function() {
                $(this).data('jcarousel', new $jc(this, o));
            });
    };

    // Default configuration properties.
    var defaults = {
        vertical: false,
        rtl: false,
        start: 1,
        offset: 1,
        size: null,
        scroll: 3,
        visible: null,
        animation: 'normal',
        easing: 'swing',
        auto: 0,
        wrap: null,
        initCallback: null,
        reloadCallback: null,
        itemLoadCallback: null,
        itemFirstInCallback: null,
        itemFirstOutCallback: null,
        itemLastInCallback: null,
        itemLastOutCallback: null,
        itemVisibleInCallback: null,
        itemVisibleOutCallback: null,
        buttonNextHTML: '<div></div>',
        buttonPrevHTML: '<div></div>',
        buttonNextEvent: 'click',
        buttonPrevEvent: 'click',
        buttonNextCallback: null,
        buttonPrevCallback: null,
        itemFallbackDimension: null
    }, windowLoaded = false;

    $(window).bind('load.jcarousel', function() { windowLoaded = true; })

    /**
     * The jCarousel object.
     *
     * @constructor
     * @class jcarousel
     * @param e {HTMLElement} The element to create the carousel for.
     * @param o {Object} A set of key/value pairs to set as configuration properties.
     * @cat Plugins/jCarousel
     */
    $.jcarousel = function(e, o) {
        this.options    = $.extend({}, defaults, o || {});

        this.locked     = false;

        this.container  = null;
        this.clip       = null;
        this.list       = null;
        this.buttonNext = null;
        this.buttonPrev = null;

        // Only set if not explicitly passed as option
        if (!o || o.rtl === undefined)
            this.options.rtl = ($(e).attr('dir') || $('html').attr('dir') || '').toLowerCase() == 'rtl';

        this.wh = !this.options.vertical ? 'width' : 'height';
        this.lt = !this.options.vertical ? (this.options.rtl ? 'right' : 'left') : 'top';

        // Extract skin class
        var skin = '', split = e.className.split(' ');

        for (var i = 0; i < split.length; i++) {
            if (split[i].indexOf('jcarousel-skin') != -1) {
                $(e).removeClass(split[i]);
                skin = split[i];
                break;
            }
        }

        if (e.nodeName.toUpperCase() == 'UL' || e.nodeName.toUpperCase() == 'OL') {
            this.list = $(e);
            this.container = this.list.parent();

            if (this.container.hasClass('jcarousel-clip')) {
                if (!this.container.parent().hasClass('jcarousel-container'))
                    this.container = this.container.wrap('<div></div>');

                this.container = this.container.parent();
            } else if (!this.container.hasClass('jcarousel-container'))
                this.container = this.list.wrap('<div></div>').parent();
        } else {
            this.container = $(e);
            this.list = this.container.find('ul,ol').eq(0);
        }

        if (skin != '' && this.container.parent()[0].className.indexOf('jcarousel-skin') == -1)
            this.container.wrap('<div class=" '+ skin + '"></div>');

        this.clip = this.list.parent();

        if (!this.clip.length || !this.clip.hasClass('jcarousel-clip'))
            this.clip = this.list.wrap('<div></div>').parent();

        this.buttonNext = $('.jcarousel-next', this.container);

        if (this.buttonNext.size() == 0 && this.options.buttonNextHTML != null)
            this.buttonNext = this.clip.after(this.options.buttonNextHTML).next();

        this.buttonNext.addClass(this.className('jcarousel-next'));

        this.buttonPrev = $('.jcarousel-prev', this.container);

        if (this.buttonPrev.size() == 0 && this.options.buttonPrevHTML != null)
            this.buttonPrev = this.clip.after(this.options.buttonPrevHTML).next();

        this.buttonPrev.addClass(this.className('jcarousel-prev'));

        this.clip.addClass(this.className('jcarousel-clip')).css({
            overflow: 'hidden',
            position: 'relative'
        });
        this.list.addClass(this.className('jcarousel-list')).css({
            overflow: 'hidden',
            position: 'relative',
            top: 0,
            margin: 0,
            padding: 0
        }).css((this.options.rtl ? 'right' : 'left'), 0);
        this.container.addClass(this.className('jcarousel-container')).css({
            position: 'relative'
        });
        if (!this.options.vertical && this.options.rtl)
            this.container.addClass('jcarousel-direction-rtl').attr('dir', 'rtl');

        var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null;
        var li = this.list.children('li');

        var self = this;

        if (li.size() > 0) {
            var wh = 0, i = this.options.offset;
            li.each(function() {
                self.format(this, i++);
                wh += self.dimension(this, di);
            });

            this.list.css(this.wh, (wh + 100) + 'px');

            // Only set if not explicitly passed as option
            if (!o || o.size === undefined)
                this.options.size = li.size();
        }

        // For whatever reason, .show() does not work in Safari...
        this.container.css('display', 'block');
        this.buttonNext.css('display', 'block');
        this.buttonPrev.css('display', 'block');

        this.funcNext   = function() { self.next(); };
        this.funcPrev   = function() { self.prev(); };
        this.funcResize = function() { self.reload(); };

        if (this.options.initCallback != null)
            this.options.initCallback(this, 'init');

        if (!windowLoaded && $.browser.safari) {
            this.buttons(false, false);
            $(window).bind('load.jcarousel', function() { self.setup(); });
        } else
            this.setup();
    };

    // Create shortcut for internal use
    var $jc = $.jcarousel;

    $jc.fn = $jc.prototype = {
        jcarousel: '0.2.5'
    };

    $jc.fn.extend = $jc.extend = $.extend;

    $jc.fn.extend({
        /**
         * Setups the carousel.
         *
         * @method setup
         * @return undefined
         */
        setup: function() {
            this.first     = null;
            this.last      = null;
            this.prevFirst = null;
            this.prevLast  = null;
            this.animating = false;
            this.timer     = null;
            this.tail      = null;
            this.inTail    = false;

            if (this.locked)
                return;

            this.list.css(this.lt, this.pos(this.options.offset) + 'px');
            var p = this.pos(this.options.start);
            this.prevFirst = this.prevLast = null;
            this.animate(p, false);

            $(window).unbind('resize.jcarousel', this.funcResize).bind('resize.jcarousel', this.funcResize);
        },

        /**
         * Clears the list and resets the carousel.
         *
         * @method reset
         * @return undefined
         */
        reset: function() {
            this.list.empty();

            this.list.css(this.lt, '0px');
            this.list.css(this.wh, '10px');

            if (this.options.initCallback != null)
                this.options.initCallback(this, 'reset');

            this.setup();
        },

        /**
         * Reloads the carousel and adjusts positions.
         *
         * @method reload
         * @return undefined
         */
        reload: function() {
            if (this.tail != null && this.inTail)
                this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + this.tail);

            this.tail   = null;
            this.inTail = false;

            if (this.options.reloadCallback != null)
                this.options.reloadCallback(this);

            if (this.options.visible != null) {
                var self = this;
                var di = Math.ceil(this.clipping() / this.options.visible), wh = 0, lt = 0;
                this.list.children('li').each(function(i) {
                    wh += self.dimension(this, di);
                    if (i + 1 < self.first)
                        lt = wh;
                });

                this.list.css(this.wh, wh + 'px');
                this.list.css(this.lt, -lt + 'px');
            }

            this.scroll(this.first, false);
        },

        /**
         * Locks the carousel.
         *
         * @method lock
         * @return undefined
         */
        lock: function() {
            this.locked = true;
            this.buttons();
        },

        /**
         * Unlocks the carousel.
         *
         * @method unlock
         * @return undefined
         */
        unlock: function() {
            this.locked = false;
            this.buttons();
        },

        /**
         * Sets the size of the carousel.
         *
         * @method size
         * @return undefined
         * @param s {Number} The size of the carousel.
         */
        size: function(s) {
            if (s != undefined) {
                this.options.size = s;
                if (!this.locked)
                    this.buttons();
            }

            return this.options.size;
        },

        /**
         * Checks whether a list element exists for the given index (or index range).
         *
         * @method get
         * @return bool
         * @param i {Number} The index of the (first) element.
         * @param i2 {Number} The index of the last element.
         */
        has: function(i, i2) {
            if (i2 == undefined || !i2)
                i2 = i;

            if (this.options.size !== null && i2 > this.options.size)
                i2 = this.options.size;

            for (var j = i; j <= i2; j++) {
                var e = this.get(j);
                if (!e.length || e.hasClass('jcarousel-item-placeholder'))
                    return false;
            }

            return true;
        },

        /**
         * Returns a jQuery object with list element for the given index.
         *
         * @method get
         * @return jQuery
         * @param i {Number} The index of the element.
         */
        get: function(i) {
            return $('.jcarousel-item-' + i, this.list);
        },

        /**
         * Adds an element for the given index to the list.
         * If the element already exists, it updates the inner html.
         * Returns the created element as jQuery object.
         *
         * @method add
         * @return jQuery
         * @param i {Number} The index of the element.
         * @param s {String} The innerHTML of the element.
         */
        add: function(i, s) {
            var e = this.get(i), old = 0, n = $(s);

            if (e.length == 0) {
                var c, e = this.create(i), j = $jc.intval(i);
                while (c = this.get(--j)) {
                    if (j <= 0 || c.length) {
                        j <= 0 ? this.list.prepend(e) : c.after(e);
                        break;
                    }
                }
            } else
                old = this.dimension(e);

            if (n.get(0).nodeName.toUpperCase() == 'LI') {
                e.replaceWith(n);
                e = n;
            } else
                e.empty().append(s);

            this.format(e.removeClass(this.className('jcarousel-item-placeholder')), i);

            var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null;
            var wh = this.dimension(e, di) - old;

            if (i > 0 && i < this.first)
                this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - wh + 'px');

            this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) + wh + 'px');

            return e;
        },

        /**
         * Removes an element for the given index from the list.
         *
         * @method remove
         * @return undefined
         * @param i {Number} The index of the element.
         */
        remove: function(i) {
            var e = this.get(i);

            // Check if item exists and is not currently visible
            if (!e.length || (i >= this.first && i <= this.last))
                return;

            var d = this.dimension(e);

            if (i < this.first)
                this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + d + 'px');

            e.remove();

            this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) - d + 'px');
        },

        /**
         * Moves the carousel forwards.
         *
         * @method next
         * @return undefined
         */
        next: function() {
            this.stopAuto();

            if (this.tail != null && !this.inTail)
                this.scrollTail(false);
            else
                this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'last') && this.options.size != null && this.last == this.options.size) ? 1 : this.first + this.options.scroll);
        },

        /**
         * Moves the carousel backwards.
         *
         * @method prev
         * @return undefined
         */
        prev: function() {
            this.stopAuto();

            if (this.tail != null && this.inTail)
                this.scrollTail(true);
            else
                this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'first') && this.options.size != null && this.first == 1) ? this.options.size : this.first - this.options.scroll);
        },

        /**
         * Scrolls the tail of the carousel.
         *
         * @method scrollTail
         * @return undefined
         * @param b {Boolean} Whether scroll the tail back or forward.
         */
        scrollTail: function(b) {
            if (this.locked || this.animating || !this.tail)
                return;

            var pos  = $jc.intval(this.list.css(this.lt));

            !b ? pos -= this.tail : pos += this.tail;
            this.inTail = !b;

            // Save for callbacks
            this.prevFirst = this.first;
            this.prevLast  = this.last;

            this.animate(pos);
        },

        /**
         * Scrolls the carousel to a certain position.
         *
         * @method scroll
         * @return undefined
         * @param i {Number} The index of the element to scoll to.
         * @param a {Boolean} Flag indicating whether to perform animation.
         */
        scroll: function(i, a) {
            if (this.locked || this.animating)
                return;

            this.animate(this.pos(i), a);
        },

        /**
         * Prepares the carousel and return the position for a certian index.
         *
         * @method pos
         * @return {Number}
         * @param i {Number} The index of the element to scoll to.
         */
        pos: function(i) {
            var pos  = $jc.intval(this.list.css(this.lt));

            if (this.locked || this.animating)
                return pos;

            if (this.options.wrap != 'circular')
                i = i < 1 ? 1 : (this.options.size && i > this.options.size ? this.options.size : i);

            var back = this.first > i;

            // Create placeholders, new list width/height
            // and new list position
            var f = this.options.wrap != 'circular' && this.first <= 1 ? 1 : this.first;
            var c = back ? this.get(f) : this.get(this.last);
            var j = back ? f : f - 1;
            var e = null, l = 0, p = false, d = 0, g;

            while (back ? --j >= i : ++j < i) {
                e = this.get(j);
                p = !e.length;
                if (e.length == 0) {
                    e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));
                    c[back ? 'before' : 'after' ](e);

                    if (this.first != null && this.options.wrap == 'circular' && this.options.size !== null && (j <= 0 || j > this.options.size)) {
                        g = this.get(this.index(j));
                        if (g.length)
                            e = this.add(j, g.clone(true));
                    }
                }

                c = e;
                d = this.dimension(e);

                if (p)
                    l += d;

                if (this.first != null && (this.options.wrap == 'circular' || (j >= 1 && (this.options.size == null || j <= this.options.size))))
                    pos = back ? pos + d : pos - d;
            }

            // Calculate visible items
            var clipping = this.clipping();
            var cache = [];
            var visible = 0, j = i, v = 0;
            var c = this.get(i - 1);

            while (++visible) {
                e = this.get(j);
                p = !e.length;
                if (e.length == 0) {
                    e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));
                    // This should only happen on a next scroll
                    c.length == 0 ? this.list.prepend(e) : c[back ? 'before' : 'after' ](e);

                    if (this.first != null && this.options.wrap == 'circular' && this.options.size !== null && (j <= 0 || j > this.options.size)) {
                        g = this.get(this.index(j));
                        if (g.length)
                            e = this.add(j, g.clone(true));
                    }
                }

                c = e;
                var d = this.dimension(e);
                if (d == 0) {
                    throw new Error('jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...');
                }

                if (this.options.wrap != 'circular' && this.options.size !== null && j > this.options.size)
                    cache.push(e);
                else if (p)
                    l += d;

                v += d;

                if (v >= clipping)
                    break;

                j++;
            }

             // Remove out-of-range placeholders
            for (var x = 0; x < cache.length; x++)
                cache[x].remove();

            // Resize list
            if (l > 0) {
                this.list.css(this.wh, this.dimension(this.list) + l + 'px');

                if (back) {
                    pos -= l;
                    this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - l + 'px');
                }
            }

            // Calculate first and last item
            var last = i + visible - 1;
            if (this.options.wrap != 'circular' && this.options.size && last > this.options.size)
                last = this.options.size;

            if (j > last) {
                visible = 0, j = last, v = 0;
                while (++visible) {
                    var e = this.get(j--);
                    if (!e.length)
                        break;
                    v += this.dimension(e);
                    if (v >= clipping)
                        break;
                }
            }

            var first = last - visible + 1;
            if (this.options.wrap != 'circular' && first < 1)
                first = 1;

            if (this.inTail && back) {
                pos += this.tail;
                this.inTail = false;
            }

            this.tail = null;
            if (this.options.wrap != 'circular' && last == this.options.size && (last - visible + 1) >= 1) {
                var m = $jc.margin(this.get(last), !this.options.vertical ? 'marginRight' : 'marginBottom');
                if ((v - m) > clipping)
                    this.tail = v - clipping - m;
            }

            // Adjust position
            while (i-- > first)
                pos += this.dimension(this.get(i));

            // Save visible item range
            this.prevFirst = this.first;
            this.prevLast  = this.last;
            this.first     = first;
            this.last      = last;

            return pos;
        },

        /**
         * Animates the carousel to a certain position.
         *
         * @method animate
         * @return undefined
         * @param p {Number} Position to scroll to.
         * @param a {Boolean} Flag indicating whether to perform animation.
         */
        animate: function(p, a) {
            if (this.locked || this.animating)
                return;

            this.animating = true;

            var self = this;
            var scrolled = function() {
                self.animating = false;

                if (p == 0)
                    self.list.css(self.lt,  0);

                if (self.options.wrap == 'circular' || self.options.wrap == 'both' || self.options.wrap == 'last' || self.options.size == null || self.last < self.options.size)
                    self.startAuto();

                self.buttons();
                self.notify('onAfterAnimation');

                // This function removes items which are appended automatically for circulation.
                // This prevents the list from growing infinitely.
                if (self.options.wrap == 'circular' && self.options.size !== null)
                    for (var i = self.prevFirst; i <= self.prevLast; i++)
                        if (i !== null && !(i >= self.first && i <= self.last) && (i < 1 || i > self.options.size))
                            self.remove(i);
            };

            this.notify('onBeforeAnimation');

            // Animate
            if (!this.options.animation || a == false) {
                this.list.css(this.lt, p + 'px');
                scrolled();
            } else {
                var o = !this.options.vertical ? (this.options.rtl ? {'right': p} : {'left': p}) : {'top': p};
                this.list.animate(o, this.options.animation, this.options.easing, scrolled);
            }
        },

        /**
         * Starts autoscrolling.
         *
         * @method auto
         * @return undefined
         * @param s {Number} Seconds to periodically autoscroll the content.
         */
        startAuto: function(s) {
            if (s != undefined)
                this.options.auto = s;

            if (this.options.auto == 0)
                return this.stopAuto();

            if (this.timer != null)
                return;

            var self = this;
            this.timer = setTimeout(function() { self.next(); }, this.options.auto * 1000);
        },

        /**
         * Stops autoscrolling.
         *
         * @method stopAuto
         * @return undefined
         */
        stopAuto: function() {
            if (this.timer == null)
                return;

            clearTimeout(this.timer);
            this.timer = null;
        },

        /**
         * Sets the states of the prev/next buttons.
         *
         * @method buttons
         * @return undefined
         */
        buttons: function(n, p) {
            if (n == undefined || n == null) {
                var n = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'first') || this.options.size == null || this.last < this.options.size);
                if (!this.locked && (!this.options.wrap || this.options.wrap == 'first') && this.options.size != null && this.last >= this.options.size)
                    n = this.tail != null && !this.inTail;
            }

            if (p == undefined || p == null) {
                var p = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'last') || this.first > 1);
                if (!this.locked && (!this.options.wrap || this.options.wrap == 'last') && this.options.size != null && this.first == 1)
                    p = this.tail != null && this.inTail;
            }

            var self = this;

            this.buttonNext[n ? 'bind' : 'unbind'](this.options.buttonNextEvent + '.jcarousel', this.funcNext)[n ? 'removeClass' : 'addClass'](this.className('jcarousel-next-disabled')).attr('disabled', n ? false : true);
            this.buttonPrev[p ? 'bind' : 'unbind'](this.options.buttonPrevEvent + '.jcarousel', this.funcPrev)[p ? 'removeClass' : 'addClass'](this.className('jcarousel-prev-disabled')).attr('disabled', p ? false : true);

            if (this.options.buttonNextCallback != null && this.buttonNext.data('jcarouselstate') != n) {
                this.buttonNext.each(function() { self.options.buttonNextCallback(self, this, n); }).data('jcarouselstate', n);
            }

            if (this.options.buttonPrevCallback != null && (this.buttonPrev.data('jcarouselstate') != p)) {
                this.buttonPrev.each(function() { self.options.buttonPrevCallback(self, this, p); }).data('jcarouselstate', p);
            }
        },

        /**
         * Notify callback of a specified event.
         *
         * @method notify
         * @return undefined
         * @param evt {String} The event name
         */
        notify: function(evt) {
            var state = this.prevFirst == null ? 'init' : (this.prevFirst < this.first ? 'next' : 'prev');

            // Load items
            this.callback('itemLoadCallback', evt, state);

            if (this.prevFirst !== this.first) {
                this.callback('itemFirstInCallback', evt, state, this.first);
                this.callback('itemFirstOutCallback', evt, state, this.prevFirst);
            }

            if (this.prevLast !== this.last) {
                this.callback('itemLastInCallback', evt, state, this.last);
                this.callback('itemLastOutCallback', evt, state, this.prevLast);
            }

            this.callback('itemVisibleInCallback', evt, state, this.first, this.last, this.prevFirst, this.prevLast);
            this.callback('itemVisibleOutCallback', evt, state, this.prevFirst, this.prevLast, this.first, this.last);
        },

        callback: function(cb, evt, state, i1, i2, i3, i4) {
            if (this.options[cb] == undefined || (typeof this.options[cb] != 'object' && evt != 'onAfterAnimation'))
                return;

            var callback = typeof this.options[cb] == 'object' ? this.options[cb][evt] : this.options[cb];

            if (!$.isFunction(callback))
                return;

            var self = this;

            if (i1 === undefined)
                callback(self, state, evt);
            else if (i2 === undefined)
                this.get(i1).each(function() { callback(self, this, i1, state, evt); });
            else {
                for (var i = i1; i <= i2; i++)
                    if (i !== null && !(i >= i3 && i <= i4))
                        this.get(i).each(function() { callback(self, this, i, state, evt); });
            }
        },

        create: function(i) {
            return this.format('<li></li>', i);
        },

        format: function(e, i) {
            var e = $(e), split = e.get(0).className.split(' ');
            for (var j = 0; j < split.length; j++) {
                if (split[j].indexOf('jcarousel-') != -1) {
                    e.removeClass(split[j]);
                }
            }
            e.addClass(this.className('jcarousel-item')).addClass(this.className('jcarousel-item-' + i)).css({
                'float': (this.options.rtl ? 'right' : 'left'),
                'list-style': 'none'
            }).attr('jcarouselindex', i);
            return e;
        },

        className: function(c) {
            return c + ' ' + c + (!this.options.vertical ? '-horizontal' : '-vertical');
        },

        dimension: function(e, d) {
            var el = e.jquery != undefined ? e[0] : e;

            var old = !this.options.vertical ?
                (el.offsetWidth || $jc.intval(this.options.itemFallbackDimension)) + $jc.margin(el, 'marginLeft') + $jc.margin(el, 'marginRight') :
                (el.offsetHeight || $jc.intval(this.options.itemFallbackDimension)) + $jc.margin(el, 'marginTop') + $jc.margin(el, 'marginBottom');

            if (d == undefined || old == d)
                return old;

            var w = !this.options.vertical ?
                d - $jc.margin(el, 'marginLeft') - $jc.margin(el, 'marginRight') :
                d - $jc.margin(el, 'marginTop') - $jc.margin(el, 'marginBottom');

            $(el).css(this.wh, w + 'px');

            return this.dimension(el);
        },

        clipping: function() {
            return !this.options.vertical ?
                this.clip[0].offsetWidth - $jc.intval(this.clip.css('borderLeftWidth')) - $jc.intval(this.clip.css('borderRightWidth')) :
                this.clip[0].offsetHeight - $jc.intval(this.clip.css('borderTopWidth')) - $jc.intval(this.clip.css('borderBottomWidth'));
        },

        index: function(i, s) {
            if (s == undefined)
                s = this.options.size;

            return Math.round((((i-1) / s) - Math.floor((i-1) / s)) * s) + 1;
        }
    });

    $jc.extend({
        /**
         * Gets/Sets the global default configuration properties.
         *
         * @method defaults
         * @return {Object}
         * @param d {Object} A set of key/value pairs to set as configuration properties.
         */
        defaults: function(d) {
            return $.extend(defaults, d || {});
        },

        margin: function(e, p) {
            if (!e)
                return 0;

            var el = e.jquery != undefined ? e[0] : e;

            if (p == 'marginRight' && $.browser.safari) {
                var old = {'display': 'block', 'float': 'none', 'width': 'auto'}, oWidth, oWidth2;

                $.swap(el, old, function() { oWidth = el.offsetWidth; });

                old['marginRight'] = 0;
                $.swap(el, old, function() { oWidth2 = el.offsetWidth; });

                return oWidth2 - oWidth;
            }

            return $jc.intval($.css(el, p));
        },

        intval: function(v) {
            v = parseInt(v);
            return isNaN(v) ? 0 : v;
        }
    });

})(jQuery);
/**/
/*
 * 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. 
 *
 */
 /**/
 /*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/

var swfobject = function() {
	
	var UNDEF = "undefined",
		OBJECT = "object",
		SHOCKWAVE_FLASH = "Shockwave Flash",
		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
		FLASH_MIME_TYPE = "application/x-shockwave-flash",
		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
		ON_READY_STATE_CHANGE = "onreadystatechange",
		
		win = window,
		doc = document,
		nav = navigator,
		
		plugin = false,
		domLoadFnArr = [main],
		regObjArr = [],
		objIdArr = [],
		listenersArr = [],
		storedAltContent,
		storedAltContentId,
		storedCallbackFn,
		storedCallbackObj,
		isDomLoaded = false,
		isExpressInstallActive = false,
		dynamicStylesheet,
		dynamicStylesheetMedia,
		autoHideShow = true,
	
	/* Centralized function for browser feature detection
		- User agent string detection is only used when no good alternative is possible
		- Is executed directly for optimal performance
	*/	
	ua = function() {
		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
			u = nav.userAgent.toLowerCase(),
			p = nav.platform.toLowerCase(),
			windows = p ? /win/.test(p) : /win/.test(u),
			mac = p ? /mac/.test(p) : /mac/.test(u),
			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
			playerVersion = [0,0,0],
			d = null;
		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
			d = nav.plugins[SHOCKWAVE_FLASH].description;
			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
				plugin = true;
				ie = false; // cascaded feature detection for Internet Explorer
				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
			}
		}
		else if (typeof win.ActiveXObject != UNDEF) {
			try {
				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
				if (a) { // a will return null when ActiveX is disabled
					d = a.GetVariable("$version");
					if (d) {
						ie = true; // cascaded feature detection for Internet Explorer
						d = d.split(" ")[1].split(",");
						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
					}
				}
			}
			catch(e) {}
		}
		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
	}(),
	
	/* Cross-browser onDomLoad
		- Will fire an event as soon as the DOM of a web page is loaded
		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
		- Regular onload serves as fallback
	*/ 
	onDomLoad = function() {
		if (!ua.w3) { return; }
		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
			callDomLoadFunctions();
		}
		if (!isDomLoaded) {
			if (typeof doc.addEventListener != UNDEF) {
				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
			}		
			if (ua.ie && ua.win) {
				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
					if (doc.readyState == "complete") {
						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
						callDomLoadFunctions();
					}
				});
				if (win == top) { // if not inside an iframe
					(function(){
						if (isDomLoaded) { return; }
						try {
							doc.documentElement.doScroll("left");
						}
						catch(e) {
							setTimeout(arguments.callee, 0);
							return;
						}
						callDomLoadFunctions();
					})();
				}
			}
			if (ua.wk) {
				(function(){
					if (isDomLoaded) { return; }
					if (!/loaded|complete/.test(doc.readyState)) {
						setTimeout(arguments.callee, 0);
						return;
					}
					callDomLoadFunctions();
				})();
			}
			addLoadEvent(callDomLoadFunctions);
		}
	}();
	
	function callDomLoadFunctions() {
		if (isDomLoaded) { return; }
		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
			t.parentNode.removeChild(t);
		}
		catch (e) { return; }
		isDomLoaded = true;
		var dl = domLoadFnArr.length;
		for (var i = 0; i < dl; i++) {
			domLoadFnArr[i]();
		}
	}
	
	function addDomLoadEvent(fn) {
		if (isDomLoaded) {
			fn();
		}
		else { 
			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
		}
	}
	
	/* Cross-browser onload
		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
		- Will fire an event as soon as a web page including all of its assets are loaded 
	 */
	function addLoadEvent(fn) {
		if (typeof win.addEventListener != UNDEF) {
			win.addEventListener("load", fn, false);
		}
		else if (typeof doc.addEventListener != UNDEF) {
			doc.addEventListener("load", fn, false);
		}
		else if (typeof win.attachEvent != UNDEF) {
			addListener(win, "onload", fn);
		}
		else if (typeof win.onload == "function") {
			var fnOld = win.onload;
			win.onload = function() {
				fnOld();
				fn();
			};
		}
		else {
			win.onload = fn;
		}
	}
	
	/* Main function
		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
	*/
	function main() { 
		if (plugin) {
			testPlayerVersion();
		}
		else {
			matchVersions();
		}
	}
	
	/* Detect the Flash Player version for non-Internet Explorer browsers
		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
		  a. Both release and build numbers can be detected
		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
	*/
	function testPlayerVersion() {
		var b = doc.getElementsByTagName("body")[0];
		var o = createElement(OBJECT);
		o.setAttribute("type", FLASH_MIME_TYPE);
		var t = b.appendChild(o);
		if (t) {
			var counter = 0;
			(function(){
				if (typeof t.GetVariable != UNDEF) {
					var d = t.GetVariable("$version");
					if (d) {
						d = d.split(" ")[1].split(",");
						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
					}
				}
				else if (counter < 10) {
					counter++;
					setTimeout(arguments.callee, 10);
					return;
				}
				b.removeChild(o);
				t = null;
				matchVersions();
			})();
		}
		else {
			matchVersions();
		}
	}
	
	/* Perform Flash Player and SWF version matching; static publishing only
	*/
	function matchVersions() {
		var rl = regObjArr.length;
		if (rl > 0) {
			for (var i = 0; i < rl; i++) { // for each registered object element
				var id = regObjArr[i].id;
				var cb = regObjArr[i].callbackFn;
				var cbObj = {success:false, id:id};
				if (ua.pv[0] > 0) {
					var obj = getElementById(id);
					if (obj) {
						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
							setVisibility(id, true);
							if (cb) {
								cbObj.success = true;
								cbObj.ref = getObjectById(id);
								cb(cbObj);
							}
						}
						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
							var att = {};
							att.data = regObjArr[i].expressInstall;
							att.width = obj.getAttribute("width") || "0";
							att.height = obj.getAttribute("height") || "0";
							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
							// parse HTML object param element's name-value pairs
							var par = {};
							var p = obj.getElementsByTagName("param");
							var pl = p.length;
							for (var j = 0; j < pl; j++) {
								if (p[j].getAttribute("name").toLowerCase() != "movie") {
									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
								}
							}
							showExpressInstall(att, par, id, cb);
						}
						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
							displayAltContent(obj);
							if (cb) { cb(cbObj); }
						}
					}
				}
				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
					setVisibility(id, true);
					if (cb) {
						var o = getObjectById(id); // test whether there is an HTML object element or not
						if (o && typeof o.SetVariable != UNDEF) { 
							cbObj.success = true;
							cbObj.ref = o;
						}
						cb(cbObj);
					}
				}
			}
		}
	}
	
	function getObjectById(objectIdStr) {
		var r = null;
		var o = getElementById(objectIdStr);
		if (o && o.nodeName == "OBJECT") {
			if (typeof o.SetVariable != UNDEF) {
				r = o;
			}
			else {
				var n = o.getElementsByTagName(OBJECT)[0];
				if (n) {
					r = n;
				}
			}
		}
		return r;
	}
	
	/* Requirements for Adobe Express Install
		- only one instance can be active at a time
		- fp 6.0.65 or higher
		- Win/Mac OS only
		- no Webkit engines older than version 312
	*/
	function canExpressInstall() {
		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
	}
	
	/* Show the Adobe Express Install dialog
		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
	*/
	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
		isExpressInstallActive = true;
		storedCallbackFn = callbackFn || null;
		storedCallbackObj = {success:false, id:replaceElemIdStr};
		var obj = getElementById(replaceElemIdStr);
		if (obj) {
			if (obj.nodeName == "OBJECT") { // static publishing
				storedAltContent = abstractAltContent(obj);
				storedAltContentId = null;
			}
			else { // dynamic publishing
				storedAltContent = obj;
				storedAltContentId = replaceElemIdStr;
			}
			att.id = EXPRESS_INSTALL_ID;
			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
				fv = "MMredirectURL=" + win.location.toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
			if (typeof par.flashvars != UNDEF) {
				par.flashvars += "&" + fv;
			}
			else {
				par.flashvars = fv;
			}
			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
			if (ua.ie && ua.win && obj.readyState != 4) {
				var newObj = createElement("div");
				replaceElemIdStr += "SWFObjectNew";
				newObj.setAttribute("id", replaceElemIdStr);
				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
				obj.style.display = "none";
				(function(){
					if (obj.readyState == 4) {
						obj.parentNode.removeChild(obj);
					}
					else {
						setTimeout(arguments.callee, 10);
					}
				})();
			}
			createSWF(att, par, replaceElemIdStr);
		}
	}
	
	/* Functions to abstract and display alternative content
	*/
	function displayAltContent(obj) {
		if (ua.ie && ua.win && obj.readyState != 4) {
			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
			var el = createElement("div");
			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
			el.parentNode.replaceChild(abstractAltContent(obj), el);
			obj.style.display = "none";
			(function(){
				if (obj.readyState == 4) {
					obj.parentNode.removeChild(obj);
				}
				else {
					setTimeout(arguments.callee, 10);
				}
			})();
		}
		else {
			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
		}
	} 

	function abstractAltContent(obj) {
		var ac = createElement("div");
		if (ua.win && ua.ie) {
			ac.innerHTML = obj.innerHTML;
		}
		else {
			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
			if (nestedObj) {
				var c = nestedObj.childNodes;
				if (c) {
					var cl = c.length;
					for (var i = 0; i < cl; i++) {
						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
							ac.appendChild(c[i].cloneNode(true));
						}
					}
				}
			}
		}
		return ac;
	}
	
	/* Cross-browser dynamic SWF creation
	*/
	function createSWF(attObj, parObj, id) {
		var r, el = getElementById(id);
		if (ua.wk && ua.wk < 312) { return r; }
		if (el) {
			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
				attObj.id = id;
			}
			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
				var att = "";
				for (var i in attObj) {
					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
						if (i.toLowerCase() == "data") {
							parObj.movie = attObj[i];
						}
						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
							att += ' class="' + attObj[i] + '"';
						}
						else if (i.toLowerCase() != "classid") {
							att += ' ' + i + '="' + attObj[i] + '"';
						}
					}
				}
				var par = "";
				for (var j in parObj) {
					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
					}
				}
				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
				r = getElementById(attObj.id);	
			}
			else { // well-behaving browsers
				var o = createElement(OBJECT);
				o.setAttribute("type", FLASH_MIME_TYPE);
				for (var m in attObj) {
					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
							o.setAttribute("class", attObj[m]);
						}
						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
							o.setAttribute(m, attObj[m]);
						}
					}
				}
				for (var n in parObj) {
					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
						createObjParam(o, n, parObj[n]);
					}
				}
				el.parentNode.replaceChild(o, el);
				r = o;
			}
		}
		return r;
	}
	
	function createObjParam(el, pName, pValue) {
		var p = createElement("param");
		p.setAttribute("name", pName);	
		p.setAttribute("value", pValue);
		el.appendChild(p);
	}
	
	/* Cross-browser SWF removal
		- Especially needed to safely and completely remove a SWF in Internet Explorer
	*/
	function removeSWF(id) {
		var obj = getElementById(id);
		if (obj && obj.nodeName == "OBJECT") {
			if (ua.ie && ua.win) {
				obj.style.display = "none";
				(function(){
					if (obj.readyState == 4) {
						removeObjectInIE(id);
					}
					else {
						setTimeout(arguments.callee, 10);
					}
				})();
			}
			else {
				obj.parentNode.removeChild(obj);
			}
		}
	}
	
	function removeObjectInIE(id) {
		var obj = getElementById(id);
		if (obj) {
			for (var i in obj) {
				if (typeof obj[i] == "function") {
					obj[i] = null;
				}
			}
			obj.parentNode.removeChild(obj);
		}
	}
	
	/* Functions to optimize JavaScript compression
	*/
	function getElementById(id) {
		var el = null;
		try {
			el = doc.getElementById(id);
		}
		catch (e) {}
		return el;
	}
	
	function createElement(el) {
		return doc.createElement(el);
	}
	
	/* Updated attachEvent function for Internet Explorer
		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
	*/	
	function addListener(target, eventType, fn) {
		target.attachEvent(eventType, fn);
		listenersArr[listenersArr.length] = [target, eventType, fn];
	}
	
	/* Flash Player and SWF content version matching
	*/
	function hasPlayerVersion(rv) {
		var pv = ua.pv, v = rv.split(".");
		v[0] = parseInt(v[0], 10);
		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
		v[2] = parseInt(v[2], 10) || 0;
		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
	}
	
	/* Cross-browser dynamic CSS creation
		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
	*/	
	function createCSS(sel, decl, media, newStyle) {
		if (ua.ie && ua.mac) { return; }
		var h = doc.getElementsByTagName("head")[0];
		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
		var m = (media && typeof media == "string") ? media : "screen";
		if (newStyle) {
			dynamicStylesheet = null;
			dynamicStylesheetMedia = null;
		}
		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
			// create dynamic stylesheet + get a global reference to it
			var s = createElement("style");
			s.setAttribute("type", "text/css");
			s.setAttribute("media", m);
			dynamicStylesheet = h.appendChild(s);
			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
			}
			dynamicStylesheetMedia = m;
		}
		// add style rule
		if (ua.ie && ua.win) {
			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
				dynamicStylesheet.addRule(sel, decl);
			}
		}
		else {
			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
			}
		}
	}
	
	function setVisibility(id, isVisible) {
		if (!autoHideShow) { return; }
		var v = isVisible ? "visible" : "hidden";
		if (isDomLoaded && getElementById(id)) {
			getElementById(id).style.visibility = v;
		}
		else {
			createCSS("#" + id, "visibility:" + v);
		}
	}

	/* Filter to avoid XSS attacks
	*/
	function urlEncodeIfNecessary(s) {
		var regex = /[\\\"<>\.;]/;
		var hasBadChars = regex.exec(s) != null;
		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
	}
	
	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
	*/
	var cleanup = function() {
		if (ua.ie && ua.win) {
			window.attachEvent("onunload", function() {
				// remove listeners to avoid memory leaks
				var ll = listenersArr.length;
				for (var i = 0; i < ll; i++) {
					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
				}
				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
				var il = objIdArr.length;
				for (var j = 0; j < il; j++) {
					removeSWF(objIdArr[j]);
				}
				// cleanup library's main closures to avoid memory leaks
				for (var k in ua) {
					ua[k] = null;
				}
				ua = null;
				for (var l in swfobject) {
					swfobject[l] = null;
				}
				swfobject = null;
			});
		}
	}();
	
	return {
		/* Public API
			- Reference: http://code.google.com/p/swfobject/wiki/documentation
		*/ 
		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
			if (ua.w3 && objectIdStr && swfVersionStr) {
				var regObj = {};
				regObj.id = objectIdStr;
				regObj.swfVersion = swfVersionStr;
				regObj.expressInstall = xiSwfUrlStr;
				regObj.callbackFn = callbackFn;
				regObjArr[regObjArr.length] = regObj;
				setVisibility(objectIdStr, false);
			}
			else if (callbackFn) {
				callbackFn({success:false, id:objectIdStr});
			}
		},
		
		getObjectById: function(objectIdStr) {
			if (ua.w3) {
				return getObjectById(objectIdStr);
			}
		},
		
		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
			var callbackObj = {success:false, id:replaceElemIdStr};
			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
				setVisibility(replaceElemIdStr, false);
				addDomLoadEvent(function() {
					widthStr += ""; // auto-convert to string
					heightStr += "";
					var att = {};
					if (attObj && typeof attObj === OBJECT) {
						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
							att[i] = attObj[i];
						}
					}
					att.data = swfUrlStr;
					att.width = widthStr;
					att.height = heightStr;
					var par = {}; 
					if (parObj && typeof parObj === OBJECT) {
						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
							par[j] = parObj[j];
						}
					}
					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
							if (typeof par.flashvars != UNDEF) {
								par.flashvars += "&" + k + "=" + flashvarsObj[k];
							}
							else {
								par.flashvars = k + "=" + flashvarsObj[k];
							}
						}
					}
					if (hasPlayerVersion(swfVersionStr)) { // create SWF
						var obj = createSWF(att, par, replaceElemIdStr);
						if (att.id == replaceElemIdStr) {
							setVisibility(replaceElemIdStr, true);
						}
						callbackObj.success = true;
						callbackObj.ref = obj;
					}
					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
						att.data = xiSwfUrlStr;
						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
						return;
					}
					else { // show alternative content
						setVisibility(replaceElemIdStr, true);
					}
					if (callbackFn) { callbackFn(callbackObj); }
				});
			}
			else if (callbackFn) { callbackFn(callbackObj);	}
		},
		
		switchOffAutoHideShow: function() {
			autoHideShow = false;
		},
		
		ua: ua,
		
		getFlashPlayerVersion: function() {
			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
		},
		
		hasFlashPlayerVersion: hasPlayerVersion,
		
		createSWF: function(attObj, parObj, replaceElemIdStr) {
			if (ua.w3) {
				return createSWF(attObj, parObj, replaceElemIdStr);
			}
			else {
				return undefined;
			}
		},
		
		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
			if (ua.w3 && canExpressInstall()) {
				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
			}
		},
		
		removeSWF: function(objElemIdStr) {
			if (ua.w3) {
				removeSWF(objElemIdStr);
			}
		},
		
		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
			if (ua.w3) {
				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
			}
		},
		
		addDomLoadEvent: addDomLoadEvent,
		
		addLoadEvent: addLoadEvent,
		
		getQueryParamValue: function(param) {
			var q = doc.location.search || doc.location.hash;
			if (q) {
				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
				if (param == null) {
					return urlEncodeIfNecessary(q);
				}
				var pairs = q.split("&");
				for (var i = 0; i < pairs.length; i++) {
					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
					}
				}
			}
			return "";
		},
		
		// For internal usage only
		expressInstallCallback: function() {
			if (isExpressInstallActive) {
				var obj = getElementById(EXPRESS_INSTALL_ID);
				if (obj && storedAltContent) {
					obj.parentNode.replaceChild(storedAltContent, obj);
					if (storedAltContentId) {
						setVisibility(storedAltContentId, true);
						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
					}
					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
				}
				isExpressInstallActive = false;
			} 
		}
	};
}();
/**/
/* 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(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(i){var g=i||window.event,f=[].slice.call(arguments,1),j=0,h=true,e=0,d=0;i=c.event.fix(g);i.type="mousewheel";if(i.wheelDelta){j=i.wheelDelta/120}if(i.detail){j=-i.detail/3}d=j;if(g.axis!==undefined&&g.axis===g.HORIZONTAL_AXIS){d=0;e=-1*j}if(g.wheelDeltaY!==undefined){d=g.wheelDeltaY/120}if(g.wheelDeltaX!==undefined){e=-1*g.wheelDeltaX/120}f.unshift(i,j,e,d);return c.event.handle.apply(this,f)}})(jQuery);
/**/
/*  
 *  Slider Kit v1.4 (packed) - Sliding contents with jQuery
 *  http://www.kyrielles.net/sliderkit
 *  
 *  Copyright (c) 2010-2011 Alan Frog
 *  Licensed under the GNU General Public License
 *  See <license.txt> or <http://www.gnu.org/licenses/>
 *  
 *  Requires : jQuery v1.3+ <http://jquery.com/>
 * 
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(7(m){o n=7(){o l=3;3.22=7(c,d){3.4=$.2K({},3.23,d);3.r=$(c);3.C=$("."+3.4.s+"-1B",3.r);3.t=$("."+3.4.s+"-t",3.r);3.13=$("."+3.4.s+"-t-2L",3.t);3.v=3.C.H();3.I=3.v>0?1:0;3.1g=3.13.H()>0?1:0;6(!3.I&&!3.1g){3.1h("2M",3.4.1i,1)}x 6(3.r.w("J")=="W"&&!3.4.1j){3.1h("2N",3.4.1i,1)}3.r.w("24","2O");3.p=0;3.14=0;3.1C=0;3.K=9;3.1D=1;3.1k=0;3.X=9;3.2P=q;3.8={1l:3.4.s+"-2Q",D:3.4.s+"-1B-2R",M:3.4.s+"-1B-2S",E:3.4.s+"-15-2T",1E:3.4.s+"-C-2U",16:3.4.s+"-2V-15",2W:"+"};6(3.1g){3.25()}3.26();6(3.I){3.1F=$("."+3.4.s+"-C",3.r);6(3.4.1m=="1n"){3.27()}}3.1o=!3.I?1:0;6(3.4.1G){3.r.1G(7(a,b){b>0?l.y(9,"+=",9,l.1o,1):l.y(9,"-=",9,l.1o,1);u q})}6(3.4.28){3.r.2X(7(a){6(a.29==37){l.2a()}x 6(a.29==39){l.1H()}})}6(3.4.2b&&3.I){3.1F.N(7(){l.1H();u q})}3.y(9,"",3.4.2c,0,9);6(3.4.W){3.1p();6(!3.1q){3.r.2d(7(){6(l.X!=9){l.1r()}},7(){l.1p()})}}u 3};3.1h=7(a,b,c){6(b){2Y("2Z 30 31! 32 #"+a+" (33 34)")}6(c){u q}};3.25=7(){3.O=$("1I",3.13);o c=$("17",3.O);o d=c.H();6(3.I&&(d!=3.v)&&3.t.H()==1){3.1h("35",3.4.1i,1)}6(3.4.2e){3.4.Y=3.v}x{7 18(a){1J=c.w(a);6(1J!="W"&&a!=""&&a!="36"){u 38(1J)}x u 0}o e=3.4.B?3.t.J():3.t.P();o f=c.3a(z);o g=c.3b(z);o h=18("19-Q")+18("19-3c");o i=18("19-R")+18("19-3d");3.S=3.4.B?g:f;3.1K=3.S*d;3.1a=(3.4.Y*3.S)-(3.4.B?i:h);3.1s=3.4.B?"R":"Q";o j=3.4.B?"J":"P";o k=3.4.B?"P":"J";c.w({P:c.P(),J:c.J()});3.O.w(j,3.1K+"1L");3.13.w({P:3.4.B?f:3.1a,J:3.4.B?3.1a:g});6(3.4.2f){3.13.w(3.1s,(e-3.1a)/2).w("19","0")}3.v=d;6(3.v>3.4.Y){3.1k=z;6(3.4.F==9||3.4.F<0||3.4.F>3.v){3.4.F=3.4.Y}3.1t=$("."+3.4.s+"-t-15",3.t);6(3.1t.H()>0){3.2g()}}}6(3.I){6(3.4.2h){c.1M(7(){l.1N(1O(3,"17"))})}x{c.N(7(){l.1N(1O(3,"17"));u q})}7 1O(a,b){u $(b,m(a).3e()).3f(a)}}};3.2g=7(a){3.2i=z;3.Z=$("."+3.4.s+"-t-2j",3.t);3.1b=$("."+3.4.s+"-t-2k",3.t);3.Z.N(7(){l.1u();u q});3.1b.N(7(){l.1v();u q});6(3.4.2l){3.Z.1M(7(){l.1u(z)});3.1b.1M(7(){l.1v(z)});3.1t.3g(7(){l.2m()})}6(!3.4.1c){3.Z.3h(3.8.E)}};3.1P=7(){3.10=3.4.B?3.O.1Q().R:3.O.1Q().Q;3.T=11.3i(11.1w(3.10)/3.S);3.L=11.3j((3.1K-11.1w(3.10)-3.1a)/3.S);6(3.L<0){3.L=0}};3.26=7(){3.U=$("."+3.4.s+"-3k-15",3.r);3.12=$("."+3.4.s+"-1R-15",3.r);3.1q=3.U.H()>0?1:0;3.1d=3.12.H()>0?1:0;6(3.1q){6(3.4.W){3.U.A(3.8.16)}3.U.N(7(){6(l.U.1S(l.8.16)){l.1T()}x{l.2n()}u q})}6(3.1d){3.1x=$("."+3.4.s+"-1R-2j",3.r);3.1y=$("."+3.4.s+"-1R-2k",3.r);6(3.4.2o){3.12.1z();$("."+3.4.s+"-C",3.r).2d(7(){l.12.2p()},7(){l.12.3l()})}3.1x.N(7(){l.2q();u q});3.1y.N(7(){l.2r();u q})}};3.27=7(){3.C.3m(\'<2s 3n="\'+3.8.1E+\'"></2s>\');3.1U=$("."+3.8.1E,3.1F);3.1U.w({"1Q":"3o"})};3.1T=7(){3.U.G(3.8.16);3.1r()};3.2n=7(){3.U.A(l.8.16);3.1p()};3.1N=7(a){3.y(9,"",a,0,1)};3.2a=7(){3.y(9,"+=",9,0,1)};3.1H=7(){3.y(9,"-=",9,0,1)};3.1u=7(c){6(c){l.1e="-="}3.y(3.Z,"+=",9,1,1)};3.1v=7(c){6(c){l.1e="+="}3.y(3.1b,"-=",9,1,1)};3.2m=7(){l.1e=""};3.2q=7(){3.y(3.1x,"+=",9,0,1)};3.2r=7(){3.y(3.1y,"-=",9,0,1)};3.y=7(a,b,c,d,e){6(e&&3.X!=9&&3.1q){3.1T()}6(a!=9){6(a.1S(3.8.E)){u q}}o f=0;o g=$(":3p",3.4.2t?3.t:3.r).H()>0?1:0;6(!g){6(c==9&&!d){3.p=b=="-="?3.p+1:3.p-1}x 6(c!=9){3.p=c}6(3.1d){3.12.G(3.8.E)}6(!3.4.1c){6(3.p==-1){3.p=0;f=1}6(3.p==0&&3.1d){3.1x.A(3.8.E)}6(3.p==3.v){3.p=3.v-1;f=1}6(3.p==3.v-1){6(3.4.W){3.1r()}6(3.1d){3.1y.A(3.8.E)}}}x 6(!3.1k){6(3.p==3.v){3.p=0}6(3.p==-1){3.p=3.v-1}}6(c==9&&3.1k&&!f){3.2u(d,b)}6(3.1g){3.2v(3.p)}6(3.I){3.2w(3.p,b)}}};3.2v=7(a){$("1I 17."+3.8.1l,3.t).G(3.8.1l);$("1I 17:2x("+a+")",3.t).A(3.8.1l)};3.2u=7(a,b){3.1P();6(!a){o c=11.1w(3.p+1-3.T);o d=3.v-3.L-3.p}6(a||d==0||c==0){o e=b=="-="?3.L:3.T;o f=e<3.4.F?e:3.4.F;o g=f*3.S;3.14=b=="-="?3.T+f:3.T-f+3.4.Y-1;6((b=="-="&&3.14>3.p)||(b=="+="&&3.14<3.p)){3.p=3.14}6(3.4.1c){6(3.T<=0&&b=="+="){b="-=";3.p=3.v-1;g=(3.L/3.4.F)*(3.S*3.4.F)}x 6(3.L==0&&b=="-="){b="+=";3.p=0;g=11.1w(3.10)}}3.2y(b,g)}};3.2w=7(a,b){3.K=3.C.2x(a);6(!3.K.1S(3.8.D)){6(3.1D){3.1V="1f";3.1D=0;o c=1}x{3.1V=3.4.1j?"1f":3.4.1m}6(l.4.1W)l.4.1W();3.2z[3.1V](b,c)}};3.2y=7(a,b){o c=7(){6(!l.4.1c&&l.2i){l.1t.G(l.8.E);l.1P();6(l.T<=0){l.Z.A(l.8.E)}x 6(l.L<=0){l.1b.A(l.8.E)}}6(l.1e){3q(7(){l.1e=="-="?l.1u():l.1v()},0)}};3.2A=3.4.2B;3.2C[3.2A](a,b,c)};3.1p=7(){o a=3;3.X=3r(7(){a.y(9,"-=",9,a.1o,9)},a.4.2D)};3.1r=7(){3s(3.X);3.X=9};3.2z={1f:7(a,b){l.C.G(l.8.D).1z();6(l.4.1j&&l.4.1m=="1X"){l.K.2p(l.4.1A)}x{l.K.A(l.8.D).1Y()}6(l.4.V)l.4.V()},1n:7(a,b){6(a==""){a=l.1C<l.p?"-=":"+="}l.1C=l.p;o c=a=="-="?"+":"-";o d=l.4.2E?"R":"Q";o e=l.4.B?l.r.J():l.r.P();o f=d=="R"?{R:a+e}:{Q:a+e};l.2F=$("."+l.8.M,l.r);l.2G=$("."+l.8.D,l.r);l.C.w(d,"0");l.2F.G(l.8.M).1z();l.2G.G(l.8.D).A(l.8.M);l.K.A(l.8.D).w(d,c+e+"1L").1Y();l.1U.2H(z,z).w(d,"0").1Z(f,l.4.1A,l.4.20,7(){6(l.4.V)l.4.V()})},1X:7(a,b){6(b){l.C.1z()}x l.K.w("24","1f");$("."+l.8.M,l.r).G(l.8.M);$("."+l.8.D,l.r).2H(z,z).G(l.8.D).A(l.8.M);l.K.A(l.8.D).1Z({"3t":"1Y"},l.4.1A,l.4.20,7(){6(l.4.V){l.4.V()}})}};3.2C={1f:7(a,b,c){o d=a=="-="?l.10-b:l.10+b;l.O.w(l.1s,d+"1L");c()},1n:7(a,b,c){l.O.1Z(l.1s=="Q"?{Q:a+b}:{R:a+b},l.4.2I,l.4.2J,7(){c()})}};3.23={s:"21",2c:0,W:z,2D:3u,1G:q,28:q,2b:q,1c:q,Y:5,2h:q,2f:q,2l:q,2B:"1n",F:9,2I:3v,2J:9,1m:"1X",1A:3w,20:9,1W:7(){},V:7(){},2o:q,B:q,2E:q,2e:q,1j:q,2t:z,1i:q};3.3x=7(a,b){3y[a]=b}};m.3z.21=7(b){6(3.3A){u 3.3B(7(){o a=3C n();a.22(3,b);$.3D(3,"21",a)})}}})(3E);',62,227,'|||this|options||if|function|cssClassNames|null|||||||||||||||var|currId|false|domObj|cssprefix|nav|return|allItems|css|else|change|true|addClass|verticalnav|panels|cssActive|cssBtnDisable|scroll|removeClass|size|arePanels|height|currPanel|LIafter|cssOld|click|navUL|width|left|top|navLIsize|LIbefore|playBtn|panelfxafter|auto|isPlaying|shownavitems|navBtnPrev|navPos|Math|gBtns|navClip|newId|btn|cssBtnPause|li|getLImargin|margin|navClipSize|navBtnNext|circular|goBtns|scrollcontinue|none|isNavClip|_errorReport|debug|freeheight|scrollit|cssSelected|panelfx|sliding|lineScrollDo|autoScrollStart|isPlayBtn|autoScrollStop|cssPosAttr|navBtns|navPrev|navNext|abs|goBtnPrev|goBtnNext|hide|panelfxspeed|panel|prevId|firstTime|cssPanelsWrapper|panelsBag|mousewheel|stepForward|ul|attrVal|navULSize|px|mouseover|changeWithId|getIndex|_getNavPos|position|go|hasClass|playBtnPause|panelsWrapper|panelTransition|panelfxbefore|fading|show|animate|panelfxeasing|sliderkit|_init|_settings|display|_buildNav|_buildControls|_wrapPanels|keyboard|keyCode|stepBackward|panelclick|start|hover|tabs|navclipcenter|_buildNavButtons|navitemshover|scrollBtns|prev|next|navcontinuous|navStopContinuous|playBtnStart|panelbtnshover|fadeIn|goPrev|goNext|div|fastchange|_setNavScroll|selectThumbnail|animPanel|eq|animNav|_panelTransitions|navTransition|navfx|_navTransitions|autospeed|verticalslide|oldPanel|activePanel|stop|scrollspeed|scrolleasing|extend|clip|01|02|block|changeOngoing|selected|active|old|disable|wrapper|pause|cssPosValue|keyup|alert|Slider|Kit|error|Code|see|doc|03|0px||parseInt||outerWidth|outerHeight|right|bottom|parent|index|mouseout|toggleClass|ceil|floor|play|fadeOut|wrapAll|class|relative|animated|setTimeout|setInterval|clearTimeout|opacity|4000|600|700|addTransition|_transitions|fn|length|each|new|data|jQuery'.split('|'),0,{}))
/**/
/*
|--------------------------------------------------------------------------
| UItoTop jQuery Plugin 1.1
| http://www.mattvarone.com/web-design/uitotop-jquery-plugin/
|--------------------------------------------------------------------------
*/

(function($){
	$.fn.UItoTop = function(options) {

 		var defaults = {
			text: 'Top of the page',
			min: 200,
			inDelay:600,
			outDelay:400,
  			containerID: 'toTop',
			containerHoverID: 'toTopHover',
			scrollSpeed: 0, /*1200*/
			easingType: 'linear'
 		};

 		var settings = $.extend(defaults, options);
		var containerIDhash = '#' + settings.containerID;
		var containerHoverIDHash = '#'+settings.containerHoverID;
		
		$('body').append('<a href="#" id="'+settings.containerID+'" title="'+settings.text+'">'+settings.text+'</a>');
		$(containerIDhash).hide().click(function(){
			if(settings.scrollSpeed == 0)
				$('html, body').attr("scrollTop", 0);
			else 
				$('html, body').animate({scrollTop:0}, settings.scrollSpeed, settings.easingType);
			
			$('#'+settings.containerHoverID, this).stop().animate({'opacity': 0 }, settings.inDelay, settings.easingType);
			return false;
		})
		.prepend('<span id="'+settings.containerHoverID+'"></span>')
		.hover(function() {
				$(containerHoverIDHash, this).stop().animate({
					'opacity': 1
				}, 600, 'linear');
			}, function() { 
				$(containerHoverIDHash, this).stop().animate({
					'opacity': 0
				}, 700, 'linear');
			});
					
		$(window).scroll(function() {
			var sd = $(window).scrollTop();
			if(typeof document.body.style.maxHeight === "undefined") {
				$(containerIDhash).css({
					'position': 'absolute',
					'top': $(window).scrollTop() + $(window).height() - 50
				});
			}
			if ( sd > settings.min ) 
				$(containerIDhash).fadeIn(settings.inDelay);
			else 
				$(containerIDhash).fadeOut(settings.Outdelay);
		});

};
})(jQuery);
/**/
