﻿/********************************************
*********************************************
jQuery.query - Query String Modification and Creation for jQuery
Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
Date: 2009/8/13
@author Blair Mitchelmore
@version 2.1.7

Adam Weber - 01/25/10
Modified base functionality slightly so that querystring keys are NOT case-sensitive
*********************************************
********************************************/

new function(d) { var a = "", b = true, c = false, f = d.separator || "&", e = d.spaces === c ? c : b, j = d.suffix === c ? a : "[]", h = d.prefix === c ? c : b, i = h ? d.hash === b ? "#" : "?" : a, g = d.numbers === c ? c : b; jQuery.query = new function() { var h = "object", d = null, j = function(a, c) { return a != undefined && a !== d && (!!c ? a.constructor == c : b) }, m = function(e) { var c, f = /\[([^[]*)\]/g, b = /^([^[]+)(\[.*\])?$/.exec(e), d = b[1], a = []; while (c = f.exec(b[2])) a.push(c[1]); return [d, a] }, k = function(b, c, e) { var m, g = c.shift(); if (typeof b != h) b = d; if (g === a) { if (!b) b = []; if (j(b, Array)) b.push(c.length == 0 ? e : k(d, c.slice(0), e)); else if (j(b, Object)) { var f = 0; while (b[f++] != d); b[--f] = c.length == 0 ? e : k(b[f], c.slice(0), e) } else { b = []; b.push(c.length == 0 ? e : k(d, c.slice(0), e)) } } else if (g && g.match(/^\s*[0-9]+\s*$/)) { var i = parseInt(g, 10); if (!b) b = []; b[i] = c.length == 0 ? e : k(b[i], c.slice(0), e) } else if (g) { var i = g.replace(/^\s*|\s*$/g, a); if (!b) b = {}; if (j(b, Array)) { for (var l = {}, f = 0; f < b.length; ++f) l[f] = b[f]; b = l } b[i] = c.length == 0 ? e : k(b[i], c.slice(0), e) } else return e; return b }, l = function(f) { var d = this; d.keys = {}; if (f.queryObject) jQuery.each(f.get(), function(a, b) { d.SET(a.toLowerCase(), b) }); else jQuery.each(arguments, function() { var f = a + this; f = f.replace(/^[?#]/, a); f = f.replace(/[;&]$/, a); if (e) f = f.replace(/[+]/g, " "); jQuery.each(f.split(/[&;]/), function() { var f = decodeURIComponent(this.split("=")[0] || a), e = decodeURIComponent(this.split("=")[1] || a); if (!f) return; if (g) if (/^[+-]?[0-9]+\.[0-9]*$/.test(e)) e = parseFloat(e); else if (/^[+-]?[0-9]+$/.test(e)) e = parseInt(e, 10); e = !e && e !== 0 ? b : e; if (e !== c && e !== b && typeof e != "number") e = e; d.SET(f.toLowerCase(), e) }) }); return d }; l.prototype = { queryObject: b, has: function(c, b) { var a = this.get(c); return j(a, b) }, GET: function(f) { if (!j(f)) return this.keys; var c = m(f), g = c[0], e = c[1], b = this.keys[g]; while (b != d && e.length != 0) b = b[e.shift()]; return typeof b == "number" ? b : b || a }, "get": function(c) { var a = this.GET(c.toLowerCase()); if (j(a, Object)) return jQuery.extend(b, {}, a); else if (j(a, Array)) return a.slice(0); return a }, SET: function(h, c) { var g = !j(c) ? d : c, a = m(h), b = a[0], f = a[1], e = this.keys[b]; this.keys[b] = k(e, f.slice(0), g); return this }, "set": function(a, b) { return this.copy().SET(a.toLowerCase(), b) }, REMOVE: function(a) { return this.SET(a, d).COMPACT() }, remove: function(a) { return this.copy().REMOVE(a) }, EMPTY: function() { var a = this; jQuery.each(a.keys, function(b) { delete a.keys[b] }); return a }, load: function(b) { var d = b.replace(/^.*?[#](.+?)(?:\?.+)?$/, "$1"), c = b.replace(/^.*?[?](.+?)(?:#.+)?$/, "$1"); return new l(b.length == c.length ? a : c, b.length == d.length ? a : d) }, empty: function() { return this.copy().EMPTY() }, copy: function() { return new l(this) }, COMPACT: function() { function a(c) { var d = typeof c == h ? j(c, Array) ? [] : {} : c; if (typeof c == h) { function e(a, c, b) { if (j(a, Array)) a.push(b); else a[c] = b } jQuery.each(c, function(f, c) { if (!j(c)) return b; e(d, f, a(c)) }) } return d } this.keys = a(this.keys); return this }, compact: function() { return this.copy().COMPACT() }, toString: function() { var o = 0, d = [], g = [], n = this, k = function(b) { b = b + a; if (e) b = b.replace(/ /g, "+"); return encodeURIComponent(b) }, m = function(f, g, d) { if (!j(d) || d === c) return; var e = [k(g)]; if (d !== b) { e.push("="); e.push(k(d)) } f.push(e.join(a)) }, l = function(d, b) { var c = function(c) { return !b || b == a ? [c].join(a) : [b, "[", c, "]"].join(a) }; jQuery.each(d, function(b, a) { if (typeof a == h) l(a, c(b)); else m(g, c(b), a) }) }; l(this.keys); g.length > 0 && d.push(i); d.push(g.join(f)); return d.join(a) } }; return new l(location.search, location.hash) } } (jQuery.query || {});


/********************************************
*********************************************
JSON2
http://www.JSON.org/json2.js
2009-09-29
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
See http://www.JSON.org/js.html
*********************************************
********************************************/

if (!this.JSON) { this.JSON = {}; }
(function()
{
	function f(n) { return n < 10 ? '0' + n : n; }
	if (typeof Date.prototype.toJSON !== 'function')
	{
		Date.prototype.toJSON = function(key)
		{
			return isFinite(this.valueOf()) ? this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z' : null;
		}; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(key) { return this.valueOf(); };
	}
	var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\' }, rep; function quote(string) { escapable.lastIndex = 0; return escapable.test(string) ? '"' + string.replace(escapable, function(a) { var c = meta[a]; return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }) + '"' : '"' + string + '"'; }
	function str(key, holder)
	{
		var i, k, v, length, mind = gap, partial, value = holder[key]; if (value && typeof value === 'object' && typeof value.toJSON === 'function') { value = value.toJSON(key); }
		if (typeof rep === 'function') { value = rep.call(holder, key, value); }
		switch (typeof value)
		{
			case 'string': return quote(value); case 'number': return isFinite(value) ? String(value) : 'null'; case 'boolean': case 'null': return String(value); case 'object': if (!value) { return 'null'; }
				gap += indent; partial = []; if (Object.prototype.toString.apply(value) === '[object Array]')
				{
					length = value.length; for (i = 0; i < length; i += 1) { partial[i] = str(i, value) || 'null'; }
					v = partial.length === 0 ? '[]' : gap ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : '[' + partial.join(',') + ']'; gap = mind; return v;
				}
				if (rep && typeof rep === 'object') { length = rep.length; for (i = 0; i < length; i += 1) { k = rep[i]; if (typeof k === 'string') { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v); } } } } else { for (k in value) { if (Object.hasOwnProperty.call(value, k)) { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v); } } } }
				v = partial.length === 0 ? '{}' : gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : '{' + partial.join(',') + '}'; gap = mind; return v;
		} 
	}
	if (typeof JSON.stringify !== 'function')
	{
		JSON.stringify = function(value, replacer, space)
		{
			var i; gap = ''; indent = ''; if (typeof space === 'number') { for (i = 0; i < space; i += 1) { indent += ' '; } } else if (typeof space === 'string') { indent = space; }
			rep = replacer; if (replacer && typeof replacer !== 'function' && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { throw new Error('JSON.stringify'); }
			return str('', { '': value });
		};
	}
	if (typeof JSON.parse !== 'function')
	{
		JSON.parse = function(text, reviver)
		{
			var j; function walk(holder, key)
			{
				var k, v, value = holder[key]; if (value && typeof value === 'object') { for (k in value) { if (Object.hasOwnProperty.call(value, k)) { v = walk(value, k); if (v !== undefined) { value[k] = v; } else { delete value[k]; } } } }
				return reviver.call(holder, key, value);
			}
			cx.lastIndex = 0; if (cx.test(text))
			{
				text = text.replace(cx, function(a)
				{
					return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
				});
			}
			if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { j = eval('(' + text + ')'); return typeof reviver === 'function' ? walk({ '': j }, '') : j; }
			throw new SyntaxError('JSON.parse');
		};
	} 
} ());


/********************************************
*********************************************
jQuery blockUI plugin
Version 2.31 (06-JAN-2010)
@requires jQuery v1.2.3 or later
Examples at: http://malsup.com/jquery/block/
Copyright (c) 2007-2008 M. Alsup
Dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html
Thanks to Amir-Hossein Sobhi for some excellent contributions!
*********************************************
********************************************/

; (function($) { if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) { alert('blockUI requires jQuery v1.2.3 or later!  You are using v' + $.fn.jquery); return } $.fn._fadeIn = $.fn.fadeIn; var B = function() { }; var C = document.documentMode || 0; var D = $.browser.msie && (($.browser.version < 8 && !C) || C < 8); var E = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !C; $.blockUI = function(a) { install(window, a) }; $.unblockUI = function(a) { remove(window, a) }; $.growlUI = function(a, b, c, d) { var e = $('<div class="growlUI"></div>'); if (a) e.append('<h1>' + a + '</h1>'); if (b) e.append('<h2>' + b + '</h2>'); if (c == undefined) c = 3000; $.blockUI({ message: e, fadeIn: 700, fadeOut: 1000, centerY: false, timeout: c, showOverlay: false, onUnblock: d, css: $.blockUI.defaults.growlCSS }) }; $.fn.block = function(a) { return this.unblock({ fadeOut: 0 }).each(function() { if ($.css(this, 'position') == 'static') this.style.position = 'relative'; if ($.browser.msie) this.style.zoom = 1; install(this, a) }) }; $.fn.unblock = function(a) { return this.each(function() { remove(this, a) }) }; $.blockUI.version = 2.31; $.blockUI.defaults = { message: '<h1>Please wait...</h1>', title: null, draggable: true, theme: false, css: { padding: 0, margin: 0, width: '30%', top: '40%', left: '35%', textAlign: 'center', color: '#000', border: '3px solid #aaa', backgroundColor: '#fff', cursor: 'wait' }, themedCSS: { width: '30%', top: '40%', left: '35%' }, overlayCSS: { backgroundColor: '#000', opacity: 0.6, cursor: 'wait' }, growlCSS: { width: '350px', top: '10px', left: '', right: '10px', border: 'none', padding: '5px', opacity: 0.6, cursor: 'default', color: '#fff', backgroundColor: '#000', '-webkit-border-radius': '10px', '-moz-border-radius': '10px' }, iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', forceIframe: false, baseZ: 1000, centerX: true, centerY: true, allowBodyStretch: true, bindEvents: true, constrainTabKey: true, fadeIn: 200, fadeOut: 400, timeout: 0, showOverlay: true, focusInput: true, applyPlatformOpacityRules: true, onBlock: null, onUnblock: null, quirksmodeOffsetHack: 4 }; var F = null; var G = []; function install(c, d) { var e = (c == window); var f = d && d.message !== undefined ? d.message : undefined; d = $.extend({}, $.blockUI.defaults, d || {}); d.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, d.overlayCSS || {}); var g = $.extend({}, $.blockUI.defaults.css, d.css || {}); var h = $.extend({}, $.blockUI.defaults.themedCSS, d.themedCSS || {}); f = f === undefined ? d.message : f; if (e && F) remove(window, { fadeOut: 0 }); if (f && typeof f != 'string' && (f.parentNode || f.jquery)) { var j = f.jquery ? f[0] : f; var k = {}; $(c).data('blockUI.history', k); k.el = j; k.parent = j.parentNode; k.display = j.style.display; k.position = j.style.position; if (k.parent) k.parent.removeChild(j) } var z = d.baseZ; var m = ($.browser.msie || d.forceIframe) ? $('<iframe class="blockUI" style="z-index:' + (z++) + ';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="' + d.iframeSrc + '"></iframe>') : $('<div class="blockUI" style="display:none"></div>'); var n = $('<div class="blockUI blockOverlay" style="z-index:' + (z++) + ';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'); var p; if (d.theme && e) { var s = '<div class="blockUI blockMsg blockPage ui-dialog ui-widget ui-corner-all" style="z-index:' + z + ';display:none;position:fixed">' + '<div class="ui-widget-header ui-dialog-titlebar blockTitle">' + (d.title || '&nbsp;') + '</div>' + '<div class="ui-widget-content ui-dialog-content"></div>' + '</div>'; p = $(s) } else { p = e ? $('<div class="blockUI blockMsg blockPage" style="z-index:' + z + ';display:none;position:fixed"></div>') : $('<div class="blockUI blockMsg blockElement" style="z-index:' + z + ';display:none;position:absolute"></div>') } if (f) { if (d.theme) { p.css(h); p.addClass('ui-widget-content') } else p.css(g) } if (!d.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform))) n.css(d.overlayCSS); n.css('position', e ? 'fixed' : 'absolute'); if ($.browser.msie || d.forceIframe) m.css('opacity', 0.0); var q = [m, n, p], $par = e ? $('body') : $(c); $.each(q, function() { this.appendTo($par) }); if (d.theme && d.draggable && $.fn.draggable) { p.draggable({ handle: '.ui-dialog-titlebar', cancel: 'li' }) } var r = D && (!$.boxModel || $('object,embed', e ? null : c).length > 0); if (E || r) { if (e && d.allowBodyStretch && $.boxModel) $('html,body').css('height', '100%'); if ((E || !$.boxModel) && !e) { var t = sz(c, 'borderTopWidth'), l = sz(c, 'borderLeftWidth'); var u = t ? '(0 - ' + t + ')' : 0; var v = l ? '(0 - ' + l + ')' : 0 } $.each([m, n, p], function(i, o) { var s = o[0].style; s.position = 'absolute'; if (i < 2) { e ? s.setExpression('height', 'Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:' + d.quirksmodeOffsetHack + ') + "px"') : s.setExpression('height', 'this.parentNode.offsetHeight + "px"'); e ? s.setExpression('width', 'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') : s.setExpression('width', 'this.parentNode.offsetWidth + "px"'); if (v) s.setExpression('left', v); if (u) s.setExpression('top', u) } else if (d.centerY) { if (e) s.setExpression('top', '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); s.marginTop = 0 } else if (!d.centerY && e) { var a = (d.css && d.css.top) ? parseInt(d.css.top) : 0; var b = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + ' + a + ') + "px"'; s.setExpression('top', b) } }) } if (f) { if (d.theme) p.find('.ui-widget-content').append(f); else p.append(f); if (f.jquery || f.nodeType) $(f).show() } if (($.browser.msie || d.forceIframe) && d.showOverlay) m.show(); if (d.fadeIn) { var w = d.onBlock ? d.onBlock : B; var x = (d.showOverlay && !f) ? w : B; var y = f ? w : B; if (d.showOverlay) n._fadeIn(d.fadeIn, x); if (f) p._fadeIn(d.fadeIn, y) } else { if (d.showOverlay) n.show(); if (f) p.show(); if (d.onBlock) d.onBlock() } bind(1, c, d); if (e) { F = p[0]; G = $(':input:enabled:visible', F); if (d.focusInput) setTimeout(focus, 20) } else center(p[0], d.centerX, d.centerY); if (d.timeout) { var A = setTimeout(function() { e ? $.unblockUI(d) : $(c).unblock(d) }, d.timeout); $(c).data('blockUI.timeout', A) } }; function remove(a, b) { var c = (a == window); var d = $(a); var e = d.data('blockUI.history'); var f = d.data('blockUI.timeout'); if (f) { clearTimeout(f); d.removeData('blockUI.timeout') } b = $.extend({}, $.blockUI.defaults, b || {}); bind(0, a, b); var g; if (c) g = $('body').children().filter('.blockUI').add('body > .blockUI'); else g = $('.blockUI', a); if (c) F = G = null; if (b.fadeOut) { g.fadeOut(b.fadeOut); setTimeout(function() { reset(g, e, b, a) }, b.fadeOut) } else reset(g, e, b, a) }; function reset(a, b, c, d) { a.each(function(i, o) { if (this.parentNode) this.parentNode.removeChild(this) }); if (b && b.el) { b.el.style.display = b.display; b.el.style.position = b.position; if (b.parent) b.parent.appendChild(b.el); $(d).removeData('blockUI.history') } if (typeof c.onUnblock == 'function') c.onUnblock(d, c) }; function bind(b, a, c) { var d = a == window, $el = $(a); if (!b && (d && !F || !d && !$el.data('blockUI.isBlocked'))) return; if (!d) $el.data('blockUI.isBlocked', b); if (!c.bindEvents || (b && !c.showOverlay)) return; var e = 'mousedown mouseup keydown keypress'; b ? $(document).bind(e, c, handler) : $(document).unbind(e, handler) }; function handler(e) { if (e.keyCode && e.keyCode == 9) { if (F && e.data.constrainTabKey) { var a = G; var b = !e.shiftKey && e.target == a[a.length - 1]; var c = e.shiftKey && e.target == a[0]; if (b || c) { setTimeout(function() { focus(c) }, 10); return false } } } if ($(e.target).parents('div.blockMsg').length > 0) return true; return $(e.target).parents().children().filter('div.blockUI').length == 0 }; function focus(a) { if (!G) return; var e = G[a === true ? G.length - 1 : 0]; if (e) e.focus() }; function center(a, x, y) { var p = a.parentNode, s = a.style; var l = ((p.offsetWidth - a.offsetWidth) / 2) - sz(p, 'borderLeftWidth'); var t = ((p.offsetHeight - a.offsetHeight) / 2) - sz(p, 'borderTopWidth'); if (x) s.left = l > 0 ? (l + 'px') : '0'; if (y) s.top = t > 0 ? (t + 'px') : '0' }; function sz(a, p) { return parseInt($.css(a, p)) || 0 } })(jQuery);


