/*
 * jQuery UI 1.7.2
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
jQuery.ui
		|| (function(c) {
			var i = c.fn.remove, d = c.browser.mozilla
					&& (parseFloat(c.browser.version) < 1.9);
			c.ui = {
				version : "1.7.2",
				plugin : {
					add : function(k, l, n) {
						var m = c.ui[k].prototype;
						for ( var j in n) {
							m.plugins[j] = m.plugins[j] || [];
							m.plugins[j].push( [ l, n[j] ])
						}
					},
					call : function(j, l, k) {
						var n = j.plugins[l];
						if (!n || !j.element[0].parentNode) {
							return
						}
						for ( var m = 0; m < n.length; m++) {
							if (j.options[n[m][0]]) {
								n[m][1].apply(j.element, k)
							}
						}
					}
				},
				contains : function(k, j) {
					return document.compareDocumentPosition ? k
							.compareDocumentPosition(j) & 16 : k !== j
							&& k.contains(j)
				},
				hasScroll : function(m, k) {
					if (c(m).css("overflow") == "hidden") {
						return false
					}
					var j = (k && k == "left") ? "scrollLeft" : "scrollTop", l = false;
					if (m[j] > 0) {
						return true
					}
					m[j] = 1;
					l = (m[j] > 0);
					m[j] = 0;
					return l
				},
				isOverAxis : function(k, j, l) {
					return (k > j) && (k < (j + l))
				},
				isOver : function(o, k, n, m, j, l) {
					return c.ui.isOverAxis(o, n, j) && c.ui.isOverAxis(k, m, l)
				},
				keyCode : {
					BACKSPACE : 8,
					CAPS_LOCK : 20,
					COMMA : 188,
					CONTROL : 17,
					DELETE : 46,
					DOWN : 40,
					END : 35,
					ENTER : 13,
					ESCAPE : 27,
					HOME : 36,
					INSERT : 45,
					LEFT : 37,
					NUMPAD_ADD : 107,
					NUMPAD_DECIMAL : 110,
					NUMPAD_DIVIDE : 111,
					NUMPAD_ENTER : 108,
					NUMPAD_MULTIPLY : 106,
					NUMPAD_SUBTRACT : 109,
					PAGE_DOWN : 34,
					PAGE_UP : 33,
					PERIOD : 190,
					RIGHT : 39,
					SHIFT : 16,
					SPACE : 32,
					TAB : 9,
					UP : 38
				}
			};
			if (d) {
				var f = c.attr, e = c.fn.removeAttr, h = "http://www.w3.org/2005/07/aaa", a = /^aria-/, b = /^wairole:/;
				c.attr = function(k, j, l) {
					var m = l !== undefined;
					return (j == "role" ? (m ? f.call(this, k, j, "wairole:"
							+ l) : (f.apply(this, arguments) || "").replace(b,
							"")) : (a.test(j) ? (m ? k.setAttributeNS(h, j
							.replace(a, "aaa:"), l) : f.call(this, k, j
							.replace(a, "aaa:"))) : f.apply(this, arguments)))
				};
				c.fn.removeAttr = function(j) {
					return (a.test(j) ? this.each(function() {
						this.removeAttributeNS(h, j.replace(a, ""))
					}) : e.call(this, j))
				}
			}
			c.fn
					.extend( {
						remove : function() {
							c("*", this).add(this).each(function() {
								c(this).triggerHandler("remove")
							});
							return i.apply(this, arguments)
						},
						enableSelection : function() {
							return this.attr("unselectable", "off").css(
									"MozUserSelect", "").unbind(
									"selectstart.ui")
						},
						disableSelection : function() {
							return this.attr("unselectable", "on").css(
									"MozUserSelect", "none").bind(
									"selectstart.ui", function() {
										return false
									})
						},
						scrollParent : function() {
							var j;
							if ((c.browser.msie && (/(static|relative)/)
									.test(this.css("position")))
									|| (/absolute/).test(this.css("position"))) {
								j = this
										.parents()
										.filter(
												function() {
													return (/(relative|absolute|fixed)/)
															.test(c.curCSS(
																	this,
																	"position",
																	1))
															&& (/(auto|scroll)/)
																	.test(c
																			.curCSS(
																					this,
																					"overflow",
																					1)
																			+ c
																					.curCSS(
																							this,
																							"overflow-y",
																							1)
																			+ c
																					.curCSS(
																							this,
																							"overflow-x",
																							1))
												}).eq(0)
							} else {
								j = this
										.parents()
										.filter(
												function() {
													return (/(auto|scroll)/)
															.test(c.curCSS(
																	this,
																	"overflow",
																	1)
																	+ c
																			.curCSS(
																					this,
																					"overflow-y",
																					1)
																	+ c
																			.curCSS(
																					this,
																					"overflow-x",
																					1))
												}).eq(0)
							}
							return (/fixed/).test(this.css("position"))
									|| !j.length ? c(document) : j
						}
					});
			c.extend(c.expr[":"],
					{
						data : function(l, k, j) {
							return !!c.data(l, j[3])
						},
						focusable : function(k) {
							var l = k.nodeName.toLowerCase(), j = c.attr(k,
									"tabindex");
							return (/input|select|textarea|button|object/
									.test(l) ? !k.disabled : "a" == l
									|| "area" == l ? k.href || !isNaN(j)
									: !isNaN(j))
									&& !c(k)["area" == l ? "parents"
											: "closest"](":hidden").length
						},
						tabbable : function(k) {
							var j = c.attr(k, "tabindex");
							return (isNaN(j) || j >= 0)
									&& c(k).is(":focusable")
						}
					});
			function g(m, n, o, l) {
				function k(q) {
					var p = c[m][n][q] || [];
					return (typeof p == "string" ? p.split(/,?\s+/) : p)
				}
				var j = k("getter");
				if (l.length == 1 && typeof l[0] == "string") {
					j = j.concat(k("getterSetter"))
				}
				return (c.inArray(o, j) != -1)
			}
			c.widget = function(k, j) {
				var l = k.split(".")[0];
				k = k.split(".")[1];
				c.fn[k] = function(p) {
					var n = (typeof p == "string"), o = Array.prototype.slice
							.call(arguments, 1);
					if (n && p.substring(0, 1) == "_") {
						return this
					}
					if (n && g(l, k, p, o)) {
						var m = c.data(this[0], k);
						return (m ? m[p].apply(m, o) : undefined)
					}
					return this.each(function() {
						var q = c.data(this, k);
						(!q && !n && c.data(this, k, new c[l][k](this, p))
								._init());
						(q && n && c.isFunction(q[p]) && q[p].apply(q, o))
					})
				};
				c[l] = c[l] || {};
				c[l][k] = function(o, n) {
					var m = this;
					this.namespace = l;
					this.widgetName = k;
					this.widgetEventPrefix = c[l][k].eventPrefix || k;
					this.widgetBaseClass = l + "-" + k;
					this.options = c.extend( {}, c.widget.defaults,
							c[l][k].defaults, c.metadata
									&& c.metadata.get(o)[k], n);
					this.element = c(o).bind("setData." + k, function(q, p, r) {
						if (q.target == o) {
							return m._setData(p, r)
						}
					}).bind("getData." + k, function(q, p) {
						if (q.target == o) {
							return m._getData(p)
						}
					}).bind("remove", function() {
						return m.destroy()
					})
				};
				c[l][k].prototype = c.extend( {}, c.widget.prototype, j);
				c[l][k].getterSetter = "option"
			};
			c.widget.prototype = {
				_init : function() {
				},
				destroy : function() {
					this.element.removeData(this.widgetName).removeClass(
							this.widgetBaseClass + "-disabled "
									+ this.namespace + "-state-disabled")
							.removeAttr("aria-disabled")
				},
				option : function(l, m) {
					var k = l, j = this;
					if (typeof l == "string") {
						if (m === undefined) {
							return this._getData(l)
						}
						k = {};
						k[l] = m
					}
					c.each(k, function(n, o) {
						j._setData(n, o)
					})
				},
				_getData : function(j) {
					return this.options[j]
				},
				_setData : function(j, k) {
					this.options[j] = k;
					if (j == "disabled") {
						this.element[k ? "addClass" : "removeClass"](
								this.widgetBaseClass + "-disabled "
										+ this.namespace + "-state-disabled")
								.attr("aria-disabled", k)
					}
				},
				enable : function() {
					this._setData("disabled", false)
				},
				disable : function() {
					this._setData("disabled", true)
				},
				_trigger : function(l, m, n) {
					var p = this.options[l], j = (l == this.widgetEventPrefix ? l
							: this.widgetEventPrefix + l);
					m = c.Event(m);
					m.type = j;
					if (m.originalEvent) {
						for ( var k = c.event.props.length, o; k;) {
							o = c.event.props[--k];
							m[o] = m.originalEvent[o]
						}
					}
					this.element.trigger(m, n);
					return !(c.isFunction(p)
							&& p.call(this.element[0], m, n) === false || m
							.isDefaultPrevented())
				}
			};
			c.widget.defaults = {
				disabled : false
			};
			c.ui.mouse = {
				_mouseInit : function() {
					var j = this;
					this.element.bind("mousedown." + this.widgetName,
							function(k) {
								return j._mouseDown(k)
							}).bind("click." + this.widgetName, function(k) {
						if (j._preventClickEvent) {
							j._preventClickEvent = false;
							k.stopImmediatePropagation();
							return false
						}
					});
					if (c.browser.msie) {
						this._mouseUnselectable = this.element
								.attr("unselectable");
						this.element.attr("unselectable", "on")
					}
					this.started = false
				},
				_mouseDestroy : function() {
					this.element.unbind("." + this.widgetName);
					(c.browser.msie && this.element.attr("unselectable",
							this._mouseUnselectable))
				},
				_mouseDown : function(l) {
					l.originalEvent = l.originalEvent || {};
					if (l.originalEvent.mouseHandled) {
						return
					}
					(this._mouseStarted && this._mouseUp(l));
					this._mouseDownEvent = l;
					var k = this, m = (l.which == 1), j = (typeof this.options.cancel == "string" ? c(
							l.target).parents().add(l.target).filter(
							this.options.cancel).length
							: false);
					if (!m || j || !this._mouseCapture(l)) {
						return true
					}
					this.mouseDelayMet = !this.options.delay;
					if (!this.mouseDelayMet) {
						this._mouseDelayTimer = setTimeout(function() {
							k.mouseDelayMet = true
						}, this.options.delay)
					}
					if (this._mouseDistanceMet(l) && this._mouseDelayMet(l)) {
						this._mouseStarted = (this._mouseStart(l) !== false);
						if (!this._mouseStarted) {
							l.preventDefault();
							return true
						}
					}
					this._mouseMoveDelegate = function(n) {
						return k._mouseMove(n)
					};
					this._mouseUpDelegate = function(n) {
						return k._mouseUp(n)
					};
					c(document).bind("mousemove." + this.widgetName,
							this._mouseMoveDelegate)
							.bind("mouseup." + this.widgetName,
									this._mouseUpDelegate);
					(c.browser.safari || l.preventDefault());
					l.originalEvent.mouseHandled = true;
					return true
				},
				_mouseMove : function(j) {
					if (c.browser.msie && !j.button) {
						return this._mouseUp(j)
					}
					if (this._mouseStarted) {
						this._mouseDrag(j);
						return j.preventDefault()
					}
					if (this._mouseDistanceMet(j) && this._mouseDelayMet(j)) {
						this._mouseStarted = (this._mouseStart(
								this._mouseDownEvent, j) !== false);
						(this._mouseStarted ? this._mouseDrag(j) : this
								._mouseUp(j))
					}
					return !this._mouseStarted
				},
				_mouseUp : function(j) {
					c(document).unbind("mousemove." + this.widgetName,
							this._mouseMoveDelegate)
							.unbind("mouseup." + this.widgetName,
									this._mouseUpDelegate);
					if (this._mouseStarted) {
						this._mouseStarted = false;
						this._preventClickEvent = (j.target == this._mouseDownEvent.target);
						this._mouseStop(j)
					}
					return false
				},
				_mouseDistanceMet : function(j) {
					return (Math.max(Math.abs(this._mouseDownEvent.pageX
							- j.pageX), Math.abs(this._mouseDownEvent.pageY
							- j.pageY)) >= this.options.distance)
				},
				_mouseDelayMet : function(j) {
					return this.mouseDelayMet
				},
				_mouseStart : function(j) {
				},
				_mouseDrag : function(j) {
				},
				_mouseStop : function(j) {
				},
				_mouseCapture : function(j) {
					return true
				}
			};
			c.ui.mouse.defaults = {
				cancel : null,
				distance : 1,
				delay : 0
			}
		})(jQuery);;

/*
 * jQuery UI Slider 1.7.2
 * 
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) Dual licensed
 * under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
 * 
 * http://docs.jquery.com/UI/Slider
 * 
 * Depends: ui.core.js
 */
(function(a) {
	a
			.widget(
					"ui.slider",
					a
							.extend(
									{},
									a.ui.mouse,
									{
										_init : function() {
											var b = this, c = this.options;
											this._keySliding = false;
											this._handleIndex = null;
											this._detectOrientation();
											this._mouseInit();
											this.element
													.addClass("ui-slider ui-slider-"
															+ this.orientation
															+ " ui-widget ui-widget-content ui-corner-all");
											this.range = a( []);
											if (c.range) {
												if (c.range === true) {
													this.range = a("<div></div>");
													if (!c.values) {
														c.values = [
																this
																		._valueMin(),
																this
																		._valueMin() ]
													}
													if (c.values.length
															&& c.values.length != 2) {
														c.values = [
																c.values[0],
																c.values[0] ]
													}
												} else {
													this.range = a("<div></div>")
												}
												this.range.appendTo(
														this.element).addClass(
														"ui-slider-range");
												if (c.range == "min"
														|| c.range == "max") {
													this.range
															.addClass("ui-slider-range-"
																	+ c.range)
												}
												this.range
														.addClass("ui-widget-header")
											}
											if (a(".ui-slider-handle",
													this.element).length == 0) {
												a('<a href="#"></a>').appendTo(
														this.element).addClass(
														"ui-slider-handle")
											}
											if (c.values && c.values.length) {
												while (a(".ui-slider-handle",
														this.element).length < c.values.length) {
													a('<a href="#"></a>')
															.appendTo(
																	this.element)
															.addClass(
																	"ui-slider-handle")
												}
											}
											this.handles = a(
													".ui-slider-handle",
													this.element)
													.addClass(
															"ui-state-default ui-corner-all");
											this.handle = this.handles.eq(0);
											this.handles
													.add(this.range)
													.filter("a")
													.click(function(d) {
														d.preventDefault()
													})
													.hover(
															function() {
																if (!c.disabled) {
																	a(this)
																			.addClass(
																					"ui-state-hover")
																}
															},
															function() {
																a(this)
																		.removeClass(
																				"ui-state-hover")
															})
													.focus(
															function() {
																if (!c.disabled) {
																	a(
																			".ui-slider .ui-state-focus")
																			.removeClass(
																					"ui-state-focus");
																	a(this)
																			.addClass(
																					"ui-state-focus")
																} else {
																	a(this)
																			.blur()
																}
															})
													.blur(
															function() {
																a(this)
																		.removeClass(
																				"ui-state-focus")
															});
											this.handles
													.each(function(d) {
														a(this)
																.data(
																		"index.ui-slider-handle",
																		d)
													});
											this.handles
													.keydown(
															function(i) {
																var f = true;
																var e = a(this)
																		.data(
																				"index.ui-slider-handle");
																if (b.options.disabled) {
																	return
																}
																switch (i.keyCode) {
																case a.ui.keyCode.HOME:
																case a.ui.keyCode.END:
																case a.ui.keyCode.UP:
																case a.ui.keyCode.RIGHT:
																case a.ui.keyCode.DOWN:
																case a.ui.keyCode.LEFT:
																	f = false;
																	if (!b._keySliding) {
																		b._keySliding = true;
																		a(this)
																				.addClass(
																						"ui-state-active");
																		b
																				._start(
																						i,
																						e)
																	}
																	break
																}
																var g, d, h = b
																		._step();
																if (b.options.values
																		&& b.options.values.length) {
																	g = d = b
																			.values(e)
																} else {
																	g = d = b
																			.value()
																}
																switch (i.keyCode) {
																case a.ui.keyCode.HOME:
																	d = b
																			._valueMin();
																	break;
																case a.ui.keyCode.END:
																	d = b
																			._valueMax();
																	break;
																case a.ui.keyCode.UP:
																case a.ui.keyCode.RIGHT:
																	if (g == b
																			._valueMax()) {
																		return
																	}
																	d = g + h;
																	break;
																case a.ui.keyCode.DOWN:
																case a.ui.keyCode.LEFT:
																	if (g == b
																			._valueMin()) {
																		return
																	}
																	d = g - h;
																	break
																}
																b._slide(i, e,
																		d);
																return f
															})
													.keyup(
															function(e) {
																var d = a(this)
																		.data(
																				"index.ui-slider-handle");
																if (b._keySliding) {
																	b._stop(e,
																			d);
																	b._change(
																			e,
																			d);
																	b._keySliding = false;
																	a(this)
																			.removeClass(
																					"ui-state-active")
																}
															});
											this._refreshValue()
										},
										destroy : function() {
											this.handles.remove();
											this.range.remove();
											this.element
													.removeClass(
															"ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all")
													.removeData("slider")
													.unbind(".slider");
											this._mouseDestroy()
										},
										_mouseCapture : function(d) {
											var e = this.options;
											if (e.disabled) {
												return false
											}
											this.elementSize = {
												width : this.element
														.outerWidth(),
												height : this.element
														.outerHeight()
											};
											this.elementOffset = this.element
													.offset();
											var h = {
												x : d.pageX,
												y : d.pageY
											};
											var j = this._normValueFromMouse(h);
											var c = this._valueMax()
													- this._valueMin() + 1, f;
											var k = this, i;
											this.handles.each(function(l) {
												var m = Math.abs(j
														- k.values(l));
												if (c > m) {
													c = m;
													f = a(this);
													i = l
												}
											});
											if (e.range == true
													&& this.values(1) == e.min) {
												f = a(this.handles[++i])
											}
											this._start(d, i);
											k._handleIndex = i;
											f.addClass("ui-state-active")
													.focus();
											var g = f.offset();
											var b = !a(d.target).parents()
													.andSelf()
													.is(".ui-slider-handle");
											this._clickOffset = b ? {
												left : 0,
												top : 0
											}
													: {
														left : d.pageX
																- g.left
																- (f.width() / 2),
														top : d.pageY
																- g.top
																- (f.height() / 2)
																- (parseInt(
																		f
																				.css("borderTopWidth"),
																		10) || 0)
																- (parseInt(
																		f
																				.css("borderBottomWidth"),
																		10) || 0)
																+ (parseInt(
																		f
																				.css("marginTop"),
																		10) || 0)
													};
											j = this._normValueFromMouse(h);
											this._slide(d, i, j);
											return true
										},
										_mouseStart : function(b) {
											return true
										},
										_mouseDrag : function(d) {
											var b = {
												x : d.pageX,
												y : d.pageY
											};
											var c = this._normValueFromMouse(b);
											this
													._slide(d,
															this._handleIndex,
															c);
											return false
										},
										_mouseStop : function(b) {
											this.handles
													.removeClass("ui-state-active");
											this._stop(b, this._handleIndex);
											this._change(b, this._handleIndex);
											this._handleIndex = null;
											this._clickOffset = null;
											return false
										},
										_detectOrientation : function() {
											this.orientation = this.options.orientation == "vertical" ? "vertical"
													: "horizontal"
										},
										_normValueFromMouse : function(d) {
											var c, h;
											if ("horizontal" == this.orientation) {
												c = this.elementSize.width;
												h = d.x
														- this.elementOffset.left
														- (this._clickOffset ? this._clickOffset.left
																: 0)
											} else {
												c = this.elementSize.height;
												h = d.y
														- this.elementOffset.top
														- (this._clickOffset ? this._clickOffset.top
																: 0)
											}
											var f = (h / c);
											if (f > 1) {
												f = 1
											}
											if (f < 0) {
												f = 0
											}
											if ("vertical" == this.orientation) {
												f = 1 - f
											}
											var e = this._valueMax()
													- this._valueMin(), i = f
													* e, b = i
													% this.options.step, g = this
													._valueMin()
													+ i - b;
											if (b > (this.options.step / 2)) {
												g += this.options.step
											}
											return parseFloat(g.toFixed(5))
										},
										_start : function(d, c) {
											var b = {
												handle : this.handles[c],
												value : this.value()
											};
											if (this.options.values
													&& this.options.values.length) {
												b.value = this.values(c);
												b.values = this.values()
											}
											this._trigger("start", d, b)
										},
										_slide : function(f, e, d) {
											var g = this.handles[e];
											if (this.options.values
													&& this.options.values.length) {
												var b = this.values(e ? 0 : 1);
												if ((this.options.values.length == 2 && this.options.range === true)
														&& ((e == 0 && d > b) || (e == 1 && d < b))) {
													d = b
												}
												if (d != this.values(e)) {
													var c = this.values();
													c[e] = d;
													var h = this
															._trigger(
																	"slide",
																	f,
																	{
																		handle : this.handles[e],
																		value : d,
																		values : c
																	});
													var b = this.values(e ? 0
															: 1);
													if (h !== false) {
														this
																.values(
																		e,
																		d,
																		(f.type == "mousedown" && this.options.animate),
																		true)
													}
												}
											} else {
												if (d != this.value()) {
													var h = this
															._trigger(
																	"slide",
																	f,
																	{
																		handle : this.handles[e],
																		value : d
																	});
													if (h !== false) {
														this
																._setData(
																		"value",
																		d,
																		(f.type == "mousedown" && this.options.animate))
													}
												}
											}
										},
										_stop : function(d, c) {
											var b = {
												handle : this.handles[c],
												value : this.value()
											};
											if (this.options.values
													&& this.options.values.length) {
												b.value = this.values(c);
												b.values = this.values()
											}
											this._trigger("stop", d, b)
										},
										_change : function(d, c) {
											var b = {
												handle : this.handles[c],
												value : this.value()
											};
											if (this.options.values
													&& this.options.values.length) {
												b.value = this.values(c);
												b.values = this.values()
											}
											this._trigger("change", d, b)
										},
										value : function(b) {
											if (arguments.length) {
												this._setData("value", b);
												this._change(null, 0)
											}
											return this._value()
										},
										values : function(b, e, c, d) {
											if (arguments.length > 1) {
												this.options.values[b] = e;
												this._refreshValue(c);
												if (!d) {
													this._change(null, b)
												}
											}
											if (arguments.length) {
												if (this.options.values
														&& this.options.values.length) {
													return this._values(b)
												} else {
													return this.value()
												}
											} else {
												return this._values()
											}
										},
										_setData : function(b, d, c) {
											a.widget.prototype._setData.apply(
													this, arguments);
											switch (b) {
											case "disabled":
												if (d) {
													this.handles.filter(
															".ui-state-focus")
															.blur();
													this.handles
															.removeClass("ui-state-hover");
													this.handles.attr(
															"disabled",
															"disabled")
												} else {
													this.handles
															.removeAttr("disabled")
												}
											case "orientation":
												this._detectOrientation();
												this.element
														.removeClass(
																"ui-slider-horizontal ui-slider-vertical")
														.addClass(
																"ui-slider-"
																		+ this.orientation);
												this._refreshValue(c);
												break;
											case "value":
												this._refreshValue(c);
												break
											}
										},
										_step : function() {
											var b = this.options.step;
											return b
										},
										_value : function() {
											var b = this.options.value;
											if (b < this._valueMin()) {
												b = this._valueMin()
											}
											if (b > this._valueMax()) {
												b = this._valueMax()
											}
											return b
										},
										_values : function(b) {
											if (arguments.length) {
												var c = this.options.values[b];
												if (c < this._valueMin()) {
													c = this._valueMin()
												}
												if (c > this._valueMax()) {
													c = this._valueMax()
												}
												return c
											} else {
												return this.options.values
											}
										},
										_valueMin : function() {
											var b = this.options.min;
											return b
										},
										_valueMax : function() {
											var b = this.options.max;
											return b
										},
										_refreshValue : function(c) {
											var f = this.options.range, d = this.options, l = this;
											if (this.options.values
													&& this.options.values.length) {
												var i, h;
												this.handles
														.each(function(p, n) {
															var o = (l
																	.values(p) - l
																	._valueMin())
																	/ (l
																			._valueMax() - l
																			._valueMin())
																	* 100;
															var m = {};
															m[l.orientation == "horizontal" ? "left"
																	: "bottom"] = o
																	+ "%";
															a(this).stop(1, 1)[c ? "animate"
																	: "css"](m,
																	d.animate);
															if (l.options.range === true) {
																if (l.orientation == "horizontal") {
																	(p == 0)
																			&& l.range
																					.stop(
																							1,
																							1)[c ? "animate"
																					: "css"]
																					(
																							{
																								left : o
																										+ "%"
																							},
																							d.animate);
																	(p == 1)
																			&& l.range[c ? "animate"
																					: "css"]
																					(
																							{
																								width : (o - lastValPercent)
																										+ "%"
																							},
																							{
																								queue : false,
																								duration : d.animate
																							})
																} else {
																	(p == 0)
																			&& l.range
																					.stop(
																							1,
																							1)[c ? "animate"
																					: "css"]
																					(
																							{
																								bottom : (o)
																										+ "%"
																							},
																							d.animate);
																	(p == 1)
																			&& l.range[c ? "animate"
																					: "css"]
																					(
																							{
																								height : (o - lastValPercent)
																										+ "%"
																							},
																							{
																								queue : false,
																								duration : d.animate
																							})
																}
															}
															lastValPercent = o
														})
											} else {
												var j = this.value(), g = this
														._valueMin(), k = this
														._valueMax(), e = k != g ? (j - g)
														/ (k - g) * 100
														: 0;
												var b = {};
												b[l.orientation == "horizontal" ? "left"
														: "bottom"] = e + "%";
												this.handle.stop(1, 1)[c ? "animate"
														: "css"](b, d.animate);
												(f == "min")
														&& (this.orientation == "horizontal")
														&& this.range
																.stop(1, 1)[c ? "animate"
																: "css"]( {
															width : e + "%"
														}, d.animate);
												(f == "max")
														&& (this.orientation == "horizontal")
														&& this.range[c ? "animate"
																: "css"]
																(
																		{
																			width : (100 - e)
																					+ "%"
																		},
																		{
																			queue : false,
																			duration : d.animate
																		});
												(f == "min")
														&& (this.orientation == "vertical")
														&& this.range
																.stop(1, 1)[c ? "animate"
																: "css"]( {
															height : e + "%"
														}, d.animate);
												(f == "max")
														&& (this.orientation == "vertical")
														&& this.range[c ? "animate"
																: "css"]
																(
																		{
																			height : (100 - e)
																					+ "%"
																		},
																		{
																			queue : false,
																			duration : d.animate
																		})
											}
										}
									}));
	a.extend(a.ui.slider, {
		getter : "value values",
		version : "1.7.2",
		eventPrefix : "slide",
		defaults : {
			animate : false,
			delay : 0,
			distance : 0,
			max : 100,
			min : 0,
			orientation : "horizontal",
			range : false,
			step : 1,
			value : 0,
			values : null
		}
	})
})(jQuery);;

/*
 * jQuery Cycle Plugin (with Transition Definitions) Examples and documentation
 * at: http://jquery.malsup.com/cycle/ Copyright (c) 2007-2009 M. Alsup Version:
 * 2.73 (04-NOV-2009) Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html Requires: jQuery v1.2.6 or later
 * 
 * Originally based on the work of: 1) Matt Oakes 2) Torsten Baldes
 * (http://medienfreunde.com/lab/innerfade/) 3) Benjamin Sterling
 * (http://www.benjaminsterling.com/experiments/jqShuffle/)
 */
(function(i) {
	var l = "2.73";
	if (i.support == undefined) {
		i.support = {
			opacity : !(i.browser.msie)
		}
	}
	function a(q) {
		if (i.fn.cycle.debug) {
			f(q)
		}
	}
	function f() {
		if (window.console && window.console.log) {
			window.console.log("[cycle] "
					+ Array.prototype.join.call(arguments, " "))
		}
	}
	i.fn.cycle = function(r, q) {
		var s = {
			s : this.selector,
			c : this.context
		};
		if (this.length === 0 && r != "stop") {
			if (!i.isReady && s.s) {
				f("DOM not ready, queuing slideshow");
				i(function() {
					i(s.s, s.c).cycle(r, q)
				});
				return this
			}
			f("terminating; zero elements found by selector"
					+ (i.isReady ? "" : " (DOM not ready)"));
			return this
		}
		return this.each(function() {
			var w = m(this, r, q);
			if (w === false) {
				return
			}
			if (this.cycleTimeout) {
				clearTimeout(this.cycleTimeout)
			}
			this.cycleTimeout = this.cyclePause = 0;
			var x = i(this);
			var y = w.slideExpr ? i(w.slideExpr, this) : x.children();
			var u = y.get();
			if (u.length < 2) {
				f("terminating; too few slides: " + u.length);
				return
			}
			var t = k(x, y, u, w, s);
			if (t === false) {
				return
			}
			var v = t.continuous ? 10 : h(t.currSlide, t.nextSlide, t, !t.rev);
			if (v) {
				v += (t.delay || 0);
				if (v < 10) {
					v = 10
				}
				a("first timeout: " + v);
				this.cycleTimeout = setTimeout(function() {
					e(u, t, 0, !t.rev)
				}, v)
			}
		})
	};
	function m(q, t, r) {
		if (q.cycleStop == undefined) {
			q.cycleStop = 0
		}
		if (t === undefined || t === null) {
			t = {}
		}
		if (t.constructor == String) {
			switch (t) {
			case "stop":
				q.cycleStop++;
				if (q.cycleTimeout) {
					clearTimeout(q.cycleTimeout)
				}
				q.cycleTimeout = 0;
				i(q).removeData("cycle.opts");
				return false;
			case "pause":
				q.cyclePause = 1;
				return false;
			case "resume":
				q.cyclePause = 0;
				if (r === true) {
					t = i(q).data("cycle.opts");
					if (!t) {
						f("options not found, can not resume");
						return false
					}
					if (q.cycleTimeout) {
						clearTimeout(q.cycleTimeout);
						q.cycleTimeout = 0
					}
					e(t.elements, t, 1, 1)
				}
				return false;
			case "prev":
			case "next":
				var u = i(q).data("cycle.opts");
				if (!u) {
					f('options not found, "prev/next" ignored');
					return false
				}
				i.fn.cycle[t](u);
				return false;
			default:
				t = {
					fx : t
				}
			}
			return t
		} else {
			if (t.constructor == Number) {
				var s = t;
				t = i(q).data("cycle.opts");
				if (!t) {
					f("options not found, can not advance slide");
					return false
				}
				if (s < 0 || s >= t.elements.length) {
					f("invalid slide index: " + s);
					return false
				}
				t.nextSlide = s;
				if (q.cycleTimeout) {
					clearTimeout(q.cycleTimeout);
					q.cycleTimeout = 0
				}
				if (typeof r == "string") {
					t.oneTimeFx = r
				}
				e(t.elements, t, 1, s >= t.currSlide);
				return false
			}
		}
		return t
	}
	function b(q, r) {
		if (!i.support.opacity && r.cleartype && q.style.filter) {
			try {
				q.style.removeAttribute("filter")
			} catch (s) {
			}
		}
	}
	function k(y, J, u, t, E) {
		var C = i.extend( {}, i.fn.cycle.defaults, t || {}, i.metadata ? y
				.metadata() : i.meta ? y.data() : {});
		if (C.autostop) {
			C.countdown = C.autostopCount || u.length
		}
		var r = y[0];
		y.data("cycle.opts", C);
		C.$cont = y;
		C.stopCount = r.cycleStop;
		C.elements = u;
		C.before = C.before ? [ C.before ] : [];
		C.after = C.after ? [ C.after ] : [];
		C.after.unshift(function() {
			C.busy = 0
		});
		if (!i.support.opacity && C.cleartype) {
			C.after.push(function() {
				b(this, C)
			})
		}
		if (C.continuous) {
			C.after.push(function() {
				e(u, C, 0, !C.rev)
			})
		}
		n(C);
		if (!i.support.opacity && C.cleartype && !C.cleartypeNoBg) {
			g(J)
		}
		if (y.css("position") == "static") {
			y.css("position", "relative")
		}
		if (C.width) {
			y.width(C.width)
		}
		if (C.height && C.height != "auto") {
			y.height(C.height)
		}
		if (C.startingSlide) {
			C.startingSlide = parseInt(C.startingSlide)
		}
		if (C.random) {
			C.randomMap = [];
			for ( var H = 0; H < u.length; H++) {
				C.randomMap.push(H)
			}
			C.randomMap.sort(function(L, w) {
				return Math.random() - 0.5
			});
			C.randomIndex = 0;
			C.startingSlide = C.randomMap[0]
		} else {
			if (C.startingSlide >= u.length) {
				C.startingSlide = 0
			}
		}
		C.currSlide = C.startingSlide = C.startingSlide || 0;
		var x = C.startingSlide;
		J.css( {
			position : "absolute",
			top : 0,
			left : 0
		}).hide().each(function(w) {
			var L = x ? w >= x ? u.length - (w - x) : x - w : u.length - w;
			i(this).css("z-index", L)
		});
		i(u[x]).css("opacity", 1).show();
		b(u[x], C);
		if (C.fit && C.width) {
			J.width(C.width)
		}
		if (C.fit && C.height && C.height != "auto") {
			J.height(C.height)
		}
		var D = C.containerResize && !y.innerHeight();
		if (D) {
			var v = 0, B = 0;
			for ( var F = 0; F < u.length; F++) {
				var q = i(u[F]), K = q[0], A = q.outerWidth(), I = q
						.outerHeight();
				if (!A) {
					A = K.offsetWidth
				}
				if (!I) {
					I = K.offsetHeight
				}
				v = A > v ? A : v;
				B = I > B ? I : B
			}
			if (v > 0 && B > 0) {
				y.css( {
					width : v + "px",
					height : B + "px"
				})
			}
		}
		if (C.pause) {
			y.hover(function() {
				this.cyclePause++
			}, function() {
				this.cyclePause--
			})
		}
		if (c(C) === false) {
			return false
		}
		var s = false;
		t.requeueAttempts = t.requeueAttempts || 0;
		J
				.each(function() {
					var N = i(this);
					this.cycleH = (C.fit && C.height) ? C.height : N.height();
					this.cycleW = (C.fit && C.width) ? C.width : N.width();
					if (N.is("img")) {
						var L = (i.browser.msie && this.cycleW == 28
								&& this.cycleH == 30 && !this.complete);
						var O = (i.browser.mozilla && this.cycleW == 34
								&& this.cycleH == 19 && !this.complete);
						var M = (i.browser.opera
								&& ((this.cycleW == 42 && this.cycleH == 19) || (this.cycleW == 37 && this.cycleH == 17)) && !this.complete);
						var w = (this.cycleH == 0 && this.cycleW == 0 && !this.complete);
						if (L || O || M || w) {
							if (E.s && C.requeueOnImageNotLoaded
									&& ++t.requeueAttempts < 100) {
								f(
										t.requeueAttempts,
										" - img slide not loaded, requeuing slideshow: ",
										this.src, this.cycleW, this.cycleH);
								setTimeout(function() {
									i(E.s, E.c).cycle(t)
								}, C.requeueTimeout);
								s = true;
								return false
							} else {
								f("could not determine size of image: "
										+ this.src, this.cycleW, this.cycleH)
							}
						}
					}
					return true
				});
		if (s) {
			return false
		}
		C.cssBefore = C.cssBefore || {};
		C.animIn = C.animIn || {};
		C.animOut = C.animOut || {};
		J.not(":eq(" + x + ")").css(C.cssBefore);
		if (C.cssFirst) {
			i(J[x]).css(C.cssFirst)
		}
		if (C.timeout) {
			C.timeout = parseInt(C.timeout);
			if (C.speed.constructor == String) {
				C.speed = i.fx.speeds[C.speed] || parseInt(C.speed)
			}
			if (!C.sync) {
				C.speed = C.speed / 2
			}
			while ((C.timeout - C.speed) < 250) {
				C.timeout += C.speed
			}
		}
		if (C.easing) {
			C.easeIn = C.easeOut = C.easing
		}
		if (!C.speedIn) {
			C.speedIn = C.speed
		}
		if (!C.speedOut) {
			C.speedOut = C.speed
		}
		C.slideCount = u.length;
		C.currSlide = C.lastSlide = x;
		if (C.random) {
			C.nextSlide = C.currSlide;
			if (++C.randomIndex == u.length) {
				C.randomIndex = 0
			}
			C.nextSlide = C.randomMap[C.randomIndex]
		} else {
			C.nextSlide = C.startingSlide >= (u.length - 1) ? 0
					: C.startingSlide + 1
		}
		if (!C.multiFx) {
			var G = i.fn.cycle.transitions[C.fx];
			if (i.isFunction(G)) {
				G(y, J, C)
			} else {
				if (C.fx != "custom" && !C.multiFx) {
					f("unknown transition: " + C.fx, "; slideshow terminating");
					return false
				}
			}
		}
		var z = J[x];
		if (C.before.length) {
			C.before[0].apply(z, [ z, z, C, true ])
		}
		if (C.after.length > 1) {
			C.after[1].apply(z, [ z, z, C, true ])
		}
		if (C.next) {
			i(C.next).bind(C.prevNextEvent, function() {
				return o(C, C.rev ? -1 : 1)
			})
		}
		if (C.prev) {
			i(C.prev).bind(C.prevNextEvent, function() {
				return o(C, C.rev ? 1 : -1)
			})
		}
		if (C.pager) {
			d(u, C)
		}
		j(C, u);
		return C
	}
	function n(q) {
		q.original = {
			before : [],
			after : []
		};
		q.original.cssBefore = i.extend( {}, q.cssBefore);
		q.original.cssAfter = i.extend( {}, q.cssAfter);
		q.original.animIn = i.extend( {}, q.animIn);
		q.original.animOut = i.extend( {}, q.animOut);
		i.each(q.before, function() {
			q.original.before.push(this)
		});
		i.each(q.after, function() {
			q.original.after.push(this)
		})
	}
	function c(w) {
		var u, s, r = i.fn.cycle.transitions;
		if (w.fx.indexOf(",") > 0) {
			w.multiFx = true;
			w.fxs = w.fx.replace(/\s*/g, "").split(",");
			for (u = 0; u < w.fxs.length; u++) {
				var v = w.fxs[u];
				s = r[v];
				if (!s || !r.hasOwnProperty(v) || !i.isFunction(s)) {
					f("discarding unknown transition: ", v);
					w.fxs.splice(u, 1);
					u--
				}
			}
			if (!w.fxs.length) {
				f("No valid transitions named; slideshow terminating.");
				return false
			}
		} else {
			if (w.fx == "all") {
				w.multiFx = true;
				w.fxs = [];
				for (p in r) {
					s = r[p];
					if (r.hasOwnProperty(p) && i.isFunction(s)) {
						w.fxs.push(p)
					}
				}
			}
		}
		if (w.multiFx && w.randomizeEffects) {
			var t = Math.floor(Math.random() * 20) + 30;
			for (u = 0; u < t; u++) {
				var q = Math.floor(Math.random() * w.fxs.length);
				w.fxs.push(w.fxs.splice(q, 1)[0])
			}
			a("randomized fx sequence: ", w.fxs)
		}
		return true
	}
	function j(r, q) {
		r.addSlide = function(u, v) {
			var t = i(u), w = t[0];
			if (!r.autostopCount) {
				r.countdown++
			}
			q[v ? "unshift" : "push"](w);
			if (r.els) {
				r.els[v ? "unshift" : "push"](w)
			}
			r.slideCount = q.length;
			t.css("position", "absolute");
			t[v ? "prependTo" : "appendTo"](r.$cont);
			if (v) {
				r.currSlide++;
				r.nextSlide++
			}
			if (!i.support.opacity && r.cleartype && !r.cleartypeNoBg) {
				g(t)
			}
			if (r.fit && r.width) {
				t.width(r.width)
			}
			if (r.fit && r.height && r.height != "auto") {
				$slides.height(r.height)
			}
			w.cycleH = (r.fit && r.height) ? r.height : t.height();
			w.cycleW = (r.fit && r.width) ? r.width : t.width();
			t.css(r.cssBefore);
			if (r.pager) {
				i.fn.cycle.createPagerAnchor(q.length - 1, w, i(r.pager), q, r)
			}
			if (i.isFunction(r.onAddSlide)) {
				r.onAddSlide(t)
			} else {
				t.hide()
			}
		}
	}
	i.fn.cycle.resetState = function(r, q) {
		q = q || r.fx;
		r.before = [];
		r.after = [];
		r.cssBefore = i.extend( {}, r.original.cssBefore);
		r.cssAfter = i.extend( {}, r.original.cssAfter);
		r.animIn = i.extend( {}, r.original.animIn);
		r.animOut = i.extend( {}, r.original.animOut);
		r.fxFn = null;
		i.each(r.original.before, function() {
			r.before.push(this)
		});
		i.each(r.original.after, function() {
			r.after.push(this)
		});
		var s = i.fn.cycle.transitions[q];
		if (i.isFunction(s)) {
			s(r.$cont, i(r.elements), r)
		}
	};
	function e(x, q, w, y) {
		if (w && q.busy && q.manualTrump) {
			i(x).stop(true, true);
			q.busy = false
		}
		if (q.busy) {
			return
		}
		var u = q.$cont[0], A = x[q.currSlide], z = x[q.nextSlide];
		if (u.cycleStop != q.stopCount || u.cycleTimeout === 0 && !w) {
			return
		}
		if (!w
				&& !u.cyclePause
				&& ((q.autostop && (--q.countdown <= 0)) || (q.nowrap
						&& !q.random && q.nextSlide < q.currSlide))) {
			if (q.end) {
				q.end(q)
			}
			return
		}
		if (w || !u.cyclePause) {
			var v = q.fx;
			A.cycleH = A.cycleH || i(A).height();
			A.cycleW = A.cycleW || i(A).width();
			z.cycleH = z.cycleH || i(z).height();
			z.cycleW = z.cycleW || i(z).width();
			if (q.multiFx) {
				if (q.lastFx == undefined || ++q.lastFx >= q.fxs.length) {
					q.lastFx = 0
				}
				v = q.fxs[q.lastFx];
				q.currFx = v
			}
			if (q.oneTimeFx) {
				v = q.oneTimeFx;
				q.oneTimeFx = null
			}
			i.fn.cycle.resetState(q, v);
			if (q.before.length) {
				i.each(q.before, function(B, C) {
					if (u.cycleStop != q.stopCount) {
						return
					}
					C.apply(z, [ A, z, q, y ])
				})
			}
			var s = function() {
				i.each(q.after, function(B, C) {
					if (u.cycleStop != q.stopCount) {
						return
					}
					C.apply(z, [ A, z, q, y ])
				})
			};
			if (q.nextSlide != q.currSlide) {
				q.busy = 1;
				if (q.fxFn) {
					q.fxFn(A, z, q, s, y)
				} else {
					if (i.isFunction(i.fn.cycle[q.fx])) {
						i.fn.cycle[q.fx](A, z, q, s)
					} else {
						i.fn.cycle.custom(A, z, q, s, w && q.fastOnEvent)
					}
				}
			}
			q.lastSlide = q.currSlide;
			if (q.random) {
				q.currSlide = q.nextSlide;
				if (++q.randomIndex == x.length) {
					q.randomIndex = 0
				}
				q.nextSlide = q.randomMap[q.randomIndex]
			} else {
				var t = (q.nextSlide + 1) == x.length;
				q.nextSlide = t ? 0 : q.nextSlide + 1;
				q.currSlide = t ? x.length - 1 : q.nextSlide - 1
			}
			if (q.pager) {
				i.fn.cycle.updateActivePagerLink(q.pager, q.currSlide)
			}
		}
		var r = 0;
		if (q.timeout && !q.continuous) {
			r = h(A, z, q, y)
		} else {
			if (q.continuous && u.cyclePause) {
				r = 10
			}
		}
		if (r > 0) {
			u.cycleTimeout = setTimeout(function() {
				e(x, q, 0, !q.rev)
			}, r)
		}
	}
	i.fn.cycle.updateActivePagerLink = function(q, r) {
		i(q).each(
				function() {
					i(this).find("a").removeClass("activeSlide").filter(
							"a:eq(" + r + ")").addClass("activeSlide")
				})
	};
	function h(v, s, u, r) {
		if (u.timeoutFn) {
			var q = u.timeoutFn(v, s, u, r);
			while ((q - u.speed) < 250) {
				q += u.speed
			}
			a("calculated timeout: " + q + "; speed: " + u.speed);
			if (q !== false) {
				return q
			}
		}
		return u.timeout
	}
	i.fn.cycle.next = function(q) {
		o(q, q.rev ? -1 : 1)
	};
	i.fn.cycle.prev = function(q) {
		o(q, q.rev ? 1 : -1)
	};
	function o(r, u) {
		var q = r.elements;
		var t = r.$cont[0], s = t.cycleTimeout;
		if (s) {
			clearTimeout(s);
			t.cycleTimeout = 0
		}
		if (r.random && u < 0) {
			r.randomIndex--;
			if (--r.randomIndex == -2) {
				r.randomIndex = q.length - 2
			} else {
				if (r.randomIndex == -1) {
					r.randomIndex = q.length - 1
				}
			}
			r.nextSlide = r.randomMap[r.randomIndex]
		} else {
			if (r.random) {
				if (++r.randomIndex == q.length) {
					r.randomIndex = 0
				}
				r.nextSlide = r.randomMap[r.randomIndex]
			} else {
				r.nextSlide = r.currSlide + u;
				if (r.nextSlide < 0) {
					if (r.nowrap) {
						return false
					}
					r.nextSlide = q.length - 1
				} else {
					if (r.nextSlide >= q.length) {
						if (r.nowrap) {
							return false
						}
						r.nextSlide = 0
					}
				}
			}
		}
		if (i.isFunction(r.prevNextClick)) {
			r.prevNextClick(u > 0, r.nextSlide, q[r.nextSlide])
		}
		e(q, r, 1, u >= 0);
		return false
	}
	function d(r, s) {
		var q = i(s.pager);
		i.each(r, function(t, u) {
			i.fn.cycle.createPagerAnchor(t, u, q, r, s)
		});
		i.fn.cycle.updateActivePagerLink(s.pager, s.startingSlide)
	}
	i.fn.cycle.createPagerAnchor = function(u, v, s, t, w) {
		var r;
		if (i.isFunction(w.pagerAnchorBuilder)) {
			r = w.pagerAnchorBuilder(u, v)
		} else {
			r = '<a href="#">' + (u + 1) + "</a>"
		}
		if (!r) {
			return
		}
		var x = i(r);
		if (x.parents("body").length === 0) {
			var q = [];
			if (s.length > 1) {
				s.each(function() {
					var y = x.clone(true);
					i(this).append(y);
					q.push(y[0])
				});
				x = i(q)
			} else {
				x.appendTo(s)
			}
		}
		x.bind(w.pagerEvent, function(A) {
			A.preventDefault();
			w.nextSlide = u;
			var z = w.$cont[0], y = z.cycleTimeout;
			if (y) {
				clearTimeout(y);
				z.cycleTimeout = 0
			}
			if (i.isFunction(w.pagerClick)) {
				w.pagerClick(w.nextSlide, t[w.nextSlide])
			}
			e(t, w, 1, w.currSlide < u);
			return false
		});
		if (w.pagerEvent != "click") {
			x.click(function() {
				return false
			})
		}
		if (w.pauseOnPagerHover) {
			x.hover(function() {
				w.$cont[0].cyclePause++
			}, function() {
				w.$cont[0].cyclePause--
			})
		}
	};
	i.fn.cycle.hopsFromLast = function(t, s) {
		var r, q = t.lastSlide, u = t.currSlide;
		if (s) {
			r = u > q ? u - q : t.slideCount - q
		} else {
			r = u < q ? q - u : q + t.slideCount - u
		}
		return r
	};
	function g(s) {
		function r(t) {
			t = parseInt(t).toString(16);
			return t.length < 2 ? "0" + t : t
		}
		function q(w) {
			for (; w && w.nodeName.toLowerCase() != "html"; w = w.parentNode) {
				var t = i.css(w, "background-color");
				if (t.indexOf("rgb") >= 0) {
					var u = t.match(/\d+/g);
					return "#" + r(u[0]) + r(u[1]) + r(u[2])
				}
				if (t && t != "transparent") {
					return t
				}
			}
			return "#ffffff"
		}
		s.each(function() {
			i(this).css("background-color", q(this))
		})
	}
	i.fn.cycle.commonReset = function(v, t, u, r, s, q) {
		i(u.elements).not(v).hide();
		u.cssBefore.opacity = 1;
		u.cssBefore.display = "block";
		if (r !== false && t.cycleW > 0) {
			u.cssBefore.width = t.cycleW
		}
		if (s !== false && t.cycleH > 0) {
			u.cssBefore.height = t.cycleH
		}
		u.cssAfter = u.cssAfter || {};
		u.cssAfter.display = "none";
		i(v).css("zIndex", u.slideCount + (q === true ? 1 : 0));
		i(t).css("zIndex", u.slideCount + (q === true ? 0 : 1))
	};
	i.fn.cycle.custom = function(B, v, q, s, r) {
		var A = i(B), w = i(v);
		var t = q.speedIn, z = q.speedOut, u = q.easeIn, y = q.easeOut;
		w.css(q.cssBefore);
		if (r) {
			if (typeof r == "number") {
				t = z = r
			} else {
				t = z = 1
			}
			u = y = null
		}
		var x = function() {
			w.animate(q.animIn, t, u, s)
		};
		A.animate(q.animOut, z, y, function() {
			if (q.cssAfter) {
				A.css(q.cssAfter)
			}
			if (!q.sync) {
				x()
			}
		});
		if (q.sync) {
			x()
		}
	};
	i.fn.cycle.transitions = {
		fade : function(r, s, q) {
			s.not(":eq(" + q.currSlide + ")").css("opacity", 0);
			q.before.push(function(v, t, u) {
				i.fn.cycle.commonReset(v, t, u);
				u.cssBefore.opacity = 0
			});
			q.animIn = {
				opacity : 1
			};
			q.animOut = {
				opacity : 0
			};
			q.cssBefore = {
				top : 0,
				left : 0
			}
		}
	};
	i.fn.cycle.ver = function() {
		return l
	};
	i.fn.cycle.defaults = {
		fx : "fade",
		timeout : 4000,
		timeoutFn : null,
		continuous : 0,
		speed : 1000,
		speedIn : null,
		speedOut : null,
		next : null,
		prev : null,
		prevNextClick : null,
		prevNextEvent : "click",
		pager : null,
		pagerClick : null,
		pagerEvent : "click",
		pagerAnchorBuilder : null,
		before : null,
		after : null,
		end : null,
		easing : null,
		easeIn : null,
		easeOut : null,
		shuffle : null,
		animIn : null,
		animOut : null,
		cssBefore : null,
		cssAfter : null,
		fxFn : null,
		height : "auto",
		startingSlide : 0,
		sync : 1,
		random : 0,
		fit : 0,
		containerResize : 1,
		pause : 0,
		pauseOnPagerHover : 0,
		autostop : 0,
		autostopCount : 0,
		delay : 0,
		slideExpr : null,
		cleartype : !i.support.opacity,
		cleartypeNoBg : false,
		nowrap : 0,
		fastOnEvent : 0,
		randomizeEffects : 1,
		rev : 0,
		manualTrump : true,
		requeueOnImageNotLoaded : true,
		requeueTimeout : 250
	}
})(jQuery);
/*
 * jQuery Cycle Plugin Transition Definitions This script is a plugin for the
 * jQuery Cycle Plugin Examples and documentation at:
 * http://malsup.com/jquery/cycle/ Copyright (c) 2007-2008 M. Alsup Version:
 * 2.72 Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function(a) {
	a.fn.cycle.transitions.none = function(c, d, b) {
		b.fxFn = function(g, e, f, h) {
			a(e).show();
			a(g).hide();
			h()
		}
	};
	a.fn.cycle.transitions.scrollUp = function(d, e, c) {
		d.css("overflow", "hidden");
		c.before.push(a.fn.cycle.commonReset);
		var b = d.height();
		c.cssBefore = {
			top : b,
			left : 0
		};
		c.cssFirst = {
			top : 0
		};
		c.animIn = {
			top : 0
		};
		c.animOut = {
			top : -b
		}
	};
	a.fn.cycle.transitions.scrollDown = function(d, e, c) {
		d.css("overflow", "hidden");
		c.before.push(a.fn.cycle.commonReset);
		var b = d.height();
		c.cssFirst = {
			top : 0
		};
		c.cssBefore = {
			top : -b,
			left : 0
		};
		c.animIn = {
			top : 0
		};
		c.animOut = {
			top : b
		}
	};
	a.fn.cycle.transitions.scrollLeft = function(d, e, c) {
		d.css("overflow", "hidden");
		c.before.push(a.fn.cycle.commonReset);
		var b = d.width();
		c.cssFirst = {
			left : 0
		};
		c.cssBefore = {
			left : b,
			top : 0
		};
		c.animIn = {
			left : 0
		};
		c.animOut = {
			left : 0 - b
		}
	};
	a.fn.cycle.transitions.scrollRight = function(d, e, c) {
		d.css("overflow", "hidden");
		c.before.push(a.fn.cycle.commonReset);
		var b = d.width();
		c.cssFirst = {
			left : 0
		};
		c.cssBefore = {
			left : -b,
			top : 0
		};
		c.animIn = {
			left : 0
		};
		c.animOut = {
			left : b
		}
	};
	a.fn.cycle.transitions.scrollHorz = function(c, d, b) {
		c.css("overflow", "hidden").width();
		b.before.push(function(h, f, g, e) {
			a.fn.cycle.commonReset(h, f, g);
			g.cssBefore.left = e ? (f.cycleW - 1) : (1 - f.cycleW);
			g.animOut.left = e ? -h.cycleW : h.cycleW
		});
		b.cssFirst = {
			left : 0
		};
		b.cssBefore = {
			top : 0
		};
		b.animIn = {
			left : 0
		};
		b.animOut = {
			top : 0
		}
	};
	a.fn.cycle.transitions.scrollVert = function(c, d, b) {
		c.css("overflow", "hidden");
		b.before.push(function(h, f, g, e) {
			a.fn.cycle.commonReset(h, f, g);
			g.cssBefore.top = e ? (1 - f.cycleH) : (f.cycleH - 1);
			g.animOut.top = e ? h.cycleH : -h.cycleH
		});
		b.cssFirst = {
			top : 0
		};
		b.cssBefore = {
			left : 0
		};
		b.animIn = {
			top : 0
		};
		b.animOut = {
			left : 0
		}
	};
	a.fn.cycle.transitions.slideX = function(c, d, b) {
		b.before.push(function(g, e, f) {
			a(f.elements).not(g).hide();
			a.fn.cycle.commonReset(g, e, f, false, true);
			f.animIn.width = e.cycleW
		});
		b.cssBefore = {
			left : 0,
			top : 0,
			width : 0
		};
		b.animIn = {
			width : "show"
		};
		b.animOut = {
			width : 0
		}
	};
	a.fn.cycle.transitions.slideY = function(c, d, b) {
		b.before.push(function(g, e, f) {
			a(f.elements).not(g).hide();
			a.fn.cycle.commonReset(g, e, f, true, false);
			f.animIn.height = e.cycleH
		});
		b.cssBefore = {
			left : 0,
			top : 0,
			height : 0
		};
		b.animIn = {
			height : "show"
		};
		b.animOut = {
			height : 0
		}
	};
	a.fn.cycle.transitions.shuffle = function(e, f, d) {
		var c, b = e.css("overflow", "visible").width();
		f.css( {
			left : 0,
			top : 0
		});
		d.before.push(function(i, g, h) {
			a.fn.cycle.commonReset(i, g, h, true, true, true)
		});
		if (!d.speedAdjusted) {
			d.speed = d.speed / 2;
			d.speedAdjusted = true
		}
		d.random = 0;
		d.shuffle = d.shuffle || {
			left : -b,
			top : 15
		};
		d.els = [];
		for (c = 0; c < f.length; c++) {
			d.els.push(f[c])
		}
		for (c = 0; c < d.currSlide; c++) {
			d.els.push(d.els.shift())
		}
		d.fxFn = function(m, j, l, g, i) {
			var h = i ? a(m) : a(j);
			a(j).css(l.cssBefore);
			var k = l.slideCount;
			h.animate(l.shuffle, l.speedIn, l.easeIn, function() {
				var o = a.fn.cycle.hopsFromLast(l, i);
				for ( var q = 0; q < o; q++) {
					i ? l.els.push(l.els.shift()) : l.els.unshift(l.els.pop())
				}
				if (i) {
					for ( var r = 0, n = l.els.length; r < n; r++) {
						a(l.els[r]).css("z-index", n - r + k)
					}
				} else {
					var s = a(m).css("z-index");
					h.css("z-index", parseInt(s) + 1 + k)
				}
				h.animate( {
					left : 0,
					top : 0
				}, l.speedOut, l.easeOut, function() {
					a(i ? this : m).hide();
					if (g) {
						g()
					}
				})
			})
		};
		d.cssBefore = {
			display : "block",
			opacity : 1,
			top : 0,
			left : 0
		}
	};
	a.fn.cycle.transitions.turnUp = function(c, d, b) {
		b.before.push(function(g, e, f) {
			a.fn.cycle.commonReset(g, e, f, true, false);
			f.cssBefore.top = e.cycleH;
			f.animIn.height = e.cycleH
		});
		b.cssFirst = {
			top : 0
		};
		b.cssBefore = {
			left : 0,
			height : 0
		};
		b.animIn = {
			top : 0
		};
		b.animOut = {
			height : 0
		}
	};
	a.fn.cycle.transitions.turnDown = function(c, d, b) {
		b.before.push(function(g, e, f) {
			a.fn.cycle.commonReset(g, e, f, true, false);
			f.animIn.height = e.cycleH;
			f.animOut.top = g.cycleH
		});
		b.cssFirst = {
			top : 0
		};
		b.cssBefore = {
			left : 0,
			top : 0,
			height : 0
		};
		b.animOut = {
			height : 0
		}
	};
	a.fn.cycle.transitions.turnLeft = function(c, d, b) {
		b.before.push(function(g, e, f) {
			a.fn.cycle.commonReset(g, e, f, false, true);
			f.cssBefore.left = e.cycleW;
			f.animIn.width = e.cycleW
		});
		b.cssBefore = {
			top : 0,
			width : 0
		};
		b.animIn = {
			left : 0
		};
		b.animOut = {
			width : 0
		}
	};
	a.fn.cycle.transitions.turnRight = function(c, d, b) {
		b.before.push(function(g, e, f) {
			a.fn.cycle.commonReset(g, e, f, false, true);
			f.animIn.width = e.cycleW;
			f.animOut.left = g.cycleW
		});
		b.cssBefore = {
			top : 0,
			left : 0,
			width : 0
		};
		b.animIn = {
			left : 0
		};
		b.animOut = {
			width : 0
		}
	};
	a.fn.cycle.transitions.zoom = function(c, d, b) {
		b.before.push(function(g, e, f) {
			a.fn.cycle.commonReset(g, e, f, false, false, true);
			f.cssBefore.top = e.cycleH / 2;
			f.cssBefore.left = e.cycleW / 2;
			f.animIn = {
				top : 0,
				left : 0,
				width : e.cycleW,
				height : e.cycleH
			};
			f.animOut = {
				width : 0,
				height : 0,
				top : g.cycleH / 2,
				left : g.cycleW / 2
			}
		});
		b.cssFirst = {
			top : 0,
			left : 0
		};
		b.cssBefore = {
			width : 0,
			height : 0
		}
	};
	a.fn.cycle.transitions.fadeZoom = function(c, d, b) {
		b.before.push(function(g, e, f) {
			a.fn.cycle.commonReset(g, e, f, false, false);
			f.cssBefore.left = e.cycleW / 2;
			f.cssBefore.top = e.cycleH / 2;
			f.animIn = {
				top : 0,
				left : 0,
				width : e.cycleW,
				height : e.cycleH
			}
		});
		b.cssBefore = {
			width : 0,
			height : 0
		};
		b.animOut = {
			opacity : 0
		}
	};
	a.fn.cycle.transitions.blindX = function(d, e, c) {
		var b = d.css("overflow", "hidden").width();
		c.before.push(function(h, f, g) {
			a.fn.cycle.commonReset(h, f, g);
			g.animIn.width = f.cycleW;
			g.animOut.left = h.cycleW
		});
		c.cssBefore = {
			left : b,
			top : 0
		};
		c.animIn = {
			left : 0
		};
		c.animOut = {
			left : b
		}
	};
	a.fn.cycle.transitions.blindY = function(d, e, c) {
		var b = d.css("overflow", "hidden").height();
		c.before.push(function(h, f, g) {
			a.fn.cycle.commonReset(h, f, g);
			g.animIn.height = f.cycleH;
			g.animOut.top = h.cycleH
		});
		c.cssBefore = {
			top : b,
			left : 0
		};
		c.animIn = {
			top : 0
		};
		c.animOut = {
			top : b
		}
	};
	a.fn.cycle.transitions.blindZ = function(e, f, d) {
		var c = e.css("overflow", "hidden").height();
		var b = e.width();
		d.before.push(function(i, g, h) {
			a.fn.cycle.commonReset(i, g, h);
			h.animIn.height = g.cycleH;
			h.animOut.top = i.cycleH
		});
		d.cssBefore = {
			top : c,
			left : b
		};
		d.animIn = {
			top : 0,
			left : 0
		};
		d.animOut = {
			top : c,
			left : b
		}
	};
	a.fn.cycle.transitions.growX = function(c, d, b) {
		b.before.push(function(g, e, f) {
			a.fn.cycle.commonReset(g, e, f, false, true);
			f.cssBefore.left = this.cycleW / 2;
			f.animIn = {
				left : 0,
				width : this.cycleW
			};
			f.animOut = {
				left : 0
			}
		});
		b.cssBefore = {
			width : 0,
			top : 0
		}
	};
	a.fn.cycle.transitions.growY = function(c, d, b) {
		b.before.push(function(g, e, f) {
			a.fn.cycle.commonReset(g, e, f, true, false);
			f.cssBefore.top = this.cycleH / 2;
			f.animIn = {
				top : 0,
				height : this.cycleH
			};
			f.animOut = {
				top : 0
			}
		});
		b.cssBefore = {
			height : 0,
			left : 0
		}
	};
	a.fn.cycle.transitions.curtainX = function(c, d, b) {
		b.before.push(function(g, e, f) {
			a.fn.cycle.commonReset(g, e, f, false, true, true);
			f.cssBefore.left = e.cycleW / 2;
			f.animIn = {
				left : 0,
				width : this.cycleW
			};
			f.animOut = {
				left : g.cycleW / 2,
				width : 0
			}
		});
		b.cssBefore = {
			top : 0,
			width : 0
		}
	};
	a.fn.cycle.transitions.curtainY = function(c, d, b) {
		b.before.push(function(g, e, f) {
			a.fn.cycle.commonReset(g, e, f, true, false, true);
			f.cssBefore.top = e.cycleH / 2;
			f.animIn = {
				top : 0,
				height : e.cycleH
			};
			f.animOut = {
				top : g.cycleH / 2,
				height : 0
			}
		});
		b.cssBefore = {
			left : 0,
			height : 0
		}
	};
	a.fn.cycle.transitions.cover = function(f, g, e) {
		var i = e.direction || "left";
		var b = f.css("overflow", "hidden").width();
		var c = f.height();
		e.before.push(function(j, d, h) {
			a.fn.cycle.commonReset(j, d, h);
			if (i == "right") {
				h.cssBefore.left = -b
			} else {
				if (i == "up") {
					h.cssBefore.top = c
				} else {
					if (i == "down") {
						h.cssBefore.top = -c
					} else {
						h.cssBefore.left = b
					}
				}
			}
		});
		e.animIn = {
			left : 0,
			top : 0
		};
		e.animOut = {
			opacity : 1
		};
		e.cssBefore = {
			top : 0,
			left : 0
		}
	};
	a.fn.cycle.transitions.uncover = function(f, g, e) {
		var i = e.direction || "left";
		var b = f.css("overflow", "hidden").width();
		var c = f.height();
		e.before.push(function(j, d, h) {
			a.fn.cycle.commonReset(j, d, h, true, true, true);
			if (i == "right") {
				h.animOut.left = b
			} else {
				if (i == "up") {
					h.animOut.top = -c
				} else {
					if (i == "down") {
						h.animOut.top = c
					} else {
						h.animOut.left = -b
					}
				}
			}
		});
		e.animIn = {
			left : 0,
			top : 0
		};
		e.animOut = {
			opacity : 1
		};
		e.cssBefore = {
			top : 0,
			left : 0
		}
	};
	a.fn.cycle.transitions.toss = function(e, f, d) {
		var b = e.css("overflow", "visible").width();
		var c = e.height();
		d.before.push(function(i, g, h) {
			a.fn.cycle.commonReset(i, g, h, true, true, true);
			if (!h.animOut.left && !h.animOut.top) {
				h.animOut = {
					left : b * 2,
					top : -c / 2,
					opacity : 0
				}
			} else {
				h.animOut.opacity = 0
			}
		});
		d.cssBefore = {
			left : 0,
			top : 0
		};
		d.animIn = {
			left : 0
		}
	};
	a.fn.cycle.transitions.wipe = function(s, m, e) {
		var q = s.css("overflow", "hidden").width();
		var j = s.height();
		e.cssBefore = e.cssBefore || {};
		var g;
		if (e.clip) {
			if (/l2r/.test(e.clip)) {
				g = "rect(0px 0px " + j + "px 0px)"
			} else {
				if (/r2l/.test(e.clip)) {
					g = "rect(0px " + q + "px " + j + "px " + q + "px)"
				} else {
					if (/t2b/.test(e.clip)) {
						g = "rect(0px " + q + "px 0px 0px)"
					} else {
						if (/b2t/.test(e.clip)) {
							g = "rect(" + j + "px " + q + "px " + j + "px 0px)"
						} else {
							if (/zoom/.test(e.clip)) {
								var o = parseInt(j / 2);
								var f = parseInt(q / 2);
								g = "rect(" + o + "px " + f + "px " + o + "px "
										+ f + "px)"
							}
						}
					}
				}
			}
		}
		e.cssBefore.clip = e.cssBefore.clip || g || "rect(0px 0px 0px 0px)";
		var k = e.cssBefore.clip.match(/(\d+)/g);
		var u = parseInt(k[0]), c = parseInt(k[1]), n = parseInt(k[2]), i = parseInt(k[3]);
		e.before.push(function(w, h, t) {
			if (w == h) {
				return
			}
			var d = a(w), b = a(h);
			a.fn.cycle.commonReset(w, h, t, true, true, false);
			t.cssAfter.display = "block";
			var r = 1, l = parseInt((t.speedIn / 13)) - 1;
			(function v() {
				var y = u ? u - parseInt(r * (u / l)) : 0;
				var z = i ? i - parseInt(r * (i / l)) : 0;
				var A = n < j ? n + parseInt(r * ((j - n) / l || 1)) : j;
				var x = c < q ? c + parseInt(r * ((q - c) / l || 1)) : q;
				b.css( {
					clip : "rect(" + y + "px " + x + "px " + A + "px " + z
							+ "px)"
				});
				(r++ <= l) ? setTimeout(v, 13) : d.css("display", "none")
			})()
		});
		e.cssBefore = {
			display : "block",
			opacity : 1,
			top : 0,
			left : 0
		};
		e.animIn = {
			left : 0
		};
		e.animOut = {
			left : 0
		}
	}
})(jQuery);


$(document).ready(
		function() {
			if($('.mq-news') != null)
				$('.mq-news').cycle( {
					fx : 'scrollUp',
					pause : 1
				});
			(function() {
				var _currentItem = 0
				var _totalItem = $('.idx-special-selling .items ul') == null ? 0 : $('.idx-special-selling .items ul').length - 1;
				var changeItem = function(r) {
					if (r < 0 || r > _totalItem) {
						return false;
					}
					if($('.idx-special-selling .nav a.dot') != null)
						$('.idx-special-selling .nav a.dot').removeClass('active').eq(r).addClass('active');
					if($('.idx-special-selling .items ul') != null)
						$('.idx-special-selling .items ul').hide().eq(r).show();
					_currentItem = r;
				}
				var prev = function() {
					0 == _currentItem ? changeItem(_totalItem) : changeItem(_currentItem - 1);
				}
				var next = function() {
					_totalItem == _currentItem ? changeItem(0) : changeItem(_currentItem + 1);
				}
				var html = '';
				
				var resetHeight = false;
				var itemNumTmp = _totalItem+1;
				
				for ( var i = 0,j = 1; i <= _totalItem; i++,j++) {
					
					/* 目前限制最多27個item,不需使用此判斷
					//for Special Selling item 的版面換行使用,初始<P> TAG.
					if(j == 1){
						html += '<P>';
					}
					*/
					
					html += '<a class="dot"></a>';
					
					/* 目前限制最多27個item,不需使用此判斷
					//item換行,超過一行以上且為最後一行,item加入sytle高度屬性
					if(j == parseFloat(itemNumTmp/27).toFixed(0)*27){
						if(lang == 'ar'){
							html += '</P><P style="height: 32px;">';
						}else{
							html += '</P><P style="padding-left: 1px; height: 32px;">';
						}
						resetHeight = true;
					//一行以上的item最末端結尾
					}else if(resetHeight && itemNumTmp == j){
						html += '</P>';
					//item換行,超過一行以上且不為最後一行
					}else if(j > 1 && j%27 == 0 && itemNumTmp > 27){
						if(lang == 'ar'){
							html += '</P><P>';
						}else{
							html += '</P><P style="padding-left: 1px;">';
						}
					//只有一行的item最末端結尾
					}else if(itemNumTmp == 27){
						html += '</P>';
					}
					*/
				}
				html += '<div class="btn"><a class="prev"></a><a class="next"></a></div>';
				if($('.idx-special-selling .nav') != null)
					$('.idx-special-selling .nav').html(html);
				if($('.idx-special-selling .nav a.dot') != null)
					$('.idx-special-selling .nav a.dot').click(
						function() {
							changeItem($('.idx-special-selling .nav a.dot').index(this));
					});
					if($('.idx-special-selling .nav .btn') != null)
						$('.idx-special-selling .nav .btn').find('.prev').click(function() {
							prev();
						}).end().find('.next').click(function() {next();
					});
					changeItem(0);

					//items輪播設定
					var clearId = '';
					var reSetInterval = function() {
						clearId = setInterval(function(){
							var changeId = _totalItem == _currentItem ? 0 : _currentItem + 1;
							changeItem(changeId);
						}, 15000
						);
					}

					//輪播暫停:滑鼠移至圖片及CATALOG_NAME
					$('.idx-special-selling .items a').mouseover(function() {
						clearInterval(clearId);
					});
					//恢復輪播:滑鼠離開圖片及CATALOG_NAME
					$('.idx-special-selling .items a').mouseout(function() {
						reSetInterval();
					});
					//輪播暫停:滑鼠移至item上一個及下一個按鈕
					$('.idx-special-selling .nav .btn').mouseover(function() {
						clearInterval(clearId);
					});
					//輪播暫停:滑鼠離開item上一個及下一個按鈕
					$('.idx-special-selling .nav .btn').mouseout(function() {
						reSetInterval();
					});
					//輪播暫停:滑鼠移至item選擇點
					$('.idx-special-selling .nav a.dot').mouseover(function() {
						clearInterval(clearId);
					});
					//輪播暫停:滑鼠離開item選擇點
					$('.idx-special-selling .nav a.dot').mouseout(function() {
						reSetInterval();
					});

					//開始輪播
					reSetInterval();
			})();
		});

/* idTabs */

/* bgiframe Version 2.1.1 */
eval(function(p, a, c, k, e, r) {
	e = function(c) {
		return (c < a ? '' : e(parseInt(c / a)))
				+ ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c
						.toString(36))
	};
	if (!''.replace(/^/, String)) {
		while (c--)
			r[e(c)] = k[c] || e(c);
		k = [ function(e) {
			return r[e]
		} ];
		e = function() {
			return '\\w+'
		};
		c = 1
	}
	;
	while (c--)
		if (k[c])
			p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
	return p
}
		(
				'(b($){$.m.E=$.m.g=b(s){h($.x.10&&/6.0/.I(D.B)){s=$.w({c:\'3\',5:\'3\',8:\'3\',d:\'3\',k:M,e:\'F:i;\'},s||{});C a=b(n){f n&&n.t==r?n+\'4\':n},p=\'<o Y="g"W="0"R="-1"e="\'+s.e+\'"\'+\'Q="P:O;N:L;z-H:-1;\'+(s.k!==i?\'G:J(K=\\\'0\\\');\':\'\')+\'c:\'+(s.c==\'3\'?\'7(((l(2.9.j.A)||0)*-1)+\\\'4\\\')\':a(s.c))+\';\'+\'5:\'+(s.5==\'3\'?\'7(((l(2.9.j.y)||0)*-1)+\\\'4\\\')\':a(s.5))+\';\'+\'8:\'+(s.8==\'3\'?\'7(2.9.S+\\\'4\\\')\':a(s.8))+\';\'+\'d:\'+(s.d==\'3\'?\'7(2.9.v+\\\'4\\\')\':a(s.d))+\';\'+\'"/>\';f 2.T(b(){h($(\'> o.g\',2).U==0)2.V(q.X(p),2.u)})}f 2}})(Z);',
				62,
				63,
				'||this|auto|px|left||expression|width|parentNode||function|top|height|src|return|bgiframe|if|false|currentStyle|opacity|parseInt|fn||iframe|html|document|Number||constructor|firstChild|offsetHeight|extend|browser|borderLeftWidth||borderTopWidth|userAgent|var|navigator|bgIframe|javascript|filter|index|test|Alpha|Opacity|absolute|true|position|block|display|style|tabindex|offsetWidth|each|length|insertBefore|frameborder|createElement|class|jQuery|msie'
						.split('|'), 0, {}))

$(document).ready(function() {
	if($(".idx-categories-nav li ul") != null)
		$(".idx-categories-nav li ul").bgiframe();
});
$(document).ready(function() {

	/* languages menu--- */
	if($(".lang-drop") != null)
		$(".lang-drop").hover(function() {
			$(this).addClass("lang-drop-open");
		}, function() {
			$(this).removeClass("lang-drop-open");
		});

	/* categores menu--- */
	if($(".idx-categories-nav li") != null)
		$(".idx-categories-nav li").hover(function() {
			$(this).addClass("hover");
		}, function() {
			$(this).removeClass("hover");
		});
	/* idx-news-list li hover--- */
	if($(".ul-normal li") != null)
		$(".ul-normal li").hover(function() {
			$(this).addClass("hover");
		}, function() {
			$(this).removeClass("hover");
		});

});
/*
 * jQuery UI Datepicker 1.7.2
 * 
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) Dual licensed
 * under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
 * 
 * http://docs.jquery.com/UI/Datepicker
 * 
 * Depends: ui.core.js
 */

(function($) { // hide the namespace

	$.extend($.ui, {
		datepicker : {
			version : "1.7.2"
		}
	});

	var PROP_NAME = 'datepicker';

	/*
	 * Date picker manager. Use the singleton instance of this class,
	 * $.datepicker, to interact with the date picker. Settings for (groups of)
	 * date pickers are maintained in an instance object, allowing multiple
	 * different settings on the same page.
	 */

	function Datepicker() {
		this.debug = false; // Change this to true to start debugging
		this._curInst = null; // The current instance in use
		this._keyEvent = false; // If the last event was a key event
		this._disabledInputs = []; // List of date picker inputs that have been
									// disabled
		this._datepickerShowing = false; // True if the popup picker is
											// showing , false if not
		this._inDialog = false; // True if showing within a "dialog", false if
								// not
		this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker
												// division
		this._inlineClass = 'ui-datepicker-inline'; // The name of the inline
													// marker class
		this._appendClass = 'ui-datepicker-append'; // The name of the append
													// marker class
		this._triggerClass = 'ui-datepicker-trigger'; // The name of the
														// trigger marker class
		this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog
													// marker class
		this._disableClass = 'ui-datepicker-disabled'; // The name of the
														// disabled covering
														// marker class
		this._unselectableClass = 'ui-datepicker-unselectable'; // The name of
																// the
																// unselectable
																// cell marker
																// class
		this._currentClass = 'ui-datepicker-current-day'; // The name of the
															// current day
															// marker class
		this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of
																// the day hover
																// marker class
		this.regional = []; // Available regional settings, indexed by language
							// code
		this.regional[''] = { // Default regional settings
			closeText : 'Done', // Display text for close link
			prevText : 'Prev', // Display text for previous month link
			nextText : 'Next', // Display text for next month link
			currentText : 'Today', // Display text for current month link
			monthNames : [ 'January', 'February', 'March', 'April', 'May',
					'June', 'July', 'August', 'September', 'October',
					'November', 'December' ], // Names of months for drop-down
												// and formatting
			monthNamesShort : [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
					'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ], // For
																// formatting
			dayNames : [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday',
					'Thursday', 'Friday', 'Saturday' ], // For formatting
			dayNamesShort : [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ], // For
																					// formatting
			dayNamesMin : [ 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa' ], // Column
																		// headings
																		// for
																		// days
																		// starting
																		// at
																		// Sunday
			dateFormat : 'mm/dd/yy', // See format options on parseDate
			firstDay : 0, // The first day of the week, Sun = 0, Mon = 1, ...
			isRTL : false
		// True if right-to-left language, false if left-to-right
		};
		this._defaults = { // Global defaults for all the date picker instances
			showOn : 'focus', // 'focus' for popup on focus,
			// 'button' for trigger button, or 'both' for either
			showAnim : 'show', // Name of jQuery animation for popup
			showOptions : {}, // Options for enhanced animations
			defaultDate : null, // Used when field is blank: actual date,
			// +/-number for offset from today, null for today
			appendText : '', // Display text following the input box, e.g.
								// showing the format
			buttonText : '...', // Text for trigger button
			buttonImage : '', // URL for trigger button image
			buttonImageOnly : false, // True if the image appears alone,
										// false if it appears on a button
			hideIfNoPrevNext : false, // True to hide next/previous month
										// links
			// if not applicable, false to just disable them
			navigationAsDateFormat : false, // True if date formatting applied
											// to prev/today/next links
			gotoCurrent : false, // True if today link goes back to current
									// selection instead
			changeMonth : false, // True if month can be selected directly,
									// false if only prev/next
			changeYear : false, // True if year can be selected directly, false
								// if only prev/next
			showMonthAfterYear : false, // True if the year select precedes
										// month, false for month then year
			yearRange : '-10:+10', // Range of years to display in drop-down,
			// either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)
			showOtherMonths : false, // True to show dates in other months,
										// false to leave blank
			calculateWeek : this.iso8601Week, // How to calculate the week of
												// the year,
			// takes a Date and returns the number of the week for it
			shortYearCutoff : '+10', // Short year values < this are in the
										// current century,
			// > this are in the previous century,
			// string value starting with '+' for current year + value
			minDate : null, // The earliest selectable date, or null for no
							// limit
			maxDate : null, // The latest selectable date, or null for no limit
			duration : 'normal', // Duration of display/closure
			beforeShowDay : null, // Function that takes a date and returns an
									// array with
			// [0] = true if selectable, false if not, [1] = custom CSS class
			// name(s) or '',
			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
			beforeShow : null, // Function that takes an input field and
			// returns a set of custom settings for the date picker
			onSelect : null, // Define a callback function when a date is
								// selected
			onChangeMonthYear : null, // Define a callback function when the
										// month or year is changed
			onClose : null, // Define a callback function when the datepicker is
							// closed
			numberOfMonths : 1, // Number of months to show at a time
			showCurrentAtPos : 0, // The position in multipe months at which
									// to show the current month (starting at 0)
			stepMonths : 1, // Number of months to step back/forward
			stepBigMonths : 12, // Number of months to step back/forward for the
								// big links
			altField : '', // Selector for an alternate field to store selected
							// dates into
			altFormat : '', // The date format to use for the alternate field
			constrainInput : true, // The input is constrained by the current
									// date format
			showButtonPanel : false
		// True to show button panel, false to not show it
		};
		$.extend(this._defaults, this.regional['']);
		this.dpDiv = $('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>');
	}

	$
			.extend(
					Datepicker.prototype,
					{
						/*
						 * Class name added to elements to indicate already
						 * configured with a date picker.
						 */
						markerClassName : 'hasDatepicker',

						/* Debug logging (if enabled). */
						log : function() {
							if (this.debug)
								console.log.apply('', arguments);
						},

						/*
						 * Override the default settings for all instances of
						 * the date picker. @param settings object - the new
						 * settings to use as defaults (anonymous object)
						 * @return the manager object
						 */
						setDefaults : function(settings) {
							extendRemove(this._defaults, settings || {});
							return this;
						},

						/*
						 * Attach the date picker to a jQuery selection. @param
						 * target element - the target input field or division
						 * or span @param settings object - the new settings to
						 * use for this date picker instance (anonymous)
						 */
						_attachDatepicker : function(target, settings) {
							// check for settings on the control itself - in
							// namespace 'date:'
							var inlineSettings = null;
							for ( var attrName in this._defaults) {
								var attrValue = target
										.getAttribute('date:' + attrName);
								if (attrValue) {
									inlineSettings = inlineSettings || {};
									try {
										inlineSettings[attrName] = eval(attrValue);
									} catch (err) {
										inlineSettings[attrName] = attrValue;
									}
								}
							}
							var nodeName = target.nodeName.toLowerCase();
							var inline = (nodeName == 'div' || nodeName == 'span');
							if (!target.id)
								target.id = 'dp' + (++this.uuid);
							var inst = this._newInst($(target), inline);
							inst.settings = $.extend( {}, settings || {},
									inlineSettings || {});
							if (nodeName == 'input') {
								this._connectDatepicker(target, inst);
							} else if (inline) {
								this._inlineDatepicker(target, inst);
							}
						},

						/* Create a new instance object. */
						_newInst : function(target, inline) {
							var id = target[0].id.replace(/([:\[\]\.])/g,
									'\\\\$1'); // escape jQuery meta chars
							return {
								id : id,
								input : target, // associated target
								selectedDay : 0,
								selectedMonth : 0,
								selectedYear : 0, // current selection
								drawMonth : 0,
								drawYear : 0, // month being drawn
								inline : inline, // is datepicker inline or
													// not
								dpDiv : (!inline ? this.dpDiv : // presentation
																// div
										$('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))
							};
						},

						/* Attach the date picker to an input field. */
						_connectDatepicker : function(target, inst) {
							var input = $(target);
							inst.append = $( []);
							inst.trigger = $( []);
							if (input.hasClass(this.markerClassName))
								return;
							var appendText = this._get(inst, 'appendText');
							var isRTL = this._get(inst, 'isRTL');
							if (appendText) {
								inst.append = $('<span class="'
										+ this._appendClass + '">' + appendText
										+ '</span>');
								input[isRTL ? 'before' : 'after'](inst.append);
							}
							var showOn = this._get(inst, 'showOn');
							if (showOn == 'focus' || showOn == 'both') // pop-up
																		// date
																		// picker
																		// when
																		// in
																		// the
																		// marked
																		// field
								input.focus(this._showDatepicker);
							if (showOn == 'button' || showOn == 'both') { // pop-up
																			// date
																			// picker
																			// when
																			// button
																			// clicked
								var buttonText = this._get(inst, 'buttonText');
								var buttonImage = this
										._get(inst, 'buttonImage');
								inst.trigger = $(this._get(inst,
										'buttonImageOnly') ? $('<img/>')
										.addClass(this._triggerClass).attr( {
											src : buttonImage,
											alt : buttonText,
											title : buttonText
										}) : $(
										'<button type="button"></button>')
										.addClass(this._triggerClass).html(
												buttonImage == '' ? buttonText
														: $('<img/>').attr( {
															src : buttonImage,
															alt : buttonText,
															title : buttonText
														})));
								input[isRTL ? 'before' : 'after'](inst.trigger);
								inst.trigger
										.click(function() {
											if ($.datepicker._datepickerShowing
													&& $.datepicker._lastInput == target)
												$.datepicker._hideDatepicker();
											else
												$.datepicker
														._showDatepicker(target);
											return false;
										});
							}
							input.addClass(this.markerClassName).keydown(
									this._doKeyDown).keypress(this._doKeyPress)
									.bind("setData.datepicker",
											function(event, key, value) {
												inst.settings[key] = value;
											}).bind("getData.datepicker",
											function(event, key) {
												return this._get(inst, key);
											});
							$.data(target, PROP_NAME, inst);
						},

						/* Attach an inline date picker to a div. */
						_inlineDatepicker : function(target, inst) {
							var divSpan = $(target);
							if (divSpan.hasClass(this.markerClassName))
								return;
							divSpan.addClass(this.markerClassName).append(
									inst.dpDiv).bind("setData.datepicker",
									function(event, key, value) {
										inst.settings[key] = value;
									}).bind("getData.datepicker",
									function(event, key) {
										return this._get(inst, key);
									});
							$.data(target, PROP_NAME, inst);
							this._setDate(inst, this._getDefaultDate(inst));
							this._updateDatepicker(inst);
							this._updateAlternate(inst);
						},

						/*
						 * Pop-up the date picker in a "dialog" box. @param
						 * input element - ignored @param dateText string - the
						 * initial date to display (in the current format)
						 * @param onSelect function - the function(dateText) to
						 * call when a date is selected @param settings object -
						 * update the dialog date picker instance's settings
						 * (anonymous object) @param pos int[2] - coordinates
						 * for the dialog's position within the screen or event -
						 * with x/y coordinates or leave empty for default
						 * (screen centre) @return the manager object
						 */
						_dialogDatepicker : function(input, dateText, onSelect,
								settings, pos) {
							var inst = this._dialogInst; // internal instance
							if (!inst) {
								var id = 'dp' + (++this.uuid);
								this._dialogInput = $('<input type="text" id="' + id + '" size="1" style="position: absolute; top: -100px;"/>');
								this._dialogInput.keydown(this._doKeyDown);
								$('body').append(this._dialogInput);
								inst = this._dialogInst = this._newInst(
										this._dialogInput, false);
								inst.settings = {};
								$.data(this._dialogInput[0], PROP_NAME, inst);
							}
							extendRemove(inst.settings, settings || {});
							this._dialogInput.val(dateText);

							this._pos = (pos ? (pos.length ? pos : [ pos.pageX,
									pos.pageY ]) : null);
							if (!this._pos) {
								var browserWidth = window.innerWidth
										|| document.documentElement.clientWidth
										|| document.body.clientWidth;
								var browserHeight = window.innerHeight
										|| document.documentElement.clientHeight
										|| document.body.clientHeight;
								var scrollX = document.documentElement.scrollLeft
										|| document.body.scrollLeft;
								var scrollY = document.documentElement.scrollTop
										|| document.body.scrollTop;
								this._pos = // should use actual width/height
											// below
								[ (browserWidth / 2) - 100 + scrollX,
										(browserHeight / 2) - 150 + scrollY ];
							}

							// move input on screen for focus, but hidden behind
							// dialog
							this._dialogInput.css('left', this._pos[0] + 'px')
									.css('top', this._pos[1] + 'px');
							inst.settings.onSelect = onSelect;
							this._inDialog = true;
							this.dpDiv.addClass(this._dialogClass);
							this._showDatepicker(this._dialogInput[0]);
							if ($.blockUI)
								$.blockUI(this.dpDiv);
							$.data(this._dialogInput[0], PROP_NAME, inst);
							return this;
						},

						/*
						 * Detach a datepicker from its control. @param target
						 * element - the target input field or division or span
						 */
						_destroyDatepicker : function(target) {
							var $target = $(target);
							var inst = $.data(target, PROP_NAME);
							if (!$target.hasClass(this.markerClassName)) {
								return;
							}
							var nodeName = target.nodeName.toLowerCase();
							$.removeData(target, PROP_NAME);
							if (nodeName == 'input') {
								inst.append.remove();
								inst.trigger.remove();
								$target.removeClass(this.markerClassName)
										.unbind('focus', this._showDatepicker)
										.unbind('keydown', this._doKeyDown)
										.unbind('keypress', this._doKeyPress);
							} else if (nodeName == 'div' || nodeName == 'span')
								$target.removeClass(this.markerClassName)
										.empty();
						},

						/*
						 * Enable the date picker to a jQuery selection. @param
						 * target element - the target input field or division
						 * or span
						 */
						_enableDatepicker : function(target) {
							var $target = $(target);
							var inst = $.data(target, PROP_NAME);
							if (!$target.hasClass(this.markerClassName)) {
								return;
							}
							var nodeName = target.nodeName.toLowerCase();
							if (nodeName == 'input') {
								target.disabled = false;
								inst.trigger.filter('button').each(function() {
									this.disabled = false;
								}).end().filter('img').css( {
									opacity : '1.0',
									cursor : ''
								});
							} else if (nodeName == 'div' || nodeName == 'span') {
								var inline = $target
										.children('.' + this._inlineClass);
								inline.children().removeClass(
										'ui-state-disabled');
							}
							this._disabledInputs = $
									.map(this._disabledInputs,
											function(value) {
												return (value == target ? null
														: value);
											}); // delete entry
						},

						/*
						 * Disable the date picker to a jQuery selection. @param
						 * target element - the target input field or division
						 * or span
						 */
						_disableDatepicker : function(target) {
							var $target = $(target);
							var inst = $.data(target, PROP_NAME);
							if (!$target.hasClass(this.markerClassName)) {
								return;
							}
							var nodeName = target.nodeName.toLowerCase();
							if (nodeName == 'input') {
								target.disabled = true;
								inst.trigger.filter('button').each(function() {
									this.disabled = true;
								}).end().filter('img').css( {
									opacity : '0.5',
									cursor : 'default'
								});
							} else if (nodeName == 'div' || nodeName == 'span') {
								var inline = $target
										.children('.' + this._inlineClass);
								inline.children().addClass('ui-state-disabled');
							}
							this._disabledInputs = $
									.map(this._disabledInputs,
											function(value) {
												return (value == target ? null
														: value);
											}); // delete entry
							this._disabledInputs[this._disabledInputs.length] = target;
						},

						/*
						 * Is the first field in a jQuery collection disabled as
						 * a datepicker? @param target element - the target
						 * input field or division or span @return boolean -
						 * true if disabled, false if enabled
						 */
						_isDisabledDatepicker : function(target) {
							if (!target) {
								return false;
							}
							for ( var i = 0; i < this._disabledInputs.length; i++) {
								if (this._disabledInputs[i] == target)
									return true;
							}
							return false;
						},

						/*
						 * Retrieve the instance data for the target control.
						 * @param target element - the target input field or
						 * division or span @return object - the associated
						 * instance data @throws error if a jQuery problem
						 * getting data
						 */
						_getInst : function(target) {
							try {
								return $.data(target, PROP_NAME);
							} catch (err) {
								throw 'Missing instance data for this datepicker';
							}
						},

						/*
						 * Update or retrieve the settings for a date picker
						 * attached to an input field or division. @param target
						 * element - the target input field or division or span
						 * @param name object - the new settings to update or
						 * string - the name of the setting to change or
						 * retrieve, when retrieving also 'all' for all instance
						 * settings or 'defaults' for all global defaults @param
						 * value any - the new value for the setting (omit if
						 * above is an object or to retrieve a value)
						 */
						_optionDatepicker : function(target, name, value) {
							var inst = this._getInst(target);
							if (arguments.length == 2
									&& typeof name == 'string') {
								return (name == 'defaults' ? $.extend( {},
										$.datepicker._defaults)
										: (inst ? (name == 'all' ? $.extend(
												{}, inst.settings) : this._get(
												inst, name)) : null));
							}
							var settings = name || {};
							if (typeof name == 'string') {
								settings = {};
								settings[name] = value;
							}
							if (inst) {
								if (this._curInst == inst) {
									this._hideDatepicker(null);
								}
								var date = this._getDateDatepicker(target);
								extendRemove(inst.settings, settings);
								this._setDateDatepicker(target, date);
								this._updateDatepicker(inst);
							}
						},

						// change method deprecated
						_changeDatepicker : function(target, name, value) {
							this._optionDatepicker(target, name, value);
						},

						/*
						 * Redraw the date picker attached to an input field or
						 * division. @param target element - the target input
						 * field or division or span
						 */
						_refreshDatepicker : function(target) {
							var inst = this._getInst(target);
							if (inst) {
								this._updateDatepicker(inst);
							}
						},

						/*
						 * Set the dates for a jQuery selection. @param target
						 * element - the target input field or division or span
						 * @param date Date - the new date @param endDate Date -
						 * the new end date for a range (optional)
						 */
						_setDateDatepicker : function(target, date, endDate) {
							var inst = this._getInst(target);
							if (inst) {
								this._setDate(inst, date, endDate);
								this._updateDatepicker(inst);
								this._updateAlternate(inst);
							}
						},

						/*
						 * Get the date(s) for the first entry in a jQuery
						 * selection. @param target element - the target input
						 * field or division or span @return Date - the current
						 * date or Date[2] - the current dates for a range
						 */
						_getDateDatepicker : function(target) {
							var inst = this._getInst(target);
							if (inst && !inst.inline)
								this._setDateFromField(inst);
							return (inst ? this._getDate(inst) : null);
						},

						/* Handle keystrokes. */
						_doKeyDown : function(event) {
							var inst = $.datepicker._getInst(event.target);
							var handled = true;
							var isRTL = inst.dpDiv.is('.ui-datepicker-rtl');
							inst._keyEvent = true;
							if ($.datepicker._datepickerShowing)
								switch (event.keyCode) {
								case 9:
									$.datepicker._hideDatepicker(null, '');
									break; // hide on tab out
								case 13:
									var sel = $('td.'
											+ $.datepicker._dayOverClass
											+ ', td.'
											+ $.datepicker._currentClass,
											inst.dpDiv);
									if (sel[0])
										$.datepicker._selectDay(event.target,
												inst.selectedMonth,
												inst.selectedYear, sel[0]);
									else
										$.datepicker._hideDatepicker(null,
												$.datepicker._get(inst,
														'duration'));
									return false; // don't submit the form
									break; // select the value on enter
								case 27:
									$.datepicker
											._hideDatepicker(null, $.datepicker
													._get(inst, 'duration'));
									break; // hide on escape
								case 33:
									$.datepicker
											._adjustDate(
													event.target,
													(event.ctrlKey ? -$.datepicker
															._get(inst,
																	'stepBigMonths')
															: -$.datepicker
																	._get(inst,
																			'stepMonths')),
													'M');
									break; // previous month/year on page up/+
											// ctrl
								case 34:
									$.datepicker
											._adjustDate(
													event.target,
													(event.ctrlKey ? +$.datepicker
															._get(inst,
																	'stepBigMonths')
															: +$.datepicker
																	._get(inst,
																			'stepMonths')),
													'M');
									break; // next month/year on page down/+
											// ctrl
								case 35:
									if (event.ctrlKey || event.metaKey)
										$.datepicker._clearDate(event.target);
									handled = event.ctrlKey || event.metaKey;
									break; // clear on ctrl or command +end
								case 36:
									if (event.ctrlKey || event.metaKey)
										$.datepicker._gotoToday(event.target);
									handled = event.ctrlKey || event.metaKey;
									break; // current on ctrl or command +home
								case 37:
									if (event.ctrlKey || event.metaKey)
										$.datepicker._adjustDate(event.target,
												(isRTL ? +1 : -1), 'D');
									handled = event.ctrlKey || event.metaKey;
									// -1 day on ctrl or command +left
									if (event.originalEvent.altKey)
										$.datepicker
												._adjustDate(
														event.target,
														(event.ctrlKey ? -$.datepicker
																._get(inst,
																		'stepBigMonths')
																: -$.datepicker
																		._get(
																				inst,
																				'stepMonths')),
														'M');
									// next month/year on alt +left on Mac
									break;
								case 38:
									if (event.ctrlKey || event.metaKey)
										$.datepicker._adjustDate(event.target,
												-7, 'D');
									handled = event.ctrlKey || event.metaKey;
									break; // -1 week on ctrl or command +up
								case 39:
									if (event.ctrlKey || event.metaKey)
										$.datepicker._adjustDate(event.target,
												(isRTL ? -1 : +1), 'D');
									handled = event.ctrlKey || event.metaKey;
									// +1 day on ctrl or command +right
									if (event.originalEvent.altKey)
										$.datepicker
												._adjustDate(
														event.target,
														(event.ctrlKey ? +$.datepicker
																._get(inst,
																		'stepBigMonths')
																: +$.datepicker
																		._get(
																				inst,
																				'stepMonths')),
														'M');
									// next month/year on alt +right
									break;
								case 40:
									if (event.ctrlKey || event.metaKey)
										$.datepicker._adjustDate(event.target,
												+7, 'D');
									handled = event.ctrlKey || event.metaKey;
									break; // +1 week on ctrl or command +down
								default:
									handled = false;
								}
							else if (event.keyCode == 36 && event.ctrlKey) // display
																			// the
																			// date
																			// picker
																			// on
																			// ctrl+home
								$.datepicker._showDatepicker(this);
							else {
								handled = false;
							}
							if (handled) {
								event.preventDefault();
								event.stopPropagation();
							}
						},

						/* Filter entered characters - based on date format. */
						_doKeyPress : function(event) {
							var inst = $.datepicker._getInst(event.target);
							if ($.datepicker._get(inst, 'constrainInput')) {
								var chars = $.datepicker
										._possibleChars($.datepicker._get(inst,
												'dateFormat'));
								var chr = String
										.fromCharCode(event.charCode == undefined ? event.keyCode
												: event.charCode);
								return event.ctrlKey
										|| (chr < ' ' || !chars || chars
												.indexOf(chr) > -1);
							}
						},

						/*
						 * Pop-up the date picker for a given input field.
						 * @param input element - the input field attached to
						 * the date picker or event - if triggered by focus
						 */
						_showDatepicker : function(input) {
							input = input.target || input;
							if (input.nodeName.toLowerCase() != 'input') // find
																			// from
																			// button/image
																			// trigger
								input = $('input', input.parentNode)[0];
							if ($.datepicker._isDisabledDatepicker(input)
									|| $.datepicker._lastInput == input) // already
																			// here
								return;
							var inst = $.datepicker._getInst(input);
							var beforeShow = $.datepicker._get(inst,
									'beforeShow');
							extendRemove(inst.settings,
									(beforeShow ? beforeShow.apply(input, [
											input, inst ]) : {}));
							$.datepicker._hideDatepicker(null, '');
							$.datepicker._lastInput = input;
							$.datepicker._setDateFromField(inst);
							if ($.datepicker._inDialog) // hide cursor
								input.value = '';
							if (!$.datepicker._pos) { // position below input
								$.datepicker._pos = $.datepicker
										._findPos(input);
								$.datepicker._pos[1] += input.offsetHeight; // add
																			// the
																			// height
							}
							var isFixed = false;
							$(input).parents().each(function() {
								isFixed |= $(this).css('position') == 'fixed';
								return !isFixed;
							});
							if (isFixed && $.browser.opera) { // correction
																// for Opera
																// when fixed
																// and scrolled
								$.datepicker._pos[0] -= document.documentElement.scrollLeft;
								$.datepicker._pos[1] -= document.documentElement.scrollTop;
							}
							var offset = {
								left : $.datepicker._pos[0],
								top : $.datepicker._pos[1]
							};
							$.datepicker._pos = null;
							inst.rangeStart = null;
							// determine sizing offscreen
							inst.dpDiv.css( {
								position : 'absolute',
								display : 'block',
								top : '-1000px'
							});
							$.datepicker._updateDatepicker(inst);
							// fix width for dynamic number of date pickers
							// and adjust position before showing
							offset = $.datepicker._checkOffset(inst, offset,
									isFixed);
							inst.dpDiv
									.css( {
										position : ($.datepicker._inDialog
												&& $.blockUI ? 'static'
												: (isFixed ? 'fixed'
														: 'absolute')),
										display : 'none',
										left : offset.left + 'px',
										top : offset.top + 'px'
									});
							if (!inst.inline) {
								var showAnim = $.datepicker._get(inst,
										'showAnim') || 'show';
								var duration = $.datepicker._get(inst,
										'duration');
								var postProcess = function() {
									$.datepicker._datepickerShowing = true;
									if ($.browser.msie
											&& parseInt($.browser.version, 10) < 7) // fix
																					// IE <
																					// 7
																					// select
																					// problems
										$('iframe.ui-datepicker-cover').css( {
											width : inst.dpDiv.width() + 4,
											height : inst.dpDiv.height() + 4
										});
								};
								if ($.effects && $.effects[showAnim])
									inst.dpDiv.show(showAnim, $.datepicker
											._get(inst, 'showOptions'),
											duration, postProcess);
								else
									inst.dpDiv[showAnim](duration, postProcess);
								if (duration == '')
									postProcess();
								if (inst.input[0].type != 'hidden')
									inst.input[0].focus();
								$.datepicker._curInst = inst;
							}
						},

						/* Generate the date picker content. */
						_updateDatepicker : function(inst) {
							var dims = {
								width : inst.dpDiv.width() + 4,
								height : inst.dpDiv.height() + 4
							};
							var self = this;
							inst.dpDiv
									.empty()
									.append(this._generateHTML(inst))
									.find('iframe.ui-datepicker-cover')
									.css( {
										width : dims.width,
										height : dims.height
									})
									.end()
									.find(
											'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a')
									.bind(
											'mouseout',
											function() {
												$(this).removeClass(
														'ui-state-hover');
												if (this.className
														.indexOf('ui-datepicker-prev') != -1)
													$(this)
															.removeClass(
																	'ui-datepicker-prev-hover');
												if (this.className
														.indexOf('ui-datepicker-next') != -1)
													$(this)
															.removeClass(
																	'ui-datepicker-next-hover');
											})
									.bind(
											'mouseover',
											function() {
												if (!self
														._isDisabledDatepicker(inst.inline ? inst.dpDiv
																.parent()[0]
																: inst.input[0])) {
													$(this)
															.parents(
																	'.ui-datepicker-calendar')
															.find('a')
															.removeClass(
																	'ui-state-hover');
													$(this).addClass(
															'ui-state-hover');
													if (this.className
															.indexOf('ui-datepicker-prev') != -1)
														$(this)
																.addClass(
																		'ui-datepicker-prev-hover');
													if (this.className
															.indexOf('ui-datepicker-next') != -1)
														$(this)
																.addClass(
																		'ui-datepicker-next-hover');
												}
											}).end().find(
											'.' + this._dayOverClass + ' a')
									.trigger('mouseover').end();
							var numMonths = this._getNumberOfMonths(inst);
							var cols = numMonths[1];
							var width = 17;
							if (cols > 1) {
								inst.dpDiv.addClass(
										'ui-datepicker-multi-' + cols).css(
										'width', (width * cols) + 'em');
							} else {
								inst.dpDiv
										.removeClass(
												'ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4')
										.width('');
							}
							inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add'
									: 'remove') + 'Class']
									('ui-datepicker-multi');
							inst.dpDiv[(this._get(inst, 'isRTL') ? 'add'
									: 'remove') + 'Class']('ui-datepicker-rtl');
							if (inst.input && inst.input[0].type != 'hidden'
									&& inst == $.datepicker._curInst)
								$(inst.input[0]).focus();
						},

						/* Check positioning to remain on screen. */
						_checkOffset : function(inst, offset, isFixed) {
							var dpWidth = inst.dpDiv.outerWidth();
							var dpHeight = inst.dpDiv.outerHeight();
							var inputWidth = inst.input ? inst.input
									.outerWidth() : 0;
							var inputHeight = inst.input ? inst.input
									.outerHeight() : 0;
							var viewWidth = (window.innerWidth
									|| document.documentElement.clientWidth || document.body.clientWidth)
									+ $(document).scrollLeft();
							var viewHeight = (window.innerHeight
									|| document.documentElement.clientHeight || document.body.clientHeight)
									+ $(document).scrollTop();

							offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth)
									: 0);
							offset.left -= (isFixed && offset.left == inst.input
									.offset().left) ? $(document).scrollLeft()
									: 0;
							offset.top -= (isFixed && offset.top == (inst.input
									.offset().top + inputHeight)) ? $(document)
									.scrollTop() : 0;

							// now check if datepicker is showing outside window
							// viewport - move to a better place if so.
							offset.left -= (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math
									.abs(offset.left + dpWidth - viewWidth)
									: 0;
							offset.top -= (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math
									.abs(offset.top + dpHeight + inputHeight
											* 2 - viewHeight)
									: 0;

							return offset;
						},

						/* Find an object's position on the screen. */
						_findPos : function(obj) {
							while (obj
									&& (obj.type == 'hidden' || obj.nodeType != 1)) {
								obj = obj.nextSibling;
							}
							var position = $(obj).offset();
							return [ position.left, position.top ];
						},

						/*
						 * Hide the date picker from view. @param input element -
						 * the input field attached to the date picker @param
						 * duration string - the duration over which to close
						 * the date picker
						 */
						_hideDatepicker : function(input, duration) {
							var inst = this._curInst;
							if (!inst
									|| (input && inst != $.data(input,
											PROP_NAME)))
								return;
							if (inst.stayOpen)
								this._selectDate('#' + inst.id, this
										._formatDate(inst, inst.currentDay,
												inst.currentMonth,
												inst.currentYear));
							inst.stayOpen = false;
							if (this._datepickerShowing) {
								duration = (duration != null ? duration : this
										._get(inst, 'duration'));
								var showAnim = this._get(inst, 'showAnim');
								var postProcess = function() {
									$.datepicker._tidyDialog(inst);
								};
								if (duration != '' && $.effects
										&& $.effects[showAnim])
									inst.dpDiv.hide(showAnim, $.datepicker
											._get(inst, 'showOptions'),
											duration, postProcess);
								else
									inst.dpDiv[(duration == '' ? 'hide'
											: (showAnim == 'slideDown' ? 'slideUp'
													: (showAnim == 'fadeIn' ? 'fadeOut'
															: 'hide')))](
											duration, postProcess);
								if (duration == '')
									this._tidyDialog(inst);
								var onClose = this._get(inst, 'onClose');
								if (onClose)
									onClose
											.apply(
													(inst.input ? inst.input[0]
															: null),
													[
															(inst.input ? inst.input
																	.val()
																	: ''), inst ]); // trigger
																					// custom
																					// callback
								this._datepickerShowing = false;
								this._lastInput = null;
								if (this._inDialog) {
									this._dialogInput.css( {
										position : 'absolute',
										left : '0',
										top : '-100px'
									});
									if ($.blockUI) {
										$.unblockUI();
										$('body').append(this.dpDiv);
									}
								}
								this._inDialog = false;
							}
							this._curInst = null;
						},

						/* Tidy up after a dialog display. */
						_tidyDialog : function(inst) {
							inst.dpDiv.removeClass(this._dialogClass).unbind(
									'.ui-datepicker-calendar');
						},

						/* Close date picker if clicked elsewhere. */
						_checkExternalClick : function(event) {
							if (!$.datepicker._curInst)
								return;
							var $target = $(event.target);
							if (($target.parents('#' + $.datepicker._mainDivId).length == 0)
									&& !$target
											.hasClass($.datepicker.markerClassName)
									&& !$target
											.hasClass($.datepicker._triggerClass)
									&& $.datepicker._datepickerShowing
									&& !($.datepicker._inDialog && $.blockUI))
								$.datepicker._hideDatepicker(null, '');
						},

						/* Adjust one of the date sub-fields. */
						_adjustDate : function(id, offset, period) {
							var target = $(id);
							var inst = this._getInst(target[0]);
							if (this._isDisabledDatepicker(target[0])) {
								return;
							}
							this._adjustInstDate(inst, offset
									+ (period == 'M' ? this._get(inst,
											'showCurrentAtPos') : 0), // undo
																		// positioning
									period);
							this._updateDatepicker(inst);
						},

						/* Action for current link. */
						_gotoToday : function(id) {
							var target = $(id);
							var inst = this._getInst(target[0]);
							if (this._get(inst, 'gotoCurrent')
									&& inst.currentDay) {
								inst.selectedDay = inst.currentDay;
								inst.drawMonth = inst.selectedMonth = inst.currentMonth;
								inst.drawYear = inst.selectedYear = inst.currentYear;
							} else {
								var date = new Date();
								inst.selectedDay = date.getDate();
								inst.drawMonth = inst.selectedMonth = date
										.getMonth();
								inst.drawYear = inst.selectedYear = date
										.getFullYear();
							}
							this._notifyChange(inst);
							this._adjustDate(target);
						},

						/* Action for selecting a new month/year. */
						_selectMonthYear : function(id, select, period) {
							var target = $(id);
							var inst = this._getInst(target[0]);
							inst._selectingMonthYear = false;
							inst['selected' + (period == 'M' ? 'Month' : 'Year')] = inst['draw' + (period == 'M' ? 'Month'
									: 'Year')] = parseInt(
									select.options[select.selectedIndex].value,
									10);
							this._notifyChange(inst);
							this._adjustDate(target);
						},

						/* Restore input focus after not changing month/year. */
						_clickMonthYear : function(id) {
							var target = $(id);
							var inst = this._getInst(target[0]);
							if (inst.input && inst._selectingMonthYear
									&& !$.browser.msie)
								inst.input[0].focus();
							inst._selectingMonthYear = !inst._selectingMonthYear;
						},

						/* Action for selecting a day. */
						_selectDay : function(id, month, year, td) {
							var target = $(id);
							if ($(td).hasClass(this._unselectableClass)
									|| this._isDisabledDatepicker(target[0])) {
								return;
							}
							var inst = this._getInst(target[0]);
							inst.selectedDay = inst.currentDay = $('a', td)
									.html();
							inst.selectedMonth = inst.currentMonth = month;
							inst.selectedYear = inst.currentYear = year;
							if (inst.stayOpen) {
								inst.endDay = inst.endMonth = inst.endYear = null;
							}
							this._selectDate(id, this._formatDate(inst,
									inst.currentDay, inst.currentMonth,
									inst.currentYear));
							if (inst.stayOpen) {
								inst.rangeStart = this
										._daylightSavingAdjust(new Date(
												inst.currentYear,
												inst.currentMonth,
												inst.currentDay));
								this._updateDatepicker(inst);
							}
						},

						/* Erase the input field and hide the date picker. */
						_clearDate : function(id) {
							var target = $(id);
							var inst = this._getInst(target[0]);
							inst.stayOpen = false;
							inst.endDay = inst.endMonth = inst.endYear = inst.rangeStart = null;
							this._selectDate(target, '');
						},

						/* Update the input field with the selected date. */
						_selectDate : function(id, dateStr) {
							var target = $(id);
							var inst = this._getInst(target[0]);
							dateStr = (dateStr != null ? dateStr : this
									._formatDate(inst));
							if (inst.input)
								inst.input.val(dateStr);
							this._updateAlternate(inst);
							var onSelect = this._get(inst, 'onSelect');
							if (onSelect)
								onSelect.apply((inst.input ? inst.input[0]
										: null), [ dateStr, inst ]); // trigger
																		// custom
																		// callback
							else if (inst.input)
								inst.input.trigger('change'); // fire the
																// change event
							if (inst.inline)
								this._updateDatepicker(inst);
							else if (!inst.stayOpen) {
								this._hideDatepicker(null, this._get(inst,
										'duration'));
								this._lastInput = inst.input[0];
								if (typeof (inst.input[0]) != 'object')
									inst.input[0].focus(); // restore focus
								this._lastInput = null;
							}
						},

						/*
						 * Update any alternate field to synchronise with the
						 * main field.
						 */
						_updateAlternate : function(inst) {
							var altField = this._get(inst, 'altField');
							if (altField) { // update alternate field too
								var altFormat = this._get(inst, 'altFormat')
										|| this._get(inst, 'dateFormat');
								var date = this._getDate(inst);
								dateStr = this.formatDate(altFormat, date, this
										._getFormatConfig(inst));
								$(altField).each(function() {
									$(this).val(dateStr);
								});
							}
						},

						/*
						 * Set as beforeShowDay function to prevent selection of
						 * weekends. @param date Date - the date to customise
						 * @return [boolean, string] - is this date selectable?,
						 * what is its CSS class?
						 */
						noWeekends : function(date) {
							var day = date.getDay();
							return [ (day > 0 && day < 6), '' ];
						},

						/*
						 * Set as calculateWeek to determine the week of the
						 * year based on the ISO 8601 definition. @param date
						 * Date - the date to get the week for @return number -
						 * the number of the week within the year that contains
						 * this date
						 */
						iso8601Week : function(date) {
							var checkDate = new Date(date.getFullYear(), date
									.getMonth(), date.getDate());
							var firstMon = new Date(checkDate.getFullYear(),
									1 - 1, 4); // First week always contains 4
												// Jan
							var firstDay = firstMon.getDay() || 7; // Day of
																	// week: Mon
																	// = 1, ...,
																	// Sun = 7
							firstMon.setDate(firstMon.getDate() + 1 - firstDay); // Preceding
																					// Monday
							if (firstDay < 4 && checkDate < firstMon) { // Adjust
																		// first
																		// three
																		// days
																		// in
																		// year
																		// if
																		// necessary
								checkDate.setDate(checkDate.getDate() - 3); // Generate
																			// for
																			// previous
																			// year
								return $.datepicker.iso8601Week(checkDate);
							} else if (checkDate > new Date(checkDate
									.getFullYear(), 12 - 1, 28)) { // Check
																	// last
																	// three
																	// days in
																	// year
								firstDay = new Date(
										checkDate.getFullYear() + 1, 1 - 1, 4)
										.getDay() || 7;
								if (firstDay > 4
										&& (checkDate.getDay() || 7) < firstDay - 3) { // Adjust
																						// if
																						// necessary
									return 1;
								}
							}
							return Math
									.floor(((checkDate - firstMon) / 86400000) / 7) + 1; // Weeks
																							// to
																							// given
																							// date
						},

						/*
						 * Parse a string value into a date object. See
						 * formatDate below for the possible formats.
						 * 
						 * @param format string - the expected format of the
						 * date @param value string - the date in the above
						 * format @param settings Object - attributes include:
						 * shortYearCutoff number - the cutoff year for
						 * determining the century (optional) dayNamesShort
						 * string[7] - abbreviated names of the days from Sunday
						 * (optional) dayNames string[7] - names of the days
						 * from Sunday (optional) monthNamesShort string[12] -
						 * abbreviated names of the months (optional) monthNames
						 * string[12] - names of the months (optional) @return
						 * Date - the extracted date value or null if value is
						 * blank
						 */
						parseDate : function(format, value, settings) {
							if (format == null || value == null)
								throw 'Invalid arguments';
							value = (typeof value == 'object' ? value
									.toString() : value + '');
							if (value == '')
								return null;
							var shortYearCutoff = (settings ? settings.shortYearCutoff
									: null)
									|| this._defaults.shortYearCutoff;
							var dayNamesShort = (settings ? settings.dayNamesShort
									: null)
									|| this._defaults.dayNamesShort;
							var dayNames = (settings ? settings.dayNames : null)
									|| this._defaults.dayNames;
							var monthNamesShort = (settings ? settings.monthNamesShort
									: null)
									|| this._defaults.monthNamesShort;
							var monthNames = (settings ? settings.monthNames
									: null)
									|| this._defaults.monthNames;
							var year = -1;
							var month = -1;
							var day = -1;
							var doy = -1;
							var literal = false;
							// Check whether a format character is doubled
							var lookAhead = function(match) {
								var matches = (iFormat + 1 < format.length && format
										.charAt(iFormat + 1) == match);
								if (matches)
									iFormat++;
								return matches;
							};
							// Extract a number from the string value
							var getNumber = function(match) {
								lookAhead(match);
								var origSize = (match == '@' ? 14
										: (match == 'y' ? 4 : (match == 'o' ? 3
												: 2)));
								var size = origSize;
								var num = 0;
								while (size > 0 && iValue < value.length
										&& value.charAt(iValue) >= '0'
										&& value.charAt(iValue) <= '9') {
									num = num
											* 10
											+ parseInt(value.charAt(iValue++),
													10);
									size--;
								}
								if (size == origSize)
									throw 'Missing number at position ' + iValue;
								return num;
							};
							// Extract a name from the string value and convert
							// to an index
							var getName = function(match, shortNames, longNames) {
								var names = (lookAhead(match) ? longNames
										: shortNames);
								var size = 0;
								for ( var j = 0; j < names.length; j++)
									size = Math.max(size, names[j].length);
								var name = '';
								var iInit = iValue;
								while (size > 0 && iValue < value.length) {
									name += value.charAt(iValue++);
									for ( var i = 0; i < names.length; i++)
										if (name == names[i])
											return i + 1;
									size--;
								}
								throw 'Unknown name at position ' + iInit;
							};
							// Confirm that a literal character matches the
							// string value
							var checkLiteral = function() {
								if (value.charAt(iValue) != format
										.charAt(iFormat))
									throw 'Unexpected literal at position ' + iValue;
								iValue++;
							};
							var iValue = 0;
							for ( var iFormat = 0; iFormat < format.length; iFormat++) {
								if (literal)
									if (format.charAt(iFormat) == "'"
											&& !lookAhead("'"))
										literal = false;
									else
										checkLiteral();
								else
									switch (format.charAt(iFormat)) {
									case 'd':
										day = getNumber('d');
										break;
									case 'D':
										getName('D', dayNamesShort, dayNames);
										break;
									case 'o':
										doy = getNumber('o');
										break;
									case 'm':
										month = getNumber('m');
										break;
									case 'M':
										month = getName('M', monthNamesShort,
												monthNames);
										break;
									case 'y':
										year = getNumber('y');
										break;
									case '@':
										var date = new Date(getNumber('@'));
										year = date.getFullYear();
										month = date.getMonth() + 1;
										day = date.getDate();
										break;
									case "'":
										if (lookAhead("'"))
											checkLiteral();
										else
											literal = true;
										break;
									default:
										checkLiteral();
									}
							}
							if (year == -1)
								year = new Date().getFullYear();
							else if (year < 100)
								year += new Date().getFullYear()
										- new Date().getFullYear() % 100
										+ (year <= shortYearCutoff ? 0 : -100);
							if (doy > -1) {
								month = 1;
								day = doy;
								do {
									var dim = this._getDaysInMonth(year,
											month - 1);
									if (day <= dim)
										break;
									month++;
									day -= dim;
								} while (true);
							}
							var date = this._daylightSavingAdjust(new Date(
									year, month - 1, day));
							if (date.getFullYear() != year
									|| date.getMonth() + 1 != month
									|| date.getDate() != day)
								throw 'Invalid date'; // E.g. 31/02/*
							return date;
						},

						/* Standard date formats. */
						ATOM : 'yy-mm-dd', // RFC 3339 (ISO 8601)
						COOKIE : 'D, dd M yy',
						ISO_8601 : 'yy-mm-dd',
						RFC_822 : 'D, d M y',
						RFC_850 : 'DD, dd-M-y',
						RFC_1036 : 'D, d M y',
						RFC_1123 : 'D, d M yy',
						RFC_2822 : 'D, d M yy',
						RSS : 'D, d M y', // RFC 822
						TIMESTAMP : '@',
						W3C : 'yy-mm-dd', // ISO 8601

						/*
						 * Format a date object into a string value. The format
						 * can be combinations of the following: d - day of
						 * month (no leading zero) dd - day of month (two digit)
						 * o - day of year (no leading zeros) oo - day of year
						 * (three digit) D - day name short DD - day name long m -
						 * month of year (no leading zero) mm - month of year
						 * (two digit) M - month name short MM - month name long
						 * y - year (two digit) yy - year (four digit) @ - Unix
						 * timestamp (ms since 01/01/1970) '...' - literal text '' -
						 * single quote
						 * 
						 * @param format string - the desired format of the date
						 * @param date Date - the date value to format @param
						 * settings Object - attributes include: dayNamesShort
						 * string[7] - abbreviated names of the days from Sunday
						 * (optional) dayNames string[7] - names of the days
						 * from Sunday (optional) monthNamesShort string[12] -
						 * abbreviated names of the months (optional) monthNames
						 * string[12] - names of the months (optional) @return
						 * string - the date in the above format
						 */
						formatDate : function(format, date, settings) {
							if (!date)
								return '';
							var dayNamesShort = (settings ? settings.dayNamesShort
									: null)
									|| this._defaults.dayNamesShort;
							var dayNames = (settings ? settings.dayNames : null)
									|| this._defaults.dayNames;
							var monthNamesShort = (settings ? settings.monthNamesShort
									: null)
									|| this._defaults.monthNamesShort;
							var monthNames = (settings ? settings.monthNames
									: null)
									|| this._defaults.monthNames;
							// Check whether a format character is doubled
							var lookAhead = function(match) {
								var matches = (iFormat + 1 < format.length && format
										.charAt(iFormat + 1) == match);
								if (matches)
									iFormat++;
								return matches;
							};
							// Format a number, with leading zero if necessary
							var formatNumber = function(match, value, len) {
								var num = '' + value;
								if (lookAhead(match))
									while (num.length < len)
										num = '0' + num;
								return num;
							};
							// Format a name, short or long as requested
							var formatName = function(match, value, shortNames,
									longNames) {
								return (lookAhead(match) ? longNames[value]
										: shortNames[value]);
							};
							var output = '';
							var literal = false;
							if (date)
								for ( var iFormat = 0; iFormat < format.length; iFormat++) {
									if (literal)
										if (format.charAt(iFormat) == "'"
												&& !lookAhead("'"))
											literal = false;
										else
											output += format.charAt(iFormat);
									else
										switch (format.charAt(iFormat)) {
										case 'd':
											output += formatNumber('d', date
													.getDate(), 2);
											break;
										case 'D':
											output += formatName('D', date
													.getDay(), dayNamesShort,
													dayNames);
											break;
										case 'o':
											var doy = date.getDate();
											for ( var m = date.getMonth() - 1; m >= 0; m--)
												doy += this._getDaysInMonth(
														date.getFullYear(), m);
											output += formatNumber('o', doy, 3);
											break;
										case 'm':
											output += formatNumber('m', date
													.getMonth() + 1, 2);
											break;
										case 'M':
											output += formatName('M', date
													.getMonth(),
													monthNamesShort, monthNames);
											break;
										case 'y':
											output += (lookAhead('y') ? date
													.getFullYear() : (date
													.getYear() % 100 < 10 ? '0'
													: '')
													+ date.getYear() % 100);
											break;
										case '@':
											output += date.getTime();
											break;
										case "'":
											if (lookAhead("'"))
												output += "'";
											else
												literal = true;
											break;
										default:
											output += format.charAt(iFormat);
										}
								}
							return output;
						},

						/* Extract all possible characters from the date format. */
						_possibleChars : function(format) {
							var chars = '';
							var literal = false;
							for ( var iFormat = 0; iFormat < format.length; iFormat++)
								if (literal)
									if (format.charAt(iFormat) == "'"
											&& !lookAhead("'"))
										literal = false;
									else
										chars += format.charAt(iFormat);
								else
									switch (format.charAt(iFormat)) {
									case 'd':
									case 'm':
									case 'y':
									case '@':
										chars += '0123456789';
										break;
									case 'D':
									case 'M':
										return null; // Accept anything
									case "'":
										if (lookAhead("'"))
											chars += "'";
										else
											literal = true;
										break;
									default:
										chars += format.charAt(iFormat);
									}
							return chars;
						},

						/* Get a setting value, defaulting if necessary. */
						_get : function(inst, name) {
							return inst.settings[name] !== undefined ? inst.settings[name]
									: this._defaults[name];
						},

						/* Parse existing date and initialise date picker. */
						_setDateFromField : function(inst) {
							var dateFormat = this._get(inst, 'dateFormat');
							var dates = inst.input ? inst.input.val() : null;
							inst.endDay = inst.endMonth = inst.endYear = null;
							var date = defaultDate = this._getDefaultDate(inst);
							var settings = this._getFormatConfig(inst);
							try {
								date = this.parseDate(dateFormat, dates,
										settings)
										|| defaultDate;
							} catch (event) {
								this.log(event);
								date = defaultDate;
							}
							inst.selectedDay = date.getDate();
							inst.drawMonth = inst.selectedMonth = date
									.getMonth();
							inst.drawYear = inst.selectedYear = date
									.getFullYear();
							inst.currentDay = (dates ? date.getDate() : 0);
							inst.currentMonth = (dates ? date.getMonth() : 0);
							inst.currentYear = (dates ? date.getFullYear() : 0);
							this._adjustInstDate(inst);
						},

						/* Retrieve the default date shown on opening. */
						_getDefaultDate : function(inst) {
							var date = this._determineDate(this._get(inst,
									'defaultDate'), new Date());
							var minDate = this
									._getMinMaxDate(inst, 'min', true);
							var maxDate = this._getMinMaxDate(inst, 'max');
							date = (minDate && date < minDate ? minDate : date);
							date = (maxDate && date > maxDate ? maxDate : date);
							return date;
						},

						/*
						 * A date may be specified as an exact value or a
						 * relative one.
						 */
						_determineDate : function(date, defaultDate) {
							var offsetNumeric = function(offset) {
								var date = new Date();
								date.setDate(date.getDate() + offset);
								return date;
							};
							var offsetString = function(offset, getDaysInMonth) {
								var date = new Date();
								var year = date.getFullYear();
								var month = date.getMonth();
								var day = date.getDate();
								var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;
								var matches = pattern.exec(offset);
								while (matches) {
									switch (matches[2] || 'd') {
									case 'd':
									case 'D':
										day += parseInt(matches[1], 10);
										break;
									case 'w':
									case 'W':
										day += parseInt(matches[1], 10) * 7;
										break;
									case 'm':
									case 'M':
										month += parseInt(matches[1], 10);
										day = Math.min(day, getDaysInMonth(
												year, month));
										break;
									case 'y':
									case 'Y':
										year += parseInt(matches[1], 10);
										day = Math.min(day, getDaysInMonth(
												year, month));
										break;
									}
									matches = pattern.exec(offset);
								}
								return new Date(year, month, day);
							};
							date = (date == null ? defaultDate
									: (typeof date == 'string' ? offsetString(
											date, this._getDaysInMonth)
											: (typeof date == 'number' ? (isNaN(date) ? defaultDate
													: offsetNumeric(date))
													: date)));
							date = (date && date.toString() == 'Invalid Date' ? defaultDate
									: date);
							if (date) {
								date.setHours(0);
								date.setMinutes(0);
								date.setSeconds(0);
								date.setMilliseconds(0);
							}
							return this._daylightSavingAdjust(date);
						},

						/*
						 * Handle switch to/from daylight saving. Hours may be
						 * non-zero on daylight saving cut-over: > 12 when
						 * midnight changeover, but then cannot generate
						 * midnight datetime, so jump to 1AM, otherwise reset.
						 * @param date (Date) the date to check @return (Date)
						 * the corrected date
						 */
						_daylightSavingAdjust : function(date) {
							if (!date)
								return null;
							date.setHours(date.getHours() > 12 ? date
									.getHours() + 2 : 0);
							return date;
						},

						/* Set the date(s) directly. */
						_setDate : function(inst, date, endDate) {
							var clear = !(date);
							var origMonth = inst.selectedMonth;
							var origYear = inst.selectedYear;
							date = this._determineDate(date, new Date());
							inst.selectedDay = inst.currentDay = date.getDate();
							inst.drawMonth = inst.selectedMonth = inst.currentMonth = date
									.getMonth();
							inst.drawYear = inst.selectedYear = inst.currentYear = date
									.getFullYear();
							if (origMonth != inst.selectedMonth
									|| origYear != inst.selectedYear)
								this._notifyChange(inst);
							this._adjustInstDate(inst);
							if (inst.input) {
								inst.input.val(clear ? '' : this
										._formatDate(inst));
							}
						},

						/* Retrieve the date(s) directly. */
						_getDate : function(inst) {
							var startDate = (!inst.currentYear
									|| (inst.input && inst.input.val() == '') ? null
									: this
											._daylightSavingAdjust(new Date(
													inst.currentYear,
													inst.currentMonth,
													inst.currentDay)));
							return startDate;
						},

						/*
						 * Generate the HTML for the current state of the date
						 * picker.
						 */
						_generateHTML : function(inst) {
							var today = new Date();
							today = this._daylightSavingAdjust(new Date(today
									.getFullYear(), today.getMonth(), today
									.getDate())); // clear time
							var isRTL = this._get(inst, 'isRTL');
							var showButtonPanel = this._get(inst,
									'showButtonPanel');
							var hideIfNoPrevNext = this._get(inst,
									'hideIfNoPrevNext');
							var navigationAsDateFormat = this._get(inst,
									'navigationAsDateFormat');
							var numMonths = this._getNumberOfMonths(inst);
							var showCurrentAtPos = this._get(inst,
									'showCurrentAtPos');
							var stepMonths = this._get(inst, 'stepMonths');
							var stepBigMonths = this
									._get(inst, 'stepBigMonths');
							var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
							var currentDate = this
									._daylightSavingAdjust((!inst.currentDay ? new Date(
											9999, 9, 9)
											: new Date(inst.currentYear,
													inst.currentMonth,
													inst.currentDay)));
							var minDate = this
									._getMinMaxDate(inst, 'min', true);
							var maxDate = this._getMinMaxDate(inst, 'max');
							var drawMonth = inst.drawMonth - showCurrentAtPos;
							var drawYear = inst.drawYear;
							if (drawMonth < 0) {
								drawMonth += 12;
								drawYear--;
							}
							if (maxDate) {
								var maxDraw = this
										._daylightSavingAdjust(new Date(maxDate
												.getFullYear(),

										maxDate.getMonth() - numMonths[1] + 1,
												maxDate.getDate()));
								maxDraw = (minDate && maxDraw < minDate ? minDate
										: maxDraw);
								while (this._daylightSavingAdjust(new Date(
										drawYear, drawMonth, 1)) > maxDraw) {
									drawMonth--;
									if (drawMonth < 0) {
										drawMonth = 11;
										drawYear--;
									}
								}
							}
							inst.drawMonth = drawMonth;
							inst.drawYear = drawYear;
							var prevText = this._get(inst, 'prevText');
							prevText = (!navigationAsDateFormat ? prevText
									: this.formatDate(prevText, this
											._daylightSavingAdjust(new Date(
													drawYear, drawMonth
															- stepMonths, 1)),
											this._getFormatConfig(inst)));
							var prev = (this._canAdjustMonth(inst, -1,
									drawYear, drawMonth) ? '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'
									+ inst.id
									+ '\', -'
									+ stepMonths
									+ ', \'M\');"'
									+ ' title="'
									+ prevText
									+ '"><span class="ui-icon ui-icon-circle-triangle-'
									+ (isRTL ? 'e' : 'w')
									+ '">'
									+ prevText
									+ '</span></a>'
									: (hideIfNoPrevNext ? ''
											: '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'
													+ prevText
													+ '"><span class="ui-icon ui-icon-circle-triangle-'
													+ (isRTL ? 'e' : 'w')
													+ '">'
													+ prevText
													+ '</span></a>'));
							var nextText = this._get(inst, 'nextText');
							nextText = (!navigationAsDateFormat ? nextText
									: this.formatDate(nextText, this
											._daylightSavingAdjust(new Date(
													drawYear, drawMonth
															+ stepMonths, 1)),
											this._getFormatConfig(inst)));
							var next = (this._canAdjustMonth(inst, +1,
									drawYear, drawMonth) ? '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'
									+ inst.id
									+ '\', +'
									+ stepMonths
									+ ', \'M\');"'
									+ ' title="'
									+ nextText
									+ '"><span class="ui-icon ui-icon-circle-triangle-'
									+ (isRTL ? 'w' : 'e')
									+ '">'
									+ nextText
									+ '</span></a>'
									: (hideIfNoPrevNext ? ''
											: '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'
													+ nextText
													+ '"><span class="ui-icon ui-icon-circle-triangle-'
													+ (isRTL ? 'w' : 'e')
													+ '">'
													+ nextText
													+ '</span></a>'));
							var currentText = this._get(inst, 'currentText');
							var gotoDate = (this._get(inst, 'gotoCurrent')
									&& inst.currentDay ? currentDate : today);
							currentText = (!navigationAsDateFormat ? currentText
									: this.formatDate(currentText, gotoDate,
											this._getFormatConfig(inst)));
							var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">' + this
									._get(inst, 'closeText') + '</button>'
									: '');
							var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">'
									+ (isRTL ? controls : '')
									+ (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'
											+ inst.id
											+ '\');"'
											+ '>'
											+ currentText + '</button>'
											: '')
									+ (isRTL ? '' : controls)
									+ '</div>'
									: '';
							var firstDay = parseInt(
									this._get(inst, 'firstDay'), 10);
							firstDay = (isNaN(firstDay) ? 0 : firstDay);
							var dayNames = this._get(inst, 'dayNames');
							var dayNamesShort = this
									._get(inst, 'dayNamesShort');
							var dayNamesMin = this._get(inst, 'dayNamesMin');
							var monthNames = this._get(inst, 'monthNames');
							var monthNamesShort = this._get(inst,
									'monthNamesShort');
							var beforeShowDay = this
									._get(inst, 'beforeShowDay');
							var showOtherMonths = this._get(inst,
									'showOtherMonths');
							var calculateWeek = this
									._get(inst, 'calculateWeek')
									|| this.iso8601Week;
							var endDate = inst.endDay ? this
									._daylightSavingAdjust(new Date(
											inst.endYear, inst.endMonth,
											inst.endDay)) : currentDate;
							var defaultDate = this._getDefaultDate(inst);
							var html = '';
							for ( var row = 0; row < numMonths[0]; row++) {
								var group = '';
								for ( var col = 0; col < numMonths[1]; col++) {
									var selectedDate = this
											._daylightSavingAdjust(new Date(
													drawYear, drawMonth,
													inst.selectedDay));
									var cornerClass = ' ui-corner-all';
									var calender = '';
									if (isMultiMonth) {
										calender += '<div class="ui-datepicker-group ui-datepicker-group-';
										switch (col) {
										case 0:
											calender += 'first';
											cornerClass = ' ui-corner-' + (isRTL ? 'right'
													: 'left');
											break;
										case numMonths[1] - 1:
											calender += 'last';
											cornerClass = ' ui-corner-' + (isRTL ? 'left'
													: 'right');
											break;
										default:
											calender += 'middle';
											cornerClass = '';
											break;
										}
										calender += '">';
									}
									calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'
											+ cornerClass
											+ '">'
											+ (/all|left/.test(cornerClass)
													&& row == 0 ? (isRTL ? next
													: prev) : '')
											+ (/all|right/.test(cornerClass)
													&& row == 0 ? (isRTL ? prev
													: next) : '')
											+ this
													._generateMonthYearHeader(
															inst, drawMonth,
															drawYear, minDate,
															maxDate,
															selectedDate,
															row > 0 || col > 0,
															monthNames,
															monthNamesShort)
											+ // draw month headers
											'</div><table class="ui-datepicker-calendar"><thead>'
											+ '<tr>';
									var thead = '';
									for ( var dow = 0; dow < 7; dow++) { // days
																			// of
																			// the
																			// week
										var day = (dow + firstDay) % 7;
										thead += '<th'
												+ ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"'
														: '') + '>'
												+ '<span title="'
												+ dayNames[day] + '">'
												+ dayNamesMin[day]
												+ '</span></th>';
									}
									calender += thead + '</tr></thead><tbody>';
									var daysInMonth = this._getDaysInMonth(
											drawYear, drawMonth);
									if (drawYear == inst.selectedYear
											&& drawMonth == inst.selectedMonth)
										inst.selectedDay = Math.min(
												inst.selectedDay, daysInMonth);
									var leadDays = (this._getFirstDayOfMonth(
											drawYear, drawMonth)
											- firstDay + 7) % 7;
									var numRows = (isMultiMonth ? 6 : Math
											.ceil((leadDays + daysInMonth) / 7)); // calculate
																					// the
																					// number
																					// of
																					// rows
																					// to
																					// generate
									var printDate = this
											._daylightSavingAdjust(new Date(
													drawYear, drawMonth,
													1 - leadDays));
									for ( var dRow = 0; dRow < numRows; dRow++) { // create
																					// date
																					// picker
																					// rows
										calender += '<tr>';
										var tbody = '';
										for ( var dow = 0; dow < 7; dow++) { // create
																				// date
																				// picker
																				// days
											var daySettings = (beforeShowDay ? beforeShowDay
													.apply(
															(inst.input ? inst.input[0]
																	: null),
															[ printDate ])
													: [ true, '' ]);
											var otherMonth = (printDate
													.getMonth() != drawMonth);
											var unselectable = otherMonth
													|| !daySettings[0]
													|| (minDate && printDate < minDate)
													|| (maxDate && printDate > maxDate);
											tbody += '<td class="'
													+ ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end'
															: '')
													+ // highlight weekends
													(otherMonth ? ' ui-datepicker-other-month'
															: '')
													+ // highlight days from
														// other months
													((printDate.getTime() == selectedDate
															.getTime()
															&& drawMonth == inst.selectedMonth && inst._keyEvent)
															|| // user pressed
																// key
															(defaultDate
																	.getTime() == printDate
																	.getTime() && defaultDate
																	.getTime() == selectedDate
																	.getTime()) ?
													// or defaultDate is current
													// printedDate and
													// defaultDate is
													// selectedDate
													' ' + this._dayOverClass
															: '')
													+ // highlight selected
														// day
													(unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled'
															: '')
													+ // highlight
														// unselectable days
													(otherMonth
															&& !showOtherMonths ? ''
															: ' '
																	+ daySettings[1]
																	+ // highlight
																		// custom
																		// dates
																	(printDate
																			.getTime() >= currentDate
																			.getTime()
																			&& printDate
																					.getTime() <= endDate
																					.getTime() ? // in
																									// current
																									// range
																	' ' + this._currentClass
																			: '')
																	+ // highlight
																		// selected
																		// day
																	(printDate
																			.getTime() == today
																			.getTime() ? ' ui-datepicker-today'
																			: ''))
													+ '"'
													+ // highlight today (if
														// different)
													((!otherMonth || showOtherMonths)
															&& daySettings[2] ? ' title="' + daySettings[2] + '"'
															: '')
													+ // cell title
													(unselectable ? ''
															: ' onclick="DP_jQuery.datepicker._selectDay(\'#'
																	+ inst.id
																	+ '\','
																	+ drawMonth
																	+ ','
																	+ drawYear
																	+ ', this);return false;"')
													+ '>'
													+ // actions
													(otherMonth ? (showOtherMonths ? printDate
															.getDate()
															: '&#xa0;')
															: // display for
																// other months
															(unselectable ? '<span class="ui-state-default">' + printDate
																	.getDate() + '</span>'
																	: '<a class="ui-state-default'
																			+ (printDate
																					.getTime() == today
																					.getTime() ? ' ui-state-highlight'
																					: '')
																			+ (printDate
																					.getTime() >= currentDate
																					.getTime()
																					&& printDate
																							.getTime() <= endDate
																							.getTime() ? // in
																											// current
																											// range
																			' ui-state-active'
																					: '')
																			+ // highlight
																				// selected
																				// day
																			'" href="#">'
																			+ printDate
																					.getDate()
																			+ '</a>'))
													+ '</td>'; // display for
																// this month
											printDate.setDate(printDate
													.getDate() + 1);
											printDate = this
													._daylightSavingAdjust(printDate);
										}
										calender += tbody + '</tr>';
									}
									drawMonth++;
									if (drawMonth > 11) {
										drawMonth = 0;
										drawYear++;
									}
									calender += '</tbody></table>' + (isMultiMonth ? '</div>' + ((numMonths[0] > 0 && col == numMonths[1] - 1) ? '<div class="ui-datepicker-row-break"></div>'
											: '')
											: '');
									group += calender;
								}
								html += group;
							}
							html += buttonPanel
									+ ($.browser.msie
											&& parseInt($.browser.version, 10) < 7
											&& !inst.inline ? '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>'
											: '');
							inst._keyEvent = false;
							return html;
						},

						/* Generate the month and year header. */
						_generateMonthYearHeader : function(inst, drawMonth,
								drawYear, minDate, maxDate, selectedDate,
								secondary, monthNames, monthNamesShort) {
							minDate = (inst.rangeStart && minDate
									&& selectedDate < minDate ? selectedDate
									: minDate);
							var changeMonth = this._get(inst, 'changeMonth');
							var changeYear = this._get(inst, 'changeYear');
							var showMonthAfterYear = this._get(inst,
									'showMonthAfterYear');
							var html = '<div class="ui-datepicker-title">';
							var monthHtml = '';
							// month selection
							if (secondary || !changeMonth)
								monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span> ';
							else {
								var inMinYear = (minDate && minDate
										.getFullYear() == drawYear);
								var inMaxYear = (maxDate && maxDate
										.getFullYear() == drawYear);
								monthHtml += '<select class="ui-datepicker-month" '
										+ 'onchange="DP_jQuery.datepicker._selectMonthYear(\'#'
										+ inst.id
										+ '\', this, \'M\');" '
										+ 'onclick="DP_jQuery.datepicker._clickMonthYear(\'#'
										+ inst.id + '\');"' + '>';
								for ( var month = 0; month < 12; month++) {
									if ((!inMinYear || month >= minDate
											.getMonth())
											&& (!inMaxYear || month <= maxDate
													.getMonth()))
										monthHtml += '<option value="'
												+ month
												+ '"'
												+ (month == drawMonth ? ' selected="selected"'
														: '') + '>'
												+ monthNamesShort[month]
												+ '</option>';
								}
								monthHtml += '</select>';
							}
							if (!showMonthAfterYear)
								html += monthHtml
										+ ((secondary || changeMonth || changeYear)
												&& (!(changeMonth && changeYear)) ? '&#xa0;'
												: '');
							// year selection
							if (secondary || !changeYear)
								html += '<span class="ui-datepicker-year">' + drawYear + '</span>';
							else {
								// determine range of years to display
								var years = this._get(inst, 'yearRange').split(
										':');
								var year = 0;
								var endYear = 0;
								if (years.length != 2) {
									year = drawYear - 10;
									endYear = drawYear + 10;
								} else if (years[0].charAt(0) == '+'
										|| years[0].charAt(0) == '-') {
									year = drawYear + parseInt(years[0], 10);
									endYear = drawYear + parseInt(years[1], 10);
								} else {
									year = parseInt(years[0], 10);
									endYear = parseInt(years[1], 10);
								}
								year = (minDate ? Math.max(year, minDate
										.getFullYear()) : year);
								endYear = (maxDate ? Math.min(endYear, maxDate
										.getFullYear()) : endYear);
								html += '<select class="ui-datepicker-year" '
										+ 'onchange="DP_jQuery.datepicker._selectMonthYear(\'#'
										+ inst.id
										+ '\', this, \'Y\');" '
										+ 'onclick="DP_jQuery.datepicker._clickMonthYear(\'#'
										+ inst.id + '\');"' + '>';
								for (; year <= endYear; year++) {
									html += '<option value="'
											+ year
											+ '"'
											+ (year == drawYear ? ' selected="selected"'
													: '') + '>' + year
											+ '</option>';
								}
								html += '</select>';
							}
							if (showMonthAfterYear)
								html += (secondary || changeMonth || changeYear ? '&#xa0;'
										: '')
										+ monthHtml;
							html += '</div>'; // Close datepicker_header
							return html;
						},

						/* Adjust one of the date sub-fields. */
						_adjustInstDate : function(inst, offset, period) {
							var year = inst.drawYear
									+ (period == 'Y' ? offset : 0);
							var month = inst.drawMonth
									+ (period == 'M' ? offset : 0);
							var day = Math.min(inst.selectedDay, this
									._getDaysInMonth(year, month))
									+ (period == 'D' ? offset : 0);
							var date = this._daylightSavingAdjust(new Date(
									year, month, day));
							// ensure it is within the bounds set
							var minDate = this
									._getMinMaxDate(inst, 'min', true);
							var maxDate = this._getMinMaxDate(inst, 'max');
							date = (minDate && date < minDate ? minDate : date);
							date = (maxDate && date > maxDate ? maxDate : date);
							inst.selectedDay = date.getDate();
							inst.drawMonth = inst.selectedMonth = date
									.getMonth();
							inst.drawYear = inst.selectedYear = date
									.getFullYear();
							if (period == 'M' || period == 'Y')
								this._notifyChange(inst);
						},

						/* Notify change of month/year. */
						_notifyChange : function(inst) {
							var onChange = this._get(inst, 'onChangeMonthYear');
							if (onChange)
								onChange.apply((inst.input ? inst.input[0]
										: null), [ inst.selectedYear,
										inst.selectedMonth + 1, inst ]);
						},

						/* Determine the number of months to show. */
						_getNumberOfMonths : function(inst) {
							var numMonths = this._get(inst, 'numberOfMonths');
							return (numMonths == null ? [ 1, 1 ]
									: (typeof numMonths == 'number' ? [ 1,
											numMonths ] : numMonths));
						},

						/*
						 * Determine the current maximum date - ensure no time
						 * components are set - may be overridden for a range.
						 */
						_getMinMaxDate : function(inst, minMax, checkRange) {
							var date = this._determineDate(this._get(inst,
									minMax + 'Date'), null);
							return (!checkRange || !inst.rangeStart ? date
									: (!date || inst.rangeStart > date ? inst.rangeStart
											: date));
						},

						/* Find the number of days in a given month. */
						_getDaysInMonth : function(year, month) {
							return 32 - new Date(year, month, 32).getDate();
						},

						/* Find the day of the week of the first of a month. */
						_getFirstDayOfMonth : function(year, month) {
							return new Date(year, month, 1).getDay();
						},

						/*
						 * Determines if we should allow a "next/prev" month
						 * display change.
						 */
						_canAdjustMonth : function(inst, offset, curYear,
								curMonth) {
							var numMonths = this._getNumberOfMonths(inst);
							var date = this._daylightSavingAdjust(new Date(
									curYear, curMonth
											+ (offset < 0 ? offset
													: numMonths[1]), 1));
							if (offset < 0)
								date.setDate(this._getDaysInMonth(date
										.getFullYear(), date.getMonth()));
							return this._isInRange(inst, date);
						},

						/* Is the given date in the accepted range? */
						_isInRange : function(inst, date) {
							// during range selection, use minimum of selected
							// date and range start
							var newMinDate = (!inst.rangeStart ? null : this
									._daylightSavingAdjust(new Date(
											inst.selectedYear,
											inst.selectedMonth,
											inst.selectedDay)));
							newMinDate = (newMinDate
									&& inst.rangeStart < newMinDate ? inst.rangeStart
									: newMinDate);
							var minDate = newMinDate
									|| this._getMinMaxDate(inst, 'min');
							var maxDate = this._getMinMaxDate(inst, 'max');
							return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate));
						},

						/*
						 * Provide the configuration settings for
						 * formatting/parsing.
						 */
						_getFormatConfig : function(inst) {
							var shortYearCutoff = this._get(inst,
									'shortYearCutoff');
							shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff
									: new Date().getFullYear() % 100
											+ parseInt(shortYearCutoff, 10));
							return {
								shortYearCutoff : shortYearCutoff,
								dayNamesShort : this
										._get(inst, 'dayNamesShort'),
								dayNames : this._get(inst, 'dayNames'),
								monthNamesShort : this._get(inst,
										'monthNamesShort'),
								monthNames : this._get(inst, 'monthNames')
							};
						},

						/* Format the given date for display. */
						_formatDate : function(inst, day, month, year) {
							if (!day) {
								inst.currentDay = inst.selectedDay;
								inst.currentMonth = inst.selectedMonth;
								inst.currentYear = inst.selectedYear;
							}
							var date = (day ? (typeof day == 'object' ? day
									: this._daylightSavingAdjust(new Date(year,
											month, day)))
									: this
											._daylightSavingAdjust(new Date(
													inst.currentYear,
													inst.currentMonth,
													inst.currentDay)));
							return this.formatDate(this
									._get(inst, 'dateFormat'), date, this
									._getFormatConfig(inst));
						}
					});

	/* jQuery extend now ignores nulls! */
	function extendRemove(target, props) {
		$.extend(target, props);
		for ( var name in props)
			if (props[name] == null || props[name] == undefined)
				target[name] = props[name];
		return target;
	}
	;

	/* Determine whether an object is an array. */
	function isArray(a) {
		return (a && (($.browser.safari && typeof a == 'object' && a.length) || (a.constructor && a.constructor
				.toString().match(/\Array\(\)/))));
	}
	;

	/*
	 * Invoke the datepicker functionality. @param options string - a command,
	 * optionally followed by additional parameters or Object - settings for
	 * attaching new datepicker functionality @return jQuery object
	 */
	$.fn.datepicker = function(options) {

		/* Initialise the date picker. */
		if (!$.datepicker.initialized) {
			$(document).mousedown($.datepicker._checkExternalClick)
					.find('body').append($.datepicker.dpDiv);
			$.datepicker.initialized = true;
		}

		var otherArgs = Array.prototype.slice.call(arguments, 1);
		if (typeof options == 'string'
				&& (options == 'isDisabled' || options == 'getDate'))
			return $.datepicker['_' + options + 'Datepicker'].apply(
					$.datepicker, [ this[0] ].concat(otherArgs));
		if (options == 'option' && arguments.length == 2
				&& typeof arguments[1] == 'string')
			return $.datepicker['_' + options + 'Datepicker'].apply(
					$.datepicker, [ this[0] ].concat(otherArgs));
		return this
				.each(function() {
					typeof options == 'string' ? $.datepicker['_' + options + 'Datepicker']
							.apply($.datepicker, [ this ].concat(otherArgs))
							: $.datepicker._attachDatepicker(this, options);
				});
	};

	$.datepicker = new Datepicker(); // singleton instance
	$.datepicker.initialized = false;
	$.datepicker.uuid = new Date().getTime();
	$.datepicker.version = "1.7.2";

	// Workaround for #4055
	// Add another global to avoid noConflict issues with inline event handlers
	window.DP_jQuery = $;

})(jQuery);

/* SmoothScroll for anchor */
// �ഫ���Ʀr
function intval(v) {
	v = parseInt(v);
	return isNaN(v) ? 0 : v;
}
// �����T��
function getPos(e) {
	var l = 0;
	var t = 0;
	var w = intval(e.style.width);
	var h = intval(e.style.height);
	var wb = e.offsetWidth;
	var hb = e.offsetHeight;
	while (e.offsetParent) {
		l += e.offsetLeft
				+ (e.currentStyle ? intval(e.currentStyle.borderLeftWidth) : 0);
		t += e.offsetTop
				+ (e.currentStyle ? intval(e.currentStyle.borderTopWidth) : 0);
		e = e.offsetParent;
	}
	l += e.offsetLeft
			+ (e.currentStyle ? intval(e.currentStyle.borderLeftWidth) : 0);
	t += e.offsetTop
			+ (e.currentStyle ? intval(e.currentStyle.borderTopWidth) : 0);
	return {
		x : l,
		y : t,
		w : w,
		h : h,
		wb : wb,
		hb : hb
	};
}
// ���scrollbar�H��
function getScroll() {
	var t, l, w, h;
	if (document.documentElement && document.documentElement.scrollTop) {
		t = document.documentElement.scrollTop;
		l = document.documentElement.scrollLeft;
		w = document.documentElement.scrollWidth;
		h = document.documentElement.scrollHeight;
	} else if (document.body) {
		t = document.body.scrollTop;
		l = document.body.scrollLeft;
		w = document.body.scrollWidth;
		h = document.body.scrollHeight;
	}
	return {
		t : t,
		l : l,
		w : w,
		h : h
	};
}
// Anchor�����Ƹ���
function scroller(el, duration) {
	if (typeof el != 'object') {
		el = document.getElementById(el);
	}
	if (!el)
		return;
	var z = this;
	z.el = el;
	z.p = getPos(el);
	z.s = getScroll();
	z.clear = function() {
		window.clearInterval(z.timer);
		z.timer = null
	};
	z.t = (new Date).getTime();
	z.step = function() {
		var t = (new Date).getTime();
		var p = (t - z.t) / duration;
		if (t >= duration + z.t) {
			z.clear();
			window.setTimeout(function() {
				z.scroll(z.p.y, z.p.x)
			}, 13);
		} else {
			st = ((-Math.cos(p * Math.PI) / 2) + 0.5) * (z.p.y - z.s.t) + z.s.t;
			sl = ((-Math.cos(p * Math.PI) / 2) + 0.5) * (z.p.x - z.s.l) + z.s.l;
			z.scroll(st, sl);
		}
	};
	z.scroll = function(t, l) {
		window.scrollTo(l, t)
	};
	z.timer = window.setInterval(function() {
		z.step();
	}, 13);
}