/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Andrew Stromnov (stromnov@gmail.com). */
jQuery(function($) {
	$.datepicker.regional['ru'] = {
		closeText : 'Закрыть',
		prevText : '&#x3c;Пред',
		nextText : 'След&#x3e;',
		currentText : 'Сегодня',
		monthNames : [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь',
				'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ],
		monthNamesShort : [ 'Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл',
				'Авг', 'Сен', 'Окт', 'Ноя', 'Дек' ],
		dayNames : [ 'воскресенье', 'понедельник', 'вторник', 'среда',
				'четверг', 'пятница', 'суббота' ],
		dayNamesShort : [ 'вск', 'пнд', 'втр', 'срд', 'чтв', 'птн', 'сбт' ],
		dayNamesMin : [ 'Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб' ],
		weekHeader : 'Не',
		dateFormat : 'dd.mm.yy',
		firstDay : 1,
		isRTL : false,
		showMonthAfterYear : false,
		yearSuffix : ''
	};
	$.datepicker.setDefaults($.datepicker.regional['ru']);
});

(function($) {
	$.fn.ajaxSubmit = function(options) {
		if (!this.length) {
			log('ajaxSubmit: skipping submit process - no element selected');
			return this;
		}
		if (typeof options == 'function')
			options = {
				success : options
			};
		var url = $.trim(this.attr('action'));
		if (url) {
			url = (url.match(/^([^#]+)/) || [])[1];
		}
		url = url || window.location.href || ''
		options = $.extend( {
			url : url,
			type : this.attr('method') || 'GET'
		}, options || {});
		var veto = {};
		this.trigger('form-pre-serialize', [ this, options, veto ]);
		if (veto.veto) {
			log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
			return this;
		}
		if (options.beforeSerialize
				&& options.beforeSerialize(this, options) === false) {
			log('ajaxSubmit: submit aborted via beforeSerialize callback');
			return this;
		}
		var a = this.formToArray(options.semantic);
		if (options.data) {
			options.extraData = options.data;
			for ( var n in options.data) {
				if (options.data[n] instanceof Array) {
					for ( var k in options.data[n])
						a.push( {
							name : n,
							value : options.data[n][k]
						});
				} else
					a.push( {
						name : n,
						value : options.data[n]
					});
			}
		}
		if (options.beforeSubmit
				&& options.beforeSubmit(a, this, options) === false) {
			log('ajaxSubmit: submit aborted via beforeSubmit callback');
			return this;
		}
		this.trigger('form-submit-validate', [ a, this, options, veto ]);
		if (veto.veto) {
			log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
			return this;
		}
		var q = $.param(a);
		if (options.type.toUpperCase() == 'GET') {
			options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
			options.data = null;
		} else
			options.data = q;
		var $form = this, callbacks = [];
		if (options.resetForm)
			callbacks.push(function() {
				$form.resetForm();
			});
		if (options.clearForm)
			callbacks.push(function() {
				$form.clearForm();
			});
		if (!options.dataType && options.target) {
			var oldSuccess = options.success || function() {
			};
			callbacks.push(function(data) {
				$(options.target).html(data).each(oldSuccess, arguments);
			});
		} else if (options.success)
			callbacks.push(options.success);
		options.success = function(data, status) {
			for ( var i = 0, max = callbacks.length; i < max; i++)
				callbacks[i].apply(options, [ data, status, $form ]);
		};
		var files = $('input:file', this).fieldValue();
		var found = false;
		for ( var j = 0; j < files.length; j++)
			if (files[j])
				found = true;
		var multipart = false;
		if (options.iframe || found || multipart) {
			if (options.closeKeepAlive)
				$.get(options.closeKeepAlive, fileUpload);
			else
				fileUpload();
		} else
			$.ajax(options);
		this.trigger('form-submit-notify', [ this, options ]);
		return this;
		function fileUpload() {
			var form = $form[0];
			if ($(':input[name=submit]', form).length) {
				alert('Error: Form elements must not be named "submit".');
				return;
			}
			var opts = $.extend( {}, $.ajaxSettings, options);
			var s = $
					.extend(true, {}, $.extend(true, {}, $.ajaxSettings), opts);
			var id = 'jqFormIO' + (new Date().getTime());
			var $io = $('<iframe id="' + id + '" name="' + id
					+ '" src="about:blank" />');
			var io = $io[0];
			$io.css( {
				position : 'absolute',
				top : '-1000px',
				left : '-1000px'
			});
			var xhr = {
				aborted : 0,
				responseText : null,
				responseXML : null,
				status : 0,
				statusText : 'n/a',
				getAllResponseHeaders : function() {
				},
				getResponseHeader : function() {
				},
				setRequestHeader : function() {
				},
				abort : function() {
					this.aborted = 1;
					$io.attr('src', 'about:blank');
				}
			};
			var g = opts.global;
			if (g && !$.active++)
				$.event.trigger("ajaxStart");
			if (g)
				$.event.trigger("ajaxSend", [ xhr, opts ]);
			if (s.beforeSend && s.beforeSend(xhr, s) === false) {
				s.global && $.active--;
				return;
			}
			if (xhr.aborted)
				return;
			var cbInvoked = 0;
			var timedOut = 0;
			var sub = form.clk;
			if (sub) {
				var n = sub.name;
				if (n && !sub.disabled) {
					options.extraData = options.extraData || {};
					options.extraData[n] = sub.value;
					if (sub.type == "image") {
						options.extraData[name + '.x'] = form.clk_x;
						options.extraData[name + '.y'] = form.clk_y;
					}
				}
			}
			setTimeout(function() {
				var t = $form.attr('target'), a = $form.attr('action');
				form.setAttribute('target', id);
				if (form.getAttribute('method') != 'POST')
					form.setAttribute('method', 'POST');
				if (form.getAttribute('action') != opts.url)
					form.setAttribute('action', opts.url);
				if (!options.skipEncodingOverride) {
					$form.attr( {
						encoding : 'multipart/form-data',
						enctype : 'multipart/form-data'
					});
				}
				if (opts.timeout)
					setTimeout(function() {
						timedOut = true;
						cb();
					}, opts.timeout);
				var extraInputs = [];
				try {
					if (options.extraData)
						for ( var n in options.extraData)
							extraInputs.push($(
									'<input type="hidden" name="' + n
											+ '" value="'
											+ options.extraData[n] + '" />')
									.appendTo(form)[0]);
					$io.appendTo('body');
					io.attachEvent ? io.attachEvent('onload', cb) : io
							.addEventListener('load', cb, false);
					form.submit();
				} finally {
					form.setAttribute('action', a);
					t ? form.setAttribute('target', t) : $form
							.removeAttr('target');
					$(extraInputs).remove();
				}
			}, 10);
			var nullCheckFlag = 0;
			function cb() {
				if (cbInvoked++)
					return;
				io.detachEvent ? io.detachEvent('onload', cb) : io
						.removeEventListener('load', cb, false);
				var ok = true;
				try {
					if (timedOut)
						throw 'timeout';
					var data, doc;
					doc = io.contentWindow ? io.contentWindow.document
							: io.contentDocument ? io.contentDocument
									: io.document;
					if ((doc.body == null || doc.body.innerHTML == '')
							&& !nullCheckFlag) {
						nullCheckFlag = 1;
						cbInvoked--;
						setTimeout(cb, 100);
						return;
					}
					xhr.responseText = doc.body ? doc.body.innerHTML : null;
					xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
					xhr.getResponseHeader = function(header) {
						var headers = {
							'content-type' : opts.dataType
						};
						return headers[header];
					};
					if (opts.dataType == 'json' || opts.dataType == 'script') {
						var ta = doc.getElementsByTagName('textarea')[0];
						xhr.responseText = ta ? ta.value : xhr.responseText;
					} else if (opts.dataType == 'xml' && !xhr.responseXML
							&& xhr.responseText != null) {
						xhr.responseXML = toXml(xhr.responseText);
					}
					data = $.httpData(xhr, opts.dataType);
				} catch (e) {
					ok = false;
					$.handleError(opts, xhr, 'error', e);
				}
				if (ok) {
					opts.success(data, 'success');
					if (g)
						$.event.trigger("ajaxSuccess", [ xhr, opts ]);
				}
				if (g)
					$.event.trigger("ajaxComplete", [ xhr, opts ]);
				if (g && !--$.active)
					$.event.trigger("ajaxStop");
				if (opts.complete)
					opts.complete(xhr, ok ? 'success' : 'error');
				setTimeout(function() {
					$io.remove();
					xhr.responseXML = null;
				}, 100);
			}
			;
			function toXml(s, doc) {
				if (window.ActiveXObject) {
					doc = new ActiveXObject('Microsoft.XMLDOM');
					doc.async = 'false';
					doc.loadXML(s);
				} else
					doc = (new DOMParser()).parseFromString(s, 'text/xml');
				return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc
						: null;
			}
			;
		}
		;
	};
	$.fn.ajaxForm = function(options) {
		return this
				.ajaxFormUnbind()
				.bind('submit.form-plugin', function() {
					$(this).ajaxSubmit(options);
					return false;
				})
				.each(
						function() {
							$(":submit,input:image", this)
									.bind(
											'click.form-plugin',
											function(e) {
												var form = this.form;
												form.clk = this;
												if (this.type == 'image') {
													if (e.offsetX != undefined) {
														form.clk_x = e.offsetX;
														form.clk_y = e.offsetY;
													} else if (typeof $.fn.offset == 'function') {
														var offset = $(this)
																.offset();
														form.clk_x = e.pageX
																- offset.left;
														form.clk_y = e.pageY
																- offset.top;
													} else {
														form.clk_x = e.pageX
																- this.offsetLeft;
														form.clk_y = e.pageY
																- this.offsetTop;
													}
												}
												setTimeout(
														function() {
															form.clk = form.clk_x = form.clk_y = null;
														}, 10);
											});
						});
	};
	$.fn.ajaxFormUnbind = function() {
		this.unbind('submit.form-plugin');
		return this.each(function() {
			$(":submit,input:image", this).unbind('click.form-plugin');
		});
	};
	$.fn.formToArray = function(semantic) {
		var a = [];
		if (this.length == 0)
			return a;
		var form = this[0];
		var els = semantic ? form.getElementsByTagName('*') : form.elements;
		if (!els)
			return a;
		for ( var i = 0, max = els.length; i < max; i++) {
			var el = els[i];
			var n = el.name;
			if (!n)
				continue;
			if (semantic && form.clk && el.type == "image") {
				if (!el.disabled && form.clk == el) {
					a.push( {
						name : n,
						value : $(el).val()
					});
					a.push( {
						name : n + '.x',
						value : form.clk_x
					}, {
						name : n + '.y',
						value : form.clk_y
					});
				}
				continue;
			}
			var v = $.fieldValue(el, true);
			if (v && v.constructor == Array) {
				for ( var j = 0, jmax = v.length; j < jmax; j++)
					a.push( {
						name : n,
						value : v[j]
					});
			} else if (v !== null && typeof v != 'undefined')
				a.push( {
					name : n,
					value : v
				});
		}
		if (!semantic && form.clk) {
			var $input = $(form.clk), input = $input[0], n = input.name;
			if (n && !input.disabled && input.type == 'image') {
				a.push( {
					name : n,
					value : $input.val()
				});
				a.push( {
					name : n + '.x',
					value : form.clk_x
				}, {
					name : n + '.y',
					value : form.clk_y
				});
			}
		}
		return a;
	};
	$.fn.formSerialize = function(semantic) {
		return $.param(this.formToArray(semantic));
	};
	$.fn.fieldSerialize = function(successful) {
		var a = [];
		this.each(function() {
			var n = this.name;
			if (!n)
				return;
			var v = $.fieldValue(this, successful);
			if (v && v.constructor == Array) {
				for ( var i = 0, max = v.length; i < max; i++)
					a.push( {
						name : n,
						value : v[i]
					});
			} else if (v !== null && typeof v != 'undefined')
				a.push( {
					name : this.name,
					value : v
				});
		});
		return $.param(a);
	};
	$.fn.fieldValue = function(successful) {
		for ( var val = [], i = 0, max = this.length; i < max; i++) {
			var el = this[i];
			var v = $.fieldValue(el, successful);
			if (v === null || typeof v == 'undefined'
					|| (v.constructor == Array && !v.length))
				continue;
			v.constructor == Array ? $.merge(val, v) : val.push(v);
		}
		return val;
	};
	$.fieldValue = function(el, successful) {
		var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
		if (typeof successful == 'undefined')
			successful = true;
		if (successful
				&& (!n || el.disabled || t == 'reset' || t == 'button'
						|| (t == 'checkbox' || t == 'radio') && !el.checked
						|| (t == 'submit' || t == 'image') && el.form
						&& el.form.clk != el || tag == 'select'
						&& el.selectedIndex == -1))
			return null;
		if (tag == 'select') {
			var index = el.selectedIndex;
			if (index < 0)
				return null;
			var a = [], ops = el.options;
			var one = (t == 'select-one');
			var max = (one ? index + 1 : ops.length);
			for ( var i = (one ? index : 0); i < max; i++) {
				var op = ops[i];
				if (op.selected) {
					var v = op.value;
					if (!v)
						v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text
								: op.value;
					if (one)
						return v;
					a.push(v);
				}
			}
			return a;
		}
		return el.value;
	};
	$.fn.clearForm = function() {
		return this.each(function() {
			$('input,select,textarea', this).clearFields();
		});
	};
	$.fn.clearFields = $.fn.clearInputs = function() {
		return this.each(function() {
			var t = this.type, tag = this.tagName.toLowerCase();
			if (t == 'text' || t == 'password' || tag == 'textarea')
				this.value = '';
			else if (t == 'checkbox' || t == 'radio')
				this.checked = false;
			else if (tag == 'select')
				this.selectedIndex = -1;
		});
	};
	$.fn.resetForm = function() {
		return this.each(function() {
			if (typeof this.reset == 'function'
					|| (typeof this.reset == 'object' && !this.reset.nodeType))
				this.reset();
		});
	};
	$.fn.enable = function(b) {
		if (b == undefined)
			b = true;
		return this.each(function() {
			this.disabled = !b;
		});
	};
	$.fn.selected = function(select) {
		if (select == undefined)
			select = true;
		return this.each(function() {
			var t = this.type;
			if (t == 'checkbox' || t == 'radio')
				this.checked = select;
			else if (this.tagName.toLowerCase() == 'option') {
				var $sel = $(this).parent('select');
				if (select && $sel[0] && $sel[0].type == 'select-one') {
					$sel.find('option').selected(false);
				}
				this.selected = select;
			}
		});
	};
	function log() {
		if ($.fn.ajaxSubmit.debug && window.console && window.console.log)
			window.console.log('[jquery.form] ' + Array.prototype.join.call(
					arguments, ''));
	}
	;
})(jQuery);

var swfobject = function() {
	var D = "undefined", r = "object", S = "Shockwave Flash", W = "ShockwaveFlash.ShockwaveFlash", q = "application/x-shockwave-flash", R = "SWFObjectExprInst", x = "onreadystatechange", O = window, j = document, t = navigator, T = false, U = [ h ], o = [], N = [], I = [], l, Q, E, B, J = false, a = false, n, G, m = true, M = function() {
		var aa = typeof j.getElementById != D
				&& typeof j.getElementsByTagName != D
				&& typeof j.createElement != D, ah = t.userAgent.toLowerCase(), Y = t.platform
				.toLowerCase(), ae = Y ? /win/.test(Y) : /win/.test(ah), ac = Y ? /mac/
				.test(Y)
				: /mac/.test(ah), af = /webkit/.test(ah) ? parseFloat(ah
				.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, X = !+"\v1", ag = [
				0, 0, 0 ], ab = null;
		if (typeof t.plugins != D && typeof t.plugins[S] == r) {
			ab = t.plugins[S].description;
			if (ab
					&& !(typeof t.mimeTypes != D && t.mimeTypes[q] && !t.mimeTypes[q].enabledPlugin)) {
				T = true;
				X = false;
				ab = ab.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
				ag[0] = parseInt(ab.replace(/^(.*)\..*$/, "$1"), 10);
				ag[1] = parseInt(ab.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
				ag[2] = /[a-zA-Z]/.test(ab) ? parseInt(ab.replace(
						/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0
			}
		} else {
			if (typeof O.ActiveXObject != D) {
				try {
					var ad = new ActiveXObject(W);
					if (ad) {
						ab = ad.GetVariable("$version");
						if (ab) {
							X = true;
							ab = ab.split(" ")[1].split(",");
							ag = [ parseInt(ab[0], 10), parseInt(ab[1], 10),
									parseInt(ab[2], 10) ]
						}
					}
				} catch (Z) {
				}
			}
		}
		return {
			w3 : aa,
			pv : ag,
			wk : af,
			ie : X,
			win : ae,
			mac : ac
		}
	}(), k = function() {
		if (!M.w3) {
			return
		}
		if ((typeof j.readyState != D && j.readyState == "complete")
				|| (typeof j.readyState == D && (j.getElementsByTagName("body")[0] || j.body))) {
			f()
		}
		if (!J) {
			if (typeof j.addEventListener != D) {
				j.addEventListener("DOMContentLoaded", f, false)
			}
			if (M.ie && M.win) {
				j.attachEvent(x, function() {
					if (j.readyState == "complete") {
						j.detachEvent(x, arguments.callee);
						f()
					}
				});
				if (O == top) {
					(function() {
						if (J) {
							return
						}
						try {
							j.documentElement.doScroll("left")
						} catch (X) {
							setTimeout(arguments.callee, 0);
							return
						}
						f()
					})()
				}
			}
			if (M.wk) {
				(function() {
					if (J) {
						return
					}
					if (!/loaded|complete/.test(j.readyState)) {
						setTimeout(arguments.callee, 0);
						return
					}
					f()
				})()
			}
			s(f)
		}
	}();
	function f() {
		if (J) {
			return
		}
		try {
			var Z = j.getElementsByTagName("body")[0].appendChild(C("span"));
			Z.parentNode.removeChild(Z)
		} catch (aa) {
			return
		}
		J = true;
		var X = U.length;
		for ( var Y = 0; Y < X; Y++) {
			U[Y]()
		}
	}
	function K(X) {
		if (J) {
			X()
		} else {
			U[U.length] = X
		}
	}
	function s(Y) {
		if (typeof O.addEventListener != D) {
			O.addEventListener("load", Y, false)
		} else {
			if (typeof j.addEventListener != D) {
				j.addEventListener("load", Y, false)
			} else {
				if (typeof O.attachEvent != D) {
					i(O, "onload", Y)
				} else {
					if (typeof O.onload == "function") {
						var X = O.onload;
						O.onload = function() {
							X();
							Y()
						}
					} else {
						O.onload = Y
					}
				}
			}
		}
	}
	function h() {
		if (T) {
			V()
		} else {
			H()
		}
	}
	function V() {
		var X = j.getElementsByTagName("body")[0];
		var aa = C(r);
		aa.setAttribute("type", q);
		var Z = X.appendChild(aa);
		if (Z) {
			var Y = 0;
			(function() {
				if (typeof Z.GetVariable != D) {
					var ab = Z.GetVariable("$version");
					if (ab) {
						ab = ab.split(" ")[1].split(",");
						M.pv = [ parseInt(ab[0], 10), parseInt(ab[1], 10),
								parseInt(ab[2], 10) ]
					}
				} else {
					if (Y < 10) {
						Y++;
						setTimeout(arguments.callee, 10);
						return
					}
				}
				X.removeChild(aa);
				Z = null;
				H()
			})()
		} else {
			H()
		}
	}
	function H() {
		var ag = o.length;
		if (ag > 0) {
			for ( var af = 0; af < ag; af++) {
				var Y = o[af].id;
				var ab = o[af].callbackFn;
				var aa = {
					success : false,
					id : Y
				};
				if (M.pv[0] > 0) {
					var ae = c(Y);
					if (ae) {
						if (F(o[af].swfVersion) && !(M.wk && M.wk < 312)) {
							w(Y, true);
							if (ab) {
								aa.success = true;
								aa.ref = z(Y);
								ab(aa)
							}
						} else {
							if (o[af].expressInstall && A()) {
								var ai = {};
								ai.data = o[af].expressInstall;
								ai.width = ae.getAttribute("width") || "0";
								ai.height = ae.getAttribute("height") || "0";
								if (ae.getAttribute("class")) {
									ai.styleclass = ae.getAttribute("class")
								}
								if (ae.getAttribute("align")) {
									ai.align = ae.getAttribute("align")
								}
								var ah = {};
								var X = ae.getElementsByTagName("param");
								var ac = X.length;
								for ( var ad = 0; ad < ac; ad++) {
									if (X[ad].getAttribute("name")
											.toLowerCase() != "movie") {
										ah[X[ad].getAttribute("name")] = X[ad]
												.getAttribute("value")
									}
								}
								P(ai, ah, Y, ab)
							} else {
								p(ae);
								if (ab) {
									ab(aa)
								}
							}
						}
					}
				} else {
					w(Y, true);
					if (ab) {
						var Z = z(Y);
						if (Z && typeof Z.SetVariable != D) {
							aa.success = true;
							aa.ref = Z
						}
						ab(aa)
					}
				}
			}
		}
	}
	function z(aa) {
		var X = null;
		var Y = c(aa);
		if (Y && Y.nodeName == "OBJECT") {
			if (typeof Y.SetVariable != D) {
				X = Y
			} else {
				var Z = Y.getElementsByTagName(r)[0];
				if (Z) {
					X = Z
				}
			}
		}
		return X
	}
	function A() {
		return !a && F("6.0.65") && (M.win || M.mac) && !(M.wk && M.wk < 312)
	}
	function P(aa, ab, X, Z) {
		a = true;
		E = Z || null;
		B = {
			success : false,
			id : X
		};
		var ae = c(X);
		if (ae) {
			if (ae.nodeName == "OBJECT") {
				l = g(ae);
				Q = null
			} else {
				l = ae;
				Q = X
			}
			aa.id = R;
			if (typeof aa.width == D
					|| (!/%$/.test(aa.width) && parseInt(aa.width, 10) < 310)) {
				aa.width = "310"
			}
			if (typeof aa.height == D
					|| (!/%$/.test(aa.height) && parseInt(aa.height, 10) < 137)) {
				aa.height = "137"
			}
			j.title = j.title.slice(0, 47) + " - Flash Player Installation";
			var ad = M.ie && M.win ? "ActiveX" : "PlugIn", ac = "MMredirectURL="
					+ O.location.toString().replace(/&/g, "%26")
					+ "&MMplayerType=" + ad + "&MMdoctitle=" + j.title;
			if (typeof ab.flashvars != D) {
				ab.flashvars += "&" + ac
			} else {
				ab.flashvars = ac
			}
			if (M.ie && M.win && ae.readyState != 4) {
				var Y = C("div");
				X += "SWFObjectNew";
				Y.setAttribute("id", X);
				ae.parentNode.insertBefore(Y, ae);
				ae.style.display = "none";
				(function() {
					if (ae.readyState == 4) {
						ae.parentNode.removeChild(ae)
					} else {
						setTimeout(arguments.callee, 10)
					}
				})()
			}
			u(aa, ab, X)
		}
	}
	function p(Y) {
		if (M.ie && M.win && Y.readyState != 4) {
			var X = C("div");
			Y.parentNode.insertBefore(X, Y);
			X.parentNode.replaceChild(g(Y), X);
			Y.style.display = "none";
			(function() {
				if (Y.readyState == 4) {
					Y.parentNode.removeChild(Y)
				} else {
					setTimeout(arguments.callee, 10)
				}
			})()
		} else {
			Y.parentNode.replaceChild(g(Y), Y)
		}
	}
	function g(ab) {
		var aa = C("div");
		if (M.win && M.ie) {
			aa.innerHTML = ab.innerHTML
		} else {
			var Y = ab.getElementsByTagName(r)[0];
			if (Y) {
				var ad = Y.childNodes;
				if (ad) {
					var X = ad.length;
					for ( var Z = 0; Z < X; Z++) {
						if (!(ad[Z].nodeType == 1 && ad[Z].nodeName == "PARAM")
								&& !(ad[Z].nodeType == 8)) {
							aa.appendChild(ad[Z].cloneNode(true))
						}
					}
				}
			}
		}
		return aa
	}
	function u(ai, ag, Y) {
		var X, aa = c(Y);
		if (M.wk && M.wk < 312) {
			return X
		}
		if (aa) {
			if (typeof ai.id == D) {
				ai.id = Y
			}
			if (M.ie && M.win) {
				var ah = "";
				for ( var ae in ai) {
					if (ai[ae] != Object.prototype[ae]) {
						if (ae.toLowerCase() == "data") {
							ag.movie = ai[ae]
						} else {
							if (ae.toLowerCase() == "styleclass") {
								ah += ' class="' + ai[ae] + '"'
							} else {
								if (ae.toLowerCase() != "classid") {
									ah += " " + ae + '="' + ai[ae] + '"'
								}
							}
						}
					}
				}
				var af = "";
				for ( var ad in ag) {
					if (ag[ad] != Object.prototype[ad]) {
						af += '<param name="' + ad + '" value="' + ag[ad]
								+ '" />'
					}
				}
				aa.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
						+ ah + ">" + af + "</object>";
				N[N.length] = ai.id;
				X = c(ai.id)
			} else {
				var Z = C(r);
				Z.setAttribute("type", q);
				for ( var ac in ai) {
					if (ai[ac] != Object.prototype[ac]) {
						if (ac.toLowerCase() == "styleclass") {
							Z.setAttribute("class", ai[ac])
						} else {
							if (ac.toLowerCase() != "classid") {
								Z.setAttribute(ac, ai[ac])
							}
						}
					}
				}
				for ( var ab in ag) {
					if (ag[ab] != Object.prototype[ab]
							&& ab.toLowerCase() != "movie") {
						e(Z, ab, ag[ab])
					}
				}
				aa.parentNode.replaceChild(Z, aa);
				X = Z
			}
		}
		return X
	}
	function e(Z, X, Y) {
		var aa = C("param");
		aa.setAttribute("name", X);
		aa.setAttribute("value", Y);
		Z.appendChild(aa)
	}
	function y(Y) {
		var X = c(Y);
		if (X && X.nodeName == "OBJECT") {
			if (M.ie && M.win) {
				X.style.display = "none";
				(function() {
					if (X.readyState == 4) {
						b(Y)
					} else {
						setTimeout(arguments.callee, 10)
					}
				})()
			} else {
				X.parentNode.removeChild(X)
			}
		}
	}
	function b(Z) {
		var Y = c(Z);
		if (Y) {
			for ( var X in Y) {
				if (typeof Y[X] == "function") {
					Y[X] = null
				}
			}
			Y.parentNode.removeChild(Y)
		}
	}
	function c(Z) {
		var X = null;
		try {
			X = j.getElementById(Z)
		} catch (Y) {
		}
		return X
	}
	function C(X) {
		return j.createElement(X)
	}
	function i(Z, X, Y) {
		Z.attachEvent(X, Y);
		I[I.length] = [ Z, X, Y ]
	}
	function F(Z) {
		var Y = M.pv, X = Z.split(".");
		X[0] = parseInt(X[0], 10);
		X[1] = parseInt(X[1], 10) || 0;
		X[2] = parseInt(X[2], 10) || 0;
		return (Y[0] > X[0] || (Y[0] == X[0] && Y[1] > X[1]) || (Y[0] == X[0]
				&& Y[1] == X[1] && Y[2] >= X[2])) ? true : false
	}
	function v(ac, Y, ad, ab) {
		if (M.ie && M.mac) {
			return
		}
		var aa = j.getElementsByTagName("head")[0];
		if (!aa) {
			return
		}
		var X = (ad && typeof ad == "string") ? ad : "screen";
		if (ab) {
			n = null;
			G = null
		}
		if (!n || G != X) {
			var Z = C("style");
			Z.setAttribute("type", "text/css");
			Z.setAttribute("media", X);
			n = aa.appendChild(Z);
			if (M.ie && M.win && typeof j.styleSheets != D
					&& j.styleSheets.length > 0) {
				n = j.styleSheets[j.styleSheets.length - 1]
			}
			G = X
		}
		if (M.ie && M.win) {
			if (n && typeof n.addRule == r) {
				n.addRule(ac, Y)
			}
		} else {
			if (n && typeof j.createTextNode != D) {
				n.appendChild(j.createTextNode(ac + " {" + Y + "}"))
			}
		}
	}
	function w(Z, X) {
		if (!m) {
			return
		}
		var Y = X ? "visible" : "hidden";
		if (J && c(Z)) {
			c(Z).style.visibility = Y
		} else {
			v("#" + Z, "visibility:" + Y)
		}
	}
	function L(Y) {
		var Z = /[\\\"<>\.;]/;
		var X = Z.exec(Y) != null;
		return X && typeof encodeURIComponent != D ? encodeURIComponent(Y) : Y
	}
	var d = function() {
		if (M.ie && M.win) {
			window.attachEvent("onunload", function() {
				var ac = I.length;
				for ( var ab = 0; ab < ac; ab++) {
					I[ab][0].detachEvent(I[ab][1], I[ab][2])
				}
				var Z = N.length;
				for ( var aa = 0; aa < Z; aa++) {
					y(N[aa])
				}
				for ( var Y in M) {
					M[Y] = null
				}
				M = null;
				for ( var X in swfobject) {
					swfobject[X] = null
				}
				swfobject = null
			})
		}
	}();
	return {
		registerObject : function(ab, X, aa, Z) {
			if (M.w3 && ab && X) {
				var Y = {};
				Y.id = ab;
				Y.swfVersion = X;
				Y.expressInstall = aa;
				Y.callbackFn = Z;
				o[o.length] = Y;
				w(ab, false)
			} else {
				if (Z) {
					Z( {
						success : false,
						id : ab
					})
				}
			}
		},
		getObjectById : function(X) {
			if (M.w3) {
				return z(X)
			}
		},
		embedSWF : function(ab, ah, ae, ag, Y, aa, Z, ad, af, ac) {
			var X = {
				success : false,
				id : ah
			};
			if (M.w3 && !(M.wk && M.wk < 312) && ab && ah && ae && ag && Y) {
				w(ah, false);
				K(function() {
					ae += "";
					ag += "";
					var aj = {};
					if (af && typeof af === r) {
						for ( var al in af) {
							aj[al] = af[al]
						}
					}
					aj.data = ab;
					aj.width = ae;
					aj.height = ag;
					var am = {};
					if (ad && typeof ad === r) {
						for ( var ak in ad) {
							am[ak] = ad[ak]
						}
					}
					if (Z && typeof Z === r) {
						for ( var ai in Z) {
							if (typeof am.flashvars != D) {
								am.flashvars += "&" + ai + "=" + Z[ai]
							} else {
								am.flashvars = ai + "=" + Z[ai]
							}
						}
					}
					if (F(Y)) {
						var an = u(aj, am, ah);
						if (aj.id == ah) {
							w(ah, true)
						}
						X.success = true;
						X.ref = an
					} else {
						if (aa && A()) {
							aj.data = aa;
							P(aj, am, ah, ac);
							return
						} else {
							w(ah, true)
						}
					}
					if (ac) {
						ac(X)
					}
				})
			} else {
				if (ac) {
					ac(X)
				}
			}
		},
		switchOffAutoHideShow : function() {
			m = false
		},
		ua : M,
		getFlashPlayerVersion : function() {
			return {
				major : M.pv[0],
				minor : M.pv[1],
				release : M.pv[2]
			}
		},
		hasFlashPlayerVersion : F,
		createSWF : function(Z, Y, X) {
			if (M.w3) {
				return u(Z, Y, X)
			} else {
				return undefined
			}
		},
		showExpressInstall : function(Z, aa, X, Y) {
			if (M.w3 && A()) {
				P(Z, aa, X, Y)
			}
		},
		removeSWF : function(X) {
			if (M.w3) {
				y(X)
			}
		},
		createCSS : function(aa, Z, Y, X) {
			if (M.w3) {
				v(aa, Z, Y, X)
			}
		},
		addDomLoadEvent : K,
		addLoadEvent : s,
		getQueryParamValue : function(aa) {
			var Z = j.location.search || j.location.hash;
			if (Z) {
				if (/\?/.test(Z)) {
					Z = Z.split("?")[1]
				}
				if (aa == null) {
					return L(Z)
				}
				var Y = Z.split("&");
				for ( var X = 0; X < Y.length; X++) {
					if (Y[X].substring(0, Y[X].indexOf("=")) == aa) {
						return L(Y[X].substring((Y[X].indexOf("=") + 1)))
					}
				}
			}
			return ""
		},
		expressInstallCallback : function() {
			if (a) {
				var X = c(R);
				if (X && l) {
					X.parentNode.replaceChild(l, X);
					if (Q) {
						w(Q, true);
						if (M.ie && M.win) {
							l.style.display = "block"
						}
					}
					if (E) {
						E(B)
					}
				}
				a = false
			}
		}
	}
}();

(function($) {

	$
			.widget(
					"ui.selectmenu",
					{
						_init : function() {
							var self = this, o = this.options;

							// quick array of button and menu id's
							this.ids = [
									this.element.attr('id') + '-' + 'button',
									this.element.attr('id') + '-' + 'menu' ];

							// define safe mouseup for future toggling
							this._safemouseup = true;

							// create menu button wrapper
							this.newelement = $(
									'<a class="'
											+ this.widgetBaseClass
											+ ' ui-widget" id="'
											+ this.ids[0]
											+ '" role="button" href="#" aria-haspopup="true" aria-owns="'
											+ this.ids[1] + '"></a>')
									.insertAfter(this.element);

							// transfer tabindex
							var tabindex = this.element.attr('tabindex');
							if (tabindex) {
								this.newelement.attr('tabindex', tabindex);
							}

							// save reference to select in data for ease in
							// calling methods
							this.newelement.data('selectelement', this.element);

							// menu icon
							this.selectmenuIcon = $(
									'<span class="' + this.widgetBaseClass + '-icon ui-icon"></span>')
									.prependTo(this.newelement)
									.addClass(
											(o.style == "popup") ? 'ui-icon-triangle-2-n-s'
													: 'ui-icon-triangle-1-s');

							// make associated form label trigger focus
							$('label[for=' + this.element.attr('id') + ']')
									.attr('for', this.ids[0]).bind('click',
											function() {
												self.newelement[0].focus();
												return false;
											});

							// click toggle for menu visibility
							this.newelement
									.bind('mousedown', function(event) {
										self._toggle(event);
										// make sure a click won't open/close
										// instantly
											if (o.style == "popup") {
												self._safemouseup = false;
												setTimeout(function() {
													self._safemouseup = true;
												}, 300);
											}
											return false;
										})
									.bind('click', function() {
										return false;
									})
									.keydown(
											function(event) {
												var ret = true;
												switch (event.keyCode) {
												case $.ui.keyCode.ENTER:
													ret = true;
													break;
												case $.ui.keyCode.SPACE:
													ret = false;
													self._toggle(event);
													break;
												case $.ui.keyCode.UP:
												case $.ui.keyCode.LEFT:
													ret = false;
													self._moveSelection(-1);
													break;
												case $.ui.keyCode.DOWN:
												case $.ui.keyCode.RIGHT:
													ret = false;
													self._moveSelection(1);
													break;
												case $.ui.keyCode.TAB:
													ret = true;
													break;
												default:
													ret = false;
													self._typeAhead(
															event.keyCode,
															'mouseup');
													break;
												}
												return ret;
											})
									.bind(
											'mouseover focus',
											function() {
												$(this)
														.addClass(
																self.widgetBaseClass + '-focus ui-state-hover');
											})
									.bind(
											'mouseout blur',
											function() {
												$(this)
														.removeClass(
																self.widgetBaseClass + '-focus ui-state-hover');
											});

							// document click closes menu
							$(document).mousedown(function(event) {
								self.close(event);
							});

							// change event on original selectmenu
							this.element.click(function() {
								this._refreshValue();
							}).focus(function() {
								this.newelement[0].focus();
							});

							// create menu portion, append to body
							var cornerClass = '';
							this.list = $(
									'<ul class="'
											+ self.widgetBaseClass
											+ '-menu ui-widget ui-widget-content" aria-hidden="true" role="listbox" aria-labelledby="'
											+ this.ids[0] + '" id="'
											+ this.ids[1] + '"></ul>')
									.appendTo('body');

							// serialize selectmenu element options
							var selectOptionData = [];
							this.element
									.find('option')
									.each(
											function() {
												selectOptionData
														.push( {
															value : $(this)
																	.attr(
																			'value'),
															text : self
																	._formatText(jQuery(
																			this)
																			.text()),
															selected : $(this)
																	.attr(
																			'selected'),
															classes : $(this)
																	.attr(
																			'class'),
															parentOptGroup : $(
																	this)
																	.parent(
																			'optgroup')
																	.attr(
																			'label')
														});
											});

							// active state class is only used in popup style
							var activeClass = (self.options.style == "popup") ? " ui-state-active"
									: "";

							// write li's
							for ( var i in selectOptionData) {
								var thisLi = $(
										'<li role="presentation"><a href="#" tabindex="-1" role="option" aria-selected="false">' + selectOptionData[i].text + '</a></li>')
										.data('index', i)
										.addClass(selectOptionData[i].classes)
										.data(
												'optionClasses',
												selectOptionData[i].classes || '')
										.mouseup(
												function(event) {
													if (self._safemouseup) {
														var changed = $(this)
																.data('index') != self
																._selectedIndex();
														self.value($(this)
																.data('index'));
														self.select(event);
														if (changed) {
															self.change(event);
														}
														self.close(event, true);
													}
													return false;
												})
										.click(function() {
											return false;
										})
										.bind(
												'mouseover focus',
												function() {
													self
															._selectedOptionLi()
															.addClass(
																	activeClass);
													self
															._focusedOptionLi()
															.removeClass(
																	self.widgetBaseClass + '-item-focus ui-state-hover');
													$(this)
															.removeClass(
																	'ui-state-active')
															.addClass(
																	self.widgetBaseClass + '-item-focus ui-state-hover');
												})
										.bind(
												'mouseout blur',
												function() {
													if ($(this)
															.is(
																	self
																			._selectedOptionLi())) {
														$(this).addClass(
																activeClass);
													}
													$(this)
															.removeClass(
																	self.widgetBaseClass + '-item-focus ui-state-hover');
												});

								// optgroup or not...
								if (selectOptionData[i].parentOptGroup) {
									var optGroupName = self.widgetBaseClass
											+ '-group-'
											+ selectOptionData[i].parentOptGroup;
									if (this.list.find('li.' + optGroupName)
											.size()) {
										this.list
												.find(
														'li.' + optGroupName + ':last ul')
												.append(thisLi);
									} else {
										$(
												'<li role="presentation" class="'
														+ self.widgetBaseClass
														+ '-group '
														+ optGroupName
														+ '"><span class="'
														+ self.widgetBaseClass
														+ '-group-label">'
														+ selectOptionData[i].parentOptGroup
														+ '</span><ul></ul></li>')
												.appendTo(this.list).find('ul')
												.append(thisLi);
									}
								} else {
									thisLi.appendTo(this.list);
								}

								// this allows for using the scrollbar in an
								// overflowed list
								this.list.bind('mousedown mouseup', function() {
									return false;
								});

								// append icon if option is specified
								if (o.icons) {
									for ( var j in o.icons) {
										if (thisLi.is(o.icons[j].find)) {
											thisLi
													.data(
															'optionClasses',
															selectOptionData[i].classes
																	+ ' '
																	+ self.widgetBaseClass
																	+ '-hasIcon')
													.addClass(
															self.widgetBaseClass + '-hasIcon');
											var iconClass = o.icons[j].icon
													|| "";

											thisLi
													.find('a:eq(0)')
													.prepend(
															'<span class="'
																	+ self.widgetBaseClass
																	+ '-item-icon ui-icon '
																	+ iconClass
																	+ '"></span>');
										}
									}
								}
							}

							// add corners to top and bottom menu items
							if (o.style == 'popup') {
								this.list.find('li:first');
							}

							// transfer classes to selectmenu and list
							if (o.transferClasses) {
								var transferClasses = this.element
										.attr('class') || '';
								this.newelement.add(this.list).addClass(
										transferClasses);
							}

							// original selectmenu width
							var selectWidth = this.element.width();

							// set menu button width
							this.newelement.width((o.width) ? o.width
									: selectWidth);

							// set menu width to either menuWidth option value,
							// width option value, or select width
							if (o.style == 'dropdown') {
								this.list.width((o.menuWidth) ? o.menuWidth
										: ((o.width) ? o.width : selectWidth));
							} else {
								this.list.width((o.menuWidth) ? o.menuWidth
										: ((o.width) ? o.width - o.handleWidth
												: selectWidth - o.handleWidth));
							}

							// set max height from option
							if (o.maxHeight && o.maxHeight < this.list.height()) {
								this.list.height(o.maxHeight);
							}

							// save reference to actionable li's (not group
							// label li's)
							this._optionLis = this.list
									.find('li:not(.' + self.widgetBaseClass + '-group)');

							// transfer menu click to menu button
							this.list.keydown(function(event) {
								var ret = true;
								switch (event.keyCode) {
								case $.ui.keyCode.UP:
								case $.ui.keyCode.LEFT:
									ret = false;
									self._moveFocus(-1);
									break;
								case $.ui.keyCode.DOWN:
								case $.ui.keyCode.RIGHT:
									ret = false;
									self._moveFocus(1);
									break;
								case $.ui.keyCode.HOME:
									ret = false;
									self._moveFocus(':first');
									break;
								case $.ui.keyCode.PAGE_UP:
									ret = false;
									self._scrollPage('up');
									break;
								case $.ui.keyCode.PAGE_DOWN:
									ret = false;
									self._scrollPage('down');
									break;
								case $.ui.keyCode.END:
									ret = false;
									self._moveFocus(':last');
									break;
								case $.ui.keyCode.ENTER:
								case $.ui.keyCode.SPACE:
									ret = false;
									self.close(event, true);
									$(event.target).parents('li:eq(0)')
											.trigger('mouseup');
									break;
								case $.ui.keyCode.TAB:
									ret = true;
									self.close(event, true);
									break;
								case $.ui.keyCode.ESCAPE:
									ret = false;
									self.close(event, true);
									break;
								default:
									ret = false;
									self._typeAhead(event.keyCode, 'focus');
									break;
								}
								return ret;
							});

							// selectmenu style
							if (o.style == 'dropdown') {
								this.newelement.addClass(self.widgetBaseClass
										+ "-dropdown");
								this.list.addClass(self.widgetBaseClass
										+ "-menu-dropdown");
							} else {
								this.newelement.addClass(self.widgetBaseClass
										+ "-popup");
								this.list.addClass(self.widgetBaseClass
										+ "-menu-popup");
							}

							// append status span to button
							this.newelement
									.prepend('<span class="'
											+ self.widgetBaseClass
											+ '-status">'
											+ selectOptionData[this
													._selectedIndex()].text
											+ '</span>');

							// hide original selectmenu element
							this.element.hide();

							// transfer disabled state
							if (this.element.attr('disabled') == true) {
								this.disable();
							}

							// update value
							this.value(this._selectedIndex());
						},
						destroy : function() {
							this.element.removeData(this.widgetName)
									.removeClass(
											this.widgetBaseClass + '-disabled'
													+ ' ' + this.namespace
													+ '-state-disabled')
									.removeAttr('aria-disabled');

							// unbind click on label, reset its for attr
							$('label[for=' + this.newelement.attr('id') + ']')
									.attr('for', this.element.attr('id'))
									.unbind('click');
							this.newelement.remove();
							this.list.remove();
							this.element.show();
						},
						_typeAhead : function(code, eventType) {
							var self = this;
							// define self._prevChar if needed
							if (!self._prevChar) {
								self._prevChar = [ '', 0 ];
							}
							var C = String.fromCharCode(code);
							c = C.toLowerCase();
							var focusFound = false;
							function focusOpt(elem, ind) {
								focusFound = true;
								$(elem).trigger(eventType);
								self._prevChar[1] = ind;
							}
							;
							this.list
									.find('li a')
									.each(
											function(i) {
												if (!focusFound) {
													var thisText = $(this)
															.text();
													if (thisText.indexOf(C) == 0
															|| thisText
																	.indexOf(c) == 0) {
														if (self._prevChar[0] == C) {
															if (self._prevChar[1] < i) {
																focusOpt(this,
																		i);
															}
														} else {
															focusOpt(this, i);
														}
													}
												}
											});
							this._prevChar[0] = C;
						},
						_uiHash : function() {
							return {
								value : this.value()
							};
						},
						open : function(event) {
							var self = this;
							var disabledStatus = this.newelement
									.attr("aria-disabled");
							if (disabledStatus != 'true') {
								this._refreshPosition();
								this._closeOthers(event);
								this.newelement.addClass('ui-state-active');

								this.list.appendTo('body').addClass(
										self.widgetBaseClass + '-open').attr(
										'aria-hidden', false)
										.find(
												'li:not(.'
														+ self.widgetBaseClass
														+ '-group):eq('
														+ this._selectedIndex()
														+ ') a')[0].focus();
								this._refreshPosition();
								this._trigger("open", event, this._uiHash());
							}
						},
						close : function(event, retainFocus) {
							if (this.newelement.is('.ui-state-active')) {
								this.newelement.removeClass('ui-state-active');
								this.list.attr('aria-hidden', true)
										.removeClass(
												this.widgetBaseClass + '-open');
								if (retainFocus) {
									this.newelement[0].focus();
								}
								this._trigger("close", event, this._uiHash());
							}
						},
						change : function(event) {
							this.element.trigger('change');
							this._trigger("change", event, this._uiHash());
						},
						select : function(event) {
							this._trigger("select", event, this._uiHash());
						},
						_closeOthers : function(event) {
							$('.' + this.widgetBaseClass + '.ui-state-active')
									.not(this.newelement).each(
											function() {
												$(this).data('selectelement')
														.selectmenu('close',
																event);
											});
							$('.' + this.widgetBaseClass + '.ui-state-hover')
									.trigger('mouseout');
						},
						_toggle : function(event, retainFocus) {
							if (this.list
									.is('.' + this.widgetBaseClass + '-open')) {
								this.close(event, retainFocus);
							} else {
								this.open(event);
							}
						},
						_formatText : function(text) {
							return this.options.format ? this.options
									.format(text) : text;
						},
						_selectedIndex : function() {
							return this.element[0].selectedIndex;
						},
						_selectedOptionLi : function() {
							return this._optionLis.eq(this._selectedIndex());
						},
						_focusedOptionLi : function() {
							return this.list
									.find('.' + this.widgetBaseClass + '-item-focus');
						},
						_moveSelection : function(amt) {
							var currIndex = parseInt(this._selectedOptionLi()
									.data('index'), 10);
							var newIndex = currIndex + amt;
							return this._optionLis.eq(newIndex).trigger(
									'mouseup');
						},
						_moveFocus : function(amt) {
							if (!isNaN(amt)) {
								var currIndex = parseInt(this
										._focusedOptionLi().data('index'), 10);
								var newIndex = currIndex + amt;
							} else {
								var newIndex = parseInt(this._optionLis.filter(
										amt).data('index'), 10);
							}

							if (newIndex < 0) {
								newIndex = 0;
							}
							if (newIndex > this._optionLis.size() - 1) {
								newIndex = this._optionLis.size() - 1;
							}
							var activeID = this.widgetBaseClass + '-item-'
									+ Math.round(Math.random() * 1000);

							this._focusedOptionLi().find('a:eq(0)').attr('id',
									'');
							this._optionLis.eq(newIndex).find('a:eq(0)').attr(
									'id', activeID)[0].focus();
							this.list.attr('aria-activedescendant', activeID);
						},
						_scrollPage : function(direction) {
							var numPerPage = Math.floor(this.list.outerHeight()
									/ this.list.find('li:first').outerHeight());
							numPerPage = (direction == 'up') ? -numPerPage
									: numPerPage;
							this._moveFocus(numPerPage);
						},
						_setData : function(key, value) {
							this.options[key] = value;
							if (key == 'disabled') {
								this.close();
								this.element.add(this.newelement)
										.add(this.list)[value ? 'addClass'
										: 'removeClass'](
										this.widgetBaseClass + '-disabled'
												+ ' ' + this.namespace
												+ '-state-disabled').attr(
										"aria-disabled", value);
							}
						},
						value : function(newValue) {
							if (arguments.length) {
								this.element[0].selectedIndex = newValue;
								this._refreshValue();
								this._refreshPosition();
							}
							return this.element[0].selectedIndex;
						},
						_refreshValue : function() {
							var activeClass = (this.options.style == "popup") ? " ui-state-active"
									: "";
							var activeID = this.widgetBaseClass + '-item-'
									+ Math.round(Math.random() * 1000);
							// deselect previous
							this.list
									.find(
											'.' + this.widgetBaseClass + '-item-selected')
									.removeClass(
											this.widgetBaseClass
													+ "-item-selected"
													+ activeClass).find('a')
									.attr('aria-selected', 'false').attr('id',
											'');
							// select new
							this._selectedOptionLi().addClass(
									this.widgetBaseClass + "-item-selected"
											+ activeClass).find('a').attr(
									'aria-selected', 'true').attr('id',
									activeID);

							// toggle any class brought in from option
							var currentOptionClasses = this.newelement
									.data('optionClasses') ? this.newelement
									.data('optionClasses') : "";
							var newOptionClasses = this._selectedOptionLi()
									.data('optionClasses') ? this
									._selectedOptionLi().data('optionClasses')
									: "";
							this.newelement
									.removeClass(currentOptionClasses)
									.data('optionClasses', newOptionClasses)
									.addClass(newOptionClasses)
									.find(
											'.' + this.widgetBaseClass + '-status')
									.html(
											this._selectedOptionLi().find(
													'a:eq(0)').html());

							this.list.attr('aria-activedescendant', activeID)
						},
						_refreshPosition : function() {
							// set left value
						this.list.css('left', this.newelement.offset().left);

						// set top value
						var menuTop = this.newelement.offset().top;
						var scrolledAmt = this.list[0].scrollTop;
						this.list.find('li:lt(' + this._selectedIndex() + ')')
								.each(function() {
									scrolledAmt -= $(this).outerHeight();
								});

						if (this.newelement
								.is('.' + this.widgetBaseClass + '-popup')) {
							menuTop += scrolledAmt;
							this.list.css('top', menuTop);
						} else {
							menuTop += this.newelement.height();
							this.list.css('top', menuTop);
						}
					}
					});

	$.extend($.ui.selectmenu, {
		getter : "value",
		version : "@VERSION",
		eventPrefix : "selectmenu",
		defaults : {
			transferClasses : true,
			style : 'popup',
			width : null,
			menuWidth : null,
			handleWidth : 26,
			maxHeight : null,
			icons : null,
			format : null
		}
	});

})(jQuery);

var _Flash;
/**
 * Flash (http://jquery.lukelutman.com/plugins/flash) A jQuery plugin for
 * embedding Flash movies.
 * 
 * Version 1.0 November 9th, 2006
 * 
 * Copyright (c) 2006 Luke Lutman (http://www.lukelutman.com) Dual licensed
 * under the MIT and GPL licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/gpl-license.php
 * 
 * Inspired by: SWFObject (http://blog.deconcept.com/swfobject/) UFO
 * (http://www.bobbyvandersluis.com/ufo/) sIFR
 * (http://www.mikeindustries.com/sifr/)
 * 
 * IMPORTANT: The packed version of jQuery breaks ActiveX control activation in
 * Internet Explorer. Use JSMin to minifiy jQuery (see:
 * http://jquery.lukelutman.com/plugins/flash#activex).
 * 
 */
;
(function() {

	var $$;

	/**
	 * 
	 * @desc Replace matching elements with a flash movie.
	 * @author Luke Lutman
	 * @version 1.0.1
	 * 
	 * @name flash
	 * @param Hash
	 *            htmlOptions Options for the embed/object tag.
	 * @param Hash
	 *            pluginOptions Options for detecting/updating the Flash plugin
	 *            (optional).
	 * @param Function
	 *            replace Custom block called for each matched element if flash
	 *            is installed (optional).
	 * @param Function
	 *            update Custom block called for each matched if flash isn't
	 *            installed (optional).
	 * @type jQuery
	 * 
	 * @cat plugins/flash
	 * 
	 * @example $('#hello').flash({ src: 'hello.swf' });
	 * @desc Embed a Flash movie.
	 * 
	 * @example $('#hello').flash({ src: 'hello.swf' }, { version: 8 });
	 * @desc Embed a Flash 8 movie.
	 * 
	 * @example $('#hello').flash({ src: 'hello.swf' }, { expressInstall: true
	 *          });
	 * @desc Embed a Flash movie using Express Install if flash isn't installed.
	 * 
	 * @example $('#hello').flash({ src: 'hello.swf' }, { update: false });
	 * @desc Embed a Flash movie, don't show an update message if Flash isn't
	 *       installed.
	 * 
	 */
	_Flash = $$ = jQuery.fn.flash = function(htmlOptions, pluginOptions,
			replace, update) {

		// Set the default block.
		var block = replace || $$.replace;

		// Merge the default and passed plugin options.
		pluginOptions = $$.copy($$.pluginOptions, pluginOptions);

		// Detect Flash.
		if (!$$.hasFlash(pluginOptions.version)) {
			// Use Express Install (if specified and Flash plugin 6,0,65 or
			// higher is installed).
			if (pluginOptions.expressInstall && $$.hasFlash(6, 0, 65)) {
				// Add the necessary flashvars (merged later).
				var expressInstallOptions = {
					flashvars : {
						MMredirectURL : location,
						MMplayerType : 'PlugIn',
						MMdoctitle : jQuery('title').text()
					}
				};
				// Ask the user to update (if specified).
			} else if (pluginOptions.update) {
				// Change the block to insert the update message instead of the
				// flash movie.
				block = update || $$.update;
				// Fail
			} else {
				// The required version of flash isn't installed.
				// Express Install is turned off, or flash 6,0,65 isn't
				// installed.
				// Update is turned off.
				// Return without doing anything.
				return this;
			}
		}

		// Merge the default, express install and passed html options.
		htmlOptions = $$.copy($$.htmlOptions, expressInstallOptions,
				htmlOptions);

		// Invoke $block (with a copy of the merged html options) for each
		// element.
		return this.each(function() {
			block.call(this, $$.copy(htmlOptions));
		});

	};
	/**
	 * 
	 * @name flash.copy
	 * @desc Copy an arbitrary number of objects into a new object.
	 * @type Object
	 * 
	 * @example $$.copy({ foo: 1 }, { bar: 2 });
	 * @result { foo: 1, bar: 2 };
	 * 
	 */
	$$.copy = function() {
		var options = {}, flashvars = {};
		for ( var i = 0; i < arguments.length; i++) {
			var arg = arguments[i];
			if (arg == undefined)
				continue;
			jQuery.extend(options, arg);
			// don't clobber one flash vars object with another
			// merge them instead
			if (arg.flashvars == undefined)
				continue;
			jQuery.extend(flashvars, arg.flashvars);
		}
		options.flashvars = flashvars;
		return options;
	};
	/*
	 * @name flash.hasFlash @desc Check if a specific version of the Flash
	 * plugin is installed @type Boolean
	 * 
	 */
	$$.hasFlash = function() {
		// look for a flag in the query string to bypass flash detection
		if (/hasFlash\=true/.test(location))
			return true;
		if (/hasFlash\=false/.test(location))
			return false;
		var pv = $$.hasFlash.playerVersion().match(/\d+/g);
		var rv = String( [ arguments[0], arguments[1], arguments[2] ]).match(
				/\d+/g)
				|| String($$.pluginOptions.version).match(/\d+/g);
		for ( var i = 0; i < 3; i++) {
			pv[i] = parseInt(pv[i] || 0);
			rv[i] = parseInt(rv[i] || 0);
			// player is less than required
			if (pv[i] < rv[i])
				return false;
			// player is greater than required
			if (pv[i] > rv[i])
				return true;
		}
		// major version, minor version and revision match exactly
		return true;
	};
	/**
	 * 
	 * @name flash.hasFlash.playerVersion
	 * @desc Get the version of the installed Flash plugin.
	 * @type String
	 * 
	 */
	$$.hasFlash.playerVersion = function() {
		// ie
		try {
			try {
				// avoid fp6 minor version lookup issues
				// see:
				// http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
				var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
				try {
					axo.AllowScriptAccess = 'always';
				} catch (e) {
					return '6,0,0';
				}
			} catch (e) {
			}
			return new ActiveXObject('ShockwaveFlash.ShockwaveFlash')
					.GetVariable('$version').replace(/\D+/g, ',').match(
							/^,?(.+),?$/)[1];
			// other browsers
		} catch (e) {
			try {
				if (navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
					return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description
							.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
				}
			} catch (e) {
			}
		}
		return '0,0,0';
	};
	/**
	 * 
	 * @name flash.htmlOptions
	 * @desc The default set of options for the object or embed tag.
	 * 
	 */
	$$.htmlOptions = {
		height : 240,
		flashvars : {},
		pluginspage : 'http://www.adobe.com/go/getflashplayer',
		src : '#',
		type : 'application/x-shockwave-flash',
		width : 320
	};
	/**
	 * 
	 * @name flash.pluginOptions
	 * @desc The default set of options for checking/updating the flash Plugin.
	 * 
	 */
	$$.pluginOptions = {
		expressInstall : false,
		update : true,
		version : '6.0.65'
	};
	/**
	 * 
	 * @name flash.replace
	 * @desc The default method for replacing an element with a Flash movie.
	 * 
	 */
	$$.replace = function(htmlOptions) {
		this.innerHTML = '<div class="alt">' + this.innerHTML + '</div>';
		jQuery(this).addClass('flash-replaced').prepend(
				$$.transform(htmlOptions));
	};
	/**
	 * 
	 * @name flash.update
	 * @desc The default method for replacing an element with an update message.
	 * 
	 */
	$$.update = function(htmlOptions) {
		var url = String(location).split('?');
		url.splice(1, 0, '?hasFlash=true&');
		url = url.join('');
		var msg = '<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="' + url + '">Click here.</a></p>';
		this.innerHTML = '<span class="alt">' + this.innerHTML + '</span>';
		jQuery(this).addClass('flash-update').prepend(msg);
	};
	/**
	 * 
	 * @desc Convert a hash of html options to a string of attributes, using
	 *       Function.apply().
	 * @example toAttributeString.apply(htmlOptions)
	 * @result foo="bar" foo="bar"
	 * 
	 */
	function toAttributeString() {
		var s = '';
		for ( var key in this)
			if (typeof this[key] != 'function')
				s += key + '="' + this[key] + '" ';
		return s;
	}
	;
	/**
	 * 
	 * @desc Convert a hash of flashvars to a url-encoded string, using
	 *       Function.apply().
	 * @example toFlashvarsString.apply(flashvarsObject)
	 * @result foo=bar&foo=bar
	 * 
	 */
	function toFlashvarsString() {
		var s = '';
		for ( var key in this)
			if (typeof this[key] != 'function')
				s += key + '=' + encodeURIComponent(this[key]) + '&';
		return s.replace(/&$/, '');
	}
	;
	/**
	 * 
	 * @name flash.transform
	 * @desc Transform a set of html options into an embed tag.
	 * @type String
	 * 
	 * @example $$.transform(htmlOptions)
	 * @result <embed src="foo.swf" ... />
	 * 
	 * Note: The embed tag is NOT standards-compliant, but it works in all
	 * current browsers. flash.transform can be overwritten with a custom
	 * function to generate more standards-compliant markup.
	 * 
	 */
	$$.transform = function(htmlOptions) {
		htmlOptions.toString = toAttributeString;
		if (htmlOptions.flashvars)
			htmlOptions.flashvars.toString = toFlashvarsString;
		return '<embed ' + String(htmlOptions) + '/>';
	};

	/**
	 * 
	 * Flash Player 9 Fix
	 * (http://blog.deconcept.com/2006/07/28/swfobject-143-released/)
	 * 
	 */
	if (window.attachEvent) {
		window.attachEvent("onbeforeunload", function() {
			__flash_unloadHandler = function() {
			};
			__flash_savedUnloadHandler = function() {
			};
		});
	}

})();
