﻿/// <reference path="/js/jquery-1.2.6-vsdoc.js"/>

var fadeDuration = 300; //time in milliseconds
var Oldbackcolor;
var Oldhoverbackcolor;
var Oldtextcolor;
var Oldhovertextcolor;

function pageLoad() {
    if (typeof contentPageLoad == 'function')
        contentPageLoad();
}

$(function () {
    //RebuildMenu();
    //UpdateMenuBuilderColors(false);
    //UpdateMenuBuildStyle();
    VisitorRuntime();
});

$(window).load(function () {

    //need to do this check in this event to get proper height...gets height after images are loaded
    var curPageHeight = parseInt($('#ctl00_PageContainer').height());
    var minPageHeight = parseInt(RemovePx($('.MasterMinimumPageHeight').val()));
    if (curPageHeight < minPageHeight) {
        $('#ctl00_PageContainer').css('height', minPageHeight + 'px');
    }

    //needs to be in window.load to insure all images are loaded before starting showcase
    $('.MasterShowcase').each(function () {
        StartShowcaseCycle($(this));
    });

    $('.PageShowcase').each(function () {
        StartShowcaseCycle($(this));
    });

});

function VisitorRuntime() {

    if (typeof TelerikMenu_Build == "function") {
        TelerikMenu_Build();
    }

    $('.MasterBanner').each(function () {
        var scrollingBehaviour = $(this).attr('scrollingbehavior');
        if (scrollingBehaviour != 'none') {
            var bannerId = $(this).attr('bannerid');
            var innerBannerId = bannerId + "_INNER";
            var scrolldiv = $('.' + innerBannerId);
            scrolldiv.marquee().mouseover(function () {
                $(this).trigger('stop');
            }).mouseout(function () {
                $(this).trigger('start');
            });
        }
    });

    $('.PageBanner').each(function () {
        var scrollingBehaviour = $(this).attr('scrollingbehavior');
        if (scrollingBehaviour != 'none') {
            var bannerId = $(this).attr('bannerid');
            var innerBannerId = bannerId + "_INNER";
            var scrolldiv = $('.' + innerBannerId);
            scrolldiv.marquee().mouseover(function () {
                $(this).trigger('stop');
            }).mouseout(function () {
                $(this).trigger('start');
            });
        }
    });

    $('.MasterImageViewer').each(function () {
        SetupImageViewerPage($(this));
    });

    $('.PageImageViewer').each(function () {
        SetupImageViewerPage($(this));
    });

    $('.MasterQuicklinks').each(function () {
        var cornerscript = $(this).attr('cornerstylescript');
        if (cornerscript != 'Flat' && cornerscript != 'n/a') {
            $(this).children('.ToolkitQuicklinksInnerContainer').corner(cornerscript);
        }
    });

    $('.PageQuicklinks').each(function () {
        var cornerscript = $(this).attr('cornerstylescript');
        if (cornerscript != 'Flat' && cornerscript != 'n/a') {
            $(this).children('.ToolkitQuicklinksInnerContainer').corner(cornerscript);
        }
    });

    $('.PageExtModuleToolkits ').each(function () {
        var marqueeBehaviour = $(this).attr('marqueebehaviour');
        if (marqueeBehaviour != 'none' && marqueeBehaviour != '') {
            var scrolldiv = $(this).find('#ToolkitExtModuleToolkitOuterContainer');
            scrolldiv.attr('direction', $(this).attr('marqueedirection'))
                 .attr('behavior', marqueeBehaviour)
                 .attr('speed', $(this).attr('marqueespeed'))
                 .attr('width', parseInt($(this).width()))
                 .attr('height', parseInt($(this).height()))
                 .marquee().mouseover(function () {
                     $(this).trigger('stop');
                 }).mouseout(function () {
                     $(this).trigger('start');
                 });
        }
    });

    $('.MasterExtModuleToolkits').each(function () {
        var marqueeBehaviour = $(this).attr('marqueebehaviour');
        if (marqueeBehaviour != 'none' && marqueeBehaviour != '') {
            var scrolldiv = $(this).find('#ToolkitExtModuleToolkitOuterContainer');
            scrolldiv.attr('direction', $(this).attr('marqueedirection'))
                 .attr('behavior', marqueeBehaviour)
                 .attr('speed', $(this).attr('marqueespeed'))
                 .attr('width', parseInt($(this).width()))
                 .attr('height', parseInt($(this).height()))
                 .marquee().mouseover(function () {
                     $(this).trigger('stop');
                 }).mouseout(function () {
                     $(this).trigger('start');
                 });
        }
    });

}

function RemovePx(text) {
    return text.replace('px', '');
}

function StartShowcaseCycle(showcaseElement) {

    showcaseElement.find('img').show();

    var width = showcaseElement.css('width');
    var height = showcaseElement.css('height');
    var showcaseInnerId = '.' + showcaseElement.attr('showcaseid') + '_INNER';
    var showcaseInner = $(showcaseInnerId);
    showcaseInner.css('width', width).css('height', height);
    showcaseInner.cycle({
        fx: $(showcaseElement).attr('showcasestyle'),
        timeout: $(showcaseElement).attr('showcasespeed'),
        sync: 0
    });
    //some showcase effects cause this inner div's width and height to not be correct, so I reset after calling cycle on it
    showcaseInner.css('width', width).css('height', height);
}

function SetupImageViewerPage(element) {
    var viewerId = element.attr('id');
    var useScroll = element.attr('ImageViewerUseScroll');
    if (useScroll == 'true') {
        element.find('#vCarousel').jcarousel({
            scroll: 1
        });
        UpdateImageViewerContainerSize(element);
    }
    else {
        var PageCount = parseInt(element.attr('ImageViewerPageCount'));
        if (PageCount > 1) {
            var viewerPagerId = viewerId + "_PAGER";
            element.children('.ImageViewerPager').attr('id', viewerPagerId);
            var jviewerPagerId = '#' + viewerPagerId;
            ImageViewerPageClick(1, $(jviewerPagerId));
        }
    }

}

function ImageViewerPageClick(pageIndex, element) {

    var myPagIndex = parseInt(pageIndex);
    var viewerContainer = '#' + element.parent().attr('id');  //element is just the pager div, need parent
    var myImagesPerPage = parseInt($(viewerContainer).attr('ImageViewerImagesPerPage'));
    var images = $(viewerContainer).find('.ImageViewerInnerWrapperDiv');
    var myImageCount = parseInt($(viewerContainer).attr('ImageViewerImageCount')); //images.length;
    var myPageCount = parseInt($(viewerContainer).attr('ImageViewerPageCount')); //Math.floor((myImageCount / myImagesPerPage));
    //var myPageCountRemainder = myImageCount % myImagesPerPage;
    //if (myPageCountRemainder > 0) {
    //myPageCount += 1;
    //}

    var rangeStart = 1;
    var rangeEnd = myImagesPerPage;
    if (myPagIndex > 1) {
        rangeStart = (myPagIndex * myImagesPerPage) - (myImagesPerPage - 1);
        rangeEnd = (myPagIndex * myImagesPerPage);
    }

    $.each(images, function (i, val) {

        var oneBasedIndex = i + 1;
        //var div = val;

        if ((oneBasedIndex >= rangeStart) && (oneBasedIndex <= rangeEnd)) {
            $(val).css('display', 'block');
        }
        else {
            $(val).css('display', 'none');
        }

    });

    var viewerPagerId = viewerContainer + "_PAGER";
    $(viewerPagerId).pager({ pagenumber: myPagIndex, pagecount: myPageCount, buttonClickCallback: ImageViewerPageClick });

}

function UpdateImageViewerContainerSize(imageviewerElement) {

    if (imageviewerElement.attr('ImageViewerUseScroll') == 'true') {
        var width = imageviewerElement.width();
        var clipWidth = width - 85;
        imageviewerElement.find('.jcarousel-container').css('width', clipWidth + 'px');
        imageviewerElement.find('.jcarousel-clip').css('width', clipWidth + 'px');
        imageviewerElement.find('.jcarousel-skin-visitor').css('width', clipWidth + 'px');
    }

}


/*
* jQuery corner plugin
*
* version 1.92 (12/18/2007)
*
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*/

/**
* The corner() method provides a simple way of styling DOM elements.  
*
* corner() takes a single string argument:  $().corner("effect corners width")
*
*   effect:  The name of the effect to apply, such as round or bevel. 
*            If you don't specify an effect, rounding is used.
*
*   corners: The corners can be one or more of top, bottom, tr, tl, br, or bl. 
*            By default, all four corners are adorned. 
*
*   width:   The width specifies the width of the effect; in the case of rounded corners this 
*            will be the radius of the width. 
*            Specify this value using the px suffix such as 10px, and yes it must be pixels.
*
* For more details see: http://methvin.com/jquery/jq-corner.html
* For a full demo see:  http://malsup.com/jquery/corner/
*
*
* @example $('.adorn').corner();
* @desc Create round, 10px corners 
*
* @example $('.adorn').corner("25px");
* @desc Create round, 25px corners 
*
* @example $('.adorn').corner("notch bottom");
* @desc Create notched, 10px corners on bottom only
*
* @example $('.adorn').corner("tr dog 25px");
* @desc Create dogeared, 25px corner on the top-right corner only
*
* @example $('.adorn').corner("round 8px").parent().css('padding', '4px').corner("round 10px");
* @desc Create a rounded border effect by styling both the element and its parent
* 
* @name corner
* @type jQuery
* @param String options Options which control the corner style
* @cat Plugins/Corner
* @return jQuery
* @author Dave Methvin (dave.methvin@gmail.com)
* @author Mike Alsup (malsup@gmail.com)
*/
(function ($) {

    $.fn.corner = function (o) {
        var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent);
        function sz(el, p) { return parseInt($.css(el, p)) || 0; };
        function hex2(s) {
            var s = parseInt(s).toString(16);
            return (s.length < 2) ? '0' + s : s;
        };
        function gpc(node) {
            for (; node && node.nodeName.toLowerCase() != 'html'; node = node.parentNode) {
                var v = $.css(node, 'backgroundColor');
                if (v.indexOf('rgb') >= 0) {
                    if ($.browser.safari && v == 'rgba(0, 0, 0, 0)')
                        continue;
                    var rgb = v.match(/\d+/g);
                    return '#' + hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
                }
                if (v && v != 'transparent')
                    return v;
            }
            return '#ffffff';
        };
        function getW(i) {
            switch (fx) {
                case 'round': return Math.round(width * (1 - Math.cos(Math.asin(i / width))));
                case 'cool': return Math.round(width * (1 + Math.cos(Math.asin(i / width))));
                case 'sharp': return Math.round(width * (1 - Math.cos(Math.acos(i / width))));
                case 'bite': return Math.round(width * (Math.cos(Math.asin((width - i - 1) / width))));
                case 'slide': return Math.round(width * (Math.atan2(i, width / i)));
                case 'jut': return Math.round(width * (Math.atan2(width, (width - i - 1))));
                case 'curl': return Math.round(width * (Math.atan(i)));
                case 'tear': return Math.round(width * (Math.cos(i)));
                case 'wicked': return Math.round(width * (Math.tan(i)));
                case 'long': return Math.round(width * (Math.sqrt(i)));
                case 'sculpt': return Math.round(width * (Math.log((width - i - 1), width)));
                case 'dog': return (i & 1) ? (i + 1) : width;
                case 'dog2': return (i & 2) ? (i + 1) : width;
                case 'dog3': return (i & 3) ? (i + 1) : width;
                case 'fray': return (i % 2) * width;
                case 'notch': return width;
                case 'bevel': return i + 1;
            }
        };
        o = (o || "").toLowerCase();
        var keep = /keep/.test(o);                       // keep borders?
        var cc = ((o.match(/cc:(#[0-9a-f]+)/) || [])[1]);  // corner color
        var sc = ((o.match(/sc:(#[0-9a-f]+)/) || [])[1]);  // strip color
        var width = parseInt((o.match(/(\d+)px/) || [])[1]) || 10; // corner width
        var re = /round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;
        var fx = ((o.match(re) || ['round'])[0]);
        var edges = { T: 0, B: 1 };
        var opts = {
            TL: /top|tl/.test(o), TR: /top|tr/.test(o),
            BL: /bottom|bl/.test(o), BR: /bottom|br/.test(o)
        };
        if (!opts.TL && !opts.TR && !opts.BL && !opts.BR)
            opts = { TL: 1, TR: 1, BL: 1, BR: 1 };
        var strip = document.createElement('div');
        strip.style.overflow = 'hidden';
        strip.style.height = '1px';
        strip.style.backgroundColor = sc || 'transparent';
        strip.style.borderStyle = 'solid';
        strip.style.zIndex = '6004';
        return this.each(function (index) {
            var pad = {
                T: parseInt($.css(this, 'paddingTop')) || 0, R: parseInt($.css(this, 'paddingRight')) || 0,
                B: parseInt($.css(this, 'paddingBottom')) || 0, L: parseInt($.css(this, 'paddingLeft')) || 0
            };

            if ($.browser.msie) this.style.zoom = 1; // force 'hasLayout' in IE
            if (!keep) this.style.border = 'none';
            strip.style.borderColor = cc || gpc(this.parentNode);
            var cssHeight = $.curCSS(this, 'height');

            for (var j in edges) {
                var bot = edges[j];
                // only add stips if needed
                if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {
                    strip.style.borderStyle = 'none ' + (opts[j + 'R'] ? 'solid' : 'none') + ' none ' + (opts[j + 'L'] ? 'solid' : 'none');
                    var d = document.createElement('div');
                    $(d).addClass('jquery-corner');
                    var ds = d.style;
                    ds.zIndex = '6004';
                    bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);

                    //by revans: changed this to not check on auto height to force the bottom div to use absolute position code below
                    //other wise, IE would never hit this and would instead use negative margin positioning (see below in else statement).
                    if (bot) { //&& cssHeight != 'auto'
                        if ($.css(this, 'position') == 'static')
                            this.style.position = 'relative';
                        ds.position = 'absolute';
                        ds.bottom = ds.left = ds.padding = ds.margin = '0';
                        //by revans: was failing in IE8.  removed this check and seems to be fine in ie7 and ie8 now.  not sure why this was there.
                        //                        if ($.browser.msie)
                        //                            ds.setExpression('width', 'this.parentNode.offsetWidth');
                        //                        else
                        ds.width = '100%';
                    }
                    // && $.browser.msie
                    else if (!bot) {
                        if ($.css(this, 'position') == 'static')
                            this.style.position = 'relative';
                        ds.position = 'absolute';
                        ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';

                        // fix ie6 problem when blocked element has a border width
                        var bw = 0;
                        if (ie6 || !$.boxModel)
                            bw = sz(this, 'borderLeftWidth') + sz(this, 'borderRightWidth');
                        ie6 ? ds.setExpression('width', 'this.parentNode.offsetWidth - ' + bw + '+ "px"') : ds.width = '100%';
                    }
                    //                    else {
                    //                        ds.margin = !bot ? '-' + pad.T + 'px -' + pad.R + 'px ' + (pad.T - width) + 'px -' + pad.L + 'px' :
                    //                                        (pad.B - width) + 'px -' + pad.R + 'px -' + pad.B + 'px -' + pad.L + 'px';
                    //                    }

                    for (var i = 0; i < width; i++) {
                        var w = Math.max(0, getW(i));
                        var e = strip.cloneNode(false);
                        e.style.borderWidth = '0 ' + (opts[j + 'R'] ? w : 0) + 'px 0 ' + (opts[j + 'L'] ? w : 0) + 'px';
                        bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);
                    }
                }
            }
        });
    };

    $.fn.uncorner = function (o) { return $('.jquery-corner', this).remove(); };

})(jQuery);

/*
VERSION: Drop Shadow jQuery Plugin 1.6  12-13-2007

REQUIRES: jquery.js (1.2.6 or later)

SYNTAX: $(selector).dropShadow(options);  // Creates new drop shadows
$(selector).redrawShadow();       // Redraws shadows on elements
$(selector).removeShadow();       // Removes shadows from elements
$(selector).shadowId();           // Returns an existing shadow's ID

OPTIONS:

left    : integer (default = 4)
top     : integer (default = 4)
blur    : integer (default = 2)
opacity : decimal (default = 0.5)
color   : string (default = "black")
swap    : boolean (default = false)

The left and top parameters specify the distance and direction, in	pixels, to
offset the shadow. Zero values position the shadow directly behind the element.
Positive values shift the shadow to the right and down, while negative values 
shift the shadow to the left and up.
	
The blur parameter specifies the spread, or dispersion, of the shadow. Zero 
produces a sharp shadow, one or two produces a normal shadow, and	three or four
produces a softer shadow. Higher values increase the processing load.
	
The opacity parameter	should be a decimal value, usually less than one. You can
use a value	higher than one in special situations, e.g. with extreme blurring. 
	
Color is specified in the usual manner, with a color name or hex value. The
color parameter	does not apply with transparent images.
	
The swap parameter reverses the stacking order of the original and the shadow.
This can be used for special effects, like an embossed or engraved look.

EXPLANATION:
	
This jQuery plug-in adds soft drop shadows behind page elements. It is only
intended for adding a few drop shadows to mostly stationary objects, like a
page heading, a photo, or content containers.

The shadows it creates are not bound to the original elements, so they won't
move or change size automatically if the original elements change. A window
resize event listener is assigned, which should re-align the shadows in many
cases, but if the elements otherwise move or resize you will have to handle
those events manually. Shadows can be redrawn with the redrawShadow() method
or removed with the removeShadow() method. The redrawShadow() method uses the
same options used to create the original shadow. If you want to change the
options, you should remove the shadow first and then create a new shadow.
	
The dropShadow method returns a jQuery collection of the new shadow(s). If
further manipulation is required, you can store it in a variable like this:

var myShadow = $("#myElement").dropShadow();

You can also read the ID of the shadow from the original element at a later
time. To get a shadow's ID, either read the shadowId attribute of the
original element or call the shadowId() method. For example:

var myShadowId = $("#myElement").attr("shadowId");  or
var myShadowId = $("#myElement").shadowId();

If the original element does not already have an ID assigned, a random ID will
be generated for the shadow. However, if the original does have an ID, the 
shadow's ID will be the original ID and "_dropShadow". For example, if the
element's ID is "myElement", the shadow's ID would be "myElement_dropShadow".

If you have a long piece of text and the user resizes the	window so that the
text wraps or unwraps, the shape of the text changes and the words are no
longer in the same positions. In that case, you can either preset the height
and width, so that it becomes a fixed box, or you can shadow each word
separately, like this:

<h1><span>Your</span> <span>Page</span> <span>Title</span></h1>

$("h1 span").dropShadow();

The dropShadow method attempts to determine whether the selected elements have
transparent backgrounds. If you want to shadow the content inside an element,
like text or a transparent image, it must not have a background-color or
background-image style. If the element has a solid background it will create a
rectangular	shadow around the outside box.

The shadow elements are positioned absolutely one layer below the original 
element, which is positioned relatively (unless it's already absolute).

*** All shadows have the "dropShadow" class, for selecting with CSS or jQuery.

ISSUES:
	
1)	Limited styling of shadowed elements by ID. Because IDs must be unique,
and the shadows have their own ID, styles applied by ID won't transfer
to the shadows. Instead, style elements by class or use inline styles.
2)	Sometimes shadows don't align properly. Elements may need to be wrapped
in container elements, margins or floats changed, etc. or you may just 
have to tweak the left and top offsets to get them to align. For example,
with draggable objects, you have to wrap them inside two divs. Make the 
outer div draggable and set the inner div's position to relative. Then 
you can create a shadow on the element inside the inner div.
3)	If the user changes font sizes it will throw the shadows off. Browsers 
do not expose an event for font size changes. The only known way to 
detect a user font size change is to embed an invisible text element and
then continuously poll for changes in size.
4)	Safari support is shaky, and may require even more tweaks/wrappers, etc.
		
The bottom line is that this is a gimick effect, not PFM, and if you push it
too hard or expect it to work in every possible situation on every browser,
you will be disappointed. Use it sparingly, and don't use it for anything 
critical. Otherwise, have fun with it!
				
AUTHOR: Larry Stevens (McLars@eyebulb.com) This work is in the public domain,
and it is not supported in any way. Use it at your own risk.
*/


(function ($) {

    var dropShadowZindex = 1;  //z-index counter

    $.fn.dropShadow = function (options) {
        // Default options
        var opt = $.extend({
            left: 4,
            top: 4,
            blur: 2,
            opacity: .5,
            color: "black",
            swap: false
        }, options);
        var jShadows = $([]);  //empty jQuery collection

        // Loop through original elements
        this.not(".dropShadow").each(function () {
            var jthis = $(this);
            var shadows = [];
            var blur = (opt.blur <= 0) ? 0 : opt.blur;
            var opacity = (blur == 0) ? opt.opacity : opt.opacity / (blur * 8);
            var zOriginal = (opt.swap) ? dropShadowZindex : dropShadowZindex + 1;
            var zShadow = (opt.swap) ? dropShadowZindex + 1 : dropShadowZindex;

            // Create ID for shadow
            var shadowId;
            if (this.id) {
                shadowId = this.id + "_dropShadow";
            }
            else {
                shadowId = "ds" + (1 + Math.floor(9999 * Math.random()));
            }

            // Modify original element
            $.data(this, "shadowId", shadowId); //store id in expando
            $.data(this, "shadowOptions", options); //store options in expando
            jthis
				.attr("shadowId", shadowId)
				.css("zIndex", zOriginal);
            if (jthis.css("position") != "absolute") {
                jthis.css({
                    position: "relative",
                    zoom: 1 //for IE layout
                });
            }

            // Create first shadow layer
            bgColor = jthis.css("backgroundColor");
            if (bgColor == "rgba(0, 0, 0, 0)") bgColor = "transparent";  //Safari
            if (bgColor != "transparent" || jthis.css("backgroundImage") != "none"
					|| this.nodeName == "SELECT"
					|| this.nodeName == "INPUT"
					|| this.nodeName == "TEXTAREA") {
                shadows[0] = $("<div></div>")
					.css("background", opt.color);
            }
            else {
                shadows[0] = jthis
					.clone()
					.removeAttr("id")
					.removeAttr("name")
					.removeAttr("shadowId")
					.css("color", opt.color);
            }
            shadows[0]
				.addClass("dropShadow")
				.css({
				    height: jthis.outerHeight(),
				    left: blur,
				    opacity: opacity,
				    position: "absolute",
				    top: blur,
				    width: jthis.outerWidth(),
				    zIndex: zShadow
				});

            // Create other shadow layers
            var layers = (8 * blur) + 1;
            for (i = 1; i < layers; i++) {
                shadows[i] = shadows[0].clone();
            }

            // Position layers
            var i = 1;
            var j = blur;
            while (j > 0) {
                shadows[i].css({ left: j * 2, top: 0 });           //top
                shadows[i + 1].css({ left: j * 4, top: j * 2 });   //right
                shadows[i + 2].css({ left: j * 2, top: j * 4 });   //bottom
                shadows[i + 3].css({ left: 0, top: j * 2 });       //left
                shadows[i + 4].css({ left: j * 3, top: j });       //top-right
                shadows[i + 5].css({ left: j * 3, top: j * 3 });   //bottom-right
                shadows[i + 6].css({ left: j, top: j * 3 });       //bottom-left
                shadows[i + 7].css({ left: j, top: j });           //top-left
                i += 8;
                j--;
            }

            // Create container
            var divShadow = $("<div></div>")
				.attr("id", shadowId)
				.addClass("dropShadow")
				.css({
				    left: jthis.position().left + opt.left - blur,
				    marginTop: jthis.css("marginTop"),
				    marginRight: jthis.css("marginRight"),
				    marginBottom: jthis.css("marginBottom"),
				    marginLeft: jthis.css("marginLeft"),
				    position: "absolute",
				    top: jthis.position().top + opt.top - blur,
				    zIndex: zShadow
				});

            // Add layers to container	
            for (i = 0; i < layers; i++) {
                divShadow.append(shadows[i]);
            }

            // Add container to DOM
            jthis.after(divShadow);

            // Add shadow to return set
            jShadows = jShadows.add(divShadow);

            // Re-align shadow on window resize
            $(window).resize(function () {
                try {
                    divShadow.css({
                        left: jthis.position().left + opt.left - blur,
                        top: jthis.position().top + opt.top - blur
                    });
                }
                catch (e) { }
            });

            // Increment z-index counter
            dropShadowZindex += 2;

        });  //end each

        return this.pushStack(jShadows);
    };


    $.fn.redrawShadow = function () {
        // Remove existing shadows
        this.removeShadow();

        // Draw new shadows
        return this.each(function () {
            var shadowOptions = $.data(this, "shadowOptions");
            $(this).dropShadow(shadowOptions);
        });
    };


    $.fn.removeShadow = function () {
        return this.each(function () {
            var shadowId = $(this).shadowId();
            $("div#" + shadowId).remove();
        });
    };


    $.fn.shadowId = function () {
        return $.data(this[0], "shadowId");
    };


    $(function () {
        // Suppress printing of shadows
        var noPrint = "<style type='text/css' media='print'>";
        noPrint += ".dropShadow{visibility:hidden;}</style>";
        $("head").append(noPrint);
    });

})(jQuery);

/*! Copyright (c) 2008 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.
*
* Color functions from Steve's Cross Browser Gradient Backgrounds v1.0 (steve@slayeroffice.com && http://slayeroffice.com/code/gradient/)
*
* Version 1.0.1-pre
*/
(function ($) {

    /**
    * Adds a gradient to the background of an element.
    *
    * @example $('div').gradient({ from: '000000', to: 'CCCCCC' });
    *
    * @param Map options Settings/options to configure the gradient.
    * @option String from The hex color code to start the gradient with.
    *     By default the value is "000000".
    * @option String to The hex color code to end the gradient with.
    *     By default the value is "FFFFFF".
    * @option String direction This tells the gradient to be horizontal
    * or vertical. By default the value is "horizontal".
    * @option Number length This is used to constrain the gradient to a
    * particular width or height (depending on the direction). By default
    * the length is set to null, which will use the width or height
    * (depending on the direction) of the element.
    * @option String position This tells the gradient to be positioned
    * at the top, bottom, left and/or right within the element. The
    * value is just a string that specifices top or bottom and left or right.
    * By default the value is 'top left'.
    *
    * @name gradient
    * @type jQuery
    * @cat Plugins/gradient
    * @author Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
    */
    $.fn.gradient = function (options) {
        options = $.extend({ from: '000000', to: 'ffffff', direction: 'horizontal', position: 'top', length: null }, options || {});
        var createColorPath = function (startColor, endColor, distance) {
            var colorPath = [],
     colorPercent = 1.0,
      distance = (distance < 100) ? distance : 100;
            do {
                colorPath[colorPath.length] = setColorHue(longHexToDec(startColor), colorPercent, longHexToDec(endColor));
                colorPercent -= ((100 / distance) * 0.01);
            } while (colorPercent > 0);
            return colorPath;
        },
  setColorHue = function (originColor, opacityPercent, maskRGB) {
      var returnColor = [];
      for (var i = 0; i < originColor.length; i++)
          returnColor[i] = Math.round(originColor[i] * opacityPercent) + Math.round(maskRGB[i] * (1.0 - opacityPercent));
      return returnColor;
  },
  longHexToDec = function (longHex) {
      return new Array(toDec(longHex.substring(0, 2)), toDec(longHex.substring(2, 4)), toDec(longHex.substring(4, 6)));
  },
  toDec = function (hex) {
      return parseInt(hex, 16);
  };
        return this.each(function () {
            var $this = $(this), width = $this.innerWidth(), height = $this.innerHeight(), x = 0, y = 0, w = 1, h = 1, html = [],
     length = options.length || (options.direction == 'vertical' ? width : height),
     position = (options.position == 'bottom' ? 'bottom:0;' : 'top:0;') + (options.position == 'right' ? 'right:0;' : 'left:0;'),
     colorArray = createColorPath(options.from, options.to, length);

            if (options.direction == 'horizontal') {
                h = Math.round(length / colorArray.length) || 1;
                w = width;
            } else {
                w = Math.round(length / colorArray.length) || 1;
                h = height;
            }

            html.push('<div class="gradient" style="position: absolute; ' + position + ' width: ' + (options.direction == 'vertical' ? length + "px" : "100%") + '; height: ' + (options.direction == 'vertical' ? "100%" : length + "px") + '; overflow: hidden; z-index: 6001; background-color: #' + (options.position.indexOf('bottom') != -1 ? options.from : options.to) + '">');
            for (var i = 0; i < colorArray.length; i++) {
                html.push('<div style="position:absolute;z-index:6002;top:' + y + 'px;left:' + x + 'px;height:' + (options.direction == 'vertical' ? "100%" : h + "px") + ';width:' + (options.direction == 'vertical' ? w + "px" : "100%") + ';background-color:rgb(' + colorArray[i][0] + ',' + colorArray[i][1] + ',' + colorArray[i][2] + ');"></div>');
                options.direction == 'vertical' ? x += w : y += h;

                if (y >= height || x >= width) break;
            }
            html.push('</div>');

            if ($this.css('position') == 'static')
                $this.css('position', 'relative');

            var inner = '';
            var outer1 = '';
            var outer2 = '';
            var htmlToAvoid = $(this).children();
            htmlToAvoid.each(function (i, e) {
                if (!$(this).hasClass('jquery-corner')) {
                    inner += $(this).outer();
                }
                else {
                    if (i == 0) {
                        outer1 += $(this).outer();
                    }
                    else {
                        outer2 += $(this).outer();
                    }


                }
            });

            $this
      .html('<div id="GradientWrapper" style="display:' + $this.css("display") + '; position: relative; z-index: 6003;">' + inner + '</div>')
      .prepend(html.join(''))
      .prepend(outer1)
      .append(outer2);
        });
    };

})(jQuery);

/**
* author Remy Sharp
* url http://remysharp.com/tag/marquee
*/

(function ($) {
    $.fn.marquee = function (klass) {
        var newMarquee = [],
            last = this.length;

        // works out the left or right hand reset position, based on scroll
        // behavior, current direction and new direction
        function getReset(newDir, marqueeRedux, marqueeState) {
            var behavior = marqueeState.behavior, width = marqueeState.width, dir = marqueeState.dir;
            var r = 0;
            if (behavior == 'alternate') {
                r = newDir == 1 ? marqueeRedux[marqueeState.widthAxis] - (width * 2) : width;
            } else if (behavior == 'slide') {
                if (newDir == -1) {
                    r = dir == -1 ? marqueeRedux[marqueeState.widthAxis] : width;
                } else {
                    r = dir == -1 ? marqueeRedux[marqueeState.widthAxis] - (width * 2) : 0;
                }
            } else {
                r = newDir == -1 ? marqueeRedux[marqueeState.widthAxis] : 0;
            }
            return r;
        }

        // single "thread" animation
        function animateMarquee() {
            var i = newMarquee.length,
                marqueeRedux = null,
                $marqueeRedux = null,
                marqueeState = {},
                newMarqueeList = [],
                hitedge = false;

            while (i--) {
                marqueeRedux = newMarquee[i];
                $marqueeRedux = $(marqueeRedux);
                marqueeState = $marqueeRedux.data('marqueeState');

                if ($marqueeRedux.data('paused') !== true) {
                    // TODO read scrollamount, dir, behavior, loops and last from data

                    if (marqueeState != null) {
                        marqueeRedux[marqueeState.axis] += (marqueeState.scrollamount * marqueeState.dir);

                        // only true if it's hit the end
                        hitedge = marqueeState.dir == -1 ? marqueeRedux[marqueeState.axis] <= getReset(marqueeState.dir * -1, marqueeRedux, marqueeState) : marqueeRedux[marqueeState.axis] >= getReset(marqueeState.dir * -1, marqueeRedux, marqueeState);

                        if ((marqueeState.behavior == 'scroll' && marqueeState.last == marqueeRedux[marqueeState.axis]) || (marqueeState.behavior == 'alternate' && hitedge && marqueeState.last != -1) || (marqueeState.behavior == 'slide' && hitedge && marqueeState.last != -1)) {
                            if (marqueeState.behavior == 'alternate') {
                                marqueeState.dir *= -1; // flip
                            }
                            marqueeState.last = -1;

                            $marqueeRedux.trigger('stop');

                            marqueeState.loops--;
                            if (marqueeState.loops === 0) {
                                if (marqueeState.behavior != 'slide') {
                                    marqueeRedux[marqueeState.axis] = getReset(marqueeState.dir, marqueeRedux, marqueeState);
                                } else {
                                    // corrects the position
                                    marqueeRedux[marqueeState.axis] = getReset(marqueeState.dir * -1, marqueeRedux, marqueeState);
                                }

                                $marqueeRedux.trigger('end');
                            } else {
                                // keep this marquee going
                                newMarqueeList.push(marqueeRedux);
                                $marqueeRedux.trigger('start');
                                marqueeRedux[marqueeState.axis] = getReset(marqueeState.dir, marqueeRedux, marqueeState);
                            }
                        } else {
                            newMarqueeList.push(marqueeRedux);
                        }
                        marqueeState.last = marqueeRedux[marqueeState.axis];

                        // store updated state only if we ran an animation
                        $marqueeRedux.data('marqueeState', marqueeState);
                    }

                } else {
                    // even though it's paused, keep it in the list
                    newMarqueeList.push(marqueeRedux);
                }
            }

            newMarquee = newMarqueeList;

            if (newMarquee.length) {
                setTimeout(animateMarquee, marqueeState.speed);
            }
        }

        function GetNewMarqueeHTML(klass, origHTML, width, height, direction) {
            var result = '';
            if (direction == 'left' || direction == 'right') {
                result = '<div ' + (klass ? 'class="' + klass + '" ' : '') + 'style="display: block-inline; width: ' + width + 'px; height: ' + height + 'px; overflow: hidden;"><div style="float: left; white-space: nowrap;">' + origHTML + '</div></div>';
            }
            else {
                result = '<div ' + (klass ? 'class="' + klass + '" ' : '') + 'style="display: block-inline; width: ' + width + 'px; height: ' + height + 'px; overflow: hidden;"><div style="float: left;">' + origHTML + '</div></div>';
            }
            return result;
        }

        // TODO consider whether using .html() in the wrapping process could lead to loosing predefined events...
        this.each(function (i) {
            var $marquee = $(this),
                direction = ($marquee.attr('direction') || 'left').toLowerCase(),
                width = $marquee.attr('width') || $marquee.width(),
                height = $marquee.attr('height') || $marquee.height(),
                $marqueeRedux = $marquee.after(GetNewMarqueeHTML(klass, $marquee.html(), width, height, direction)).next(),
                marqueeRedux = $marqueeRedux.get(0),
                hitedge = 0,
                marqueeState = {
                    dir: /down|right/.test(direction) ? -1 : 1,
                    axis: /left|right/.test(direction) ? 'scrollLeft' : 'scrollTop',
                    widthAxis: /left|right/.test(direction) ? 'scrollWidth' : 'scrollHeight',
                    last: -1,
                    loops: $marquee.attr('loop') || -1,
                    scrollamount: $marquee.attr('scrollamount') || this.scrollAmount || 2,
                    behavior: ($marquee.attr('behavior') || 'scroll').toLowerCase(),
                    width: /left|right/.test(direction) ? width : height,
                    speed: $marquee.attr('speed') || 25
                };

            // corrects a bug in Firefox - the default loops for slide is -1
            if ($marquee.attr('loop') == -1 && marqueeState.behavior == 'slide') {
                marqueeState.loops = 1;
            }

            $marquee.remove();

            // add padding
            if (/left|right/.test(direction)) {
                $marqueeRedux.find('> div').css('padding', '0 ' + width + 'px');
            } else {
                $marqueeRedux.find('> div').css('padding', height + 'px 0');
            }

            // events
            $marqueeRedux.bind('stop', function () {
                $marqueeRedux.data('paused', true);
            }).bind('pause', function () {
                $marqueeRedux.data('paused', true);
            }).bind('start', function () {
                $marqueeRedux.data('paused', false);
            }).bind('unpause', function () {
                $marqueeRedux.data('paused', false);
            }).data('marqueeState', marqueeState); // finally: store the state

            // todo - rerender event allowing us to do an ajax hit and redraw the marquee

            newMarquee.push(marqueeRedux);

            marqueeRedux[marqueeState.axis] = getReset(marqueeState.dir, marqueeRedux, marqueeState);
            $marqueeRedux.trigger('start');

            // on the very last marquee, trigger the animation
            if (i + 1 == last) {
                animateMarquee();
            }
        });

        return $(newMarquee);
    };
} (jQuery));

/*!
* jQuery Cycle Plugin (with Transition Definitions)
* Examples and documentation at: http://jquery.malsup.com/cycle/
* Copyright (c) 2007-2009 M. Alsup
* Version: 2.65 (07-APR-2009)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Requires: jQuery v1.2.6 or later
*
* Originally based on the work of:
*	1) Matt Oakes
*	2) Torsten Baldes (http://medienfreunde.com/lab/innerfade/)
*	3) Benjamin Sterling (http://www.benjaminsterling.com/experiments/jqShuffle/)
*/
; (function ($) {

    var ver = '2.65';

    // if $.support is not defined (pre jQuery 1.3) add what I need
    if ($.support == undefined) {
        $.support = {
            opacity: !($.browser.msie)
        };
    }

    function log() {
        if (window.console && window.console.log)
            window.console.log('[cycle] ' + Array.prototype.join.call(arguments, ' '));
        //$('body').append('<div>'+Array.prototype.join.call(arguments,' ')+'</div>');
    };

    // the options arg can be...
    //   a number  - indicates an immediate transition should occur to the given slide index
    //   a string  - 'stop', 'pause', 'resume', or the name of a transition effect (ie, 'fade', 'zoom', etc)
    //   an object - properties to control the slideshow
    //
    // the arg2 arg can be...
    //   the name of an fx (only used in conjunction with a numeric value for 'options')
    //   the value true (only used in conjunction with a options == 'resume') and indicates
    //     that the resume should occur immediately (not wait for next timeout)

    $.fn.cycle = function (options, arg2) {
        var o = { s: this.selector, c: this.context };

        // in 1.3+ we can fix mistakes with the ready state
        if (this.length == 0 && options != 'stop') {
            if (!$.isReady && o.s) {
                log('DOM not ready, queuing slideshow')
                $(function () {
                    $(o.s, o.c).cycle(options, arg2);
                });
                return this;
            }
            // is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
            log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
            return this;
        }

        // iterate the matched nodeset
        return this.each(function () {
            options = handleArguments(this, options, arg2);
            if (options === false)
                return;

            // stop existing slideshow for this container (if there is one)
            if (this.cycleTimeout)
                clearTimeout(this.cycleTimeout);
            this.cycleTimeout = this.cyclePause = 0;

            var $cont = $(this);
            var $slides = options.slideExpr ? $(options.slideExpr, this) : $cont.children();
            var els = $slides.get();
            if (els.length < 2) {
                log('terminating; too few slides: ' + els.length);
                return;
            }

            var opts = buildOptions($cont, $slides, els, options, o);
            if (opts === false)
                return;

            // if it's an auto slideshow, kick it off
            if (opts.timeout || opts.continuous)
                this.cycleTimeout = setTimeout(function () { go(els, opts, 0, !opts.rev) },
				opts.continuous ? 10 : opts.timeout + (opts.delay || 0));
        });
    };

    // process the args that were passed to the plugin fn
    function handleArguments(cont, options, arg2) {
        if (cont.cycleStop == undefined)
            cont.cycleStop = 0;
        if (options === undefined || options === null)
            options = {};
        if (options.constructor == String) {
            switch (options) {
                case 'stop':
                    cont.cycleStop++; // callbacks look for change
                    if (cont.cycleTimeout)
                        clearTimeout(cont.cycleTimeout);
                    cont.cycleTimeout = 0;
                    $(cont).removeData('cycle.opts');
                    return false;
                case 'pause':
                    cont.cyclePause = 1;
                    return false;
                case 'resume':
                    cont.cyclePause = 0;
                    if (arg2 === true) { // resume now!
                        options = $(cont).data('cycle.opts');
                        if (!options) {
                            log('options not found, can not resume');
                            return false;
                        }
                        if (cont.cycleTimeout) {
                            clearTimeout(cont.cycleTimeout);
                            cont.cycleTimeout = 0;
                        }
                        go(options.elements, options, 1, 1);
                    }
                    return false;
                default:
                    options = { fx: options };
            };
        }
        else if (options.constructor == Number) {
            // go to the requested slide
            var num = options;
            options = $(cont).data('cycle.opts');
            if (!options) {
                log('options not found, can not advance slide');
                return false;
            }
            if (num < 0 || num >= options.elements.length) {
                log('invalid slide index: ' + num);
                return false;
            }
            options.nextSlide = num;
            if (cont.cycleTimeout) {
                clearTimeout(cont.cycleTimeout);
                cont.cycleTimeout = 0;
            }
            if (typeof arg2 == 'string')
                options.oneTimeFx = arg2;
            go(options.elements, options, 1, num >= options.currSlide);
            return false;
        }
        return options;
    };

    function removeFilter(el, opts) {
        if (!$.support.opacity && opts.cleartype && el.style.filter) {
            try { el.style.removeAttribute('filter'); }
            catch (smother) { } // handle old opera versions
        }
    };

    // one-time initialization
    function buildOptions($cont, $slides, els, options, o) {
        // support metadata plugin (v1.0 and v2.0)
        var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
        if (opts.autostop)
            opts.countdown = opts.autostopCount || els.length;

        var cont = $cont[0];
        $cont.data('cycle.opts', opts);
        opts.$cont = $cont;
        opts.stopCount = cont.cycleStop;
        opts.elements = els;
        opts.before = opts.before ? [opts.before] : [];
        opts.after = opts.after ? [opts.after] : [];
        opts.after.unshift(function () { opts.busy = 0; });

        // push some after callbacks
        if (!$.support.opacity && opts.cleartype)
            opts.after.push(function () { removeFilter(this, opts); });
        if (opts.continuous)
            opts.after.push(function () { go(els, opts, 0, !opts.rev); });

        saveOriginalOpts(opts);

        // clearType corrections
        if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
            clearTypeFix($slides);

        // container requires non-static position so that slides can be position within
        if ($cont.css('position') == 'static')
            $cont.css('position', 'relative');
        if (opts.width)
            $cont.width(opts.width);
        if (opts.height && opts.height != 'auto')
            $cont.height(opts.height);

        if (opts.startingSlide)
            opts.startingSlide = parseInt(opts.startingSlide);

        // if random, mix up the slide array
        if (opts.random) {
            opts.randomMap = [];
            for (var i = 0; i < els.length; i++)
                opts.randomMap.push(i);
            opts.randomMap.sort(function (a, b) { return Math.random() - 0.5; });
            opts.randomIndex = 0;
            opts.startingSlide = opts.randomMap[0];
        }
        else if (opts.startingSlide >= els.length)
            opts.startingSlide = 0; // catch bogus input
        opts.currSlide = opts.startingSlide = opts.startingSlide || 0;
        var first = opts.startingSlide;

        // set position and zIndex on all the slides
        $slides.css({ position: 'absolute', top: 0, left: 0 }).hide().each(function (i) {
            var z = first ? i >= first ? els.length - (i - first) : first - i : els.length - i;
            $(this).css('z-index', z)
        });

        // make sure first slide is visible
        $(els[first]).css('opacity', 1).show(); // opacity bit needed to handle restart use case
        removeFilter(els[first], opts);

        // stretch slides
        if (opts.fit && opts.width)
            $slides.width(opts.width);
        if (opts.fit && opts.height && opts.height != 'auto')
            $slides.height(opts.height);

        // stretch container
        var reshape = opts.containerResize && !$cont.innerHeight();
        if (reshape) { // do this only if container has no size http://tinyurl.com/da2oa9
            var maxw = 0, maxh = 0;
            for (var i = 0; i < els.length; i++) {
                var $e = $(els[i]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight();
                if (!w) w = e.offsetWidth;
                if (!h) h = e.offsetHeight;
                maxw = w > maxw ? w : maxw;
                maxh = h > maxh ? h : maxh;
            }
            if (maxw > 0 && maxh > 0)
                $cont.css({ width: maxw + 'px', height: maxh + 'px' });
        }

        if (opts.pause)
            $cont.hover(function () { this.cyclePause++; }, function () { this.cyclePause--; });

        if (supportMultiTransitions(opts) === false)
            return false;

        // run transition init fn
        if (!opts.multiFx) {
            var init = $.fn.cycle.transitions[opts.fx];
            if ($.isFunction(init))
                init($cont, $slides, opts);
            else if (opts.fx != 'custom' && !opts.multiFx) {
                log('unknown transition: ' + opts.fx, '; slideshow terminating');
                return false;
            }
        }

        // apparently a lot of people use image slideshows without height/width attributes on the images.
        // Cycle 2.50+ requires the sizing info for every slide; this block tries to deal with that.
        var requeue = false;
        options.requeueAttempts = options.requeueAttempts || 0;
        $slides.each(function () {
            // try to get height/width of each slide
            var $el = $(this);
            this.cycleH = (opts.fit && opts.height) ? opts.height : $el.height();
            this.cycleW = (opts.fit && opts.width) ? opts.width : $el.width();

            if ($el.is('img')) {
                // sigh..  sniffing, hacking, shrugging...
                var loadingIE = ($.browser.msie && this.cycleW == 28 && this.cycleH == 30 && !this.complete);
                var loadingOp = ($.browser.opera && this.cycleW == 42 && this.cycleH == 19 && !this.complete);
                var loadingOther = (this.cycleH == 0 && this.cycleW == 0 && !this.complete);

                // don't requeue for images that are still loading but have a valid size
                if (loadingIE || loadingOp || loadingOther) {
                    if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever
                        log(options.requeueAttempts, ' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH);
                        setTimeout(function () { $(o.s, o.c).cycle(options) }, opts.requeueTimeout);
                        requeue = true;
                        return false; // break each loop
                    }
                    else {
                        log('could not determine size of image: ' + this.src, this.cycleW, this.cycleH);
                    }
                }
            }
            return true;
        });

        if (requeue)
            return false;

        opts.cssBefore = opts.cssBefore || {};
        opts.animIn = opts.animIn || {};
        opts.animOut = opts.animOut || {};

        $slides.not(':eq(' + first + ')').css(opts.cssBefore);
        if (opts.cssFirst)
            $($slides[first]).css(opts.cssFirst);

        if (opts.timeout) {
            opts.timeout = parseInt(opts.timeout);
            // ensure that timeout and speed settings are sane
            if (opts.speed.constructor == String)
                opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed);
            if (!opts.sync)
                opts.speed = opts.speed / 2;
            while ((opts.timeout - opts.speed) < 250) // sanitize timeout
                opts.timeout += opts.speed;
        }
        if (opts.easing)
            opts.easeIn = opts.easeOut = opts.easing;
        if (!opts.speedIn)
            opts.speedIn = opts.speed;
        if (!opts.speedOut)
            opts.speedOut = opts.speed;

        opts.slideCount = els.length;
        opts.currSlide = opts.lastSlide = first;
        if (opts.random) {
            opts.nextSlide = opts.currSlide;
            if (++opts.randomIndex == els.length)
                opts.randomIndex = 0;
            opts.nextSlide = opts.randomMap[opts.randomIndex];
        }
        else
            opts.nextSlide = opts.startingSlide >= (els.length - 1) ? 0 : opts.startingSlide + 1;

        // fire artificial events
        var e0 = $slides[first];
        if (opts.before.length)
            opts.before[0].apply(e0, [e0, e0, opts, true]);
        if (opts.after.length > 1)
            opts.after[1].apply(e0, [e0, e0, opts, true]);

        if (opts.next)
            $(opts.next).click(function () { return advance(opts, opts.rev ? -1 : 1) });
        if (opts.prev)
            $(opts.prev).click(function () { return advance(opts, opts.rev ? 1 : -1) });
        if (opts.pager)
            buildPager(els, opts);

        exposeAddSlide(opts, els);

        return opts;
    };

    // save off original opts so we can restore after clearing state
    function saveOriginalOpts(opts) {
        opts.original = { before: [], after: [] };
        opts.original.cssBefore = $.extend({}, opts.cssBefore);
        opts.original.cssAfter = $.extend({}, opts.cssAfter);
        opts.original.animIn = $.extend({}, opts.animIn);
        opts.original.animOut = $.extend({}, opts.animOut);
        $.each(opts.before, function () { opts.original.before.push(this); });
        $.each(opts.after, function () { opts.original.after.push(this); });
    };

    function supportMultiTransitions(opts) {
        var txs = $.fn.cycle.transitions;
        // look for multiple effects
        if (opts.fx.indexOf(',') > 0) {
            opts.multiFx = true;
            opts.fxs = opts.fx.replace(/\s*/g, '').split(',');
            // discard any bogus effect names
            for (var i = 0; i < opts.fxs.length; i++) {
                var fx = opts.fxs[i];
                var tx = txs[fx];
                if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) {
                    log('discarding unknown transition: ', fx);
                    opts.fxs.splice(i, 1);
                    i--;
                }
            }
            // if we have an empty list then we threw everything away!
            if (!opts.fxs.length) {
                log('No valid transitions named; slideshow terminating.');
                return false;
            }
        }
        else if (opts.fx == 'all') {  // auto-gen the list of transitions
            opts.multiFx = true;
            opts.fxs = [];
            for (p in txs) {
                var tx = txs[p];
                if (txs.hasOwnProperty(p) && $.isFunction(tx))
                    opts.fxs.push(p);
            }
        }
        if (opts.multiFx && opts.randomizeEffects) {
            // munge the fxs array to make effect selection random
            var r1 = Math.floor(Math.random() * 20) + 30;
            for (var i = 0; i < r1; i++) {
                var r2 = Math.floor(Math.random() * opts.fxs.length);
                opts.fxs.push(opts.fxs.splice(r2, 1)[0]);
            }
            log('randomized fx sequence: ', opts.fxs);
        }
        return true;
    };

    // provide a mechanism for adding slides after the slideshow has started
    function exposeAddSlide(opts, els) {
        opts.addSlide = function (newSlide, prepend) {
            var $s = $(newSlide), s = $s[0];
            if (!opts.autostopCount)
                opts.countdown++;
            els[prepend ? 'unshift' : 'push'](s);
            if (opts.els)
                opts.els[prepend ? 'unshift' : 'push'](s); // shuffle needs this
            opts.slideCount = els.length;

            $s.css('position', 'absolute');
            $s[prepend ? 'prependTo' : 'appendTo'](opts.$cont);

            if (prepend) {
                opts.currSlide++;
                opts.nextSlide++;
            }

            if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
                clearTypeFix($s);

            if (opts.fit && opts.width)
                $s.width(opts.width);
            if (opts.fit && opts.height && opts.height != 'auto')
                $slides.height(opts.height);
            s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height();
            s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width();

            $s.css(opts.cssBefore);

            if (opts.pager)
                $.fn.cycle.createPagerAnchor(els.length - 1, s, $(opts.pager), els, opts);

            if ($.isFunction(opts.onAddSlide))
                opts.onAddSlide($s);
            else
                $s.hide(); // default behavior
        };
    }

    // reset internal state; we do this on every pass in order to support multiple effects
    $.fn.cycle.resetState = function (opts, fx) {
        fx = fx || opts.fx;
        opts.before = []; opts.after = [];
        opts.cssBefore = $.extend({}, opts.original.cssBefore);
        opts.cssAfter = $.extend({}, opts.original.cssAfter);
        opts.animIn = $.extend({}, opts.original.animIn);
        opts.animOut = $.extend({}, opts.original.animOut);
        opts.fxFn = null;
        $.each(opts.original.before, function () { opts.before.push(this); });
        $.each(opts.original.after, function () { opts.after.push(this); });

        // re-init
        var init = $.fn.cycle.transitions[fx];
        if ($.isFunction(init))
            init(opts.$cont, $(opts.elements), opts);
    };

    // this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt
    function go(els, opts, manual, fwd) {
        // opts.busy is true if we're in the middle of an animation
        if (manual && opts.busy && opts.manualTrump) {
            // let manual transitions requests trump active ones
            $(els).stop(true, true);
            opts.busy = false;
        }
        // don't begin another timeout-based transition if there is one active
        if (opts.busy)
            return;

        var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide];

        // stop cycling if we have an outstanding stop request
        if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual)
            return;

        // check to see if we should stop cycling based on autostop options
        if (!manual && !p.cyclePause &&
		((opts.autostop && (--opts.countdown <= 0)) ||
		(opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) {
            if (opts.end)
                opts.end(opts);
            return;
        }

        // if slideshow is paused, only transition on a manual trigger
        if (manual || !p.cyclePause) {
            var fx = opts.fx;
            // keep trying to get the slide size if we don't have it yet
            curr.cycleH = curr.cycleH || $(curr).height();
            curr.cycleW = curr.cycleW || $(curr).width();
            next.cycleH = next.cycleH || $(next).height();
            next.cycleW = next.cycleW || $(next).width();

            // support multiple transition types
            if (opts.multiFx) {
                if (opts.lastFx == undefined || ++opts.lastFx >= opts.fxs.length)
                    opts.lastFx = 0;
                fx = opts.fxs[opts.lastFx];
                opts.currFx = fx;
            }

            // one-time fx overrides apply to:  $('div').cycle(3,'zoom');
            if (opts.oneTimeFx) {
                fx = opts.oneTimeFx;
                opts.oneTimeFx = null;
            }

            $.fn.cycle.resetState(opts, fx);

            // run the before callbacks
            if (opts.before.length)
                $.each(opts.before, function (i, o) {
                    if (p.cycleStop != opts.stopCount) return;
                    o.apply(next, [curr, next, opts, fwd]);
                });

            // stage the after callacks
            var after = function () {
                $.each(opts.after, function (i, o) {
                    if (p.cycleStop != opts.stopCount) return;
                    o.apply(next, [curr, next, opts, fwd]);
                });
            };

            if (opts.nextSlide != opts.currSlide) {
                // get ready to perform the transition
                opts.busy = 1;
                if (opts.fxFn) // fx function provided?
                    opts.fxFn(curr, next, opts, after, fwd);
                else if ($.isFunction($.fn.cycle[opts.fx])) // fx plugin ?
                    $.fn.cycle[opts.fx](curr, next, opts, after);
                else
                    $.fn.cycle.custom(curr, next, opts, after, manual && opts.fastOnEvent);
            }

            // calculate the next slide
            opts.lastSlide = opts.currSlide;
            if (opts.random) {
                opts.currSlide = opts.nextSlide;
                if (++opts.randomIndex == els.length)
                    opts.randomIndex = 0;
                opts.nextSlide = opts.randomMap[opts.randomIndex];
            }
            else { // sequence
                var roll = (opts.nextSlide + 1) == els.length;
                opts.nextSlide = roll ? 0 : opts.nextSlide + 1;
                opts.currSlide = roll ? els.length - 1 : opts.nextSlide - 1;
            }

            if (opts.pager)
                $.fn.cycle.updateActivePagerLink(opts.pager, opts.currSlide);
        }

        // stage the next transtion
        var ms = 0;
        if (opts.timeout && !opts.continuous)
            ms = getTimeout(curr, next, opts, fwd);
        else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic
            ms = 10;
        if (ms > 0)
            p.cycleTimeout = setTimeout(function () { go(els, opts, 0, !opts.rev) }, ms);
    };

    // invoked after transition
    $.fn.cycle.updateActivePagerLink = function (pager, currSlide) {
        $(pager).find('a').removeClass('activeSlide').filter('a:eq(' + currSlide + ')').addClass('activeSlide');
    };

    // calculate timeout value for current transition
    function getTimeout(curr, next, opts, fwd) {
        if (opts.timeoutFn) {
            // call user provided calc fn
            var t = opts.timeoutFn(curr, next, opts, fwd);
            if (t !== false)
                return t;
        }
        return opts.timeout;
    };

    // expose next/prev function, caller must pass in state
    $.fn.cycle.next = function (opts) { advance(opts, opts.rev ? -1 : 1); };
    $.fn.cycle.prev = function (opts) { advance(opts, opts.rev ? 1 : -1); };

    // advance slide forward or back
    function advance(opts, val) {
        var els = opts.elements;
        var p = opts.$cont[0], timeout = p.cycleTimeout;
        if (timeout) {
            clearTimeout(timeout);
            p.cycleTimeout = 0;
        }
        if (opts.random && val < 0) {
            // move back to the previously display slide
            opts.randomIndex--;
            if (--opts.randomIndex == -2)
                opts.randomIndex = els.length - 2;
            else if (opts.randomIndex == -1)
                opts.randomIndex = els.length - 1;
            opts.nextSlide = opts.randomMap[opts.randomIndex];
        }
        else if (opts.random) {
            if (++opts.randomIndex == els.length)
                opts.randomIndex = 0;
            opts.nextSlide = opts.randomMap[opts.randomIndex];
        }
        else {
            opts.nextSlide = opts.currSlide + val;
            if (opts.nextSlide < 0) {
                if (opts.nowrap) return false;
                opts.nextSlide = els.length - 1;
            }
            else if (opts.nextSlide >= els.length) {
                if (opts.nowrap) return false;
                opts.nextSlide = 0;
            }
        }

        if ($.isFunction(opts.prevNextClick))
            opts.prevNextClick(val > 0, opts.nextSlide, els[opts.nextSlide]);
        go(els, opts, 1, val >= 0);
        return false;
    };

    function buildPager(els, opts) {
        var $p = $(opts.pager);
        $.each(els, function (i, o) {
            $.fn.cycle.createPagerAnchor(i, o, $p, els, opts);
        });
        $.fn.cycle.updateActivePagerLink(opts.pager, opts.startingSlide);
    };

    $.fn.cycle.createPagerAnchor = function (i, el, $p, els, opts) {
        var a = ($.isFunction(opts.pagerAnchorBuilder))
		? opts.pagerAnchorBuilder(i, el)
		: '<a href="#">' + (i + 1) + '</a>';
        if (!a)
            return;
        var $a = $(a);
        // don't reparent if anchor is in the dom
        if ($a.parents('body').length == 0) {
            var arr = [];
            if ($p.length > 1) {
                $p.each(function () {
                    var $clone = $a.clone(true);
                    $(this).append($clone);
                    arr.push($clone);
                });
                $a = $(arr);
            }
            else {
                $a.appendTo($p);
            }
        }

        $a.bind(opts.pagerEvent, function () {
            opts.nextSlide = i;
            var p = opts.$cont[0], timeout = p.cycleTimeout;
            if (timeout) {
                clearTimeout(timeout);
                p.cycleTimeout = 0;
            }
            if ($.isFunction(opts.pagerClick))
                opts.pagerClick(opts.nextSlide, els[opts.nextSlide]);
            go(els, opts, 1, opts.currSlide < i); // trigger the trans
            return false;
        });
        if (opts.pauseOnPagerHover)
            $a.hover(function () { opts.$cont[0].cyclePause++; }, function () { opts.$cont[0].cyclePause--; });
    };

    // helper fn to calculate the number of slides between the current and the next
    $.fn.cycle.hopsFromLast = function (opts, fwd) {
        var hops, l = opts.lastSlide, c = opts.currSlide;
        if (fwd)
            hops = c > l ? c - l : opts.slideCount - l;
        else
            hops = c < l ? l - c : l + opts.slideCount - c;
        return hops;
    };

    // fix clearType problems in ie6 by setting an explicit bg color
    // (otherwise text slides look horrible during a fade transition)
    function clearTypeFix($slides) {
        function hex(s) {
            s = parseInt(s).toString(16);
            return s.length < 2 ? '0' + s : s;
        };
        function getBg(e) {
            for (; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) {
                var v = $.css(e, 'background-color');
                if (v.indexOf('rgb') >= 0) {
                    var rgb = v.match(/\d+/g);
                    return '#' + hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
                }
                if (v && v != 'transparent')
                    return v;
            }
            return '#ffffff';
        };
        $slides.each(function () { $(this).css('background-color', getBg(this)); });
    };

    // reset common props before the next transition
    $.fn.cycle.commonReset = function (curr, next, opts, w, h, rev) {
        $(opts.elements).not(curr).hide();
        opts.cssBefore.opacity = 1;
        opts.cssBefore.display = 'block';
        if (w !== false && next.cycleW > 0)
            opts.cssBefore.width = next.cycleW;
        if (h !== false && next.cycleH > 0)
            opts.cssBefore.height = next.cycleH;
        opts.cssAfter = opts.cssAfter || {};
        opts.cssAfter.display = 'none';
        $(curr).css('zIndex', opts.slideCount + (rev === true ? 1 : 0));
        $(next).css('zIndex', opts.slideCount + (rev === true ? 0 : 1));
    };

    // the actual fn for effecting a transition
    $.fn.cycle.custom = function (curr, next, opts, cb, speedOverride) {
        var $l = $(curr), $n = $(next);
        var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut;
        $n.css(opts.cssBefore);
        if (speedOverride) {
            if (typeof speedOverride == 'number')
                speedIn = speedOut = speedOverride;
            else
                speedIn = speedOut = 1;
            easeIn = easeOut = null;
        }
        var fn = function () { $n.animate(opts.animIn, speedIn, easeIn, cb) };
        $l.animate(opts.animOut, speedOut, easeOut, function () {
            if (opts.cssAfter) $l.css(opts.cssAfter);
            if (!opts.sync) fn();
        });
        if (opts.sync) fn();
    };

    // transition definitions - only fade is defined here, transition pack defines the rest
    $.fn.cycle.transitions = {
        fade: function ($cont, $slides, opts) {
            $slides.not(':eq(' + opts.currSlide + ')').css('opacity', 0);
            opts.before.push(function (curr, next, opts) {
                $.fn.cycle.commonReset(curr, next, opts);
                opts.cssBefore.opacity = 0;
            });
            opts.animIn = { opacity: 1 };
            opts.animOut = { opacity: 0 };
            opts.cssBefore = { top: 0, left: 0 };
        }
    };

    $.fn.cycle.ver = function () { return ver; };

    // override these globally if you like (they are all optional)
    $.fn.cycle.defaults = {
        fx: 'fade', // name of transition effect (or comma separated names, ex: fade,scrollUp,shuffle)
        timeout: 4000,  // milliseconds between slide transitions (0 to disable auto advance)
        timeoutFn: null,  // callback for determining per-slide timeout value:  function(currSlideElement, nextSlideElement, options, forwardFlag)
        continuous: 0,   // true to start next transition immediately after current one completes
        speed: 1000,  // speed of the transition (any valid fx speed value)
        speedIn: null,  // speed of the 'in' transition
        speedOut: null,  // speed of the 'out' transition
        next: null,  // selector for element to use as click trigger for next slide
        prev: null,  // selector for element to use as click trigger for previous slide
        prevNextClick: null,  // callback fn for prev/next clicks:	function(isNext, zeroBasedSlideIndex, slideElement)
        pager: null,  // selector for element to use as pager container
        pagerClick: null,  // callback fn for pager clicks:	function(zeroBasedSlideIndex, slideElement)
        pagerEvent: 'click', // name of event which drives the pager navigation
        pagerAnchorBuilder: null, // callback fn for building anchor links:  function(index, DOMelement)
        before: null,  // transition callback (scope set to element to be shown):     function(currSlideElement, nextSlideElement, options, forwardFlag)
        after: null,  // transition callback (scope set to element that was shown):  function(currSlideElement, nextSlideElement, options, forwardFlag)
        end: null,  // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options)
        easing: null,  // easing method for both in and out transitions
        easeIn: null,  // easing for "in" transition
        easeOut: null,  // easing for "out" transition
        shuffle: null,  // coords for shuffle animation, ex: { top:15, left: 200 }
        animIn: null,  // properties that define how the slide animates in
        animOut: null,  // properties that define how the slide animates out
        cssBefore: null,  // properties that define the initial state of the slide before transitioning in
        cssAfter: null,  // properties that defined the state of the slide after transitioning out
        fxFn: null,  // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag)
        height: 'auto', // container height
        startingSlide: 0,   // zero-based index of the first slide to be displayed
        sync: 1,   // true if in/out transitions should occur simultaneously
        random: 0,   // true for random, false for sequence (not applicable to shuffle fx)
        fit: 0,   // force slides to fit container
        containerResize: 1,   // resize container to fit largest slide
        pause: 0,   // true to enable "pause on hover"
        pauseOnPagerHover: 0, // true to pause when hovering over pager link
        autostop: 0,   // true to end slideshow after X transitions (where X == slide count)
        autostopCount: 0,   // number of transitions (optionally used with autostop to define X)
        delay: 0,   // additional delay (in ms) for first transition (hint: can be negative)
        slideExpr: null,  // expression for selecting slides (if something other than all children is required)
        cleartype: !$.support.opacity,  // true if clearType corrections should be applied (for IE)
        nowrap: 0,   // true to prevent slideshow from wrapping
        fastOnEvent: 0,   // force fast transitions when triggered manually (via pager or prev/next); value == time in ms
        randomizeEffects: 1,  // valid when multiple effects are used; true to make the effect sequence random
        rev: 0,     // causes animations to transition in reverse
        manualTrump: true,  // causes manual transition to stop an active transition instead of being ignored
        requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded
        requeueTimeout: 250   // ms delay for requeue
    };

})(jQuery);


/*!
* jQuery Cycle Plugin Transition Definitions
* This script is a plugin for the jQuery Cycle Plugin
* Examples and documentation at: http://malsup.com/jquery/cycle/
* Copyright (c) 2007-2008 M. Alsup
* Version:	 2.52
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function ($) {

    //
    // These functions define one-time slide initialization for the named
    // transitions. To save file size feel free to remove any of these that you
    // don't need.
    //

    // scrollUp/Down/Left/Right
    $.fn.cycle.transitions.scrollUp = function ($cont, $slides, opts) {
        $cont.css('overflow', 'hidden');
        opts.before.push($.fn.cycle.commonReset);
        var h = $cont.height();
        opts.cssBefore = { top: h, left: 0 };
        opts.cssFirst = { top: 0 };
        opts.animIn = { top: 0 };
        opts.animOut = { top: -h };
    };
    $.fn.cycle.transitions.scrollDown = function ($cont, $slides, opts) {
        $cont.css('overflow', 'hidden');
        opts.before.push($.fn.cycle.commonReset);
        var h = $cont.height();
        opts.cssFirst = { top: 0 };
        opts.cssBefore = { top: -h, left: 0 };
        opts.animIn = { top: 0 };
        opts.animOut = { top: h };
    };
    $.fn.cycle.transitions.scrollLeft = function ($cont, $slides, opts) {
        $cont.css('overflow', 'hidden');
        opts.before.push($.fn.cycle.commonReset);
        var w = $cont.width();
        opts.cssFirst = { left: 0 };
        opts.cssBefore = { left: w, top: 0 };
        opts.animIn = { left: 0 };
        opts.animOut = { left: 0 - w };
    };
    $.fn.cycle.transitions.scrollRight = function ($cont, $slides, opts) {
        $cont.css('overflow', 'hidden');
        opts.before.push($.fn.cycle.commonReset);
        var w = $cont.width();
        opts.cssFirst = { left: 0 };
        opts.cssBefore = { left: -w, top: 0 };
        opts.animIn = { left: 0 };
        opts.animOut = { left: w };
    };
    $.fn.cycle.transitions.scrollHorz = function ($cont, $slides, opts) {
        $cont.css('overflow', 'hidden').width();
        opts.before.push(function (curr, next, opts, fwd) {
            $.fn.cycle.commonReset(curr, next, opts);
            opts.cssBefore.left = fwd ? (next.cycleW - 1) : (1 - next.cycleW);
            opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW;
        });
        opts.cssFirst = { left: 0 };
        opts.cssBefore = { top: 0 };
        opts.animIn = { left: 0 };
        opts.animOut = { top: 0 };
    };
    $.fn.cycle.transitions.scrollVert = function ($cont, $slides, opts) {
        $cont.css('overflow', 'hidden');
        opts.before.push(function (curr, next, opts, fwd) {
            $.fn.cycle.commonReset(curr, next, opts);
            opts.cssBefore.top = fwd ? (1 - next.cycleH) : (next.cycleH - 1);
            opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH;
        });
        opts.cssFirst = { top: 0 };
        opts.cssBefore = { left: 0 };
        opts.animIn = { top: 0 };
        opts.animOut = { left: 0 };
    };

    // slideX/slideY
    $.fn.cycle.transitions.slideX = function ($cont, $slides, opts) {
        opts.before.push(function (curr, next, opts) {
            $(opts.elements).not(curr).hide();
            $.fn.cycle.commonReset(curr, next, opts, false, true);
            opts.animIn.width = next.cycleW;
        });
        opts.cssBefore = { left: 0, top: 0, width: 0 };
        opts.animIn = { width: 'show' };
        opts.animOut = { width: 0 };
    };
    $.fn.cycle.transitions.slideY = function ($cont, $slides, opts) {
        opts.before.push(function (curr, next, opts) {
            $(opts.elements).not(curr).hide();
            $.fn.cycle.commonReset(curr, next, opts, true, false);
            opts.animIn.height = next.cycleH;
        });
        opts.cssBefore = { left: 0, top: 0, height: 0 };
        opts.animIn = { height: 'show' };
        opts.animOut = { height: 0 };
    };

    // shuffle
    $.fn.cycle.transitions.shuffle = function ($cont, $slides, opts) {
        var w = $cont.css('overflow', 'visible').width();
        $slides.css({ left: 0, top: 0 });
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, true, true, true);
        });
        opts.speed = opts.speed / 2; // shuffle has 2 transitions
        opts.random = 0;
        opts.shuffle = opts.shuffle || { left: -w, top: 15 };
        opts.els = [];
        for (var i = 0; i < $slides.length; i++)
            opts.els.push($slides[i]);

        for (var i = 0; i < opts.currSlide; i++)
            opts.els.push(opts.els.shift());

        // custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!)
        opts.fxFn = function (curr, next, opts, cb, fwd) {
            var $el = fwd ? $(curr) : $(next);
            $(next).css(opts.cssBefore);
            var count = opts.slideCount;
            $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function () {
                var hops = $.fn.cycle.hopsFromLast(opts, fwd);
                for (var k = 0; k < hops; k++)
                    fwd ? opts.els.push(opts.els.shift()) : opts.els.unshift(opts.els.pop());
                if (fwd)
                    for (var i = 0, len = opts.els.length; i < len; i++)
                        $(opts.els[i]).css('z-index', len - i + count);
                else {
                    var z = $(curr).css('z-index');
                    $el.css('z-index', parseInt(z) + 1 + count);
                }
                $el.animate({ left: 0, top: 0 }, opts.speedOut, opts.easeOut, function () {
                    $(fwd ? this : curr).hide();
                    if (cb) cb();
                });
            });
        };
        opts.cssBefore = { display: 'block', opacity: 1, top: 0, left: 0 };
    };

    // turnUp/Down/Left/Right
    $.fn.cycle.transitions.turnUp = function ($cont, $slides, opts) {
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, true, false);
            opts.cssBefore.top = next.cycleH;
            opts.animIn.height = next.cycleH;
        });
        opts.cssFirst = { top: 0 };
        opts.cssBefore = { left: 0, height: 0 };
        opts.animIn = { top: 0 };
        opts.animOut = { height: 0 };
    };
    $.fn.cycle.transitions.turnDown = function ($cont, $slides, opts) {
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, true, false);
            opts.animIn.height = next.cycleH;
            opts.animOut.top = curr.cycleH;
        });
        opts.cssFirst = { top: 0 };
        opts.cssBefore = { left: 0, top: 0, height: 0 };
        opts.animOut = { height: 0 };
    };
    $.fn.cycle.transitions.turnLeft = function ($cont, $slides, opts) {
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, false, true);
            opts.cssBefore.left = next.cycleW;
            opts.animIn.width = next.cycleW;
        });
        opts.cssBefore = { top: 0, width: 0 };
        opts.animIn = { left: 0 };
        opts.animOut = { width: 0 };
    };
    $.fn.cycle.transitions.turnRight = function ($cont, $slides, opts) {
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, false, true);
            opts.animIn.width = next.cycleW;
            opts.animOut.left = curr.cycleW;
        });
        opts.cssBefore = { top: 0, left: 0, width: 0 };
        opts.animIn = { left: 0 };
        opts.animOut = { width: 0 };
    };

    // zoom
    $.fn.cycle.transitions.zoom = function ($cont, $slides, opts) {
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, false, false, true);
            opts.cssBefore.top = next.cycleH / 2;
            opts.cssBefore.left = next.cycleW / 2;
            opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH };
            opts.animOut = { width: 0, height: 0, top: curr.cycleH / 2, left: curr.cycleW / 2 };
        });
        opts.cssFirst = { top: 0, left: 0 };
        opts.cssBefore = { width: 0, height: 0 };
    };

    // fadeZoom
    $.fn.cycle.transitions.fadeZoom = function ($cont, $slides, opts) {
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, false, false);
            opts.cssBefore.left = next.cycleW / 2;
            opts.cssBefore.top = next.cycleH / 2;
            opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH };
        });
        opts.cssBefore = { width: 0, height: 0 };
        opts.animOut = { opacity: 0 };
    };

    // blindX
    $.fn.cycle.transitions.blindX = function ($cont, $slides, opts) {
        var w = $cont.css('overflow', 'hidden').width();
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts);
            opts.animIn.width = next.cycleW;
            opts.animOut.left = curr.cycleW;
        });
        opts.cssBefore = { left: w, top: 0 };
        opts.animIn = { left: 0 };
        opts.animOut = { left: w };
    };
    // blindY
    $.fn.cycle.transitions.blindY = function ($cont, $slides, opts) {
        var h = $cont.css('overflow', 'hidden').height();
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts);
            opts.animIn.height = next.cycleH;
            opts.animOut.top = curr.cycleH;
        });
        opts.cssBefore = { top: h, left: 0 };
        opts.animIn = { top: 0 };
        opts.animOut = { top: h };
    };
    // blindZ
    $.fn.cycle.transitions.blindZ = function ($cont, $slides, opts) {
        var h = $cont.css('overflow', 'hidden').height();
        var w = $cont.width();
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts);
            opts.animIn.height = next.cycleH;
            opts.animOut.top = curr.cycleH;
        });
        opts.cssBefore = { top: h, left: w };
        opts.animIn = { top: 0, left: 0 };
        opts.animOut = { top: h, left: w };
    };

    // growX - grow horizontally from centered 0 width
    $.fn.cycle.transitions.growX = function ($cont, $slides, opts) {
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, false, true);
            opts.cssBefore.left = this.cycleW / 2;
            opts.animIn = { left: 0, width: this.cycleW };
            opts.animOut = { left: 0 };
        });
        opts.cssBefore = { width: 0, top: 0 };
    };
    // growY - grow vertically from centered 0 height
    $.fn.cycle.transitions.growY = function ($cont, $slides, opts) {
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, true, false);
            opts.cssBefore.top = this.cycleH / 2;
            opts.animIn = { top: 0, height: this.cycleH };
            opts.animOut = { top: 0 };
        });
        opts.cssBefore = { height: 0, left: 0 };
    };

    // curtainX - squeeze in both edges horizontally
    $.fn.cycle.transitions.curtainX = function ($cont, $slides, opts) {
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, false, true, true);
            opts.cssBefore.left = next.cycleW / 2;
            opts.animIn = { left: 0, width: this.cycleW };
            opts.animOut = { left: curr.cycleW / 2, width: 0 };
        });
        opts.cssBefore = { top: 0, width: 0 };
    };
    // curtainY - squeeze in both edges vertically
    $.fn.cycle.transitions.curtainY = function ($cont, $slides, opts) {
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, true, false, true);
            opts.cssBefore.top = next.cycleH / 2;
            opts.animIn = { top: 0, height: next.cycleH };
            opts.animOut = { top: curr.cycleH / 2, height: 0 };
        });
        opts.cssBefore = { left: 0, height: 0 };
    };

    // cover - curr slide covered by next slide
    $.fn.cycle.transitions.cover = function ($cont, $slides, opts) {
        var d = opts.direction || 'left';
        var w = $cont.css('overflow', 'hidden').width();
        var h = $cont.height();
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts);
            if (d == 'right')
                opts.cssBefore.left = -w;
            else if (d == 'up')
                opts.cssBefore.top = h;
            else if (d == 'down')
                opts.cssBefore.top = -h;
            else
                opts.cssBefore.left = w;
        });
        opts.animIn = { left: 0, top: 0 };
        opts.animOut = { opacity: 1 };
        opts.cssBefore = { top: 0, left: 0 };
    };

    // uncover - curr slide moves off next slide
    $.fn.cycle.transitions.uncover = function ($cont, $slides, opts) {
        var d = opts.direction || 'left';
        var w = $cont.css('overflow', 'hidden').width();
        var h = $cont.height();
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, true, true, true);
            if (d == 'right')
                opts.animOut.left = w;
            else if (d == 'up')
                opts.animOut.top = -h;
            else if (d == 'down')
                opts.animOut.top = h;
            else
                opts.animOut.left = -w;
        });
        opts.animIn = { left: 0, top: 0 };
        opts.animOut = { opacity: 1 };
        opts.cssBefore = { top: 0, left: 0 };
    };

    // toss - move top slide and fade away
    $.fn.cycle.transitions.toss = function ($cont, $slides, opts) {
        var w = $cont.css('overflow', 'visible').width();
        var h = $cont.height();
        opts.before.push(function (curr, next, opts) {
            $.fn.cycle.commonReset(curr, next, opts, true, true, true);
            // provide default toss settings if animOut not provided
            if (!opts.animOut.left && !opts.animOut.top)
                opts.animOut = { left: w * 2, top: -h / 2, opacity: 0 };
            else
                opts.animOut.opacity = 0;
        });
        opts.cssBefore = { left: 0, top: 0 };
        opts.animIn = { left: 0 };
    };

    // wipe - clip animation
    $.fn.cycle.transitions.wipe = function ($cont, $slides, opts) {
        var w = $cont.css('overflow', 'hidden').width();
        var h = $cont.height();
        opts.cssBefore = opts.cssBefore || {};
        var clip;
        if (opts.clip) {
            if (/l2r/.test(opts.clip))
                clip = 'rect(0px 0px ' + h + 'px 0px)';
            else if (/r2l/.test(opts.clip))
                clip = 'rect(0px ' + w + 'px ' + h + 'px ' + w + 'px)';
            else if (/t2b/.test(opts.clip))
                clip = 'rect(0px ' + w + 'px 0px 0px)';
            else if (/b2t/.test(opts.clip))
                clip = 'rect(' + h + 'px ' + w + 'px ' + h + 'px 0px)';
            else if (/zoom/.test(opts.clip)) {
                var t = parseInt(h / 2);
                var l = parseInt(w / 2);
                clip = 'rect(' + t + 'px ' + l + 'px ' + t + 'px ' + l + 'px)';
            }
        }

        opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)';

        var d = opts.cssBefore.clip.match(/(\d+)/g);
        var t = parseInt(d[0]), r = parseInt(d[1]), b = parseInt(d[2]), l = parseInt(d[3]);

        opts.before.push(function (curr, next, opts) {
            if (curr == next) return;
            var $curr = $(curr), $next = $(next);
            $.fn.cycle.commonReset(curr, next, opts, true, true, false);
            opts.cssAfter.display = 'block';

            var step = 1, count = parseInt((opts.speedIn / 13)) - 1;
            (function f() {
                var tt = t ? t - parseInt(step * (t / count)) : 0;
                var ll = l ? l - parseInt(step * (l / count)) : 0;
                var bb = b < h ? b + parseInt(step * ((h - b) / count || 1)) : h;
                var rr = r < w ? r + parseInt(step * ((w - r) / count || 1)) : w;
                $next.css({ clip: 'rect(' + tt + 'px ' + rr + 'px ' + bb + 'px ' + ll + 'px)' });
                (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none');
            })();
        });
        opts.cssBefore = { display: 'block', opacity: 1, top: 0, left: 0 };
        opts.animIn = { left: 0 };
        opts.animOut = { left: 0 };
    };

})(jQuery);

/*
* jQuery pager plugin
* Version 1.0 (12/22/2008)
* @requires jQuery v1.2.6 or later
*
* Example at: http://jonpauldavies.github.com/JQuery/Pager/PagerDemo.html
*
* Copyright (c) 2008-2009 Jon Paul Davies
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* 
* Read the related blog post and contact the author at http://www.j-dee.com/2008/12/22/jquery-pager-plugin/
*
* This version is far from perfect and doesn't manage it's own state, therefore contributions are more than welcome!
*
* Usage: .pager({ pagenumber: 1, pagecount: 15, buttonClickCallback: PagerClickTest });
*
* Where pagenumber is the visible page number
*       pagecount is the total number of pages to display
*       buttonClickCallback is the method to fire when a pager button is clicked.
*
* buttonClickCallback signiture is PagerClickTest = function(pageclickednumber) 
* Where pageclickednumber is the number of the page clicked in the control.
*
* The included Pager.CSS file is a dependancy but can obviously tweaked to your wishes
* Tested in IE6 IE7 Firefox & Safari. Any browser strangeness, please report.
*/
(function ($) {

    $.fn.pager = function (options) {

        var opts = $.extend({}, $.fn.pager.defaults, options);

        return this.each(function () {

            // empty out the destination element and then render out the pager with the supplied options
            $(this).empty().append(renderpager(parseInt(options.pagenumber), parseInt(options.pagecount), options.buttonClickCallback, $(this)));

            // specify correct cursor activity
            $('.pages li').mouseover(function () { document.body.style.cursor = "pointer"; }).mouseout(function () { document.body.style.cursor = "auto"; });
        });
    };

    // render and return the pager with the supplied options
    function renderpager(pagenumber, pagecount, buttonClickCallback, element) {

        // setup $pager to hold render
        var $pager = $('<ul class="pages"></ul>');

        // add in the previous and next buttons
        $pager.append(renderButton('first', pagenumber, pagecount, buttonClickCallback, element)).append(renderButton('prev', pagenumber, pagecount, buttonClickCallback, element));

        // pager currently only handles 10 viewable pages ( could be easily parameterized, maybe in next version ) so handle edge cases
        var startPoint = 1;
        var endPoint = 9;

        if (pagenumber > 4) {
            startPoint = pagenumber - 4;
            endPoint = pagenumber + 4;
        }

        if (endPoint > pagecount) {
            startPoint = pagecount - 8;
            endPoint = pagecount;
        }

        if (startPoint < 1) {
            startPoint = 1;
        }

        // loop thru visible pages and render buttons
        for (var page = startPoint; page <= endPoint; page++) {

            var currentButton = $('<li class="page-number">' + (page) + '</li>');

            page == pagenumber ? currentButton.addClass('pgCurrent') : currentButton.click(function () { buttonClickCallback(this.firstChild.data, element); });
            currentButton.appendTo($pager);
        }

        // render in the next and last buttons before returning the whole rendered control back.
        $pager.append(renderButton('next', pagenumber, pagecount, buttonClickCallback, element)).append(renderButton('last', pagenumber, pagecount, buttonClickCallback, element));

        return $pager;
    }

    // renders and returns a 'specialized' button, ie 'next', 'previous' etc. rather than a page number button
    function renderButton(buttonLabel, pagenumber, pagecount, buttonClickCallback, element) {

        var $Button = $('<li class="pgNext">' + buttonLabel + '</li>');

        var destPage = 1;

        // work out destination page for required button type
        switch (buttonLabel) {
            case "first":
                destPage = 1;
                break;
            case "prev":
                destPage = pagenumber - 1;
                break;
            case "next":
                destPage = pagenumber + 1;
                break;
            case "last":
                destPage = pagecount;
                break;
        }

        // disable and 'grey' out buttons if not needed.
        if (buttonLabel == "first" || buttonLabel == "prev") {
            pagenumber <= 1 ? $Button.addClass('pgEmpty') : $Button.click(function () { buttonClickCallback(destPage, element); });
        }
        else {
            pagenumber >= pagecount ? $Button.addClass('pgEmpty') : $Button.click(function () { buttonClickCallback(destPage, element); });
        }

        return $Button;
    }

    // pager defaults. hardly worth bothering with in this case but used as placeholder for expansion in the next version
    $.fn.pager.defaults = {
        pagenumber: 1,
        pagecount: 1
    };



})(jQuery);


/**
* jCarousel - Riding carousels with jQuery
*   http://sorgalla.com/jcarousel/
*
* Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* Built on top of the jQuery library
*   http://jquery.com
*
* Inspired by the "Carousel Component" by Bill Scott
*   http://billwscott.com/carousel/
*/
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 } ('(9($){$.1v.C=9(o){z 4.1b(9(){3p r(4,o)})};8 q={Z:F,25:1,21:1,u:7,1c:3,15:7,1K:\'2X\',2c:\'2Q\',1q:0,B:7,1j:7,1G:7,2F:7,2B:7,2z:7,2x:7,2v:7,2s:7,2p:7,1S:\'<P></P>\',1Q:\'<P></P>\',2m:\'2l\',2k:\'2l\',1O:7,1L:7};$.C=9(e,o){4.5=$.16({},q,o||{});4.Q=F;4.D=7;4.H=7;4.t=7;4.U=7;4.R=7;4.N=!4.5.Z?\'1H\':\'26\';4.E=!4.5.Z?\'24\':\'23\';8 a=\'\',1e=e.K.1e(\' \');1r(8 i=0;i<1e.I;i++){6(1e[i].2y(\'C-2w\')!=-1){$(e).1E(1e[i]);8 a=1e[i];1p}}6(e.2t==\'3o\'||e.2t==\'3n\'){4.t=$(e);4.D=4.t.19();6(4.D.1o(\'C-H\')){6(!4.D.19().1o(\'C-D\'))4.D=4.D.B(\'<P></P>\');4.D=4.D.19()}10 6(!4.D.1o(\'C-D\'))4.D=4.t.B(\'<P></P>\').19()}10{4.D=$(e);4.t=$(e).3h(\'>2o,>2n,P>2o,P>2n\')}6(a!=\'\'&&4.D.19()[0].K.2y(\'C-2w\')==-1)4.D.B(\'<P 3g=" \'+a+\'"></P>\');4.H=4.t.19();6(!4.H.I||!4.H.1o(\'C-H\'))4.H=4.t.B(\'<P></P>\').19();4.R=$(\'.C-11\',4.D);6(4.R.u()==0&&4.5.1Q!=7)4.R=4.H.1z(4.5.1Q).11();4.R.V(4.K(\'C-11\'));4.U=$(\'.C-17\',4.D);6(4.U.u()==0&&4.5.1S!=7)4.U=4.H.1z(4.5.1S).11();4.U.V(4.K(\'C-17\'));4.H.V(4.K(\'C-H\'));4.t.V(4.K(\'C-t\'));4.D.V(4.K(\'C-D\'));8 b=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 c=4.t.32(\'1F\');8 d=4;6(c.u()>0){8 f=0,i=4.5.21;c.1b(9(){d.1I(4,i++);f+=d.S(4,b)});4.t.y(4.N,f+\'T\');6(!o||o.u===J)4.5.u=c.u()}4.D.y(\'1y\',\'1A\');4.U.y(\'1y\',\'1A\');4.R.y(\'1y\',\'1A\');4.2G=9(){d.17()};4.2b=9(){d.11()};4.1U=9(){d.2q()};6(4.5.1j!=7)4.5.1j(4,\'2a\');6($.2A.28){4.1f(F,F);$(27).1u(\'2I\',9(){d.1t()})}10 4.1t()};8 r=$.C;r.1v=r.2H={C:\'0.2.3\'};r.1v.16=r.16=$.16;r.1v.16({1t:9(){4.A=7;4.G=7;4.X=7;4.13=7;4.14=F;4.1d=7;4.O=7;4.W=F;6(4.Q)z;4.t.y(4.E,4.1s(4.5.21)+\'T\');8 p=4.1s(4.5.25);4.X=4.13=7;4.1i(p,F);$(27).22(\'2E\',4.1U).1u(\'2E\',4.1U)},2D:9(){4.t.2C();4.t.y(4.E,\'3u\');4.t.y(4.N,\'3t\');6(4.5.1j!=7)4.5.1j(4,\'2D\');4.1t()},2q:9(){6(4.O!=7&&4.W)4.t.y(4.E,r.M(4.t.y(4.E))+4.O);4.O=7;4.W=F;6(4.5.1G!=7)4.5.1G(4);6(4.5.15!=7){8 a=4;8 b=1k.1P(4.1m()/4.5.15),N=0,E=0;$(\'1F\',4.t).1b(9(i){N+=a.S(4,b);6(i+1<a.A)E=N});4.t.y(4.N,N+\'T\');4.t.y(4.E,-E+\'T\')}4.1c(4.A,F)},3s:9(){4.Q=1h;4.1f()},3r:9(){4.Q=F;4.1f()},u:9(s){6(s!=J){4.5.u=s;6(!4.Q)4.1f()}z 4.5.u},3q:9(i,a){6(a==J||!a)a=i;6(4.5.u!==7&&a>4.5.u)a=4.5.u;1r(8 j=i;j<=a;j++){8 e=4.L(j);6(!e.I||e.1o(\'C-1a-1D\'))z F}z 1h},L:9(i){z $(\'.C-1a-\'+i,4.t)},2u:9(i,s){8 e=4.L(i),20=0,2u=0;6(e.I==0){8 c,e=4.1B(i),j=r.M(i);1n(c=4.L(--j)){6(j<=0||c.I){j<=0?4.t.2r(e):c.1X(e);1p}}}10 20=4.S(e);e.1E(4.K(\'C-1a-1D\'));1R s==\'3l\'?e.3k(s):e.2C().3j(s);8 a=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 b=4.S(e,a)-20;6(i>0&&i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))-b+\'T\');4.t.y(4.N,r.M(4.t.y(4.N))+b+\'T\');z e},1V:9(i){8 e=4.L(i);6(!e.I||(i>=4.A&&i<=4.G))z;8 d=4.S(e);6(i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))+d+\'T\');e.1V();4.t.y(4.N,r.M(4.t.y(4.N))-d+\'T\')},17:9(){4.1C();6(4.O!=7&&!4.W)4.1T(F);10 4.1c(((4.5.B==\'1Z\'||4.5.B==\'G\')&&4.5.u!=7&&4.G==4.5.u)?1:4.A+4.5.1c)},11:9(){4.1C();6(4.O!=7&&4.W)4.1T(1h);10 4.1c(((4.5.B==\'1Z\'||4.5.B==\'A\')&&4.5.u!=7&&4.A==1)?4.5.u:4.A-4.5.1c)},1T:9(b){6(4.Q||4.14||!4.O)z;8 a=r.M(4.t.y(4.E));!b?a-=4.O:a+=4.O;4.W=!b;4.X=4.A;4.13=4.G;4.1i(a)},1c:9(i,a){6(4.Q||4.14)z;4.1i(4.1s(i),a)},1s:9(i){6(4.Q||4.14)z;6(4.5.B!=\'18\')i=i<1?1:(4.5.u&&i>4.5.u?4.5.u:i);8 a=4.A>i;8 b=r.M(4.t.y(4.E));8 f=4.5.B!=\'18\'&&4.A<=1?1:4.A;8 c=a?4.L(f):4.L(4.G);8 j=a?f:f-1;8 e=7,l=0,p=F,d=0;1n(a?--j>=i:++j<i){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K(\'C-1a-1D\'));c[a?\'1z\':\'1X\'](e)}c=e;d=4.S(e);6(p)l+=d;6(4.A!=7&&(4.5.B==\'18\'||(j>=1&&(4.5.u==7||j<=4.5.u))))b=a?b+d:b-d}8 g=4.1m();8 h=[];8 k=0,j=i,v=0;8 c=4.L(i-1);1n(++k){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K(\'C-1a-1D\'));c.I==0?4.t.2r(e):c[a?\'1z\':\'1X\'](e)}c=e;8 d=4.S(e);6(d==0){3f(\'3e: 3d 1H/26 3c 1r 3b. 3a 39 38 37 36 35. 34...\');z 0}6(4.5.B!=\'18\'&&4.5.u!==7&&j>4.5.u)h.33(e);10 6(p)l+=d;v+=d;6(v>=g)1p;j++}1r(8 x=0;x<h.I;x++)h[x].1V();6(l>0){4.t.y(4.N,4.S(4.t)+l+\'T\');6(a){b-=l;4.t.y(4.E,r.M(4.t.y(4.E))-l+\'T\')}}8 n=i+k-1;6(4.5.B!=\'18\'&&4.5.u&&n>4.5.u)n=4.5.u;6(j>n){k=0,j=n,v=0;1n(++k){8 e=4.L(j--);6(!e.I)1p;v+=4.S(e);6(v>=g)1p}}8 o=n-k+1;6(4.5.B!=\'18\'&&o<1)o=1;6(4.W&&a){b+=4.O;4.W=F}4.O=7;6(4.5.B!=\'18\'&&n==4.5.u&&(n-k+1)>=1){8 m=r.Y(4.L(n),!4.5.Z?\'1l\':\'1N\');6((v-m)>g)4.O=v-g-m}1n(i-->o)b+=4.S(4.L(i));4.X=4.A;4.13=4.G;4.A=o;4.G=n;z b},1i:9(p,a){6(4.Q||4.14)z;4.14=1h;8 b=4;8 c=9(){b.14=F;6(p==0)b.t.y(b.E,0);6(b.5.B==\'1Z\'||b.5.B==\'G\'||b.5.u==7||b.G<b.5.u)b.2j();b.1f();b.1M(\'2i\')};4.1M(\'31\');6(!4.5.1K||a==F){4.t.y(4.E,p+\'T\');c()}10{8 o=!4.5.Z?{\'24\':p}:{\'23\':p};4.t.1i(o,4.5.1K,4.5.2c,c)}},2j:9(s){6(s!=J)4.5.1q=s;6(4.5.1q==0)z 4.1C();6(4.1d!=7)z;8 a=4;4.1d=30(9(){a.17()},4.5.1q*2Z)},1C:9(){6(4.1d==7)z;2Y(4.1d);4.1d=7},1f:9(n,p){6(n==J||n==7){8 n=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'A\')||4.5.u==7||4.G<4.5.u);6(!4.Q&&(!4.5.B||4.5.B==\'A\')&&4.5.u!=7&&4.G>=4.5.u)n=4.O!=7&&!4.W}6(p==J||p==7){8 p=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'G\')||4.A>1);6(!4.Q&&(!4.5.B||4.5.B==\'G\')&&4.5.u!=7&&4.A==1)p=4.O!=7&&4.W}8 a=4;4.U[n?\'1u\':\'22\'](4.5.2m,4.2G)[n?\'1E\':\'V\'](4.K(\'C-17-1w\')).1J(\'1w\',n?F:1h);4.R[p?\'1u\':\'22\'](4.5.2k,4.2b)[p?\'1E\':\'V\'](4.K(\'C-11-1w\')).1J(\'1w\',p?F:1h);6(4.U.I>0&&(4.U[0].1g==J||4.U[0].1g!=n)&&4.5.1O!=7){4.U.1b(9(){a.5.1O(a,4,n)});4.U[0].1g=n}6(4.R.I>0&&(4.R[0].1g==J||4.R[0].1g!=p)&&4.5.1L!=7){4.R.1b(9(){a.5.1L(a,4,p)});4.R[0].1g=p}},1M:9(a){8 b=4.X==7?\'2a\':(4.X<4.A?\'17\':\'11\');4.12(\'2F\',a,b);6(4.X!==4.A){4.12(\'2B\',a,b,4.A);4.12(\'2z\',a,b,4.X)}6(4.13!==4.G){4.12(\'2x\',a,b,4.G);4.12(\'2v\',a,b,4.13)}4.12(\'2s\',a,b,4.A,4.G,4.X,4.13);4.12(\'2p\',a,b,4.X,4.13,4.A,4.G)},12:9(a,b,c,d,e,f,g){6(4.5[a]==J||(1R 4.5[a]!=\'2h\'&&b!=\'2i\'))z;8 h=1R 4.5[a]==\'2h\'?4.5[a][b]:4.5[a];6(!$.2W(h))z;8 j=4;6(d===J)h(j,c,b);10 6(e===J)4.L(d).1b(9(){h(j,4,d,c,b)});10{1r(8 i=d;i<=e;i++)6(i!==7&&!(i>=f&&i<=g))4.L(i).1b(9(){h(j,4,i,c,b)})}},1B:9(i){z 4.1I(\'<1F></1F>\',i)},1I:9(e,i){8 a=$(e).V(4.K(\'C-1a\')).V(4.K(\'C-1a-\'+i));a.1J(\'2V\',i);z a},K:9(c){z c+\' \'+c+(!4.5.Z?\'-2U\':\'-Z\')},S:9(e,d){8 a=e.2g!=J?e[0]:e;8 b=!4.5.Z?a.1x+r.Y(a,\'2f\')+r.Y(a,\'1l\'):a.2e+r.Y(a,\'2d\')+r.Y(a,\'1N\');6(d==J||b==d)z b;8 w=!4.5.Z?d-r.Y(a,\'2f\')-r.Y(a,\'1l\'):d-r.Y(a,\'2d\')-r.Y(a,\'1N\');$(a).y(4.N,w+\'T\');z 4.S(a)},1m:9(){z!4.5.Z?4.H[0].1x-r.M(4.H.y(\'2T\'))-r.M(4.H.y(\'2S\')):4.H[0].2e-r.M(4.H.y(\'2R\'))-r.M(4.H.y(\'3i\'))},2P:9(i,s){6(s==J)s=4.5.u;z 1k.2O((((i-1)/s)-1k.2N((i-1)/s))*s)+1}});r.16({3m:9(d){z $.16(q,d||{})},Y:9(e,p){6(!e)z 0;8 a=e.2g!=J?e[0]:e;6(p==\'1l\'&&$.2A.28){8 b={\'1y\':\'1A\',\'2M\':\'2L\',\'1H\':\'1q\'},1Y,1W;$.29(a,b,9(){1Y=a.1x});b[\'1l\']=0;$.29(a,b,9(){1W=a.1x});z 1W-1Y}z r.M($.y(a,p))},M:9(v){v=2K(v);z 2J(v)?0:v}})})(3v);', 62, 218, '||||this|options|if|null|var|function||||||||||||||||||||list|size||||css|return|first|wrap|jcarousel|container|lt|false|last|clip|length|undefined|className|get|intval|wh|tail|div|locked|buttonPrev|dimension|px|buttonNext|addClass|inTail|prevFirst|margin|vertical|else|prev|callback|prevLast|animating|visible|extend|next|circular|parent|item|each|scroll|timer|split|buttons|jcarouselstate|true|animate|initCallback|Math|marginRight|clipping|while|hasClass|break|auto|for|pos|setup|bind|fn|disabled|offsetWidth|display|before|block|create|stopAuto|placeholder|removeClass|li|reloadCallback|width|format|attr|animation|buttonPrevCallback|notify|marginBottom|buttonNextCallback|ceil|buttonPrevHTML|typeof|buttonNextHTML|scrollTail|funcResize|remove|oWidth2|after|oWidth|both|old|offset|unbind|top|left|start|height|window|safari|swap|init|funcPrev|easing|marginTop|offsetHeight|marginLeft|jquery|object|onAfterAnimation|startAuto|buttonPrevEvent|click|buttonNextEvent|ol|ul|itemVisibleOutCallback|reload|prepend|itemVisibleInCallback|nodeName|add|itemLastOutCallback|skin|itemLastInCallback|indexOf|itemFirstOutCallback|browser|itemFirstInCallback|empty|reset|resize|itemLoadCallback|funcNext|prototype|load|isNaN|parseInt|none|float|floor|round|index|swing|borderTopWidth|borderRightWidth|borderLeftWidth|horizontal|jcarouselindex|isFunction|normal|clearTimeout|1000|setTimeout|onBeforeAnimation|children|push|Aborting|loop|infinite|an|cause|will|This|items|set|No|jCarousel|alert|class|find|borderBottomWidth|append|html|string|defaults|OL|UL|new|has|unlock|lock|10px|0px|jQuery'.split('|'), 0, {}))

jQuery.fn.outer = function () {
    return $($('<div></div>').html(this.clone())).html();

}


