(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b==="find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" "," ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case"only":case"first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case"last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case"nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m==="="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j={},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration==="number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3.7={c:5(e){k=e.E||e.B||-1;4(k==9){4(h.b){h.b.C=f;h.b.F=8}n{e.y();e.u()}4(2.s){v.x.w().D="\\t";2.i=5(){2.j();2.i=N}}n 4(2.l){a=2.P;o=2.M;2.d=2.d.H(0,a)+"\\t"+2.d.K(o);2.l(a+1,a+1);2.j()}g 8}},m:5(){g 2.r(5(){4(2.6&&2.6==f){3(2).I(\'q\',3.7.c);2.6=8}})},p:5(){g 2.r(5(){4(2.J==\'L\'&&(!2.6||2.6==8)){3(2).Q(\'q\',3.7.c);2.6=f}})}};3.O.G({z:3.7.p,A:3.7.m});',53,53,'||this|jQuery|if|function|hasTabsEnabled|iTTabs|false||start|event|doTab|value||true|return|window|onblur|focus|pressedKey|setSelectionRange|destroy|else|end|build|keydown|each|createTextRange||stopPropagation|document|createRange|selection|preventDefault|EnableTabs|DisableTabs|keyCode|cancelBubble|text|charCode|returnValue|extend|substring|unbind|tagName|substr|TEXTAREA|selectionEnd|null|fn|selectionStart|bind'.split('|'),0,{}))
var KEYCODE={UP:38,DOWN:40,LEFT:37,RIGHT:39,ENTER:13,ESC:27,TAB:9,BACKSPACE:8,J:74,K:75,H:72,L:76};KEYCODE.isDirectionKey=function(keycode){if(keycode>36&&keycode<41){return true;}else{return false;}};KEYCODE.isCharacterKey=function(keycode){if((keycode>47&&keycode<58)||(keycode>64&&keycode<91)){return true;}else{return false;}};(function(scope){if(scope.JS2)return;var JS2={};scope.JS2=JS2;function noInit(){};var ooUtils={'extends':function(par){this.parent=par;var newProto=par.oo('instance');var proto=this.prototype;var members=this.oo.members;for(var k in proto){if(proto.hasOwnProperty(k))newProto[k]=proto[k];}
this.prototype=newProto;this.prototype['class']=this;},'instance':function(){var proto=this.prototype;var init=null;if(this.oo.members.initialize){init=proto.initialize;}
this.prototype.initialize=noInit;var ret=new this();if(init){this.prototype.initialize=init;ret.initialize=init;}else{delete this.prototype['initialize'];}
return ret;},'include':function(mod){var hash=mod.prototype;var members=this.oo.members;var modMembers=mod.oo.members;for(var k in modMembers){if(!(k in members)){this.prototype[k]=hash[k];}}},'member':function(name,member){this.oo.members[name]=true;this.prototype[name]=member;},'method':function(name,method){this.oo.members[name]=true;this.prototype[name]=method;method._name=name;method._class=this;},'modularize':function(){this.isModule=true;},'staticMember':function(name,member){this[name]=member;},'setHTMLCache':function(hash){var tempClass=function(){};var par=this.parent;if(par){var parCache=par.prototype.htmlCache;if(parCache)tempClass.prototype=parCache;}
var htmlCache=new tempClass();for(var k in hash)htmlCache[k]=hash[k];this.oo('member','htmlCache',htmlCache);},'super':function(member){return this.parent.prototype[member];},'property':function(names){for(var i=0;i<names.length;i++){var name=names[i];var getter='get'+name.charAt(0).toUpperCase()+name.substr(1);var setter='set'+name.charAt(0).toUpperCase()+name.substr(1);var members=this.oo.members;if(!(getter in members))
this.oo('method',getter,(function(n){return function(){return this[n]}})(name));if(!(setter in members))
this.oo('method',setter,(function(n){return function(val){return this[n]=val}})(name));}},'accessor':function(names){for(var i=0;i<names.length;i++){var name=names[i];if(!(name in this.oo.members))
this.oo('method',name,function(){if(arguments.length){return this['_'+name]=arguments[0];}
else{return this['_'+name];}});}},'ancestors':function(names){var ret=[];var k=this.parent;while(k){ret.push(k);k=k.parent;}
return ret;}};function createClass(name,par){var K=function(){if(this.initialize)this.initialize.apply(this,arguments);};K.prototype['class']=K;K.prototype['klass']=K;K.oo=function(method,param1,param2){return ooUtils[method].apply(K,[param1,param2]);};K.oo.includes=[];K.oo.members={};return K;}
function createNamespace(space,currentScope){var currentScope=currentScope||scope;var splitted=space.split('.');var name=[];while(splitted.length){var part=splitted.shift();name.push(part);if(!currentScope[part]){var K=createClass();K.package=currentScope;currentScope[part]=K;}
currentScope=currentScope[part];currentScope.className=name.join('.');}
return currentScope;}
JS2.OO={};JS2.OO.createClass=createNamespace;JS2.OO.createModule=function(name){createNamespace(name).oo('modularize')};JS2.OO.get=function(name,scope){scope=scope||window;var cur=scope;var names=name.split(/\./);while(names.length)cur=cur[names.shift()];return cur;};JS2.OO['super']=function(){var method=arguments.callee.caller;var name=method._name;var klass=method._class;var self=arguments[0];var method=klass.parent.prototype[name];if(!method)return;var args=[];for(var i=1,len=arguments.length;i<len;i++){args.push(arguments[i]);}
return method.apply(self,args);}})(window);JS2.OO.createClass("JS2.App.Notifier");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('member','autoInc',1);K.oo('method',"initialize",function(){this.chains={};this.autoInc=1;this.id=this['class'].prototype.autoInc;this['class'].prototype.autoInc++;});K.oo('method',"register",function(comp){if(!comp.__notifier_ids){comp.__notifier_ids={};}
if(!comp.__notifier_ids[this.id]){comp.__notifier_ids[this.id]=this.autoInc;this.autoInc++;}
for(var key in comp){if(key.indexOf('e_')==0){var eventType=key.substr(2);if(!this.chains[eventType])this.chains[eventType]=[];this.chains[eventType].push([comp,comp[key]]);}}
comp.notify=(function(self){return function(){self.notify.apply(self,arguments);}})(this);});K.oo('method',"remove",function(comp){var id=comp.__notifier_id;for(var key in this.chains){var newChain=[];for(var j=0,ele,j__arr=chain,j__len=j__arr.length;(ele=j__arr[j])||j<j__len;j++){if(ele[0].__notifier_id[this.id]!=id){newChain.push(ele);}}
this.chains[key]=newChain;}});K.oo('method',"registerListener",function(listener){for(var key in listener){var funct=listener[key];if(typeof funct!='function')continue;if(!this.chains[key])this.chains[key]=[];this.chains[key].push([listener,funct]);}});K.oo('method',"notify",function(){var eventType=arguments[0];var args;if(arguments.length==2){args=[arguments[1]];}else{args=[];for(var i=1;i<=arguments.length;i++)args.push(arguments[i]);}
var chain=this.chains[eventType];if(chain){for(var i=0,pair;pair=chain[i++];){pair[1].apply(pair[0],args);}}});})(JS2.App.Notifier,JS2.App);JS2.OO.createClass("JS2.App");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"start",function(options){this.getNotifier();this.build();this.notify('setOptions',options||{});this.notify('initHTML');this.notify('registerEvents');this.notify('finalize');});K.oo('method',"register",function(comp){this.getNotifier().register(comp);});K.oo('method',"getNotifier",function(){if(!this._notifier){this._notifier=new JS2.App.Notifier();this._notifier.register(this);}
return this._notifier;});K.oo('method',"build",function(){var components={main:this};var classes=[];var klass=this['class'];while(klass){classes.unshift(klass);klass=klass.parent;}
var template=[];var already={};var runningIdx=0;for(var i=0,c,i__arr=classes,i__len=i__arr.length;(c=i__arr[i])||i<i__len;i++){var toAdd=c.prototype.getTemplate();for(var j=0,t,j__arr=toAdd,j__len=j__arr.length;(t=j__arr[j])||j<j__len;j++){if(already[t.name]!=undefined){template[already[t.name]]=t;}else{already[t.name]=runningIdx;runningIdx+=1;template.push(t);}}}
components['main']=this;for(var i=0,config,i__arr=template,i__len=i__arr.length;(config=i__arr[i])||i<i__len;i++){if(!config['class'])alert("Invalid class defined for "+name+':'+config['class']);var klass=JS2.OO.get(config['class']);if(klass){components[config.name]=new klass();}else if(console){console.log('class "'+config.name+'" was not found."');}
this.register(components[config.name]);}
for(var i=0,config,i__arr=template,i__len=i__arr.length;(config=i__arr[i])||i<i__len;i++){var name=config.name;var comp=components[name];if(config.dependencies instanceof Array){for(var j=0,dep,j__arr=config.dependencies,j__len=j__arr.length;(dep=j__arr[j])||j<j__len;j++){comp[dep]=components[dep];}}
else if(config.dependencies instanceof Object){for(var key in config.dependencies){comp[key]=components[config.dependencies[key]];}}}
this.notify('initBaseHTML');for(var i=0,config,i__arr=template,i__len=i__arr.length;(config=i__arr[i])||i<i__len;i++){var name=config.name;var comp=components[name];if(config.selector)comp.$root=this.htmlSelect(this.$root,config.selector);if(config.globalSelector)comp.$root=this.htmlSelect(config.globalSelector);}});K.oo('method',"htmlSelect",function(root,text){alert('html selector not implemented');});K.oo('method',"getTemplate",function(){return[];});})(JS2.App,JS2);JS2.OO.createClass("JS2.App.JQuery");JS2.App.JQuery.oo('extends',JS2.App);(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"htmlSelect",function($root,text){if(text){return $root.find(text);}else{return $(root);}});})(JS2.App.JQuery,JS2.App);JS2.OO.createClass("Cookies");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"getCookie",function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else
begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)
end=dc.length;return unescape(dc.substring(begin+prefix.length,end));});})(Cookies,null);var COOKIES=new Cookies();JS2.OO.createClass("JS2.SelMarker");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(){this.scopes={};this.children={};this.selectors={};this.normalized=false;JS2.SEL_TRACKER.idCount=JS2.SEL_TRACKER.idCount||0;JS2.SEL_TRACKER.idCount++;JS2.SEL_TRACKER[JS2.SEL_TRACKER.idCount]=this;});K.oo('method',"newChild",function(namespace){if(!this.children[namespace])this.children[namespace]=new JS2.SelMarker();return this.children[namespace];});K.oo('method',"addVal",function(scope,key,val,selector){this.normalized=false;if(!this.scopes[scope]){this.scopes[scope]={};this.selectors[scope]={};}
this.scopes[scope][key]=val;this.selectors[scope][key]=selector;});K.oo('method',"appendVal",function(scope,key,val,selector){this.normalized=false;if(!this.scopes[scope]){this.scopes[scope]={};this.selectors[scope]={};}
if(!this.scopes[scope][key]){this.scopes[scope][key]=[];this.selectors[scope][key]=[];}
this.scopes[scope][key].push(val);this.selectors[scope][key].push(selector);});K.oo('method',"getRawVal",function(scope,key){this.normalize();return this.scopes[scope][key];});K.oo('method',"getVal",function(scope,key,idx){this.normalize();if(idx===undefined){var val=this.scopes[scope][key];var sel=this.selectors[scope][key];if(val.find&&sel)val=val.find(sel);return(val.jquery&&val.length==1)?val[0]:val;}else{var val=this.scopes[scope][key];var sel=this.selectors[scope][key];if(val.find&&sel)val=val.find(sel);return val[idx];}});K.oo('method',"getJQ",function(scope,key,idx){idx=idx||0;return $(this.getVal(scope,key,idx));});K.oo('method',"toJson",function(){return JSON.stringify(this.toHash());});K.oo('method',"toHash",function(){this.normalize();var ret={'children':{}};for(var name in this.scopes){var scope=this.scopes[name];ret[name]={};for(var key in scope){var val=scope[key];if(val.length==1){ret[name][key]='Scalar';}else{ret[name][key]='Array';}}}
for(var namespace in this.children){var childMarker=this.children[namespace];ret.children[namespace]=childMarker.toHash();}
return ret;});K.oo('method',"normalize",function(){this.normalized=true;});K.oo('method',"getRealClassScope",function(klass){if(klass.main&&klass.main.factoryId){var namespace=klass.main['class'].className.replace(/\.\w+$/,'');var classname=klass['class'].className.match(/\.\w+$/)[0];return namespace+classname;}else{if(!klass.className)return klass['class'].className;return klass.className;}});K.oo('method',"normalizeVal",function(val){var ret=[];if(typeof val=='object'){if(val.jquery){for(var it155=0,e,it155__arr=val,it155__len=it155__arr.length;(e=it155__arr[it155])||it155<it155__len;it155++){if(!e)continue;ret.push(e);}}else if(val instanceof Array){for(var it156=0,v,it156__arr=val,it156__len=it156__arr.length;(v=it156__arr[it156])||it156<it156__len;it156++){if(!v)continue;var norms=this.normalizeVal(v);for(var it157=0,norm,it157__arr=norms,it157__len=it157__arr.length;(norm=it157__arr[it157])||it157<it157__len;it157++){if(!norm)continue;ret.push(norm);}}}}
return ret;});})(JS2.SelMarker,JS2);JS2.SEL_EVENTS={};JS2.SEL_EVENTS.LEFT_BUTTON=$.browser.msie?1:0;JS2.SEL_EVENTS.LEFT_MOUSE_UP=$.Event('mouseup');JS2.SEL_EVENTS.LEFT_MOUSE_UP.button=JS2.SEL_EVENTS.LEFT_BUTTON;JS2.SEL_EVENTS.LEFT_MOUSE_DOWN=$.Event('mousedown');JS2.SEL_EVENTS.LEFT_MOUSE_DOWN.button=JS2.SEL_EVENTS.LEFT_BUTTON;JS2.SEL_TRACKER={};JS2.SEL_MARKER=new JS2.SelMarker();var CLASSES={get:function(key){var namespaces=key.split(/\./);var next=window;for(var i=0,l=namespaces.length;ns=namespaces[i];i++){next=next[ns];}
return next;}};JS2.OO.createClass("JS2.Main");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('member','components',['Notifier','Seed']);K.oo('member','core',['Notifier','Seed','Main']);K.oo('member','__isApp',true);K.oo('method',"initialize",function(options){this.options=options||{};});K.oo('method',"start",function(){this.notify('start');});K.oo('method',"assign",function(key,val){this.factory.assign(key,val);});K.oo('method',"comp",function(name){return this.factory.compLookup[name];});K.oo('method',"compList",function(){var list=[];var used={};var protoList=this.protoList();for(var it85=0,proto,it85__arr=protoList,it85__len=it85__arr.length;(proto=it85__arr[it85])||it85<it85__len;it85++){this.parseClassList(proto,proto.components,list,used);}
return list;});K.oo('method',"coreList",function(){var list=[];var used={};var protoList=this.protoList();for(var it86=0,proto,it86__arr=protoList,it86__len=it86__arr.length;(proto=it86__arr[it86])||it86<it86__len;it86++){this.parseClassList(proto,proto.core,list,used);}
return list;});K.oo('method',"register",function(comp){this.factory.register(comp);});K.oo('method',"registerListener",function(comp){this.factory.registerListener(comp);});K.oo('method',"classList",function(){if(this._classList)return this._classList;this._classList=[this['class']];var anc=this['class'].oo('ancestors');for(var i=0,a,i__arr=anc,i__len=i__arr.length;(a=i__arr[i])||i<i__len;i++){this._classList.push(a);}
return this._classList;});K.oo('method',"packageList",function(){if(this._packageList)return this._packageList;var classList=this.classList();this._packageList=[];for(var it87=0,c,it87__arr=classList,it87__len=it87__arr.length;(c=it87__arr[it87])||it87<it87__len;it87++){this._packageList.push(c.package);}
return this._packageList;});K.oo('method',"protoList",function(){if(this._protoList)return this._protoList;var list=this.classList();this._protoList=[];for(var it88=0,c,it88__arr=list,it88__len=it88__arr.length;(c=it88__arr[it88])||it88<it88__len;it88++){this._protoList.push(c.prototype);}
return this._protoList;});K.oo('method',"setFactPaths",function(namespace){this.factory.setFactPaths(namespace);});K.oo('method',"parseClassList",function(proto,classList,list,used){if(!classList)return;var newList=[];for(var it89=0,c,it89__arr=classList,it89__len=it89__arr.length;(c=it89__arr[it89])||it89<it89__len;it89++)newList.push(c);if(this.options&&this.options.plugins){var plugins=this.options.plugins;for(var it90=0,p,it90__arr=plugins,it90__len=it90__arr.length;(p=it90__arr[it90])||it90<it90__len;it90++){newList.push(p);}}
for(var i=newList.length-1;i>=0;i--){var klassName=newList[i];var compName=klassName.split(/\./).pop();if(!klassName.match(/\./)){klassName=this['class'].package.className+'.'+compName;}
if(!used[compName]){list.unshift(klassName);used[compName]=true;}}});})(JS2.Main,JS2);JS2.OO.createClass("JS2.Factory");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('member','autoIncrement',1);K.oo('method',"initialize",function(package,options){this.factoryId=this.autoIncrement++;this.options=options||{};this.debugMode=options.debugMode;this.package=package;this.compList=[];this.compLookup={};this.assignments={};var main=package.Main.className;this.initComp(main);this.list=this.compLookup.main.compList();this.core=this.compLookup.main.coreList();if(this.debugMode){this.js2debugger=APP(FactoryDebugger,{factory:this});this.js2debugger.dFactory=this;this.options.js2debugger=this.js2debugger;}
this.init();if(this.debugMode)this.js2debugger.start();});K.oo('method',"register",function(comp){this.compLookup.notifier.register(comp);this.injectComp(comp);for(var key in this.assignments)comp[key]=this.assignments[key];});K.oo('method',"registerListener",function(listener){this.compLookup.notifier.registerListener(listener);});K.oo('method',"notify",function(eventName,params){this.compLookup.notifier.notify(arguments);});K.oo('method',"assign",function(key,value){this.assignments[key]=value;for(var it91=0,c,it91__arr=this.compList,it91__len=it91__arr.length;(c=it91__arr[it91])||it91<it91__len;it91++){c[key]=value;}});K.oo('method',"setFactPaths",function(namespace){if(this.__fpathed)return;this.__fpathed=true;this.__fpathedList=[];namespace=namespace||'APP';var compList=this.compList;for(var it92=0,comp,it92__arr=compList,it92__len=it92__arr.length;(comp=it92__arr[it92])||it92<it92__len;it92++){this.setCompFactPaths(comp,namespace);}
for(var it93=0,obj,it93__arr=this.__fpathedList,it93__len=it93__arr.length;(obj=it93__arr[it93])||it93<it93__len;it93++){delete obj['__fpathed'];}});K.oo('method',"setCompFactPaths",function(comp,namespace){if(comp.__fpathed)return;comp.__fpathed=true;this.__fpathedList.push(comp);namespace=namespace+'.'+comp.nickname;for(var k in comp){var fpath=namespace+'.'+k;var val=comp[k];if(val&&val.jquery){this.setFactPath(val,fpath);}else if(val&&val.__isApp){val.setFactPaths(namespace+'>'+k);}else{this.setMemberFactPaths(val,namespace);}}});K.oo('method',"setMemberFactPaths",function(obj,namespace){if(typeof obj!='object'||obj==null||obj.jqeury||obj.compIndex||obj.nodeName)return;if(obj.__fpathed)return;obj.__fpathed=true;this.__fpathedList.push(obj);for(var k in obj){var val=obj[k];if(typeof val=='object'&&val!=null){if(val.__fpathed)continue;var fpath=namespace+'.'+k;if(val.jquery){this.setFactPath(val,fpath);}
else if(!val.compIndex){this.setMemberFactPaths(val,fpath);}}}});K.oo('method',"setFactPath",function(jq,fpath){try{if(jq.length==1){var ele=jq[0];var oldFpath=ele.getAttribute('fpath')||ele.getAttribute('id');if(!oldFpath){var id=ele.getAttribute('id');if(!id||id.match(/\./)){ele.setAttribute('id',fpath);}
ele.setAttribute('fpath',fpath);}}else{for(var idx=0;idx<jq.length;idx++){var ele=jq[idx];var old=ele.getAttribute('fpath')||ele.getAttribute('id');if(!old){var id=ele.getAttribute('id');var newFpath=fpath+'['+idx+']'
if(!id||id.match(/\./)){ele.setAttribute('id',newFpath);}
ele.setAttribute('fpath',newFpath);}}}}catch(e){}});K.oo('method',"init",function(){this.initComps();var notifier=this.compLookup.notifier;var notify=notifier.notify;var self=this;this._notify=function(eventName,params){notify.apply(notifier,arguments);};this.injectComps();this.injectMain();});K.oo('method',"injectMain",function(){var self=this;var register=function(comp){self.register(comp);};var main=this.compLookup.main;main.factory=this;main.js2debugger=this.js2debugger;main.factoryId=this.factoryId;});K.oo('method',"injectComps",function(){var deps=[];for(var i=0,name;name=this.core[i++];){name=name.replace(/^[\w.]*\./,'');name=name.substr(0,1).toLowerCase()+name.substr(1);deps.push(name);}
this.deps=deps;for(var i=0,comp;comp=this.compList[i++];){this.injectComp(comp);this.compLookup.notifier.register(comp);}});K.oo('method',"injectComp",function(comp){var deps=$.makeArray(this.deps);if(comp.dependencies){var dep=comp.dependencies;var extra=typeof(dep)=='string'?dep.split(/\s\s*/):dep;for(var i=0,c;c=extra[i++];){deps.push(c);}}
for(var it94=0,d,it94__arr=deps,it94__len=it94__arr.length;(d=it94__arr[it94])||it94<it94__len;it94++){if(d.match(/Controller$/)){var nick=d.replace(/Controller$/,'');comp[d]=this.compLookup[nick];}
else if(d.match(/View$/)){var nick=d.replace(/View$/,'');comp[d]=this.compLookup[nick].view;}
else{comp[d]=this.compLookup[d];}}
if(comp.nickname!='notifier')comp.notify=this._notify;if(this.debugMode){var self=this;comp.log=function(str){self.js2debugger.toLog(this,str);};comp.explore=function(obj){self.js2debugger.exp(obj);};}else{comp.log=function(){};comp.explore=function(){};}});K.oo('method',"initComps",function(){for(var i=0,name;name=this.list[i++];)this.initComp(name);});K.oo('method',"initComp",function(name){if(this.debugMode&&name=='JS2.Notifier'){name='FactoryDebugger.Notifier';}
var main=this.initMain(name);var con=main?false:this.initController(name);var view=this.initView(name);var events=this.initEvents(name);this.initMVC(main,con,view,events);});K.oo('method',"initController",function(name){var klass=this.findClass(name+'Controller');if(!klass)return false;return this.addComp(klass,name);});K.oo('method',"initMain",function(name){var klass=this.findClass(name);if(!klass)return false;return this.addComp(klass,name);});K.oo('method',"initView",function(name){var klass=this.findClass(name+'View');if(!klass)return false;return this.addComp(klass,name);});K.oo('method',"initEvents",function(name){var klass=this.findClass(name+'Events');if(!klass)return false;return this.addComp(klass,name);});K.oo('method',"addComp",function(klass,klassName){var obj=new klass(this.options);obj.compIndex=this.compList.length;this.compList.push(obj);var name=obj.nickname;if(!name){var sub=klassName.split(/\./).pop();name=sub.substr(0,1).toLowerCase()+sub.substr(1);obj.nickname=name;if(!this.compLookup[name])this.compLookup[name]=obj;}
return obj;});K.oo('method',"findClass",function(name){var klass=JS2.OO.get(name);if(klass)return klass;var packageList=this.compLookup.main.packageList();var nick=name.replace(/^[\w\.]*\./,'');for(var it95=0,p,it95__arr=packageList,it95__len=it95__arr.length;(p=it95__arr[it95])||it95<it95__len;it95++){var c=p[nick];if(c)return c;}
return false;});K.oo('method',"initMVC",function(main,con,view,events){if(main){main.view=view;main.events=events;}
if(view)view.controller=con||main;if(con){con.view=view;con.events=events;}
if(events){events.controller=con||main;events.view=view;}});})(JS2.Factory,JS2);JS2.OO.createClass("JS2.Notifier");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(){this.chains={};});K.oo('method',"register",function(comp){for(var key in comp){if(key.indexOf('e_')==0){var eventType=key.substr(2);if(!this.chains[eventType])this.chains[eventType]=[];this.chains[eventType].push([comp,comp[key]]);}}});K.oo('method',"registerListener",function(listener){for(var key in listener){var funct=listener[key];if(typeof funct!='function')continue;if(!this.chains[key])this.chains[key]=[];this.chains[key].push([listener,funct]);}});K.oo('method',"notify",function(){var eventType=arguments[0];var args;if(arguments.length==2){args=[arguments[1]];}else{args=[];for(var i=1;i<=arguments.length;i++)args.push(arguments[i]);}
var chain=this.chains[eventType];if(chain){for(var i=0,pair;pair=chain[i++];){pair[1].apply(pair[0],args);}}});})(JS2.Notifier,JS2);JS2.OO.createClass("JS2.Seed");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(options){if(options.seed){this.jq=$(options.seed);}else{this.jq=$(document.body);}});K.oo('method',"setSass",function(force){var mainProto=this.main.klass.prototype;if(mainProto.__sassSet&&!force)return;var sass='';for(var it96=0,c,it96__arr=this.main.factory.compList,it96__len=it96__arr.length;(c=it96__arr[it96])||it96<it96__len;it96++){if(c.htmlCache&&c.htmlCache.sass){sass+=c.htmlCache.sass;}}
mainProto.__sassSet=true;$('head:first').append('<style>'+sass+'</style>');});K.oo('method',"append",function(html){return this.jq.append(html);});K.oo('method',"child",function(selector){return this.jq.find('>'+selector);});K.oo('method',"find",function(selector){return this.jq.find(selector);});K.oo('method',"first",function(selector){return this.jq.find(selector+':first');});K.oo('method',"setSeed",function(jq){if(jq.jquery){this.jq=jq;}else{var newSeed=$(jq);this.append(newSeed);this.jq=newSeed;}
return this.jq;});K.oo('method',"e_initHTML",function(){var namespaces=this.main.klass.className.split(/\./);namespaces.pop();var namespace=namespaces.join('');this.jq.addClass(namespace);});K.oo('method',"html",function(val){return arguments.length?this.jq.html(val):this.html();});})(JS2.Seed,JS2);_APPS=[];SET_FACT_PATHS=function(){for(var i=0;i<_APPS.length;i++){var app=_APPS[i];app.setFactPaths('APP'+i);}}
APP=function(package,options){options=options||{};var fact=new JS2.Factory(package,options);var app=fact.compLookup.main;_APPS.push(app);if(JS2.SEL_MARKER){if(options.parent){var newSelMarker=options.parent.SEL_MARKER.newChild(options.name||'namespace');newSelMarker.child=true;app.assign('SEL_MARKER',newSelMarker);}else{app.assign('SEL_MARKER',JS2.SEL_MARKER);}}
return app;}
FACTORY=function(package,options){console.log('FACTORY has been deprecated... please use APP(..)');return APP(package,options);}
DAPP=function(package,options){options=options||{};options.debugMode=true;return APP(package,options);}
DFACTORY=function(package,options){console.log('DFACTORY has been deprecated... please use DAPP(..)');return APP(package,options);}
FPATH=function(xpath){xpath=xpath.toLowerCase();var ele=document.evaluate(xpath,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0);var jq=$(ele);var jqF=jq.parents('[fpath]:first');var fpath=jqF.attr('fpath');var tag=jqF[0].tagName.toLowerCase();var newXpath=tag+'[@fpath="'+fpath+'"]';var toReplace=getElementXPath(jqF[0]);return xpath.replace(toReplace,newXpath);}
function getElementXPath(elt){var path="";for(;elt&&elt.nodeType==1;elt=elt.parentNode){idx=getElementIdx(elt);xname=elt.tagName;if(idx>1)xname+="["+idx+"]";path="/"+xname+path;}
return path.toLowerCase();}
function getElementIdx(ele){var count=1;for(var sib=ele.previousSibling;sib;sib=sib.previousSibling){if(sib.nodeType==1&&sib.tagName==ele.tagName)count++}
return count;}
if(!this.JSON||navigator.userAgent.toLowerCase().indexOf('chrome')>-1){JSON=function(){function f(n){return n<10?'0'+n:n;}
Date.prototype.toJSON=function(key){return this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z';};var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapeable=/[\\\"\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){escapeable.lastIndex=0;return escapeable.test(string)?'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string'){return c;}
return'\\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(typeof value.length==='number'&&!(value.propertyIsEnumerable('length'))){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,rep);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value,rep);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;}}
return{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});},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');}};}();}
if(!Array.prototype.push)Array.prototype.push=function(o){this[this.length]=o}
Array.prototype.subarr=function(iStart,iLength){if(iStart>=this.length||(iLength!=null&&iLength<=0))return[];else if(iStart<0){if(Math.abs(iStart)>this.length)iStart=0;else iStart=this.length+iStart;}
if(iLength==null||iLength+iStart>this.length)iLength=this.length-iStart;var aReturn=new Array();for(var i=iStart;i<iStart+iLength;i++){aReturn.push(this[i]);}
return aReturn;}
Array.prototype.subarray=function(iIndexA,iIndexB){if(iIndexA<0)iIndexA=0;if(iIndexB==null||iIndexB>this.length)iIndexB=this.length;if(iIndexA==iIndexB)return[];var aReturn=new Array();for(var i=iIndexA;i<iIndexB;i++){aReturn.push(this[i]);}
return aReturn;}
if(!Array.prototype.splice)Array.prototype.splice=function(iStart,iLength){if(iLength<0)iLength=0;var aInsert=new Array();if(arguments.length>2){for(var i=2;i<arguments.length;i++){aInsert.push(arguments[i]);}}
var aHead=this.subarray(0,iStart);var aDelete=this.subarr(iStart,iLength);var aTail=this.subarray(iStart+iLength);var aNew=aHead.concat(aInsert,aTail);this.length=0;for(var i=0;i<aNew.length;i++){this.push(aNew[i]);}
return aDelete;}
Date.prototype.fixDate=function(integer){var bt=new Date(integer);var by=bt.getFullYear();var bm=bt.getMonth()+1;var bd=bt.getDate();integer+=bt.getTimezoneOffset()*60000;if(by*10000+bm*100+bd>15821014){return(new Date(integer));}
if(by<0){var h=parseInt((0-by)/100);var c=h-parseInt(h/4);return(new Date(integer+86400000*(c+2)));}
var sh=parseInt(by/100)+1;if((by%100==0)&&(by%400!=0)&&(bm*100+bd<228))sh--;var c=13-sh+parseInt(sh/4);return(new Date(integer-86400000*(10-c)));}
String.prototype.startsWith=function(str,caseSensitive){if(str==null)return false;if(caseSensitive==null)caseSensitive=false;aStr=(caseSensitive)?this:this.toLowerCase();bStr=(caseSensitive)?str:str.toLowerCase();return(aStr.indexOf(bStr)==0);}
String.prototype.lstrip=function(str){var len=0;if(str==null){}else if(this.startsWith(str)){len=str.length;}
return this.substr(len);};;(function(){var CHARS='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');Math.uuid=function(len,radix){var chars=CHARS,uuid=[];radix=radix||chars.length;if(len){for(var i=0;i<len;i++)uuid[i]=chars[0|Math.random()*radix];}else{var r;uuid[8]=uuid[13]=uuid[18]=uuid[23]='-';uuid[14]='4';for(var i=0;i<36;i++){if(!uuid[i]){r=0|Math.random()*16;uuid[i]=chars[(i==19)?(r&0x3)|0x8:r];}}}
return uuid.join('').toLowerCase();};Math.uuidFast=function(){var chars=CHARS,uuid=new Array(36),rnd=0,r;for(var i=0;i<36;i++){if(i==8||i==13||i==18||i==23){uuid[i]='-';}else{if(rnd<=0x02)rnd=0x2000000+(Math.random()*0x1000000)|0;r=rnd&0xf;rnd=rnd>>4;uuid[i]=chars[(i==19)?(r&0x3)|0x8:r];}}
return uuid.join('').toLowerCase();};Math.uuidCompact=function(){return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c=='x'?r:(r&0x3|0x8);return v.toString(16);}).toLowerCase();};})();var sci={};sci.htmlCache={};sci.createClass=function(className,prototype){var path=className.split('.');var klass=path.pop();var pack=window;for(var i=0,p;p=path[i++];){if(!pack[p])pack[p]={};pack=pack[p];}
pack[klass]=function(){if(this.initialize)this.initialize.apply(this,arguments);};var newClass=pack[klass];newClass.prototype=prototype;newClass.prototype._klass=className;if(prototype.static){for(var name in prototype.static){newClass[name]=prototype.static[name];}}
return newClass;};sci.extendClass=function(className,extendClass,prototype){var klass=this.createClass(className,prototype);var protoSub=klass.prototype;var protoParent=extendClass.prototype;for(var method in protoParent){if(protoSub[method]){protoSub[method]._super=protoParent[method];}else{protoSub[method]=protoParent[method];}}
klass.prototype._klass=className;};sci['accessor']=function(name){return function(val){return(arguments.length>0)?(this['_'+name]=val):(this['_'+name]);}};function _superGet(self){var kname=arguments.callee.caller._klass;eval('var klass = '+kname+';');}
var _super=JS2.OO['super'];JS2.OO.createClass("Sci.Common");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"htmlEscape",function(str){if(str==null||str==undefined)return'';return str.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/\"/g,"&quot;");});K.oo('method',"htmlUnescape",function(str){if(str==null||str==undefined)return'';return str.toString().replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&').replace(/&#39/,"'").replace(/&quot/,'"');});K.oo('method',"htmlWrap",function(str,size){if(size)str=chrome.truncateStr(str,size);if(str==null||str==undefined)return'';return str.toString().replace(/\</g,'&lt;').replace(/\>/g,'&gt;').replace(/'/g,"&#39;").replace(/&amp;/g,'&').replace(/\"/g,"&quot;").replace(/\n/g,'<br/>');});K.oo('method',"htmlDisplay",function(str,size){if(str==null||str==undefined)return'';if(size)str=chrome.truncateStr(str,size);return str.toString().replace(/\</g,'&lt;').replace(/\>/g,'&gt;').replace(/'/g,"&#39;").replace(/\"/g,"&quot;").replace(/&amp;/g,'&').replace(/\n/g,'<br/>').replace(/\s/g,'&nbsp;');});K.oo('method',"getDisplay",function(datatype,val,method){if(datatype){var dt=typeof(datatype)=='string'?sci.constants.datatypes[datatype]:datatype;var func=method?sci.displayMethods[method]:dt.display;var noNumericComma=sci.cUtil.isNumericDatatype(dt.name)?true:false;return(val instanceof Array)?$.map(val,function(v){return noNumericComma?func(v).toString().replace(/,/g,''):func(v);}).join(', '):func(val);}
return sci.common.htmlEscape(val);});K.oo('method',"parseString",function(v){if(!v&&v!=0)return'';return v.toString();});K.oo('method',"getRadioValue",function(jqRadios){for(var i=0,len=jqRadios.length;i<len;i++){var radio=jqRadios[i];if(radio.checked){return radio.value;}}
return null;});K.oo('method',"getIdInfo",function(url){url=url.replace(/^\s*http(s)?\:\/\/[^\/]+\//,'');var urlParts=url.replace(/\s+$/,'').split('/');var type='non-datasets';if(urlParts[0]=='t'){type='datasets';}else if(urlParts[0]=='ts'){type='state';}
var id=urlParts[1];return{type:type,id:id};});K.oo('method',"getFullXPath",function(simpleXPath){var ele=document.evaluate(simpleXPath,document,null,XPathResult.ANY_TYPE,null).iterateNext();return'//'+this.getXPath(ele).join('/');});K.oo('method',"getXPath",function(node,path){path=path||[];if(node.parentNode){path=this.getXPath(node.parentNode,path);}
if(node.previousSibling){var count=1;var sibling=node.previousSibling
do{if(sibling.nodeType==1&&sibling.nodeName==node.nodeName){count++;}
sibling=sibling.previousSibling;}while(sibling);if(count==1)count=null;}else if(node.nextSibling){var sibling=node.nextSibling;do{if(sibling.nodeType==1&&sibling.nodeName==node.nodeName){var count=1;sibling=null;}else{var count=null;sibling=sibling.previousSibling;}}while(sibling);}
if(node.nodeType==1)path.push(node.nodeName.toLowerCase()+(node.id?"[@id='"+node.id+"']":count>0?"["+count+"]":''));return path;});K.oo('method',"isToggleInput",function(input){return $(input).hasClass('sciToggleInput');});K.oo('method',"postToUrl",function(path,params,method){method=method||"post";var form=document.createElement("form");form.setAttribute("method",method);form.setAttribute("action",path);for(var key in params){var hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden");hiddenField.setAttribute("name",key);hiddenField.setAttribute("value",params[key]);form.appendChild(hiddenField);}
document.body.appendChild(form);form.submit();});})(Sci.Common,Sci);sci.common=new Sci.Common();var ESCAPE={html:sci.common.htmlEscape};$.fn.first=function(t){return this.find(t+':first');};$.fn.fchild=function(t){return this.find('>'+t+':first');};(function($){$.fn.toggleInput=function(key,value){switch(key){case undefined:return init(this);break;case'defaultValue':setDefaultValue(this,value);return init(this);break;case'resetDefaultValue':resetDefaultValue(this,value);break;case'val':return handlerVal(value,this);break;default:alert('ToggleInput: wrong arguments');break;}};$.fn.toggleInput.defaultStyle='blankToggleInput'
function init(jqInputs){jqInputs.each(function(){if(isInitted(this))return;var jq=$(this);var value=jq.val();var self=this;jq.addClass('sciToggleInput');if(value=="")value='Please input here';setDefaultValue(jqInputs,value)
$.data(this,'val',function(){var value=$(self).val();var userValue=getUserValue(self);var defaultValue=getDefaultValue(self);if(value==defaultValue&&value!=userValue){value='';}
return value;});$.data(this,'isInitted',{});addDefaultStyle(this);registerEvents(jq);});return jqInputs;}
function handlerVal(value,jqInputs){if(value==undefined){var values=[];jqInputs.each(function(){values.push($.data(this,'toggleInputInfo').userValue);});return values.join(' ');}else{jqInputs.each(function(){setUserValue(this,value);$(this).val(value);if(value==''){addDefaultStyle(this);}else{removeDefaultStyle(this);}});return jqInputs;}}
function isInitted(ele){return!!$.data(ele,'isInitted');}
function registerEvents(jq){jq.focus(function(){var jqInput=$(this);var value=jqInput.val();var userValue=getUserValue(this);var defaultValue=getDefaultValue(this);if(value==defaultValue&&value!=userValue){jqInput.val('');removeDefaultStyle(this);}else{removeDefaultStyle(this);}});jq.keyup(function(){var jqInput=$(this);var value=jqInput.val();setUserValue(this,value);});jq.blur(function(){var jqInput=$(this);var value=jqInput.val();setUserValue(this,value);if(value=='')addDefaultStyle(this);});}
function setDefaultValue(jq,value){if(!jq.data('toggleInputInfo')){jq.data('toggleInputInfo',{});}
var toggleInputInfo=jq.data('toggleInputInfo');if(toggleInputInfo.defaultValue==undefined)toggleInputInfo.defaultValue=value;toggleInputInfo.userValue='';jq.data('toggleInputInfo',toggleInputInfo);}
function resetDefaultValue(jq,value){var value=value||'Please input here';var toggleInputInfo=jq.data('toggleInputInfo');toggleInputInfo.defaultValue=value;jq.data('toggleInputInfo',toggleInputInfo);}
function setUserValue(ele,value){var toggleInputInfo=$.data(ele,'toggleInputInfo');toggleInputInfo.userValue=value;$.data(this,'toggleInputInfo',toggleInputInfo);}
function getUserValue(ele){return $.data(ele,'toggleInputInfo').userValue;}
function getDefaultValue(ele){return $.data(ele,'toggleInputInfo').defaultValue;}
function removeDefaultStyle(ele){$(ele).removeClass($.fn.toggleInput.defaultStyle);}
function addDefaultStyle(ele){var jq=$(ele);jq.addClass($.fn.toggleInput.defaultStyle);jq.val(getDefaultValue(ele));}})(jQuery);$.fn.enterKey=function(func){$(this).keyup(function(event){if(event.keyCode==KEYCODE.ENTER){func.call();}});};$.fn.escKey=function(func){$(this).keyup(function(event){if(event.keyCode==KEYCODE.ESC){func.call();}});};(function($){if(typeof $.timeout!="undefined")return;$.extend({timeout:function(func,delay){if(typeof $.timeout.count=="undefined")$.timeout.count=0;if(typeof $.timeout.funcs=="undefined")$.timeout.funcs=new Array();if(typeof func=='string')return setTimeout(func,delay);if(typeof func=='function'){$.timeout.count++;$.timeout.funcs[$.timeout.count]=func;return setTimeout("$.timeout.funcs['"+$.timeout.count+"']();",delay);}},interval:function(func,delay){if(typeof $.interval.count=="undefined")$.interval.count=0;if(typeof $.interval.funcs=="undefined")$.interval.funcs=new Array();if(typeof func=='string')return setInterval(func,delay);if(typeof func=='function'){$.interval.count++;$.interval.funcs[$.interval.count]=func;return setInterval("$.interval.funcs['"+$.interval.count+"']();",delay);}},idle:function(func,delay){if(typeof $.idle.lasttimeout=="undefined")$.idle.lasttimeout=null;if(typeof $.idle.lastfunc=="undefined")$.idle.lastfunc=null;if($.idle.timeout){clearTimeout($.idle.timeout);$.idle.timeout=null;$.idle.lastfunc=null;}
if(typeof(func)=='string'){$.idle.timeout=setTimeout(func,delay);return $.idle.timeout;}
if(typeof(func)=='function'){$.idle.lastfunc=func;$.idle.timeout=setTimeout("$.idle.lastfunc();",delay);return $.idle.timeout;}},clear:function(countdown){clearInterval(countdown);clearTimeout(countdown);}});})(jQuery);$.fn.ctrlEnterKey=function(func){$(this).keyup(function(event){if(event.keyCode==KEYCODE.ENTER&&event.ctrlKey){func.call();}});}
function _(str){return str;}
$.enumeration_list=function(value){var vals=[];if(!value)return vals;var enums=$.map(value.split('\n'),$.trim);$.each(enums,function(i,n){if(n.length>0&&$.inArray(n,vals)==-1){vals.push(n);}});return vals;}
$.isEmpty=function(value){if(value==null||value==undefined){return true;}
if(typeof(value)=='string'&&$.trim(value).length==0){return true;}
return false;}
var WIDGET={};var HTML_CACHE={};var UNIQUE_ID=0;function generateUID(){var UID="UID"+UNIQUE_ID.toString();UNIQUE_ID++;return UID;}
jQuery.event.special.clickoff={setup:function(data,namespaces){var $this=jQuery(this);state=jQuery.event.special.clickoff.state;var id=state.idCounter+'';$this.data('clickoffId',id);$this.data('clickoffIgnore',false);state.lookups[id]=this;if(state.idCounter==0){var body=jQuery('body');body.bind('click.clickoffHandler',function(clickState){return function(e){for(var k in clickState.lookups){if(!jQuery(clickState.lookups[k]).data('clickoffIgnore')){jQuery.event.trigger('clickoff',null,clickState.lookups[k],false,null);}else{jQuery(clickState.lookups[k]).data('clickoffIgnore',false);}}}}(state));}
var uniqueEvent="click.clickoff"+id;$this.bind(uniqueEvent,function(self){return function(e){self.data('clickoffIgnore',true);}}($this));state.idCounter++;},teardown:function(namespaces){state=jQuery.event.special.clickoff.state;var $this=jQuery(this);var id=$this.data('clickoffId');var clickEvent="click.clickoff"+id;$this.unbind(clickEvent);delete state.lookups[clickEvent];},state:{idCounter:0,lookups:{}}};jQuery.fn.extend({clickoff:function(fn){if(fn){return jQuery.event.add(this[0],'clickoff',fn,null);}else{return jQuery.event.trigger('clickoff',null,this[0],false,null);}}});function autoUrl(text){var exp=new RegExp("^([a-zA-Z]+\\.)?[a-zA-Z0-9\\-\\.]+\\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk|cn)(\\/[a-zA-Z0-9-_.,~)(]*)*(\\?[a-zA-Z0-9.;=&%#-_]+)?","gi");return text.replace(exp,function(str){return"http://"+str;});}
function S4(){return(((1+Math.random())*0x10000)|0).toString(16).substring(1);}
function guid(){return(S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());}
$.fn.selectedOption=function(){var elem=this[0];return $(elem.options[elem.selectedIndex]);}
function checkLoadable(ele,btn,func){var jqEle=ele.jquery?ele:$(ele);var jqBtn=btn.jquery?btn:$(btn);var intval=null;function check(){if(func){jqBtn.attr("disabled",!func());}else{if(jqEle.val()==''){jqBtn.attr("disabled",true);jqBtn.addClass('disabled');}else{jqBtn.attr("disabled",false);jqBtn.removeClass('disabled');}}}
check();function clearIntval(){if(intval)clearInterval(intval);}
jqEle.keyup(function(){clearIntval();intval=setInterval(check,500);}).click(function(){clearIntval();intval=setInterval(check,500);}).focus(function(){clearIntval();intval=setInterval(check,500);}).blur(function(){clearIntval();check();});}
function onEnterKey(inputEle,callBack){$(inputEle).keyup(function(evt){if(evt.keyCode==KEYCODE.ENTER){callBack(evt);}});}
(function($){$.fn.changable=function(){$.each(this,function(i,dom){var $dom=$(dom);$dom.blur(function(){$dom.removeClass('focused');});$dom.click(function(){if($dom.hasClass('focused'))return;$dom.addClass('focused');$dom[0].select();});});};})(jQuery);JS2.OO.createClass("Display");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(s){this.s=s;});K.oo('method',"html",function(){this.s=DISPLAY.html(this.s);return this;});K.oo('method',"dt",function(datatype,method){this.s=DISPLAY.datatype(datatype,this.s,method);return this;});K.oo('method',"link",function(length){this.s=DISPLAY.link(this.s,length);return this;});K.oo('method',"trunc",function(length){this.s=DISPLAY.trunc(this.s,length);return this;});K.oo('method',"toString",function(){return this.s});})(Display,null);function unEscape(){this.s=DISPLAY.unEscape(this.s);return this;}
var DISPLAY=function(s){return new Display(s);};DISPLAY.html=sci.common.htmlDisplay;DISPLAY.wrap_html=sci.common.htmlWrap;DISPLAY.unEscape=sci.common.htmlUnescape;DISPLAY.datatype=function(dt,val,method){var datatype=sci.constants.datatypes[dt];if(datatype){if(datatype[method]){return datatype[method](val);}else if(method){var func=sci.displayMethods[method];return func(val);}else if(datatype.display){return datatype.display(val);}}
return sci.common.htmlEscape(val);};DISPLAY.linkExp="\\b((https?|ftp|file|rtsp|mms)://)?((([a-zA-Z]+\\.)?[a-zA-Z0-9\\-\\.]+\\.([a-z]{2,4}|museum))|((?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])))(\\/[a-zA-Z0-9-_.,~!=%@)(]*)*((\\?)[a-zA-Z0-9-_.,~!:;=&%+]+)?(#[a-zA-Z0-9-_.,~!:;=&%+]+)?";DISPLAY.uuidExp="[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}";DISPLAY.isLink=function(str){var url_exp=new RegExp(DISPLAY.linkExp,"gi");return str.toString().match(url_exp);}
DISPLAY.isAndReturnLink=function(str){str=DISPLAY.trim(str);var url_exp=new RegExp("^"+DISPLAY.linkExp+'$',"gi");if(url_exp.test(str)){if(str.match(/\:\/\//)){return str;}else{return'http://'+str;}}else{return false;}}
DISPLAY.link=function(link,length){if(!link)return'';link=link.toString();if(link.length==0)return'';if(!length)length=50;link=sci.common.htmlEscape(link);var host_exp=new RegExp("^[^\\/]?"+window.location.hostname.replace(/\./g,"\\."));var url_exp=new RegExp(DISPLAY.linkExp,"gi");return link.replace(url_exp,function(str){return getLinkHtml(str);});function getLinkHtml(str){var withProtocol=str.match(/\:\/\//)?true:false;var external=(str.replace(/^\w+\:\/\//,'').match(host_exp))?false:true;return' <a href="'+(withProtocol?'':'http://')+str+'" target="_blank" '+(external?'class="external" ':'')+'title="'+str+'"'+' >'+chrome.truncateStr(str,length)+'</a> ';}};DISPLAY.trunc=function(str,length){return chrome.truncateStr(str,length);};DISPLAY.user=function(userId,userName,target){if(!userName)userName=userId;return'<a href="/members/'+userId+'" '+
(target?'target="'+target+'"':'')+'>'+userName+'</a>';};DISPLAY.dsPage=function(dsUrl,dsName,dsLength){if(!dsName)dsName=_("Some view of the source table.");return'<a href="/t/'+dsUrl+'" target="_blank" title="'+DISPLAY.html(dsName)+'">'+DISPLAY.html(DISPLAY.trunc(dsName,dsLength))+'</a>';}
DISPLAY.getCharWidth=function(letter){letter=letter==null?'':letter.toString();var jqBody=$(document.body);var jqCharDiv=$('<div>'+letter+'</div>');var css={position:'absolute',top:0,left:0}
jqCharDiv.css(css);jqBody.append(jqCharDiv);var width=jqCharDiv.width();jqCharDiv.remove();return width;}
DISPLAY.trim=function(str){try{return $.trim(str.toString());}catch(e){return'';}}
DISPLAY.parseUnicode=function(u){return eval('unescape("'+u+'")');}
DISPLAY.blankValue='<em class="blank">[blank]</em>';DISPLAY.present=function(jq){return new Sci.Presenter(jq);}
JS2.OO.createClass("Sci.DomEvent");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"add",function(ele,ev,func,ft){ele=$(ele)[0];if(!ele)return;if(ele.addEventListener){ele.addEventListener(ev,func,ft);}else{ele.attachEvent("on"+ev,func);}});})(Sci.DomEvent,Sci);sci.domEvent=new Sci.DomEvent();function initChrome(){chrome.init();}
var chrome={init:function(){this.ieResize();},ieResize:function(){if($.browser.msie&&parseInt($.browser.version)<7){var self=this;var minWidth=1024-55;var page=$("div:first, #footer");chrome.setPageMinWidth(page,minWidth);$(window).resize(function(){self.setPageMinWidth(page,minWidth);});}},setPageMinWidth:function(jqObj,minWidth){var curWidth=$(window).width();if(curWidth<=minWidth){jqObj.width(minWidth);}
else{jqObj.width(curWidth);}},getStyle:function(el,styleProp){var x=el;if(x.currentStyle)
var y=x.currentStyle[styleProp];else if(window.getComputedStyle)
var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);return y;},getImageFromURL:function(url){var arr=url.split("/");var imgStr=arr[arr.length-1];var newStr=imgStr.replace(/\)$/,"");return newStr;},hCenter:function(jqEle){var dw=$(document).width();var jw=jqEle.width();var pos={left:(dw-jw)/2}
jqEle.css(pos);},centerToDoc:function(ele,offset){var d=document.documentElement;d.w=d.clientWidth;d.h=d.clientHeight;var x=$(ele);x.w=x.width();x.h=x.height();offset=offset||{x:0,y:0};offset.x+=d.scrollLeft;offset.y+=d.scrollTop;var pos={top:((d.h-x.h)/2)+offset.y,left:((d.w-x.w)/2)+offset.x}
x.css(pos);},truncateStr:function(str,length){if(!str)str='';if(str.length>length){return str.substring(0,length-1).concat('...');}
else{return str;}}}
JS2.OO.createClass("Sci.Website");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(){var self=this;});K.oo('method',"message",function(msg){if(msg){$('#mainMessages .messages').html('<li>'+msg+'</li>');$('#mainMessages .errors').html('');}
this.showMessages();});K.oo('method',"error",function(error){if(error){$('#mainMessages .errors').html('<li>'+error+'</li>');$('#mainMessages .messages').html('');}
this.showErrors();});K.oo('method',"appendMessage",function(msg){if(msg){$('#mainMessages .messages').append('<li>'+msg+'</li>');}});K.oo('method',"appendError",function(error){if(error){$('#mainMessages .errors').append('<li>'+error+'</li>');}});K.oo('method',"showErrors",function(){this._showMessages('#mainMessages .errors');});K.oo('method',"showMessages",function(){this._showMessages('#mainMessages .messages');});K.oo('method',"hideErrors",function(delay){this._hideMessages('#mainMessages .errors',delay);});K.oo('method',"hideMessages",function(delay){this._hideMessages('#mainMessages .messages',delay);});K.oo('method',"hideErrorsImmediately",function(){$('#mainMessages').css({top:'-40',display:'none'});});K.oo('method',"_showMessages",function(selector){var jq=$(selector);var ct=$('#global-messages:first');var pa=ct.find('#mainMessages:first');var self=this;if(jq.find('li').length>0){switch(jq[0].className){case'errors':pa.addClass('error');pa.removeClass('message');break;case'messages':pa.addClass('message');pa.removeClass('error');break;}
pa.animate({opacity:"show",top:"0"},"slow");jq.show();}
this._hideMessages(selector,14000);});K.oo('method',"getScrollTop",function(){return $(window).scrollTop();});K.oo('method',"_hideMessages",function(selector,delay){var jq=$(selector);var pa=jq.parents('#mainMessages');setTimeout(function(){pa.animate({opacity:"hide",top:"-50"},"slow");},delay);});K.oo('method',"showDebug",function(){this.prepareDebug();this.jq.toggle();});K.oo('method',"addDebug",function(items){this.prepareDebug();var currentContext=false;var contextArray=[];var keyArray=false;var struct=[];for(var i=0,item;item=items[i];i++){var context=item[0];var key=item[1];var value=item[2];var hidden=item[3];if(context!=contextArray.name){contextArray=[];contextArray.name=context;struct.push(contextArray);}
contextArray.push([key,value,hidden]);}
var html='<li class="request">';for(var it114=0,context,it114__arr=struct,it114__len=it114__arr.length;(context=it114__arr[it114])||it114<it114__len;it114++){html+='<table class="debug">';html+='<tr>';html+='<td colspan="2"><span class="context">'+context.name+'</span> <span class="remove">[x]</span></td></tr>';for(var it115=0,item,it115__arr=context,it115__len=it115__arr.length;(item=it115__arr[it115])||it115<it115__len;it115++){var hidden=sci.common.htmlEscape(item[2])?'style="display: none"':'';html+='<tr>';html+='<td valign="top"><div class="key">'+sci.common.htmlEscape(item[0])+'</div></td>';html+='<td valign="top"><div class="value" '+hidden+'><pre>'+sci.common.htmlEscape(item[1])+'</pre></div></td>';html+='</tr>';}
html+='</table>';}
html+='</li>';this.jqRequests.prepend(html);this.prepareDebug();});K.oo('method',"prepareDebug",function(){if(!this.jq){this.jq=$('#debugDiv');this.jqLink=$('#debugLink');this.jqclear=this.jq.find('>.clearAll');this.jqClose=this.jq.find('>.closeThis');this.jqRequests=this.jq.find('>.requests');var self=this;this.jq.click(function(evt){self.handleDebugClick(evt)});}});K.oo('method',"handleDebugClick",function(evt){var ele=evt.target;if(ele.className=='key'){$(ele.parentNode).next().find('.value').toggle();}else if(ele.className=='remove'){$(ele).parents('table.debug').remove();}else if(ele.className=='clearAll'){this.jqRequests.html('');}else if(ele.className=='closeThis'){$(ele).parents('#debugDiv').hide();}});K.oo('method',"userLink",function(userId,userName){console.log('DEPRECATED!!!!!!!!!! use DISPLAY.user(userId, username)');return'<a href="/members/'+userId+'">'+userName+'</a>';});K.oo('method',"showOpenSquareDialog",function(){if(!this.openSquareDialog){this.openSquareDialog=new Sci.OpenSquare();}
this.openSquareDialog.open();});})(Sci.Website,Sci);sci.website=new Sci.Website();var WEBSITE=sci.website;$('body').ready(function(){if(sci.website){$('.openSquareLink').live('click',sci.website.showOpenSquareDialog);}});JS2.OO.createClass("Sci.Ajax");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('member','exceptionMailURL','/contact/exception_report');K.oo('method',"get",function(url,params,onComplete,toEsc){return this._handleRequest(url,params,onComplete,toEsc);});K.oo('method',"post",function(url,params,onComplete,toEsc){params['__post']=true;this._handleRequest(url,params,onComplete,toEsc);});K.oo('method',"handleForm",function(selector,onResponseComplete){var self=this;var onComplete=function(txt,respStatus){self._handleResponse(txt,onResponseComplete);};$(selector).ajaxForm({success:onComplete});});K.oo('method',"esc",function(str){if(str==null||str==undefined)return'';return str.toString().replace(/\\u0026/g,"&amp;").replace(/\\u003C/g,"&lt;").replace(/\\u003E/g,"&gt;");});K.oo('method',"_handleRequest",function(url,params,onResponseComplete,toEsc){if(url.indexOf('.js')<0)url+='.js';var self=this;this.onError=params['onError']?params['onError']:false;this.onLogin=params['onLogin']?params['onLogin']:false;this.onLoginReload=params['onLoginReload']?params['onLoginReload']:false;delete(params['onError']);delete(params['onLogin']);delete(params['onLoginReload']);if(window.top!=window){params._synd_url=document.referrer;}
var requestParams={url:url,params:params};var onComplete=(function(self,onResponseComplete,toEsc,requestParams){return function(txt,respStatus){var start=(new Date()).getTime();self._handleResponse(txt,onResponseComplete,self.onError,toEsc,requestParams);var finish=(new Date()).getTime();if(window.console)WEBSITE.addDebug([['ajax','post process',finish-start]]);}})(this,onResponseComplete,toEsc,requestParams);var handleError=function(xhr,message){if(xhr['status']==0)return;if(xhr['status']==200){onComplete(xhr.responseText,xhr.status);return;}
self.handleError(xhr);}
var requestType=params['__post']?'POST':'GET';return $.ajax({url:url,type:requestType,data:params,success:onComplete,error:handleError});});K.oo('method',"handleError",function(e){if(window.console)console.log(e);if(window.exceptionMailing)this.handleRequestError(e);WEBSITE.error('There was an error in retrieving your data.');if(this.onError)this.onError(e);});K.oo('method',"_handleResponse",function(txt,onResponseComplete,onError,toEsc,requestParams){if(toEsc)txt=this.esc(txt);if(typeof txt=='object'){var robj=txt;}else{try{eval('var robj='+txt.toString().replace(/[\r\n]+/g,' ')+';');}catch(e){if(window.console)console.log(e);return false;}}
if(robj.login){if(this.onLogin){this.onLogin();return false;}
if(this.onLoginReload){WEBSITE.error('You have been logged out. Please reload the page and resubmit your input.')
setTimeout("location.reload(true)",5000);return false;}
location.href=robj.login;return false;}
if(robj.redirect){location.href=robj.redirect;return false;}
if(!this._handleErrorsAndMessages(robj)){try{if(onError){var obj=null;if(robj.txt){var start=(new Date()).getTime();eval('var obj='+robj.txt.replace(/[\r\n]+/g,' ')+';');var finish=(new Date()).getTime();if(window.console)WEBSITE.addDebug([['ajax','parse payload',finish-start]]);}
onError(robj);return false;}else{if(!this.handledErrorMessages)WEBSITE.error('There has been an unexpected error.');}
this.handledErrorMessages=false;}catch(e){if(window.console)console.log(e);WEBSITE.error('There was an error in retrieving your data.');}
return false;}
if(!onResponseComplete){return false;}
if(this.uiDebug){this._handleUiDebug(this.uiDebug);}
try{if(robj.is_json){var start=(new Date()).getTime();var finish=(new Date()).getTime();if(window.console)WEBSITE.addDebug([['ajax','parse payload',finish-start]]);return onResponseComplete(robj.obj);}else{return onResponseComplete(robj.txt);}}catch(e){if(window.console)console.log(e);this.handleCallBackError(e,robj,requestParams);WEBSITE.error('There was an error in retrieving your data.');if(this.onError)this.onError();}});K.oo('method',"login",function(){alert('You need to login!');location.href='/login';});K.oo('method',"refreshCaptcha",function(ele){var img=$(ele).parent().find('img');var src=img.attr('src').toString().replace(/\?\d+$/,'')+'?'+(new Date()).getTime();var onComplete=function(txt,respStatus){img.attr('src',src);};$.get('/captcha'+'?'+(new Date()).getTime(),{},onComplete);});K.oo('method',"validate_by_ajax",function(jq,url,paramKey,callBack){jq.siblings('img.spinner').remove();jq.parent().append('<img class="spinner" src="/images/animation/spinner_blue_14.gif" />');var params={}
params[paramKey]=jq.val();var onComplete=function(txt,respStatus){eval("var json = "+txt.replace(/[\r\n]+/g,' '));jq.siblings().remove();if(json.txt=='false'){jq.addClass('textFieldError');}else{jq.removeClass('textFieldError');}
if(callBack)callBack(json.txt);jq.ajax=null;};if(jq.ajax)jq.ajax.abort();jq.ajax=$.post(url,params,onComplete);});K.oo('method',"_handleErrorsAndMessages",function(robj){if(robj.fatal_error){if(window.console)console.log(robj);alert("There has been an error.");return false;}
if(robj.login){location.href=robj.login;return false;}
if(robj.alert){alert(robj.alert);}
if((robj.errors&&robj.errors.length)||(robj.messages&&robj.messages.length)){$('#mainMessages .errors').html('');$('#mainMessages .messages').html('');}
if(robj.errors&&robj.errors.length){var html='';var obj=$('#mainMessages');for(var i=0;i<robj.errors.length;i++){html+='<li>'+DISPLAY.wrap_html(robj.errors[i])+'</li>';}
obj.find('.errors').html(html);sci.website.showErrors();this.handledErrorMessages=true;return false;}
if(robj.messages&&robj.messages.length){var html='';var obj=$('#mainMessages');for(var i=0;i<robj.messages.length;i++){html+='<li>'+DISPLAY.wrap_html(robj.messages[i])+'</li>';}
obj.find('.messages').html(html);sci.website.showMessages();}
if(robj.ui_debug){sci.website.addDebug(robj.ui_debug);}
return true;});K.oo('method',"handleRequestError",function(req){return;return $.ajax({url:this.exceptionMailURL,type:'POST',data:{error:req.responseText}});});K.oo('method',"handleCallBackError",function(e,obj,params){if(!e||e.message=="")return;var err={};err.request=params;err.response=obj;err.referrer=document.referrer;err.url=window.location.href;err.browser=$.browser;err.platform=navigator.appVersion;err.cookie=document.cookie;err.error=e;return $.ajax({url:this.exceptionMailURL,type:'POST',data:{error:JSON.stringify(err)}});});})(Sci.Ajax,Sci);sci.ajax=new Sci.Ajax();var AJAX=sci.ajax;sci.constants={"rowFilterFieldAttributes":[{"sortDescMin":null,"id":"consensus-value","viewName":"Consensus Value","datatype":null,"sortDescMax":null},{"sortDescMin":null,"id":"strength","viewName":"Level of Consensus","datatype":"Strength","sortDescMax":null},{"sortDescMin":null,"id":"unique-votes","viewName":"Total Votes","datatype":"Integer","sortDescMax":null}],"rowFilterAttributes":{"fact":[{"sortDescMin":null,"id":"consensus-value","viewName":"consensusValue","datatype":null,"sortDescMax":null},{"sortDescMin":null,"id":"strength","viewName":"strength","datatype":"Strength","sortDescMax":null},{"sortDescMin":null,"id":"vote-count","viewName":"!voteCount","datatype":"Integer","sortDescMax":null},{"sortDescMin":null,"id":"unique-votes","viewName":"uniqueVotes","datatype":"Integer","sortDescMax":null}],"subject":[{"sortDescMin":null,"id":"consensus-value","viewName":"consensusValue","datatype":null,"sortDescMax":null},{"sortDescMin":null,"id":"!garbage-count","viewName":"garbageCount","datatype":"GarbageCount","sortDescMax":null}],"table":[{"sortDescMin":null,"id":"consensus-value","viewName":"consensusValue","datatype":null,"sortDescMax":null},{"sortDescMin":null,"id":"strength","viewName":"strength","datatype":"Strength","sortDescMax":null},{"sortDescMin":null,"id":"vote-count","viewName":"!voteCount","datatype":"Integer","sortDescMax":null},{"sortDescMin":null,"id":"unique-votes","viewName":"uniqueVotes","datatype":"Integer","sortDescMax":null}],"field":[{"sortDescMin":null,"id":"consensus-value","viewName":"consensusValue","datatype":null,"sortDescMax":null},{"sortDescMin":null,"id":"strength","viewName":"strength","datatype":"Strength","sortDescMax":null},{"sortDescMin":null,"id":"vote-count","viewName":"!voteCount","datatype":"Integer","sortDescMax":null},{"sortDescMin":null,"id":"unique-votes","viewName":"uniqueVotes","datatype":"Integer","sortDescMax":null}]},"voteFilterAttributes":{"fact":[{"sortDescMin":null,"id":"value","viewName":"value","datatype":null,"sortDescMax":null},{"sortDescMin":null,"id":"user-id","viewName":"userId","datatype":"VotingUser","sortDescMax":null},{"sortDescMin":null,"id":"comments","viewName":"comments","datatype":"Text","sortDescMax":null},{"sortDescMin":null,"id":"source","viewName":"source","datatype":"Text","sortDescMax":null},{"sortDescMin":null,"id":"date","viewName":"date","datatype":"Date","sortDescMax":null},{"sortDescMin":null,"id":"source-dataset","viewName":"sourceDataset","datatype":"Table","sortDescMax":null},{"sortDescMin":null,"id":"timestamp","viewName":"timestamp","datatype":"Time","sortDescMax":null}],"field":[{"sortDescMin":null,"id":"value","viewName":"value","datatype":null,"sortDescMax":null},{"sortDescMin":null,"id":"user-id","viewName":"userId","datatype":"VotingUser","sortDescMax":null},{"sortDescMin":null,"id":"comments","viewName":"comments","datatype":"Text","sortDescMax":null},{"sortDescMin":null,"id":"source","viewName":"source","datatype":"Text","sortDescMax":null},{"sortDescMin":null,"id":"date","viewName":"date","datatype":"Date","sortDescMax":null},{"sortDescMin":null,"id":"source-dataset","viewName":"sourceDataset","datatype":"Table","sortDescMax":null},{"sortDescMin":null,"id":"timestamp","viewName":"timestamp","datatype":"Time","sortDescMax":null}]},"rowSortFieldAttributes":["consensus-val","unique-votes","strength"],"notRatedRating":0.3333333333,"datatypes":{"boolean":{"name":"Boolean","defaultAggregation":"mode","sortDescMin":null,"quartzId":0,"aggregationMethods":[],"viewName":"","displayMethods":null,"quartzName":null,"operatorOptions":[],"sortDescMax":null,"primaryKeyName":""},"strength":{"name":"Strength","defaultAggregation":"mode","sortDescMin":null,"quartzId":null,"aggregationMethods":[{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the arithmetic average of submitted values","name":"Mean","id":"mean"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"}],"viewName":"Strength","displayMethods":null,"quartzName":null,"operatorOptions":[{"case_sensitive":null,"value":70,"inclusive":null,"id":"debated","verbiage":"debated"},{"case_sensitive":null,"value":70,"inclusive":null,"id":"ndebated","verbiage":"ndebated"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"seq","verbiage":"eq"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"sneq","verbiage":"neq"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"s<","verbiage":"smaller"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"s>","verbiage":"bigger"}],"sortDescMax":null,"primaryKeyName":"Strength"},"numeric":{"name":"Numeric","defaultAggregation":"mean","sortDescMin":"0","quartzId":4,"aggregationMethods":[{"description":"the arithmetic average of submitted values","name":"Mean","id":"mean"},{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"},{"description":"all unique values","name":"List","id":"top-values"}],"viewName":"Decimal Number","displayMethods":["decimal0","decimal2","decimal6"],"quartzName":"double","operatorOptions":[{"case_sensitive":null,"value":null,"inclusive":null,"id":"eq","verbiage":"equals"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"eq-in","verbiage":"equals-in"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"neq","verbiage":"not-equals"},{"case_sensitive":null,"value":null,"inclusive":true,"id":"<","verbiage":"smaller-than"},{"case_sensitive":null,"value":null,"inclusive":true,"id":">","verbiage":"bigger-than"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"blank","verbiage":"blank"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"nblank","verbiage":"not-blank"}],"sortDescMax":"9","primaryKeyName":null},"isGarbage":{"name":"IsGarbage","defaultAggregation":"mode","sortDescMin":null,"quartzId":-1,"aggregationMethods":[],"viewName":"Is Garbage","displayMethods":null,"quartzName":null,"operatorOptions":[{"case_sensitive":null,"value":-1,"inclusive":null,"id":"eq","verbiage":"eq"},{"case_sensitive":null,"value":-1,"inclusive":null,"id":"neq","verbiage":"neq"}],"sortDescMax":null,"primaryKeyName":null},"text":{"name":"Text","defaultAggregation":"mode","sortDescMin":null,"quartzId":-1,"aggregationMethods":[],"viewName":"Text","displayMethods":null,"quartzName":null,"operatorOptions":[{"case_sensitive":true,"value":null,"inclusive":null,"id":"contains","verbiage":"contains"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"ncontains","verbiage":"notContains"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"empty","verbiage":"blank"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"nempty","verbiage":"notBlank"}],"sortDescMax":null,"primaryKeyName":null},"time":{"name":"Time","defaultAggregation":"mode","sortDescMin":0,"quartzId":3,"aggregationMethods":[{"description":"the arithmetic average of submitted values","name":"Mean","id":"mean"},{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"},{"description":"all unique values","name":"List","id":"top-values"}],"viewName":"Time","displayMethods":["toInt"],"quartzName":null,"operatorOptions":[{"case_sensitive":null,"value":null,"inclusive":null,"id":"lt","verbiage":"before"}],"sortDescMax":null,"primaryKeyName":"Time"},"lng":{"name":"Lng","defaultAggregation":"wiki","sortDescMin":"0","quartzId":4,"aggregationMethods":[{"description":"the arithmetic average of submitted values","name":"Mean","id":"mean"},{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"},{"description":"all unique values","name":"List","id":"top-values"}],"viewName":"Lng","displayMethods":["decimal0","decimal2","decimal6"],"quartzName":"double","operatorOptions":[{"case_sensitive":null,"value":null,"inclusive":null,"id":"eq","verbiage":"equals"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"eq-in","verbiage":"equals-in"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"neq","verbiage":"not-equals"},{"case_sensitive":null,"value":null,"inclusive":true,"id":"<","verbiage":"smaller-than"},{"case_sensitive":null,"value":null,"inclusive":true,"id":">","verbiage":"bigger-than"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"blank","verbiage":"blank"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"nblank","verbiage":"not-blank"}],"sortDescMax":"9","primaryKeyName":null},"zipCode":{"name":"ZipCode","defaultAggregation":"mode","sortDescMin":"0","quartzId":2,"aggregationMethods":[{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"},{"description":"all unique values","name":"List","id":"top-values"}],"viewName":"Zip Code","displayMethods":["showInvisible","hideInvisible"],"quartzName":"zip","operatorOptions":[{"case_sensitive":true,"value":null,"inclusive":null,"id":"contains","verbiage":"contains"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"contains-in","verbiage":"contains-in"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"eqp","verbiage":"eqp"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"eqp-in","verbiage":"eqp-in"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"neqp","verbiage":"not-equals"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"starts","verbiage":"starts-with"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"starts-in","verbiage":"starts-within"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"ends","verbiage":"ends-with"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"ends-in","verbiage":"ends-within"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"blank","verbiage":"blank"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"nblank","verbiage":"not-blank"}],"sortDescMax":"9","primaryKeyName":"String"},"phoneNumber":{"name":"PhoneNumber","defaultAggregation":"mode","sortDescMin":"0","quartzId":2,"aggregationMethods":[{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"},{"description":"all unique values","name":"List","id":"top-values"}],"viewName":"Phone Number","displayMethods":["showInvisible","hideInvisible"],"quartzName":"phone","operatorOptions":[{"case_sensitive":true,"value":null,"inclusive":null,"id":"contains","verbiage":"contains"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"contains-in","verbiage":"contains-in"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"eqp","verbiage":"eqp"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"eqp-in","verbiage":"eqp-in"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"neqp","verbiage":"not-equals"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"starts","verbiage":"starts-with"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"starts-in","verbiage":"starts-within"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"ends","verbiage":"ends-with"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"ends-in","verbiage":"ends-within"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"blank","verbiage":"blank"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"nblank","verbiage":"not-blank"}],"sortDescMax":"9","primaryKeyName":"String"},"date":{"name":"Date","defaultAggregation":"mode","sortDescMin":"Jan","quartzId":2,"aggregationMethods":[{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"},{"description":"all unique values","name":"List","id":"top-values"}],"viewName":"Date","displayMethods":["inSeconds","inDate","inTime"],"quartzName":"date","operatorOptions":[{"case_sensitive":null,"value":null,"inclusive":null,"id":"on","verbiage":"is-on"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"not-on","verbiage":"is-not-on"},{"case_sensitive":null,"value":null,"inclusive":true,"id":"before","verbiage":"before"},{"case_sensitive":null,"value":null,"inclusive":true,"id":"after","verbiage":"after"}],"sortDescMax":"Dec","primaryKeyName":"Date"},"table":{"name":"Table","defaultAggregation":"mode","sortDescMin":null,"quartzId":-1,"aggregationMethods":[],"viewName":"Table","displayMethods":null,"quartzName":null,"operatorOptions":[{"case_sensitive":null,"value":null,"inclusive":null,"id":"eq","verbiage":"eq"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"neq","verbiage":"neq"},{"case_sensitive":null,"value":"this","inclusive":null,"id":"is","verbiage":"from"},{"case_sensitive":null,"value":"this","inclusive":null,"id":"isnot","verbiage":"notFrom"}],"sortDescMax":null,"primaryKeyName":null},"uUID":{"name":"UUID","defaultAggregation":"mode","sortDescMin":"0","quartzId":7,"aggregationMethods":[{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"},{"description":"all unique values","name":"List","id":"top-values"}],"viewName":"UUID","displayMethods":["showInvisible","hideInvisible"],"quartzName":"uuid","operatorOptions":[{"case_sensitive":true,"value":null,"inclusive":null,"id":"contains","verbiage":"contains"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"contains-in","verbiage":"contains-in"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"eqp","verbiage":"eqp"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"eqp-in","verbiage":"eqp-in"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"neqp","verbiage":"not-equals"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"starts","verbiage":"starts-with"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"starts-in","verbiage":"starts-within"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"ends","verbiage":"ends-with"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"ends-in","verbiage":"ends-within"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"blank","verbiage":"blank"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"nblank","verbiage":"not-blank"}],"sortDescMax":"9","primaryKeyName":"String"},"double":{"name":"Numeric","defaultAggregation":"mean","sortDescMin":"0","quartzId":4,"aggregationMethods":[{"description":"the arithmetic average of submitted values","name":"Mean","id":"mean"},{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"},{"description":"all unique values","name":"List","id":"top-values"}],"viewName":"Decimal Number","displayMethods":["decimal0","decimal2","decimal6"],"quartzName":"double","operatorOptions":[{"case_sensitive":null,"value":null,"inclusive":null,"id":"eq","verbiage":"equals"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"eq-in","verbiage":"equals-in"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"neq","verbiage":"not-equals"},{"case_sensitive":null,"value":null,"inclusive":true,"id":"<","verbiage":"smaller-than"},{"case_sensitive":null,"value":null,"inclusive":true,"id":">","verbiage":"bigger-than"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"blank","verbiage":"blank"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"nblank","verbiage":"not-blank"}],"sortDescMax":"9","primaryKeyName":null},"link":{"name":"Link","defaultAggregation":"mode","sortDescMin":"A","quartzId":2,"aggregationMethods":[{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"},{"description":"all unique values","name":"List","id":"top-values"}],"viewName":"Link","displayMethods":["showInvisible","hideInvisible"],"quartzName":"link","operatorOptions":[{"case_sensitive":true,"value":null,"inclusive":null,"id":"contains","verbiage":"contains"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"contains-in","verbiage":"contains-in"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"eqp","verbiage":"eqp"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"eqp-in","verbiage":"eqp-in"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"neqp","verbiage":"not-equals"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"starts","verbiage":"starts-with"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"starts-in","verbiage":"starts-within"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"ends","verbiage":"ends-with"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"ends-in","verbiage":"ends-within"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"blank","verbiage":"blank"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"nblank","verbiage":"not-blank"}],"sortDescMax":"Z","primaryKeyName":"String"},"string":{"name":"String","defaultAggregation":"mode","sortDescMin":"A","quartzId":2,"aggregationMethods":[{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"},{"description":"all unique values","name":"List","id":"top-values"}],"viewName":"Text","displayMethods":["showInvisible","hideInvisible"],"quartzName":"string","operatorOptions":[{"case_sensitive":true,"value":null,"inclusive":null,"id":"contains","verbiage":"contains"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"contains-in","verbiage":"contains-in"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"eqp","verbiage":"eqp"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"eqp-in","verbiage":"eqp-in"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"neqp","verbiage":"not-equals"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"starts","verbiage":"starts-with"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"starts-in","verbiage":"starts-within"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"ends","verbiage":"ends-with"},{"case_sensitive":true,"value":null,"inclusive":null,"id":"ends-in","verbiage":"ends-within"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"blank","verbiage":"blank"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"nblank","verbiage":"not-blank"}],"sortDescMax":"Z","primaryKeyName":"String"},"garbageCount":{"name":"GarbageCount","defaultAggregation":"mode","sortDescMin":null,"quartzId":-1,"aggregationMethods":[],"viewName":"GarbageCount","displayMethods":null,"quartzName":null,"operatorOptions":[{"case_sensitive":null,"value":null,"inclusive":true,"id":">","verbiage":"more"},{"case_sensitive":null,"value":null,"inclusive":true,"id":"<","verbiage":"less"}],"sortDescMax":null,"primaryKeyName":null},"lat":{"name":"Lat","defaultAggregation":"wiki","sortDescMin":"0","quartzId":4,"aggregationMethods":[{"description":"the arithmetic average of submitted values","name":"Mean","id":"mean"},{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"},{"description":"all unique values","name":"List","id":"top-values"}],"viewName":"Lat","displayMethods":["decimal0","decimal2","decimal6"],"quartzName":"double","operatorOptions":[{"case_sensitive":null,"value":null,"inclusive":null,"id":"eq","verbiage":"equals"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"eq-in","verbiage":"equals-in"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"neq","verbiage":"not-equals"},{"case_sensitive":null,"value":null,"inclusive":true,"id":"<","verbiage":"smaller-than"},{"case_sensitive":null,"value":null,"inclusive":true,"id":">","verbiage":"bigger-than"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"blank","verbiage":"blank"},{"case_sensitive":null,"value":0,"inclusive":null,"id":"nblank","verbiage":"not-blank"}],"sortDescMax":"9","primaryKeyName":null},"votingUser":{"name":"VotingUser","defaultAggregation":"mode","sortDescMin":null,"quartzId":-1,"aggregationMethods":[],"viewName":"Voting User","displayMethods":null,"quartzName":null,"operatorOptions":[{"case_sensitive":null,"value":"me","inclusive":null,"id":"is-me","verbiage":"me"},{"case_sensitive":null,"value":"me","inclusive":null,"id":"not-me","verbiage":"notMe"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"!contains","verbiage":"contains"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"is-user","verbiage":"eq"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"is-not-user","verbiage":"neq"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"!starts","verbiage":"starts"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"!ends","verbiage":"ends"},{"case_sensitive":null,"value":"active","inclusive":null,"id":"!isActive","verbiage":"active"},{"case_sensitive":null,"value":"active","inclusive":null,"id":"!isNotActive","verbiage":"notActive"}],"sortDescMax":null,"primaryKeyName":null},"integer":{"name":"Integer","defaultAggregation":"mean","sortDescMin":"0","quartzId":2,"aggregationMethods":[{"description":"the most common value","name":"Mode","id":"mode"},{"description":"the arithmetic average of submitted values","name":"Mean","id":"mean"},{"description":"the most recently submitted value","name":"Wiki","id":"wiki"}],"viewName":"Whole Number","displayMethods":[],"quartzName":"int","operatorOptions":[{"case_sensitive":null,"value":null,"inclusive":null,"id":"eq","verbiage":"equals"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"eq-in","verbiage":"equals-in"},{"case_sensitive":null,"value":null,"inclusive":null,"id":"neq","verbiage":"not-equals"},{"case_sensitive":null,"value":null,"inclusive":true,"id":"<","verbiage":"smaller-than"},{"case_sensitive":null,"value":null,"inclusive":true,"id":">","verbiage":"bigger-than"}],"sortDescMax":"9","primaryKeyName":"Integer"}}};sci.constants.datatypes.GarbageCount=sci.constants.datatypes.garbageCount;sci.constants.datatypes.UUID=sci.constants.datatypes.uUID;sci.constants.datatypes.Time=sci.constants.datatypes.time;sci.constants.datatypes.String=sci.constants.datatypes.string;sci.constants.datatypes.Link=sci.constants.datatypes.link;sci.constants.datatypes.Table=sci.constants.datatypes.table;sci.constants.datatypes.Date=sci.constants.datatypes.date;sci.constants.datatypes.Double=sci.constants.datatypes.double;sci.constants.datatypes.PhoneNumber=sci.constants.datatypes.phoneNumber;sci.constants.datatypes.Strength=sci.constants.datatypes.strength;sci.constants.datatypes.Boolean=sci.constants.datatypes.boolean;sci.constants.datatypes.ZipCode=sci.constants.datatypes.zipCode;sci.constants.datatypes.Text=sci.constants.datatypes.text;sci.constants.datatypes.VotingUser=sci.constants.datatypes.votingUser;sci.constants.datatypes.Lat=sci.constants.datatypes.lat;sci.constants.datatypes.Integer=sci.constants.datatypes.integer;sci.constants.datatypes.IsGarbage=sci.constants.datatypes.isGarbage;sci.constants.datatypes.Lng=sci.constants.datatypes.lng;sci.constants.datatypes.Numeric=sci.constants.datatypes.numeric;JS2.OO.createClass("Sci.ConstantUtil");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"getFieldAttribute",function(attrName){attrName=attrName.replace(/\.\d+$/,'');var attrs=sci.constants.rowFilterFieldAttributes;for(var it121=0,attr,it121__arr=attrs,it121__len=it121__arr.length;(attr=it121__arr[it121])||it121<it121__len;it121++){if(attr.id==attrName)return attr;}});K.oo('method',"getOperator",function(dtName,operator){var dt=sci.constants.datatypes[dtName];var ops=dt.operatorOptions;for(var it122=0,o,it122__arr=ops,it122__len=it122__arr.length;(o=it122__arr[it122])||it122<it122__len;it122++){if(o.id==unescape(operator)){return o;}}});K.oo('method',"getAvailableDatatypes",function(isPrimary){return isPrimary?['String','Integer','Date','Link','PhoneNumber','ZipCode','UUID']:['String','Double','Date','Link','PhoneNumber','ZipCode','UUID','Lat','Lng'];});K.oo('method',"isNumericDatatype",function(dt){var datatype='';if(typeof(dt)=='string'){datatype=dt;}else{datatype=dt.name;}
return datatype.match(/(Numeric|Integer|Double|Lat|Lng)/);});})(Sci.ConstantUtil,Sci);function alphanumCase(a,b){function chunkify(t){var tz=new Array();var x=0,y=-1,n=0,i,j;while(i=(j=t.charAt(x++)).charCodeAt(0)){var m=(i==46||(i>=48&&i<=57));if(m!==n){tz[++y]="";n=m;}
tz[y]+=j;}
return tz;}
var aa=chunkify(String(a).toLowerCase());var bb=chunkify(String(b).toLowerCase());for(x=0;aa[x]&&bb[x];x++){if(aa[x]!==bb[x]){var c=Number(aa[x]),d=Number(bb[x]);if(c==aa[x]&&d==bb[x]){return c-d;}else return(aa[x]>bb[x])?1:-1;}}
return aa.length-bb.length;}
sci.cUtil=new Sci.ConstantUtil();var fixDate=function(integer){var bt=new Date(integer);var by=bt.getFullYear();var bm=bt.getMonth()+1;var bd=bt.getDate();integer+=bt.getTimezoneOffset()*60000;if(by*10000+bm*100+bd>15821014){return(new Date(integer));}
if(by<0){var h=parseInt((0-by)/100);var c=h-parseInt(h/4);return(new Date(integer+86400000*(c+2)));}
var sh=parseInt(by/100)+1;if((by%100==0)&&(by%400!=0)&&(bm*100+bd<228))sh--;var c=13-sh+parseInt(sh/4);return(new Date(integer-86400000*(10-c)));}
sci.constants.datatypes.Numeric.display=function(str){if(!str&&str!=0)return'';var num=parseFloat(str);return sci.constants.datatypes.extraComma(num);}
sci.constants.datatypes.Numeric.sort=alphanumCase;sci.constants.datatypes.Double.sort=alphanumCase;sci.constants.datatypes.Double.display=sci.constants.datatypes.Numeric.display;sci.constants.datatypes.Integer.display=function(str){if(!str&&str!=0)return'';var num=parseInt(str.toString(),10);return sci.constants.datatypes.extraComma(num);}
sci.constants.datatypes.extraComma=function(num){return num.toString();var minus=(num<0);num=Math.abs(num);var numStr=num.toString();if(/[a-zA-Z]/.test(numStr)){return minus?('-'+numStr):numStr;}
numParts=numStr.split('.');var sections=[];var numWhole=numParts[0];var numDigit=numParts[1];while(numWhole.length>3){var section=numWhole.substr(numWhole.length-3);sections.unshift(section);numWhole=numWhole.substr(0,numWhole.length-3);}
if(numWhole.length>0){sections.unshift(numWhole)};numStr=sections.join(',');if(numDigit&&numDigit.length>0)numStr+='.'+numDigit;if(minus)numStr='-'+numStr;return numStr;};sci.constants.datatypes.Integer.sort=alphanumCase;sci.constants.datatypes.String.display=function(str){return sci.common.htmlEscape(str);}
sci.constants.datatypes.String.sort=alphanumCase;sci.constants.datatypes.Link.display=sci.constants.datatypes.String.display;sci.constants.datatypes.Link.sort=alphanumCase;sci.constants.datatypes.PhoneNumber.display=sci.constants.datatypes.String.display;sci.constants.datatypes.PhoneNumber.sort=alphanumCase;sci.constants.datatypes.ZipCode.display=sci.constants.datatypes.String.display;sci.constants.datatypes.ZipCode.sort=alphanumCase;sci.constants.datatypes.UUID.display=sci.constants.datatypes.String.display;sci.constants.datatypes.UUID.sort=alphanumCase;sci.constants.datatypes.Lat.display=sci.constants.datatypes.Lng.display=function(str){if(!str&&str!=0)return'';return parseFloat(str).toFixed(6);}
sci.constants.datatypes.Lat.display=sci.constants.datatypes.Numeric.display;sci.constants.datatypes.Lat.sort=alphanumCase;sci.constants.datatypes.Lng.display=sci.constants.datatypes.Numeric.display;sci.constants.datatypes.Lng.sort=alphanumCase;sci.constants.datatypes.Date.display=function(str){if(str==null)return'';if(str.toString().match(/^\d+\-\d+\-\d+$/))return str;var dt=fixDate(parseInt(str)*1000);var y=dt.getFullYear();var m=dt.getMonth()+1;if(m<10)m='0'+m;var d=dt.getDate();if(d<10)d='0'+d;return y+'-'+m+'-'+d;}
sci.constants.datatypes.Date.sort=alphanumCase;sci.constants.datatypes.Date.displayInTime=function(str){if(!str)return'';var dt=fixDate(parseInt(str)*1000);var y=dt.getFullYear();var m=dt.getMonth()+1;if(m<10)m='0'+m;var d=dt.getDate();if(d<10)d='0'+d;var h=dt.getHours();if(h<10)h='0'+h;var mi=dt.getMinutes();if(mi<10)mi='0'+mi;var s=dt.getSeconds();if(s<10)s='0'+s;return y+'-'+m+'-'+d+' '+h+':'+mi;}
sci.constants.datatypes.Date.displayInTimeWithoutFixDate=function(str){if(!str)str=new Date().getTime();var dt=new Date(parseInt(str));var y=dt.getFullYear();var m=dt.getMonth()+1;if(m<10)m='0'+m;var d=dt.getDate();if(d<10)d='0'+d;var h=dt.getHours();if(h<10)h='0'+h;var mi=dt.getMinutes();if(mi<10)mi='0'+mi;var s=dt.getSeconds();if(s<10)s='0'+s;return y+'-'+m+'-'+d+' '+h+':'+mi+":"+s;}
sci.constants.datatypes.Date.displayAsMediumDate=function(str){if(!str)return'';var monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var dt=fixDate(parseInt(str)*1000);var y=dt.getFullYear();var m=dt.getMonth();m=monthNames[m];var d=dt.getDate();return m+' '+d+', '+y;}
sci.constants.datatypes.Date.dateTimeWithTimezone=function(integer){var dt=new Date();return sci.constants.datatypes.Date.displayInTime(parseInt(integer)-dt.getTimezoneOffset()*60);}
sci.constants.datatypes.Date.humanTime=function(str){var dt=fixDate(parseInt(str)*1000);var timeNow=fixDate((new Date()).getTime());var difference=timeNow.getTime()-dt.getTime();difference=Math.round(difference/(3600000*24));if(difference>=2){return sci.constants.datatypes.Date.displayAsMediumDate(str);}else{return timeAgoInWords(dt)+' ago';}}
var timeAgoInWords=function(fromTime){var timeNow=fixDate((new Date()).getTime());var diffMinutes=timeNow.getTime()-fromTime.getTime();diffMinutes=Math.round(diffMinutes/60000);if(diffMinutes<1){return'less than a minute';}else if(diffMinutes==1){return'1 minute';}else if(diffMinutes>=2&&diffMinutes<=44){return(diffMinutes+' minutes');}else if(diffMinutes>=45&&diffMinutes<=89){return'about 1 hour';}else if(diffMinutes>=90&&diffMinutes<=1439){var hours=Math.round(diffMinutes/60.0);return('about '+hours+' hours');}else if(diffMinutes>=1440&&diffMinutes<=2879){return'1 day';}else if(diffMinutes>=2880&&diffMinutes<=43199){var days=Math.round(diffMinutes/1440.0);return(days+' days');}else if(diffMinutes>=43200&&diffMinutes<=86399){return'about 1 month';}else if(diffMinutes>=86400&&diffMinutes<=525599){var months=Math.round(diffMinutes/43200.0);return(months+' months');}else if(diffMinutes>=525600&&diffMinutes<=1051199){return'about 1 year';}else{var years=Math.round(diffMinutes/525600.0);return('over '+years+'years');}}
sci.displayMethods={showInvisible:function(str){if(!str)return'<span class="grayText">[blank]</span>';return str.replace(/\s/g,'[]');},hideInvisible:function(str){if(!str)return'';return str;},decimal0:function(str){if(!str)return'';var f=parseFloat(str);return f.toFixed(0);},decimal2:function(str){if(!str)return'';var f=parseFloat(str);return f.toFixed(2);},decimal6:function(str){if(!str)return'';var f=parseFloat(str);return f.toFixed(6);},inTime:sci.constants.datatypes.Date.displayInTime,inDate:sci.constants.datatypes.Date.display,inSeconds:function(str){return(str)?str:'';}}
JS2.OO.createClass("Sci.Graphic");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(options){this.renderer=document.all?new Sci.Graphic.VmlRenderer(options):new Sci.Graphic.SvgRenderer(options);});K.oo('method',"drawLine",function(params){this.renderer.drawLine(params);});K.oo('method',"drawPolygon",function(params){this.renderer.drawPolygon(params);});K.oo('method',"drawCircle",function(params){this.renderer.drawCircle(params);});})(Sci.Graphic,Sci);JS2.OO.createClass("Sci.Graphic.SvgRenderer");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(options){this.nameSpace='http://www.w3.org/2000/svg';this.body=options.ele;this.doc=this.body.ownerDocument;this.root=this.doc.createElementNS(this.nameSpace,"svg");this.body.appendChild(this.root);});K.oo('method',"drawLine",function(params){var line=this.doc.createElementNS(this.nameSpace,"line");line.setAttribute('x1',params.x1);line.setAttribute('y1',params.y1);line.setAttribute('x2',params.x2);line.setAttribute('y2',params.y2);line.setAttribute('stroke',params.stroke);line.setAttribute('stroke-width',params.strokeWidth);this.root.appendChild(line);});K.oo('method',"drawPolygon",function(params){var polygon=this.doc.createElementNS(this.nameSpace,"polygon");polygon.setAttribute("points",params.points);polygon.setAttribute("fill",params.fill);polygon.setAttribute("stroke",params.stroke);this.root.appendChild(polygon);});K.oo('method',"drawCircle",function(params){var circle=this.doc.createElementNS(this.nameSpace,"circle");circle.setAttribute("cx",params.cx);circle.setAttribute("cy",params.cy);circle.setAttribute("r",params.r);circle.setAttribute("fill",params.fill);circle.setAttribute("stroke",params.stroke);circle.setAttribute('stroke-width',params.strokeWidth);this.root.appendChild(circle);});})(Sci.Graphic.SvgRenderer,Sci.Graphic);JS2.OO.createClass("Sci.Graphic.VmlRenderer");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(options){this.body=options.ele;this.doc=this.body.ownerDocument;try{this.doc.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML");}catch(e){}});K.oo('method',"drawLine",function(params){var line=this.doc.createElement("v:line");line.from=params.x1+','+params.y1;line.to=params.x2+','+params.y2;line.strokeColor=params.stroke;line.strokeWeight=params.strokeWidth;this.body.appendChild(line);});K.oo('method',"drawPolygon",function(params){var polygon=this.doc.createElement("v:polyline");this.body.appendChild(polygon);polygon.points.value=params.points+" "+params.points.substring(0,params.points.indexOf(" "));polygon.fillcolor.value=params.fill;polygon.strokecolor.value=params.stroke;});K.oo('method',"drawCircle",function(params){var circle=this.doc.createElement("v:oval");circle.style.position='absolute';circle.style.left=(params.cx-params.r)+'px';circle.style.top=(params.cy-params.r)+'px';circle.style.width=(params.r*2)+'px';circle.style.height=circle.style.width;circle.fillColor=params.fill;circle.strokeColor=params.stroke;circle.strokeWeight=params.strokeWidth;this.body.appendChild(circle);});})(Sci.Graphic.VmlRenderer,Sci.Graphic);JS2.OO.createClass("Sci.DialogPointer");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(options){options=options||{};this.options=options;this.padding=options.padding||5;this.thickness=options.thickness||40;this.threshold=options.threshold||60;this.buildElement();this.registerEvents();});K.oo('method',"show",function(){this.isHidden=false;this.jq.show();this.jqCircle.show();});K.oo('method',"hide",function(){this.isHidden=true;this.jq.hide();this.jqCircle.hide();});K.oo('method',"setZIndex",function(z){this.jq.css('z-index',z);this.jqCircle.css('z-index',z);});K.oo('method',"point",function(dialog,cell){if(this.isHidden)return;this.jq.html('');var apex=this.apex(cell);var base=this.hBase(dialog,apex);if(!base){if(!this.vPoint(dialog,apex)){this.hide();}
return;}
var container={};container.top=Math.min(apex.top,base.top.top);container.left=Math.min(apex.left,base.top.left);container.width=Math.abs(apex.left-base.top.left);var bottom=Math.max(apex.top,base.bottom.top);container.height=Math.abs(bottom-container.top);container.height+=5;container.top-=5;if(container.width<this.thickness){if(this.vPoint(dialog,apex)){return;}}
this.svg=new Sci.Graphic({ele:this.jq[0]});this.jq.css(container);var point1={left:(base.leftSide?container.width:0),top:(apex.top-container.top)};var point2={left:(base.leftSide?0:container.width),top:(base.top.top-container.top)};var point3={left:(base.leftSide?0:container.width),top:(base.bottom.top-container.top)};var points=point1.left+','+
point1.top+' '+
point2.left+','+
point2.top+' '+
point3.left+','+
point3.top;this.drawPolygon({points:points});this.drawLines(point1,point2,point3);this.positionCircle(apex.left,apex.top);this.jq.show();this.jqCircle.show();dialog.css('opacity',"1");});K.oo('method',"drawPolygon",function(options){options.strokeWidth='1';options.stroke='white';options.fill='white';this.svg.drawPolygon(options);});K.oo('method',"drawLines",function(point1,point2,point3){this.drawLine({x1:point1.left,x2:point2.left,y1:point1.top,y2:point2.top});this.drawLine({x1:point1.left,x2:point3.left,y1:point1.top,y2:point3.top});});K.oo('method',"drawLine",function(options){options.strokeWidth='1';options.stroke='#aaaaaa';this.svg.drawLine(options);});K.oo('method',"vPoint",function(dialog,apex){var base=this.vBase(dialog,apex);if(!base)return false;var container={};container.top=Math.min(apex.top,base.left.top);container.left=Math.min(apex.left,base.left.left);var left=Math.max(apex.left,base.right.left);container.width=Math.abs(container.left-left);var bottom=Math.max(apex.top,base.left.top);container.height=Math.abs(bottom-container.top);this.svg=new Sci.Graphic({ele:this.jq[0]});this.jq.css(container);var point1={left:(apex.left-container.left),top:(base.topSide?container.height:0)};var point2={left:(base.left.left-container.left),top:(base.left.top-container.top)};var point3={left:(base.right.left-container.left),top:(base.left.top-container.top)};var points=point1.left+','+
point1.top+' '+
point2.left+','+
point2.top+' '+
point3.left+','+
point3.top;this.drawPolygon({points:points});this.drawLines(point1,point2,point3);this.positionCircle(apex.left,apex.top);this.jq.show();this.jqCircle.show();dialog.css('opacity',"1");return true;});K.oo('method',"hBase",function(dialog,apex){var dialogHeight=dialog.outerHeight();var dialogWidth=dialog.outerWidth();var dialogOffset=dialog.offset();var dialogRight=dialogOffset.left+dialogWidth;var top={};var bottom={};var thresholdTop=dialogOffset.top+this.threshold;var thresholdBottom=dialogOffset.top-this.threshold+dialogHeight;var leftSide=apex.left>dialogRight;if(apex.top<thresholdTop){top.top=thresholdTop;bottom.top=thresholdTop+this.thickness;}else if(apex.top>thresholdBottom){bottom.top=thresholdBottom;top.top=thresholdBottom-this.thickness;}else{var middle=dialogOffset.top+(dialogHeight/2);if(apex.top>middle){top.top=apex.top-(this.threshold*2);if(top.top<thresholdTop)top.top=thresholdTop;}else{top.top=apex.top+(this.threshold*2);if(top.top>thresholdBottom)top.top=thresholdBottom;}
bottom.top=top.top+this.thickness;}
if(apex.left>dialogRight){top.left=dialogRight-1;bottom.left=dialogRight-1;}
else if(apex.left<dialogOffset.left){top.left=dialogOffset.left+1;bottom.left=dialogOffset.left+1;}
else{return false;}
return{top:top,bottom:bottom,leftSide:leftSide};});K.oo('method',"vBase",function(dialog,apex){var dialogHeight=dialog.outerHeight();var dialogWidth=dialog.outerWidth();var dialogOffset=dialog.offset();var dialogBottom=dialogOffset.top+dialogHeight;var left={};var right={};var thresholdLeft=dialogOffset.left-this.threshold;var thresholdRight=dialogOffset.left-this.threshold+dialogWidth;var topSide=apex.top>dialogBottom;if(apex.left<thresholdLeft){left.left=thresholdLeft;right.left=thresholdLeft+this.thickness;}else if(apex.left>thresholdRight){left.left=thresholdRight-this.thickness;right.left=thresholdRight;}else{var middle=dialogOffset.left+(dialogWidth/2);if(apex.left>middle){left.left=apex.left-(this.threshold*2);}else{left.left=apex.left+(this.threshold*2);}
right.left=left.left+this.thickness;}
if(apex.top<dialogOffset.top){left.top=dialogOffset.top+1;right.top=dialogOffset.top+1;}
else if(apex.top>dialogBottom){left.top=dialogBottom-1;right.top=dialogBottom-1;}
else{return false;}
return{right:right,left:left,topSide:topSide};});K.oo('method',"apex",function(cell){var cellHeight=cell.height();var cellOffset=cell.offset();return{top:cellOffset.top+(cellHeight/2),left:cellOffset.left+cell.width()-this.padding};});K.oo('method',"buildElement",function(){this.jq=$('<div class="svgPointer"></div>');this.jqCircle=$('<div class="svgPointerCircle"></div>');$(document.body).append(this.jq).append(this.jqCircle);this.drawCircle();this.jq.hide();this.jqCircle.hide();});K.oo('method',"registerEvents",function(){var click=this.options.click;var dblClick=this.options.dblClick;var move=this.options.move;if(click)this.jq.click(click);if(dblClick)this.jq.dblclick(dblClick);if(move)sci.domEvent.add(this.jq,'mousemove',move,true);});K.oo('method',"positionCircle",function(x,y){this.jqCircle.css({top:y-7,left:x-7});});K.oo('method',"drawCircle",function(){this.svgCircle=new Sci.Graphic({ele:this.jqCircle[0]});this.svgCircle.drawCircle({cx:7,cy:7,r:5,fill:'#d1f39d',stroke:"#080",strokeWidth:1});this.jqCircle.css({height:14,width:14});});})(Sci.DialogPointer,Sci);JS2.OO.createClass("Sci.Upload");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(formName){this.name=formName;this.callBacks={};this.jqForm=$("form[name='"+formName+"']");this.jqIframe=this.buildIframe();this.parseFormFields();this.inSubmit=false;var self=this;this.jqForm.submit(function(){self.submit();return false;});});K.oo('method',"submit",function(){this.buildBasics();if(arguments[0]){var fields={};for(var i=0,f;f=arguments[i++];){fields[f]=true;}
this.filterSubmitFields(fields);}
this._submit();});K.oo('method',"_submit",function(){if(this.callBacks.before)this.callBacks.before();this.jqSubmitForm[0].submit();this.inSubmit=true;this.iframeDoc.body.innerHTML='';if(this.callBacks.submit)this.callBacks.submit();this.afterSubmit();});K.oo('method',"parseFormFields",function(){var self=this;var fileFields=this.jqForm.find("input[type='file']");fileFields.each(function(){self.parseFileFields(this);});});K.oo('method',"afterSubmit",function(){var self=this;var ret=this.jqIframe[0].contentWindow.document.body.innerHTML;if(ret!=''){this.inSubmit=false;if(this.callBacks.after)this.callBacks.after(ret);return;}else{setTimeout(function(){self.afterSubmit();},500);}});K.oo('method',"registerCallBacks",function(name,func){this.callBacks[name]=func;});K.oo('method',"cleanCallBacks",function(){this.callBacks={};});K.oo('method',"buildBasics",function(){this.buildContainers();this.buildSubmitFields();});K.oo('method',"buildContainers",function(){this.iframeDoc=this.jqIframe[0].contentWindow.document;this.jqSubmitForm=this.buildSubmitForm();});K.oo('method',"buildSubmitFields",function(){var fields=this.jqForm.find("*");for(var i=0,field;field=fields[i++];){if(field.name&&field.value!=undefined){if(!(field.type=='file'||((field.type=='checkbox'||field.type=='radio')&&field.checked==false))){this.buildSubmitField(field);}}}});K.oo('method',"filterSubmitFields",function(fields){this.jqSubmitForm.find('*').each(function(){if(!fields[this.name]){$(this).remove();}});});K.oo('method',"buildSubmitField",function(field){var jqField=$(this.jqSubmitForm).find("textarea[name='"+field.name+"']");if(field.name.match(/\[\w*\]/)||!jqField[0]){jqField=$(this.iframeDoc.createElement($.browser.msie?"<textarea name='"+field.name+"'>":"textarea"));jqField[0].name=field.name;this.jqSubmitForm.append(jqField);jqField.val(field.value);}});K.oo('method',"parseFileFields",function(field){var self=this;if($.browser.msie){var jqPickFileLink=$(field).next('.fileUploadButton');if(!jqPickFileLink[0]){var jqPickFileLink=$(document.createElement("<a name='"+field.name+"'>"));jqPickFileLink.text('Select file');}else{jqPickFileLink.attr('name',field.name).css("display","block");}
$(field).css("display","none").after(jqPickFileLink).remove();jqPickFileLink.click(function(){if(self.inSubmit&&!confirm('Another upload is running, do you want to cancel it and submit anyway?'))return;self.inSubmit=false;self.buildContainers();self.buildFileField(this.name).click();});}else{var jqField=$(field);var jqReplaceFileBtn=$(document.createElement("input"));jqReplaceFileBtn[0].type="button";jqReplaceFileBtn[0].value="Replace File";jqField.after(jqReplaceFileBtn.hide());jqReplaceFileBtn.click(function(){if(self.inSubmit&&!confirm('Another upload is running, do you want to cancel it and submit anyway?'))return;self.inSubmit=false;$(this).hide();jqField.show();});jqField.click(function(){jqField.val('');});jqField.change(function(){self.buildContainers();var jqFile=self.jqSubmitForm.find("input[name='"+field.name+"']");if(jqFile[0])jqFile.remove();jqFile=jqField.clone();self.jqSubmitForm.append(jqFile);jqField.hide().val('');jqReplaceFileBtn.css("display","").show();self.submit();});}});K.oo('method',"buildIframe",function(){var iName=this.name+"Iframe";var jqIframe=$("iframe[name='"+iName+"']");if(!jqIframe[0]){jqIframe=$(document.createElement($.browser.msie?"<iframe name='"+iName+"'></iframe>":"iframe"));jqIframe.css("display","none");jqIframe[0].name=iName;this.jqForm.after(jqIframe);}
return jqIframe;});K.oo('method',"buildSubmitForm",function(){var jqForm=$(this.iframeDoc).find("form[name='"+this.name+"']");if(!jqForm[0]){jqForm=$(this.iframeDoc.createElement($.browser.msie?"<form name='"+this.name+"' method='post' enctype='multipart/form-data'></form>":"form"));jqForm[0].encoding='multipart/form-data';jqForm[0].action=this.jqForm[0].action;jqForm[0].method='post';jqForm[0].name=this.name;if(!this.iframeDoc.body)this.iframeDoc.appendChild(this.iframeDoc.createElement("body"));$(this.iframeDoc.body).append(jqForm);}
return jqForm;});K.oo('method',"buildFileField",function(name){var jqField=$(this.jqSubmitForm).find("input[type='file'][name='"+name+"']");if(name.match(/\[\w*\]/)||!jqField[0]){jqField=$(this.iframeDoc.createElement($.browser.msie?"<input name='"+name+"'>":"input"));jqField[0].type='file';jqField[0].name=name;this.jqSubmitForm.append(jqField);var self=this;jqField[0].attachEvent('onpropertychange',function(){if(jqField.val()!="")self.submit();});}
return jqField;});})(Sci.Upload,Sci);JS2.OO.createClass("Sci.Uploader");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('member','idx',0);K.oo('member','URL','/uploader/submit_ajax');K.oo('method',"initialize",function(jq,useFlash){this.idx++;this.jq=$(jq);this.useFlash=useFlash;this.initHTML();});K.oo('method',"initHTML",function(){this.jq.html(this.htmlCache.main(this.idx));this.jqFlash=this.jq.first('.flashUpload');this.jqDefault=this.jq.first('.defaultUpload');this.jqForm=this.jqDefault.first('form');this.buildDefaultUpload();this.buildSWFUpload();});K.oo('method',"buildDefaultUpload",function(){var self=this;this.jqForm.ajaxForm({dataType:"json",success:function(result){self.defaultUploadSuccess(result);},error:function(p){self.defaultUploadError(p);},beforeSubmit:function(p){return self.defaultBeforeSubmit(p);}});});K.oo('method',"buildSWFUpload",function(){var self=this;this.swf=new SWFUpload({flash_url:'/flash/swfupload.swf',upload_url:self.URL,file_post_name:"file",debug:false,button_image_url:"/images/uploader_button.png",button_width:"143",button_height:"25",button_placeholder_id:"Sci-Uploader-placeholder-"+this.idx,button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT,file_upload_limit:"25",file_queue_limit:"0",file_size_limit:"500 MB",file_types_description:"Data Files",file_types:"*.csv;*.xls;*.xlsx;*.tsv;*.ods;*.tgz;*.zip;*.tar;*.bz2;*.gz;*.*",swfupload_loaded_handler:function(){self.swfuploadLoaded.apply(self,arguments);},file_dialog_start_handler:function(){self.fileDialogStart.apply(self,arguments);},file_queued_handler:function(){self.fileQueued.apply(self,arguments);},file_queue_error_handler:function(){self.fileQueueError.apply(self,arguments);},file_dialog_complete_handler:function(){self.fileDialogComplete.apply(self,arguments);},upload_start_handler:function(){self.uploadStart.apply(self,arguments);},upload_progress_handler:function(){self.uploadProgress.apply(self,arguments);},upload_error_handler:function(){self.uploadError.apply(self,arguments);},upload_success_handler:function(){self.uploadSuccess.apply(self,arguments);},upload_complete_handler:function(){self.uploadComplete.apply(self,arguments);}});});K.oo('method',"cancelUpload",function(fileId){this.swf.cancelUpload(fileId);});K.oo('method',"defaultCancelUpload",function(){this.defaultUploadFile=null;});K.oo('method',"setCallbacks",function(callbacks){this.callbacks=callbacks;});K.oo('method',"defaultBeforeSubmit",function(params){var fileName=DISPLAY.trim(this.jqForm.first('input[type=file]').val());if(fileName.length==0){alert('Please choose a file to proceed.');return false;}
this.defaultUploadStart(params[0].value);return true;});K.oo('method',"defaultUploadStart",function(fileName){var file={id:fileName,name:fileName,noSwf:true};if(this.callbacks.uploadStart){this.callbacks.uploadStart(file);}
this.defaultUploadFile=file;});K.oo('method',"defaultUploadSuccess",function(result){if(this.defaultUploadFile){this.callbacks.uploadSuccess(result,this.defaultUploadFile);}});K.oo('method',"defaultUploadError",function(p){this.callbacks.uploadError(this.defaultUploadFile);});K.oo('method',"swfuploadLoaded",function(){if(this.useFlash){this.jqDefault.hide();this.jqFlash.show();}else{this.jqDefault.show();this.jqFlash.hide();}});K.oo('method',"fileDialogStart",function(){});K.oo('method',"fileQueued",function(file){if(this.callbacks.fileQueued){this.callbacks.fileQueued(file);}});K.oo('method',"fileQueueError",function(file,errorCode,message){if(this.callbacks.fileQueueError){this.callbacks.fileQueueError(file,errorCode,message);}});K.oo('method',"fileDialogComplete",function(selectedNum,queuedNum,totalQueuedNum){this.swf.startUpload();});K.oo('method',"uploadStart",function(file){if(this.callbacks.uploadStart){this.callbacks.uploadStart(file);}});K.oo('method',"uploadProgress",function(file,complete,total){if(this.callbacks.uploadProgress){var percent=complete/total;this.callbacks.uploadProgress(file,percent);}});K.oo('method',"uploadError",function(file,errorCode,message){if(this.callbacks.uploadError){this.callbacks.uploadError(file,errorCode,message);}});K.oo('method',"uploadSuccess",function(file,serverData,response){if(this.callbacks.uploadSuccess){var result=JSON.parse(serverData);this.callbacks.uploadSuccess(result,file);}});K.oo('method',"uploadComplete",function(file){});})(Sci.Uploader,Sci);Sci.Uploader.oo('setHTMLCache',{"main":function(idx){return"<div class='defaultUpload'><form action='\/uploader\/submit_ajax' enctype='multipart\/form-data' id='Sci-Default-Uploader-Form-"+idx+"' method='post'><input name='file' type='file' \/><input type='submit' value='Upload' \/><\/form><\/div><div class='flashUpload'><div class='placeholder' id='Sci-Uploader-placeholder-"+idx+"'><\/div><\/div>"}});JS2.OO.createClass("Sci.Tab");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(tabsContainer,targetsContainer,defShow,clickCallBack){this.jqTabsContainer=$(tabsContainer);this.jqTargetsContainer=$(targetsContainer);this.tabs=this.jqTabsContainer.children();this.targets=this.jqTargetsContainer.children();this.callBack=clickCallBack;var self=this;for(var i=0,tab;tab=this.tabs[i];i++){$(tab).click(function(){self.tabClick(this);if(self.callBack)self.callBack();});if(i==defShow)$(tab).click();}});K.oo('method',"tabClick",function(tabEle){var order=$(tabEle).prevAll().length;if(order>=this.tabs.length)return;$(tabEle).addClass("press");for(var i=0,len=this.tabs.length;i<len;i++){if(!this.targets[i])return;$(this.targets[i]).removeClass("hidden");if(i!=order){$(this.targets[i]).addClass("hidden");$(this.tabs[i]).removeClass("press");}}});})(Sci.Tab,Sci);JS2.OO.createClass("Sci.InputHandler");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"handleWheel",function(delta,e){var prevent=false;if(this.wheelList){for(var i=0,w;w=this.wheelList[i++];){if(w.handleWheel&&w.handleWheel(delta,e))prevent=true;}}
return prevent;});K.oo('method',"wheel",function(obj){if(!this.wheelList){this.wheelList=[];}
this.wheelList.push(obj);});K.oo('method',"keydown",function(evt){if(evt.keyCode==27&&this.closeables){for(var key in this.closeables){this.closeables[key].close(evt);}}});})(Sci.InputHandler,Sci);sci.inputHandler=new Sci.InputHandler();function wheel(event){var delta=0;if(!event)
event=window.event;if(event.wheelDelta){delta=event.wheelDelta/120;}else if(event.detail){delta=-event.detail/3;}
var prevent=false;if(delta){if(sci.inputHandler)prevent=sci.inputHandler.handleWheel(delta,event);}
if(prevent){if(event.preventDefault)event.preventDefault();event.returnValue=false;}}
if(window.addEventListener)
window.addEventListener('DOMMouseScroll',wheel,false);window.onmousewheel=document.onmousewheel=wheel;JS2.OO.createClass("HtmlBehavior");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"press",function(ele){ele.className=this._newClasses(ele,'Press','press');var self=this;var f=function(){ele.className=ele.getAttribute('origClasses');$().unbind('mouseup',f);self.over(ele);};$().bind('mouseup',f);});K.oo('method',"pressTab",function(ele){if(ele.getAttribute('sciDisabled')=="true")return;var lis=ele.nodeName=='LI'?$(ele).siblings():$(ele).parent('li').siblings();for(var i=0,li;li=lis[i++];){var orig=li.getAttribute('origClasses');if(orig){li.className=orig;li.setAttribute('sciDisabled',false);}}
ele.className=this._newClasses(ele,'Press','press');ele.setAttribute('sciDisabled',true);});K.oo('method',"focus",function(ele){if(ele.getAttribute('sciDisabled'))return;ele.className=this._newClasses(ele,'Focus','focus');});K.oo('method',"blur",function(ele){if(ele.getAttribute('sciDisabled'))return;ele.className=ele.getAttribute('origClasses');});K.oo('method',"over",function(ele){if(ele.getAttribute('sciDisabled'))return;ele.className=this._newClasses(ele,'Hover','hover');});K.oo('method',"out",function(ele){if(ele.getAttribute('sciDisabled'))return;ele.className=ele.getAttribute('origClasses');});K.oo('method',"_newClasses",function(ele,append,newClass){if(!ele.getAttribute('origClasses')){var classes=ele.className.split(/\s+/);ele.setAttribute('origClasses',classes.join(' '));}
var classes=ele.getAttribute('origClasses').split(/\s+/);var newClasses=[];for(var i=0,k;k=classes[i++];){newClasses.push(k+append);}
newClasses.push(newClass);newClasses.push(ele.getAttribute('origClasses'));return newClasses.join(' ');});})(HtmlBehavior,null);var s=new HtmlBehavior();$(document).ready(function(){$('.tabbableTextarea').EnableTabs();});Sci.validate=function(jqObj,validationType,options){return(new Sci.Validator(jqObj,validationType,options));}
sci.createClass('Sci.Validator',{VALIDATORS:['notNull','allowNull','trimValue','maxLength','minLength','canBe','cannotBe'],initialize:function(jqObj,validationType,options){var self=this;this.jq=jqObj;this.options=options||{};this.setDatatype(validationType);if(this.isAnInput()){this.jq.keyup(function(){self.validate();});this.jq.blur(function(){self.validate();});this.reset();}else if(this.isAnDateConstrainer()){this.jq.find('input').keyup(function(){self.validate();});this.jq.find('input').blur(function(){self.validate();});this.reset();}else{this.validate();}},setDatatype:function(datatype){this.datatype=datatype||'String';this.vType=sci.constants.datatypes[this.datatype]?sci.constants.datatypes[this.datatype].name:this.datatype;},setOptions:function(options){options=options||{};for(var key in options){this.options[key]=options[key];}},reset:function(){this.highlightError(false);},highlightError:function(has_error){if(has_error){if(this.isAnInput()){this.jq.addClass('textFieldError');}else if(this.isAnDateConstrainer()){this.jq.addClass('dateConstrainerError');}else{this.jq.css('color','red');}}else{if(this.jq.hasClass('textFieldError')){this.jq.removeClass('textFieldError');}
if(this.jq.hasClass('dateConstrainerError')){this.jq.removeClass('dateConstrainerError');}
this.jq.css('color','');}},isAnInput:function(){return(this.jq.is('input')||this.jq.is('textarea'));},isAnDateConstrainer:function(){return(this.jq.is('.dateConstrainer')&&this.jq.find('input').length==3);},val:function(){if(sci.common.isToggleInput(this.jq)){return this.jq.toggleInput('val');}else if(this.isAnInput()){return this.jq.val();}else if(this.isAnDateConstrainer()){return this.jq;}else{return this.jq.text();}},html:function(){return this.jq.html();},textLength:function(){var s=this.val();return(s)?s.length:0;},notNull:function(){var s=this.val();return!((s==null)||(s==undefined)||(0==s.length));},allowNull:function(){this.isAllowNull=$.isEmpty(this.val());return this.isAllowNull;},isEmpty:function(){var s=this.val();return((s==null)||(s.length==0))},trimValue:function(){return!(this.val().length!=0&&$.trim(this.val()).length==0);},maxLength:function(){return(this.options.maxLength>this.textLength());},minLength:function(){return(this.options.minLength<this.textLength());},canBe:function(){return this.options.canBe==this.html();},cannotBe:function(){return this.options.cannotBe!=this.html();},valid:function(){if(this.isEmpty())return!this.options.notNull;if(this.options.allowNull&&this.allowNull())return true;var textLength=this.textLength();if(this.options.maxLength&&(textLength>this.options.maxLength))return false;if(this.options.minLength&&(textLength<this.options.minLength))return false;if(this.options.canBe&&(this.html()==this.options.canBe))return true;if(this.options.cannotBe&&(this.html()==this.options.cannotBe))return false;return!!sci.validatorFactory.get_validator(this.vType,this.options).validate(this.val());},commonValidate:function(){var valid=this.valid();this.highlightError(!valid);if(this.options.callback)this.options.callback(valid);return valid;},compoundValidate:function(){var valid={isValid:true,isCompound:true,results:[]};for(var i=0;i<this.VALIDATORS.length;i++){var validator=this.VALIDATORS[i];if(this.options[validator]){if(!this[validator]()&&(validator!='allowNull')){valid.isValid=false;valid.results.push('invalid'+validator);}else{valid.results.push('valid'+validator);}}}
if(valid.isValid){if(!this.isAllowNull){var vTypeValidator=sci.validatorFactory.get_validator(this.vType,this.options);vTypeValidator.isValid=vTypeValidator.validate(this.val());if(!vTypeValidator.isValid){valid.isValid=false;valid.results.push('invalid'+this.vType);}else{valid.results.push('valid'+this.vType);}}}else{valid.results.push('valid'+this.vType);}
this.highlightError(!valid.isValid);if(this.options.callback)this.options.callback(valid);return valid;},validate:function(){if(this.options.compoundValidate){return this.compoundValidate();}else{return this.commonValidate();}}});sci.createClass('Validator.Factory',{get_validator:function(vType,options){options=options||{};switch(vType.toLowerCase()){case'string':return(new Validator.String());case'integer':return(new Validator.Integer());case'date':return(new Validator.Date(options.version));case'numeric':return(new Validator.Double());case'double':return(new Validator.Double());case'month':return(new Validator.Month());case'day':return(new Validator.Day(options.year,options.month));case'dateconstrainer':return(new Validator.DateConstrainer(options.dateConstrainerRule));case'inputmatch':return(new Validator.InputMatch(options.jqRefInput.val()));case'email':return(new Validator.Email());case'time':return(new Validator.Time());case'zipcode':return(new Validator.ZipCode());case'phonenumber':return(new Validator.PhoneNumber());case'link':return(new Validator.Link());case'uuid':return(new Validator.UUID());case'lat':return(new Validator.Lat());case'lng':return(new Validator.Lng());}}});sci.validatorFactory=new Validator.Factory();sci.createClass('Validator.Base',{DIGIT_REGEX:/^\d+$/,getDateValue:function(jqObj){},isDigit:function(c){return this.DIGIT_REGEX.test(c);},validate:function(s){return this.valid(s);}});sci.extendClass('Validator.String',Validator.Base,{valid:function(s){return true;}});sci.extendClass('Validator.Integer',Validator.Base,{intRegex:/^\-?[\d,]+$/,valid:function(s){return true;return s.match(this.intRegex);}});sci.extendClass('Validator.Double',Validator.Base,{dblRegex:/^(-?(?:\d+|\d{1,3}(?:,\d{3})+))?(?:\.\d+)?$/,valid:function(s){return true;return this.dblRegex.test(s);}});sci.extendClass('Validator.Date',Validator.Base,{initialize:function(version){this.version=version;},datRegex1:/^(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])\-(\d\d\d\d)$/,datRegex2:/^(\d\d\d\d)\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])$/,datRegex3:/^(0[1-9]|[12][0-9]|3[01])\-(0[1-9]|1[012])\-(\d\d\d\d)$/,datRegex4:/^(0[1-9]|1[012])\/(0[1-9]|[12][0-9]|3[01])\/(\d\d\d\d)$/,datRegex5:/^(\d\d\d\d)\/(0[1-9]|1[012])\/(0[1-9]|[12][0-9]|3[01])$/,valid:function(s){return true;if(this.version==2){return this.validPlus(s,this.datRegex2,1,2,3)||this.validPlus(s,this.datRegex3,3,2,1);}else if(this.version==3){return this.validPlus(s,this.datRegex2,1,2,3)||this.validPlus(s,this.datRegex4,3,1,2)||this.validPlus(s,this.datRegex5,1,2,3);}else{return this.validPlus(s,this.datRegex1,3,1,2)||this.validPlus(s,this.datRegex2,1,2,3);}},validPlus:function(value,regex,yearIndex,monthIndex,dayIndex){var result=value.match(regex);if(result){if(result[dayIndex]==31&&(result[monthIndex]==4||result[monthIndex]==6||result[monthIndex]==9||result[monthIndex]==11)){return false;}else if(result[dayIndex]>=30&&result[monthIndex]==2){return false;}else if(result[monthIndex]==2&&result[dayIndex]==29&&!(result[yearIndex]%4==0&&(result[yearIndex]%100!=0||result[yearIndex]%400==0))){return false;}else{return true;}}else{return false;}}});sci.extendClass('Validator.Month',Validator.Base,{monRegex:/^(0[1-9]|1[012])$/,valid:function(s){return s.match(this.monRegex);}});sci.extendClass('Validator.Day',Validator.Base,{initialize:function(year,month){if(year.jquery)year=year.val();if(month.jquery)month=month.val();this.year=parseInt(year);this.month=parseInt(month);},dayRegex:/^(0[1-9]|[12][0-9]|3[01])$/,valid:function(s){if(!s.match(this.dayRegex))return false;if(this.year&&this.month){var day=parseInt(s);return(day>0&&day<=this.daysInMonth(this.year,this.month));}
return true;},daysInMonth:function(year,month){switch(month){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return 31;case 4:case 6:case 9:case 11:return 30;case 2:if(this.isLeapYear(year)){return 29;}
else{return 28;}}},isLeapYear:function(year){if(year%4==0){if(year%100!=0){return true;}else{if(year%400==0){return true;}else{return false;}}}
return false;}});sci.extendClass('Validator.DateConstrainer',Validator.Base,{initialize:function(dateConstrainerRule){this.rule=dateConstrainerRule;},valid:function(s){strYear=s.find('input[name = "year"]').eq(0).val();strMonth=s.find('input[name = "month"]').eq(0).val();strDay=s.find('input[name = "day"]').eq(0).val();yearValidator=new Validator.Integer();monthValidator=new Validator.Month();dayValidator=new Validator.Day(strYear,strMonth);if(strYear.length!=4||!yearValidator.valid(strYear))
return false;if(!monthValidator.valid(strMonth))
return false;if(!dayValidator.valid(strDay))
return false;strDate=strYear+'/'+strMonth+'/'+strDay;dGiven=new Date(strDate);dNow=new Date();if(this.rule=='beforeNow'){if(dGiven.getTime()>dNow.getTime()){return false;}else{return true;}}else if(this.rule=='afterNow'){if(dGiven.getTime()<dNow.getTime()){return false;}else{return true;}}else{return true;}}});sci.extendClass('Validator.InputMatch',Validator.Base,{initialize:function(refVal){this.refVal=refVal;},valid:function(s){return s==this.refVal;}});sci.extendClass('Validator.Email',Validator.Base,{emailRegex:/^([\w.%+\-]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i,valid:function(s){var valid=s.match(this.emailRegex);return valid;}});sci.extendClass('Validator.Time',Validator.Base,{validate:function(s){var d=new Date(s.replace(/-/g,'/'));return d.toString()!='Invalid Date';}});sci.extendClass('Validator.PhoneNumber',Validator.Base,{phoneRegex:/^(\d|\(|\)|\+|\-|\s|[a-zA-Z])+$/i,valid:function(s){var dgLength=s.match(/\w/g).length;var valid=s.match(this.phoneRegex)&&(dgLength==10||(dgLength==11&&s[0]=='1'));return valid;}});sci.extendClass('Validator.ZipCode',Validator.Base,{zipRegex:/^\d{5}(-\d{4})?$/i,valid:function(s){var valid=s.match(this.zipRegex);return valid;}});sci.extendClass('Validator.Link',Validator.Base,{valid:function(s){var url_exp=new RegExp("^"+DISPLAY.linkExp+"$","gi");var valid=s.match(url_exp);return valid;}});sci.extendClass('Validator.UUID',Validator.Base,{valid:function(s){var uuid_exp=new RegExp("^"+DISPLAY.uuidExp+"$");var valid=s.match(uuid_exp);return valid;}});sci.extendClass('Validator.Lat',Validator.Base,{latRegex:/^(-?(?:\d+|\d{1,3}(?:,\d{3})+))?(?:\.\d+)?$/,valid:function(s){var valid=s.match(this.latRegex);if(valid){s=parseFloat(s);return(s>=-90&&s<=90);}else{return false}}});sci.extendClass('Validator.Lng',Validator.Base,{lngRegex:/^(-?(?:\d+|\d{1,3}(?:,\d{3})+))?(?:\.\d+)?$/,valid:function(s){var valid=s.match(this.lngRegex);if(valid){s=parseFloat(s);return(s>=-180&&s<=180);}else{return false}}});JS2.OO.createClass("Sci.EditableField.Base");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(jq,value,options){this.jqParent=$(jq);this.value=value;options=options||{};this.validator=options.validator;this.par=options.par;this.initHTML();});K.oo('method',"changeValidator",function(validator){this.validator=validator;this.validate();});K.oo('method',"isValid",function(){if(this.validator){return this.validator.valid(this.value);}
return true;});K.oo('method',"validate",function(){this.showError(this.isValid());this.par.validate();});K.oo('method',"showError",function(valid){if(valid){if(this.jqInput.hasClass('textFieldError'))this.jqInput.removeClass('textFieldError');}else{this.jqInput.addClass('textFieldError');}});K.oo('method',"initHTML",function(){this.jq=$(this.htmlCache.main());this.jqParent.append(this.jq);this.jqValue=this.jq.first('>.value');this.jqField=this.jq.first('>.field');var TMP_SEL_MARKER=this.SEL_MARKER||JS2.SEL_MARKER;TMP_SEL_MARKER.appendVal(TMP_SEL_MARKER.getRealClassScope(this),"fields",this.jqField,null);this.hideEdit();});K.oo('method',"showEdit",function(){this.setValue(this.value);this.jqValue.hide();this.jqField.show();});K.oo('method',"hideEdit",function(){this.jqValue.html(DISPLAY.html(this.value));this.jqValue.show();this.jqField.hide();});K.oo('method',"submit",function(){this.value=this.getValue();this.jqValue.html(DISPLAY.html(this.value));this.hideEdit();return this.value;});})(Sci.EditableField.Base,Sci.EditableField);JS2.OO.createClass("Sci.EditableField.TextField");Sci.EditableField.TextField.oo('extends',Sci.EditableField.Base);(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(jq,value,options){_super(this,jq,value,options);this.notNull=options.notNull;this.jqInput=this.jqField.first('input');var TMP_SEL_MARKER=this.SEL_MARKER||JS2.SEL_MARKER;TMP_SEL_MARKER.appendVal(TMP_SEL_MARKER.getRealClassScope(this),"fieldname",this.jqInput,null);this.jqInput.keyup((function(self){return function(){self.validate()}})(this));});K.oo('method',"isValid",function(){var valid=_super(this);if(this.notNull&&(this.jqInput.val()==''))valid=false;return valid;});K.oo('method',"focus",function(){this.jqInput.focus();});K.oo('method',"getValue",function(){return this.jqInput.val();});K.oo('method',"setValue",function(v){this.jqInput.val(v);});})(Sci.EditableField.TextField,Sci.EditableField);JS2.OO.createClass("Sci.EditableField.SelectBox");Sci.EditableField.SelectBox.oo('extends',Sci.EditableField.Base);(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(jq,value,options){this.items=options.items;this.onChange=options.onChange;this.useSciSelectBox=options.sciSelect;_super(this,jq,value,options);});K.oo('method',"initHTML",function(){_super(this);if(this.useSciSelectBox){this.selectBox=new Sci.SelectBox(this.jqField);var TMP_SEL_MARKER=this.SEL_MARKER||JS2.SEL_MARKER;TMP_SEL_MARKER.appendVal(TMP_SEL_MARKER.getRealClassScope(this),"select",this.selectBox,null);}else{this.selectBox=$('<select></select>');var TMP_SEL_MARKER=this.SEL_MARKER||JS2.SEL_MARKER;TMP_SEL_MARKER.appendVal(TMP_SEL_MARKER.getRealClassScope(this),"select",this.selectBox,null);this.jqField.append(this.selectBox);}
this.setItems(this.items);this.selectBox.val(this.value);var self=this;if(this.onChange){this.selectBox.change(function(){self.onChange(self.getValue());});}});K.oo('method',"getValue",function(){return this.selectBox.val();});K.oo('method',"setValue",function(v){this.selectBox.val(v);});K.oo('method',"setItems",function(items){this.items=items;if(this.useSciSelectBox){this.selectBox.items(this.items);}else{this.selectBox.html('');for(var it97=0,optionItem,it97__arr=this.items,it97__len=it97__arr.length;(optionItem=it97__arr[it97])||it97<it97__len;it97++){this.selectBox[0].options.add(new Option(optionItem[1],optionItem[0]));}}});})(Sci.EditableField.SelectBox,Sci.EditableField);JS2.OO.createClass("Sci.EditableField.RadioButton");Sci.EditableField.RadioButton.oo('extends',Sci.EditableField.Base);(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(jq,value,options){this.items=options.items;this.name=options.name;_super(this,jq,value,options);});K.oo('method',"initHTML",function(){_super(this);for(var it98=0,item,it98__arr=this.items,it98__len=it98__arr.length;(item=it98__arr[it98])||it98<it98__len;it98++){if(typeof(item)=='string'){var val=item;var html=item;}else{var val=item[0];var html=DISPLAY.html(item[1])+"<br/>";}
var box=this.htmlCache.button(this.name,val,html);this.jqField.append(box);}
this.jqRadios=this.jqField.find("input[type=radio]");var TMP_SEL_MARKER=this.SEL_MARKER||JS2.SEL_MARKER;TMP_SEL_MARKER.appendVal(TMP_SEL_MARKER.getRealClassScope(this),"radio",this.jqRadios,null);});K.oo('method',"getValue",function(){return this.jqRadios.closest(':checked').val();});K.oo('method',"setValue",function(v){this.value=v;this.jqRadios.val([v]);});})(Sci.EditableField.RadioButton,Sci.EditableField);JS2.OO.createClass("Sci.EditableField.CheckBox");Sci.EditableField.CheckBox.oo('extends',Sci.EditableField.Base);(function(K,Package){var self=K;var _super=JS2.OO['super'];})(Sci.EditableField.CheckBox,Sci.EditableField);JS2.OO.createClass("Sci.EditableField.TextArea");Sci.EditableField.TextArea.oo('extends',Sci.EditableField.Base);(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"getValue",function(){return this.jqField.find('textarea').val();});K.oo('method',"setValue",function(v){if(v==null)v='';this.jqField.find('textarea').val(v);});})(Sci.EditableField.TextArea,Sci.EditableField);JS2.OO.createClass("Sci.EditableField.Validation");Sci.EditableField.Validation.oo('extends',Sci.EditableField.Base);(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(jq,value,options){options=options||{};this.title=options.title||'Validation';this.afterSubmit=options.afterSubmit||null;_super(this,jq,value,options);});K.oo('method',"isValid",function(){var valid=true;for(var it99=0,val,it99__arr=this.value,it99__len=it99__arr.length;(val=it99__arr[it99])||it99<it99__len;it99++){valid=this.validator.valid(val);if(!valid)break;}
return valid;});K.oo('method',"initHTML",function(){_super(this);this.jqTextarea=this.jq.first('textarea');var self=this;this.jqDialog=$(this.htmlCache.enumDialog()).dialog({autoOpen:false,modal:true,width:500,height:400,resizable:false,title:'Validation for '+this.title,buttons:{"Save":function(){var dlgTextarea=$(this).first('textarea');self.jqTextarea.val(dlgTextarea.val());var val=$.enumeration_list(self.jqTextarea.val());self.setValue(val);self.validate();self.jqDialog.dialog('close');if(self.afterSubmit)self.afterSubmit(val);}}});this.jqEmpty=this.jqField.first('.empty');var TMP_SEL_MARKER=this.SEL_MARKER||JS2.SEL_MARKER;TMP_SEL_MARKER.addVal(TMP_SEL_MARKER.getRealClassScope(this),"nullvalidation",this.jqEmpty,null);this.jqFull=this.jqField.first('.full');var TMP_SEL_MARKER=this.SEL_MARKER||JS2.SEL_MARKER;TMP_SEL_MARKER.addVal(TMP_SEL_MARKER.getRealClassScope(this),"fullvalidation",this.jqFull,null);this.jqInput=this.jqFull.first('span.label');this.registerEvents();});K.oo('method',"registerEvents",function(){var self=this;this.jqField.first('a.remove').click(function(){self.jqTextarea.val('');self.setValue('');self.validate();if(self.afterSubmit)self.afterSubmit([]);});this.jqField.find('a.enum').click(function(){self.jqDialog.first('textarea').val($.enumeration_list(self.jqTextarea.val()).join("\n"));self.jqDialog.dialog('open');});});K.oo('method',"submit",function(){this.hideEdit();var value=$.enumeration_list(this.jqTextarea.val());return value;});K.oo('method',"setValue",function(v){if(v==null||v=='')v=[];this.value=v;this.jqTextarea.val(v.join("\n"));if(v.length==0){this.jqEmpty.show();this.jqFull.hide();}else{this.jqEmpty.hide();this.jqFull.show();}});K.oo('method',"getValue",function(){return $.enumeration_list(this.jqTextarea.val());});})(Sci.EditableField.Validation,Sci.EditableField);JS2.OO.createClass("Sci.EditableField.EnumField");Sci.EditableField.EnumField.oo('extends',Sci.EditableField.Base);(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(jq,value,options){this.enums=options.enums;this.jqDialog=options.jqDialog;_super(this,jq,value,options);});K.oo('method',"initHTML",function(){_super(this);this.jqField.prepend($('<span>'+this.value+'</span>'));this.jqTextarea=this.jq.first('textarea');this.jqTextarea.val(this.enums.join("\n"));var self=this;this.jqField.first('a.enum').click(function(){self.jqDialog.first('textarea').val($.enumeration_list(self.jqTextarea.val()).join("\n"));self.jqDialog.source=self.jqTextarea;self.jqDialog.dialog('open');});});K.oo('method',"submit",function(){this.hideEdit();var value=$.enumeration_list(this.jqTextarea.val());return value;});K.oo('method',"setValue",function(v){});K.oo('method',"getValue",function(){});})(Sci.EditableField.EnumField,Sci.EditableField);JS2.OO.createClass("Sci.EditableField.DefaultValueRadios");Sci.EditableField.DefaultValueRadios.oo('extends',Sci.EditableField.Base);(function(K,Package){var self=K;var _super=JS2.OO['super'];this.SEQ="__SEQUENCE__";K.oo('method',"initialize",function(jq,value,options){this.field=options.field;this.enumControl=options.enumControl;_super(this,jq,value,options);});K.oo('method',"initHTML",function(){_super(this);this.jqRadios=this.jqField.find('input[type=radio]');var TMP_SEL_MARKER=this.SEL_MARKER||JS2.SEL_MARKER;TMP_SEL_MARKER.appendVal(TMP_SEL_MARKER.getRealClassScope(this),"radio",this.jqRadios,null);this.jqInput=this.jqField.first('.textField');var TMP_SEL_MARKER=this.SEL_MARKER||JS2.SEL_MARKER;TMP_SEL_MARKER.addVal(TMP_SEL_MARKER.getRealClassScope(this),"input",this.jqInput,null);this.initToggleInput();this.registerEvents();});K.oo('method',"initToggleInput",function(){var hash={'String':'any text','Integer':'any integer','Numeric':'any number','Double':'any number','Date':'YYYY-MM-DD'};this.jqInput.val(hash[this.datatype]);this.jqInput.toggleInput();});K.oo('method',"registerEvents",function(){var self=this;this.jqInput.keyup(function(){self.jqRadios.val(["value"]);self.validate();});this.jqRadios.change(function(){var radioValue=self.jqRadios.closest(':checked').val();if(radioValue!='value')self.jqInput.toggleInput('val','');self.validate();});});K.oo('method',"isValid",function(){this.value=this.getValue();var valid=true;if(this.value!=null){valid=_super(this);if(this.value==''&&!this.field.isPrimary)valid=false;if(valid&&this.enumControl&&this.enumControl.value.length>1){var validEnum=this.enumControl.value;valid=false;for(var it100=0,val,it100__arr=validEnum,it100__len=it100__arr.length;(val=it100__arr[it100])||it100<it100__len;it100++){if(val==this.value){valid=true;break;}}}}
return valid;});K.oo('method',"setValue",function(v){if(v==null){this.jqRadios.val(['none']);this.jqInput.toggleInput('val','');}else if(v==this.SEQ){this.jqRadios.val(['sequence']);this.jqInput.toggleInput('val','');}else{this.jqRadios.val(['value']);this.jqInput.toggleInput('val',v);}});K.oo('method',"getValue",function(){var radioValue=this.jqRadios.closest(':checked').val();if(radioValue=='value'){var val=this.jqInput.toggleInput('val');return val;}
if(radioValue=='none'){return null;}
if(radioValue=='sequence'){return this.SEQ;}});K.oo('method',"hideEdit",function(){_super(this);if(this.value==''){this.jqValue.html('<em class="blank">[blank]</em>');}else{this.jqValue.html(DISPLAY.html(this.value));}});})(Sci.EditableField.DefaultValueRadios,Sci.EditableField);Sci.EditableField.RadioButton.oo('setHTMLCache',{"button":function(){return"<span class='option'><input class='radioButton' name='"+arguments[0]+"' type='radio' value='"+arguments[1]+"' \/><span class='radioLabel'>"+arguments[2]+"<\/span><\/span>"},"main":function(){return"<div class='container'><div class='value'><\/div><div class='field'><\/div><\/div>"}});Sci.EditableField.TextField.oo('setHTMLCache',{"main":function(){return"<div class='container'><div class='value'><\/div><div class='field'><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><\/div><\/div>"}});Sci.EditableField.EnumField.oo('setHTMLCache',{"main":function(){return"<div class='container'><div class='value'><\/div><div class='field'>(<a class='enum' href='javascript:void(0)'>Enumeration<\/a>)<textarea class='textArea  hidden' onblur='s.blur(this)' onfocus='s.focus(this)'><\/textarea><\/div><\/div>"}});Sci.EditableField.SelectBox.oo('setHTMLCache',{"main":function(){return"<div class='container'><div class='value'><\/div><div class='field'><\/div><\/div>"}});Sci.EditableField.CheckBox.oo('setHTMLCache',{"box":function(){return},"main":function(){return"<div class='container'><div class='value'><\/div><div class='field'><\/div><\/div>"}});Sci.EditableField.Validation.oo('setHTMLCache',{"enumDialog":function(){return"<div id='enumeration'><div><em>Please list possible values for the cells in this field below. Separate each value with a new line.<\/em><\/div><textarea class='textArea ' onblur='s.blur(this)' onfocus='s.focus(this)' style='height: 255px; width: 100%;'><\/textarea><\/div>"},"main":function(){return"<div class='container'><div class='value hidden'><\/div><div class='field'><div class='empty'>none&nbsp;-&nbsp;<a class='enum' href='javascript:void(0)'>add<\/a><\/div><div class='full'><span class='label'>picklist<\/span>&nbsp;-&nbsp;<a class='enum' href='javascript:void(0)'>edit<\/a>&nbsp;-&nbsp;<a class='remove' href='javascript:void(0)'>remove<\/a><textarea class='textArea f hidden'><\/textarea><\/div><\/div><\/div>"}});Sci.EditableField.TextArea.oo('setHTMLCache',{"main":function(){return"<div class='container'><div class='value'><\/div><div class='field'><textarea class='textArea ' name='"+arguments[0]+"' onblur='s.blur(this)' onfocus='s.focus(this)'><\/textarea><\/div><\/div>"}});Sci.EditableField.DefaultValueRadios.oo('setHTMLCache',{"main":function(){return"<div class='container'><div class='value'><\/div><div class='field defaultValue'><input checked='checked' class='radioButton' name='dv' type='radio' value='none'>Do not automatically populate this cell<\/input><br \/><input class='radioButton' name='dv' type='radio' value='value'>This cell is populated by default with this value:<\/input><br \/><input class='textField' type='text' \/><!-- %br --><!-- %input.radioButton{ :name => \"dv\", :value => 'sequence', :type => 'radio' } This cell is populated by an automatically sequencing value. --><\/div><\/div>"}});JS2.OO.createClass("Sci.FieldDialog");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('property',['isPrimary','mode']);K.oo('method',"initialize",function(){this.initHTML();});K.oo('method',"save",function(){var hash=this.data;for(var colName in this.f){var ctrl=this.f[colName].control;if(ctrl)hash[colName]=ctrl.getValue();}
hash.aggregation=hash.agg;hash.description=hash.desc;hash.isHidden=hash.visible=='visible'?false:true;hash.enumerationList=hash.validation;hash.isEnumerated=hash.validation.length>0;hash.defaultValue=hash['default'];hash.autogen=hash.autogen=='yes'?true:false;return hash;});K.oo('method',"setup",function(mode,isPrimary,auth){this.setMode(mode);this.isPrimary=isPrimary;this.auth=auth;});K.oo('method',"load",function(data,focus){this.data=data;this.jqDialog.dialog('open');if(this.isPrimary){this.loadSubjectEditor(data,focus);}else{this.loadFieldEditor(data,focus);}
this.f.name.control.focus();this.f.name.control.validate();});K.oo('method',"unload",function(){this.jqDialog.dialog('close');});K.oo('method',"onSubmit",function(func){this.submitFunc=func;});K.oo('method',"validate",function(){for(var colName in this.f){if(colName.match(/^jq/))continue;if(this.isPrimary&&(colName=='agg'||colName=='validation'||colName=='presummary'))continue;var ctrl=this.f[colName].control;if(!ctrl.isValid()){this.jqSubmit.addClass('disabled');return;}}
this.jqSubmit.removeClass('disabled');});K.oo('method',"initHTML",function(){this.buildEditor();this.setMode('edit');var jqButtons=this.jqDialog.first('.buttons');this.jqSubmit=jqButtons.first('.submit');this.jqCancel=jqButtons.first('.cancel');this.jqCancel.click((function(self){return function(){self.unload()}})(this))
this.jqSubmit.click((function(self){return function(){self.submit()}})(this));});K.oo('method',"submit",function(){if(this.jqSubmit.is('.disabled'))return;if(this.submitFunc){var hash=this.save();this.submitFunc(hash);}
this.unload();});K.oo('method',"setMode",function(mode){this.mode=mode;if(this.mode=='view'){this.jqDialog.dialog('option','title',"View Field Details");}else if(this.mode.match(/edit/)){this.jqDialog.dialog('option','title',"Field Editor:");}else if(this.mode=='create'){this.jqDialog.dialog('option','title',"Add New Field");this.jqSubmit.first('a').html('Create');}});K.oo('method',"buildEditor",function(){var options={title:'Field Editor:',modal:true,autoOpen:false,resizable:false,width:600,minWidth:600};this.jqDialog=$(this.htmlCache.editor());this.jqDialog.dialog(options);this.jqHeader=this.jqDialog.first('.header');this.h={}
var controls=["fieldId","fieldRefs","creator","createdAt","sourceTables"];for(var it116=0,ctrlName,it116__arr=controls,it116__len=it116__arr.length;(ctrlName=it116__arr[it116])||it116<it116__len;it116++){var jqueryName='jq'+ctrlName.substr(0,1).toUpperCase()+ctrlName.substr(1);var jq=this.jqHeader.first('.'+ctrlName);this.h[jqueryName]=jq;this.h[ctrlName]={jqLabel:jq.first('.labelCell'),jqValue:jq.first('.inputCell')}}
this.jqForm=this.jqDialog.first('.form');this.f={};var controls=["name","agg","datatype","desc","visible","validation","autogen","default","computed","presummary","submitable"];for(var it117=0,ctrlName,it117__arr=controls,it117__len=it117__arr.length;(ctrlName=it117__arr[it117])||it117<it117__len;it117++){var jqueryName='jq'+ctrlName.substr(0,1).toUpperCase()+ctrlName.substr(1);var jq=this.jqForm.first('.'+ctrlName);this.f[jqueryName]=jq;this.f[ctrlName]={jqLabel:jq.first('.labelCell'),jqValue:jq.first('.inputCell')}}});K.oo('method',"loadSubjectEditor",function(data,focus){this.jqDialog.dialog('option','title',"Subject Editor:");this.h.sourceTables.jqLabel.html('This subject is joined to:');this.f.name.jqLabel.html('Subject Name:');this.f.desc.jqLabel.html('Subject Description:');this.f.jqAgg.hide();this.f.jqValidation.hide();this.f.jqPresummary.hide();this.loadHeaderData(data);this.loadFormData(data);if(focus=='datatype'){this.jqDialog.find('.datatype .inputCell select').focus();}});K.oo('method',"loadFieldEditor",function(data,focus){this.h.sourceTables.jqLabel.html('This field was joined from:');this.f.name.jqLabel.html('Field Name:');this.f.desc.jqLabel.html('Field Description:');this.f.jqAgg.show();this.f.jqValidation.show();this.f.jqPresummary.show();this.loadHeaderData(data);this.loadFormData(data);if(focus=='datatype'||focus=='agg')
this.jqDialog.find('.'+focus+' .inputCell select').focus();});K.oo('method',"loadHeaderData",function(data){if(!data.fieldId){this.jqHeader.hide();return;}
this.h.fieldId.jqValue.html(data.fieldId);this.h.fieldRefs.jqValue.html(data.fieldRefs);this.h.creator.jqValue.html(DISPLAY.user(data.creatorId,data.creator));this.h.createdAt.jqValue.html(data.createdAt);if(data.sourceTables&&data.sourceTables.length){for(var it118=0,t,it118__arr=data.sourceTables,it118__len=it118__arr.length;(t=it118__arr[it118])||it118<it118__len;it118++){var datasetKey=t[0];var datasetName=t[1];var datasetUrl='/t/'+t[2];var fieldHtml="<strong>"+DISPLAY(data.name).trunc(30).html()+'</strong> from ';var linkHtml='<a href="'+datasetUrl+'" target = "_blank" title = "'+datasetName+'">'+DISPLAY(datasetName).trunc(50).html()+'</a>';var html='<li> - '+fieldHtml+linkHtml+'</li>';this.h.sourceTables.jqValue.append(html);}
this.h.jqSourceTables.show();}else{this.h.jqSourceTables.hide();}
this.jqHeader.show();});K.oo('method',"loadFormData",function(data){this.setEditControl('name','TextField',data.name,{notNull:true});this.setEditControl('desc','TextArea',data.description);this.setEditControl('visible','RadioButton',(data.isHidden)?'hidden':'visible',{items:['visible','hidden'],name:'isHidden'});this.setEditControl('validation','Validation',(data.isEnumerated)?data.enumerationList:[],{validator:sci.validatorFactory.get_validator(data.datatype,{version:3}),title:data.name});this.setEditControl('default','DefaultValueRadios',data.defaultValue,{field:{datatype:data.datatype,isPrimary:this.isPrimary},name:'default',validator:sci.validatorFactory.get_validator(data.datatype,{version:3}),enumControl:this.f.validation.control});this.setEditControl('autogen','RadioButton',data.autogen?'yes':'no',{items:[['no','Do not automatically populate this cell'],['yes','Autogenerated UUID']],name:'autogen'});if(data.isSubmitable==null)data.isSubmitable=true;this.setEditControl('computed','TextArea',data.computedFunction);this.setEditControl('presummary','TextArea',data.presummaryFunction);this.setEditControl('submitable','RadioButton',(data.isSubmitable)?'yes':'no',{items:['yes','no'],name:'submitable'});this.setEditControl('agg','SelectBox',data.aggregation,{items:this.getAggregationOptions(data.datatype)});if(this.mode=='edit'&&this.isPrimary){var dt=sci.constants.datatypes[data.datatype];this.f.datatype.jqValue.html(dt.viewName);}else{var self=this;this.setEditControl('datatype','SelectBox',data.datatype,{items:this.getDatatypes(),onChange:function(dt){self.changeDatatype(dt);}});}
this.setPermissions();this.toggleUUIDOptions(data.datatype);});K.oo('method',"setPermissions",function(){if(this.auth&&this.auth.isAdmin()){this.f.jqSubmitable.show();this.f.jqPresummary.show();this.f.jqComputed.show();}else if(this.auth&&this.auth.isDev()){this.f.jqSubmitable.hide();this.f.jqPresummary.hide();this.f.jqComputed.hide();}else{this.f.jqSubmitable.hide();this.f.jqPresummary.hide();this.f.jqComputed.hide();}});K.oo('method',"toggleUUIDOptions",function(dt){var show=dt=='UUID';this.f.jqAutogen.toggle(show);this.f.jqDefault.toggle(!show&&this.mode!='editInCreation'&&this.auth&&(this.auth.isDev()||this.auth.isAdmin()));this.f.jqValidation.toggle(!show&&!this.isPrimary);});K.oo('method',"changeDatatype",function(dt){this.f['agg'].control.setItems(this.getAggregationOptions(dt));this.toggleUUIDOptions(dt);var newValidator=sci.validatorFactory.get_validator(dt,{version:3});this.f['default'].control.changeValidator(newValidator);this.f['validation'].control.changeValidator(newValidator);});K.oo('method',"setEditControl",function(ctrlName,ctrlKlass,value,options){options=options||{};options.par=this;if(!this.f[ctrlName])console.log(ctrlName);this.f[ctrlName].jqValue.html('');this.f[ctrlName].control=new Sci.EditableField[ctrlKlass](this.f[ctrlName].jqValue,value,options);if(this.mode=='view'){this.f[ctrlName].control.hideEdit();}else{this.f[ctrlName].control.showEdit();}});K.oo('method',"getDatatypes",function(){var dts=sci.cUtil.getAvailableDatatypes(this.isPrimary,this.data.trueDatatype);var options=[];for(var it119=0,dt,it119__arr=dts,it119__len=it119__arr.length;(dt=it119__arr[it119])||it119<it119__len;it119++){var viewName=sci.constants.datatypes[dt].viewName;options.push([dt,viewName]);}
return options;});K.oo('method',"getAggregationOptions",function(datatype){var dt=sci.constants.datatypes[datatype];var options=[];for(var it120=0,m,it120__arr=dt.aggregationMethods,it120__len=it120__arr.length;(m=it120__arr[it120])||it120<it120__len;it120++){var html=m.name;if(m.id=='mode'){html='most common';}else if(m.id=='wiki'){html='most recent';}
options.push([m.id,html]);}
return options;});})(Sci.FieldDialog,Sci);Sci.FieldDialog.oo('setHTMLCache',{"editor":function(){return"<div class='fieldEditor fact-form'><div class='header'><table><tr><td class='fieldId'><span class='labelCell'>Field ID:<\/span><span class='inputCell'><\/span><\/td><td class='createdAt'><span class='labelCell'>Created on:<\/span><span class='inputCell'><\/span><\/td><\/tr><tr><td class='fieldRefs'><span class='labelCell'>Field Refs:<\/span><span class='inputCell'><\/span><\/td><td class='creator'><span class='labelCell'>Created by:<\/span><span class='inputCell'><\/span><\/td><\/tr><\/table><div class='sourceTables hidden'><div class='labelCell'><\/div><ul class='inputCell'><\/ul><\/div><\/div><table class='form'><tr class='name'><td class='labelCell'>Field Name:<\/td><td class='inputCell'><\/td><\/tr><tr class='desc'><td class='labelCell'>Field Description:<\/td><td class='inputCell'><\/td><\/tr><tr class='datatype'><td class='labelCell'>Datatype:<\/td><td class='inputCell'><\/td><\/tr><tr class='agg'><td class='labelCell'>Aggregation Method:<\/td><td class='inputCell'><\/td><\/tr><tr class='validation'><td class='labelCell'>Validation:<\/td><td class='inputCell'><\/td><\/tr><tr class='visible'><td class='labelCell'>Visible by default:<\/td><td class='inputCell'><\/td><\/tr><tr class='autogen'><td class='labelCell'>Default Value:<\/td><td class='inputCell'><\/td><\/tr><tr class='default'><td class='labelCell' valign='top'>Default Value:<\/td><td class='inputCell'><\/td><\/tr><tr class='computed'><td class='labelCell' valign='top'>Computed Function:<\/td><td class='inputCell'><textarea class='textArea'><\/textarea><\/td><\/tr><tr class='presummary'><td class='labelCell'>Presummary Function:<\/td><td class='inputCell'><\/td><\/tr><tr class='submitable'><td class='labelCell'>Submittable?:<\/td><td class='inputCell'><\/td><\/tr><tr class='buttons'><td><\/td><td><span class='submit fact-button'>  <span class='button h p'>    <span>      <a href='javascript:void(0);' name='Submit'>        Done      <\/a>    <\/span>  <\/span><\/span><span class='cancel fact-button'>  <span class='button h p'>    <span>      <a href='javascript:void(0);' name='Submit'>        Cancel      <\/a>    <\/span>  <\/span><\/span><\/td><\/tr><\/table><style>.fieldEditor .sourceTable {  padding: 0 0 12px 6px; }.fieldEditor .form {  width: auto;  margin: 0 auto; }  .fieldEditor .form .visible .radioLabel {    margin-right: 12px; }  .fieldEditor .form .labelCell {    width: 150px; }  .fieldEditor .form .inputCell {    width: 320px; }    .fieldEditor .form .inputCell .textField, .fieldEditor .form .inputCell .textArea {      width: 300px; }    .fieldEditor .form .inputCell .textFieldError {      border: 1px solid red; }    .fieldEditor .form .inputCell .radioButton {      margin-right: 3px; }  .fieldEditor .form .default .inputCell .textField {    margin-bottom: 6px;    width: 284px; }  .fieldEditor .form .default .inputCell .defaultValue {    padding-left: 15px; }  .fieldEditor .form .default .inputCell .radioButton {    margin-left: -15px; }<\/style><\/div>"}});JS2.OO.createClass("Sci.StarRating");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(jq,options){this.jq=$(jq);this.options=options||{};this.vals=this.options.vals||[0,0.25,0.5,0.75,1];this.callback=this.options.callback;this.disabled=this.options.disabled;this.initHTML();this.registerEvents();this.idx=-1;if(this.options.val)this.showRating(this.options.val);});K.oo('method',"initHTML",function(){this.jqList=$(this.htmlCache.main());this.jq.append(this.jqList);for(var i=0,len=this.vals.length;i<len;i++){this.jqList.append(this.htmlCache.star(i));}
this.jqStars=this.jqList.find('li');});K.oo('method',"registerEvents",function(){var self=this;this.jqList.mouseout(function(){self.mouseout();});this.jqStars.mouseover(function(){self.selectRating(this);});this.jqStars.click(function(){self.setRating(this);});});K.oo('method',"mouseout",function(){this.highlight();});K.oo('method',"index",function(ele){var i=this.idx;if(ele)i=parseInt($(ele).attr("idx"));return i;});K.oo('method',"selectRating",function(ele){if(!this.disabled)this.highlight(this.index(ele));});K.oo('method',"setRating",function(ele){if(this.disabled)return;var jq=$(ele);this.idx=parseInt(jq.attr('idx'));this.submit();});K.oo('method',"highlight",function(index){if(index==undefined)index=this.idx;for(var i=0;i<this.vals.length;i++){var star=this.jqStars[i];if(i<=index){if(star.className!="on")star.className="on";}else{star.className="";}}});K.oo('method',"showRating",function(val){if(!val&&val!=0){this.highlight();return;}
for(var i=0,len=this.vals.length;i<len;i++){if(val>=this.vals[i])this.idx=i;}
this.highlight();});K.oo('method',"submit",function(){var val=this.vals[this.idx];if(this.callback)this.callback(val);});K.oo('method',"val",function(){return this.vals[this.idx];});})(Sci.StarRating,Sci);WIDGET.starRating=function(jq,options){return new Sci.StarRating(jq,options);};Sci.StarRating.oo('setHTMLCache',{"star":function(){return"<li idx='"+arguments[0]+"'>&nbsp;<\/li>"},"main":function(){return"<ol class='starRating'><\/ol>"}});JS2.OO.createClass("Sci.TemplateHandler");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"objToFunct",function(obj){if(typeof(obj)=='string'){return this.stringToFunct(obj);}else{var ret={};for(var k in obj){ret[k]=this.objToFunct(obj[k]);}
return ret;}});K.oo('method',"stringToFunct",function(str){var htmls=str.split(/#\w*#/);if(htmls.length==1)return function(){return str};var funct=function(){var jq=false;var offset=0;if(typeof(arguments[0])=='object'){jq=arguments[0];offset=1;}
var html='';for(var i=0,len=htmls.length;i<len;i++){html+=htmls[i];if(arguments[i+offset]||arguments[i+offset]==0){html+=arguments[i+offset];}}
if(jq){jq.append(html);var nodes=jq[0].childNodes;return nodes[nodes.length-1];}else{return html;}}
return funct;});})(Sci.TemplateHandler,Sci);sci.templateHandler=new Sci.TemplateHandler();JS2.OO.createClass("Sci.TabHandler");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(jqTabContainer,jqPaneContainer,options){this.options=options||{};this.id=1;this.selectedId=0;this.tabs=new Sci.JqList(jqTabContainer,options);var tabitems=this.tabs.jq.find('li')
var TMP_SEL_MARKER=this.SEL_MARKER||JS2.SEL_MARKER;TMP_SEL_MARKER.appendVal(TMP_SEL_MARKER.getRealClassScope(this),"tabs",tabitems,null);this.panes=new Sci.JqMode(jqPaneContainer,options);if(this.options.alreadyBuilt){this.processBuiltHtml();this.switchToPane('0');}});K.oo('method',"registerSwitchCallback",function(callback){this.switchCallback=function(id){callback(id);}});K.oo('method',"processBuiltHtml",function(){var count=this.tabs.count;var self=this;for(var i=0;i<count;i++){var id=i.toString();this.registerClick(id);}});K.oo('method',"registerClick",function(id){var self=this;var tab=this.tabs.get(id);tab.click(function(){self.switchToPane(id);});});K.oo('method',"add",function(name,html){var tab=this.tabs.add(this.id,name);var pane=this.panes.add(this.id,html);var self=this;var currentId=toString(this.id);tab.click(function(){self.switchToPane(currentId);});this.id++;return[tab,pane];});K.oo('method',"switchToPane",function(id){var tab=this.tabs.get(id);if(this.tabs.count==0)return;tab.addClass('selected');tab.removeClass('unselected');tab.siblings().removeClass('selected');tab.siblings().addClass('unselected');this.panes.hideAll(true);this.panes.show(id);this.selectedId=id;if(this.switchCallback){this.switchCallback(id);}});K.oo('method',"hidePane",function(id){this.tabs.get(id).hide();this.panes.get(id).hide();});K.oo('method',"showPane",function(id){this.tabs.get(id).show();});})(Sci.TabHandler,Sci);WIDGET.tabs=function(jqParent){var jqTabs=jqParent.find('>ul:first,>ol:first');var jqPanes=jqParent.find('>.fact-panes:first');return new Sci.TabHandler(jqTabs,jqPanes,{alreadyBuilt:true});};JS2.OO.createClass("Sci.SelectBox");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(selector,options){options=options||{};var jq=$(selector);this.view=new Sci.SelectBoxView(jq);this.view.input=options['input'];this.options=[];this.initHTML();this.registerEvents();this.view.hideList(true);if(options.selectedIndex){this.selectIndex(options.selectedIndex);}
if(options.selChangeCallBack){this.view.callBack=options.selChangeCallBack;}});K.oo('method',"registerEvents",function(){var self=this;this.view.jqSelectField.click(function(e){self.toggleList(e);self.focus();});this.view.jqList.click(function(e){if(!$(e.target).hasClass("outside")){self.select(e);self.hideList();}});this.view.registerHovers();});K.oo('method',"change",function(func){this.view.onChange=func;});K.oo('method',"value",function(){return this.view.value();});K.oo('method',"text",function(){return this.view.text();});K.oo('method',"selectedIndex",function(){return this.view.selectedIndex;});K.oo('method',"clear",function(){this.view.clear();});K.oo('method',"focus",function(){this.view.jqValue.focus();});K.oo('method',"selectionChanged",function(selChangeCallBack){this.view.callBack=selChangeCallBack;});K.oo('method',"initHTML",function(){this.view.initHTML();});K.oo('method',"addItem",function(val,html,className){this.view.addItem(val,html,className);});K.oo('method',"items",function(options){this.options=options;this.view.items(options);});K.oo('method',"addItems",function(options){this.view.addItems(options);});K.oo('method',"selectIndex",function(idx){this.view.selectIndex(idx);});K.oo('method',"selectValue",function(val,withCallBack){if($.isEmpty(val)){this.view.jqValue.html('- select -');}else{this.view.selectValue(val,withCallBack);}});K.oo('method',"mouseOver",function(e){this.view.getLi(e.target);});K.oo('method',"hideList",function(){this.view.hideList();});K.oo('method',"select",function(e){var target=e.target;this.view.selectElement(target);});K.oo('method',"toggleList",function(e){this.view.toggleList();});K.oo('method',"setIndex",function(idx){this.view.setIndex(idx);});K.oo('method',"setValue",function(idx){this.view.setValue(idx);});K.oo('method',"val",function(v){if(arguments.length==0)return this.value();this.selectValue(v);return this;});K.oo('method',"setEnable",function(enable){this.view.setEnable(enable);});K.oo('method',"hide",function(){this.view.hide();});K.oo('method',"show",function(){this.view.show();});K.oo('method',"setWidth",function(width){this.view.setWidth(width);});})(Sci.SelectBox,Sci);JS2.OO.createClass("Sci.SelectBoxView");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(jq){this.enable=true;this.html=this.htmlCache.main();this.jq=jq;this.hadContent=this.jq[0].childNodes.length>0;});K.oo('method',"initHTML",function(){if(!this.hadContent)this.jq.html(this.html);while(this.setUnique()==false){};this.jqSelect=this.jq.find('.selectBox');this.jqValue=this.jq.find('.value');this.jqList=this.jq.find('ol.list');this.jqSelectField=this.jq.find('.selectField');var jqInput=this.jq.find('.selectBox > input');if(!this.input&&jqInput){this.input=jqInput[0];}
var self=this;this.mouseDown=function(e){var ele=e.target;for(var i=0;i<6;i++){if(ele){if(ele.className&&ele.className.indexOf(self.unique)>=0)return;ele=ele.parentNode;}}
self.hideList();}});K.oo('method',"setUnique",function(){var unique='sBox'+generateUID();this.unique=unique;this.jq.attr('id',unique);this.jq.addClass(unique);return true;});K.oo('method',"setWidth",function(width){this.jqSelect.css('width',width);});K.oo('method',"items",function(options){var html='';for(var i=0,o;o=options[i];i++){html+=this.getItemHTML(o[0],o[1],o[2]);}
this.jqList.html(html);this.jqValue.html('');this.registerHovers();});K.oo('method',"addItems",function(options){var html='';for(var i=0,o;o=options[i];i++){html+=this.getItemHTML(o[0],o[1],o[2]);}
this.jqList.append(html);this.registerHovers();});K.oo('method',"addItem",function(val,html,className){this.jqList.append(this.getItemHTML(val,html,className));this.registerHovers();});K.oo('method',"showList",function(){this.jqList.show();this.jqSelect.addClass('selectBoxDropped');$(document).bind('mousedown',this.mouseDown);this.isShowing=true;this.bindKeyEvents();});K.oo('method',"hideList",function(firstTime){this.jqList.hide();this.jqSelect.removeClass('selectBoxDropped');$(document).unbind('mousedown',this.mouseDown);this.jqValue.unbind('keypress');this.isShowing=false;});K.oo('method',"toggleList",function(){if(!this.enable)return;if(this.isShowing){this.hideList();}else{this.showList();var jqEle=this.getSelectedEle();this.highlightEle(jqEle);}});K.oo('method',"registerHovers",function(){this.jqListItems=this.jqList.find("li");this.jqListItems.hover(function(){$(this).siblings().removeClass("hover");$(this).addClass("hover");},function(){$(this).removeClass("hover");});});K.oo('method',"bindKeyEvents",function(){var self=this;var length=this.jqList[0].childNodes.length-1;var selectedIdx=self.selectedIndex||-1;if(this.isShowing){this.jqValue.bind('keypress',function(e){if(e.keyCode==KEYCODE.UP){e.preventDefault();var jqEle=self.jqList.children().eq(selectedIdx>0?(selectedIdx-=1):0);self.highlightEle(jqEle);}
else if(e.keyCode==KEYCODE.DOWN){e.preventDefault();var jqEle=self.jqList.children().eq(selectedIdx<length?(selectedIdx+=1):length);self.highlightEle(jqEle);}
else if(e.keyCode==KEYCODE.ENTER){e.preventDefault();self.selectElement(self.jqList.children()[selectedIdx]);self.hideList();}
else if(e.keyCode==KEYCODE.TAB){self.selectElement(self.jqList.children()[selectedIdx]);self.hideList();}});}});K.oo('method',"highlightEle",function(jqEle){jqEle.addClass('hover');jqEle.siblings().removeClass('hover');});K.oo('method',"unHighlightEle",function(jqEle){jqEle.removeClass('hover');});K.oo('method',"getSelectedEle",function(){return this.jqList.children().eq(this.selectedIndex);});K.oo('method',"setIndex",function(idx){var ele=this.jqList.children()[idx];this.selectElement(ele,false);});K.oo('method',"setValue",function(val){this.selectElement(this.jqList.find("li[val='"+val+"']")[0],false);});K.oo('method',"selectIndex",function(idx){if(idx==this.selectedIndex)return;var ele=this.jqList.children()[idx];this.selectElement(ele);});K.oo('method',"selectValue",function(val,withCallBack){var ele=this.jqList.find("li[val='"+val+"']")[0];if(ele){this.selectElement(ele,withCallBack);}else{this.addOutSideItem(val);}});K.oo('method',"addOutSideItem",function(val){if($.isEmpty(val))return;this.jqList.find('li.outside').remove();this.addItem(sci.common.htmlEscape(val),sci.common.htmlEscape(val),'disabled outside');var title='This value is outside the possible list of enumerations';this.jqList.find('li.outside').attr('title',title).insertBefore(this.jqList.first('li'));});K.oo('method',"selectElement",function(ele,withCallbacks){if(withCallbacks==null)withCallbacks=true;if(!ele)return;for(var i=0;i<2;i++){if($(ele).is('li'))break;ele=ele.parentNode;}
if(!$(ele).is('li'))return;if($(ele).hasClass('disabled'))return;this.jqValue.html(ele.innerHTML);var value=ele.getAttribute('val');if(!value){value=ele.innerHTML;}
this.jqValue[0].setAttribute('value',value);if(this.input){this.input.value=value;}
this.selectedIndex=this.jqList.children().index(ele);if(withCallbacks&&this.callBack){this.callBack(this.value());}
if(this.onChange){this.onChange();}});K.oo('method',"value",function(){return this.jqValue[0].getAttribute('value');});K.oo('method',"text",function(){return this.jqValue.text();});K.oo('method',"innerHtml",function(){return this.jqValue.html();});K.oo('method',"clear",function(){this.selectedIndex=-1;this.jqList.empty();this.jqValue.html('');});K.oo('method',"setEnable",function(enable){this.enable=enable;if(enable){this.jqSelectField.removeClass('disabled');}else{this.jqSelectField.addClass('disabled');}});K.oo('method',"hide",function(){this.jqSelect.hide();});K.oo('method',"show",function(){this.jqSelect.show();});K.oo('method',"getItemHTML",function(val,html,className){val=val.toString().replace(/([\"\'\\])/g,"\\$1");var classAttr='';if(className){classAttr='class="'+className+'"';}
return'<li val="'+val+'" '+classAttr+'>'+html+'</li>';});})(Sci.SelectBoxView,Sci);WIDGET.select=function(jq,options){return new Sci.SelectBox(jq,options);};Sci.SelectBoxView.oo('setHTMLCache',{"main":function(){return"<div class='selectBox'><div class='selectField'><div class='selector'><\/div><a class='value' href='javascript:void(0);'><\/a><\/div><ol class='list'><\/ol><input class='inputValue' type='hidden' \/><\/div>"}});JS2.OO.createClass("Sci.SelectBoxHelper");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(sb){this.jq=$(sb);this.ele=this.jq.get(0);this.options=this.ele.options;});K.oo('method',"addItem",function(val,name,className){var len=this.options.length;var opt=new Option(name,val);this.options[len]=opt;if(className)opt.className=className;});K.oo('method',"addComment",function(text,className){var len=this.options.length;var opt=new Option(text,'');this.options[len]=opt;opt.setAttribute('disabled','disabled');if(className)opt.className=className;});K.oo('method',"disable",function(idx){this.get(idx).setAttribute('disabled','disabled');});K.oo('method',"enable",function(idx){this.get(idx).removeAttribute('disabled');});K.oo('method',"isDisabled",function(idx){return this.get(idx).getAttribute('disabled')=='disabled';});K.oo('method',"get",function(idx){return this.options[idx];});K.oo('method',"selectedIndex",function(){return this.options.selectedIndex;});K.oo('method',"value",function(){return this.jq.val();});K.oo('method',"selectIndex",function(idx){return this.options.selectedIndex=idx;});K.oo('method',"selectValue",function(value){for(var i=0,o;o=this.options[i];i++){if($(o).val()==value){this.options.selectedIndex=i;break;}}});K.oo('method',"change",function(funct){this.jq.change(funct);return this;});K.oo('method',"keyup",function(funct){this.jq.keyup(funct);return this;});K.oo('method',"clear",function(){this.jq.html('');});K.oo('method',"disableOption",function(val){var jqOption=this.jq.find('option[value='+val+']');if(jqOption[0])jqOption.attr('disabled','disabled');});K.oo('method',"enableOption",function(val){var jqOption=this.jq.find('option[value='+val+']');if(jqOption[0])jqOption.attr('disabled','');});})(Sci.SelectBoxHelper,Sci);JS2.OO.createClass("Sci.JqMode");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(jqContainer,options){this.options=options||{};this.jq=jqContainer;this.lookup={};this.jq.hide();this.isShowingLookup={};this.nShowing=0;this.showStack=[];if(this.options.alreadyBuilt){this.processBuiltHtml();}});K.oo('method',"processBuiltHtml",function(){var divs=this.jq.find('>div');for(var i=0,div;div=divs[i];i++){this.lookup[i.toString()]=$(div);this.count++;}});K.oo('method',"container",function(){return this.jq;});K.oo('method',"add",function(name,html){var jq=$(html).addClass(name).hide().appendTo(this.jq);this.lookup[name]=jq;return jq;});K.oo('method',"addJq",function(name,jq){this.lookup[name]=jq;jq.hide();return jq;});K.oo('method',"get",function(name){return this.lookup[name];});K.oo('method',"show",function(name){for(var key in this.isShowingLookup){if(key!=name){this.lookup[key].hide();delete(this.isShowingLookup[key]);}}
this.nShowing=1;this.isShowingLookup[name]=true;this.showStack=[name];this.lookup[name].show();this.jq.show();return this.lookup[name];});K.oo('method',"push",function(name){if(this.isShowingLookup[name])return;this.isShowingLookup[name]=true;this.nShowing+=1;this.lookup[name].show();this.jq.show();this.showStack.push(name);return this.lookup[name];});K.oo('method',"isEmpty",function(){return(this.showStack.length==0);});K.oo('method',"pop",function(evt){var name=this.showStack.pop();this.hide(name);});K.oo('method',"hideAll",function(force){if(force){for(var key in this.lookup){this.lookup[key].hide();}}else{for(var key in this.isShowingLookup){this.lookup[key].hide();delete(this.isShowingLookup[key]);}}
this.nShowing=0;});K.oo('method',"hide",function(name){if(!name){this.hideAll();this.jq.hide();}else{if(this.isShowingLookup[name]){delete(this.isShowingLookup[name]);this.nShowing--;this.lookup[name].hide();}
if(!this.nShowing)this.jq.hide();}});K.oo('method',"isShowing",function(name){return this.isShowingLookup[name]||false;});})(Sci.JqMode,Sci);JS2.OO.createClass("Sci.JqList");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(jqUl,options){this.options=options||{};this.jq=jqUl;this.lookup={};this.count=0;if(this.options.alreadyBuilt){this.processBuiltHtml();}});K.oo('method',"processBuiltHtml",function(){var lis=this.jq.find('li');for(var i=0,li;li=lis[i];i++){this.lookup[i.toString()]=$(li);this.count++;}});K.oo('method',"container",function(){return this.jq;});K.oo('method',"add",function(name,html,noMouseEffect){var useName=true;if(!html){html=name;useName=false;}
var mouseEffect=noMouseEffect?'':' onmouseover="s.over(this)" onmouseout="s.out(this)"';var jq=this.jq.append('<li'+mouseEffect+'>'+html+'</li>').children(':last-child');if(useName){this.lookup[name]=jq;jq.addClass(name);}
this.count++;return jq;});K.oo('method',"get",function(name){return this.lookup[name];});})(Sci.JqList,Sci);JS2.OO.createClass("Sci.Presenter");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(jq){this.jq=jq;this.lookup={};this.traverse();});K.oo('method',"traverse",function(){var elements=this.jq.find('[present]');for(var i=0;i<elements.length;i++){var jq=elements.eq(i);var pairs=jq.attr('present').split(';');var def={jq:jq};for(var it105=0,p,it105__arr=pairs,it105__len=it105__arr.length;(p=it105__arr[it105])||it105<it105__len;it105++){var splitted=p.split(':');var key=splitted[0];var val=splitted[1];if(key=='name'){this.lookup[val]=def;}
def[key]=val;}}});K.oo('method',"populate",function(name,str){var def=this.lookup[name];var dis=DISPLAY(str);if(def.trunc)dis.trunc(def.trunc);if(def.link)dis.link(def.link);def.jq.html(dis.toString());});K.oo('method',"vinnie",function(jq){var tds=jq.find('td:first-child');var width=tds.eq(0).width();var charWidth=DISPLAY.getCharWidth();var len=Math.floor(width/charWidth);tds.each(function(){if(this.className.indexOf('multiline')>0)return;var str=DISPLAY.trim($(this).text());var newstr=DISPLAY.trunc(str,len);$(this).text(newstr);});});})(Sci.Presenter,Sci);WIDGET.progressBar=function(seed,options){return new ProgressBar($(seed),options);};JS2.OO.createClass("ProgressBar");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('member','DEFAULT_COLOR',"blue");K.oo('member','DEFAULT_WIDTH',200);K.oo('method',"initialize",function(jq,options){this.jq=jq;this.options=options||{};this.initHTML();});K.oo('method',"initHTML",function(){this.jq.html(this.htmlCache.main());this.jqBorder=this.jq.first('.progressBar');this.jqBar=this.jq.first('.bar');this.jqText=this.jq.find('.textContainer');var color=this.options.color||this.DEFAULT_COLOR;var width=this.options.width||this.DEFAULT_WIDTH;this.setColor(color);this.setWidth(width);});K.oo('method',"setColor",function(color){this.color=color;this.jqBorder.css('border-color',color);this.jqBar.css('background-color',color);});K.oo('method',"setWidth",function(width){this.width=width;this.jqBorder.width(width);this.jqText.css('left',width+10);});K.oo('method',"setPercent",function(percent){var width=percent*(this.width-2)/100;this.jqBar.width(width);this.jqText.html(this.getText(percent));});K.oo('method',"getText",function(percent){if(this.options.textDecorator){return this.options.textDecorator(percent);}else{return percent+'%';}});})(ProgressBar,null);ProgressBar.oo('setHTMLCache',{"main":function(){return"<div class='progressBar'><div class='bar'><\/div><div class='textContainer'>0%<\/div><\/div>"}});JS2.OO.createClass("Sci.InputControl");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(seed,options){this.jq=$(seed);this.jqIndicators={};this.jqInputs={};this.validators={};this.datatype='String';this.isEnum=false;this.mode=new Sci.JqMode(this.jq);this.setOptions(options);});K.oo('method',"setOptions",function(options){options=options||{};var self=this;this.indicatorTogglable=options.indicatorTogglable;this.validatorOptions=options.validatorOptions||{};});K.oo('method',"setReadOnly",function(){for(var key in this.jqInputs){this.jqInputs[key].attr('readonly',true);}
if(this.isEnum)this.valueSb.setReadOnly();});K.oo('method',"setWrite",function(){for(var key in this.jqInputs){this.jqInputs[key].attr('readonly',false);}
if(this.isEnum)this.valueSb.setWrite();});K.oo('method',"populate",function(datatype,enumList,validatorOptions){this.datatype=datatype;this.isEnum=!!enumList;this.isEnum?this._populateEnum(enumList,validatorOptions):this._populateInput(validatorOptions);});K.oo('method',"parseValue",function(v){if($.isEmpty(v))return'';if(this.datatype=='Date')return sci.common.getDisplay('Date',v);if(sci.cUtil.isNumericDatatype(this.datatype))return parseFloat(v).toString().replace(/,/g,'');return v.toString();});K.oo('method',"setValue",function(value){this.clear();var val='';var self=this;if(value instanceof Array){val=$.map(value,function(v){return self.parseValue(v);}).join(', ');}else{val=this.parseValue(value);}
if(this.isEnum){this.valueSb.selectValue(val);}else{this.jqInputs[this.datatype].val(val);}});K.oo('method',"setValueWithoutDatatype",function(value){if(this.isEnum)this.valueSb.selectValue(value);this.jqInputs[this.datatype].val(value);});K.oo('method',"getValue",function(){return $.trim(this.jqInputs[this.datatype].val());});K.oo('method',"focus",function(){if(this.isEnum){this.valueSb.focus();}else{var self=this;setTimeout(function(){self.jqInputs[self.datatype].focus();},0);}});K.oo('method',"select",function(){if(this.isEnum){this.valueSb.focus();}else{this.jqInputs[this.datatype][0].select();}});K.oo('method',"blur",function(){if(this._noInited())return;this.jqInputs[this.datatype].blur();});K.oo('method',"clear",function(){for(var key in this.jqInputs){this.jqInputs[key].val('');}
if(this.isEnum)this.valueSb.selectIndex(0);});K.oo('method',"keydown",function(fun){for(var i in this.jqInputs){this.jqInputs[i].keydown(function(e){fun(e);});}});K.oo('method',"validate",function(){var valid=this.validators[this.datatype].validate();return valid.isCompound?valid.isValid:valid;});K.oo('method',"setInputIndicator",function(obj){if(obj.isCompound){var ary=[];for(var i=0;i<obj.results.length;i++){ary.push(this.htmlCache[obj.results[i]]?this.htmlCache[obj.results[i]]():obj.results[i]);}
str=ary.join("");}else{var datatype=sci.constants.datatypes[this.datatype].name;var str=obj?this.htmlCache['valid'+datatype]():this.htmlCache['invalid'+datatype]();}
this.jqIndicators[this.datatype].html(str);});K.oo('method',"toggleInputIndicator",function(token){var input=this.jqInputs[this.datatype];var indicator=this.jqIndicators[this.datatype];var display=token?'block':'none';if(this.indicatorTogglable&&!input.hasClass('textFieldFocus')){if(display!=indicator.css('display')){indicator.css('display',display);}}else if(!$.isEmpty(indicator.text())){indicator.css('display','block');}else{indicator.css('display','none');}});K.oo('method',"getInput",function(){return this.jqInputs[this.datatype];});K.oo('method',"_populateEnum",function(enumList,validatorOptions){if(!this.mode.get('Enum'))this.buildEnum();if(!this.mode.get(this.datatype)){this.buildInput();this.buildValidator(validatorOptions);}
this.mode.show('Enum');this.valueSb.clear();for(var i=0,len=enumList.length;i<len;i++){var value=DISPLAY.html(enumList[i]);this.valueSb.addItem(value,value);}});K.oo('method',"_populateInput",function(validatorOptions){if(!this.mode.get(this.datatype)){this.buildInput();this.buildValidator(validatorOptions);}
this.mode.show(this.datatype);});K.oo('method',"buildEnum",function(){var self=this;var jqEnum=this.mode.add('Enum',this.htmlCache.sb());this.valueSb=new Sci.SelectBox(jqEnum,{selChangeCallBack:function(){self.jqInputs[self.datatype].val(this.value());}});});K.oo('method',"buildInput",function(){var jq=this.mode.add(this.datatype,Sci.InputControl.dtCache(this.datatype));var jqInput=jq.first('input');this.registerEvents(jqInput);this.jqInputs[this.datatype]=jqInput;});K.oo('method',"indicatorTogglableCallback",function(valid){if(valid.isCompound?!valid.isValid:!valid){this.toggleInputIndicator(true);}else{this.toggleInputIndicator(false);}});K.oo('method',"buildValidator",function(options){var self=this;if(!this.validators[this.datatype]){options=options||this.validatorOptions;origCallback=options.callback;options.callback=function(valid){self.setInputIndicator(valid);if(self.indicatorTogglable){self.indicatorTogglableCallback(valid);}else{self.toggleInputIndicator(false);}
if(origCallback)origCallback(valid);};var jqInput=this.jqInputs[this.datatype];this.jqIndicators[this.datatype]=jqInput.siblings('.inputIndicator');this.validators[this.datatype]=Sci.validate(jqInput,this.datatype,options);}});K.oo('method',"registerEvents",function(jqInput){var self=this;jqInput.focus(function(){self.toggleInputIndicator(true);}).blur(function(){self.toggleInputIndicator(false);});});K.oo('method',"_noInited",function(){return!this.jqInputs[this.datatype];});K.oo('staticMember',"dtCache",function(datatype){var ns=Sci.InputControl;var lookup=ns.lookup;if(!lookup[datatype]){lookup[datatype]=$(ns.prototype.htmlCache['input'+datatype]());}
return lookup[datatype].clone();});})(Sci.InputControl,Sci);Sci.InputControl.lookup={};Sci.InputControl.oo('setHTMLCache',{"invalidUUID":function(){return"<span class='invalidInput'>Requires a valid uuid.<\/span>"},"validLink":function(){return"Requires a valid url."},"invalidPhoneNumber":function(){return"<span class='invalidInput'>Requires a phone number.<\/span>"},"invalidInteger":function(){return"<span class='invalidInput'>Requires numeric input.<\/span>"},"inputInteger":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"},"validDate":function(){return"Requires a date format, like YYYY-MM-DD."},"validnotNull":function(){return"Can't be blank."},"validZipCode":function(){return"Requires a zip code."},"invalidNumber":function(){return"<span class='invalidInput'>Requires numeric input.<\/span>"},"invalidNumeric":function(){return"<span class='invalidInput'>Requires numeric input.<\/span>"},"invalidtrimValue":function(){return"<span class='invalidInput'>Can't be all whitespace.<\/span>"},"validallowNull":function(){return},"invalidZipCode":function(){return"<span class='invalidInput'>Requires a zip code.<\/span>"},"inputLat":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"},"sb":function(){return"<div><\/div>"},"inputPhoneNumber":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"},"invalidLng":function(){return"<span class='invalidInput'>Requires lat|lng input.<\/span>"},"validPhoneNumber":function(){return"Requires a phone number."},"invalidallowNull":function(){return},"invalidnotNull":function(){return"<span class='invalidInput'>Can't be blank.<\/span>"},"inputDouble":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"},"inputNumeric":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"},"inputString":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"},"validDouble":function(){return"Requires numeric input."},"validInteger":function(){return"Requires numeric input."},"validString":function(){return"Can be any text."},"inputLink":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"},"inputDate":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"},"invalidLink":function(){return"<span class='invalidInput'>Requires a valid url.<\/span>"},"inputZipCode":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"},"inputNumber":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"},"validNumber":function(){return"Requires numeric input."},"invalidDate":function(){return"<span class='invalidInput'>Requires a date format, like YYYY-MM-DD.<\/span>"},"inputLng":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"},"inputUUID":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"},"invalidLat":function(){return"<span class='invalidInput'>Requires lat|lng input.<\/span>"},"invalidDouble":function(){return"<span class='invalidInput'>Requires numeric input.<\/span>"},"validNumeric":function(){return"Requires numeric input."},"validtrimValue":function(){return},"input":function(){return"<div><input class='textField ' onblur='s.blur(this)' onfocus='s.focus(this)' type='text' \/><div class='inputIndicator'><\/div><\/div>"}});JS2.OO.createClass("Sci.FactInputControl");Sci.FactInputControl.oo('extends',Sci.InputControl);(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"registerEvents",function(){this.jq.context=document;this.jq.find('input').live('blur',(function(self){return function(){self.validate();}})(this)).live('keyup',(function(self){return function(){self.validate();}})(this));this.jq.find('.selectBox').live('click',(function(self){return function(){if($.trim($(this).find('a.value').text()).length>0){self.validate();}}})(this));});K.oo('method',"populate",function(field,options){var datatype=field.datatype;var list=false;if(field.isEnumerated){var enumList=field.enumerationList;list=[];for(var i=0,len=enumList.length;i<len;i++){var value=enumList[i];if(value!='')list.push(value);}}
if(!options){var options={compoundValidate:true,notNull:true}
if(datatype=='String')options.trimValue=true;}
_super(this,datatype,list,options);});K.oo('method',"setValidateCallback",function(callback){this.validateCallback=callback;});K.oo('method',"validate",function(){var isValid=_super(this);if(this.validateCallback)this.validateCallback(isValid);return isValid;});K.oo('method',"focus",function(){_super(this);this.validate();});K.oo('method',"blur",function(){if(this._noInited())return;_super(this);this.validate();});K.oo('method',"select",function(){_super(this)
this.validate();});})(Sci.FactInputControl,Sci);Sci.toggleElement=function(clickEle,toggleEle,options){return new Sci.ToggleElement(clickEle,toggleEle,options);};JS2.OO.createClass("Sci.ToggleElement");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(clickEle,toggleEle,options){this.jq=$(toggleEle);if(clickEle){this.jqClick=$(clickEle);}
this.options=options||{};this.registerEvents();this.setGuid();});K.oo('method',"registerEvents",function(){var self=this;if(this.jqClick){this.jqClick.click(function(){if(self.jq.is(':hidden')){self.show();}else{self.hide();}});}});K.oo('method',"setGuid",function(){this.guid=guid();this.jq.attr('guid',this.guid);if(this.jqClick){this.jqClick.attr('guid',this.guid);}});K.oo('method',"show",function(){this.jq.show();this.bindEvents();if(this.options.show_handler)this.options.show_handler();});K.oo('method',"hide",function(){this.jq.hide();this.unbindEvents();if(this.options.hide_handler)this.options.hide_handler();});K.oo('method',"bindEvents",function(){$(document).bind('mousedown',{toggleElement:this},this.toggle);});K.oo('method',"unbindEvents",function(){$(document).unbind('mousedown',this.toggle);});K.oo('method',"toggle",function(e){var self=e.data.toggleElement;var jqTarget=$(e.target);if(jqTarget.parents('[guid='+self.guid+']').length>0){self.show();}else{self.hide();}});K.oo('method',"setHideHandler",function(fun){this.options.hide_handler=fun;});})(Sci.ToggleElement,Sci);JS2.OO.createClass("Sci.BugReporter");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(button,options){this.jqButton=$(button);this.options=options?options:{}
this.email=this.options.email?this.options.email:'';this.initHTML();this.registerEvents();});K.oo('method',"initHTML",function(){this.jqDialog=$(this.htmlCache.main());this.jqForm=this.jqDialog.first('form');this.jqEmail=this.jqDialog.first('.email');this.jqDesc=this.jqDialog.first('.description');this.jqSubmit=this.jqDialog.first('.submit');this.jqCancel=this.jqDialog.first('.cancel');this.jqSpinner=this.jqDialog.first('.fact-spinner');this.addValidation();this.buildDialog();});K.oo('method',"addValidation",function(){var self=this;this.emailValidator=Sci.validate(this.jqEmail,'email',{notNull:true,callback:function(validate){if(validate){self.enableSubmit();}else{self.disableSubmit();}}});});K.oo('method',"buildDialog",function(){this.jqDialog.dialog({title:"Report a Bug",autoOpen:false,resizable:false,closeOnEscape:false,modal:true,width:700,height:400});this.jqDialog.siblings().first('a.ui-dialog-titlebar-close').remove();});K.oo('method',"registerEvents",function(){var self=this;this.jqButton.click(function(){self.show();});this.jqForm.submit(function(){self.submit();return false;});this.jqSubmit.click(function(){self.submit();});this.jqCancel.click(function(){self.jqDialog.dialog('close');});});K.oo('method',"submit",function(){this.emailValidator.validate();if(this.isSubmitDisabled())return;var self=this;var params={subject:'bug_report',email:this.jqEmail.val(),description:this.jqDesc.val(),onError:function(){self.ajaxCallback();}};this.jqSpinner.show();this.jqSubmit.hide();this.jqCancel.hide();AJAX.post('/contact/send_mail_ajax',params,function(){self.ajaxCallback();});});K.oo('method',"show",function(){this.jqSpinner.hide();this.jqSubmit.show();this.jqCancel.show();this.jqEmail.val(this.email);var desc="Referring URL:\n"+
window.location.toString()+"\n";this.jqDesc.val(desc);this.jqDialog.dialog('open');this.emailValidator.validate();});K.oo('method',"ajaxCallback",function(){this.jqDialog.dialog('close');});K.oo('method',"disableSubmit",function(){this.jqSubmit.addClass('disabled');});K.oo('method',"enableSubmit",function(){this.jqSubmit.removeClass('disabled');});K.oo('method',"isSubmitDisabled",function(){return this.jqSubmit.is('.disabled');});})(Sci.BugReporter,Sci);Sci.BugReporter.oo('setHTMLCache',{"main":function(){return"<div id='bugReport'><form><table><tr><td class='label'>Your email:<\/td><td class='input'><input class='textField  email' name='message[email]' onblur='s.blur(this)' onfocus='s.focus(this)' \/><\/td><\/tr><tr><td class='label'>Description:<\/td><td class='input'><textarea class='textArea  description' name='message[description]' onblur='s.blur(this)' onfocus='s.focus(this)'><\/textarea><\/td><\/tr><tr><td class='label'>&nbsp;<\/td><td class='input'><span class='submit fact-button'>  <span class='button h p'>    <span>      <a href='javascript:void(0);' name='Submit'>        Report Bug      <\/a>    <\/span>  <\/span><\/span><span class='cancel fact-button'>  <span class='button h p'>    <span>      <a href='javascript:void(0);' name='Submit'>        Cancel      <\/a>    <\/span>  <\/span><\/span><div class='fact-spinner'>Sending...<\/div><input class='hidden' type='submit' \/><\/td><\/tr><\/table><\/form><\/div>"}});JS2.OO.createClass("Sci.OpenSquare");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('method',"initialize",function(){this.initHTML();});K.oo('method',"initHTML",function(){this.jqDialog=$(this.htmlCache.main());this.jqDialog.dialog({autoOpen:false,resizable:false,title:"Why can't I download this?",width:350,modal:true});});K.oo('method',"open",function(){this.jqDialog.dialog('open');});K.oo('method',"close",function(){this.jqDialog.dialog('close');});})(Sci.OpenSquare,Sci);Sci.OpenSquare.oo('setHTMLCache',{"main":function(){return"<div id='openSquareDialog'><p>The owner of this table prefers that you only connect to the data directly using Factual APIs.  This guarantees your apps have the latest version of the data as well as promotes the growth and improvement of this dataset.<\/p><\/div>"}});(function($){var g,d,j=1,a,b=this,f=!1,h="postMessage",e="addEventListener",c,i=b[h];$[h]=function(k,l,m){if(!l){return}k=typeof k==="string"?k:$.param(k);m=m||parent;if(i){m[h](k,l.replace(/([^:]+:\/\/[^\/]+).*/,"$1"))}else{if(l){m.location=l.replace(/#.*$/,"")+"#"+(+new Date)+(j++)+"&"+k}}};$.receiveMessage=c=function(l,m,k){if(i){if(l){a&&c();a=function(n){if((typeof m==="string"&&n.origin!==m)||($.isFunction(m)&&m(n.origin)===f)){return f}l(n)}}if(b[e]){b[l?e:"removeEventListener"]("message",a,f)}else{b[l?"attachEvent":"detachEvent"]("onmessage",a)}}else{g&&clearInterval(g);g=null;if(l){k=typeof m==="number"?m:typeof k==="number"?k:100;g=setInterval(function(){var o=document.location.hash,n=/^#?\d+&/;if(o!==d&&n.test(o)){d=o;l({data:o.replace(n,"")})}},k)}}}})(jQuery);JS2.OO.createClass("Sci.Authentication");(function(K,Package){var self=K;var _super=JS2.OO['super'];K.oo('member','loginUrl',"/login_box");K.oo('member','logoutUrl',"/logout?redirect=false");K.oo('staticMember',"init",function(options){if(!this.instance){options=options||{};this.instance=new this(options);}
return this.instance;});K.oo('method',"addAuthListener",function(obj){if(!this.listeners[obj.className]){this.listeners[obj.klass.className]=obj;obj.sciAuth=this;}});K.oo('method',"initialize",function(options){this.options=options;this.listeners={};window.factualLogin=(function(self){return function(){self.userLoggedIn();}})(this)
$.receiveMessage((function(self){return function(e){if(e.data=='factualLogin')window.factualLogin();}})(this));});K.oo('method',"userLoggedIn",function(){if(this.returnTo){window.location.href=this.returnTo;return;}
this.hide();this.notify('userLoggedIn');try{if(this.loggedIn())this.reApplyCaller();}catch(e){}
this.loginToParent();this.loginToIframe();});K.oo('method',"loginToParent",function(){var op=window.opener||window.parent;if(op!=window){if($.browser.safari){this.originUrl=this.originUrl||op.location.href;$.postMessage('factualLogin',this.originUrl,op);}else{try{if(op.factualLogin)op.factualLogin();}catch(e){$.postMessage('factualLogin',this.originUrl,op);}}}});K.oo('method',"loginToIframe",function(){var iframes=$('iframe');if(iframes.length<1)return;for(var it110=0,iframe,it110__arr=iframes,it110__len=it110__arr.length;(iframe=it110__arr[it110])||it110<it110__len;it110++){try{iframe.contentWindow.sci.auth.loginFromParent();}catch(e){}}});K.oo('method',"loginFromParent",function(){this.notify('userLoggedIn');this.loginToIframe();});K.oo('method',"getLoginUrl",function(){return(window.sslLogin?"https":"http")+"://"+window.location.hostname+this.loginUrl+"?origin_url="+encodeURIComponent(window.location.href);});K.oo('method',"getLogoutUrl",function(){return(window.sslLogin?"https":"http")+"://"+window.location.hostname+this.logoutUrl;});K.oo('method',"setOriginUrl",function(url){this.originUrl=url;});K.oo('method',"addRedirectUrl",function(url){this.returnTo=url;});K.oo('method',"isAdmin",function(){return this.getFromCookie('r')=='a';});K.oo('method',"isDev",function(){if(this.isAdmin())return true;return this.getFromCookie('r')=='d';});K.oo('method',"userId",function(){return parseInt(this.getFromCookie('i'));});K.oo('method',"userEmail",function(){return this.getFromCookie('e');});K.oo('method',"username",function(){return this.getFromCookie('u');});K.oo('method',"loggedIn",function(){var r=this.getFromCookie('r');if(!r)return false;return r!='n';});K.oo('method',"getFromCookie",function(key){return COOKIES.getCookie(key);});K.oo('method',"buildDialog",function(){this.jq=$(this.htmlCache.main());this.jqIframe=this.jq.find('iframe');var options={autoOpen:false,title:'Factual Login',width:800,height:500,minWidth:600,minHeight:500,modal:true}
this.jq.dialog(options);this.jqDialog=this.jq.parent();var TMP_SEL_MARKER=this.SEL_MARKER||JS2.SEL_MARKER;TMP_SEL_MARKER.addVal(TMP_SEL_MARKER.getRealClassScope(this),"dialog",this.jqDialog,null);this.jqDialog.addClass('authDialog');this.jqClose=this.jqDialog.find(':first-child>a');});K.oo('method',"showLogin",function(){this.callerInfo=null;this.show();});K.oo('method',"show",function(){if(!this.jqDialog)this.buildDialog();this.jqIframe.attr('src',this.loginUrl);this.jqIframe.attr('src',this.getLoginUrl());this.jq.dialog('open');});K.oo('method',"isShown",function(){if(!this.jqDialog)return false;return this.jq.dialog('isOpen');});K.oo('method',"logout",function(){if(!this.jqDialog)this.buildDialog();this.callerInfo=null;this.jqIframe.attr('src',this.logoutUrl);this.jqIframe.one('load',(function(self){return function(){self.userLoggedIn();}})(this));});K.oo('method',"notify",function(evt){for(var klass in this.listeners){try{if(this.listeners[klass][evt])this.listeners[klass][evt]();}catch(e){}}});K.oo('method',"hide",function(){if(!this.jqDialog)return;this.jq.dialog('close');});K.oo('method',"requireLogin",function(){if(this.loggedIn())return false;var args=[];for(var i=1,len=arguments.length;i<len;i++){args.push(arguments[i]);}
this.callerInfo={scope:arguments[0],fun:arguments.callee.caller,args:args};this.show();return true;});K.oo('method',"reApplyCaller",function(){try{this.callerInfo.fun.apply(this.callerInfo.scope,this.callerInfo.args);}catch(e){}
this.callerInfo=null;});K.oo('method',"checkLogin",function(mArea){if(!mArea||$(mArea).length==0)return;if(this.loggedIn()){$(mArea).html('');}else{$(mArea).html(this.htmlCache.requireLoginMsg());}});})(Sci.Authentication,Sci);if(!window.sci)window.sci={};window.sci.auth=Sci.Authentication.init();Sci.Authentication.oo('setHTMLCache',{"requireLoginMsg":function(){return"<div style='color:#525ed9'>After you submit this, you will be solicited for either a&nbsp;<strong>Factual login&nbsp;<\/strong>or a&nbsp;<strong>social network login.<\/strong><\/div>"},"main":function(){return"<div class='iframeWrapper'><iframe frameborder='0' height='450px' width='770px'><\/iframe><\/div>"}});