//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 } (';1T.r||(5($){g 1U=$.V.18,1V=$.E.2L&&(2M($.E.1W)<1.9);$.r={1W:"1.7.1",1o:{1p:5(1X,19,p){g 1a=$.r[1X].F;1q(g i 2N p){1a.1b[i]=1a.1b[i]||[];1a.1b[i].2O([19,p[i]])}},J:5(k,c,t){g p=k.1b[c];d(!p||!k.e[0].2P){6}1q(g i=0;i<p.K;i++){d(k.f[p[i][0]]){p[i][1].L(k.e,t)}}}},1Y:5(a,b){6 1c.1Z?a.1Z(b)&16:a!==b&&a.1Y(b)},2Q:5(M,a){d($(M).N(\'G\')==\'21\'){6 n}g H=(a&&a==\'1r\')?\'2R\':\'2S\',1s=n;d(M[H]>0){6 z}M[H]=1;1s=(M[H]>0);M[H]=0;6 1s},1t:5(x,1u,22){6(x>1u)&&(x<(1u+22))},2T:5(y,x,23,1r,24,25){6 $.r.1t(y,23,24)&&$.r.1t(x,1r,25)},2U:{2V:8,2W:20,2X:2Y,2Z:17,30:46,31:40,3a:35,3b:13,3c:27,3d:36,3e:45,3f:37,3g:3h,3i:3j,3k:3l,3m:3n,3o:3p,3q:3r,3s:34,3t:33,3u:3v,3w:39,3x:16,3y:32,3z:9,3A:38}};d(1V){g l=$.l,W=$.V.W,1v="3B://3C.3D.3E/3F/3G/1w",O=/^1x-/,26=/^28:/;$.l=5(P,c,m){g p=m!==1y;6(c==\'3H\'?(p?l.J(2,P,c,"28:"+m):(l.L(2,1d)||"").1e(26,"")):(O.u(c)?(p?P.3I(1v,c.1e(O,"1w:"),m):l.J(2,P,c.1e(O,"1w:"))):l.L(2,1d)))};$.V.W=5(c){6(O.u(c)?2.1f(5(){2.3J(1v,c.1e(O,""))}):W.J(2,c))}}$.V.1g({18:5(){$("*",2).1p(2).1f(5(){$(2).3K("18")});6 1U.L(2,1d)},3L:5(){6 2.l(\'X\',\'3M\').N(\'29\',\'\').1h(\'2a.r\')},3N:5(){6 2.l(\'X\',\'2b\').N(\'29\',\'3O\').A(\'2a.r\',5(){6 n})},Q:5(){g Q;d(($.E.1i&&(/(3P|2c)/).u(2.N(\'1j\')))||(/2d/).u(2.N(\'1j\'))){Q=2.1k().1z(5(){6(/(2c|2d|2e)/).u($.I(2,\'1j\',1))&&(/(2f|H)/).u($.I(2,\'G\',1)+$.I(2,\'G-y\',1)+$.I(2,\'G-x\',1))}).2g(0)}3Q{Q=2.1k().1z(5(){6(/(2f|H)/).u($.I(2,\'G\',1)+$.I(2,\'G-y\',1)+$.I(2,\'G-x\',1))}).2g(0)}6(/2e/).u(2.N(\'1j\'))||!Q.K?$(1c):Q}});$.1g($.3R[\':\'],{B:5(P,i,2h){6!!$.B(P,2h[3])},2i:5(e){g R=e.R.3S(),S=$.l(e,\'2j\');6(/3T|3U|3V|2k|3W/.u(R)?!e.q:\'a\'==R||\'2l\'==R?e.3X||!1A(S):!1A(S))&&!$(e)[\'2l\'==R?\'1k\':\'3Y\'](\':21\').K},3Z:5(e){g S=$.l(e,\'2j\');6(1A(S)||S>=0)&&$(e).41(\':2i\')}});5 1B(h,1o,2m,t){5 1C(C){g D=$[h][1o][C]||[];6(Y D==\'Z\'?D.1D(/,?\\s+/):D)}g D=1C(\'1B\');d(t.K==1&&Y t[0]==\'Z\'){D=D.42(1C(\'2n\'))}6($.43(2m,D)!=-1)}$.10=5(c,F){g h=c.1D(".")[0];c=c.1D(".")[1];$.V[c]=5(f){g 11=(Y f==\'Z\'),t=44.F.47.J(1d,1);d(11&&f.48(0,1)==\'49\'){6 2}d(11&&1B(h,c,f,t)){g k=$.B(2[0],c);6(k?k[f].L(k,t):1y)}6 2.1f(5(){g k=$.B(2,c);(!k&&!11&&$.B(2,c,4a $[h][c](2,f)).2o());(k&&11&&$.2p(k[f])&&k[f].L(k,t))})};$[h]=$[h]||{};$[h][c]=5(e,f){g o=2;2.h=h;2.v=c;2.1E=$[h][c].4b||c;2.1F=h+\'-\'+c;2.f=$.1g({},$.10.1l,$[h][c].1l,$.2q&&$.2q.4c(e)[c],f);2.e=$(e).A(\'4d.\'+c,5(4,j,m){d(4.T==e){6 o.12(j,m)}}).A(\'4e.\'+c,5(4,j){d(4.T==e){6 o.1G(j)}}).A(\'18\',5(){6 o.2r()})};$[h][c].F=$.1g({},$.10.F,F);$[h][c].2n=\'19\'};$.10.F={2o:5(){},2r:5(){2.e.4f(2.v).2s(2.1F+\'-q\'+\' \'+2.h+\'-2t-q\').W(\'1x-q\')},19:5(j,m){g f=j,o=2;d(Y j=="Z"){d(m===1y){6 2.1G(j)}f={};f[j]=m}$.1f(f,5(j,m){o.12(j,m)})},1G:5(j){6 2.f[j]},12:5(j,m){2.f[j]=m;d(j==\'q\'){2.e[m?\'4g\':\'2s\'](2.1F+\'-q\'+\' \'+2.h+\'-2t-q\').l("1x-q",m)}},4h:5(){2.12(\'q\',n)},4i:5(){2.12(\'q\',z)},4j:5(C,4,B){g 1H=2.f[C],2u=(C==2.1E?C:2.1E+C);4=$.4k(4);4.C=2u;d(4.U){1q(g i=$.4.2v.K,1m;i;){1m=$.4.2v[--i];4[1m]=4.U[1m]}}2.e.4l(4,B);6!($.2p(1H)&&1H.J(2.e[0],4,B)===n||4.4m())}};$.10.1l={q:n};$.r.2w={4n:5(){g o=2;2.e.A(\'4o.\'+2.v,5(4){6 o.2x(4)}).A(\'4p.\'+2.v,5(4){d(o.1I){o.1I=n;4.4q();6 n}});d($.E.1i){2.2y=2.e.l(\'X\');2.e.l(\'X\',\'2b\')}2.4r=n},4s:5(){2.e.1h(\'.\'+2.v);($.E.1i&&2.e.l(\'X\',2.2y))},2x:5(4){4.U=4.U||{};d(4.U.2z){6}(2.w&&2.14(4));2.15=4;g o=2,2A=(4.4t==1),2B=(Y 2.f.1J=="Z"?$(4.T).1k().1p(4.T).1z(2.f.1J).K:n);d(!2A||2B||!2.2C(4)){6 z}2.1n=!2.f.1K;d(!2.1n){2.4u=4v(5(){o.1n=z},2.f.1K)}d(2.1L(4)&&2.1M(4)){2.w=(2.1N(4)!==n);d(!2.w){4.1O();6 z}}2.1P=5(4){6 o.2D(4)};2.1Q=5(4){6 o.14(4)};$(1c).A(\'2E.\'+2.v,2.1P).A(\'2F.\'+2.v,2.1Q);($.E.4w||4.1O());4.U.2z=z;6 z},2D:5(4){d($.E.1i&&!4.2k){6 2.14(4)}d(2.w){2.1R(4);6 4.1O()}d(2.1L(4)&&2.1M(4)){2.w=(2.1N(2.15,4)!==n);(2.w?2.1R(4):2.14(4))}6!2.w},14:5(4){$(1c).1h(\'2E.\'+2.v,2.1P).1h(\'2F.\'+2.v,2.1Q);d(2.w){2.w=n;2.1I=(4.T==2.15.T);2.2G(4)}6 n},1L:5(4){6(1S.4x(1S.2H(2.15.2I-4.2I),1S.2H(2.15.2J-4.2J))>=2.f.2K)},1M:5(4){6 2.1n},1N:5(4){},1R:5(4){},2G:5(4){},2C:5(4){6 z}};$.r.2w.1l={1J:4y,2K:1,1K:0}})(1T);', 62, 283, '||this||event|function|return||||||name|if|element|options|var|namespace||key|instance|attr|value|false|self|set|disabled|ui||args|test|widgetName|_mouseStarted|||true|bind|data|type|methods|browser|prototype|overflow|scroll|curCSS|call|length|apply|el|css|ariaState|elem|scrollParent|nodeName|tabIndex|target|originalEvent|fn|removeAttr|unselectable|typeof|string|widget|isMethodCall|_setData||_mouseUp|_mouseDownEvent|||remove|option|proto|plugins|document|arguments|replace|each|extend|unbind|msie|position|parents|defaults|prop|mouseDelayMet|plugin|add|for|left|has|isOverAxis|reference|ariaNS|aaa|aria|undefined|filter|isNaN|getter|getMethods|split|widgetEventPrefix|widgetBaseClass|_getData|callback|_preventClickEvent|cancel|delay|_mouseDistanceMet|_mouseDelayMet|_mouseStart|preventDefault|_mouseMoveDelegate|_mouseUpDelegate|_mouseDrag|Math|jQuery|_remove|isFF2|version|module|contains|compareDocumentPosition||hidden|size|top|height|width|ariaRole||wairole|MozUserSelect|selectstart|on|relative|absolute|fixed|auto|eq|match|focusable|tabindex|button|area|method|getterSetter|_init|isFunction|metadata|destroy|removeClass|state|eventName|props|mouse|_mouseDown|_mouseUnselectable|mouseHandled|btnIsLeft|elIsCancel|_mouseCapture|_mouseMove|mousemove|mouseup|_mouseStop|abs|pageX|pageY|distance|mozilla|parseFloat|in|push|parentNode|hasScroll|scrollLeft|scrollTop|isOver|keyCode|BACKSPACE|CAPS_LOCK|COMMA|188|CONTROL|DELETE|DOWN|||||||||END|ENTER|ESCAPE|HOME|INSERT|LEFT|NUMPAD_ADD|107|NUMPAD_DECIMAL|110|NUMPAD_DIVIDE|111|NUMPAD_ENTER|108|NUMPAD_MULTIPLY|106|NUMPAD_SUBTRACT|109|PAGE_DOWN|PAGE_UP|PERIOD|190|RIGHT|SHIFT|SPACE|TAB|UP|http|www|w3|org|2005|07|role|setAttributeNS|removeAttributeNS|triggerHandler|enableSelection|off|disableSelection|none|static|else|expr|toLowerCase|input|select|textarea|object|href|closest|tabbable||is|concat|inArray|Array|||slice|substring|_|new|eventPrefix|get|setData|getData|removeData|addClass|enable|disable|_trigger|Event|trigger|isDefaultPrevented|_mouseInit|mousedown|click|stopImmediatePropagation|started|_mouseDestroy|which|_mouseDelayTimer|setTimeout|safari|max|null'.split('|'), 0, {}))

/*
 * jQuery UI 1.7.1
 *
 * 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($) {

var _remove = $.fn.remove,
	isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);

//Helper functions and ui object
$.ui = {
	version: "1.7.1",

	// $.ui.plugin is deprecated.  Use the proxy pattern instead.
	plugin: {
		add: function(module, option, set) {
			var proto = $.ui[module].prototype;
			for(var i in set) {
				proto.plugins[i] = proto.plugins[i] || [];
				proto.plugins[i].push([option, set[i]]);
			}
		},
		call: function(instance, name, args) {
			var set = instance.plugins[name];
			if(!set || !instance.element[0].parentNode) { return; }

			for (var i = 0; i < set.length; i++) {
				if (instance.options[set[i][0]]) {
					set[i][1].apply(instance.element, args);
				}
			}
		}
	},

	contains: function(a, b) {
		return document.compareDocumentPosition
			? a.compareDocumentPosition(b) & 16
			: a !== b && a.contains(b);
	},

	hasScroll: function(el, a) {

		//If overflow is hidden, the element might have extra content, but the user wants to hide it
		if ($(el).css('overflow') == 'hidden') { return false; }

		var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
			has = false;

		if (el[scroll] > 0) { return true; }

		// TODO: determine which cases actually cause this to happen
		// if the element doesn't have the scroll set, see if it's possible to
		// set the scroll
		el[scroll] = 1;
		has = (el[scroll] > 0);
		el[scroll] = 0;
		return has;
	},

	isOverAxis: function(x, reference, size) {
		//Determines when x coordinate is over "b" element axis
		return (x > reference) && (x < (reference + size));
	},

	isOver: function(y, x, top, left, height, width) {
		//Determines when x, y coordinates is over "b" element
		return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
	},

	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
	}
};

// WAI-ARIA normalization
if (isFF2) {
	var attr = $.attr,
		removeAttr = $.fn.removeAttr,
		ariaNS = "http://www.w3.org/2005/07/aaa",
		ariaState = /^aria-/,
		ariaRole = /^wairole:/;

	$.attr = function(elem, name, value) {
		var set = value !== undefined;

		return (name == 'role'
			? (set
				? attr.call(this, elem, name, "wairole:" + value)
				: (attr.apply(this, arguments) || "").replace(ariaRole, ""))
			: (ariaState.test(name)
				? (set
					? elem.setAttributeNS(ariaNS,
						name.replace(ariaState, "aaa:"), value)
					: attr.call(this, elem, name.replace(ariaState, "aaa:")))
				: attr.apply(this, arguments)));
	};

	$.fn.removeAttr = function(name) {
		return (ariaState.test(name)
			? this.each(function() {
				this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
			}) : removeAttr.call(this, name));
	};
}

//jQuery plugins
$.fn.extend({
	remove: function() {
		// Safari has a native remove event which actually removes DOM elements,
		// so we have to use triggerHandler instead of trigger (#3037).
		$("*", this).add(this).each(function() {
			$(this).triggerHandler("remove");
		});
		return _remove.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 scrollParent;
		if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
			scrollParent = this.parents().filter(function() {
				return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
			}).eq(0);
		} else {
			scrollParent = this.parents().filter(function() {
				return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
			}).eq(0);
		}

		return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
	}
});


//Additional selectors
$.extend($.expr[':'], {
	data: function(elem, i, match) {
		return !!$.data(elem, match[3]);
	},

	focusable: function(element) {
		var nodeName = element.nodeName.toLowerCase(),
			tabIndex = $.attr(element, 'tabindex');
		return (/input|select|textarea|button|object/.test(nodeName)
			? !element.disabled
			: 'a' == nodeName || 'area' == nodeName
				? element.href || !isNaN(tabIndex)
				: !isNaN(tabIndex))
			// the element and all of its ancestors must be visible
			// the browser may report that the area is hidden
			&& !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
	},

	tabbable: function(element) {
		var tabIndex = $.attr(element, 'tabindex');
		return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
	}
});


// $.widget is a factory to create jQuery plugins
// taking some boilerplate code out of the plugin code
function getter(namespace, plugin, method, args) {
	function getMethods(type) {
		var methods = $[namespace][plugin][type] || [];
		return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
	}

	var methods = getMethods('getter');
	if (args.length == 1 && typeof args[0] == 'string') {
		methods = methods.concat(getMethods('getterSetter'));
	}
	return ($.inArray(method, methods) != -1);
}

$.widget = function(name, prototype) {
	var namespace = name.split(".")[0];
	name = name.split(".")[1];

	// create plugin method
	$.fn[name] = function(options) {
		var isMethodCall = (typeof options == 'string'),
			args = Array.prototype.slice.call(arguments, 1);

		// prevent calls to internal methods
		if (isMethodCall && options.substring(0, 1) == '_') {
			return this;
		}

		// handle getter methods
		if (isMethodCall && getter(namespace, name, options, args)) {
			var instance = $.data(this[0], name);
			return (instance ? instance[options].apply(instance, args)
				: undefined);
		}

		// handle initialization and non-getter methods
		return this.each(function() {
			var instance = $.data(this, name);

			// constructor
			(!instance && !isMethodCall &&
				$.data(this, name, new $[namespace][name](this, options))._init());

			// method call
			(instance && isMethodCall && $.isFunction(instance[options]) &&
				instance[options].apply(instance, args));
		});
	};

	// create widget constructor
	$[namespace] = $[namespace] || {};
	$[namespace][name] = function(element, options) {
		var self = this;

		this.namespace = namespace;
		this.widgetName = name;
		this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
		this.widgetBaseClass = namespace + '-' + name;

		this.options = $.extend({},
			$.widget.defaults,
			$[namespace][name].defaults,
			$.metadata && $.metadata.get(element)[name],
			options);

		this.element = $(element)
			.bind('setData.' + name, function(event, key, value) {
				if (event.target == element) {
					return self._setData(key, value);
				}
			})
			.bind('getData.' + name, function(event, key) {
				if (event.target == element) {
					return self._getData(key);
				}
			})
			.bind('remove', function() {
				return self.destroy();
			});
	};

	// add widget prototype
	$[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);

	// TODO: merge getter and getterSetter properties from widget prototype
	// and plugin prototype
	$[namespace][name].getterSetter = 'option';
};

$.widget.prototype = {
	_init: function() {},
	destroy: function() {
		this.element.removeData(this.widgetName)
			.removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
			.removeAttr('aria-disabled');
	},

	option: function(key, value) {
		var options = key,
			self = this;

		if (typeof key == "string") {
			if (value === undefined) {
				return this._getData(key);
			}
			options = {};
			options[key] = value;
		}

		$.each(options, function(key, value) {
			self._setData(key, value);
		});
	},
	_getData: function(key) {
		return this.options[key];
	},
	_setData: function(key, value) {
		this.options[key] = value;

		if (key == 'disabled') {
			this.element
				[value ? 'addClass' : 'removeClass'](
					this.widgetBaseClass + '-disabled' + ' ' +
					this.namespace + '-state-disabled')
				.attr("aria-disabled", value);
		}
	},

	enable: function() {
		this._setData('disabled', false);
	},
	disable: function() {
		this._setData('disabled', true);
	},

	_trigger: function(type, event, data) {
		var callback = this.options[type],
			eventName = (type == this.widgetEventPrefix
				? type : this.widgetEventPrefix + type);

		event = $.Event(event);
		event.type = eventName;

		// copy original event properties over to the new event
		// this would happen if we could call $.event.fix instead of $.Event
		// but we don't have a way to force an event to be fixed multiple times
		if (event.originalEvent) {
			for (var i = $.event.props.length, prop; i;) {
				prop = $.event.props[--i];
				event[prop] = event.originalEvent[prop];
			}
		}

		this.element.trigger(event, data);

		return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
			|| event.isDefaultPrevented());
	}
};

$.widget.defaults = {
	disabled: false
};


/** Mouse Interaction Plugin **/

$.ui.mouse = {
	_mouseInit: function() {
		var self = this;

		this.element
			.bind('mousedown.'+this.widgetName, function(event) {
				return self._mouseDown(event);
			})
			.bind('click.'+this.widgetName, function(event) {
				if(self._preventClickEvent) {
					self._preventClickEvent = false;
					event.stopImmediatePropagation();
					return false;
				}
			});

		// Prevent text selection in IE
		if ($.browser.msie) {
			this._mouseUnselectable = this.element.attr('unselectable');
			this.element.attr('unselectable', 'on');
		}

		this.started = false;
	},

	// TODO: make sure destroying one instance of mouse doesn't mess with
	// other instances of mouse
	_mouseDestroy: function() {
		this.element.unbind('.'+this.widgetName);

		// Restore text selection in IE
		($.browser.msie
			&& this.element.attr('unselectable', this._mouseUnselectable));
	},

	_mouseDown: function(event) {
		// don't let more than one widget handle mouseStart
		// TODO: figure out why we have to use originalEvent
		event.originalEvent = event.originalEvent || {};
		if (event.originalEvent.mouseHandled) { return; }

		// we may have missed mouseup (out of window)
		(this._mouseStarted && this._mouseUp(event));

		this._mouseDownEvent = event;

		var self = this,
			btnIsLeft = (event.which == 1),
			elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
			return true;
		}

		this.mouseDelayMet = !this.options.delay;
		if (!this.mouseDelayMet) {
			this._mouseDelayTimer = setTimeout(function() {
				self.mouseDelayMet = true;
			}, this.options.delay);
		}

		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
			this._mouseStarted = (this._mouseStart(event) !== false);
			if (!this._mouseStarted) {
				event.preventDefault();
				return true;
			}
		}

		// these delegates are required to keep context
		this._mouseMoveDelegate = function(event) {
			return self._mouseMove(event);
		};
		this._mouseUpDelegate = function(event) {
			return self._mouseUp(event);
		};
		$(document)
			.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
			.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);

		// preventDefault() is used to prevent the selection of text here -
		// however, in Safari, this causes select boxes not to be selectable
		// anymore, so this fix is needed
		($.browser.safari || event.preventDefault());

		event.originalEvent.mouseHandled = true;
		return true;
	},

	_mouseMove: function(event) {
		// IE mouseup check - mouseup happened when mouse was out of window
		if ($.browser.msie && !event.button) {
			return this._mouseUp(event);
		}

		if (this._mouseStarted) {
			this._mouseDrag(event);
			return event.preventDefault();
		}

		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
			this._mouseStarted =
				(this._mouseStart(this._mouseDownEvent, event) !== false);
			(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
		}

		return !this._mouseStarted;
	},

	_mouseUp: function(event) {
		$(document)
			.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
			.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);

		if (this._mouseStarted) {
			this._mouseStarted = false;
			this._preventClickEvent = (event.target == this._mouseDownEvent.target);
			this._mouseStop(event);
		}

		return false;
	},

	_mouseDistanceMet: function(event) {
		return (Math.max(
				Math.abs(this._mouseDownEvent.pageX - event.pageX),
				Math.abs(this._mouseDownEvent.pageY - event.pageY)
			) >= this.options.distance
		);
	},

	_mouseDelayMet: function(event) {
		return this.mouseDelayMet;
	},

	// These are placeholder methods, to be overriden by extending plugin
	_mouseStart: function(event) {},
	_mouseDrag: function(event) {},
	_mouseStop: function(event) {},
	_mouseCapture: function(event) { return true; }
};

$.ui.mouse.defaults = {
	cancel: null,
	distance: 1,
	delay: 0
};

})(jQuery);

