// Store the widgets in this code block
$.storeWidgets('547dc6e8|dfe9c83e|18f55887|1f42d7d2|a029b9cb|61875f15|d6b20e38|9ea9d7dc|dce3ea72|2cca1144|68170197|9c4edb33|8581a45b|a2bad5ef|46849228');

/**
 * @fileoverview The javascript that runs the common-button.jsp widget.
*/
if (typeof ButtonWidget == "undefined")
{
	/**
	 * @class Handles the execution for {@link com.fry.ocpsdk.widget.common.ButtonWidget}
	 *        objects within the DOM.
	 */
	var ButtonWidget = BaseWidget.extend({

		/**
		 * Initialize a DOM element to represent a ButtonWidget.  When a DOM element
		 * is made into a button, the element will be assigned an <tt>enabled</tt> method.
		 * This method is a quick way to either set, or access, the enabled state of the
		 * button.  Setting the enabled state to <tt>false</tt> will assign the <tt>disabled</tt>
		 * CSS class to the parent container.  You can apply this style via the descendent
		 * selector:
		 * <pre>
		 *    .someWidget .common-button #myButton { color: black; }
		 *    .someWidget .disabled .common-button #myButton { color: gray; }
		 * </pre>
		 * Working with the enabled method is as simple as:
		 * <pre>
		 *    $("#myButton").enabled(true);   // Sets the button to the enabled state
		 *    if ($("#myButton").enabled()) {
		 *       // The button is enabled, do something
		 *       ...
		 *    }
		 * </pre>
		 * A button will also be assigned a hover state where it's parent container will have
		 * the <tt>mouseover</tt> CSS class when the mouse is over the button.  The class will
		 * be absent when the mouse is <i>not over</i> the button.
		 * <p/>
		 *
		 * @param widget {String} The unique selector for a button, or a jQuery object representing
		 *                        the DOM element of the button.
		 * @param settings {Object} The widget state
		 */
		create: function(widget, settings) {
			var jQ = this.base(widget, settings);
			var s = jQ.widgetState();

			// Convert the click function string into a function
			var fn = s.clickFunction;
			if (fn) {
				jQ.widgetData({ clickFunction:
						eval("(function(){ var f=" + fn + "; return f;})()")
				});
				delete s.clickFunction;
			}

			jQ.click(function() {
					if (this.enabled())
					{
						var f = $(this).widgetData().clickFunction;
						if (f) {
							f();
						}
					}
				})
				.mousedown(function() {
					if (this.enabled()) {
						$(this).parent(".Button.widget-root").addClass("mousedown");
						if ($(this).parent(".Button.widget-root").hasClass("mouseover")) {
							this.mOver = true;
							$(this).parent(".Button.widget-root").removeClass("mouseover");
						}
					}
				})
				.mouseup(function() {
					$(this).parent(".Button.widget-root").removeClass("mousedown");
					if (this.mOver) {
						this.mOver = false;
						$(this).parent(".Button.widget-root").addClass("mouseover");
					}
				});

			jQ.widgetElement().enabled = function(state) {
				// Adds a function that either sets or gets the enabled state of the button object
				if (state != null)
				{
					if (state)
					{
						ButtonWidget.enable($(this));
					}
					else
					{
						ButtonWidget.disable($(this));
					}

					return true;
				}
				else
				{
					return ButtonWidget.isEnabled($(this));
				}
			};

			jQ.widgetElement().selected = function(state) {
				// Adds a function that either sets or gets the selected state of the button object
				if (state != null)
				{
					if (state)
					{
						ButtonWidget.select($(this));
					}
					else
					{
						ButtonWidget.unselect($(this));
					}

					return true;
				}
				else
				{
					return ButtonWidget.isSelected($(this));
				}
			};

			return jQ;
		},

		/**
		 * Determine if a button is enabled.
		 *
		 * @param selector {String} The CSS selector for the element
		 * @return {Boolean} <tt>true</tt> if the button is enabled
		 */
		isEnabled: function(selector) {
			return !$(selector).parent(".Button.widget-root").is(".disabled");
		},

		/**
		 * Set the button to the enabled state.  Removes the <tt>disabled</tt> CSS
		 * class from the parent container.
		 *
		 * @param selector {String} The CSS selector for the element
		 */
		enable: function(selector) {
			$(selector).parent(".Button.widget-root").removeClass("disabled");
		},

		/**
		 * Set the button to the disabled state.  Applies the <tt>disabled</tt> CSS
		 * class to the parent container.
		 *
		 * @param selector {String} The CSS selector for the element
		 */
		disable: function(selector) {
			$(selector).parent(".Button.widget-root").addClass("disabled").removeClass("mouseover").removeClass("mousedown");
		},

		/**
		 * Determine if a button is selected.
		 *
		 * @param selector {String} The CSS selector for the element
		 * @return {Boolean} <tt>true</tt> if the button is selected
		 */
		isSelected: function(selector) {
			return $(selector).parent(".Button.widget-root").is(".selected");
		},

		/**
		 * Set the button to the selected state.  Applies the <tt>selected</tt> CSS
		 * class to the parent container.
		 *
		 * @param selector {String} The CSS selector for the element
		 */
		select: function(selector) {
			$(selector).parent(".Button.widget-root").addClass("selected");
		},

		/**
		 * Set the button to the default state.  Removes the <tt>selected</tt> CSS
		 * class from the parent container.
		 *
		 * @param selector {String} The CSS selector for the element
		 */
		unselect: function(selector) {
			$(selector).parent(".Button.widget-root").removeClass("selected");
		}
		
	});
}

// Initialize all common buttons with hover
// states if they don't already have it
$(document).ready(function() {
	$(".common-button").each(function() {
		if (!$(this).get(0).hoverState)
		{
			$(this).hover(
				function() {
					if (!$(this).parent(".Button.widget-root").is(".disabled"))
					{
						$(this).parent(".Button.widget-root").addClass("mouseover");
					}
				},
				function() {
					$(this).parent(".Button.widget-root").removeClass("mouseover");
				}
			).get(0).hoverState = true;
		}
	});
});
;if (typeof ScrollerWidget == "undefined") {

	/**
	 * @class Handles the execution for {@link com.fry.ocpsdk.widget.common.container.ScrollerWidget}
	 *        objects within the DOM.
	 */
	var ScrollerWidget = BaseWidget.extend({

		/**
		 * Initialize a DOM element to represent a ScrollerWidget.  A simple scroller
		 * displays the contents within an area that can be scrolled left and right by
		 * a defined amount.
		 *
		 * @param selector {String} The unique selector for a simple scroller, or a jQuery object representing
		 *                        the DOM element of the simple scroller.
		 * @param settings {Object} Model parameters you want the simple scroller to retain, such as scroll amount.
		 */
		create: function(selector, settings) {
			var jQ = this.base(selector, settings);

			// If there were parts, remove them
			var s = jQ.widgetState();
			delete s.parts;

			var d = jQ.widgetData();
			if (s.beforeScroll) {
				// Convert to a function
				var fn = "var v = " + s.beforeScroll + "; return v(selector,cb);";
				d.beforeScroll = new Function("selector,cb", fn);
				delete s.beforeScroll;
			}

			if (s.afterScroll) {
				// Convert to a function
				var fn = "var v = " + s.afterScroll + "; return v(selector);";
				d.afterScroll = new Function("selector", fn);
				delete s.afterScroll;
			}

			// Set a class if the developer wants to show a different state when
			// the mouse is over the scroller
			var self = this;
			jQ.hover(function() {
				var p = self.findParts(jQ);
				if (p.bodyMax > p.areaMax) {
					$(".mouseState", this).addClass("mouseoverscroller");
				}
			}, function() {
				$(".mouseState", this).removeClass("mouseoverscroller");
			});

			// This check needs to be static for all scroller types, otherwise we get
			// multiple event handlers per widget type (Scroller, SnapToScroller, etc...)
			if(ScrollerWidget.initInterval) {
				clearTimeout(ScrollerWidget.initInterval);
			}
			ScrollerWidget.initInterval = setTimeout(function() {
				self.checkInitialButtonStates();
			}, 50);

			// We need a function we can call when scrolling is complete
			d.finishCallback = function() {
				arguments.callee.thisObj.finishScroll(arguments.callee.selector);
			};
			d.finishCallback.thisObj = this;
			d.finishCallback.selector = selector;

			return jQ;
		},

		/**
		 * Find the parts of a simple scroller to speed up execution.  The parts are:
		 * <table border='1'><tr><td><b>Part</b></td><td><b>Description</b></td></tr>
		 * <tr><td>area</td><td>The area DIV element where the items will be displayed</td></tr>
		 * <tr><td>body</td><td>The table element where the items will be displayed</td></tr>
		 * <tr><td>areaMax</td><td>The size (height or width) of the visible window over the items</td></tr>
		 * <tr><td>bodyMax</td><td>The size (height or width) of the entire collection of items</td></tr>
		 * <tr><td>prevButton</td><td>The button widget that moves to previous items</td></tr>
		 * <tr><td>nextButton</td><td>The button widget that moves to later items</td></tr>
		 * </table>
		 *
		 * @param selector {String} The CSS selector for the element
		 * @return {Object} An object that contains the different parts of a scroller
		 */
		findParts: function(selector) {
			var jQ = $(selector);
			var s = jQ.widgetState();

			if (s.parts == null)
			{
				s.parts = {};
				s.parts.area = $("div.area", jQ);
				s.parts.body = $("div.area table.body", jQ);
				s.parts.areaMax = s.direction == "horizontal" ? s.parts.area.width() : s.parts.area.height();
				s.parts.bodyMax = s.direction == "horizontal" ? s.parts.body.width() : s.parts.body.height();
				s.parts.prevButton = jQ.widgetChild(".scroller-layout .button-previous");
				s.parts.nextButton = jQ.widgetChild(".scroller-layout .button-next");
         }

			return s.parts;
		},

		/**
		 * Calculate the actual scroll to position based on the provided position.
		 * The widget will adjust the position by determining the available scroll area size,
		 * enable/disable buttons, and trigger events.
		 *
		 * @param selector {String} The CSS selector for the element
		 * @param position {Object} The position to scroll to.  Can be either a String with the
		 *                          unit defined (percent: "%" or pixels: "px"), or a Number.
		 * @return {Number} The amount to scroll the area by
		 */
		calcScroll: function(selector, position, animate) {
			var jQ = $(selector);
			var s = jQ.widgetState();
			var parts = this.findParts(selector);

			// If the position is already a number, this won't matter...
			var pixelPos = Number(position);

			if (typeof position == "string") {
				// Check the unit type
				if (position.indexOf("%") == position.length - 1) {
					// Calculate a position from the total area width
					pixelPos = Math.floor(parts.bodyMax * (Number(position.substring(0, position.length - 1)) / 100));
				} else if (position.indexOf("px") == position.length - 2) {
					// Just eliminate the "px" unit
					pixelPos = Number(position.substring(0, position.length - 2));
				} else {
					// Let 'em know we don't like what they gave us...
					throw new Error("You passed an invalid position value to Scroller.scrollTo for object " + jQ.attr("id"));
				}
			}

			// TODO: We should try to short circuit the long calculations when we're not using animation [BF : 08/12/2008]

			// Determine where the start is, and what the change will be
			var start = (s.direction == "horizontal" ?  parts.area.scrollLeft() : parts.area.scrollTop());
			var delta = pixelPos - start;
			var max = (delta <= 0 ? 0 : parts.areaMax);
			var maxMove = (delta <= 0 ? 0 : parts.bodyMax - parts.areaMax);

			// Determine if the move is possible
			if(start >= 0 && start <= parts.bodyMax) {
				// We may need to adjust the delta due to us not being able
				// to move an entire "scrollAmount"
				if (delta < 0 && start + delta < 0) {
					delta = -start;
				} else if (delta > 0 && start + delta > maxMove) {
					delta = maxMove - start;
				}

				// Find out if we're going to hit a stop
				var hitStop = (delta > 0 ? (start + delta >= maxMove) : (start + delta <= 0));

				// Enable and disable buttons
				if (hitStop && delta <= 0) {
					parts.prevButton.widgetElement().enabled(false);
					s.prevStop = true;
				} else if (hitStop && delta >= 0) {
					parts.nextButton.widgetElement().enabled(false);
					s.nextStop = true;
				}

				if (delta < 0) {
					parts.nextButton.widgetElement().enabled(true);
					s.nextStop = false;
				} else if (delta > 0) {
					parts.prevButton.widgetElement().enabled(true);
					s.prevStop = false;
				}

				// Final pixel position
				return (hitStop ? maxMove : start + delta);
			}

			return 0;
		},

		/**
		 * Scroll to a specified position, handling whether an animation should
		 * be used.
		 *
		 * @param selector {String} The CSS selector for the element
		 * @param position {Object} The position to scroll to.  Can be either a String with the
		 *                          unit defined (percent: "%" or pixels: "px"), or a Number.
		 * @param animate {Boolean} <tt>true</tt> to use animation (smooth scrolling) to move
		 *                          to the specified position.
		 */
		scrollTo: function(selector, position, animate) {
			var jQ = $(selector);
			if (jQ[0].inmotion) {
				return;
			}

			var s = jQ.widgetState();
			var parts = this.findParts(selector);
			var start = (s.direction == "horizontal" ? parts.area.scrollLeft() : parts.area.scrollTop());

			// Calculate the scroll amount
			var scrollPos = this.calcScroll(selector, position, animate);
			if (start == scrollPos) {
				// No scroll is occurring
				return;
			}

			// Do they want a callback executed?
			var d = jQ.widgetData();
			if (d.beforeScroll) {
				// We'll hand the callback a function that they need to call when their
				// interrupt completes.  If they don't call it -- well, it's not our fault
				var cb = function() {
					arguments.callee.thisObj.startScroll(arguments.callee.selector, arguments.callee.scrollPos, arguments.callee.animate);
				};
				cb.thisObj = this;
				cb.selector = selector;
				cb.scrollPos = scrollPos;
				cb.animate = animate;

				// Call their method...
				d.beforeScroll(selector, cb);
			} else {
				this.startScroll(selector, scrollPos, animate);
			}
		},

		/**
		 * Called before starting the scroll.  The <tt>scrollstart</tt> event will be triggered,
		 * passing along the position where scrolling will finish and a boolean value indicating
		 * if one of the borders has been hit.
		 *
		 * @param selector {String} The CSS selector for the element
		 * @param scrollPos {Number} The position to scroll to
		 * @param animate {Boolean} <tt>true</tt> to animate the scroll.  <tt>false</tt> to jump to
		 *                the new position.
		 */
		startScroll: function(selector, scrollPos, animate) {
			var jQ = $(selector);
			if (jQ[0].inmotion) {
				return;
			}

			var s = jQ.widgetState();
			var d = jQ.widgetData();
			var parts = this.findParts(selector);
			var start = (s.direction == "horizontal" ? parts.area.scrollLeft() : parts.area.scrollTop());

			var anim="scroll";
			anim += (s.direction == "horizontal" ? "Left" : "Top");

			var hitStop = this.isAtStop(jQ);

			// Trigger the starting event, we're moving
			jQ.widgetTrigger("scrollstart", [scrollPos, hitStop]);

			// We would also like to know which way we're going to scroll
			var eventName = scrollPos < start ? "scrollprevious" : "scrollnext";
			jQ.widgetTrigger(eventName, [scrollPos, hitStop]);

			// Add a class to mirror the scroll direction
			$(".mouseState", jQ).addClass(eventName);
			if (s.scrollEvent && s.scrollEvent != eventName) {
				$(".mouseState", jQ).removeClass(s.scrollEvent);
			}
			s.scrollEvent = eventName;

         // Show the overlay
         $(".area .overlay", jQ).css("display", "block");

         jQ[0].inmotion = true;

			// Do the deed...
			if (animate) {
				var parms = {};
				var self = this;
				parms[anim] = scrollPos;
				parts.area.animate(parms, s.scrollSpeed, null, function() {
					self.finishScroll(selector);
				});
			} else {
				var self = this;
				parts.area[0][anim] = scrollPos;
				jQ[0].inmotion = false;
				if (s.finishTimer) {
					window.clearTimeout(s.finishTimer);
				}

				s.finishTimer = window.setTimeout(d.finishCallback, 250);
			}
		},

		/**
		 * Called after a scroll has finished.  The <tt>scrollend</tt> event contains the
		 * page number that the scroll ended on.  The page may contain a fractional portion
		 * which represents how far into the page the scroll ended.
		 *
		 * @param selector {String} The CSS selector for the element
		 */
		finishScroll: function(selector) {
			var jQ = $(selector);
			var s = jQ.widgetState();
			var parts = this.findParts(selector);

			s.finishTimer = null;
			jQ[0].inmotion = false;

         // Hide the overlay
         $(".area .overlay", jQ).css("display", "none");

         // Which page are we on?
			var scroll = (s.direction == "horizontal" ? parts.area.scrollLeft() : parts.area.scrollTop());
			var page = Number(Number(scroll / s.scrollAmount).toFixed(1));
			jQ.widgetTrigger("scrollend", [page]);

			// Clear the event class
			if (s.scrollEvent) {
				$(".mouseState", jQ).removeClass(s.scrollEvent);
				delete s.scrollEvent;
			}

			// If they specified a callback, call it now...
			var d = jQ.widgetData();
			if (d.afterScroll) {
				d.afterScroll(selector);
			}
		},

		/**
		 * Returns <tt>true</tt> if the scroller is in motion.
		 * @return {Boolean} <tt>true</tt> if the scroller is currently in motion
		 */
		isInMotion: function(selector) {
			return $(selector)[0].inmotion;
		},

		/**
		 * Scroll the area to the right or down, depending on the configured direction of the scroller.
		 *
		 * @param selector {String} The CSS selector for the element
		 */
		scrollNext: function(selector) {
			var jQ = $(selector);
			var s = jQ.widgetState();
			var parts = this.findParts(jQ);
			var amt = (s.direction == "horizontal" ? parts.area.scrollLeft() + s.scrollAmount : parts.area.scrollTop() + s.scrollAmount);
			this.scrollTo(selector, amt, s.animateScroll);
		},

		/**
		 * Scroll the area to the left or up, depending on the configured direction of the scroller.
		 *
		 * @param selector {String} The CSS selector for the element
		 */
		scrollPrevious: function(selector) {
			var jQ = $(selector);
			var s = jQ.widgetState();
			var parts = this.findParts(jQ);
			var amt = (s.direction == "horizontal" ? parts.area.scrollLeft() - s.scrollAmount : parts.area.scrollTop() - s.scrollAmount);
			this.scrollTo(selector, amt, s.animateScroll);
		},

		/**
		 * Scroll to a logical page by number.  The position is determined using the
		 * scroll amount set during creation of the widget.
		 *
		 * @param selector {String} The CSS selector for the element
		 * @param pageNumber {Number} Logical page number within the defined range of pages for the scroller
		 * @param animate {Boolean} <tt>true</tt> to animate the scroll to the position
		 */
		scrollToPage: function(selector, pageNumber, animate) {
			var jQ = $(selector);
			var s = jQ.widgetState();
			var pos = pageNumber * parseInt(s.scrollAmount);
			this.scrollTo(selector, pos, animate);
		},

		/**
		 * Returns <tt>true</tt> if the scroller is at either stop, or will arrive at one
		 * if it is in motion.
		 * @return {Boolean} <tt>true</tt> if the scroller is at either the beginning or end.
		 */
		isAtStop: function(selector) {
			var s = $(selector).widgetState();
			return (s.nextStop || s.prevStop);
		},

		/**
		 * Returns <tt>true</tt> if the scroller can move to no more previous pages.
		 * @return {Boolean} <tt>true</tt> if the scroller cannot move to the left, or up
		 */
		isPrevStop: function(selector) {
			var s = $(selector).widgetState();
			return s.prevStop;
		},

		/**
		 * Returns <tt>true</tt> if the scroller can move to no more next pages.
		 * @return {Boolean} <tt>true</tt> if the scroller cannot move to the right, or down
		 */
		isNextStop: function(selector) {
			var s = $(selector).widgetState();
			return s.nextStop;
		},

		/**
		 * Executed during initial initialization to set the buttons accordingly.
		 * @private
		 */
		checkInitialButtonStates: function() {
         // This would be slightly cleaner if we used the Scroller.findParts() method here as well,
			// but this method needs to be optimized completely for speed...
			$(".Scroller").each(function() {
				var jQ = $(this);
				var s = jQ.widgetState();

				// Set up the stops
				s.prevStop = true;
				s.nextStop = true;

				var jq = jQ.find("div.area");
				var bodyTable = jq.find("table.body");
				var areaMax = parseInt(jq.css(s.direction == "horizontal" ? "width" : "height").replace("px"));
				var bodyMax = s.direction == "horizontal" ? bodyTable.width() : bodyTable.height();

            $(".overlay", jq).width(bodyMax);

            if (bodyMax - 1 > areaMax) {
					$(this).find(".scroller-layout .button-next").widgetElement().enabled(true);
					s.nextStop = false;

					if (s.linkSlider) {
						// Link the slider to the scroller
                  SliderWidget.create("#" + s.linkSlider, { maxValue: bodyMax - areaMax, pageWidth: areaMax });
					}
				} else {
					if (s.linkSlider) {
						// Hide the slider if no need to scroll
						//$(".thumb", "#" + s.linkSlider).css("display", "none");
                  $("#" + s.linkSlider).css("display", "none");
					}

					$(this).find(".scroller-layout .scroll-button").css("display", "none");
				}
			});
			clearTimeout(this.initInterval);
			this.initInterval = null;
		}

	});
}
;if (typeof SnapToScrollerWidget == "undefined") {

	/**
	 * @class Handles the execution for {@link com.fry.ocpsdk.widget.common.container.ScrollerWidget}
	 *        objects within the DOM.
	 */
	var SnapToScrollerWidget = ScrollerWidget.extend({

      findParts: function(selector) {
         var jQ = $(selector);
         var s = jQ.widgetState();

         if (s.parts == null)
         {
            parts = this.base(selector);
            parts.areaMax = (Math.round(parts.areaMax / s.unitSize) * s.unitSize);
         }
         return s.parts;
      },

      /**
		 * Calculate the actual scroll to position based on the provided position.
		 * The widget will adjust the position by determining the available scroll area size,
		 * enable/disable buttons, and trigger events.
		 *
		 * @param selector {String} The CSS selector for the element
		 * @param position {Object} The position to scroll to.  Can be either a String with the
		 *                          unit defined (percent: "%" or pixels: "px"), or a Number.
		 * @return {Number} The amount to scroll the area by
		 */
		calcScroll: function(selector, position, animate) {
			var jQ = $(selector);
			var s = jQ.widgetState();
			var parts = this.findParts(selector);

			var actualPos = this.base(selector, position);
			if (animate) {
				var stepSize = (s.unitSize != null ? Number(s.unitSize) : Number(s.scrollAmount));
				actualPos = Math.round(actualPos / stepSize) * stepSize;
			}
			return actualPos;
		},

      /**
       * We can more efficiently calculate the scroller window size due to having
       * the unit size available.
       * @private
       */
      checkInitialButtonStates: function() {
         $(".Scroller").each(function() {
            var jQ = $(this);
            var s = jQ.widgetState();

            // Set up the stops
            s.prevStop = true;
            s.nextStop = true;

            var jq = $("div.area", jQ);
            var bodyTable = $("table.body", jq);
            var areaMax = parseInt(jq.css(s.direction == "horizontal" ? "width" : "height").replace("px"));
            areaMax = (Math.round(areaMax / s.unitSize) * s.unitSize);
            var bodyMax = s.direction == "horizontal" ? bodyTable.width() : bodyTable.height();

            $(".overlay", jq).width(bodyMax);

            if (bodyMax > areaMax) {
               $(this).find(".scroller-layout .button-next").widgetElement().enabled(true);
               s.nextStop = false;

               if (s.linkSlider) {
                  // Link the slider to the scroller
                  SliderWidget.create("#" + s.linkSlider, { maxValue: bodyMax - areaMax, pageWidth: areaMax });
               }
            } else {
               if (s.linkSlider) {
                  // Hide the slider if no need to scroll
                  //$(".thumb", "#" + s.linkSlider).css("display", "none");
                  $("#" + s.linkSlider).css("display", "none");
               }

               $(this).find(".scroller-layout .scroll-button").css("display", "none");
            }
         });
         clearTimeout(ScrollerWidget.initInterval);
         ScrollerWidget.initInterval = null;
      }
		
	});
}
;

		if (typeof PagedDataSetFilmstripLoaderWidget == "undefined") {

			/**
			 * @class Controls the com.fry.ocpsdk.widget.browsers.PagedDataSetFilmstripLoaderWidget
			 *        display which has a scrolling filmstrip per category.
			 *
			 * @author Brett Fattori (bfattori@fry.com)
			 */
			var PagedDataSetFilmstripLoaderWidget = BaseWidget.extend({

				/**
				 * Create an instance of a PagedDataSetFilmstripLoaderWidget by linking a
				 * DOM element to the class via its jQuery selector.
				 *
				 * @param selector {String} A jQuery selector for the widget root
				 * @param settings {Object} Any settings you wish to persist in the widget as its state
				 */
				create: function(selector, settings) {
					var jQ = this.base(selector, settings);
					var s = jQ.widgetState();

					if (jQ.elementData().entityCount == 0) {
                  jQ.hide();
                  return jQ;
               }

					// Read the total entity count off the filmstrip
					var data = jQ.elementData();
					s.totalEntityCount = data.entityCount;
					s.totalPages = Math.floor(s.totalEntityCount / s.pageSize);

					// Remember which pages are loaded
					s.loadedItems = $.fillArr((s.totalEntityCount), false);
					var x = s.pages * s.pageSize;
					while (x-- > 0) {
						s.loadedItems[x] = true;
					}

					s.currentPage = 0;

					// Fill in the widget with empty table cells
					var cT, sel, ev;

					// We'll let them specify an entity viewer to display when the entity
					// isn't yet loaded.
					if (s.emptyItemViewer) {
					   ev = "<div class='entity-viewer'>" + s.emptyItemViewer + "</div>";
					} else {
						ev = "<div class='entity-viewer'><!-- --></div>";
					}

					if (s.direction == "horizontal") {
						cT = ".filmstrip-table TR";
						sel = "<td class='item empty col cell'>" + ev + "</td>";
					} else {
						cT = ".filmstrip-table";
						sel = "<tr class='item empty row'><td class='cell'>" + ev + "</td></tr>";
					}

               var loadedEntities = s.totalEntityCount - (s.pageSize * s.pages);
					var t = $(cT, jQ);
					while (loadedEntities-- > 0) {
						t.append($(sel));
					}

					return jQ;
				},

				/**
				 * Returns the count of entities that will be displayed by this widget.
				 *
				 * @param selector {String} A jQuery selector for the widget root
				 * @return {Number} The number of entities to be displayed
				 */
				getEntityCount: function(selector) {
					return $(selector).elementData().entityCount;
				},

				/**
				 * Clamp the range of items to return based on the page number requested and
				 * the min and max range around that page.  Min and max are specified as items
				 * before and after, respectively.  The min and max will be adjusted to the
				 * nearest min and max item number based on what is already loaded.
				 *
				 * @param selector {String} A jQuery selector for the widget root
				 * @param pageNumber {Number} The page, within the range, to start with
				 * @param min {Number} The items before the page number, or the number of
				 *                     initial items loaded divided in half.
				 * @param max {Number} The items after the page number, or the number of
				 *                     initial items loaded divided in half.
				 * @return An array with two elements specifying the actual min and max range.
				 * @return {Array} An array of two elements: the min and max index
				 */
				clampRange: function(selector, pageNumber, min, max) {
					var jQ = $(selector);
					var s = jQ.widgetState();

					// Determine the buffer size to load
					var itemNum = pageNumber * s.pageSize;
					var buf = Math.floor((s.pages * s.pageSize) / 2) + 1;
					var minP = min || itemNum - buf;
					var maxP = max || itemNum + buf;

					// Normalize
					minP = minP < 0 ? 0 : minP;
					maxP = maxP > s.totalEntityCount ? s.totalEntityCount : maxP;

					// Determine which items before and after the page are loaded and
					// set a min/max to load around our current page
					while (s.loadedItems[minP] && minP < maxP) {
						minP++;
					}
					while (s.loadedItems[max] && maxP > minP) {
						maxP--;
					}

					// Return the array sorted numerically in case we get a wierd situation
					return [minP, maxP].sort(function(a,b) {
						return a - b;
					});
				},

				/**
				 * Called when navigating to the previous page, will determine items
				 * that need to be loaded to fill in the set.
				 *
				 * @param selector {String} A jQuery selector for the widget root
				 */
				previousPage: function(selector) {
					var jQ = $(selector);
					var s = jQ.widgetState();
					s.currentPage--;

					// Are there more pages to go?
					if (s.currentPage - s.loadThreshold > 0) {
						// Are the pages beyond at threshold not currently loaded?
						if (!s.loadedPages[s.currentPage - s.loadThreshold]) {
							// Load up the previous pages
							this.loadItems(selector, s.currentPage - s.loadThreshold, 0, s.pages);
						}
					}
				},

				/**
				 * Called when navigating to the next page, will determine items
				 * that need to be loaded to fill in the set.
				 *
				 * @param selector {String} A jQuery selector for the widget root
				 */
				nextPage: function(selector) {
					var jQ = $(selector);
					var s = jQ.widgetState();
					s.currentPage++;

					// Are there more pages to go?
					if (s.currentPage + s.loadThreshold < s.totalPages) {
						// Are the pages beyond at threshold not currently loaded?
						if (!s.loadedPages[s.currentPage + s.loadThreshold]) {
							// Load up the next pages
							this.loadItems(selector, s.currentPage + s.loadThreshold, s.pages, 0);
						}
					}
				},

				/**
				 * Set the page that should be scrolled to. The method will
				 * determine the items that need to be loaded to fill in the set.
				 *
				 * @param selector {String} A jQuery selector for the widget root
				 * @param pageNumber {Number} The page number to jump to
				 */
				setPage: function(selector, pageNumber) {
					var jQ = $(selector);
					var s = jQ.widgetState();

					if (pageNumber > 0 && pageNumber < s.totalPages) {
						// Do the scroll
						ScrollerWidget.scrollToPage($(".Scroller", jQ), pageNumber, true);
						this.loadPage(selector, pageNumber);
					}
				},

				/**
				 * Load the designated page and surrounding pages.  Using the starting count of
				 * pages, divided by two and adding one, that many pages will be loaded to each
				 * side of the designated page.  So, if you specified four pages to intially
				 * load, 3 pages to each side of the specified page will be loaded (if they
				 * aren't already loaded).
				 *
				 * @param selector {String} A jQuery selector for the widget root
				 * @param pageNumber {Number} The page number load around
				 */
				loadPage: function(selector, pageNumber) {
					var jQ = $(selector);
					var s = jQ.widgetState();

					// Load up the pages surrounding the specified page
					s.currentPage = Number(pageNumber);
					this.loadItems(selector, s.currentPage);
				},

				/**
				 * Load a set of items, as determined by the starting page and the number of
				 * pages after the starting page.  Optionally the starting page can be modified
				 * by specifying the pages to load before the starting page.  After the items
				 * have been loaded, the <tt>itemsLoaded</tt> event will be triggered, passing
				 * the set of elements that were loaded from the server.
				 *
				 * @param selector {String} A jQuery selector for the widget root
				 * @param startPage {Number} The page at which to start loading items
				 * @param pagesAfter {Number} The number of pages to load beyond the starting page
				 * @param [pagesBefore=0] {Number} The number of pages to load before the starting page
				 */
				loadItems: function(selector, startPage) {
					var jQ = $(selector);
					var s = jQ.widgetState();

					// Clamp the range
					var clamp = this.clampRange(selector, startPage);

					// Are we already loaded?
					if (s.loadedItems[clamp[0]] && s.loadedItems[clamp[1]]) {
						return;
					}

					// Mark the items as loaded
					for (var p = clamp[0]; p < clamp[1]; p++) {
						s.loadedItems[p] = true;
					}

					// Do the load
					var startIndex = clamp[0];
					var endIndex = clamp[1];
					endIndex = endIndex > startIndex ? endIndex : startIndex;

					var d, type, marker;
					if (s.direction == "horizontal") {
						d = $("<tr>");
						type = "TD.item";
						marker = "TD";
					} else {
						d = $("<table>");
						type = "TR.item";
						marker = "TR";
					}

					d.widgetAjax(jQ, "com.fry.ocpsdk.widget.browsers.PagedDataSetFilmstripWidget", type, "dataModel",
							{
								"startIndex": startIndex,
								"endIndex": endIndex
							},
							function() {

								var fn = function() {
									var aC = arguments.callee;
									if (aC.scroller.inmotion) {
										window.setTimeout(aC, 100);
										return;
									}

									/* Remove empty cells from the table row */
									$(".filmstrip-table " + aC.type + ":in(" + aC.startIndex + "-" + aC.endIndex + ")", aC.jQ).remove();

									/* Insert new cells into the table */
									var itemCount = $(aC.marker, aC.thisObj).length;
									$(".filmstrip-table " + aC.type + ":eq(" + (aC.startIndex - 1) + ")", aC.jQ).after($(aC.marker, aC.thisObj));

									/* Get our new items */
									var newItems = $(".filmstrip-table " + aC.type + ":in(" + aC.startIndex + "-" + aC.endIndex + ")", aC.jQ);

									/* Maybe this should be lower level? */
									$.initElementData(newItems);
									$.initWidgets(newItems);

									/* Trigger an event, passing the insert index and number of items */
									aC.jQ.widgetTrigger("itemsloaded", [(aC.startIndex - 1), itemCount, newItems]);
								};
								fn.scroller = $(".Scroller", jQ)[0];
								fn.thisObj = this;
								fn.marker = marker;
								fn.type = type;
								fn.startIndex = startIndex;
								fn.endIndex = endIndex;
								fn.jQ = jQ;

								window.setTimeout(fn, 100);
							}
					);

				}

			});
		}

	eval(function(p,a,c,k,e,d){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--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[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}('(3(C){C.a={1L:{P:3(E,F,H){6 G=C.a[E].i;17(6 D 1M H){G.q[D]=G.q[D]||[];G.q[D].1N([F,H[D]])}},1l:3(D,F,E){6 H=D.q[F];5(!H){4}17(6 G=0;G<H.1m;G++){5(D.8[H[G][0]]){H[G][1].w(D.b,E)}}}},o:{},c:3(D){5(C.a.o[D]){4 C.a.o[D]}6 E=C(\'<1O 1K="a-1J">\').1g(D).c({1F:"1G",X:"-1o",1H:"-1o",1I:"1P"}).1E("1d");C.a.o[D]=!!((!(/1X|1Y/).h(E.c("1Z"))||(/^[1-9]/).h(E.c("1W"))||(/^[1-9]/).h(E.c("1V"))||!(/1u/).h(E.c("1R"))||!(/1S|1T\\(0, 0, 0, 0\\)/).h(E.c("1U"))));20{C("1d").19(0).1D(E.19(0))}1y(F){}4 C.a.o[D]},1z:3(D){C(D).p("l","14").c("1k","1u")},1A:3(D){C(D).p("l","1C").c("1k","")},1x:3(G,E){6 D=/X/.h(E||"X")?"1B":"1w",F=7;5(G[D]>0){4 f}G[D]=1;F=G[D]>0?f:7;G[D]=0;4 F}};6 B=C.Q.u;C.Q.u=3(){C("*",2).P(2).1Q("u");4 B.w(2,1t)};3 A(E,F,G){6 D=C[E][F].2q||[];D=(N D=="O"?D.x(/,?\\s+/):D);4(C.2l(G,D)!=-1)}C.n=3(E,D){6 F=E.x(".")[0];E=E.x(".")[1];C.Q[E]=3(J){6 H=(N J=="O"),I=2n.i.2m.1l(1t,1);5(H&&A(F,E,J)){6 G=C.M(2[0],E);4(G?G[J].w(G,I):2j)}4 2.2k(3(){6 K=C.M(2,E);5(H&&K&&C.2o(K[J])){K[J].w(K,I)}2p{5(!H){C.M(2,E,2r C[F][E](2,J))}}})};C[F][E]=3(I,H){6 G=2;2.e=E;2.1f=F+"-"+E;2.8=C.1c({},C.n.r,C[F][E].r,H);2.b=C(I).g("m."+E,3(L,J,K){4 G.m(J,K)}).g("z."+E,3(K,J){4 G.z(J)}).g("u",3(){4 G.1a()});2.1b()};C[F][E].i=C.1c({},C.n.i,D)};C.n.i={1b:3(){},1a:3(){2.b.2h(2.e)},z:3(D){4 2.8[D]},m:3(D,E){2.8[D]=E;5(D=="j"){2.b[E?"1g":"27"](2.1f+"-j")}},28:3(){2.m("j",7)},21:3(){2.m("j",f)}};C.n.r={j:7};C.a.13={2i:3(){6 D=2;2.b.g("25."+2.e,3(E){4 D.1s(E)});5(C.y.R){2.1j=2.b.p("l");2.b.p("l","14")}2.22=7},23:3(){2.b.10("."+2.e);(C.y.R&&2.b.p("l",2.1j))},1s:3(F){(2.d&&2.k(F));2.t=F;6 E=2,G=(F.24==1),D=(N 2.8.V=="O"?C(F.1p).29().P(F.1p).2a(2.8.V).1m:7);5(!G||D||!2.16(F)){4 f}2.v=!2.8.W;5(!2.v){2.2f=2g(3(){E.v=f},2.8.W)}5(2.Y(F)&&2.S(F)){2.d=(2.Z(F)!==7);5(!2.d){F.2e();4 f}}2.11=3(H){4 E.1n(H)};2.12=3(H){4 E.k(H)};C(1e).g("1r."+2.e,2.11).g("1h."+2.e,2.12);4 7},1n:3(D){5(C.y.R&&!D.2d){4 2.k(D)}5(2.d){2.U(D);4 7}5(2.Y(D)&&2.S(D)){2.d=(2.Z(2.t,D)!==7);(2.d?2.U(D):2.k(D))}4!2.d},k:3(D){C(1e).10("1r."+2.e,2.11).10("1h."+2.e,2.12);5(2.d){2.d=7;2.1i(D)}4 7},Y:3(D){4(T.2b(T.1q(2.t.15-D.15),T.1q(2.t.1v-D.1v))>=2.8.18)},S:3(D){4 2.v},Z:3(D){},U:3(D){},1i:3(D){},16:3(D){4 f}};C.a.13.r={V:2c,18:1,W:0}})(26);',62,152,'||this|function|return|if|var|false|options||ui|element|css|_mouseStarted|widgetName|true|bind|test|prototype|disabled|mouseUp|unselectable|setData|widget|cssCache|attr|plugins|defaults||_mouseDownEvent|remove|_mouseDelayMet|apply|split|browser|getData|||||||||||||data|typeof|string|add|fn|msie|mouseDelayMet|Math|mouseDrag|cancel|delay|top|mouseDistanceMet|mouseStart|unbind|_mouseMoveDelegate|_mouseUpDelegate|mouse|on|pageX|mouseCapture|for|distance|get|destroy|init|extend|body|document|widgetBaseClass|addClass|mouseup|mouseStop|_mouseUnselectable|MozUserSelect|call|length|mouseMove|5000px|target|abs|mousemove|mouseDown|arguments|none|pageY|scrollLeft|hasScroll|catch|disableSelection|enableSelection|scrollTop|off|removeChild|appendTo|position|absolute|left|display|gen|class|plugin|in|push|div|block|triggerHandler|backgroundImage|transparent|rgba|backgroundColor|width|height|auto|default|cursor|try|disable|started|mouseDestroy|which|mousedown|jQuery|removeClass|enable|parents|filter|max|null|button|preventDefault|_mouseDelayTimer|setTimeout|removeData|mouseInit|undefined|each|inArray|slice|Array|isFunction|else|getter|new'.split('|'),0,{}));
;eval(function(p,a,c,k,e,d){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--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[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}('(c(A){A.2I("g.i",A.2c({},A.g.2L,{2G:c(){a B=4.9;7(B.d=="24"&&!(/(l|V|13)/).1h(4.j.e("m"))){4.j.e("m","l")}4.j.1M("g-i");(B.1O&&4.j.1M("g-i-1O"));4.2M()},2n:c(F){a H=4.9;7(4.d||H.1O||A(F.2a).2A(".g-2F-1G")){n 15}a C=!4.9.1G||!A(4.9.1G,4.j).1C?v:15;A(4.9.1G,4.j).2C("*").2E().1d(c(){7(4==F.2a){C=v}});7(!C){n 15}7(A.g.1b){A.g.1b.2Z=4}4.d=A.2P(H.d)?A(H.d.30(4.j[0],[F])):(H.d=="28"?4.j.28():4.j);7(!4.d.31("12").1C){4.d.1u((H.1u=="k"?4.j[0].1t:H.1u))}7(4.d[0]!=4.j[0]&&!(/(13|V)/).1h(4.d.e("m"))){4.d.e("m","V")}4.S={6:(o(4.j.e("33"),10)||0),5:(o(4.j.e("2S"),10)||0)};4.z=4.d.e("m");4.8=4.j.8();4.8={5:4.8.5-4.S.5,6:4.8.6-4.S.6};4.8.r={6:F.1r-4.8.6,5:F.1s-4.8.5};4.p=4.d.p();a B=4.p.8();7(4.p[0]==f.12&&A.2V.2Y){B={5:0,6:0}}4.8.k={5:B.5+(o(4.p.e("1N"),10)||0),6:B.6+(o(4.p.e("1T"),10)||0)};a E=4.j.m();4.8.l=4.z=="l"?{5:E.5-(o(4.d.e("5"),10)||0)+4.p[0].q,6:E.6-(o(4.d.e("6"),10)||0)+4.p[0].s}:{5:0,6:0};4.1g=4.1S(F);4.w={t:4.d.26(),u:4.d.1Q()};7(H.16){7(H.16.6!=1A){4.8.r.6=H.16.6+4.S.6}7(H.16.2s!=1A){4.8.r.6=4.w.t-H.16.2s+4.S.6}7(H.16.5!=1A){4.8.r.5=H.16.5+4.S.5}7(H.16.2k!=1A){4.8.r.5=4.w.u-H.16.2k+4.S.5}}7(H.h){7(H.h=="k"){H.h=4.d[0].1t}7(H.h=="f"||H.h=="1o"){4.h=[0-4.8.l.6-4.8.k.6,0-4.8.l.5-4.8.k.5,A(H.h=="f"?f:1o).t()-4.8.l.6-4.8.k.6-4.w.t-4.S.6-(o(4.j.e("2i"),10)||0),(A(H.h=="f"?f:1o).u()||f.12.1t.2u)-4.8.l.5-4.8.k.5-4.w.u-4.S.5-(o(4.j.e("2h"),10)||0)]}7(!(/^(f|1o|k)$/).1h(H.h)){a D=A(H.h)[0];a G=A(H.h).8();4.h=[G.6+(o(A(D).e("1T"),10)||0)-4.8.l.6-4.8.k.6,G.5+(o(A(D).e("1N"),10)||0)-4.8.l.5-4.8.k.5,G.6+T.2g(D.2U,D.1U)-(o(A(D).e("1T"),10)||0)-4.8.l.6-4.8.k.6-4.w.t-4.S.6-(o(4.j.e("2i"),10)||0),G.5+T.2g(D.2u,D.1V)-(o(A(D).e("1N"),10)||0)-4.8.l.5-4.8.k.5-4.w.u-4.S.5-(o(4.j.e("2h"),10)||0)]}}4.19("18",F);4.w={t:4.d.26(),u:4.d.1Q()};7(A.g.1b&&!H.2m){A.g.1b.2Q(4,F)}4.d.1M("g-i-2p");4.2d(F);n v},X:c(C,D){7(!D){D=4.m}a B=C=="V"?1:-1;n{5:(D.5+4.8.l.5*B+4.8.k.5*B-(4.z=="13"||(4.z=="V"&&4.p[0]==f.12)?0:4.p[0].q)*B+(4.z=="13"?A(f).q():0)*B+4.S.5*B),6:(D.6+4.8.l.6*B+4.8.k.6*B-(4.z=="13"||(4.z=="V"&&4.p[0]==f.12)?0:4.p[0].s)*B+(4.z=="13"?A(f).s():0)*B+4.S.6*B)}},1S:c(E){a F=4.9;a B={5:(E.1s-4.8.r.5-4.8.l.5-4.8.k.5+(4.z=="13"||(4.z=="V"&&4.p[0]==f.12)?0:4.p[0].q)-(4.z=="13"?A(f).q():0)),6:(E.1r-4.8.r.6-4.8.l.6-4.8.k.6+(4.z=="13"||(4.z=="V"&&4.p[0]==f.12)?0:4.p[0].s)-(4.z=="13"?A(f).s():0))};7(!4.1g){n B}7(4.h){7(B.6<4.h[0]){B.6=4.h[0]}7(B.5<4.h[1]){B.5=4.h[1]}7(B.6>4.h[2]){B.6=4.h[2]}7(B.5>4.h[3]){B.5=4.h[3]}}7(F.1a){a D=4.1g.5+T.2l((B.5-4.1g.5)/F.1a[1])*F.1a[1];B.5=4.h?(!(D<4.h[1]||D>4.h[3])?D:(!(D<4.h[1])?D-F.1a[1]:D+F.1a[1])):D;a C=4.1g.6+T.2l((B.6-4.1g.6)/F.1a[0])*F.1a[0];B.6=4.h?(!(C<4.h[0]||C>4.h[2])?C:(!(C<4.h[0])?C-F.1a[0]:C+F.1a[0])):C}n B},2d:c(B){4.m=4.1S(B);4.1j=4.X("V");4.m=4.19("1c",B)||4.m;7(!4.9.1w||4.9.1w!="y"){4.d[0].1x.6=4.m.6+"1J"}7(!4.9.1w||4.9.1w!="x"){4.d[0].1x.5=4.m.5+"1J"}7(A.g.1b){A.g.1b.1c(4,B)}n 15},2b:c(C){a D=15;7(A.g.1b&&!4.9.2m){a D=A.g.1b.34(4,C)}7((4.9.1m=="2N"&&!D)||(4.9.1m=="2D"&&D)||4.9.1m===v){a B=4;A(4.d).2B(4.1g,o(4.9.1m,10)||2O,c(){B.19("1k",C);B.22()})}1y{4.19("1k",C);4.22()}n 15},22:c(){4.d.2o("g-i-2p");7(4.9.d!="24"&&!4.1z){4.d.2e()}4.d=2K;4.1z=15},2H:{},23:c(B){n{d:4.d,m:4.m,1P:4.1j,9:4.9}},19:c(C,B){A.g.17.2t(4,C,[B,4.23()]);7(C=="1c"){4.1j=4.X("V")}n 4.j.2z(C=="1c"?C:"1c"+C,[B,4.23()],4.9[C])},2T:c(){7(!4.j.U("i")){n}4.j.3d("i").3x(".i").2o("g-i");4.35()}}));A.2c(A.g.i,{3l:{1u:"k",1w:15,3r:":3p",3q:0,3n:1,d:"24"}});A.g.17.1e("i","1p",{18:c(D,C){a B=A("12");7(B.e("1p")){C.9.21=B.e("1p")}B.e("1p",C.9.1p)},1k:c(C,B){7(B.9.21){A("12").e("1p",B.9.21)}}});A.g.17.1e("i","Z",{18:c(D,C){a B=A(C.d);7(B.e("Z")){C.9.1W=B.e("Z")}B.e("Z",C.9.Z)},1k:c(C,B){7(B.9.1W){A(B.d).e("Z",B.9.1W)}}});A.g.17.1e("i","1l",{18:c(D,C){a B=A(C.d);7(B.e("1l")){C.9.1X=B.e("1l")}B.e("1l",C.9.1l)},1k:c(C,B){7(B.9.1X){A(B.d).e("1l",B.9.1X)}}});A.g.17.1e("i","1K",{18:c(C,B){A(B.9.1K===v?"3v":B.9.1K).1d(c(){A(\'<1Y 3y="g-i-1K" 1x="3t: #3u;"></1Y>\').e({t:4.1U+"1J",u:4.1V+"1J",m:"V",1l:"0.3a",Z:3k}).e(A(4).8()).1u("12")})},1k:c(C,B){A("1Y.37").1d(c(){4.1t.3c(4)})}});A.g.17.1e("i","1v",{18:c(D,C){a E=C.9;a B=A(4).U("i");E.14=E.14||20;E.11=E.11||20;B.W=c(F){2f{7(/1D|1v/.1h(F.e("1L"))||(/1D|1v/).1h(F.e("1L-y"))){n F}F=F.k()}2j(F[0].1t);n A(f)}(4);B.Y=c(F){2f{7(/1D|1v/.1h(F.e("1L"))||(/1D|1v/).1h(F.e("1L-x"))){n F}F=F.k()}2j(F[0].1t);n A(f)}(4);7(B.W[0]!=f&&B.W[0].1F!="1E"){B.1Z=B.W.8()}7(B.Y[0]!=f&&B.Y[0].1F!="1E"){B.25=B.Y.8()}},1c:c(D,C){a E=C.9;a B=A(4).U("i");7(B.W[0]!=f&&B.W[0].1F!="1E"){7((B.1Z.5+B.W[0].1V)-D.1s<E.14){B.W[0].q=B.W[0].q+E.11}7(D.1s-B.1Z.5<E.14){B.W[0].q=B.W[0].q-E.11}}1y{7(D.1s-A(f).q()<E.14){A(f).q(A(f).q()-E.11)}7(A(1o).u()-(D.1s-A(f).q())<E.14){A(f).q(A(f).q()+E.11)}}7(B.Y[0]!=f&&B.Y[0].1F!="1E"){7((B.25.6+B.Y[0].1U)-D.1r<E.14){B.Y[0].s=B.Y[0].s+E.11}7(D.1r-B.25.6<E.14){B.Y[0].s=B.Y[0].s-E.11}}1y{7(D.1r-A(f).s()<E.14){A(f).s(A(f).s()-E.11)}7(A(1o).t()-(D.1r-A(f).s())<E.14){A(f).s(A(f).s()+E.11)}}}});A.g.17.1e("i","1R",{18:c(D,C){a B=A(4).U("i");B.1i=[];A(C.9.1R===v?".g-i":C.9.1R).1d(c(){a F=A(4);a E=F.8();7(4!=B.j[0]){B.1i.2x({2q:4,t:F.26(),u:F.1Q(),5:E.5,6:E.6})}})},1c:c(J,N){a I=A(4).U("i");a L=N.9.3j||20;a D=N.1P.6,C=D+I.w.t,P=N.1P.5,O=P+I.w.u;3s(a H=I.1i.1C-1;H>=0;H--){a E=I.1i[H].6,B=E+I.1i[H].t,R=I.1i[H].5,M=R+I.1i[H].u;7(!((E-L<D&&D<B+L&&R-L<P&&P<M+L)||(E-L<D&&D<B+L&&R-L<O&&O<M+L)||(E-L<C&&C<B+L&&R-L<P&&P<M+L)||(E-L<C&&C<B+L&&R-L<O&&O<M+L))){3w}7(N.9.2w!="3b"){a K=T.1f(R-O)<=20;a Q=T.1f(M-P)<=20;a G=T.1f(E-C)<=20;a F=T.1f(B-D)<=20;7(K){N.m.5=I.X("l",{5:R-I.w.u,6:0}).5}7(Q){N.m.5=I.X("l",{5:M,6:0}).5}7(G){N.m.6=I.X("l",{5:0,6:E-I.w.t}).6}7(F){N.m.6=I.X("l",{5:0,6:B}).6}}7(N.9.2w!="36"){a K=T.1f(R-P)<=20;a Q=T.1f(M-O)<=20;a G=T.1f(E-D)<=20;a F=T.1f(B-C)<=20;7(K){N.m.5=I.X("l",{5:R,6:0}).5}7(Q){N.m.5=I.X("l",{5:M-I.w.u,6:0}).5}7(G){N.m.6=I.X("l",{5:0,6:E}).6}7(F){N.m.6=I.X("l",{5:0,6:B-I.w.t}).6}}}}});A.g.17.1e("i","2v",{18:c(D,C){a B=A(4).U("i");B.1H=[];A(C.9.2v).1d(c(){7(A.U(4,"27")){a E=A.U(4,"27");B.1H.2x({b:E,2y:E.9.1m});E.3g();E.19("39",D,B)}})},1k:c(D,C){a B=A(4).U("i");A.1d(B.1H,c(){7(4.b.1q){4.b.1q=0;B.1z=v;4.b.1z=15;7(4.2y){4.b.9.1m=v}4.b.2b(D);4.b.j.2z("3f",[D,A.2c(4.b.g(),{3e:B.j})],4.b.9.3h);4.b.9.d=4.b.9.29}1y{4.b.19("3i",D,B)}})},1c:c(F,E){a D=A(4).U("i"),B=4;a C=c(K){a H=K.6,J=H+K.t,I=K.5,G=I+K.u;n(H<(4.1j.6+4.8.r.6)&&(4.1j.6+4.8.r.6)<J&&I<(4.1j.5+4.8.r.5)&&(4.1j.5+4.8.r.5)<G)};A.1d(D.1H,c(G){7(C.2t(D,4.b.3o)){7(!4.b.1q){4.b.1q=1;4.b.1I=A(B).28().1u(4.b.j).U("27-2q",v);4.b.9.29=4.b.9.d;4.b.9.d=c(){n E.d[0]};F.2a=4.b.1I[0];4.b.3m(F,v);4.b.2n(F,v,v);4.b.8.r.5=D.8.r.5;4.b.8.r.6=D.8.r.6;4.b.8.k.6-=D.8.k.6-4.b.8.k.6;4.b.8.k.5-=D.8.k.5-4.b.8.k.5;D.19("2J",F)}7(4.b.1I){4.b.2d(F)}}1y{7(4.b.1q){4.b.1q=0;4.b.1z=v;4.b.9.1m=15;4.b.2b(F,v);4.b.9.d=4.b.9.29;4.b.1I.2e();7(4.b.2r){4.b.2r.2e()}D.19("32",F)}}})}});A.g.17.1e("i","1n",{18:c(D,B){a C=A.2X(A(B.9.1n.2W)).2R(c(F,E){n(o(A(F).e("Z"),10)||B.9.1n.1B)-(o(A(E).e("Z"),10)||B.9.1n.1B)});A(C).1d(c(E){4.1x.Z=B.9.1n.1B+E});4[0].1x.Z=B.9.1n.1B+C.1C}})})(38);',62,221,'||||this|top|left|if|offset|options|var|instance|function|helper|css|document|ui|containment|draggable|element|parent|relative|position|return|parseInt|offsetParent|scrollTop|click|scrollLeft|width|height|true|helperProportions|||cssPosition|||||||||||||||||||margins|Math|data|absolute|overflowY|convertPositionTo|overflowX|zIndex||scrollSpeed|body|fixed|scrollSensitivity|false|cursorAt|plugin|start|propagate|grid|ddmanager|drag|each|add|abs|originalPosition|test|snapElements|positionAbs|stop|opacity|revert|stack|window|cursor|isOver|pageX|pageY|parentNode|appendTo|scroll|axis|style|else|cancelHelperRemoval|undefined|min|length|auto|HTML|tagName|handle|sortables|currentItem|px|iframeFix|overflow|addClass|borderTopWidth|disabled|absolutePosition|outerHeight|snap|generatePosition|borderLeftWidth|offsetWidth|offsetHeight|_zIndex|_opacity|div|overflowYOffset||_cursor|clear|uiHash|original|overflowXOffset|outerWidth|sortable|clone|_helper|target|mouseStop|extend|mouseDrag|remove|do|max|marginBottom|marginRight|while|bottom|round|dropBehaviour|mouseStart|removeClass|dragging|item|placeholder|right|call|scrollHeight|connectToSortable|snapMode|push|shouldRevert|triggerHandler|is|animate|find|valid|andSelf|resizable|init|plugins|widget|toSortable|null|mouse|mouseInit|invalid|500|isFunction|prepareOffsets|sort|marginTop|destroy|scrollWidth|browser|group|makeArray|mozilla|current|apply|parents|fromSortable|marginLeft|drop|mouseDestroy|outer|DragDropIframeFix|jQuery|activate|001|inner|removeChild|removeData|sender|sortreceive|refreshItems|receive|deactivate|snapTolerance|1000|defaults|mouseCapture|distance|containerCache|input|delay|cancel|for|background|fff|iframe|continue|unbind|class'.split('|'),0,{}))
;;(function(j){j.effects=j.effects||{};j.extend(j.effects,{save:function(b,a){for(var c=0;c<a.length;c++){if(a[c]!==null)j.data(b[0],"ec.storage."+a[c],b[0].style[a[c]])}},restore:function(b,a){for(var c=0;c<a.length;c++){if(a[c]!==null)b.css(a[c],j.data(b[0],"ec.storage."+a[c]))}},setMode:function(b,a){if(a=='toggle')a=b.is(':hidden')?'show':'hide';return a},getBaseline:function(b,a){var c,e;switch(b[0]){case'top':c=0;break;case'middle':c=0.5;break;case'bottom':c=1;break;default:c=b[0]/a.height};switch(b[1]){case'left':e=0;break;case'center':e=0.5;break;case'right':e=1;break;default:e=b[1]/a.width};return{x:e,y:c}},createWrapper:function(b){if(b.parent().attr('id')=='fxWrapper')return b;var a={width:b.outerWidth({margin:true}),height:b.outerHeight({margin:true}),'float':b.css('float')};b.wrap('<div id="fxWrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var c=b.parent();if(b.css('position')=='static'){c.css({position:'relative'});b.css({position:'relative'})}else{var e=b.css('top');if(isNaN(parseInt(e)))e='auto';var d=b.css('left');if(isNaN(parseInt(d)))d='auto';c.css({position:b.css('position'),top:e,left:d,zIndex:b.css('z-index')}).show();b.css({position:'relative',top:0,left:0})}c.css(a);return c},removeWrapper:function(b){if(b.parent().attr('id')=='fxWrapper')return b.parent().replaceWith(b);return b},setTransition:function(c,e,d,g){g=g||{};j.each(e,function(b,a){unit=c.cssUnit(a);if(unit[0]>0)g[a]=unit[0]*d+unit[1]});return g},animateClass:function(f,i,h,k){var o=(typeof h=="function"?h:(k?k:null));var p=(typeof h=="object"?h:null);return this.each(function(){var b={};var a=j(this);var c=a.attr("style")||'';if(typeof c=='object')c=c["cssText"];if(f.toggle){a.hasClass(f.toggle)?f.remove=f.toggle:f.add=f.toggle}var e=j.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(f.add)a.addClass(f.add);if(f.remove)a.removeClass(f.remove);var d=j.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(f.add)a.removeClass(f.add);if(f.remove)a.addClass(f.remove);for(var g in d){if(typeof d[g]!="function"&&d[g]&&g.indexOf("Moz")==-1&&g.indexOf("length")==-1&&d[g]!=e[g]&&(g.match(/color/i)||(!g.match(/color/i)&&!isNaN(parseInt(d[g],10))))&&(e.position!="static"||(e.position=="static"&&!g.match(/left|top|bottom|right/))))b[g]=d[g]}a.animate(b,i,p,function(){if(typeof j(this).attr("style")=='object'){j(this).attr("style")["cssText"]="";j(this).attr("style")["cssText"]=c}else j(this).attr("style",c);if(f.add)j(this).addClass(f.add);if(f.remove)j(this).removeClass(f.remove);if(o)o.apply(this,arguments)})})}});j.fn.extend({_show:j.fn.show,_hide:j.fn.hide,__toggle:j.fn.toggle,_addClass:j.fn.addClass,_removeClass:j.fn.removeClass,_toggleClass:j.fn.toggleClass,effect:function(b,a,c,e){return j.effects[b]?j.effects[b].call(this,{method:b,options:a||{},duration:c,callback:e}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])))return this._show.apply(this,arguments);else{var b=arguments[1]||{};b['mode']='show';return this.effect.apply(this,[arguments[0],b,arguments[2]||b.duration,arguments[3]||b.callback])}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])))return this._hide.apply(this,arguments);else{var b=arguments[1]||{};b['mode']='hide';return this.effect.apply(this,[arguments[0],b,arguments[2]||b.duration,arguments[3]||b.callback])}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0]))||(arguments[0].constructor==Function))return this.__toggle.apply(this,arguments);else{var b=arguments[1]||{};b['mode']='toggle';return this.effect.apply(this,[arguments[0],b,arguments[2]||b.duration,arguments[3]||b.callback])}},addClass:function(b,a,c,e){return a?j.effects.animateClass.apply(this,[{add:b},a,c,e]):this._addClass(b)},removeClass:function(b,a,c,e){return a?j.effects.animateClass.apply(this,[{remove:b},a,c,e]):this._removeClass(b)},toggleClass:function(b,a,c,e){return a?j.effects.animateClass.apply(this,[{toggle:b},a,c,e]):this._toggleClass(b)},morph:function(b,a,c,e,d){return j.effects.animateClass.apply(this,[{add:a,remove:b},c,e,d])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(c){var e=this.css(c),d=[];j.each(['em','px','%','pt'],function(b,a){if(e.indexOf(a)>0)d=[parseFloat(e),a]});return d}});jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(a,c){jQuery.fx.step[c]=function(b){if(b.state==0){b.start=m(b.elem,c);b.end=l(b.end)}b.elem.style[c]="rgb("+[Math.max(Math.min(parseInt((b.pos*(b.end[0]-b.start[0]))+b.start[0]),255),0),Math.max(Math.min(parseInt((b.pos*(b.end[1]-b.start[1]))+b.start[1]),255),0),Math.max(Math.min(parseInt((b.pos*(b.end[2]-b.start[2]))+b.start[2]),255),0)].join(",")+")"}});function l(b){var a;if(b&&b.constructor==Array&&b.length==3)return b;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(a=/rgba\(0, 0, 0, 0\)/.exec(b))return q['transparent'];return q[jQuery.trim(b).toLowerCase()]}function m(b,a){var c;do{c=jQuery.curCSS(b,a);if(c!=''&&c!='transparent'||jQuery.nodeName(b,"body"))break;a="backgroundColor"}while(b=b.parentNode);return l(c)};var q={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(b,a,c,e,d){return jQuery.easing[jQuery.easing.def](b,a,c,e,d)},easeInQuad:function(b,a,c,e,d){return e*(a/=d)*a+c},easeOutQuad:function(b,a,c,e,d){return-e*(a/=d)*(a-2)+c},easeInOutQuad:function(b,a,c,e,d){if((a/=d/2)<1)return e/2*a*a+c;return-e/2*((--a)*(a-2)-1)+c},easeInCubic:function(b,a,c,e,d){return e*(a/=d)*a*a+c},easeOutCubic:function(b,a,c,e,d){return e*((a=a/d-1)*a*a+1)+c},easeInOutCubic:function(b,a,c,e,d){if((a/=d/2)<1)return e/2*a*a*a+c;return e/2*((a-=2)*a*a+2)+c},easeInQuart:function(b,a,c,e,d){return e*(a/=d)*a*a*a+c},easeOutQuart:function(b,a,c,e,d){return-e*((a=a/d-1)*a*a*a-1)+c},easeInOutQuart:function(b,a,c,e,d){if((a/=d/2)<1)return e/2*a*a*a*a+c;return-e/2*((a-=2)*a*a*a-2)+c},easeInQuint:function(b,a,c,e,d){return e*(a/=d)*a*a*a*a+c},easeOutQuint:function(b,a,c,e,d){return e*((a=a/d-1)*a*a*a*a+1)+c},easeInOutQuint:function(b,a,c,e,d){if((a/=d/2)<1)return e/2*a*a*a*a*a+c;return e/2*((a-=2)*a*a*a*a+2)+c},easeInSine:function(b,a,c,e,d){return-e*Math.cos(a/d*(Math.PI/2))+e+c},easeOutSine:function(b,a,c,e,d){return e*Math.sin(a/d*(Math.PI/2))+c},easeInOutSine:function(b,a,c,e,d){return-e/2*(Math.cos(Math.PI*a/d)-1)+c},easeInExpo:function(b,a,c,e,d){return(a==0)?c:e*Math.pow(2,10*(a/d-1))+c},easeOutExpo:function(b,a,c,e,d){return(a==d)?c+e:e*(-Math.pow(2,-10*a/d)+1)+c},easeInOutExpo:function(b,a,c,e,d){if(a==0)return c;if(a==d)return c+e;if((a/=d/2)<1)return e/2*Math.pow(2,10*(a-1))+c;return e/2*(-Math.pow(2,-10*--a)+2)+c},easeInCirc:function(b,a,c,e,d){return-e*(Math.sqrt(1-(a/=d)*a)-1)+c},easeOutCirc:function(b,a,c,e,d){return e*Math.sqrt(1-(a=a/d-1)*a)+c},easeInOutCirc:function(b,a,c,e,d){if((a/=d/2)<1)return-e/2*(Math.sqrt(1-a*a)-1)+c;return e/2*(Math.sqrt(1-(a-=2)*a)+1)+c},easeInElastic:function(b,a,c,e,d){var g=1.70158;var f=0;var i=e;if(a==0)return c;if((a/=d)==1)return c+e;if(!f)f=d*.3;if(i<Math.abs(e)){i=e;var g=f/4}else var g=f/(2*Math.PI)*Math.asin(e/i);return-(i*Math.pow(2,10*(a-=1))*Math.sin((a*d-g)*(2*Math.PI)/f))+c},easeOutElastic:function(b,a,c,e,d){var g=1.70158;var f=0;var i=e;if(a==0)return c;if((a/=d)==1)return c+e;if(!f)f=d*.3;if(i<Math.abs(e)){i=e;var g=f/4}else var g=f/(2*Math.PI)*Math.asin(e/i);return i*Math.pow(2,-10*a)*Math.sin((a*d-g)*(2*Math.PI)/f)+e+c},easeInOutElastic:function(b,a,c,e,d){var g=1.70158;var f=0;var i=e;if(a==0)return c;if((a/=d/2)==2)return c+e;if(!f)f=d*(.3*1.5);if(i<Math.abs(e)){i=e;var g=f/4}else var g=f/(2*Math.PI)*Math.asin(e/i);if(a<1)return-.5*(i*Math.pow(2,10*(a-=1))*Math.sin((a*d-g)*(2*Math.PI)/f))+c;return i*Math.pow(2,-10*(a-=1))*Math.sin((a*d-g)*(2*Math.PI)/f)*.5+e+c},easeInBack:function(b,a,c,e,d,g){if(g==undefined)g=1.70158;return e*(a/=d)*a*((g+1)*a-g)+c},easeOutBack:function(b,a,c,e,d,g){if(g==undefined)g=1.70158;return e*((a=a/d-1)*a*((g+1)*a+g)+1)+c},easeInOutBack:function(b,a,c,e,d,g){if(g==undefined)g=1.70158;if((a/=d/2)<1)return e/2*(a*a*(((g*=(1.525))+1)*a-g))+c;return e/2*((a-=2)*a*(((g*=(1.525))+1)*a+g)+2)+c},easeInBounce:function(b,a,c,e,d){return e-jQuery.easing.easeOutBounce(b,d-a,0,e,d)+c},easeOutBounce:function(b,a,c,e,d){if((a/=d)<(1/2.75)){return e*(7.5625*a*a)+c}else if(a<(2/2.75)){return e*(7.5625*(a-=(1.5/2.75))*a+.75)+c}else if(a<(2.5/2.75)){return e*(7.5625*(a-=(2.25/2.75))*a+.9375)+c}else{return e*(7.5625*(a-=(2.625/2.75))*a+.984375)+c}},easeInOutBounce:function(b,a,c,e,d){if(a<d/2)return jQuery.easing.easeInBounce(b,a*2,0,e,d)*.5+c;return jQuery.easing.easeOutBounce(b,a*2-d,0,e,d)*.5+e*.5+c}})})(jQuery);(function(k){k.effects.blind=function(h){return this.queue(function(){var b=k(this),a=['position','top','left'];var c=k.effects.setMode(b,h.options.mode||'hide');var e=h.options.direction||'vertical';k.effects.save(b,a);b.show();var d=k.effects.createWrapper(b).css({overflow:'hidden'});var g=(e=='vertical')?'height':'width';var f=(e=='vertical')?d.height():d.width();if(c=='show')d.css(g,0);var i={};i[g]=c=='show'?f:0;d.animate(i,h.duration,h.options.easing,function(){if(c=='hide')b.hide();k.effects.restore(b,a);k.effects.removeWrapper(b);if(h.callback)h.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);(function(m){m.effects.bounce=function(l){return this.queue(function(){var b=m(this),a=['position','top','left'];var c=m.effects.setMode(b,l.options.mode||'effect');var e=l.options.direction||'up';var d=l.options.distance||20;var g=l.options.times||5;var f=l.duration||250;if(/show|hide/.test(c))a.push('opacity');m.effects.save(b,a);b.show();m.effects.createWrapper(b);var i=(e=='up'||e=='down')?'top':'left';var h=(e=='up'||e=='left')?'pos':'neg';var d=l.options.distance||(i=='top'?b.outerHeight({margin:true})/3:b.outerWidth({margin:true})/3);if(c=='show')b.css('opacity',0).css(i,h=='pos'?-d:d);if(c=='hide')d=d/(g*2);if(c!='hide')g--;if(c=='show'){var k={opacity:1};k[i]=(h=='pos'?'+=':'-=')+d;b.animate(k,f/2,l.options.easing);d=d/2;g--};for(var o=0;o<g;o++){var p={},j={};p[i]=(h=='pos'?'-=':'+=')+d;j[i]=(h=='pos'?'+=':'-=')+d;b.animate(p,f/2,l.options.easing).animate(j,f/2,l.options.easing);d=(c=='hide')?d*2:d/2};if(c=='hide'){var k={opacity:0};k[i]=(h=='pos'?'-=':'+=')+d;b.animate(k,f/2,l.options.easing,function(){b.hide();m.effects.restore(b,a);m.effects.removeWrapper(b);if(l.callback)l.callback.apply(this,arguments)})}else{var p={},j={};p[i]=(h=='pos'?'-=':'+=')+d;j[i]=(h=='pos'?'+=':'-=')+d;b.animate(p,f/2,l.options.easing).animate(j,f/2,l.options.easing,function(){m.effects.restore(b,a);m.effects.removeWrapper(b);if(l.callback)l.callback.apply(this,arguments)})};b.queue('fx',function(){b.dequeue()});b.dequeue()})}})(jQuery);(function(o){o.effects.clip=function(k){return this.queue(function(){var b=o(this),a=['position','top','left','height','width'];var c=o.effects.setMode(b,k.options.mode||'hide');var e=k.options.direction||'vertical';o.effects.save(b,a);b.show();var d=o.effects.createWrapper(b).css({overflow:'hidden'});var g=b[0].tagName=='IMG'?d:b;var f={size:(e=='vertical')?'height':'width',position:(e=='vertical')?'top':'left'};var i=(e=='vertical')?g.height():g.width();if(c=='show'){g.css(f.size,0);g.css(f.position,i/2)}var h={};h[f.size]=c=='show'?i:0;h[f.position]=c=='show'?0:i/2;g.animate(h,{queue:false,duration:k.duration,easing:k.options.easing,complete:function(){if(c=='hide')b.hide();o.effects.restore(b,a);o.effects.removeWrapper(b);if(k.callback)k.callback.apply(b[0],arguments);b.dequeue()}})})}})(jQuery);(function(k){k.effects.drop=function(h){return this.queue(function(){var b=k(this),a=['position','top','left','opacity'];var c=k.effects.setMode(b,h.options.mode||'hide');var e=h.options.direction||'left';k.effects.save(b,a);b.show();k.effects.createWrapper(b);var d=(e=='up'||e=='down')?'top':'left';var g=(e=='up'||e=='left')?'pos':'neg';var f=h.options.distance||(d=='top'?b.outerHeight({margin:true})/2:b.outerWidth({margin:true})/2);if(c=='show')b.css('opacity',0).css(d,g=='pos'?-f:f);var i={opacity:c=='show'?1:0};i[d]=(c=='show'?(g=='pos'?'+=':'-='):(g=='pos'?'-=':'+='))+f;b.animate(i,{queue:false,duration:h.duration,easing:h.options.easing,complete:function(){if(c=='hide')b.hide();k.effects.restore(b,a);k.effects.removeWrapper(b);if(h.callback)h.callback.apply(this,arguments);b.dequeue()}})})}})(jQuery);(function(k){k.effects.explode=function(h){return this.queue(function(){var b=h.options.pieces?Math.round(Math.sqrt(h.options.pieces)):3;var a=h.options.pieces?Math.round(Math.sqrt(h.options.pieces)):3;h.options.mode=h.options.mode=='toggle'?(k(this).is(':visible')?'hide':'show'):h.options.mode;var c=k(this).show().css('visibility','hidden');var e=c.offset();e.top-=parseInt(c.css("marginTop"))||0;e.left-=parseInt(c.css("marginLeft"))||0;var d=c.outerWidth(true);var g=c.outerHeight(true);for(var f=0;f<b;f++){for(var i=0;i<a;i++){c.clone().appendTo('body').wrap('<div></div>').css({position:'absolute',visibility:'visible',left:-i*(d/a),top:-f*(g/b)}).parent().addClass('effects-explode').css({position:'absolute',overflow:'hidden',width:d/a,height:g/b,left:e.left+i*(d/a)+(h.options.mode=='show'?(i-Math.floor(a/2))*(d/a):0),top:e.top+f*(g/b)+(h.options.mode=='show'?(f-Math.floor(b/2))*(g/b):0),opacity:h.options.mode=='show'?0:1}).animate({left:e.left+i*(d/a)+(h.options.mode=='show'?0:(i-Math.floor(a/2))*(d/a)),top:e.top+f*(g/b)+(h.options.mode=='show'?0:(f-Math.floor(b/2))*(g/b)),opacity:h.options.mode=='show'?1:0},h.duration||500)}}setTimeout(function(){h.options.mode=='show'?c.css({visibility:'visible'}):c.css({visibility:'visible'}).hide();if(h.callback)h.callback.apply(c[0]);c.dequeue();k('.effects-explode').remove()},h.duration||500)})}})(jQuery);(function(l){l.effects.fold=function(j){return this.queue(function(){var b=l(this),a=['position','top','left'];var c=l.effects.setMode(b,j.options.mode||'hide');var e=j.options.size||15;var d=!(!j.options.horizFirst);l.effects.save(b,a);b.show();var g=l.effects.createWrapper(b).css({overflow:'hidden'});var f=((c=='show')!=d);var i=f?['width','height']:['height','width'];var h=f?[g.width(),g.height()]:[g.height(),g.width()];var k=/([0-9]+)%/.exec(e);if(k)e=parseInt(k[1])/100*h[c=='hide'?0:1];if(c=='show')g.css(d?{height:0,width:e}:{height:e,width:0});var o={},p={};o[i[0]]=c=='show'?h[0]:e;p[i[1]]=c=='show'?h[1]:0;g.animate(o,j.duration/2,j.options.easing).animate(p,j.duration/2,j.options.easing,function(){if(c=='hide')b.hide();l.effects.restore(b,a);l.effects.removeWrapper(b);if(j.callback)j.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);(function(i){i.effects.highlight=function(f){return this.queue(function(){var b=i(this),a=['backgroundImage','backgroundColor','opacity'];var c=i.effects.setMode(b,f.options.mode||'show');var e=f.options.color||"#ffff99";var d=b.css("backgroundColor");i.effects.save(b,a);b.show();b.css({backgroundImage:'none',backgroundColor:e});var g={backgroundColor:d};if(c=="hide")g['opacity']=0;b.animate(g,{queue:false,duration:f.duration,easing:f.options.easing,complete:function(){if(c=="hide")b.hide();i.effects.restore(b,a);if(c=="show"&&jQuery.browser.msie)this.style.removeAttribute('filter');if(f.callback)f.callback.apply(this,arguments);b.dequeue()}})})}})(jQuery);(function(g){g.effects.pulsate=function(d){return this.queue(function(){var b=g(this);var a=g.effects.setMode(b,d.options.mode||'show');var c=d.options.times||5;if(a=='hide')c--;if(b.is(':hidden')){b.css('opacity',0);b.show();b.animate({opacity:1},d.duration/2,d.options.easing);c=c-2}for(var e=0;e<c;e++){b.animate({opacity:0},d.duration/2,d.options.easing).animate({opacity:1},d.duration/2,d.options.easing)};if(a=='hide'){b.animate({opacity:0},d.duration/2,d.options.easing,function(){b.hide();if(d.callback)d.callback.apply(this,arguments)})}else{b.animate({opacity:0},d.duration/2,d.options.easing).animate({opacity:1},d.duration/2,d.options.easing,function(){if(d.callback)d.callback.apply(this,arguments)})};b.queue('fx',function(){b.dequeue()});b.dequeue()})}})(jQuery);(function(i){i.effects.fade=function(f){return this.queue(function(){var b=i(this),a=['opacity'];var c=i.effects.setMode(b,f.options.mode||'effect');if(c=='toggle')c=b.is(':hidden')?'show':'hide';var e=f.options.opacity||0;var d=b.css('opacity');i.effects.save(b,a);b.show();if(c=='show')b.css({opacity:0});var g={opacity:c=='show'?d:e};b.animate(g,{queue:false,duration:f.duration,easing:f.options.easing,complete:function(){if(c=='hide')b.hide();if(c=='hide')i.effects.restore(b,a);if(f.callback)f.callback.apply(this,arguments);b.dequeue()}})})}})(jQuery);(function(n){n.effects.puff=function(f){return this.queue(function(){var b=n(this);var a=n.extend(true,{},f.options);var c=n.effects.setMode(b,f.options.mode||'hide');var e=parseInt(f.options.percent)||150;a.fade=true;var d={height:b.height(),width:b.width()};var g=e/100;b.from=(c=='hide')?d:{height:d.height*g,width:d.width*g};a.from=b.from;a.percent=(c=='hide')?e:100;a.mode=c;b.effect('scale',a,f.duration,f.callback);b.dequeue()})};n.effects.scale=function(h){return this.queue(function(){var b=n(this);var a=n.extend(true,{},h.options);var c=n.effects.setMode(b,h.options.mode||'effect');var e=parseInt(h.options.percent)||(parseInt(h.options.percent)==0?0:(c=='hide'?0:100));var d=h.options.direction||'both';var g=h.options.origin;if(c!='effect'){a.origin=g||['middle','center'];a.restore=true}var f={height:b.height(),width:b.width()};b.from=h.options.from||(c=='show'?{height:0,width:0}:f);var i={y:d!='horizontal'?(e/100):1,x:d!='vertical'?(e/100):1};b.to={height:f.height*i.y,width:f.width*i.x};if(h.options.fade){if(c=='show'){b.from.opacity=0;b.to.opacity=1};if(c=='hide'){b.from.opacity=1;b.to.opacity=0}};a.from=b.from;a.to=b.to;a.mode=c;b.effect('size',a,h.duration,h.callback);b.dequeue()})};n.effects.size=function(q){return this.queue(function(){var a=n(this),c=['position','top','left','width','height','overflow','opacity'];var e=['position','top','left','overflow','opacity'];var d=['width','height','overflow'];var g=['fontSize'];var f=['borderTopWidth','borderBottomWidth','paddingTop','paddingBottom'];var i=['borderLeftWidth','borderRightWidth','paddingLeft','paddingRight'];var h=n.effects.setMode(a,q.options.mode||'effect');var k=q.options.restore||false;var o=q.options.scale||'both';var p=q.options.origin;var j={height:a.height(),width:a.width()};a.from=q.options.from||j;a.to=q.options.to||j;if(p){var l=n.effects.getBaseline(p,j);a.from.top=(j.height-a.from.height)*l.y;a.from.left=(j.width-a.from.width)*l.x;a.to.top=(j.height-a.to.height)*l.y;a.to.left=(j.width-a.to.width)*l.x};var m={from:{y:a.from.height/j.height,x:a.from.width/j.width},to:{y:a.to.height/j.height,x:a.to.width/j.width}};if(o=='box'||o=='both'){if(m.from.y!=m.to.y){c=c.concat(f);a.from=n.effects.setTransition(a,f,m.from.y,a.from);a.to=n.effects.setTransition(a,f,m.to.y,a.to)};if(m.from.x!=m.to.x){c=c.concat(i);a.from=n.effects.setTransition(a,i,m.from.x,a.from);a.to=n.effects.setTransition(a,i,m.to.x,a.to)}};if(o=='content'||o=='both'){if(m.from.y!=m.to.y){c=c.concat(g);a.from=n.effects.setTransition(a,g,m.from.y,a.from);a.to=n.effects.setTransition(a,g,m.to.y,a.to)}};n.effects.save(a,k?c:e);a.show();n.effects.createWrapper(a);a.css('overflow','hidden').css(a.from);if(o=='content'||o=='both'){f=f.concat(['marginTop','marginBottom']).concat(g);i=i.concat(['marginLeft','marginRight']);d=c.concat(f).concat(i);a.find("*[width]").each(function(){child=n(this);if(k)n.effects.save(child,d);var b={height:child.height(),width:child.width()};child.from={height:b.height*m.from.y,width:b.width*m.from.x};child.to={height:b.height*m.to.y,width:b.width*m.to.x};if(m.from.y!=m.to.y){child.from=n.effects.setTransition(child,f,m.from.y,child.from);child.to=n.effects.setTransition(child,f,m.to.y,child.to)};if(m.from.x!=m.to.x){child.from=n.effects.setTransition(child,i,m.from.x,child.from);child.to=n.effects.setTransition(child,i,m.to.x,child.to)};child.css(child.from);child.animate(child.to,q.duration,q.options.easing,function(){if(k)n.effects.restore(child,d)})})};a.animate(a.to,{queue:false,duration:q.duration,easing:q.options.easing,complete:function(){if(h=='hide')a.hide();n.effects.restore(a,k?c:e);n.effects.removeWrapper(a);if(q.callback)q.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);(function(m){m.effects.shake=function(l){return this.queue(function(){var b=m(this),a=['position','top','left'];var c=m.effects.setMode(b,l.options.mode||'effect');var e=l.options.direction||'left';var d=l.options.distance||20;var g=l.options.times||3;var f=l.duration||l.options.duration||140;m.effects.save(b,a);b.show();m.effects.createWrapper(b);var i=(e=='up'||e=='down')?'top':'left';var h=(e=='up'||e=='left')?'pos':'neg';var k={},o={},p={};k[i]=(h=='pos'?'-=':'+=')+d;o[i]=(h=='pos'?'+=':'-=')+d*2;p[i]=(h=='pos'?'-=':'+=')+d*2;b.animate(k,f,l.options.easing);for(var j=1;j<g;j++){b.animate(o,f,l.options.easing).animate(p,f,l.options.easing)};b.animate(o,f,l.options.easing).animate(k,f/2,l.options.easing,function(){m.effects.restore(b,a);m.effects.removeWrapper(b);if(l.callback)l.callback.apply(this,arguments)});b.queue('fx',function(){b.dequeue()});b.dequeue()})}})(jQuery);(function(k){k.effects.slide=function(h){return this.queue(function(){var b=k(this),a=['position','top','left'];var c=k.effects.setMode(b,h.options.mode||'show');var e=h.options.direction||'left';k.effects.save(b,a);b.show();k.effects.createWrapper(b).css({overflow:'hidden'});var d=(e=='up'||e=='down')?'top':'left';var g=(e=='up'||e=='left')?'pos':'neg';var f=h.options.distance||(d=='top'?b.outerHeight({margin:true}):b.outerWidth({margin:true}));if(c=='show')b.css(d,g=='pos'?-f:f);var i={};i[d]=(c=='show'?(g=='pos'?'+=':'-='):(g=='pos'?'-=':'+='))+f;b.animate(i,{queue:false,duration:h.duration,easing:h.options.easing,complete:function(){if(c=='hide')b.hide();k.effects.restore(b,a);k.effects.removeWrapper(b);if(h.callback)h.callback.apply(this,arguments);b.dequeue()}})})}})(jQuery);(function(f){f.effects.transfer=function(g){return this.queue(function(){var b=f(this);var a=f.effects.setMode(b,g.options.mode||'effect');var c=f(g.options.to);var e=b.offset();var d=f('<div class="ui-effects-transfer"></div>').appendTo(document.body);if(g.options.className)d.addClass(g.options.className);d.addClass(g.options.className);d.css({top:e.top,left:e.left,height:b.outerHeight()-parseInt(d.css('borderTopWidth'))-parseInt(d.css('borderBottomWidth')),width:b.outerWidth()-parseInt(d.css('borderLeftWidth'))-parseInt(d.css('borderRightWidth')),position:'absolute'});e=c.offset();animation={top:e.top,left:e.left,height:c.outerHeight()-parseInt(d.css('borderTopWidth'))-parseInt(d.css('borderBottomWidth')),width:c.outerWidth()-parseInt(d.css('borderLeftWidth'))-parseInt(d.css('borderRightWidth'))};d.animate(animation,g.duration,g.options.easing,function(){d.remove();if(g.callback)g.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);;                                                                  
		if (typeof OverlayWidget == "undefined") {
			var OverlayWidget = Base.extend({
				constructor: null,

				create: function(selector, settings) {
					$(selector).widgetState(settings).widgetClass(OverlayWidget);
				},

				
				getWidgetClassName: function() {
					return "OverlayWidget";
				},

				lazyload: function(selector, event) {
					var jQ = $(selector);
					var s = jQ.widgetState();
					this.createBackground(selector);
					this.createOverlay(selector);
					this.assignEvents(selector);
				},

				assignEvents: function(selector) {
					var jQ = $(selector);
					var s = jQ.widgetState();
					var self = this;
					var bg = $(s.bg);
					var ov = $(s.ov);
					
					$(".close", ov).hover(
						  function() {
							  $(this).addClass("close-mouseover");
						  },
						  function() {
							  $(this).removeClass("close-mouseover");
							  $(".quicklook-button", this).hide();
						  }
					  );
					$(".close", ov).click(function(e) {
						self.hide(selector);
					});
					if (s.closeOnBackgroundClick) {
						bg.click( function(e) {
							if(e.target == bg.get(0)) {
								self.hide(selector);
							}							
						});
					}

				},

				createBackground: function(selector) {
				
					var jQ=$(selector);
					var s = jQ.widgetState();
					var x = s.cssSelector;
					if (s.captureClicks) $("body").append('<div class="OverlayScreen ' + $(selector).widgetId() + '-screen"><!-- --></div>');
					
					if (x) {
						if (x.charAt(0) == "#") {
							$("body").append('<div id="' + x.substring(1,x.length) + '"><div class="OverlayBackground ' + $(selector).widgetId() + '-bg"><!-- --></div></div>');
						} else {
							$("body").append('<div class="' + s.cssSelector + '"><div class="OverlayBackground ' + $(selector).widgetId() + '-bg"><!-- --></div></div>');
						}
					} else {
						$("body").append('<div class="' + $(selector).widgetId() + '-bg"><!-- --></div>');
					}
					s.bg = "." + $(selector).widgetId() + "-bg";
					s.screen = ".OverlayScreen";
					if (s.captureClicks) {
						$(s.screen).css("opacity", "0.0").add(s.bg).css("width", document.body.clientWidth).css("height", $(document).height());
					} else {
						$(s.bg).css("width", 0).css("height", 0);
					}
				},

				createOverlay: function(selector) {
					var jQ = $(selector);
					var s = jQ.widgetState();
					
					$(s.bg).append('<div class="Overlay"><iframe src="about:blank" scrolling="no" frameborder="0" width="100%"></iframe><div class="handle"><div class="close"></div></div><div class="overlay-body"></div><div class="overlay-loading"><!-- --></div></div>');
					s.ov = s.bg + " .Overlay";
					s.ovbody = s.bg + " .Overlay .overlay-body";
					s.ovloading = s.bg + " .overlay-loading";
					var ov = $(s.ov);
					ov.css("position", "absolute");
					
					var options = {};
					// Safari has an issue with select dropdown boxes inside of draggable areas, so we need to explicitly
					// disable dragging on the body of the overlay in Safari only 
					if($.browser.safari) {
						$.extend(options, { cancel:'.overlay-body'});
					}
					if (s.dragByBody) {
						ov.draggable(options);
					}
					if (s.dragByHandle) {
						$.extend(options, { handle:'.handle'});
						ov.draggable(options);
					}
				},

				getBody: function(selector, source) {
	      		var s = $(selector).widgetState();
					var b = $(s.ovbody);
					if (source.sourceURL) {
						
						b.widgetAjax(selector, "path:" + source.sourceURL, null, null, null, function() {
							$(s.ovloading).hide();
							var ov =$(s.ov);
							$("iframe", ov).attr("height",ov.height() + "px");
						});
					} else if (source.sourceSelector) {
						b.html("").append($(source.sourceSelector).html());
					}
				},

				hideAll: function() {
					$(".Overlay-stub").each(function(){
						OverlayWidget.hide(this);
					});	
				},
				
				hide: function(selector) {
					var jQ = $(selector);
					var s = jQ.widgetState();
					if (jQ[0].inProgress) return;
					if (!s.ov) return;
					var ov = $(s.ov);
					$("iframe", ov).hide();
					if (s.effectOnHide) {
						$(s.ov)
							  .hide(s.effectOnHide, {}, s.effectOnHideSpeed, function() {$(s.bg).hide();$(s.screen).hide();})
							  .find(s.ovbody).html("");
					} else {
							$(s.ov).hide().find(s.ovbody).html("");
							$(s.bg).hide();
							$(s.screen).hide();
					}
				},

				setShowEffect: function(selector, effect, options, speed) {
					var s = $(selector).widgetState();
					s.effectOnShow = effect;
					s.effectOnShowOptions = options;
					s.effectOnShowSpeed = speed;
				},

				setHideEffect: function(selector, effect, options, speed) {
					var s = $(selector).widgetState();
					s.effectOnHide = effect;
					s.effectOnHideOptions = options;
					s.effectOnHideSpeed = speed;
				},

				show: function(selector, event, source, x, y) {
					var jQ = $(selector);
					var s = jQ.widgetState();
					if (jQ[0].inProgress) return;
					jQ[0].inProgress = true;
					if (!s.created) {
						this.lazyload(selector, event);
						s.created = true;
					}

					$(s.bg).show();
					$(s.screen).show();
					$("iframe", ov).show();
					var ov = $(s.ov);
					var ovl = $(s.ovloading);
					ov.show();
					ovl.show();
					this.getBody(selector, source);

					if (!x) {
						
						x = document.body.parentNode.clientWidth / 2;
						}
					if (!y) {
						y = document.body.parentNode.clientHeight /2;
					}

					var ovx = x - (ov.width() / 2);
					var ovy = y - (ov.height() / 2);


					if (!s.allowOffScreenOverlay) {
					
						var st = $(window).scrollTop();
						var sl = $(window).scrollLeft();
						if (ovx < sl) {
							ovx = s.onScreenPadding + sl;
						} else if (ovx + ov.width() > $(window).width()) {
							ovx = $(window).width() - ov.width() - s.onScreenPadding + sl;
						}

						if (ovy < st) {
							ovy = s.onScreenPadding + st;
						} else if (ovy + ov.height() > ($(window).height() + st)) {
							ovy = $(window).height() - ov.height() - s.onScreenPadding + st;
						}
					}
					ov.css("top", ovy + "px").css("left", ovx + "px");
					if (s.effectOnShow) {
						ov.show(s.effectOnShow, {}, s.effectOnShowSpeed, function() {
							jQ[0].inProgress = false;
							if (source.sourceSelector) {
								ovl.hide();
							}
						});
					} else {
						ov.show();
						jQ[0].inProgress = false;
						ovl.hide();
					}
				}
			});
		}
	

		function openBasketPage()
		{
			window.location = '/checkout/basket.jsp';
		}
	
   	$(function(){
			$("#widget-but-ucart").click(function(){
			  openBasketPage();
			});

			$(".cart-search-keyword-container .search-button").click(function(){
				submitSearchForm(document.searchForm);
			});

			if ($(".keyword-text").height() < 16) {
				$(".keyword-text").height("16px");
			}
		});
	
		$(function(){
		   var ucartTimer;
		
		   $("#widget-but-ucart").hover(function(){
		      ucartTimer = setTimeout(function() { showBasket('show',''); }, 500);
		   },function(ev) {
		      if( typeof ucartTimer != undefined ) { clearTimeout(ucartTimer); }
		   });
		});

		// When the Universal Cart layer opens 
		// it will close if the user clicks on anything in the main browser window
		$(document).click(function(event) {
			var posX = event.clientX;
			var posY = event.clientY;
			var miniCart = $('#widget-ucart');
			var miniCartPos = miniCart.offset();
			if(isShowingBasket())
			{
				// If user click to background, close the mini cart
				if(!(posX >= miniCartPos.left && posX <= (miniCartPos.left + miniCart.width())
					&& posY >= miniCartPos.top && posY <= (miniCartPos.top + miniCart.height()))) {
					hideBasket();
				}
			}
		});
		
	function buildSelectedRefinements() {
		$.browser.queryParams["refineByColorValue"] = $("#refineColor").val() == null ? "" : $("#refineColor").val();
		$.browser.queryParams["refineBySizeValue"] = $("#refineSize").val() == null ? "" : $("#refineSize").val();
		$.browser.queryParams["refineByPriceValue"] = $("#refinePrice").val() == null ? "" : $("#refinePrice").val();
		$.browser.queryParams["refineByCategoryId"] = $("#refineCategory").val() == null ? "" : $("#refineCategory").val();
		$.browser.queryParams["refineByBrandValue"] = $("#refineBrand").val() == null ? "" : $("#refineBrand").val();
		if($.browser.queryParams["currentIndex"] != null){
			$.browser.queryParams["currentIndex"] = "0";
		}
	}

	function refineColor(theObj) {
		skipDisplaySizeColor();
		buildSelectedRefinements();
		window.location.search = $.browser.serializeQueryParams();
	}
	function refineSize(theObj) {
		skipDisplaySizeColor();
		buildSelectedRefinements();
		window.location.search = $.browser.serializeQueryParams();
	}
	function refinePrice(theObj) {
		skipDisplaySizeColor();
		buildSelectedRefinements();
		window.location.search = $.browser.serializeQueryParams();
	}

	function refineCategory(theObj) {
		skipDisplaySizeColor();
		buildSelectedRefinements();
		window.location.search = $.browser.serializeQueryParams();
	}

	function refineBrand(theObj) {
		skipDisplaySizeColor();
		buildSelectedRefinements();
		window.location.search = $.browser.serializeQueryParams();
	}
	
	function skipDisplaySizeColor() {
		if ($("#skipDisplaySize").val() == "true") {
			$.browser.queryParams["skipDisplaySize"] = $("#skipDisplaySize").val();
		}
		if ($("#skipDisplayColor").val() == "true") {
	      $.browser.queryParams["skipDisplayColor"] = $("#skipDisplayColor").val();
	   }
	}	
	
	$(document).ready(
		function() {
				$("#refineBrand option[value='']").attr("selected", "true");
				$("#refinePrice option[value='']").attr("selected", "true");
				$("#refineSize option[value='']").attr("selected", "true");
				$("#refineColor option[value='']").attr("selected", "true");	   		
				$("#refineCategory option[value='792']").attr("selected", "true");
		}
	);
	

		if (typeof BreadcrumbWidget == "undefined") {
			var BreadcrumbWidget = Base.extend({
				constructor: null,

				create: function(selector, settings) {
					$(selector).widgetState(settings).widgetClass(BreadcrumbWidget);
					
					PersistentStorage.register(BreadcrumbWidget, selector);
				},

				addBreadcrumb: function(selector, name, index) {
					var jQ = $(selector);
					var ti = $(".crumb", jQ).length;
					if (index <= (ti - 1)) {
						var j = index - 1;
						// replace
						$(".crumb:gt(" + j + ")", jQ).add($(".delim:gt(" + (j - 1) + ")", jQ)).remove();
						jQ.append('<div class="delim"><!-- --></div>').append('<div class="crumb last">' + name + '</div');
					} else {
						// append - Should handle the 'organic' growth model...
						$(".last", jQ).removeClass("last");
						jQ.append('<div class="delim"><!-- --></div>').append('<div class="crumb last">' + name + '</div');
					}
					var li = $(".crumb", jQ).index($(".crumb.last")[0]);
					var state = PersistentStorage.loadPersistent();
					$(".crumb.last", jQ).click(function(event) {
						PersistentStorage.executeState(state);
						var i = $(".crumb", jQ).index(this);
						$(".crumb:gt(" + i + ")", jQ).add($(".delim:gt(" + (i - 1) + ")", jQ)).remove();
					});
				},

				removeBreadcrumbs: function(selector, index) {
					var jQ = $(selector);
				},

			/**
			 * Public method which external widgets can invoke (normally via an event bind)
			 * which will refresh the state of this widget to show the sub categories for
			 * the given parent category.
			 *
			 * @param selector {String} The selector name of the element in the DOM
			 * @param event {Event} The event object
			 * @param parentCategoryId {Number} The parent category Id
			 */
				loadBreadcrumbs: function(selector, event, categoryId) {
					var jQ = $(selector);
					var s = jQ.widgetState();
					var self = this;

					jQ.widgetLoad("com.fry.ocpsdk.widget.catalog.navigation.BreadcrumbWidget",
					{
						categoryId: categoryId
					},
							  function() {
							  }
							  );
				},
				
				restoreState: function(state, selector) {
					var catId = state["categoryId"];
					var subcatId = state["subcategoryId"];
					if (subcatId) {
						this.loadBreadcrumbs(selector, null, subcatId);
					} else if (catId) {
						this.loadBreadcrumbs(selector, null, catId);
					}
				},

				getWidgetClassName: function() {
					return "BreadcrumbWidget";
				}
			});
		}
	

if (typeof PagingWidget == "undefined") {

	/**
	 * @class Renders paging controls allowing direct access to any page within a result set as well as
	 *        'next' and 'previous' controls.  The pages will all be listed in sequence preceeded and followed
	 * 		by 'next' and 'previous' links.  The links can be overridden as text or images using Motifs styles for
	 *       the 'next' and 'previous' css classes and the resource attributes 'paging.previous' and 'paging.next'
	 * @author Michael Maley(mmaley@fry.com)
	 */
	var PagingWidget = Base.extend({

		constructor: null,

		create: function(selector, settings) {
			var jQ = $(selector);
			jQ.widgetState(settings).widgetClass(PagingWidget);
			if (jQ.widgetState().enabled != undefined && !jQ.widgetState().enabled) {
				this.hide(selector);
			};
			if (jQ.widgetState().triggerPageChanged) {
				this.calculateValues(jQ, 0, settings.totalItems);
				this.assignEvents(selector);
			}
		},

	/**
	 * Hides the Paging controls (using jQuery's 'hide' method)
	 *
	 * @param selector {String} A jQuery selector for the widget root
	 */
		hide: function(selector) {
			$(selector).hide();
		},

	/**
	 * Shows the Paging controls (using jQuery's 'show' method)
	 *
	 * @param selector {String} A jQuery selector for the widget root
	 */
		show: function(selector) {
			$(selector).show();
		},

	/**
	 * Returns the class name of the widget
	 * @type String
	 */
		getWidgetClassName: function() {
			return "PagingWidget";
		},

	/**
	 * Sets the 'current-page' css class on the page number provided and recalculates the 'next' and 'previous'
	 * links.
	 * @param selector {String} A jQuery selector for the widget root
	 * @param event {Event} The event object
	 * @param pageNumber {Integer} The page number you want to set as the current page
	 */
		setPage: function(selector, event, pageNumber) {
			updatePagingLinks(selector, pageNumber, $(selector).widgetState("totalPages"));
		},


	/**
	 * Sets the number of elements to include per page in the paging control.
	 *
	 * @param selector {String} A jQuery selector for the widget root
	 * @param event {Event} The event object
	 * @param pageSize {Number} The number of items per page for this paging control.
	 */
		setPageSize: function(selector, event, pageSize) {
			$(selector).widgetState("pageSize", pageSize);
		},

	/**
	 * Specify the index of the an item in the collection to use to determine the current-page.  Recalculates
	 * the entire paging control to activate the page that contains the specified index.
	 *
	 * @param selector {String} A jQuery selector for the widget root
	 * @param event {Event} The event object
	 * @param index {Number} The index of the item to use to determine the page to mark as the 'current-page'
	 * @param pageSize {Number} The number of items to render per page
	 * @param totalItems {Number} The total number of items being paged over
	 */
		setIndex: function(selector, event, index, pageSize, totalItems) {
			var s = $(selector).widgetState();
			if (pageSize) s.pageSize = pageSize;
			if (totalItems) s.totalItems = totalItems;
			if (!s.defaultTotalItems) s.defaultTotalItems = totalItems;
			this.calculateValues(selector, index, s.totalItems);
			this.updatePageNumbers(selector);
			this.assignEvents(selector);
			this.selectPage(selector, s.currentPage);
		},

	/**
	 * Internal helper method to assign click events when the controls is rendered/re-rendered.  Only necessary
	 * when the next and previous controls have been re-added to the DOM after a change in the total number of
	 * items/pages in the paged set.
	 *
	 * @param selector {String} A jQuery selector for the widget root
	 * @private
	 */
	 
		assignEvents: function(selector) {
			var jQ = $(selector);
			var self = this;
			var s = jQ.widgetState();

		
			$(".previous", jQ).click(function(event) {
				self.onPageChanged(selector, s.previousIndex);
			});

		
			jQ.find(".page-number").click(function(event) {
				$(".current-page", jQ).removeClass("current-page");
				$(this).addClass("current-page");
				var pIdx = parseInt($(this).text()) - 1;
				var startIndex = pIdx * s.pageSize;
				self.onPageChanged(selector, startIndex);
			});

		
			$(".next", jQ).click(function(event) {
				self.onPageChanged(selector, s.nextIndex);
			});

			$(".viewall", jQ).click(function(event) {
				s.pageSize = s.totalItems;
				s.totalPages = 1;
				s.currentPage = 1;
				s.mode = "all";
				self.updatePageNumbers(selector);
				self.onPageChanged(selector, 0);
				self.assignEvents(selector);
				$(this).css("display", "none");
				$(".viewbypage", jQ).css("display", "block");
				EventTracker.track("AllItems");
			});

			$(".viewbypage", jQ).click(function(event) {
				s.pageSize = s.defaultPageSize;
				s.mode = "page";
				self.calculateValues(selector, 0, s.totalItems);
				self.updatePageNumbers(selector);
				self.onPageChanged(selector, 0);
				self.assignEvents(selector);
				$(this).css("display", "none");
				$(".viewall", jQ).css("display", "block");
				EventTracker.track("ByPage");
			});
		},


	/**
	 * Recalculates the number of pages, the current page, the next and previous indexes, and then updates the
	 * html
	 *
	 */
		onPageChanged: function(selector, pageStartIndex) {
			var jQ = $(selector);
			var s = jQ.widgetState();
			var self = this;
			/**/
			s.nextIndex = Number(pageStartIndex) + s.pageSize;
			s.previousIndex = Number(pageStartIndex) - s.pageSize;
			s.currentIndex = Number(pageStartIndex);
			var currentPage = Math.floor((pageStartIndex + s.pageSize) / s.pageSize);
			self.calculateValues(selector, s.currentIndex, s.totalItems);
			self.selectPage(selector, currentPage);

			EventTracker.track("ToPage", "Page: " + currentPage);

			/**/
			if (s.triggerPageChanged) {
				if (!s.restoringState) {
					PersistentStorage.savePersistent({"browse": {"currentindex": s.currentIndex, "totalitems": s.totalItems, "pagesize" : s.pageSize, "mode" : s.mode}});
				} else {
					s.restoringState = false;
				}
				jQ.widgetTrigger("pagechanged", [pageStartIndex, s.pageSize, s.totalItems]);
			}
		},


	/**
	 *	Function to redraw the paging numbers and labels when the list of entities has changed and
	 *	thrown the 'entities loaded' event.  Should always load from the start of the list (index 0)
	 */

		drawPagingWidget: function(selector, event, totalCount, activeCount) {
			var jQ = $(selector);
			var self = this;
			var s = jQ.widgetState();
			/**/
			this.show(selector);
			if (totalCount != s.totalItems) {
				s.currentIndex = 0;
				if (!s.defaultTotalItems) s.defaultTotalItems = totalCount;
				s.totalItems = totalCount;
				self.calculateValues(selector, s.currentIndex, totalCount);
				self.updatePageNumbers(selector);
				self.selectPage(jQ, s.currentPage);
				self.assignEvents(jQ);
			}
		},

	/**
	 * Calculate the following values for the paging widget based on the widget's page size:
	 * Total Number of Pages, Current Page, Next and Previous indexes
	 *
	 * @param selector {String} A jQuery selector for the widget root
	 * @param currentIndex {Integer} The current index into the paged set
	 * @param totalCount {Integer} The total number of items included in the paged set
	 */
		calculateValues: function(selector, currentIndex, totalCount) {
			var s = $(selector).widgetState();
			s.totalItems = totalCount;
			s.totalPages = Math.floor((totalCount + s.pageSize - 1) / s.pageSize);
			s.currentIndex = currentIndex;
			s.currentPage = Math.floor((currentIndex + s.pageSize) / s.pageSize);
			if (currentIndex > s.pageSize) {
				s.previousIndex = Number(currentIndex) - s.pageSize;
			}
			if (currentIndex < (totalCount - s.pageSize)) {
				s.nextIndex = currentIndex + s.pageSize;
			}
		},


	/**
	 * Updates the HTML styles to show/hide next and previous links as appropriate and
	 * applies the 'current-page' style to the specified current page.
	 *
	 * @param selector {String} A jQuery selector for the widget root
	 *@param currentPage {Integer} The page number to select/highlight
	 *@param totalPages {Integer} The total number of pages
	 *
	 */

		selectPage: function(selector, currentPage) {
			var jQ = $(selector);
			var s = jQ.widgetState();
			if (currentPage > s.totalPages) {
				currentPage = s.totalPages;
			}
			if (currentPage == s.totalPages) {
				jQ.find(".next").css("display", "none");
			} else {
				jQ.find(".next").css("display", "block");
			}

			jQ.find(".current-page").removeClass("current-page");
			$(jQ.find(".page-number").get(currentPage - 1)).addClass("current-page");
			if (currentPage <= 1) {
				jQ.find(".previous").css("display", "none");
			} else {
				jQ.find(".previous").css("display", "block");
			}

         var endIndex = s.currentIndex + s.pageSize > s.totalItems ? s.totalItems : s.currentIndex + s.pageSize;
			if (s.currentIndex + 1 == endIndex) {
				jQ.find(".viewall .xofy").html((s.currentIndex + 1) + ' of ' + s.totalItems);
			} else {
				jQ.find(".viewall .xofy").html((s.currentIndex + 1) + ' - ' + (endIndex) + ' of ' + s.totalItems);
			}
		},

	/**
	 * Updates the html/div representation of the pages that are available for the settings defined for
	 * this widget.  This includes the next and previous labels and links.  Any logic for number ranges
	 * and/or collapsing should occur here.
	 * @param selector {String} A jQuery selector for the widget root
	 * @private
	 */
		updatePageNumbers: function(selector) {
			var jQ = $(selector);
			var self = this;
			var s = jQ.widgetState();

         var pgs = jQ.html("");
			if (s.viewModeBeforePages) {
				this.generateViewModeDiv(selector);
			}
			
			pgs.append('<div class="page-numbers"></div>').children(".page-numbers");
			pgs.append('<div class="previous"><span class="text">' + s.paging_previous + '</span></div>');
			if (s.totalPages > 1 || s.showSinglePage) {
				for (i = 1; i <= s.totalPages; i++) {
					var startIndex = (i - 1) * s.pageSize;
					if (i == s.currentPage) {
						pgs.append('<div class="page-number current-page">' + i + '</div>');
					} else {
						pgs.append('<div class="page-number">' + i + '</div>');
					}
				}
			}
			pgs.append('<div class="next"><span class="text">' + s.paging_next + '</span></div>');
			if (s.currentPage <= 1) {
				jQ.find(".previous").css("display", "none");
			}
			if (s.currentPage >= s.totalPages) {
				jQ.find(".next").css("display", "none");
			}

			if (!s.viewModeBeforePages) {
				this.generateViewModeDiv(selector);
			}
		},

		generateViewModeDiv: function(selector) {
			var jQ = $(selector);
			var s = jQ.widgetState();
			
			var vm = jQ.append('<div class="viewmode"></div>').children(".viewmode");
			var endIndex = s.currentIndex + s.pageSize > s.totalItems ? s.totalItems : s.currentIndex + s.pageSize;
			var xofy = null;
			if (s.currentIndex + 1 == endIndex) {
				xofy = s.showXofYLabel ? '<span class="xofy">' + (s.currentIndex + 1) + ' of ' + s.totalItems + '</span>' : '';
			}else {
				xofy = s.showXofYLabel ? '<span class="xofy">' + (s.currentIndex + 1) + ' - ' + endIndex  + ' of ' + s.totalItems + '</span>' : '';
			}
			if (s.totalPages > 1) {
				vm.append('<div class="viewall">' + xofy + '<span class="text">' + s.paging_view_all + '</span></div>');
			} else {
				vm.append('<div class="viewall" style="display:none">' + xofy + '<span class="text">' + s.paging_view_all + '</span></div>');
			}
			$(".itemcount", vm).html(s.totalItems);
			if (s.totalItems == s.pageSize) {
				vm.append('<div class="viewbypage"><span class="text">' + s.paging_view_by_page + '</span></div>');
			} else {
				vm.append('<div class="viewbypage" style="display:none"><span class="text">' + s.paging_view_by_page + '</span></div>');
			}
		},



	/**
	 * Restores the display and state of the widget based on the state object provided.
	 *
	 * @param state {Object} A widget state object containing the 'paging' with the required information to restore the PagingWidget
	 * @param selector {String}  A jQuery selector for the widget root
	 */
		restoreState: function(state, selector) {
			var browse = state["browse"];
			var jQ = $(selector);
			var s = jQ.widgetState();
			if (s.triggerPageChanged) {
				if (browse && browse.currentindex) {
					if (browse.currentindex != s.currentIndex) {
						s.restoringState = true;
						s.totalItems = browse.totalitems;
						s.pageSize = browse.pagesize;
						s.mode = browse.mode;
						s.currentIndex = browse.currentindex;
						s.currentPage = Math.floor((s.currentIndex + s.pageSize) / s.pageSize);
						this.calculateValues(selector, s.currentIndex, s.totalItems);
						this.updatePageNumbers(selector);
						this.selectPage(jQ, s.currentPage);
						this.assignEvents(selector);
					}
				} else {
				
					s.restoringState = true;
					s.totalItems = s.defaultTotalItems;
					s.pageSize = s.defaultPageSize;
					s.currentPage = 1;
					s.mode = "page";
					this.calculateValues(selector, 0, s.totalItems);
					this.updatePageNumbers(selector);
					this.selectPage(jQ, s.currentPage);
					this.assignEvents(selector);
					$(".viewall", jQ).css("display", "block");
					$(".viewbypage", jQ).css("display", "none");

				}
			}
		}

	});
}
;
                                                
	if (typeof CollapsingPagingWidget == "undefined") {
	/**
	 * @class An extension of the PagingWidget control that renders a listing of pages within a collapsing structure
	          that allows the paging control to consume a fixed amount of space.  The page listing consists of 5
	          sections, 3 are clickable, and 2 are ellipsiss representing a collapsed range of numbers.  In general,
	          the paging control renders the following areas:

                A            B                C
                     D                   E
					1 2 3 ... 7 8 9 10 11 12 13 ... 18 19 20

				 where the sections marked A and C are the beginning and end of the paging list.  B represents the 'active'
				 portion of the user's paging activity, with the middle number (10 in the above example) being the currently
				 selected page.  D and E represent the page numbers that have been collapsed to save screen space.
				 Each ellipsis represents at least one page.  The B section of the paging control 'slides' to the left and
				 right as the user clicks Next and Previous or clicks on a page number.  'Next' would show the next page
				 in sequence (in this example, 14) and consume '7' from the center list of pages.  'Previous' would
				 show the next lowest page number below the current active set (in this example, 6) and consume the
				 number 13 in the ellipsis.

				 As users initialize the paging control or navigate towards the beginning or end of the page list, the
				 ellipsiss are removed since the active and anchor sections overlap.  The two boundry examples for this
				 example would be:

				 1 2 3 4 5 6 7 ... 18 19 20
				 1 2 3 ... 14 15 16 17 18 19 20

				 The number page pages shows (in the above example, 7 pages) is dictated by the size of the 'active buffer',
				 which is provided to the widget as activeBuffer.  The active page will be surrounded by +/- activeBuffer
				 pages.  In the above example, the active buffer is 3 which causes at least 7 (3 + active page + 3) pages
				 to always be shown.  The number of pages shown in the anchors on the left and right side of the
				 paging list are dicted by the value specified in the inactiveBuffer parameter of the widget.  This is the
				 number of pages that will always be shown on the left and right sides of the control.

				 When the active portion of the paging list is 'next to' an anchor, you can get a long display of numbers.
				 This is the 'worst case scenario' for the size of the paging control.  In this example, when the user
				 selects page 7 or page 15, 10 page numbers 10 will be shown in sequence:

				   A         B         E     C
				 1 2 3 4 5 6 7 8 9 10 ... 18 19 20
				   A    D           B            C
				 1 2 3 ... 12 13 14 15 16 17 18 19 20

				 This behavior leads the largest size possible that the paging control can consume.  This size can be
				 determined by the following equation:

				 inactiveBuffer + 2 x activeBuffer + 1 active page + 1 ellipsis + inactiveBuffer = total active pages shown

				 So, in the above example, we'd have

				 3 + 2 x 3 + 1 + 1 + 3 = 14

				  


	 Renders paging controls allowing direct access to any page within a result set as well as
	 *        'next' and 'previous' controls.  The pages will all be listed in sequence preceeded and followed
	 * 		by 'next' and 'previous' links.  The links can be overridden as text or images using Motifs styles for
	 *       the 'next' and 'previous' css classes and the resource attributes 'paging.previous' and 'paging.next'
	 * @author Michael Maley(mmaley@fry.com)
	 * @author $Author: lajollagroup.philyurchuk $
	 * @version $Revision: 1.1 $
	 */
		var CollapsingPagingWidget = PagingWidget.constructor.extend({
			constructor: null,

			create: function(selector, settings) {
				var jQ = $(selector);
				jQ.widgetState(settings).widgetClass(CollapsingPagingWidget);
				var s = jQ.widgetState();
				if (jQ.widgetState().triggerPageChanged) {
					this.calculateValues(jQ, settings.currentIndex, settings.totalItems);
					this.updatePageNumbers(selector);
					this.assignEvents(jQ);
				}

			},
		
			

			getWidgetClassName: function() {
				return "CollapsingPagingWidget";
			},

		/**
		 * Updates the html/div representation of the pages that are available for the settings defined for
		 * this widget.  This includes the next and previous labels and links.  Any logic for number ranges
		 * and/or collapsing should occur here.
		 * @param selector {String} A jQuery selector for the widget root
		 * @private
		 */
			updatePageNumbers: function(selector) {
				var jQ = $(selector);
				var self = this;
				var s = jQ.widgetState();

				var inactiveBuffer = s.inactiveBuffer;
				var activeBuffer = s.activeBuffer;
				var minPages = (2 * activeBuffer) + 1 + (2 * inactiveBuffer);

				if (s.totalPages <= minPages) {
					// Use default paging behavior
					this.base(selector);


				} else {
					var startEllipsis = false;
					var endEllipsis = false;
					if ((s.currentPage + activeBuffer) < (s.totalPages - (inactiveBuffer))) {
						endEllipsis = true;
					}
					if ((s.currentPage - (activeBuffer + 1)) > inactiveBuffer) {
						startEllipsis = true;
					}
					jQ.html("");
					if (s.viewModeBeforePages) {
						this.generateViewModeDiv(selector);
					}

					var pgs = jQ.append('<div class="page-numbers">').children(".page-numbers");
					if (s.currentPage > 1) {
						pgs.append('<div class="previous"><span class="text">' + s.paging_previous + '</span></div>');
					}
					

					for (var i = 1; i <= s.totalPages; i++) {
						
						if ((i <= inactiveBuffer) || (i > inactiveBuffer && (s.currentPage <= inactiveBuffer+1) && (i <= (activeBuffer * 2 + 1)))) {
							self.printPage(pgs, i);
						
						} else if ((i > (s.totalPages - inactiveBuffer)) || (i <= (s.totalPages - inactiveBuffer) && (s.currentPage >= s.totalPages - inactiveBuffer) && (i > (s.totalPages - (activeBuffer * 2 + 1))))) {
						   self.printPage(pgs, i);
						
						} else if (i > inactiveBuffer && i < (s.currentPage - activeBuffer)) {
							if (startEllipsis) {
								
								pgs.append('<div class="page-number ellipsis start">&hellip;</div>');
								startEllipsis = false;
							}

						
						} else if (i >= (s.currentPage - activeBuffer) && i <= (s.currentPage + activeBuffer)) {
                  	self.printPage(pgs, i);
						
						} else if (i > (s.currentPage + activeBuffer) && (i <= (s.totalPages - inactiveBuffer))) {
							if (endEllipsis) {
								// print ellipsis
								pgs.append('<div class="page-number ellipsis end">&hellip;</div>');
								endEllipsis = false;
							}
						} else {
							// console.error("Failed to match " + i );
						}
					}
				if (s.currentPage < s.totalPages) {
					pgs.append('<div class="next"><span class="text">' + s.paging_next + '</span></div>');
				}

				if (!s.viewModeBeforePages) {
					this.generateViewModeDiv(selector);
				}


			}

		},

		onPageChanged: function(selector, pageStartIndex) {
			var jQ = $(selector);
			var s = jQ.widgetState();
			/**/
			s.nextIndex = pageStartIndex + s.pageSize;
			s.previousIndex = pageStartIndex - s.pageSize;
			s.currentIndex = pageStartIndex;
			var currentPage = Math.floor((pageStartIndex + s.pageSize) / s.pageSize);
			s.currentPage = currentPage;
			this.calculateValues(selector, s.currentIndex, s.totalItems);
			this.updatePageNumbers(selector);
			// this.selectPage(selector, currentPage);
			this.assignEvents($(selector));
			EventTracker.track("ToPage", "Page: " + currentPage);

			/**/
			if (!s.restoringState) {
				PersistentStorage.savePersistent({"browse": {"currentindex": s.currentIndex, "totalitems": s.totalItems, "pagesize" : s.pageSize, "mode" : s.mode}});
			} else {
				s.restoringState = false;
			}
			jQ.widgetTrigger("pagechanged", [pageStartIndex, s.pageSize, s.totalItems]);
		},


		printPage: function(jQ, p) {
			if (p == jQ.widgetState().currentPage) {
				jQ.append('<div class="page-number current-page">' + p + '</div>');
			} else {
				jQ.append('<div class="page-number">' + p + '</div>');
			}
		}
	});
}
;

		$(document).ready(function() {
			QuickLookWidget.init();
		});

		if (typeof QuickLookWidget == "undefined") {
			var QuickLookWidget = Base.extend({

				constructor: null,

				init: function() {
					this.assignEvents();
				},

				assignEvents: function(scope) {
					var self = this;
				  
					$(".Quicklook", scope).hover(
							  function() {
								  $(this).addClass("mouseover");
								  $(".quicklook-button", this).show();
							  },
							  function() {
								  $(this).removeClass("mouseover");
								  $(".quicklook-button", this).hide();
							  }
							  );
					$(".quicklook-button", scope).hover(
							  function() {
								  $(this).addClass("mouseover");
							  },
							  function() {
								  $(this).removeClass("mouseover").removeClass("clicked");
							  }
							  );
					$(".quicklook-button", scope).mousedown(
							  function() {
								  $(this).addClass("clicked");
								  });

					$(".quicklook-button", scope).click(
							  function() {
								  var pos = $(this).parent(".Quicklook").offset();
								  var x = pos.left + ($(this).parent(".Quicklook").width() / 2);
								  var y = pos.top + ($(this).parent(".Quicklook").height() / 2);
								  self.onQuickLookSelected($(this).widget(), x, y);
							  });
				},

				getWidgetClassName: function() {
					return "QuickLookWidget";
				},

				onQuickLookSelected: function(selector, x, y) {
					var jQ = $(selector);
					var data = jQ.elementData();
					jQ.widgetTrigger("quicklookselected", [data, x, y]);
				}

			});
		}
	