/*
 MIT Licensed
 http://www.gnu.org/licenses/gpl.html [GNU General Public License]
*/
var a;(function(b){var c=["info","log","warn","error","assert","dir","dirxml","trace","group","groupEnd","time","timeEnd","profile","profileEnd","count"],e;if(typeof b.console=="undefined"||!b.console)b.console={};for(e=0;e<c.length;e++)if(PHP.Environment.SERVER!="dev"||typeof b.console[c[e]]=="undefined"||!b.console[c[e]])b.console[c[e]]=function(){}})(window);this.JSON||(JSON={});
(function(){function b(t){return t<10?"0"+t:t}function c(t){m.lastIndex=0;return m.test(t)?'"'+t.replace(m,function(A){var D=s[A];return typeof D==="string"?D:"\\u"+("0000"+A.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function e(t,A){var D,H,T=l,F,N=A[t];if(N&&typeof N==="object"&&typeof N.toJSON==="function")N=N.toJSON(t);if(typeof u==="function")N=u.call(A,t,N);switch(typeof N){case "string":return c(N);case "number":return isFinite(N)?String(N):"null";case "boolean":case "null":return String(N);
case "object":if(!N)return"null";l+=x;F=[];if(Object.prototype.toString.apply(N)==="[object Array]"){H=N.length;for(t=0;t<H;t+=1)F[t]=e(t,N)||"null";A=F.length===0?"[]":l?"[\n"+l+F.join(",\n"+l)+"\n"+T+"]":"["+F.join(",")+"]";l=T;return A}if(u&&typeof u==="object"){H=u.length;for(t=0;t<H;t+=1){D=u[t];if(typeof D==="string")if(A=e(D,N))F.push(c(D)+(l?": ":":")+A)}}else for(D in N)if(Object.hasOwnProperty.call(N,D))if(A=e(D,N))F.push(c(D)+(l?": ":":")+A);A=F.length===0?"{}":l?"{\n"+l+F.join(",\n"+l)+
"\n"+T+"}":"{"+F.join(",")+"}";l=T;return A}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var g=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
m=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,l,x,s={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},u;if(typeof JSON.stringify!=="function")JSON.stringify=function(t,A,D){var H;x=l="";if(typeof D==="number")for(H=0;H<D;H+=1)x+=" ";else if(typeof D==="string")x=D;if((u=A)&&typeof A!=="function"&&(typeof A!=="object"||typeof A.length!=="number"))throw new Error("JSON.stringify");return e("",
{"":t})};if(typeof JSON.parse!=="function")JSON.parse=function(t,A){function D(H,T){var F,N,h=H[T];if(h&&typeof h==="object")for(F in h)if(Object.hasOwnProperty.call(h,F)){N=D(h,F);if(N!==undefined)h[F]=N;else delete h[F]}return A.call(H,T,h)}g.lastIndex=0;if(g.test(t))t=t.replace(g,function(H){return"\\u"+("0000"+H.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(t.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){t=eval("("+t+")");return typeof A==="function"?D({"":t},""):t}throw new SyntaxError("JSON.parse");}})();
(function(b,c){function e(){if(!h.isReady){try{Q.documentElement.doScroll("left")}catch(d){setTimeout(e,1);return}h.ready()}}function g(d,f){f.src?h.ajax({url:f.src,async:false,dataType:"script"}):h.globalEval(f.text||f.textContent||f.innerHTML||"");f.parentNode&&f.parentNode.removeChild(f)}function m(d,f,k,p,n,C){var B=d.length;if(typeof f==="object"){for(var M in f)m(d,M,f[M],p,n,k);return d}if(k!==c){p=!C&&p&&h.isFunction(k);for(M=0;M<B;M++)n(d[M],f,p?k.call(d[M],M,n(d[M],f)):k,C);return d}return B?
n(d[0],f):c}function l(){return(new Date).getTime()}function x(){return false}function s(){return true}function u(d,f,k){k[0].type=d;return h.event.handle.apply(f,k)}function t(d){var f,k=[],p=[],n=arguments,C,B,M,I,L,S;B=h.data(this,"events");if(!(d.liveFired===this||!B||!B.live||d.button&&d.type==="click")){d.liveFired=this;var W=B.live.slice(0);for(I=0;I<W.length;I++){B=W[I];B.origType.replace(ya,"")===d.type?p.push(B.selector):W.splice(I--,1)}C=h(d.target).closest(p,d.currentTarget);L=0;for(S=
C.length;L<S;L++)for(I=0;I<W.length;I++){B=W[I];if(C[L].selector===B.selector){M=C[L].elem;p=null;if(B.preType==="mouseenter"||B.preType==="mouseleave")p=h(d.relatedTarget).closest(B.selector)[0];if(!p||p!==M)k.push({elem:M,handleObj:B})}}L=0;for(S=k.length;L<S;L++){C=k[L];d.currentTarget=C.elem;d.data=C.handleObj.data;d.handleObj=C.handleObj;if(C.handleObj.origHandler.apply(C.elem,n)===false){f=false;break}}return f}}function A(d,f){return"live."+(d&&d!=="*"?d+".":"")+f.replace(/\./g,"`").replace(/ /g,
"&")}function D(d){return!d||!d.parentNode||d.parentNode.nodeType===11}function H(d,f){var k=0;f.each(function(){if(this.nodeName===(d[k]&&d[k].nodeName)){var p=h.data(d[k++]),n=h.data(this,p);if(p=p&&p.events){delete n.handle;n.events={};for(var C in p)for(var B in p[C])h.event.add(this,C,p[C][B],p[C][B].data)}}})}function T(d,f,k){var p,n,C;f=f&&f[0]?f[0].ownerDocument||f[0]:Q;if(d.length===1&&typeof d[0]==="string"&&d[0].length<512&&f===Q&&!Na.test(d[0])&&(h.support.checkClone||!Oa.test(d[0]))){n=
true;if(C=h.fragments[d[0]])if(C!==1)p=C}if(!p){p=f.createDocumentFragment();h.clean(d,f,p,k)}if(n)h.fragments[d[0]]=C?p:1;return{fragment:p,cacheable:n}}function F(d,f){var k={};h.each(Pa.concat.apply([],Pa.slice(0,f)),function(){k[this]=d});return k}function N(d){return"scrollTo"in d&&d.document?d:d.nodeType===9?d.defaultView||d.parentWindow:false}var h=function(d,f){return new h.fn.init(d,f)},Y=b.jQuery,E=b.$,Q=b.document,ia,na=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,G=/^.[^:#\[\.,]*$/,ja=/\S/,ka=
/^(\s|\u00A0)+|(\s|\u00A0)+$/g,y=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,O=navigator.userAgent,U=false,aa=[],ga,la=Object.prototype.toString,ra=Object.prototype.hasOwnProperty,ma=Array.prototype.push,sa=Array.prototype.slice,ha=Array.prototype.indexOf;h.fn=h.prototype={init:function(d,f){var k,p;if(!d)return this;if(d.nodeType){this.context=this[0]=d;this.length=1;return this}if(d==="body"&&!f){this.context=Q;this[0]=Q.body;this.selector="body";this.length=1;return this}if(typeof d==="string")if((k=na.exec(d))&&
(k[1]||!f))if(k[1]){p=f?f.ownerDocument||f:Q;if(d=y.exec(d))if(h.isPlainObject(f)){d=[Q.createElement(d[1])];h.fn.attr.call(d,f,true)}else d=[p.createElement(d[1])];else{d=T([k[1]],[p]);d=(d.cacheable?d.fragment.cloneNode(true):d.fragment).childNodes}return h.merge(this,d)}else{if(f=Q.getElementById(k[2])){if(f.id!==k[2])return ia.find(d);this.length=1;this[0]=f}this.context=Q;this.selector=d;return this}else if(!f&&/^\w+$/.test(d)){this.selector=d;this.context=Q;d=Q.getElementsByTagName(d);return h.merge(this,
d)}else return!f||f.jquery?(f||ia).find(d):h(f).find(d);else if(h.isFunction(d))return ia.ready(d);if(d.selector!==c){this.selector=d.selector;this.context=d.context}return h.makeArray(d,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return sa.call(this,0)},get:function(d){return d==null?this.toArray():d<0?this.slice(d)[0]:this[d]},pushStack:function(d,f,k){var p=h();h.isArray(d)?ma.apply(p,d):h.merge(p,d);p.prevObject=this;p.context=this.context;
if(f==="find")p.selector=this.selector+(this.selector?" ":"")+k;else if(f)p.selector=this.selector+"."+f+"("+k+")";return p},each:function(d,f){return h.each(this,d,f)},ready:function(d){h.bindReady();if(h.isReady)d.call(Q,h);else aa&&aa.push(d);return this},eq:function(d){return d===-1?this.slice(d):this.slice(d,+d+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(sa.apply(this,arguments),"slice",sa.call(arguments).join(","))},map:function(d){return this.pushStack(h.map(this,
function(f,k){return d.call(f,k,f)}))},end:function(){return this.prevObject||h(null)},push:ma,sort:[].sort,splice:[].splice};h.fn.init.prototype=h.fn;h.extend=h.fn.extend=function(){var d=arguments[0]||{},f=1,k=arguments.length,p=false,n,C,B,M;if(typeof d==="boolean"){p=d;d=arguments[1]||{};f=2}if(typeof d!=="object"&&!h.isFunction(d))d={};if(k===f){d=this;--f}for(;f<k;f++)if((n=arguments[f])!=null)for(C in n){B=d[C];M=n[C];if(d!==M)if(p&&M&&(h.isPlainObject(M)||h.isArray(M))){B=B&&(h.isPlainObject(B)||
h.isArray(B))?B:h.isArray(M)?[]:{};d[C]=h.extend(p,B,M)}else if(M!==c)d[C]=M}return d};h.extend({noConflict:function(d){b.$=E;if(d)b.jQuery=Y;return h},isReady:false,ready:function(){if(!h.isReady){if(!Q.body)return setTimeout(h.ready,13);h.isReady=true;if(aa){for(var d,f=0;d=aa[f++];)d.call(Q,h);aa=null}h.fn.triggerHandler&&h(Q).triggerHandler("ready")}},bindReady:function(){if(!U){U=true;if(Q.readyState==="complete")return h.ready();if(Q.addEventListener){Q.addEventListener("DOMContentLoaded",ga,
false);b.addEventListener("load",h.ready,false)}else if(Q.attachEvent){Q.attachEvent("onreadystatechange",ga);b.attachEvent("onload",h.ready);var d=false;try{d=b.frameElement==null}catch(f){}Q.documentElement.doScroll&&d&&e()}}},isFunction:function(d){return la.call(d)==="[object Function]"},isArray:function(d){return la.call(d)==="[object Array]"},isPlainObject:function(d){if(!d||la.call(d)!=="[object Object]"||d.nodeType||d.setInterval)return false;if(d.constructor&&!ra.call(d,"constructor")&&!ra.call(d.constructor.prototype,
"isPrototypeOf"))return false;var f;for(f in d);return f===c||ra.call(d,f)},isEmptyObject:function(d){for(var f in d)return false;return true},error:function(d){throw d;},parseJSON:function(d){if(typeof d!=="string"||!d)return null;d=h.trim(d);if(/^[\],:{}\s]*$/.test(d.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return b.JSON&&b.JSON.parse?b.JSON.parse(d):(new Function("return "+
d))();else h.error("Invalid JSON: "+d)},noop:function(){},globalEval:function(d){if(d&&ja.test(d)){var f=Q.getElementsByTagName("head")[0]||Q.documentElement,k=Q.createElement("script");k.type="text/javascript";if(h.support.scriptEval)k.appendChild(Q.createTextNode(d));else k.text=d;f.insertBefore(k,f.firstChild);f.removeChild(k)}},nodeName:function(d,f){return d.nodeName&&d.nodeName.toUpperCase()===f.toUpperCase()},each:function(d,f,k){var p,n=0,C=d.length,B=C===c||h.isFunction(d);if(k)if(B)for(p in d){if(f.apply(d[p],
k)===false)break}else for(;n<C;){if(f.apply(d[n++],k)===false)break}else if(B)for(p in d){if(f.call(d[p],p,d[p])===false)break}else for(k=d[0];n<C&&f.call(k,n,k)!==false;k=d[++n]);return d},trim:function(d){return(d||"").replace(ka,"")},makeArray:function(d,f){f=f||[];if(d!=null)d.length==null||typeof d==="string"||h.isFunction(d)||typeof d!=="function"&&d.setInterval?ma.call(f,d):h.merge(f,d);return f},inArray:function(d,f){if(f.indexOf)return f.indexOf(d);for(var k=0,p=f.length;k<p;k++)if(f[k]===
d)return k;return-1},merge:function(d,f){var k=d.length,p=0;if(typeof f.length==="number")for(var n=f.length;p<n;p++)d[k++]=f[p];else for(;f[p]!==c;)d[k++]=f[p++];d.length=k;return d},grep:function(d,f,k){for(var p=[],n=0,C=d.length;n<C;n++)!k!==!f(d[n],n)&&p.push(d[n]);return p},map:function(d,f,k){for(var p=[],n,C=0,B=d.length;C<B;C++){n=f(d[C],C,k);if(n!=null)p[p.length]=n}return p.concat.apply([],p)},guid:1,proxy:function(d,f,k){if(arguments.length===2)if(typeof f==="string"){k=d;d=k[f];f=c}else if(f&&
!h.isFunction(f)){k=f;f=c}if(!f&&d)f=function(){return d.apply(k||this,arguments)};if(d)f.guid=d.guid=d.guid||f.guid||h.guid++;return f},uaMatch:function(d){d=d.toLowerCase();d=/(webkit)[ \/]([\w.]+)/.exec(d)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(d)||/(msie) ([\w.]+)/.exec(d)||!/compatible/.test(d)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(d)||[];return{browser:d[1]||"",version:d[2]||"0"}},browser:{}});O=h.uaMatch(O);if(O.browser){h.browser[O.browser]=true;h.browser.version=O.version}if(h.browser.webkit)h.browser.safari=
true;if(ha)h.inArray=function(d,f){return ha.call(f,d)};ia=h(Q);if(Q.addEventListener)ga=function(){Q.removeEventListener("DOMContentLoaded",ga,false);h.ready()};else if(Q.attachEvent)ga=function(){if(Q.readyState==="complete"){Q.detachEvent("onreadystatechange",ga);h.ready()}};(function(){h.support={};var d=Q.documentElement,f=Q.createElement("script"),k=Q.createElement("div"),p="script"+l();k.style.display="none";k.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var n=k.getElementsByTagName("*"),C=k.getElementsByTagName("a")[0];if(!(!n||!n.length||!C)){h.support={leadingWhitespace:k.firstChild.nodeType===3,tbody:!k.getElementsByTagName("tbody").length,htmlSerialize:!!k.getElementsByTagName("link").length,style:/red/.test(C.getAttribute("style")),hrefNormalized:C.getAttribute("href")==="/a",opacity:/^0.55$/.test(C.style.opacity),cssFloat:!!C.style.cssFloat,checkOn:k.getElementsByTagName("input")[0].value==="on",optSelected:Q.createElement("select").appendChild(Q.createElement("option")).selected,
parentNode:k.removeChild(k.appendChild(Q.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};f.type="text/javascript";try{f.appendChild(Q.createTextNode("window."+p+"=1;"))}catch(B){}d.insertBefore(f,d.firstChild);if(b[p]){h.support.scriptEval=true;delete b[p]}try{delete f.test}catch(M){h.support.deleteExpando=false}d.removeChild(f);if(k.attachEvent&&k.fireEvent){k.attachEvent("onclick",function I(){h.support.noCloneEvent=
false;k.detachEvent("onclick",I)});k.cloneNode(true).fireEvent("onclick")}k=Q.createElement("div");k.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";d=Q.createDocumentFragment();d.appendChild(k.firstChild);h.support.checkClone=d.cloneNode(true).cloneNode(true).lastChild.checked;h(function(){var I=Q.createElement("div");I.style.width=I.style.paddingLeft="1px";Q.body.appendChild(I);h.boxModel=h.support.boxModel=I.offsetWidth===2;Q.body.removeChild(I).style.display="none"});d=function(I){var L=
Q.createElement("div");I="on"+I;var S=I in L;if(!S){L.setAttribute(I,"return;");S=typeof L[I]==="function"}return S};h.support.submitBubbles=d("submit");h.support.changeBubbles=d("change");d=f=k=n=C=null}})();h.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var da="jQuery"+l(),va=0,Qa={};h.extend({cache:{},expando:da,noData:{embed:true,
object:true,applet:true},data:function(d,f,k){if(!(d.nodeName&&h.noData[d.nodeName.toLowerCase()])){d=d==b?Qa:d;var p=d[da],n=h.cache;if(!p&&typeof f==="string"&&k===c)return null;p||(p=++va);if(typeof f==="object"){d[da]=p;n[p]=h.extend(true,{},f)}else if(!n[p]){d[da]=p;n[p]={}}d=n[p];if(k!==c)d[f]=k;return typeof f==="string"?d[f]:d}},removeData:function(d,f){if(!(d.nodeName&&h.noData[d.nodeName.toLowerCase()])){d=d==b?Qa:d;var k=d[da],p=h.cache,n=p[k];if(f){if(n){delete n[f];h.isEmptyObject(n)&&
h.removeData(d)}}else{if(h.support.deleteExpando)delete d[h.expando];else d.removeAttribute&&d.removeAttribute(h.expando);delete p[k]}}}});h.fn.extend({data:function(d,f){if(typeof d==="undefined"&&this.length)return h.data(this[0]);else if(typeof d==="object")return this.each(function(){h.data(this,d)});var k=d.split(".");k[1]=k[1]?"."+k[1]:"";if(f===c){var p=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(p===c&&this.length)p=h.data(this[0],d);return p===c&&k[1]?this.data(k[0]):p}else return this.trigger("setData"+
k[1]+"!",[k[0],f]).each(function(){h.data(this,d,f)})},removeData:function(d){return this.each(function(){h.removeData(this,d)})}});h.extend({queue:function(d,f,k){if(d){f=(f||"fx")+"queue";var p=h.data(d,f);if(!k)return p||[];if(!p||h.isArray(k))p=h.data(d,f,h.makeArray(k));else p.push(k);return p}},dequeue:function(d,f){f=f||"fx";var k=h.queue(d,f),p=k.shift();if(p==="inprogress")p=k.shift();if(p){f==="fx"&&k.unshift("inprogress");p.call(d,function(){h.dequeue(d,f)})}}});h.fn.extend({queue:function(d,
f){if(typeof d!=="string"){f=d;d="fx"}if(f===c)return h.queue(this[0],d);return this.each(function(){var k=h.queue(this,d,f);d==="fx"&&k[0]!=="inprogress"&&h.dequeue(this,d)})},dequeue:function(d){return this.each(function(){h.dequeue(this,d)})},delay:function(d,f){d=h.fx?h.fx.speeds[d]||d:d;f=f||"fx";return this.queue(f,function(){var k=this;setTimeout(function(){h.dequeue(k,f)},d)})},clearQueue:function(d){return this.queue(d||"fx",[])}});var Ra=/[\n\t]/g,Da=/\s+/,gb=/\r/g,hb=/href|src|style/,ib=
/(button|input)/i,jb=/(button|input|object|select|textarea)/i,kb=/^(a|area)$/i,Sa=/radio|checkbox/;h.fn.extend({attr:function(d,f){return m(this,d,f,true,h.attr)},removeAttr:function(d){return this.each(function(){h.attr(this,d,"");this.nodeType===1&&this.removeAttribute(d)})},addClass:function(d){if(h.isFunction(d))return this.each(function(L){var S=h(this);S.addClass(d.call(this,L,S.attr("class")))});if(d&&typeof d==="string")for(var f=(d||"").split(Da),k=0,p=this.length;k<p;k++){var n=this[k];
if(n.nodeType===1)if(n.className){for(var C=" "+n.className+" ",B=n.className,M=0,I=f.length;M<I;M++)if(C.indexOf(" "+f[M]+" ")<0)B+=" "+f[M];n.className=h.trim(B)}else n.className=d}return this},removeClass:function(d){if(h.isFunction(d))return this.each(function(I){var L=h(this);L.removeClass(d.call(this,I,L.attr("class")))});if(d&&typeof d==="string"||d===c)for(var f=(d||"").split(Da),k=0,p=this.length;k<p;k++){var n=this[k];if(n.nodeType===1&&n.className)if(d){for(var C=(" "+n.className+" ").replace(Ra,
" "),B=0,M=f.length;B<M;B++)C=C.replace(" "+f[B]+" "," ");n.className=h.trim(C)}else n.className=""}return this},toggleClass:function(d,f){var k=typeof d,p=typeof f==="boolean";if(h.isFunction(d))return this.each(function(n){var C=h(this);C.toggleClass(d.call(this,n,C.attr("class"),f),f)});return this.each(function(){if(k==="string")for(var n,C=0,B=h(this),M=f,I=d.split(Da);n=I[C++];){M=p?M:!B.hasClass(n);B[M?"addClass":"removeClass"](n)}else if(k==="undefined"||k==="boolean"){this.className&&h.data(this,
"__className__",this.className);this.className=this.className||d===false?"":h.data(this,"__className__")||""}})},hasClass:function(d){d=" "+d+" ";for(var f=0,k=this.length;f<k;f++)if((" "+this[f].className+" ").replace(Ra," ").indexOf(d)>-1)return true;return false},val:function(d){if(d===c){var f=this[0];if(f){if(h.nodeName(f,"option"))return(f.attributes.value||{}).specified?f.value:f.text;if(h.nodeName(f,"select")){var k=f.selectedIndex,p=[],n=f.options;f=f.type==="select-one";if(k<0)return null;
var C=f?k:0;for(k=f?k+1:n.length;C<k;C++){var B=n[C];if(B.selected){d=h(B).val();if(f)return d;p.push(d)}}return p}if(Sa.test(f.type)&&!h.support.checkOn)return f.getAttribute("value")===null?"on":f.value;return(f.value||"").replace(gb,"")}return c}var M=h.isFunction(d);return this.each(function(I){var L=h(this),S=d;if(this.nodeType===1){if(M)S=d.call(this,I,L.val());if(typeof S==="number")S+="";if(h.isArray(S)&&Sa.test(this.type))this.checked=h.inArray(L.val(),S)>=0;else if(h.nodeName(this,"select")){var W=
h.makeArray(S);h("option",this).each(function(){this.selected=h.inArray(h(this).val(),W)>=0});if(!W.length)this.selectedIndex=-1}else this.value=S}})}});h.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(d,f,k,p){if(!d||d.nodeType===3||d.nodeType===8)return c;if(p&&f in h.attrFn)return h(d)[f](k);p=d.nodeType!==1||!h.isXMLDoc(d);var n=k!==c;f=p&&h.props[f]||f;if(d.nodeType===1){var C=hb.test(f);if(f in d&&p&&!C){if(n){f==="type"&&ib.test(d.nodeName)&&
d.parentNode&&h.error("type property can't be changed");d[f]=k}if(h.nodeName(d,"form")&&d.getAttributeNode(f))return d.getAttributeNode(f).nodeValue;if(f==="tabIndex")return(f=d.getAttributeNode("tabIndex"))&&f.specified?f.value:jb.test(d.nodeName)||kb.test(d.nodeName)&&d.href?0:c;return d[f]}if(!h.support.style&&p&&f==="style"){if(n)d.style.cssText=""+k;return d.style.cssText}n&&d.setAttribute(f,""+k);d=!h.support.hrefNormalized&&p&&C?d.getAttribute(f,2):d.getAttribute(f);return d===null?c:d}return h.style(d,
f,k)}});var ya=/\.(.*)$/,lb=function(d){return d.replace(/[^\w\s\.\|`]/g,function(f){return"\\"+f})};h.event={add:function(d,f,k,p){if(!(d.nodeType===3||d.nodeType===8)){if(d.setInterval&&d!==b&&!d.frameElement)d=b;var n,C;if(k.handler){n=k;k=n.handler}if(!k.guid)k.guid=h.guid++;if(C=h.data(d)){var B=C.events=C.events||{},M=C.handle;if(!M)C.handle=M=function(){return typeof h!=="undefined"&&!h.event.triggered?h.event.handle.apply(M.elem,arguments):c};M.elem=d;f=f.split(" ");for(var I,L=0,S;I=f[L++];){C=
n?h.extend({},n):{handler:k,data:p};if(I.indexOf(".")>-1){S=I.split(".");I=S.shift();C.namespace=S.slice(0).sort().join(".")}else{S=[];C.namespace=""}C.type=I;C.guid=k.guid;var W=B[I],ca=h.event.special[I]||{};if(!W){W=B[I]=[];if(!ca.setup||ca.setup.call(d,p,S,M)===false)if(d.addEventListener)d.addEventListener(I,M,false);else d.attachEvent&&d.attachEvent("on"+I,M)}if(ca.add){ca.add.call(d,C);if(!C.handler.guid)C.handler.guid=k.guid}W.push(C);h.event.global[I]=true}d=null}}},global:{},remove:function(d,
f,k,p){if(!(d.nodeType===3||d.nodeType===8)){var n,C=0,B,M,I,L,S,W,ca=h.data(d),fa=ca&&ca.events;if(ca&&fa){if(f&&f.type){k=f.handler;f=f.type}if(!f||typeof f==="string"&&f.charAt(0)==="."){f=f||"";for(n in fa)h.event.remove(d,n+f)}else{for(f=f.split(" ");n=f[C++];){L=n;B=n.indexOf(".")<0;M=[];if(!B){M=n.split(".");n=M.shift();I=new RegExp("(^|\\.)"+h.map(M.slice(0).sort(),lb).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(S=fa[n])if(k){L=h.event.special[n]||{};for(ea=p||0;ea<S.length;ea++){W=S[ea];if(k.guid===
W.guid){if(B||I.test(W.namespace)){p==null&&S.splice(ea--,1);L.remove&&L.remove.call(d,W)}if(p!=null)break}}if(S.length===0||p!=null&&S.length===1){if(!L.teardown||L.teardown.call(d,M)===false)Ta(d,n,ca.handle);delete fa[n]}}else for(var ea=0;ea<S.length;ea++){W=S[ea];if(B||I.test(W.namespace)){h.event.remove(d,L,W.handler,ea);S.splice(ea--,1)}}}if(h.isEmptyObject(fa)){if(f=ca.handle)f.elem=null;delete ca.events;delete ca.handle;h.isEmptyObject(ca)&&h.removeData(d)}}}}},trigger:function(d,f,k,p){var n=
d.type||d;if(!p){d=typeof d==="object"?d[da]?d:h.extend(h.Event(n),d):h.Event(n);if(n.indexOf("!")>=0){d.type=n=n.slice(0,-1);d.exclusive=true}if(!k){d.stopPropagation();h.event.global[n]&&h.each(h.cache,function(){this.events&&this.events[n]&&h.event.trigger(d,f,this.handle.elem)})}if(!k||k.nodeType===3||k.nodeType===8)return c;d.result=c;d.target=k;f=h.makeArray(f);f.unshift(d)}d.currentTarget=k;(p=h.data(k,"handle"))&&p.apply(k,f);p=k.parentNode||k.ownerDocument;try{if(!(k&&k.nodeName&&h.noData[k.nodeName.toLowerCase()]))if(k["on"+
n]&&k["on"+n].apply(k,f)===false)d.result=false}catch(C){}if(!d.isPropagationStopped()&&p)h.event.trigger(d,f,p,true);else if(!d.isDefaultPrevented()){p=d.target;var B,M=h.nodeName(p,"a")&&n==="click",I=h.event.special[n]||{};if((!I._default||I._default.call(k,d)===false)&&!M&&!(p&&p.nodeName&&h.noData[p.nodeName.toLowerCase()])){try{if(p[n]){if(B=p["on"+n])p["on"+n]=null;h.event.triggered=true;p[n]()}}catch(L){}if(B)p["on"+n]=B;h.event.triggered=false}}},handle:function(d){var f,k,p,n;d=arguments[0]=
h.event.fix(d||b.event);d.currentTarget=this;f=d.type.indexOf(".")<0&&!d.exclusive;if(!f){k=d.type.split(".");d.type=k.shift();p=new RegExp("(^|\\.)"+k.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}n=h.data(this,"events");k=n[d.type];if(n&&k){k=k.slice(0);n=0;for(var C=k.length;n<C;n++){var B=k[n];if(f||p.test(B.namespace)){d.handler=B.handler;d.data=B.data;d.handleObj=B;B=B.handler.apply(this,arguments);if(B!==c){d.result=B;if(B===false){d.preventDefault();d.stopPropagation()}}if(d.isImmediatePropagationStopped())break}}}return d.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(d){if(d[da])return d;var f=d;d=h.Event(f);for(var k=this.props.length,p;k;){p=this.props[--k];d[p]=f[p]}if(!d.target)d.target=d.srcElement||
Q;if(d.target.nodeType===3)d.target=d.target.parentNode;if(!d.relatedTarget&&d.fromElement)d.relatedTarget=d.fromElement===d.target?d.toElement:d.fromElement;if(d.pageX==null&&d.clientX!=null){f=Q.documentElement;k=Q.body;d.pageX=d.clientX+(f&&f.scrollLeft||k&&k.scrollLeft||0)-(f&&f.clientLeft||k&&k.clientLeft||0);d.pageY=d.clientY+(f&&f.scrollTop||k&&k.scrollTop||0)-(f&&f.clientTop||k&&k.clientTop||0)}if(!d.which&&(d.charCode||d.charCode===0?d.charCode:d.keyCode))d.which=d.charCode||d.keyCode;if(!d.metaKey&&
d.ctrlKey)d.metaKey=d.ctrlKey;if(!d.which&&d.button!==c)d.which=d.button&1?1:d.button&2?3:d.button&4?2:0;return d},guid:1E8,proxy:h.proxy,special:{ready:{setup:h.bindReady,teardown:h.noop},live:{add:function(d){h.event.add(this,d.origType,h.extend({},d,{handler:t}))},remove:function(d){var f=true,k=d.origType.replace(ya,"");h.each(h.data(this,"events").live||[],function(){if(k===this.origType.replace(ya,""))return f=false});f&&h.event.remove(this,d.origType,t)}},beforeunload:{setup:function(d,f,k){if(this.setInterval)this.onbeforeunload=
k;return false},teardown:function(d,f){if(this.onbeforeunload===f)this.onbeforeunload=null}}}};var Ta=Q.removeEventListener?function(d,f,k){d.removeEventListener(f,k,false)}:function(d,f,k){d.detachEvent("on"+f,k)};h.Event=function(d){if(!this.preventDefault)return new h.Event(d);if(d&&d.type){this.originalEvent=d;this.type=d.type}else this.type=d;this.timeStamp=l();this[da]=true};h.Event.prototype={preventDefault:function(){this.isDefaultPrevented=s;var d=this.originalEvent;if(d){d.preventDefault&&
d.preventDefault();d.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=s;var d=this.originalEvent;if(d){d.stopPropagation&&d.stopPropagation();d.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=s;this.stopPropagation()},isDefaultPrevented:x,isPropagationStopped:x,isImmediatePropagationStopped:x};var Ua=function(d){var f=d.relatedTarget;try{for(;f&&f!==this;)f=f.parentNode;if(f!==this){d.type=d.data;h.event.handle.apply(this,arguments)}}catch(k){}},
Va=function(d){d.type=d.data;h.event.handle.apply(this,arguments)};h.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(d,f){h.event.special[d]={setup:function(k){h.event.add(this,f,k&&k.selector?Va:Ua,d)},teardown:function(k){h.event.remove(this,f,k&&k.selector?Va:Ua)}}});if(!h.support.submitBubbles)h.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!=="form"){h.event.add(this,"click.specialSubmit",function(d){var f=d.target,k=f.type;if((k==="submit"||k==="image")&&
h(f).closest("form").length)return u("submit",this,arguments)});h.event.add(this,"keypress.specialSubmit",function(d){var f=d.target,k=f.type;if((k==="text"||k==="password")&&h(f).closest("form").length&&d.keyCode===13)return u("submit",this,arguments)})}else return false},teardown:function(){h.event.remove(this,".specialSubmit")}};if(!h.support.changeBubbles){var Ea=/textarea|input|select/i,Fa,Wa=function(d){var f=d.type,k=d.value;if(f==="radio"||f==="checkbox")k=d.checked;else if(f==="select-multiple")k=
d.selectedIndex>-1?h.map(d.options,function(p){return p.selected}).join("-"):"";else if(d.nodeName.toLowerCase()==="select")k=d.selectedIndex;return k},Ga=function(d,f){var k=d.target,p,n;if(!(!Ea.test(k.nodeName)||k.readOnly)){p=h.data(k,"_change_data");n=Wa(k);if(d.type!=="focusout"||k.type!=="radio")h.data(k,"_change_data",n);if(!(p===c||n===p))if(p!=null||n){d.type="change";return h.event.trigger(d,f,k)}}};h.event.special.change={filters:{focusout:Ga,click:function(d){var f=d.target,k=f.type;
if(k==="radio"||k==="checkbox"||f.nodeName.toLowerCase()==="select")return Ga.call(this,d)},keydown:function(d){var f=d.target,k=f.type;if(d.keyCode===13&&f.nodeName.toLowerCase()!=="textarea"||d.keyCode===32&&(k==="checkbox"||k==="radio")||k==="select-multiple")return Ga.call(this,d)},beforeactivate:function(d){d=d.target;h.data(d,"_change_data",Wa(d))}},setup:function(){if(this.type==="file")return false;for(var d in Fa)h.event.add(this,d+".specialChange",Fa[d]);return Ea.test(this.nodeName)},teardown:function(){h.event.remove(this,
".specialChange");return Ea.test(this.nodeName)}};Fa=h.event.special.change.filters}Q.addEventListener&&h.each({focus:"focusin",blur:"focusout"},function(d,f){function k(p){p=h.event.fix(p);p.type=f;return h.event.handle.call(this,p)}h.event.special[f]={setup:function(){this.addEventListener(d,k,true)},teardown:function(){this.removeEventListener(d,k,true)}}});h.each(["bind","one"],function(d,f){h.fn[f]=function(k,p,n){if(typeof k==="object"){for(var C in k)this[f](C,p,k[C],n);return this}if(h.isFunction(p)){n=
p;p=c}var B=f==="one"?h.proxy(n,function(I){h(this).unbind(I,B);return n.apply(this,arguments)}):n;if(k==="unload"&&f!=="one")this.one(k,p,n);else{C=0;for(var M=this.length;C<M;C++)h.event.add(this[C],k,B,p)}return this}});h.fn.extend({unbind:function(d,f){if(typeof d==="object"&&!d.preventDefault)for(var k in d)this.unbind(k,d[k]);else{k=0;for(var p=this.length;k<p;k++)h.event.remove(this[k],d,f)}return this},delegate:function(d,f,k,p){return this.live(f,k,p,d)},undelegate:function(d,f,k){return arguments.length===
0?this.unbind("live"):this.die(f,null,k,d)},trigger:function(d,f){return this.each(function(){h.event.trigger(d,f,this)})},triggerHandler:function(d,f){if(this[0]){d=h.Event(d);d.preventDefault();d.stopPropagation();h.event.trigger(d,f,this[0]);return d.result}},toggle:function(d){for(var f=arguments,k=1;k<f.length;)h.proxy(d,f[k++]);return this.click(h.proxy(d,function(p){var n=(h.data(this,"lastToggle"+d.guid)||0)%k;h.data(this,"lastToggle"+d.guid,n+1);p.preventDefault();return f[n].apply(this,
arguments)||false}))},hover:function(d,f){return this.mouseenter(d).mouseleave(f||d)}});var Xa={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};h.each(["live","die"],function(d,f){h.fn[f]=function(k,p,n,C){var B,M=0,I,L,S=C||this.selector,W=C?this:h(this.context);if(h.isFunction(p)){n=p;p=c}for(k=(k||"").split(" ");(B=k[M++])!=null;){C=ya.exec(B);I="";if(C){I=C[0];B=B.replace(ya,"")}if(B==="hover")k.push("mouseenter"+I,"mouseleave"+I);else{L=B;if(B==="focus"||B==="blur"){k.push(Xa[B]+
I);B+=I}else B=(Xa[B]||B)+I;f==="live"?W.each(function(){h.event.add(this,A(B,S),{data:p,selector:S,handler:n,origType:B,origHandler:n,preType:L})}):W.unbind(A(B,S),n)}}return this}});h.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(d,f){h.fn[f]=function(k){return k?this.bind(f,k):this.trigger(f)};if(h.attrFn)h.attrFn[f]=true});b.attachEvent&&
!b.addEventListener&&b.attachEvent("onunload",function(){for(var d in h.cache)if(h.cache[d].handle)try{h.event.remove(h.cache[d].handle.elem)}catch(f){}});(function(){function d(q){for(var z="",J,K=0;q[K];K++){J=q[K];if(J.nodeType===3||J.nodeType===4)z+=J.nodeValue;else if(J.nodeType!==8)z+=d(J.childNodes)}return z}function f(q,z,J,K,R,P){R=0;for(var X=K.length;R<X;R++){var V=K[R];if(V){V=V[q];for(var ba=false;V;){if(V.sizcache===J){ba=K[V.sizset];break}if(V.nodeType===1&&!P){V.sizcache=J;V.sizset=
R}if(V.nodeName.toLowerCase()===z){ba=V;break}V=V[q]}K[R]=ba}}}function k(q,z,J,K,R,P){R=0;for(var X=K.length;R<X;R++){var V=K[R];if(V){V=V[q];for(var ba=false;V;){if(V.sizcache===J){ba=K[V.sizset];break}if(V.nodeType===1){if(!P){V.sizcache=J;V.sizset=R}if(typeof z!=="string"){if(V===z){ba=true;break}}else if(I.filter(z,[V]).length>0){ba=V;break}}V=V[q]}K[R]=ba}}}var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
n=0,C=Object.prototype.toString,B=false,M=true;[0,0].sort(function(){M=false;return 0});var I=function(q,z,J,K){J=J||[];var R=z=z||Q;if(z.nodeType!==1&&z.nodeType!==9)return[];if(!q||typeof q!=="string")return J;for(var P=[],X,V,ba,za,ta=true,wa=Z(z),ua=q;(p.exec(""),X=p.exec(ua))!==null;){ua=X[3];P.push(X[1]);if(X[2]){za=X[3];break}}if(P.length>1&&S.exec(q))if(P.length===2&&L.relative[P[0]])V=Ha(P[0]+P[1],z);else for(V=L.relative[P[0]]?[z]:I(P.shift(),z);P.length;){q=P.shift();if(L.relative[q])q+=
P.shift();V=Ha(q,V)}else{if(!K&&P.length>1&&z.nodeType===9&&!wa&&L.match.ID.test(P[0])&&!L.match.ID.test(P[P.length-1])){X=I.find(P.shift(),z,wa);z=X.expr?I.filter(X.expr,X.set)[0]:X.set[0]}if(z){X=K?{expr:P.pop(),set:ca(K)}:I.find(P.pop(),P.length===1&&(P[0]==="~"||P[0]==="+")&&z.parentNode?z.parentNode:z,wa);V=X.expr?I.filter(X.expr,X.set):X.set;if(P.length>0)ba=ca(V);else ta=false;for(;P.length;){var oa=P.pop();X=oa;if(L.relative[oa])X=P.pop();else oa="";if(X==null)X=z;L.relative[oa](ba,X,wa)}}else ba=
[]}ba||(ba=V);ba||I.error(oa||q);if(C.call(ba)==="[object Array]")if(ta)if(z&&z.nodeType===1)for(q=0;ba[q]!=null;q++){if(ba[q]&&(ba[q]===true||ba[q].nodeType===1&&pa(z,ba[q])))J.push(V[q])}else for(q=0;ba[q]!=null;q++)ba[q]&&ba[q].nodeType===1&&J.push(V[q]);else J.push.apply(J,ba);else ca(ba,J);if(za){I(za,R,J,K);I.uniqueSort(J)}return J};I.uniqueSort=function(q){if(ea){B=M;q.sort(ea);if(B)for(var z=1;z<q.length;z++)q[z]===q[z-1]&&q.splice(z--,1)}return q};I.matches=function(q,z){return I(q,null,
null,z)};I.find=function(q,z,J){var K,R;if(!q)return[];for(var P=0,X=L.order.length;P<X;P++){var V=L.order[P];if(R=L.leftMatch[V].exec(q)){var ba=R[1];R.splice(1,1);if(ba.substr(ba.length-1)!=="\\"){R[1]=(R[1]||"").replace(/\\/g,"");K=L.find[V](R,z,J);if(K!=null){q=q.replace(L.match[V],"");break}}}}K||(K=z.getElementsByTagName("*"));return{set:K,expr:q}};I.filter=function(q,z,J,K){for(var R=q,P=[],X=z,V,ba,za=z&&z[0]&&Z(z[0]);q&&z.length;){for(var ta in L.filter)if((V=L.leftMatch[ta].exec(q))!=null&&
V[2]){var wa=L.filter[ta],ua,oa;oa=V[1];ba=false;V.splice(1,1);if(oa.substr(oa.length-1)!=="\\"){if(X===P)P=[];if(L.preFilter[ta])if(V=L.preFilter[ta](V,X,J,P,K,za)){if(V===true)continue}else ba=ua=true;if(V)for(var Aa=0;(oa=X[Aa])!=null;Aa++)if(oa){ua=wa(oa,V,Aa,X);var Ya=K^!!ua;if(J&&ua!=null)if(Ya)ba=true;else X[Aa]=false;else if(Ya){P.push(oa);ba=true}}if(ua!==c){J||(X=P);q=q.replace(L.match[ta],"");if(!ba)return[];break}}}if(q===R)if(ba==null)I.error(q);else break;R=q}return X};I.error=function(q){throw"Syntax error, unrecognized expression: "+
q;};var L=I.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(q){return q.getAttribute("href")}},relative:{"+":function(q,z){var J=typeof z==="string",K=J&&!/\W/.test(z);J=J&&!K;if(K)z=z.toLowerCase();K=0;for(var R=q.length,P;K<R;K++)if(P=q[K]){for(;(P=P.previousSibling)&&P.nodeType!==1;);q[K]=J||P&&P.nodeName.toLowerCase()===z?P||false:P===z}J&&I.filter(z,q,true)},">":function(q,z){var J=typeof z==="string";if(J&&!/\W/.test(z)){z=z.toLowerCase();for(var K=0,R=q.length;K<R;K++){var P=
q[K];if(P){J=P.parentNode;q[K]=J.nodeName.toLowerCase()===z?J:false}}}else{K=0;for(R=q.length;K<R;K++)if(P=q[K])q[K]=J?P.parentNode:P.parentNode===z;J&&I.filter(z,q,true)}},"":function(q,z,J){var K=n++,R=k;if(typeof z==="string"&&!/\W/.test(z)){var P=z=z.toLowerCase();R=f}R("parentNode",z,K,q,P,J)},"~":function(q,z,J){var K=n++,R=k;if(typeof z==="string"&&!/\W/.test(z)){var P=z=z.toLowerCase();R=f}R("previousSibling",z,K,q,P,J)}},find:{ID:function(q,z,J){if(typeof z.getElementById!=="undefined"&&
!J)return(q=z.getElementById(q[1]))?[q]:[]},NAME:function(q,z){if(typeof z.getElementsByName!=="undefined"){var J=[];z=z.getElementsByName(q[1]);for(var K=0,R=z.length;K<R;K++)z[K].getAttribute("name")===q[1]&&J.push(z[K]);return J.length===0?null:J}},TAG:function(q,z){return z.getElementsByTagName(q[1])}},preFilter:{CLASS:function(q,z,J,K,R,P){q=" "+q[1].replace(/\\/g,"")+" ";if(P)return q;P=0;for(var X;(X=z[P])!=null;P++)if(X)if(R^(X.className&&(" "+X.className+" ").replace(/[\t\n]/g," ").indexOf(q)>=
0))J||K.push(X);else if(J)z[P]=false;return false},ID:function(q){return q[1].replace(/\\/g,"")},TAG:function(q){return q[1].toLowerCase()},CHILD:function(q){if(q[1]==="nth"){var z=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(q[2]==="even"&&"2n"||q[2]==="odd"&&"2n+1"||!/\D/.test(q[2])&&"0n+"+q[2]||q[2]);q[2]=z[1]+(z[2]||1)-0;q[3]=z[3]-0}q[0]=n++;return q},ATTR:function(q,z,J,K,R,P){z=q[1].replace(/\\/g,"");if(!P&&L.attrMap[z])q[1]=L.attrMap[z];if(q[2]==="~=")q[4]=" "+q[4]+" ";return q},PSEUDO:function(q,z,J,K,
R){if(q[1]==="not")if((p.exec(q[3])||"").length>1||/^\w/.test(q[3]))q[3]=I(q[3],null,null,z);else{q=I.filter(q[3],z,J,true^R);J||K.push.apply(K,q);return false}else if(L.match.POS.test(q[0])||L.match.CHILD.test(q[0]))return true;return q},POS:function(q){q.unshift(true);return q}},filters:{enabled:function(q){return q.disabled===false&&q.type!=="hidden"},disabled:function(q){return q.disabled===true},checked:function(q){return q.checked===true},selected:function(q){return q.selected===true},parent:function(q){return!!q.firstChild},
empty:function(q){return!q.firstChild},has:function(q,z,J){return!!I(J[3],q).length},header:function(q){return/h\d/i.test(q.nodeName)},text:function(q){return"text"===q.type},radio:function(q){return"radio"===q.type},checkbox:function(q){return"checkbox"===q.type},file:function(q){return"file"===q.type},password:function(q){return"password"===q.type},submit:function(q){return"submit"===q.type},image:function(q){return"image"===q.type},reset:function(q){return"reset"===q.type},button:function(q){return"button"===
q.type||q.nodeName.toLowerCase()==="button"},input:function(q){return/input|select|textarea|button/i.test(q.nodeName)}},setFilters:{first:function(q,z){return z===0},last:function(q,z,J,K){return z===K.length-1},even:function(q,z){return z%2===0},odd:function(q,z){return z%2===1},lt:function(q,z,J){return z<J[3]-0},gt:function(q,z,J){return z>J[3]-0},nth:function(q,z,J){return J[3]-0===z},eq:function(q,z,J){return J[3]-0===z}},filter:{PSEUDO:function(q,z,J,K){var R=z[1],P=L.filters[R];if(P)return P(q,
J,z,K);else if(R==="contains")return(q.textContent||q.innerText||d([q])||"").indexOf(z[3])>=0;else if(R==="not"){z=z[3];J=0;for(K=z.length;J<K;J++)if(z[J]===q)return false;return true}else I.error("Syntax error, unrecognized expression: "+R)},CHILD:function(q,z){var J=z[1],K=q;switch(J){case "only":case "first":for(;K=K.previousSibling;)if(K.nodeType===1)return false;if(J==="first")return true;K=q;case "last":for(;K=K.nextSibling;)if(K.nodeType===1)return false;return true;case "nth":J=z[2];var R=
z[3];if(J===1&&R===0)return true;z=z[0];var P=q.parentNode;if(P&&(P.sizcache!==z||!q.nodeIndex)){var X=0;for(K=P.firstChild;K;K=K.nextSibling)if(K.nodeType===1)K.nodeIndex=++X;P.sizcache=z}q=q.nodeIndex-R;return J===0?q===0:q%J===0&&q/J>=0}},ID:function(q,z){return q.nodeType===1&&q.getAttribute("id")===z},TAG:function(q,z){return z==="*"&&q.nodeType===1||q.nodeName.toLowerCase()===z},CLASS:function(q,z){return(" "+(q.className||q.getAttribute("class"))+" ").indexOf(z)>-1},ATTR:function(q,z){var J=
z[1];q=L.attrHandle[J]?L.attrHandle[J](q):q[J]!=null?q[J]:q.getAttribute(J);J=q+"";var K=z[2];z=z[4];return q==null?K==="!=":K==="="?J===z:K==="*="?J.indexOf(z)>=0:K==="~="?(" "+J+" ").indexOf(z)>=0:!z?J&&q!==false:K==="!="?J!==z:K==="^="?J.indexOf(z)===0:K==="$="?J.substr(J.length-z.length)===z:K==="|="?J===z||J.substr(0,z.length+1)===z+"-":false},POS:function(q,z,J,K){var R=L.setFilters[z[2]];if(R)return R(q,J,z,K)}}},S=L.match.POS;for(var W in L.match){L.match[W]=new RegExp(L.match[W].source+/(?![^\[]*\])(?![^\(]*\))/.source);
L.leftMatch[W]=new RegExp(/(^(?:.|\r|\n)*?)/.source+L.match[W].source.replace(/\\(\d+)/g,function(q,z){return"\\"+(z-0+1)}))}var ca=function(q,z){q=Array.prototype.slice.call(q,0);if(z){z.push.apply(z,q);return z}return q};try{Array.prototype.slice.call(Q.documentElement.childNodes,0)}catch(fa){ca=function(q,z){z=z||[];if(C.call(q)==="[object Array]")Array.prototype.push.apply(z,q);else if(typeof q.length==="number")for(var J=0,K=q.length;J<K;J++)z.push(q[J]);else for(J=0;q[J];J++)z.push(q[J]);return z}}var ea;
if(Q.documentElement.compareDocumentPosition)ea=function(q,z){if(!q.compareDocumentPosition||!z.compareDocumentPosition){if(q==z)B=true;return q.compareDocumentPosition?-1:1}q=q.compareDocumentPosition(z)&4?-1:q===z?0:1;if(q===0)B=true;return q};else if("sourceIndex"in Q.documentElement)ea=function(q,z){if(!q.sourceIndex||!z.sourceIndex){if(q==z)B=true;return q.sourceIndex?-1:1}q=q.sourceIndex-z.sourceIndex;if(q===0)B=true;return q};else if(Q.createRange)ea=function(q,z){if(!q.ownerDocument||!z.ownerDocument){if(q==
z)B=true;return q.ownerDocument?-1:1}var J=q.ownerDocument.createRange(),K=z.ownerDocument.createRange();J.setStart(q,0);J.setEnd(q,0);K.setStart(z,0);K.setEnd(z,0);q=J.compareBoundaryPoints(Range.START_TO_END,K);if(q===0)B=true;return q};(function(){var q=Q.createElement("div"),z="script"+(new Date).getTime();q.innerHTML="<a name='"+z+"'/>";var J=Q.documentElement;J.insertBefore(q,J.firstChild);if(Q.getElementById(z)){L.find.ID=function(K,R,P){if(typeof R.getElementById!=="undefined"&&!P)return(R=
R.getElementById(K[1]))?R.id===K[1]||typeof R.getAttributeNode!=="undefined"&&R.getAttributeNode("id").nodeValue===K[1]?[R]:c:[]};L.filter.ID=function(K,R){var P=typeof K.getAttributeNode!=="undefined"&&K.getAttributeNode("id");return K.nodeType===1&&P&&P.nodeValue===R}}J.removeChild(q);J=q=null})();(function(){var q=Q.createElement("div");q.appendChild(Q.createComment(""));if(q.getElementsByTagName("*").length>0)L.find.TAG=function(z,J){J=J.getElementsByTagName(z[1]);if(z[1]==="*"){z=[];for(var K=
0;J[K];K++)J[K].nodeType===1&&z.push(J[K]);J=z}return J};q.innerHTML="<a href='#'></a>";if(q.firstChild&&typeof q.firstChild.getAttribute!=="undefined"&&q.firstChild.getAttribute("href")!=="#")L.attrHandle.href=function(z){return z.getAttribute("href",2)};q=null})();Q.querySelectorAll&&function(){var q=I,z=Q.createElement("div");z.innerHTML="<p class='TEST'></p>";if(!(z.querySelectorAll&&z.querySelectorAll(".TEST").length===0)){I=function(K,R,P,X){R=R||Q;if(!X&&R.nodeType===9&&!Z(R))try{return ca(R.querySelectorAll(K),
P)}catch(V){}return q(K,R,P,X)};for(var J in q)I[J]=q[J];z=null}}();(function(){var q=Q.createElement("div");q.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!q.getElementsByClassName||q.getElementsByClassName("e").length===0)){q.lastChild.className="e";if(q.getElementsByClassName("e").length!==1){L.order.splice(1,0,"CLASS");L.find.CLASS=function(z,J,K){if(typeof J.getElementsByClassName!=="undefined"&&!K)return J.getElementsByClassName(z[1])};q=null}}})();var pa=Q.compareDocumentPosition?
function(q,z){return!!(q.compareDocumentPosition(z)&16)}:function(q,z){return q!==z&&(q.contains?q.contains(z):true)},Z=function(q){return(q=(q?q.ownerDocument||q:0).documentElement)?q.nodeName!=="HTML":false},Ha=function(q,z){var J=[],K="",R;for(z=z.nodeType?[z]:z;R=L.match.PSEUDO.exec(q);){K+=R[0];q=q.replace(L.match.PSEUDO,"")}q=L.relative[q]?q+"*":q;R=0;for(var P=z.length;R<P;R++)I(q,z[R],J);return I.filter(K,J)};h.find=I;h.expr=I.selectors;h.expr[":"]=h.expr.filters;h.unique=I.uniqueSort;h.text=
d;h.isXMLDoc=Z;h.contains=pa})();var mb=/Until$/,nb=/^(?:parents|prevUntil|prevAll)/,ob=/,/;sa=Array.prototype.slice;var Za=function(d,f,k){if(h.isFunction(f))return h.grep(d,function(n,C){return!!f.call(n,C,n)===k});else if(f.nodeType)return h.grep(d,function(n){return n===f===k});else if(typeof f==="string"){var p=h.grep(d,function(n){return n.nodeType===1});if(G.test(f))return h.filter(f,p,!k);else f=h.filter(f,p)}return h.grep(d,function(n){return h.inArray(n,f)>=0===k})};h.fn.extend({find:function(d){for(var f=
this.pushStack("","find",d),k=0,p=0,n=this.length;p<n;p++){k=f.length;h.find(d,this[p],f);if(p>0)for(var C=k;C<f.length;C++)for(var B=0;B<k;B++)if(f[B]===f[C]){f.splice(C--,1);break}}return f},has:function(d){var f=h(d);return this.filter(function(){for(var k=0,p=f.length;k<p;k++)if(h.contains(this,f[k]))return true})},not:function(d){return this.pushStack(Za(this,d,false),"not",d)},filter:function(d){return this.pushStack(Za(this,d,true),"filter",d)},is:function(d){return!!d&&h.filter(d,this).length>
0},closest:function(d,f){if(h.isArray(d)){var k=[],p=this[0],n,C={},B;if(p&&d.length){n=0;for(var M=d.length;n<M;n++){B=d[n];C[B]||(C[B]=h.expr.match.POS.test(B)?h(B,f||this.context):B)}for(;p&&p.ownerDocument&&p!==f;){for(B in C){n=C[B];if(n.jquery?n.index(p)>-1:h(p).is(n)){k.push({selector:B,elem:p});delete C[B]}}p=p.parentNode}}return k}var I=h.expr.match.POS.test(d)?h(d,f||this.context):null;return this.map(function(L,S){for(;S&&S.ownerDocument&&S!==f;){if(I?I.index(S)>-1:h(S).is(d))return S;
S=S.parentNode}return null})},index:function(d){if(!d||typeof d==="string")return h.inArray(this[0],d?h(d):this.parent().children());return h.inArray(d.jquery?d[0]:d,this)},add:function(d,f){d=typeof d==="string"?h(d,f||this.context):h.makeArray(d);f=h.merge(this.get(),d);return this.pushStack(D(d[0])||D(f[0])?f:h.unique(f))},andSelf:function(){return this.add(this.prevObject)}});h.each({parent:function(d){return(d=d.parentNode)&&d.nodeType!==11?d:null},parents:function(d){return h.dir(d,"parentNode")},
parentsUntil:function(d,f,k){return h.dir(d,"parentNode",k)},next:function(d){return h.nth(d,2,"nextSibling")},prev:function(d){return h.nth(d,2,"previousSibling")},nextAll:function(d){return h.dir(d,"nextSibling")},prevAll:function(d){return h.dir(d,"previousSibling")},nextUntil:function(d,f,k){return h.dir(d,"nextSibling",k)},prevUntil:function(d,f,k){return h.dir(d,"previousSibling",k)},siblings:function(d){return h.sibling(d.parentNode.firstChild,d)},children:function(d){return h.sibling(d.firstChild)},
contents:function(d){return h.nodeName(d,"iframe")?d.contentDocument||d.contentWindow.document:h.makeArray(d.childNodes)}},function(d,f){h.fn[d]=function(k,p){var n=h.map(this,f,k);mb.test(d)||(p=k);if(p&&typeof p==="string")n=h.filter(p,n);n=this.length>1?h.unique(n):n;if((this.length>1||ob.test(p))&&nb.test(d))n=n.reverse();return this.pushStack(n,d,sa.call(arguments).join(","))}});h.extend({filter:function(d,f,k){if(k)d=":not("+d+")";return h.find.matches(d,f)},dir:function(d,f,k){var p=[];for(d=
d[f];d&&d.nodeType!==9&&(k===c||d.nodeType!==1||!h(d).is(k));){d.nodeType===1&&p.push(d);d=d[f]}return p},nth:function(d,f,k){f=f||1;for(var p=0;d;d=d[k])if(d.nodeType===1&&++p===f)break;return d},sibling:function(d,f){for(var k=[];d;d=d.nextSibling)d.nodeType===1&&d!==f&&k.push(d);return k}});var $a=/ jQuery\d+="(?:\d+|null)"/g,Ba=/^\s+/,ab=/(<([\w:]+)[^>]*?)\/>/g,pb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,bb=/<([\w:]+)/,qb=/<tbody/i,rb=/<|&#?\w+;/,Na=/<script|<object|<embed|<option|<style/i,
Oa=/checked\s*(?:[^=]|=\s*.checked.)/i,cb=function(d,f,k){return pb.test(k)?d:f+"></"+k+">"},qa={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,"",""]};qa.optgroup=qa.option;qa.tbody=qa.tfoot=qa.colgroup=qa.caption=qa.thead;qa.th=
qa.td;if(!h.support.htmlSerialize)qa._default=[1,"div<div>","</div>"];h.fn.extend({text:function(d){if(h.isFunction(d))return this.each(function(f){var k=h(this);k.text(d.call(this,f,k.text()))});if(typeof d!=="object"&&d!==c)return this.empty().append((this[0]&&this[0].ownerDocument||Q).createTextNode(d));return h.text(this)},wrapAll:function(d){if(h.isFunction(d))return this.each(function(k){h(this).wrapAll(d.call(this,k))});if(this[0]){var f=h(d,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&
f.insertBefore(this[0]);f.map(function(){for(var k=this;k.firstChild&&k.firstChild.nodeType===1;)k=k.firstChild;return k}).append(this)}return this},wrapInner:function(d){if(h.isFunction(d))return this.each(function(f){h(this).wrapInner(d.call(this,f))});return this.each(function(){var f=h(this),k=f.contents();k.length?k.wrapAll(d):f.append(d)})},wrap:function(d){return this.each(function(){h(this).wrapAll(d)})},unwrap:function(){return this.parent().each(function(){h.nodeName(this,"body")||h(this).replaceWith(this.childNodes)}).end()},
append:function(){return this.domManip(arguments,true,function(d){this.nodeType===1&&this.appendChild(d)})},prepend:function(){return this.domManip(arguments,true,function(d){this.nodeType===1&&this.insertBefore(d,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(f){this.parentNode.insertBefore(f,this)});else if(arguments.length){var d=h(arguments[0]);d.push.apply(d,this.toArray());return this.pushStack(d,"before",arguments)}},after:function(){if(this[0]&&
this[0].parentNode)return this.domManip(arguments,false,function(f){this.parentNode.insertBefore(f,this.nextSibling)});else if(arguments.length){var d=this.pushStack(this,"after",arguments);d.push.apply(d,h(arguments[0]).toArray());return d}},remove:function(d,f){for(var k=0,p;(p=this[k])!=null;k++)if(!d||h.filter(d,[p]).length){if(!f&&p.nodeType===1){h.cleanData(p.getElementsByTagName("*"));h.cleanData([p])}p.parentNode&&p.parentNode.removeChild(p)}return this},empty:function(){for(var d=0,f;(f=
this[d])!=null;d++)for(f.nodeType===1&&h.cleanData(f.getElementsByTagName("*"));f.firstChild;)f.removeChild(f.firstChild);return this},clone:function(d){var f=this.map(function(){if(!h.support.noCloneEvent&&!h.isXMLDoc(this)){var k=this.outerHTML,p=this.ownerDocument;if(!k){k=p.createElement("div");k.appendChild(this.cloneNode(true));k=k.innerHTML}return h.clean([k.replace($a,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(Ba,"")],p)[0]}else return this.cloneNode(true)});if(d===true){H(this,f);
H(this.find("*"),f.find("*"))}return f},html:function(d){if(d===c)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace($a,""):null;else if(typeof d==="string"&&!Na.test(d)&&(h.support.leadingWhitespace||!Ba.test(d))&&!qa[(bb.exec(d)||["",""])[1].toLowerCase()]){d=d.replace(ab,cb);try{for(var f=0,k=this.length;f<k;f++)if(this[f].nodeType===1){h.cleanData(this[f].getElementsByTagName("*"));this[f].innerHTML=d}}catch(p){this.empty().append(d)}}else h.isFunction(d)?this.each(function(n){var C=
h(this),B=C.html();C.empty().append(function(){return d.call(this,n,B)})}):this.empty().append(d);return this},replaceWith:function(d){if(this[0]&&this[0].parentNode){if(h.isFunction(d))return this.each(function(f){var k=h(this),p=k.html();k.replaceWith(d.call(this,f,p))});if(typeof d!=="string")d=h(d).detach();return this.each(function(){var f=this.nextSibling,k=this.parentNode;h(this).remove();f?h(f).before(d):h(k).append(d)})}else return this.pushStack(h(h.isFunction(d)?d():d),"replaceWith",d)},
detach:function(d){return this.remove(d,true)},domManip:function(d,f,k){function p(W){return h.nodeName(W,"table")?W.getElementsByTagName("tbody")[0]||W.appendChild(W.ownerDocument.createElement("tbody")):W}var n,C,B=d[0],M=[],I;if(!h.support.checkClone&&arguments.length===3&&typeof B==="string"&&Oa.test(B))return this.each(function(){h(this).domManip(d,f,k,true)});if(h.isFunction(B))return this.each(function(W){var ca=h(this);d[0]=B.call(this,W,f?ca.html():c);ca.domManip(d,f,k)});if(this[0]){n=B&&
B.parentNode;n=h.support.parentNode&&n&&n.nodeType===11&&n.childNodes.length===this.length?{fragment:n}:T(d,this,M);I=n.fragment;if(C=I.childNodes.length===1?(I=I.firstChild):I.firstChild){f=f&&h.nodeName(C,"tr");for(var L=0,S=this.length;L<S;L++)k.call(f?p(this[L],C):this[L],L>0||n.cacheable||this.length>1?I.cloneNode(true):I)}M.length&&h.each(M,g)}return this}});h.fragments={};h.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(d,
f){h.fn[d]=function(k){var p=[];k=h(k);var n=this.length===1&&this[0].parentNode;if(n&&n.nodeType===11&&n.childNodes.length===1&&k.length===1){k[f](this[0]);return this}else{n=0;for(var C=k.length;n<C;n++){var B=(n>0?this.clone(true):this).get();h.fn[f].apply(h(k[n]),B);p=p.concat(B)}return this.pushStack(p,d,k.selector)}}});h.extend({clean:function(d,f,k,p){f=f||Q;if(typeof f.createElement==="undefined")f=f.ownerDocument||f[0]&&f[0].ownerDocument||Q;for(var n=[],C=0,B;(B=d[C])!=null;C++){if(typeof B===
"number")B+="";if(B){if(typeof B==="string"&&!rb.test(B))B=f.createTextNode(B);else if(typeof B==="string"){B=B.replace(ab,cb);var M=(bb.exec(B)||["",""])[1].toLowerCase(),I=qa[M]||qa._default,L=I[0],S=f.createElement("div");for(S.innerHTML=I[1]+B+I[2];L--;)S=S.lastChild;if(!h.support.tbody){L=qb.test(B);M=M==="table"&&!L?S.firstChild&&S.firstChild.childNodes:I[1]==="<table>"&&!L?S.childNodes:[];for(I=M.length-1;I>=0;--I)h.nodeName(M[I],"tbody")&&!M[I].childNodes.length&&M[I].parentNode.removeChild(M[I])}!h.support.leadingWhitespace&&
Ba.test(B)&&S.insertBefore(f.createTextNode(Ba.exec(B)[0]),S.firstChild);B=S.childNodes}if(B.nodeType)n.push(B);else n=h.merge(n,B)}}if(k)for(C=0;n[C];C++)if(p&&h.nodeName(n[C],"script")&&(!n[C].type||n[C].type.toLowerCase()==="text/javascript"))p.push(n[C].parentNode?n[C].parentNode.removeChild(n[C]):n[C]);else{n[C].nodeType===1&&n.splice.apply(n,[C+1,0].concat(h.makeArray(n[C].getElementsByTagName("script"))));k.appendChild(n[C])}return n},cleanData:function(d){for(var f,k,p=h.cache,n=h.event.special,
C=h.support.deleteExpando,B=0,M;(M=d[B])!=null;B++)if(k=M[h.expando]){f=p[k];if(f.events)for(var I in f.events)n[I]?h.event.remove(M,I):Ta(M,I,f.handle);if(C)delete M[h.expando];else M.removeAttribute&&M.removeAttribute(h.expando);delete p[k]}}});var sb=/z-?index|font-?weight|opacity|zoom|line-?height/i,db=/alpha\([^)]*\)/,eb=/opacity=([^)]*)/,Ia=/float/i,Ja=/-([a-z])/ig,tb=/([A-Z])/g,ub=/^-?\d+(?:px)?$/i,vb=/^-?\d/,wb={position:"absolute",visibility:"hidden",display:"block"},xb=["Left","Right"],
yb=["Top","Bottom"],zb=Q.defaultView&&Q.defaultView.getComputedStyle,fb=h.support.cssFloat?"cssFloat":"styleFloat",Ka=function(d,f){return f.toUpperCase()};h.fn.css=function(d,f){return m(this,d,f,true,function(k,p,n){if(n===c)return h.curCSS(k,p);if(typeof n==="number"&&!sb.test(p))n+="px";h.style(k,p,n)})};h.extend({style:function(d,f,k){if(!d||d.nodeType===3||d.nodeType===8)return c;if((f==="width"||f==="height")&&parseFloat(k)<0)k=c;var p=d.style||d,n=k!==c;if(!h.support.opacity&&f==="opacity"){if(n){p.zoom=
1;f=parseInt(k,10)+""==="NaN"?"":"alpha(opacity="+k*100+")";d=p.filter||h.curCSS(d,"filter")||"";p.filter=db.test(d)?d.replace(db,f):f}return p.filter&&p.filter.indexOf("opacity=")>=0?parseFloat(eb.exec(p.filter)[1])/100+"":""}if(Ia.test(f))f=fb;f=f.replace(Ja,Ka);if(n)p[f]=k;return p[f]},css:function(d,f,k,p){if(f==="width"||f==="height"){var n,C=f==="width"?xb:yb;function B(){n=f==="width"?d.offsetWidth:d.offsetHeight;p!=="border"&&h.each(C,function(){p||(n-=parseFloat(h.curCSS(d,"padding"+this,
true))||0);if(p==="margin")n+=parseFloat(h.curCSS(d,"margin"+this,true))||0;else n-=parseFloat(h.curCSS(d,"border"+this+"Width",true))||0})}d.offsetWidth!==0?B():h.swap(d,wb,B);return Math.max(0,Math.round(n))}return h.curCSS(d,f,k)},curCSS:function(d,f,k){var p,n=d.style;if(!h.support.opacity&&f==="opacity"&&d.currentStyle){p=eb.test(d.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return p===""?"1":p}if(Ia.test(f))f=fb;if(!k&&n&&n[f])p=n[f];else if(zb){if(Ia.test(f))f="float";f=f.replace(tb,
"-$1").toLowerCase();n=d.ownerDocument.defaultView;if(!n)return null;if(d=n.getComputedStyle(d,null))p=d.getPropertyValue(f);if(f==="opacity"&&p==="")p="1"}else if(d.currentStyle){k=f.replace(Ja,Ka);p=d.currentStyle[f]||d.currentStyle[k];if(!ub.test(p)&&vb.test(p)){f=n.left;var C=d.runtimeStyle.left;d.runtimeStyle.left=d.currentStyle.left;n.left=k==="fontSize"?"1em":p||0;p=n.pixelLeft+"px";n.left=f;d.runtimeStyle.left=C}}return p},swap:function(d,f,k){var p={};for(var n in f){p[n]=d.style[n];d.style[n]=
f[n]}k.call(d);for(n in f)d.style[n]=p[n]}});if(h.expr&&h.expr.filters){h.expr.filters.hidden=function(d){var f=d.offsetWidth,k=d.offsetHeight,p=d.nodeName.toLowerCase()==="tr";return f===0&&k===0&&!p?true:f>0&&k>0&&!p?false:h.curCSS(d,"display")==="none"};h.expr.filters.visible=function(d){return!h.expr.filters.hidden(d)}}var Ab=l(),Bb=/<script(.|\s)*?\/script>/gi,Cb=/select|textarea/i,Db=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,xa=/=\?(&|$)/,
La=/\?/,Eb=/(\?|&)_=.*?(&|$)/,Fb=/^(\w+:)?\/\/([^\/?#]+)/,Gb=/%20/g,Hb=h.fn.load;h.fn.extend({load:function(d,f,k){if(typeof d!=="string")return Hb.call(this,d);else if(!this.length)return this;var p=d.indexOf(" ");if(p>=0){var n=d.slice(p,d.length);d=d.slice(0,p)}p="GET";if(f)if(h.isFunction(f)){k=f;f=null}else if(typeof f==="object"){f=h.param(f,h.ajaxSettings.traditional);p="POST"}var C=this;h.ajax({url:d,type:p,dataType:"html",data:f,complete:function(B,M){if(M==="success"||M==="notmodified")C.html(n?
h("<div />").append(B.responseText.replace(Bb,"")).find(n):B.responseText);k&&C.each(k,[B.responseText,M,B])}});return this},serialize:function(){return h.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?h.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Cb.test(this.nodeName)||Db.test(this.type))}).map(function(d,f){d=h(this).val();return d==null?null:h.isArray(d)?h.map(d,function(k){return{name:f.name,
value:k}}):{name:f.name,value:d}}).get()}});h.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(d,f){h.fn[f]=function(k){return this.bind(f,k)}});h.extend({get:function(d,f,k,p){if(h.isFunction(f)){p=p||k;k=f;f=null}return h.ajax({type:"GET",url:d,data:f,success:k,dataType:p})},getScript:function(d,f){return h.get(d,null,f,"script")},getJSON:function(d,f,k){return h.get(d,f,k,"json")},post:function(d,f,k,p){if(h.isFunction(f)){p=p||k;k=f;f={}}return h.ajax({type:"POST",
url:d,data:f,success:k,dataType:p})},ajaxSetup:function(d){h.extend(h.ajaxSettings,d)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:b.XMLHttpRequest&&(b.location.protocol!=="file:"||!b.ActiveXObject)?function(){return new b.XMLHttpRequest}:function(){try{return new b.ActiveXObject("Microsoft.XMLHTTP")}catch(d){}},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(d){function f(){n.success&&n.success.call(I,M,B,Z);n.global&&p("ajaxSuccess",[Z,n])}function k(){n.complete&&n.complete.call(I,Z,B);n.global&&p("ajaxComplete",[Z,n]);n.global&&!--h.active&&h.event.trigger("ajaxStop")}function p(R,P){(n.context?h(n.context):h.event).trigger(R,P)}var n=h.extend(true,{},h.ajaxSettings,d),C,B,M,I=d&&d.context||n,L=n.type.toUpperCase();if(n.data&&n.processData&&
typeof n.data!=="string")n.data=h.param(n.data,n.traditional);if(n.dataType==="jsonp"){if(L==="GET")xa.test(n.url)||(n.url+=(La.test(n.url)?"&":"?")+(n.jsonp||"callback")+"=?");else if(!n.data||!xa.test(n.data))n.data=(n.data?n.data+"&":"")+(n.jsonp||"callback")+"=?";n.dataType="json"}if(n.dataType==="json"&&(n.data&&xa.test(n.data)||xa.test(n.url))){C=n.jsonpCallback||"jsonp"+Ab++;if(n.data)n.data=(n.data+"").replace(xa,"="+C+"$1");n.url=n.url.replace(xa,"="+C+"$1");n.dataType="script";b[C]=b[C]||
function(R){M=R;f();k();b[C]=c;try{delete b[C]}catch(P){}ca&&ca.removeChild(fa)}}if(n.dataType==="script"&&n.cache===null)n.cache=false;if(n.cache===false&&L==="GET"){var S=l(),W=n.url.replace(Eb,"$1_="+S+"$2");n.url=W+(W===n.url?(La.test(n.url)?"&":"?")+"_="+S:"")}if(n.data&&L==="GET")n.url+=(La.test(n.url)?"&":"?")+n.data;n.global&&!h.active++&&h.event.trigger("ajaxStart");S=(S=Fb.exec(n.url))&&(S[1]&&S[1]!==location.protocol||S[2]!==location.host);if(n.dataType==="script"&&L==="GET"&&S){var ca=
Q.getElementsByTagName("head")[0]||Q.documentElement,fa=Q.createElement("script");fa.src=n.url;if(n.scriptCharset)fa.charset=n.scriptCharset;if(!C){var ea=false;fa.onload=fa.onreadystatechange=function(){if(!ea&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){ea=true;f();k();fa.onload=fa.onreadystatechange=null;ca&&fa.parentNode&&ca.removeChild(fa)}}}ca.insertBefore(fa,ca.firstChild);return c}var pa=false,Z=n.xhr();if(Z){n.username?Z.open(L,n.url,n.async,n.username,n.password):
Z.open(L,n.url,n.async);try{if(n.data||d&&d.contentType)Z.setRequestHeader("Content-Type",n.contentType);if(n.ifModified){h.lastModified[n.url]&&Z.setRequestHeader("If-Modified-Since",h.lastModified[n.url]);h.etag[n.url]&&Z.setRequestHeader("If-None-Match",h.etag[n.url])}S||Z.setRequestHeader("X-Requested-With","XMLHttpRequest");Z.setRequestHeader("Accept",n.dataType&&n.accepts[n.dataType]?n.accepts[n.dataType]+", */*":n.accepts._default)}catch(Ha){}if(n.beforeSend&&n.beforeSend.call(I,Z,n)===false){n.global&&
!--h.active&&h.event.trigger("ajaxStop");Z.abort();return false}n.global&&p("ajaxSend",[Z,n]);var q=Z.onreadystatechange=function(R){if(!Z||Z.readyState===0||R==="abort"){pa||k();pa=true;if(Z)Z.onreadystatechange=h.noop}else if(!pa&&Z&&(Z.readyState===4||R==="timeout")){pa=true;Z.onreadystatechange=h.noop;B=R==="timeout"?"timeout":!h.httpSuccess(Z)?"error":n.ifModified&&h.httpNotModified(Z,n.url)?"notmodified":"success";var P;if(B==="success")try{M=h.httpData(Z,n.dataType,n)}catch(X){B="parsererror";
P=X}if(B==="success"||B==="notmodified")C||f();else h.handleError(n,Z,B,P);k();R==="timeout"&&Z.abort();if(n.async)Z=null}};try{var z=Z.abort;Z.abort=function(){Z&&z.call(Z);q("abort")}}catch(J){}n.async&&n.timeout>0&&setTimeout(function(){Z&&!pa&&q("timeout")},n.timeout);try{Z.send(L==="POST"||L==="PUT"||L==="DELETE"?n.data:null)}catch(K){h.handleError(n,Z,null,K);k()}n.async||q();return Z}},handleError:function(d,f,k,p){if(d.error)d.error.call(d.context||d,f,k,p);if(d.global)(d.context?h(d.context):
h.event).trigger("ajaxError",[f,d,p])},active:0,httpSuccess:function(d){try{return!d.status&&location.protocol==="file:"||d.status>=200&&d.status<300||d.status===304||d.status===1223||d.status===0}catch(f){}return false},httpNotModified:function(d,f){var k=d.getResponseHeader("Last-Modified"),p=d.getResponseHeader("Etag");if(k)h.lastModified[f]=k;if(p)h.etag[f]=p;return d.status===304||d.status===0},httpData:function(d,f,k){var p=d.getResponseHeader("content-type")||"",n=f==="xml"||!f&&p.indexOf("xml")>=
0;d=n?d.responseXML:d.responseText;n&&d.documentElement.nodeName==="parsererror"&&h.error("parsererror");if(k&&k.dataFilter)d=k.dataFilter(d,f);if(typeof d==="string")if(f==="json"||!f&&p.indexOf("json")>=0)d=h.parseJSON(d);else if(f==="script"||!f&&p.indexOf("javascript")>=0)h.globalEval(d);return d},param:function(d,f){function k(B,M){if(h.isArray(M))h.each(M,function(I,L){f||/\[\]$/.test(B)?p(B,L):k(B+"["+(typeof L==="object"||h.isArray(L)?I:"")+"]",L)});else!f&&M!=null&&typeof M==="object"?h.each(M,
function(I,L){k(B+"["+I+"]",L)}):p(B,M)}function p(B,M){M=h.isFunction(M)?M():M;n[n.length]=encodeURIComponent(B)+"="+encodeURIComponent(M)}var n=[];if(f===c)f=h.ajaxSettings.traditional;if(h.isArray(d)||d.jquery)h.each(d,function(){p(this.name,this.value)});else for(var C in d)k(C,d[C]);return n.join("&").replace(Gb,"+")}});var Ma={},Ib=/toggle|show|hide/,Jb=/^([+-]=)?([\d+-.]+)(.*)$/,Ca,Pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft",
"paddingRight"],["opacity"]];h.fn.extend({show:function(d,f){if(d||d===0)return this.animate(F("show",3),d,f);else{d=0;for(f=this.length;d<f;d++){var k=h.data(this[d],"olddisplay");this[d].style.display=k||"";if(h.css(this[d],"display")==="none"){k=this[d].nodeName;var p;if(Ma[k])p=Ma[k];else{var n=h("<"+k+" />").appendTo("body");p=n.css("display");if(p==="none")p="block";n.remove();Ma[k]=p}h.data(this[d],"olddisplay",p)}}d=0;for(f=this.length;d<f;d++)this[d].style.display=h.data(this[d],"olddisplay")||
"";return this}},hide:function(d,f){if(d||d===0)return this.animate(F("hide",3),d,f);else{d=0;for(f=this.length;d<f;d++){var k=h.data(this[d],"olddisplay");!k&&k!=="none"&&h.data(this[d],"olddisplay",h.css(this[d],"display"))}d=0;for(f=this.length;d<f;d++)this[d].style.display="none";return this}},_toggle:h.fn.toggle,toggle:function(d,f){var k=typeof d==="boolean";if(h.isFunction(d)&&h.isFunction(f))this._toggle.apply(this,arguments);else d==null||k?this.each(function(){var p=k?d:h(this).is(":hidden");
h(this)[p?"show":"hide"]()}):this.animate(F("toggle",3),d,f);return this},fadeTo:function(d,f,k){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:f},d,k)},animate:function(d,f,k,p){var n=h.speed(f,k,p);if(h.isEmptyObject(d))return this.each(n.complete);return this[n.queue===false?"each":"queue"](function(){var C=h.extend({},n),B,M=this.nodeType===1&&h(this).is(":hidden"),I=this;for(B in d){var L=B.replace(Ja,Ka);if(B!==L){d[L]=d[B];delete d[B];B=L}if(d[B]==="hide"&&M||
d[B]==="show"&&!M)return C.complete.call(this);if((B==="height"||B==="width")&&this.style){C.display=h.css(this,"display");C.overflow=this.style.overflow}if(h.isArray(d[B])){(C.specialEasing=C.specialEasing||{})[B]=d[B][1];d[B]=d[B][0]}}if(C.overflow!=null)this.style.overflow="hidden";C.curAnim=h.extend({},d);h.each(d,function(S,W){var ca=new h.fx(I,C,S);if(Ib.test(W))ca[W==="toggle"?M?"show":"hide":W](d);else{var fa=Jb.exec(W),ea=ca.cur(true)||0;if(fa){W=parseFloat(fa[2]);var pa=fa[3]||"px";if(pa!==
"px"){I.style[S]=(W||1)+pa;ea=(W||1)/ca.cur(true)*ea;I.style[S]=ea+pa}if(fa[1])W=(fa[1]==="-="?-1:1)*W+ea;ca.custom(ea,W,pa)}else ca.custom(ea,W,"")}});return true})},stop:function(d,f){var k=h.timers;d&&this.queue([]);this.each(function(){for(var p=k.length-1;p>=0;p--)if(k[p].elem===this){f&&k[p](true);k.splice(p,1)}});f||this.dequeue();return this}});h.each({slideDown:F("show",1),slideUp:F("hide",1),slideToggle:F("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(d,f){h.fn[d]=
function(k,p){return this.animate(f,k,p)}});h.extend({speed:function(d,f,k){var p=d&&typeof d==="object"?d:{complete:k||!k&&f||h.isFunction(d)&&d,duration:d,easing:k&&f||f&&!h.isFunction(f)&&f};p.duration=h.fx.off?0:typeof p.duration==="number"?p.duration:h.fx.speeds[p.duration]||h.fx.speeds._default;p.old=p.complete;p.complete=function(){p.queue!==false&&h(this).dequeue();h.isFunction(p.old)&&p.old.call(this)};return p},easing:{linear:function(d,f,k,p){return k+p*d},swing:function(d,f,k,p){return(-Math.cos(d*
Math.PI)/2+0.5)*p+k}},timers:[],fx:function(d,f,k){this.options=f;this.elem=d;this.prop=k;if(!f.orig)f.orig={}}});h.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(h.fx.step[this.prop]||h.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(d){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(d=parseFloat(h.css(this.elem,
this.prop,d)))&&d>-10000?d:parseFloat(h.curCSS(this.elem,this.prop))||0},custom:function(d,f,k){function p(C){return n.step(C)}this.startTime=l();this.start=d;this.end=f;this.unit=k||this.unit||"px";this.now=this.start;this.pos=this.state=0;var n=this;p.elem=this.elem;if(p()&&h.timers.push(p)&&!Ca)Ca=setInterval(h.fx.tick,13)},show:function(){this.options.orig[this.prop]=h.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());h(this.elem).show()},
hide:function(){this.options.orig[this.prop]=h.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(d){var f=l(),k=true;if(d||f>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var p in this.options.curAnim)if(this.options.curAnim[p]!==true)k=false;if(k){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;d=h.data(this.elem,"olddisplay");this.elem.style.display=
d?d:this.options.display;if(h.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&h(this.elem).hide();if(this.options.hide||this.options.show)for(var n in this.options.curAnim)h.style(this.elem,n,this.options.orig[n]);this.options.complete.call(this.elem)}return false}else{n=f-this.startTime;this.state=n/this.options.duration;d=this.options.easing||(h.easing.swing?"swing":"linear");this.pos=h.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||
d](this.state,n,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};h.extend(h.fx,{tick:function(){for(var d=h.timers,f=0;f<d.length;f++)d[f]()||d.splice(f--,1);d.length||h.fx.stop()},stop:function(){clearInterval(Ca);Ca=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(d){h.style(d.elem,"opacity",d.now)},_default:function(d){if(d.elem.style&&d.elem.style[d.prop]!=null)d.elem.style[d.prop]=(d.prop==="width"||d.prop==="height"?
Math.max(0,d.now):d.now)+d.unit;else d.elem[d.prop]=d.now}}});if(h.expr&&h.expr.filters)h.expr.filters.animated=function(d){return h.grep(h.timers,function(f){return d===f.elem}).length};h.fn.offset="getBoundingClientRect"in Q.documentElement?function(d){var f=this[0];if(d)return this.each(function(n){h.offset.setOffset(this,d,n)});if(!f||!f.ownerDocument)return null;if(f===f.ownerDocument.body)return h.offset.bodyOffset(f);var k=f.getBoundingClientRect(),p=f.ownerDocument;f=p.body;p=p.documentElement;
return{top:k.top+(self.pageYOffset||h.support.boxModel&&p.scrollTop||f.scrollTop)-(p.clientTop||f.clientTop||0),left:k.left+(self.pageXOffset||h.support.boxModel&&p.scrollLeft||f.scrollLeft)-(p.clientLeft||f.clientLeft||0)}}:function(d){var f=this[0];if(d)return this.each(function(S){h.offset.setOffset(this,d,S)});if(!f||!f.ownerDocument)return null;if(f===f.ownerDocument.body)return h.offset.bodyOffset(f);h.offset.initialize();var k=f.offsetParent,p=f,n=f.ownerDocument,C,B=n.documentElement,M=n.body;
p=(n=n.defaultView)?n.getComputedStyle(f,null):f.currentStyle;for(var I=f.offsetTop,L=f.offsetLeft;(f=f.parentNode)&&f!==M&&f!==B;){if(h.offset.supportsFixedPosition&&p.position==="fixed")break;C=n?n.getComputedStyle(f,null):f.currentStyle;I-=f.scrollTop;L-=f.scrollLeft;if(f===k){I+=f.offsetTop;L+=f.offsetLeft;if(h.offset.doesNotAddBorder&&!(h.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(f.nodeName))){I+=parseFloat(C.borderTopWidth)||0;L+=parseFloat(C.borderLeftWidth)||0}p=k;k=f.offsetParent}if(h.offset.subtractsBorderForOverflowNotVisible&&
C.overflow!=="visible"){I+=parseFloat(C.borderTopWidth)||0;L+=parseFloat(C.borderLeftWidth)||0}p=C}if(p.position==="relative"||p.position==="static"){I+=M.offsetTop;L+=M.offsetLeft}if(h.offset.supportsFixedPosition&&p.position==="fixed"){I+=Math.max(B.scrollTop,M.scrollTop);L+=Math.max(B.scrollLeft,M.scrollLeft)}return{top:I,left:L}};h.offset={initialize:function(){var d=Q.body,f=Q.createElement("div"),k,p,n,C=parseFloat(h.curCSS(d,"marginTop",true))||0;h.extend(f.style,{position:"absolute",top:0,
left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});f.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>";d.insertBefore(f,d.firstChild);k=f.firstChild;p=k.firstChild;n=k.nextSibling.firstChild.firstChild;this.doesNotAddBorder=p.offsetTop!==
5;this.doesAddBorderForTableAndCells=n.offsetTop===5;p.style.position="fixed";p.style.top="20px";this.supportsFixedPosition=p.offsetTop===20||p.offsetTop===15;p.style.position=p.style.top="";k.style.overflow="hidden";k.style.position="relative";this.subtractsBorderForOverflowNotVisible=p.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=d.offsetTop!==C;d.removeChild(f);h.offset.initialize=h.noop},bodyOffset:function(d){var f=d.offsetTop,k=d.offsetLeft;h.offset.initialize();if(h.offset.doesNotIncludeMarginInBodyOffset){f+=
parseFloat(h.curCSS(d,"marginTop",true))||0;k+=parseFloat(h.curCSS(d,"marginLeft",true))||0}return{top:f,left:k}},setOffset:function(d,f,k){if(/static/.test(h.curCSS(d,"position")))d.style.position="relative";var p=h(d),n=p.offset(),C=parseInt(h.curCSS(d,"top",true),10)||0,B=parseInt(h.curCSS(d,"left",true),10)||0;if(h.isFunction(f))f=f.call(d,k,n);k={top:f.top-n.top+C,left:f.left-n.left+B};"using"in f?f.using.call(d,k):p.css(k)}};h.fn.extend({position:function(){if(!this[0])return null;var d=this[0],
f=this.offsetParent(),k=this.offset(),p=/^body|html$/i.test(f[0].nodeName)?{top:0,left:0}:f.offset();k.top-=parseFloat(h.curCSS(d,"marginTop",true))||0;k.left-=parseFloat(h.curCSS(d,"marginLeft",true))||0;p.top+=parseFloat(h.curCSS(f[0],"borderTopWidth",true))||0;p.left+=parseFloat(h.curCSS(f[0],"borderLeftWidth",true))||0;return{top:k.top-p.top,left:k.left-p.left}},offsetParent:function(){return this.map(function(){for(var d=this.offsetParent||Q.body;d&&!/^body|html$/i.test(d.nodeName)&&h.css(d,
"position")==="static";)d=d.offsetParent;return d})}});h.each(["Left","Top"],function(d,f){var k="scroll"+f;h.fn[k]=function(p){var n=this[0],C;if(!n)return null;return p!==c?this.each(function(){if(C=N(this))C.scrollTo(!d?p:h(C).scrollLeft(),d?p:h(C).scrollTop());else this[k]=p}):(C=N(n))?"pageXOffset"in C?C[d?"pageYOffset":"pageXOffset"]:h.support.boxModel&&C.document.documentElement[k]||C.document.body[k]:n[k]}});h.each(["Height","Width"],function(d,f){var k=f.toLowerCase();h.fn["inner"+f]=function(){return this[0]?
h.css(this[0],k,false,"padding"):null};h.fn["outer"+f]=function(p){return this[0]?h.css(this[0],k,false,p?"margin":"border"):null};h.fn[k]=function(p){var n=this[0];if(!n)return p==null?null:this;if(h.isFunction(p))return this.each(function(C){var B=h(this);B[k](p.call(this,C,B[k]()))});return"scrollTo"in n&&n.document?n.document.compatMode==="CSS1Compat"&&n.document.documentElement["client"+f]||n.document.body["client"+f]:n.nodeType===9?Math.max(n.documentElement["client"+f],n.body["scroll"+f],n.documentElement["scroll"+
f],n.body["offset"+f],n.documentElement["offset"+f]):p===c?h.css(n,k):this.css(k,typeof p==="string"?p:p+"px")}});b.jQuery=b.$=h})(window);a=String.prototype;a.singular=function(){var b=this.length;if(this.substr(b-3)=="ies")return this.substr(0,b-3)+"y";if(this.substr(b-2)=="es"&&this.toString()!="files")return this.substr(0,b-2);if(this.substr(b-1)=="s")return this.substr(0,b-1);return this};
a.plural=function(){var b=this.length;if(this=="litigation"||this.substr(b-2)=="es")return this;if(this.substr(b-1)=="y")return this.substr(0,b-1)+"ies";if(this.substr(b-1)=="s"||this.substr(b-2)=="ch")return this+"es";return this+"s"};a.capitalize=function(){return this.substr(0,1).toUpperCase()+this.substr(1)};
a.substitute_plaintext_chars=function(){return this.replace(/[|]+/g,"%X1").replace(/[\u201D|\u201C]/g,'"').replace(/[\u2018|\u2019|\u201a|\u201b]/g,"'").replace(/\x0A/g,"").replace(/(%X1)+/g,"|")};a.contains_illegal_chars=function(){for(var b=this,c=0;c<b.length;c++)if(b.charCodeAt(c)<32||b.charCodeAt(c)>=128)return true;return false};a.truncate=function(b,c){if(this.length<=b)return this;return c!=false?b<4?this.substring(0,b):this.substring(0,b-3)+"...":this.substring(0,b)};a.first_word=function(){return this.split(" ")[0]};
a.is_email=function(){return this.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)!=null};a.type_name2num=function(){console.log(this.toString());var b=this;switch(this.toString()){case "project":b=1;break;case "savedsearch":b=2;break;case "patent":b=3;break;case "company":b=4;break;case "litigation":b=5;break;case "person":b=6;break;case "file":b=7;break;case "trademark":b=8;break}return b};
a.type_num2name=function(){var b=this;switch(this.toString()){case 1:b="project";break;case 2:b="savedsearch";break;case 3:b="patent";break;case 4:b="company";break;case 5:b="litigation";break;case 6:b="person";break;case 7:b="file";break;case 8:b="trademark";break}return b};
a.stem=function(){var b={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""};return function(){w=this.toString();var e,g,m,l,x;if(w.length<3)return w;m=w.substr(0,1);if(m=="y")w=m.toUpperCase()+w.substr(1);l=/^(.+?)(ss|i)es$/;g=/^(.+?)([^s])s$/;
if(l.test(w))w=w.replace(l,"$1$2");else if(g.test(w))w=w.replace(g,"$1$2");l=/^(.+?)eed$/;g=/^(.+?)(ed|ing)$/;if(l.test(w)){g=l.exec(w);l=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*/;if(l.test(g[1])){l=/.$/;w=w.replace(l,"")}}else if(g.test(w)){g=g.exec(w);e=g[1];g=/^([^aeiou][^aeiouy]*)?[aeiouy]/;if(g.test(e)){w=e;g=/(at|bl|iz)$/;x=/([^aeiouylsz])\1$/;e=/^[^aeiou][^aeiouy]*[aeiouy][^aeiouwxy]$/;if(g.test(w))w+="e";else if(x.test(w)){l=/.$/;w=w.replace(l,"")}else if(e.test(w))w+="e"}}l=
/^(.+?)y$/;if(l.test(w)){g=l.exec(w);e=g[1];l=/^([^aeiou][^aeiouy]*)?[aeiouy]/;if(l.test(e))w=e+"i"}l=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;if(l.test(w)){g=l.exec(w);e=g[1];g=g[2];l=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*/;if(l.test(e))w=e+b[g]}l=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;if(l.test(w)){g=l.exec(w);e=g[1];g=g[2];l=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*/;
if(l.test(e))w=e+c[g]}l=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;g=/^(.+?)(s|t)(ion)$/;if(l.test(w)){g=l.exec(w);e=g[1];l=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/;if(l.test(e))w=e}else if(g.test(w)){g=g.exec(w);e=g[1]+g[2];g=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/;if(g.test(e))w=e}l=/^(.+?)e$/;if(l.test(w)){g=l.exec(w);e=g[1];l=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/;
g=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$/;x=/^[^aeiou][^aeiouy]*[aeiouy][^aeiouwxy]$/;if(l.test(e)||g.test(e)&&!x.test(e))w=e}l=/ll$/;g=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/;if(l.test(w)&&g.test(w)){l=/.$/;w=w.replace(l,"")}if(m=="y")w=m.toLowerCase()+w.substr(1);return w}}();Array.remove=function(b,c,e){e=b.slice((e||c)+1||b.length);b.length=c<0?b.length+c:c;return b.push.apply(b,e)};
Array.clean=function(b,c){for(var e=0;e<b.length;e++)if(b[e]==c){b.splice(e,1);e--}return b};Date.getUniversalDate=function(b){if(b===null)return"N/A";var c=b.getUTCDate();if(c<10)c="0"+c;var e=b.getUTCMonth()+1;if(e<10)e="0"+e;return e+"-"+c+"-"+b.getUTCFullYear()};Date.getLocalDate=function(){};
jQuery.ui||function(b){function c(u,t,A,D){function H(F){F=b[u][t][F]||[];return typeof F=="string"?F.split(/,?\s+/):F}var T=H("getter");if(D.length==1&&typeof D[0]=="string")T=T.concat(H("getterSetter"));return b.inArray(A,T)!=-1}var e=b.fn.remove,g=b.browser.mozilla&&parseFloat(b.browser.version)<1.9;b.ui={version:"1.7.1",plugin:{add:function(u,t,A){u=b.ui[u].prototype;for(var D in A){u.plugins[D]=u.plugins[D]||[];u.plugins[D].push([t,A[D]])}},call:function(u,t,A){if((t=u.plugins[t])&&u.element[0].parentNode)for(var D=
0;D<t.length;D++)u.options[t[D][0]]&&t[D][1].apply(u.element,A)}},contains:function(u,t){return document.compareDocumentPosition?u.compareDocumentPosition(t)&16:u!==t&&u.contains(t)},hasScroll:function(u,t){if(b(u).css("overflow")=="hidden")return false;t=t&&t=="left"?"scrollLeft":"scrollTop";var A=false;if(u[t]>0)return true;u[t]=1;A=u[t]>0;u[t]=0;return A},isOverAxis:function(u,t,A){return u>t&&u<t+A},isOver:function(u,t,A,D,H,T){return b.ui.isOverAxis(u,A,H)&&b.ui.isOverAxis(t,D,T)},keyCode:{BACKSPACE:8,
CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(g){var m=b.attr,l=b.fn.removeAttr,x=/^aria-/,s=/^wairole:/;b.attr=function(u,t,A){var D=A!==undefined;return t=="role"?D?m.call(this,u,t,"wairole:"+A):(m.apply(this,arguments)||"").replace(s,""):x.test(t)?D?u.setAttributeNS("http://www.w3.org/2005/07/aaa",
t.replace(x,"aaa:"),A):m.call(this,u,t.replace(x,"aaa:")):m.apply(this,arguments)};b.fn.removeAttr=function(u){return x.test(u)?this.each(function(){this.removeAttributeNS("http://www.w3.org/2005/07/aaa",u.replace(x,""))}):l.call(this,u)}}b.fn.extend({remove:function(){b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return e.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable",
"on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var u;u=b.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(b.curCSS(this,"position",1))&&/(auto|scroll)/.test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(b.curCSS(this,
"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!u.length?b(document):u}});b.extend(b.expr[":"],{data:function(u,t,A){return!!b.data(u,A[3])},focusable:function(u){var t=u.nodeName.toLowerCase(),A=b.attr(u,"tabindex");return(/input|select|textarea|button|object/.test(t)?!u.disabled:"a"==t||"area"==t?u.href||!isNaN(A):!isNaN(A))&&!b(u)["area"==t?"parents":"closest"](":hidden").length},tabbable:function(u){var t=b.attr(u,"tabindex");
return(isNaN(t)||t>=0)&&b(u).is(":focusable")}});b.widget=function(u,t){var A=u.split(".")[0];u=u.split(".")[1];b.fn[u]=function(D){var H=typeof D=="string",T=Array.prototype.slice.call(arguments,1);if(H&&D.substring(0,1)=="_")return this;if(H&&c(A,u,D,T)){var F=b.data(this[0],u);return F?F[D].apply(F,T):undefined}return this.each(function(){var N=b.data(this,u);!N&&!H&&b.data(this,u,new b[A][u](this,D))._init();N&&H&&b.isFunction(N[D])&&N[D].apply(N,T)})};b[A]=b[A]||{};b[A][u]=function(D,H){var T=
this;this.namespace=A;this.widgetName=u;this.widgetEventPrefix=b[A][u].eventPrefix||u;this.widgetBaseClass=A+"-"+u;this.options=b.extend({},b.widget.defaults,b[A][u].defaults,b.metadata&&b.metadata.get(D)[u],H);this.element=b(D).bind("setData."+u,function(F,N,h){if(F.target==D)return T._setData(N,h)}).bind("getData."+u,function(F,N){if(F.target==D)return T._getData(N)}).bind("remove",function(){return T.destroy()})};b[A][u].prototype=b.extend({},b.widget.prototype,t);b[A][u].getterSetter="option"};
b.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(u,t){var A=u,D=this;if(typeof u=="string"){if(t===undefined)return this._getData(u);A={};A[u]=t}b.each(A,function(H,T){D._setData(H,T)})},_getData:function(u){return this.options[u]},_setData:function(u,t){this.options[u]=t;if(u=="disabled")this.element[t?"addClass":"removeClass"](this.widgetBaseClass+
"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",t)},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(u,t,A){var D=this.options[u];u=u==this.widgetEventPrefix?u:this.widgetEventPrefix+u;t=b.Event(t);t.type=u;if(t.originalEvent){u=b.event.props.length;for(var H;u;){H=b.event.props[--u];t[H]=t.originalEvent[H]}}this.element.trigger(t,A);return!(b.isFunction(D)&&D.call(this.element[0],t,A)===false||t.isDefaultPrevented())}};
b.widget.defaults={disabled:false};b.ui.mouse={_mouseInit:function(){var u=this;this.element.bind("mousedown."+this.widgetName,function(t){return u._mouseDown(t)}).bind("click."+this.widgetName,function(t){if(u._preventClickEvent){u._preventClickEvent=false;t.stopImmediatePropagation();return false}});if(b.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);
b.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable)},_mouseDown:function(u){u.originalEvent=u.originalEvent||{};if(!u.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(u);this._mouseDownEvent=u;var t=this,A=u.which==1,D=typeof this.options.cancel=="string"?b(u.target).parents().add(u.target).filter(this.options.cancel).length:false;if(!A||D||!this._mouseCapture(u))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){t.mouseDelayMet=
true},this.options.delay);if(this._mouseDistanceMet(u)&&this._mouseDelayMet(u)){this._mouseStarted=this._mouseStart(u)!==false;if(!this._mouseStarted){u.preventDefault();return true}}this._mouseMoveDelegate=function(H){return t._mouseMove(H)};this._mouseUpDelegate=function(H){return t._mouseUp(H)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);b.browser.safari||u.preventDefault();return u.originalEvent.mouseHandled=true}},
_mouseMove:function(u){if(b.browser.msie&&!u.button)return this._mouseUp(u);if(this._mouseStarted){this._mouseDrag(u);return u.preventDefault()}if(this._mouseDistanceMet(u)&&this._mouseDelayMet(u))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,u)!==false)?this._mouseDrag(u):this._mouseUp(u);return!this._mouseStarted},_mouseUp:function(u){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
false;this._preventClickEvent=u.target==this._mouseDownEvent.target;this._mouseStop(u)}return false},_mouseDistanceMet:function(u){return Math.max(Math.abs(this._mouseDownEvent.pageX-u.pageX),Math.abs(this._mouseDownEvent.pageY-u.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}};b.ui.mouse.defaults={cancel:null,distance:1,delay:0}}(jQuery);
(function(b){b.fn.jqm=function(H){fadeSpeed=250;jqmcallback=function(){};var T={overlay:50,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:l,ajaxText:"",target:l,modal:l,toTop:l,onShow:l,onHide:l,onLoad:l};return this.each(function(){if(this._jqm)return e[this._jqm].c=b.extend({},e[this._jqm].c,H);c++;this._jqm=c;e[c]={c:b.extend(T,b.jqm.params,H),a:l,w:b(this).addClass("jqmID"+c),s:c};T.trigger&&b(this).jqmAddTrigger(T.trigger)})};b.fn.jqmAddClose=function(H){return D(this,
H,"jqmHide")};b.fn.jqmAddTrigger=function(H){return D(this,H,"jqmShow")};b.fn.jqmShow=function(H){return this.each(function(){b.jqm.open(this._jqm,H)})};b.fn.jqmHide=function(H,T){return this.each(function(){b.jqm.close(this._jqm,H,T)})};b.jqm={hash:{},open:function(H,T){var F=e[H],N=F.c,h="."+N.closeClass,Y=parseInt(F.w.css("z-index"));Y=Y>0?Y:3E3;var E=b("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":Y-1,opacity:N.overlay/100});if(F.a)return l;F.t=T;F.a=true;
F.w.css("z-index",Y);if(N.modal){g[0]||t("bind");g.push(H)}else if(N.overlay>0)F.w.jqmAddClose(E);else E=l;F.o=E?E.addClass(N.overlayClass).prependTo("body").hide().fadeIn(fadeSpeed,jqmcallback):l;if(m){b("html,body").css({height:"100%",width:"100%"});if(E){E=E.css({position:"absolute"})[0];for(var Q in{Top:1,Left:1})E.style.setExpression(Q.toLowerCase(),"(_=(document.documentElement.scroll"+Q+" || document.body.scroll"+Q+"))+'px'")}}if(N.ajax){H=N.target||F.w;Y=N.ajax;H=typeof H=="string"?b(H,F.w):
b(H);Y=Y.substr(0,1)=="@"?b(T).attr(Y.substring(1)):Y;H.html(N.ajaxText).load(Y,function(){N.onLoad&&N.onLoad.call(this,F);h&&F.w.jqmAddClose(b(h,F.w));s(F)})}else h&&F.w.jqmAddClose(b(h,F.w));N.toTop&&F.o&&F.w.before('<span id="jqmP'+F.w[0]._jqm+'"></span>').insertAfter(F.o);N.onShow?N.onShow(F):F.w.fadeIn(fadeSpeed,jqmcallback);s(F);return l},close:function(H,T){if(typeof T!="function")T=function(){};H=e[H];if(!H.a)return l;H.a=l;if(g[0]){g.pop();g[0]||t("unbind")}H.c.toTop&&H.o&&b("#jqmP"+H.w[0]._jqm).after(H.w).remove();
if(H.c.onHide)H.c.onHide(H);else{H.w.fadeOut(fadeSpeed,T);H.o&&H.o.fadeOut(fadeSpeed,function(){b(this).remove()})}return l},params:{}};var c=0,e=b.jqm.hash,g=[],m=b.browser.msie&&b.browser.version=="6.0",l=false,x=b('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),s=function(H){if(m)if(H.o)H.o.html('<p style="width:100%;height:100%"/>').prepend(x);else b("iframe.jqm",H.w)[0]||H.w.prepend(x);u(H)},u=function(H){try{b(":input:visible",H.w)[0].focus()}catch(T){}},
t=function(H){b()[H]("keypress",A)[H]("keydown",A)[H]("mousedown",A)},A=function(H){var T=e[g[g.length-1]];(H=!b(H.target).parents(".jqmID"+T.s)[0])&&u(T);return!H},D=function(H,T,F){return H.each(function(){var N=this._jqm;b(T).each(function(){if(!this[F]){this[F]=[];b(this).click(function(){for(var h in{jqmShow:1,jqmHide:1})for(var Y in this[h])e[this[h][Y]]&&e[this[h][Y]].w[h](this);return l})}this[F].push(N)})})}})(jQuery);
jQuery.cookie=function(b,c,e){if(typeof c!="undefined"){e=e||{};if(c===null){c="";e.expires=-1}var g="";if(e.expires&&(typeof e.expires=="number"||e.expires.toUTCString)){if(typeof e.expires=="number"){g=new Date;g.setTime(g.getTime()+e.expires*24*60*60*1E3)}else g=e.expires;g="; expires="+g.toUTCString()}var m=e.path?"; path="+e.path:"",l=e.domain?"; domain="+e.domain:"";e=e.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(c),g,m,l,e].join("")}else{c=null;if(document.cookie&&document.cookie!=
""){e=document.cookie.split(";");for(g=0;g<e.length;g++){m=jQuery.trim(e[g]);if(m.substring(0,b.length+1)==b+"="){c=decodeURIComponent(m.substring(b.length+1));break}}}return c}};
jQuery.cookie.json=function(b,c,e){var g=$.cookie(b);g=g?JSON.parse(g):{};if(e==undefined)return c!=undefined?g[c]:g;else if(c!=undefined&&e!=undefined){var m=$.extend({expires:90,path:"/"},m);typeof g==="object"&&!(g instanceof Array)&&g!==null||console.log("cookie must be an object");g[c]=e;g=JSON.stringify(g);return $.cookie(b,g,m)}};var HISTORY_ACTIVATED_ROUTER=false;
(function(b){b.ajaxHistory=new (function(){var c=location.hash,e=null,g;this.update=function(){};var m=function(){b(".remote-output").empty()};b(document).bind("history.reset",m);if(b.browser.msie){var l,x=false;b(function(){l=b('<iframe src="/blank.html" style="display:none;"></iframe>').appendTo(document.body).get(0);var D=l.contentWindow.document;D.open();D.close();if(c&&c!="#")D.location.hash=c.replace("#","")});this.update=function(D){b(document).trigger("history.click");c=D;var H=l.contentWindow.document;
H.open();H.close();H.location.hash=D.replace("#","")};g=function(){var D=l.contentWindow.document.location.hash;if(D!=c){b(document).trigger("history.forwardback");HISTORY_ACTIVATED_ROUTER=true;if((c=D)&&D!="#"){b('a[href$="'+D+'"]').click();router.hash(D)}else if(x){router.hash("");b(document).trigger("history.reset")}}x=true}}else if(b.browser.mozilla||b.browser.opera){this.update=function(D){b(document).trigger("history.click");c=D};g=function(){if(location.hash){var D=location.hash;D=D.replace(/[']+/g,
"%27");if(c!=D){b(document).trigger("history.forwardback");c=D;D=!c.contains_illegal_chars()?b('a[href$="'+c.replace(/"/g,'\\"')+'"]'):"";if(D.length)D.click();else{HISTORY_ACTIVATED_ROUTER=true;router.init()}}}else if(c){c="";b(document).trigger("history.reset")}}}else if(b.browser.safari){var s,u,t;b(function(){s=[];s.length=history.length;u=[]});var A=false;x=false;t=function(D){s.push(D);u.length=0;A=false};this.update=function(D){b(document).trigger("history.click");c=D;t(c)};g=function(){var D=
history.length-s.length;if(D){b(document).trigger("history.forwardback");A=false;if(D<0)for(var H=0;H<Math.abs(D);H++)u.unshift(s.pop());else for(H=0;H<D;H++)s.push(u.shift());D=b('a[href$="'+s[s.length-1]+'"]');if(D.length)D.click();else{HISTORY_ACTIVATED_ROUTER=true;router.init()}c=location.hash}else if(s[s.length-1]==undefined&&!A){if(document.URL.indexOf("#")>=0)b('a[href$="#'+document.URL.split("#")[1]+'"]').click();else x&&b(document).trigger("history.reset");A=true}x=true}}this.initialize=
function(D){typeof D=="function"&&b(document).unbind("history.reset",m).bind("history.reset",D);if(location.hash&&typeof t=="undefined")if(!location.hash.contains_illegal_chars()){D=b('a[href$="'+location.hash.replace(/"/g,'\\"')+'"]');D.length?D.trigger("click"):router.init()}if(g&&e==null)e=setInterval(g,200)}});b.fn.remote=function(c,e,g){g=g||function(){};if(typeof e=="function")g=e;e=b.extend({hashPrefix:"remote-"},e||{});var m=b(c).size()&&b(c)||b("<div></div>").appendTo("body");m.addClass("remote-output");
return this.each(function(l){var x=this.href,s="#"+(this.title&&this.title.replace(/\s/g,"_")||e.hashPrefix+(l+1)),u=this;this.href=s;b(this).click(function(t){if(!m.locked){t.clientX&&b.ajaxHistory.update(s);m.load(x,function(){m.locked=null;g.apply(u)})}})})};b.fn.history=function(c){return this.click(function(e){if(e.clientX){if(this.hash==location.hash)return false;b.ajaxHistory.update(this.hash)}typeof c=="function"&&c.call(this)})}})(jQuery);
(function(b){var c=function(g){g=g.replace(/\x0d\x0a/g,"\n");for(var m="",l=0;l<g.length;l++){var x=g.charCodeAt(l);if(x<128)m+=String.fromCharCode(x);else{if(x>127&&x<2048)m+=String.fromCharCode(x>>6|192);else{m+=String.fromCharCode(x>>12|224);m+=String.fromCharCode(x>>6&63|128)}m+=String.fromCharCode(x&63|128)}}return m},e=function(g){for(var m="",l=0,x=c1=c2=0;l<g.length;){x=g.charCodeAt(l);if(x<128){m+=String.fromCharCode(x);l++}else if(x>191&&x<224){c2=g.charCodeAt(l+1);m+=String.fromCharCode((x&
31)<<6|c2&63);l+=2}else{c2=g.charCodeAt(l+1);c3=g.charCodeAt(l+2);m+=String.fromCharCode((x&15)<<12|(c2&63)<<6|c3&63);l+=3}}return m};b.extend({base64Encode:function(g){var m="",l,x,s,u,t,A,D=0;for(g=c(g);D<g.length;){l=g.charCodeAt(D++);x=g.charCodeAt(D++);s=g.charCodeAt(D++);u=l>>2;l=(l&3)<<4|x>>4;t=(x&15)<<2|s>>6;A=s&63;if(isNaN(x))t=A=64;else if(isNaN(s))A=64;m=m+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(u)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(A)}return m},base64Decode:function(g){var m="",l,x,s,u,t,A=0;for(g=g.replace(/[^A-Za-z0-9\+\/\=]/g,"");A<g.length;){l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(g.charAt(A++));x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(g.charAt(A++));u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(g.charAt(A++));
t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(g.charAt(A++));l=l<<2|x>>4;x=(x&15)<<4|u>>2;s=(u&3)<<6|t;m+=String.fromCharCode(l);if(u!=64)m+=String.fromCharCode(x);if(t!=64)m+=String.fromCharCode(s)}return m=e(m)}})})(jQuery);
jQuery.extend({createUploadIframe:function(b,c){b="jUploadFrame"+b;if(window.ActiveXObject){var e=document.createElement('<iframe id="'+b+'" name="'+b+'" />');if(typeof c=="boolean")e.src="javascript:false";else if(typeof c=="string")e.src=c}else{e=document.createElement("iframe");e.id=b;e.name=b}e.style.position="absolute";e.style.top="-1000px";e.style.left="-1000px";document.body.appendChild(e);return e},createUploadForm:function(b,c){var e="jUploadForm"+b;b="jUploadFile"+b;e=$('<form  action="" method="POST" name="'+
e+'" id="'+e+'" enctype="multipart/form-data"></form>');c=$(c);var g=$(c).clone();$(c).attr("id",b);$(c).before(g);$(c).appendTo(e);$(e).css("position","absolute");$(e).css("top","-1200px");$(e).css("left","-1200px");$(e).appendTo("body");return e},ajaxFileUpload:function(b){b=jQuery.extend({},jQuery.ajaxSettings,b);var c=(new Date).getTime();if(b.replaceForm==undefined)var e=jQuery.createUploadForm(c,b.fileElementId);else{c=b.id;e=$("#"+b.replaceForm)}jQuery.createUploadIframe(c,b.secureuri);var g=
"jUploadFrame"+c;c="jUploadForm"+c;b.global&&!jQuery.active++&&jQuery.event.trigger("ajaxStart");var m=false,l={};b.global&&jQuery.event.trigger("ajaxSend",[l,b]);var x=function(u){var t=document.getElementById(g);try{if(t.contentWindow){l.responseText=t.contentWindow.document.body?t.contentWindow.document.body.innerHTML:null;l.responseXML=t.contentWindow.document.XMLDocument?t.contentWindow.document.XMLDocument:t.contentWindow.document}else if(t.contentDocument){l.responseText=t.contentDocument.document.body?
t.contentDocument.document.body.innerHTML:null;l.responseXML=t.contentDocument.document.XMLDocument?t.contentDocument.document.XMLDocument:t.contentDocument.document}}catch(A){jQuery.handleError(b,l,null,A)}if(l||u=="timeout"){m=true;var D;try{D=u!="timeout"?"success":"error";if(D!="error"){var H=jQuery.uploadHttpData(l,b.dataType);b.success&&b.success(H,D);b.global&&jQuery.event.trigger("ajaxSuccess",[l,b])}else jQuery.handleError(b,l,D)}catch(T){D="error";jQuery.handleError(b,l,D,T)}b.global&&jQuery.event.trigger("ajaxComplete",
[l,b]);b.global&&!--jQuery.active&&jQuery.event.trigger("ajaxStop");b.complete&&b.complete(l,D);jQuery(t).unbind();setTimeout(function(){try{$(t).remove();$(e).remove()}catch(F){jQuery.handleError(b,l,null,F)}},100);l=null}};b.timeout>0&&setTimeout(function(){m||x("timeout")},b.timeout);try{e=$("#"+c);$(e).attr("action",b.url);$(e).attr("method","POST");$(e).attr("target",g);if(e.encoding)e.encoding="multipart/form-data";else e.enctype="multipart/form-data";$(e).submit()}catch(s){jQuery.handleError(b,
l,null,s)}window.attachEvent?document.getElementById(g).attachEvent("onload",x):document.getElementById(g).addEventListener("load",x,false);return{abort:function(){}}},uploadHttpData:function(b){b=b.responseText;b=b.replace("<pre>","").replace("</pre>","");return b=b.replace(/^\/\*-secure-([\s\S]*)\*\/\s*$/,"$1")}});jQuery.fn.doppel=function(b){if(b)return this.each(function(){jQuery.data(this,"doppel",b)});else{var c=[];this.each(function(){c.push(jQuery.data(this,"doppel"))});return c}};
(function(b){b.topZIndex=function(c){return Math.max(0,Math.max.apply(null,b.map(b(c||"body *"),function(e){return parseInt(b(e).css("z-index"))||null})))};b.fn.topZIndex=function(c){if(this.length===0)return this;c=b.extend({increment:1,selector:"body *"},c);var e=b.topZIndex(c.selector),g=c.increment;return this.each(function(){b(this).css("z-index",e+=g)})}})(jQuery);(function(b){b.fn.reverseOrder=function(){return this.each(function(){b(this).prependTo(b(this).parent())})}})(jQuery);
eval(function(b,c,e,g,m,l){m=function(x){return(x<62?"":m(parseInt(x/62)))+((x%=62)>35?String.fromCharCode(x+29):x.toString(36))};if("0".replace(0,m)==0){for(;e--;)l[m(e)]=g[e];g=[function(x){return l[x]||x}];m=function(){return"([237-9n-zA-Z]|1\\w)"};e=1}for(;e--;)if(g[e])b=b.replace(new RegExp("\\b"+m(e)+"\\b","g"),g[e]);return b}("(s(m){3.fn.pngFix=s(c){c=3.extend({P:'blank.gif'},c);8 e=(o.Q==\"t R S\"&&T(o.u)==4&&o.u.A(\"U 5.5\")!=-1);8 f=(o.Q==\"t R S\"&&T(o.u)==4&&o.u.A(\"U 6.0\")!=-1);p(3.browser.msie&&(e||f)){3(2).B(\"img[n$=.C]\").D(s(){3(2).7('q',3(2).q());3(2).7('r',3(2).r());8 a='';8 b='';8 g=(3(2).7('E'))?'E=\"'+3(2).7('E')+'\" ':'';8 h=(3(2).7('F'))?'F=\"'+3(2).7('F')+'\" ':'';8 i=(3(2).7('G'))?'G=\"'+3(2).7('G')+'\" ':'';8 j=(3(2).7('H'))?'H=\"'+3(2).7('H')+'\" ':'';8 k=(3(2).7('V'))?'float:'+3(2).7('V')+';':'';8 d=(3(2).parent().7('href'))?'cursor:hand;':'';p(2.9.v){a+='v:'+2.9.v+';';2.9.v=''}p(2.9.w){a+='w:'+2.9.w+';';2.9.w=''}p(2.9.x){a+='x:'+2.9.x+';';2.9.x=''}8 l=(2.9.cssText);b+='<y '+g+h+i+j;b+='9=\"W:X;white-space:pre-line;Y:Z-10;I:transparent;'+k+d;b+='q:'+3(2).q()+'z;r:'+3(2).r()+'z;';b+='J:K:L.t.M(n=\\''+3(2).7('n')+'\\', N=\\'O\\');';b+=l+'\"></y>';p(a!=''){b='<y 9=\"W:X;Y:Z-10;'+a+d+'q:'+3(2).q()+'z;r:'+3(2).r()+'z;\">'+b+'</y>'}3(2).hide();3(2).after(b)});3(2).B(\"*\").D(s(){8 a=3(2).11('I-12');p(a.A(\".C\")!=-1){8 b=a.13('url(\"')[1].13('\")')[0];3(2).11('I-12','none');3(2).14(0).15.J=\"K:L.t.M(n='\"+b+\"',N='O')\"}});3(2).B(\"input[n$=.C]\").D(s(){8 a=3(2).7('n');3(2).14(0).15.J='K:L.t.M(n=\\''+a+'\\', N=\\'O\\');';3(2).7('n',c.P)})}return 3}})(3);",
[],68,"||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|relative|display|inline|block|css|image|split|get|runtimeStyle".split("|"),0,{}));
(function(b){b.fn.placeholder=function(c){if(!b.browser.webkit){c=c||"#a9a9a9";var e=b(this).filter("input[type=text]");e.each(function(){b(this).val(b(this).attr("placeholder"));b(this).css("color",c)});e.focus(function(){b(this).val()==b(this).attr("placeholder")&&b(this).val("").css("color","")});e.blur(function(){b(this).val()==""&&b(this).val(b(this).attr("placeholder")).css("color",c)})}}})(jQuery);
jQuery.extend({highlight:function(b,c,e,g){if(b.nodeType===3){if(c=b.data.match(c)){e=document.createElement(e||"span");e.className=g||"highlight";b=b.splitText(c.index);b.splitText(c[0].length);g=b.cloneNode(true);e.appendChild(g);b.parentNode.replaceChild(e,b);return 1}}else if(b.nodeType===1&&b.childNodes&&!/(script|style)/i.test(b.tagName)&&!(b.tagName===e.toUpperCase()&&b.className===g))for(var m=0;m<b.childNodes.length;m++)m+=jQuery.highlight(b.childNodes[m],c,e,g);return 0}});
jQuery.fn.unhighlight=function(b){var c={className:"highlight",element:"span"};jQuery.extend(c,b);return this.find(c.element+"."+c.className).each(function(){var e=this.parentNode;e.replaceChild(this.firstChild,this);e.normalize()}).end()};
jQuery.fn.highlight=function(b,c){var e={className:"highlight",element:"span",caseSensitive:false,wordsOnly:false};jQuery.extend(e,c);if(b.constructor===String)b=[b];for(var g=0;g<b.length;g++)b[g]||Array.remove(b,g--);if(b.length){c=e.caseSensitive?"":"i";if(e.stem){e.wordsOnly=true;for(g=0;g<b.length;g++)b[g]=b[g].stem()+"+(s|es|i|ss|at|bl|iz|ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi|icate|ative|alize|iciti|ical|ful|ness|ed|ing|al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize|e|ll|ion|l)?"}b=
"("+b.join("|")+")";if(e.wordsOnly)b="\\b"+b+"\\b";var m=new RegExp(b,c);console.log("regex",m,b)}return this.each(function(){jQuery.highlight(this,m,e.element,e.className)})};var hexcase=0,b64pad="";function hex_md5(b){return rstr2hex(rstr_md5(str2rstr_utf8(b)))}function b64_md5(b){return rstr2b64(rstr_md5(str2rstr_utf8(b)))}function any_md5(b,c){return rstr2any(rstr_md5(str2rstr_utf8(b)),c)}function hex_hmac_md5(b,c){return rstr2hex(rstr_hmac_md5(str2rstr_utf8(b),str2rstr_utf8(c)))}
function b64_hmac_md5(b,c){return rstr2b64(rstr_hmac_md5(str2rstr_utf8(b),str2rstr_utf8(c)))}function any_hmac_md5(b,c,e){return rstr2any(rstr_hmac_md5(str2rstr_utf8(b),str2rstr_utf8(c)),e)}function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function rstr_md5(b){return binl2rstr(binl_md5(rstr2binl(b),b.length*8))}
function rstr_hmac_md5(b,c){var e=rstr2binl(b);if(e.length>16)e=binl_md5(e,b.length*8);var g=Array(16);b=Array(16);for(var m=0;m<16;m++){g[m]=e[m]^909522486;b[m]=e[m]^1549556828}c=binl_md5(g.concat(rstr2binl(c)),512+c.length*8);return binl2rstr(binl_md5(b.concat(c),640))}function rstr2hex(b){for(var c=hexcase?"0123456789ABCDEF":"0123456789abcdef",e="",g,m=0;m<b.length;m++){g=b.charCodeAt(m);e+=c.charAt(g>>>4&15)+c.charAt(g&15)}return e}
function rstr2b64(b){for(var c="",e=b.length,g=0;g<e;g+=3)for(var m=b.charCodeAt(g)<<16|(g+1<e?b.charCodeAt(g+1)<<8:0)|(g+2<e?b.charCodeAt(g+2):0),l=0;l<4;l++)c+=g*8+l*6>b.length*8?b64pad:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m>>>6*(3-l)&63);return c}
function rstr2any(b,c){var e=c.length,g,m,l,x,s,u=Array(Math.ceil(b.length/2));for(g=0;g<u.length;g++)u[g]=b.charCodeAt(g*2)<<8|b.charCodeAt(g*2+1);var t=Math.ceil(b.length*8/(Math.log(c.length)/Math.log(2)));b=Array(t);for(m=0;m<t;m++){s=Array();for(g=x=0;g<u.length;g++){x=(x<<16)+u[g];l=Math.floor(x/e);x-=l*e;if(s.length>0||l>0)s[s.length]=l}b[m]=x;u=s}e="";for(g=b.length-1;g>=0;g--)e+=c.charAt(b[g]);return e}
function str2rstr_utf8(b){for(var c="",e=-1,g,m;++e<b.length;){g=b.charCodeAt(e);m=e+1<b.length?b.charCodeAt(e+1):0;if(55296<=g&&g<=56319&&56320<=m&&m<=57343){g=65536+((g&1023)<<10)+(m&1023);e++}if(g<=127)c+=String.fromCharCode(g);else if(g<=2047)c+=String.fromCharCode(192|g>>>6&31,128|g&63);else if(g<=65535)c+=String.fromCharCode(224|g>>>12&15,128|g>>>6&63,128|g&63);else if(g<=2097151)c+=String.fromCharCode(240|g>>>18&7,128|g>>>12&63,128|g>>>6&63,128|g&63)}return c}
function str2rstr_utf16le(b){for(var c="",e=0;e<b.length;e++)c+=String.fromCharCode(b.charCodeAt(e)&255,b.charCodeAt(e)>>>8&255);return c}function str2rstr_utf16be(b){for(var c="",e=0;e<b.length;e++)c+=String.fromCharCode(b.charCodeAt(e)>>>8&255,b.charCodeAt(e)&255);return c}function rstr2binl(b){var c=Array(b.length>>2),e;for(e=0;e<c.length;e++)c[e]=0;for(e=0;e<b.length*8;e+=8)c[e>>5]|=(b.charCodeAt(e/8)&255)<<e%32;return c}
function binl2rstr(b){for(var c="",e=0;e<b.length*32;e+=8)c+=String.fromCharCode(b[e>>5]>>>e%32&255);return c}
function binl_md5(b,c){b[c>>5]|=128<<c%32;b[(c+64>>>9<<4)+14]=c;c=1732584193;for(var e=-271733879,g=-1732584194,m=271733878,l=0;l<b.length;l+=16){var x=c,s=e,u=g,t=m;c=md5_ff(c,e,g,m,b[l+0],7,-680876936);m=md5_ff(m,c,e,g,b[l+1],12,-389564586);g=md5_ff(g,m,c,e,b[l+2],17,606105819);e=md5_ff(e,g,m,c,b[l+3],22,-1044525330);c=md5_ff(c,e,g,m,b[l+4],7,-176418897);m=md5_ff(m,c,e,g,b[l+5],12,1200080426);g=md5_ff(g,m,c,e,b[l+6],17,-1473231341);e=md5_ff(e,g,m,c,b[l+7],22,-45705983);c=md5_ff(c,e,g,m,b[l+8],7,
1770035416);m=md5_ff(m,c,e,g,b[l+9],12,-1958414417);g=md5_ff(g,m,c,e,b[l+10],17,-42063);e=md5_ff(e,g,m,c,b[l+11],22,-1990404162);c=md5_ff(c,e,g,m,b[l+12],7,1804603682);m=md5_ff(m,c,e,g,b[l+13],12,-40341101);g=md5_ff(g,m,c,e,b[l+14],17,-1502002290);e=md5_ff(e,g,m,c,b[l+15],22,1236535329);c=md5_gg(c,e,g,m,b[l+1],5,-165796510);m=md5_gg(m,c,e,g,b[l+6],9,-1069501632);g=md5_gg(g,m,c,e,b[l+11],14,643717713);e=md5_gg(e,g,m,c,b[l+0],20,-373897302);c=md5_gg(c,e,g,m,b[l+5],5,-701558691);m=md5_gg(m,c,e,g,b[l+
10],9,38016083);g=md5_gg(g,m,c,e,b[l+15],14,-660478335);e=md5_gg(e,g,m,c,b[l+4],20,-405537848);c=md5_gg(c,e,g,m,b[l+9],5,568446438);m=md5_gg(m,c,e,g,b[l+14],9,-1019803690);g=md5_gg(g,m,c,e,b[l+3],14,-187363961);e=md5_gg(e,g,m,c,b[l+8],20,1163531501);c=md5_gg(c,e,g,m,b[l+13],5,-1444681467);m=md5_gg(m,c,e,g,b[l+2],9,-51403784);g=md5_gg(g,m,c,e,b[l+7],14,1735328473);e=md5_gg(e,g,m,c,b[l+12],20,-1926607734);c=md5_hh(c,e,g,m,b[l+5],4,-378558);m=md5_hh(m,c,e,g,b[l+8],11,-2022574463);g=md5_hh(g,m,c,e,b[l+
11],16,1839030562);e=md5_hh(e,g,m,c,b[l+14],23,-35309556);c=md5_hh(c,e,g,m,b[l+1],4,-1530992060);m=md5_hh(m,c,e,g,b[l+4],11,1272893353);g=md5_hh(g,m,c,e,b[l+7],16,-155497632);e=md5_hh(e,g,m,c,b[l+10],23,-1094730640);c=md5_hh(c,e,g,m,b[l+13],4,681279174);m=md5_hh(m,c,e,g,b[l+0],11,-358537222);g=md5_hh(g,m,c,e,b[l+3],16,-722521979);e=md5_hh(e,g,m,c,b[l+6],23,76029189);c=md5_hh(c,e,g,m,b[l+9],4,-640364487);m=md5_hh(m,c,e,g,b[l+12],11,-421815835);g=md5_hh(g,m,c,e,b[l+15],16,530742520);e=md5_hh(e,g,m,
c,b[l+2],23,-995338651);c=md5_ii(c,e,g,m,b[l+0],6,-198630844);m=md5_ii(m,c,e,g,b[l+7],10,1126891415);g=md5_ii(g,m,c,e,b[l+14],15,-1416354905);e=md5_ii(e,g,m,c,b[l+5],21,-57434055);c=md5_ii(c,e,g,m,b[l+12],6,1700485571);m=md5_ii(m,c,e,g,b[l+3],10,-1894986606);g=md5_ii(g,m,c,e,b[l+10],15,-1051523);e=md5_ii(e,g,m,c,b[l+1],21,-2054922799);c=md5_ii(c,e,g,m,b[l+8],6,1873313359);m=md5_ii(m,c,e,g,b[l+15],10,-30611744);g=md5_ii(g,m,c,e,b[l+6],15,-1560198380);e=md5_ii(e,g,m,c,b[l+13],21,1309151649);c=md5_ii(c,
e,g,m,b[l+4],6,-145523070);m=md5_ii(m,c,e,g,b[l+11],10,-1120210379);g=md5_ii(g,m,c,e,b[l+2],15,718787259);e=md5_ii(e,g,m,c,b[l+9],21,-343485551);c=safe_add(c,x);e=safe_add(e,s);g=safe_add(g,u);m=safe_add(m,t)}return Array(c,e,g,m)}function md5_cmn(b,c,e,g,m,l){return safe_add(bit_rol(safe_add(safe_add(c,b),safe_add(g,l)),m),e)}function md5_ff(b,c,e,g,m,l,x){return md5_cmn(c&e|~c&g,b,c,m,l,x)}function md5_gg(b,c,e,g,m,l,x){return md5_cmn(c&g|e&~g,b,c,m,l,x)}
function md5_hh(b,c,e,g,m,l,x){return md5_cmn(c^e^g,b,c,m,l,x)}function md5_ii(b,c,e,g,m,l,x){return md5_cmn(e^(c|~g),b,c,m,l,x)}function safe_add(b,c){var e=(b&65535)+(c&65535);return(b>>16)+(c>>16)+(e>>16)<<16|e&65535}function bit_rol(b,c){return b<<c|b>>>32-c}var rpc={version:"0.8.0.2",requestCount:0,cache:{}};
rpc.ServiceProxy=function(b,c){this.__serviceURL=b;this.__isCrossSite=false;if(b=this.__serviceURL.match(/^(\w+:)\/\/([^\/]+?)(?::(\d+))?(?:$|\/)/))this.__isCrossSite=location.protocol!=b[1]||document.domain!=b[2]||location.port!=(b[3]||"");var e;this.__isResponseSanitized=this.__isAsynchronous=true;this.__authPassword=this.__authUsername=null;this.__callbackParamName="JSON-response-callback";this.__protocol="JSON-RPC";this.__dateEncoding="ISO8601";this.__decodeISO8601=true;if(c instanceof Object){if(c.asynchronous!==
undefined){this.__isAsynchronous=!!c.asynchronous;if(!this.__isAsynchronous&&this.__isCrossSite)throw Error("It is not possible to establish a synchronous connection to a cross-site RPC service.");}if(c.sanitize!=undefined)this.__isResponseSanitized=!!c.sanitize;if(c.user!=undefined)this.__authUsername=c.user;if(c.password!=undefined)this.__authPassword=c.password;if(c.callbackParamName!=undefined)this.__callbackParamName=c.callbackParamName;if(String(c.protocol).toUpperCase()=="XML-RPC")this.__protocol=
"XML-RPC";if(c.dateEncoding!=undefined)this.__dateEncoding=c.dateEncoding;if(c.decodeISO8601!=undefined)this.__decodeISO8601=!!c.decodeISO8601;e=c.methods}if(this.__isCrossSite)if(this.__isResponseSanitized)throw Error("You are attempting to access a service on another site, and the JSON data returned by cross-site requests cannot be sanitized. You must therefore explicitly set the 'sanitize' option to false (it is true by default) in order to proceed with making potentially insecure cross-site rpc calls.");
else if(this.__protocol=="XML-RPC")throw Error("Unable to use the XML-RPC protocol to access services on other domains.");if(this.__isCrossSite&&!e)throw Error("You must manually supply the service's method names since auto-introspection is not permitted for cross-site services.");if(e)this.__methodList=e;else{c=this.__isAsynchronous;this.__isAsynchronous=false;this.__methodList=this.__callMethod("system.listMethods",[]);this.__isAsynchronous=c}this.__methodList.push("system.listMethods");this.__methodList.push("system.describe");
var g;for(c=0;g=this.__methodList[c];c++){e=this;b=g.split(/\./);for(var m=0;m+1<b.length;m++){e[b[m]]||(e[b[m]]={});e=e[b[m]]}g=function(l,x){var s={instance:l,methodName:x};return function(){if(s.instance.__isAsynchronous)arguments.length==1&&arguments[0]instanceof Object?s.instance.__callMethod(s.methodName,arguments[0].params,arguments[0].elementID,arguments[0].onSuccess,arguments[0].onException,arguments[0].onComplete,arguments[0].cache):s.instance.__callMethod(s.methodName,arguments[0],arguments[1],
arguments[2],arguments[3],arguments[4]);else return s.instance.__callMethod(s.methodName,rpc.toArray(arguments))}}(this,g);e[b[b.length-1]]=g}};rpc.setAsynchronous=function(b,c){if(!c&&b.__isCrossSite)throw Error("It is not possible to establish a synchronous connection to a cross-site RPC service.");b.__isAsynchronous=!!c};
rpc.ServiceProxy.prototype.__callMethod=function(b,c,e,g,m,l,x){rpc.requestCount++;if(this.__isAsynchronous){if(g&&typeof g!="function")throw Error("The asynchronous onSuccess handler callback function you provided is invalid; the value you provided ("+g.toString()+') is of type "'+typeof g+'".');if(m&&typeof m!="function")throw Error("The asynchronous onException handler callback function you provided is invalid; the value you provided ("+m.toString()+') is of type "'+typeof m+'".');if(l&&typeof l!=
"function")throw Error("The asynchronous onComplete handler callback function you provided is invalid; the value you provided ("+l.toString()+') is of type "'+typeof l+'".');}try{if(this.__isAsynchronous||this.__isCrossSite)rpc.pendingRequests[String(rpc.requestCount)]={elementIdentifier:e,onSuccess:g,onException:m,onComplete:l};if(c.filerpc!=undefined){x="";if(c.usefilecontents!=undefined){x='<input type=hidden name=filerpc value="'+c.filerpc+'">';delete c.usefilecontents}delete c.filerpc;var s=
this.__serviceURL+"/"+b+"?"+this.__callbackParamName+"=rpc.callbacks.r&"+rpc.toQueryString(c),u="jUploadFrame"+(new Date).getTime();if(window.ActiveXObject){var t=document.createElement('<iframe id="'+u+'" name="'+u+'" />');if(typeof uri=="boolean")t.src="javascript:false";else if(typeof uri=="string")t.src=uri}else{t=document.createElement("iframe");t.id=u;t.name=u}t.style.position="absolute";t.style.top="-1000px";t.style.left="-1000px";document.body.appendChild(t);jQuery('<form target="'+u+'" action="'+
s+'" method="post">'+x+"</form>").appendTo("body").submit().remove()}else{if(x){var A=this.__serviceURL+"/"+b+"?"+this.__callbackParamName+"=rpc.callbacks.r";if(c)A+="&"+rpc.toQueryString(c)}else A=false;if(this.__isCrossSite||c.fileimport!=undefined){rpc.callbacks["r"+String(rpc.requestCount)]=function(G,ja){var ka={instance:G,id:ja};return function(y){if(typeof y=="object"&&(y.result||y.error)){y.id=ka.id;G.__doCallback(y)}else G.__doCallback({id:ka.id,result:y})}}(this,rpc.requestCount);var D=
this.__serviceURL+"/"+b+"?"+this.__callbackParamName+"=rpc.callbacks.r"+rpc.requestCount;if(c)D+="&"+rpc.toQueryString(c);if(c.fileimport!=undefined){if(this.__isCrossSite)throw Error("File transfers cannot currently be done cross site");$.ajaxFileUpload({url:D,secureuri:true,fileElementId:c.fileimport,success:function(G,ja){var ka={id:rpc.requestCount};if(ja=="success"){G=eval(G);if(!G.id)G.id=ka.id;E.__doCallback(G,A)}},error:function(G,ja){var ka={id:rpc.requestCount};if(ja=="success"){G=eval(G);
if(!G.id)G.id=ka.id;E.__doCallback(G,A)}}})}else{var H=document.createElement("script");H.setAttribute("type","text/javascript");H.setAttribute("src",D);H.setAttribute("id","rpc"+rpc.requestCount);var T=document.getElementsByTagName("head")[0];rpc.pendingRequests[rpc.requestCount].scriptElement=H;T.appendChild(H)}}else{if(c)if(!(c instanceof Object)||c instanceof Date)throw Error("When making asynchronous calls, the parameters for the method must be passed as an array (or a hash); the value you supplied ("+
String(c)+') is of type "'+typeof c+'".');var F,N;if(this.__protocol=="XML-RPC"){if(!(c instanceof Array))throw Error("Unable to pass associative arrays to XML-RPC services.");s=['<?xml version="1.0"?><methodCall><methodName>'+b+"</methodName>"];if(c){s.push("<params>");for(u=0;u<c.length;u++)s.push("<param>"+this.__toXMLRPC(c[u])+"</param>");s.push("</params>")}s.push("</methodCall>");N=s.join("")}else{F={version:"1.1",method:b,id:rpc.requestCount};if(c)F.params=c;N=this.__toJSON(F)}var h;if(window.XMLHttpRequest)h=
new XMLHttpRequest;else if(window.ActiveXObject)try{h=new ActiveXObject("Msxml2.XMLHTTP")}catch(Y){h=new ActiveXObject("Microsoft.XMLHTTP")}h.open("POST",this.__serviceURL,this.__isAsynchronous,this.__authUsername,this.__authPassword);if(this.__protocol=="XML-RPC"){h.setRequestHeader("Content-Type","text/xml");h.setRequestHeader("Accept","text/xml")}else{h.setRequestHeader("Content-Type","application/json");h.setRequestHeader("Accept","application/json")}if(this.__isAsynchronous){var E=this;if(x&&
rpc.cache[A]){console.log("from cache");rpc.cache[A].id=rpc.requestCount;E.__doCallback(rpc.cache[A],A)}else{h.send(N);var Q={id:rpc.requestCount};h.onreadystatechange=function(){if(h.readyState==4)if(E.__protocol=="XML-RPC"){var G=E.__getXMLRPCResponse(h,Q.id);E.__doCallback(G)}else{G=E.__evalJSON(h.responseText,E.__isResponseSanitized);if(!G.id)G.id=Q.id;E.__doCallback(G,A)}}}}else{h.send(N);var ia;ia=this.__protocol=="XML-RPC"?this.__getXMLRPCResponse(h,rpc.requestCount):this.__evalJSON(h.responseText,
this.__isResponseSanitized);if(ia.error)throw Error('Unable to call "'+b+'". Server responsed with error (code '+ia.error.code+"): "+ia.error.message);this.__upgradeValuesFromJSON(ia);return ia.result}}}}catch(na){b=false;if(m)b=m(na);l&&l();if(!b)throw na;}};rpc.pendingRequests={};rpc.callbacks={};
rpc.ServiceProxy.prototype.__doCallback=function(b,c){if(typeof b!="object")throw Error("The server did not respond with a response object.");if(!b.id)throw Error("The server did not respond with the required response id for asynchronous calls.");if(!rpc.pendingRequests[b.id])throw Error('Fatal error with RPC code: no ID "'+b.id+'" found in pendingRequests.');if(rpc.pendingRequests[b.id].scriptElement){var e=rpc.pendingRequests[b.id].scriptElement;e.parentNode.removeChild(e)}rpc.callbacks["r"+b.id]&&
delete rpc.callbacks["r"+b.id];e=[];if(b.error!==undefined){c=new Error(b.error.message);c.code=b.error.code;if(c.message=="not authorized")return Router.unauthorized();if(rpc.pendingRequests[b.id].onException)try{rpc.pendingRequests[b.id].onException(c)||e.push(c)}catch(g){e.push(c);e.push(g)}else e.push(c)}else if(b.result!==undefined){if(c)rpc.cache[c]=b;this.__upgradeValuesFromJSON(b);var m=rpc.pendingRequests[b.id].elementIdentifier;if(rpc.pendingRequests[b.id].onSuccess)try{rpc.pendingRequests[b.id].onSuccess(b.result,
m)}catch(l){if(rpc.pendingRequests[b.id].onException)try{rpc.pendingRequests[b.id].onException(l,m)||e.push(l)}catch(x){e.push(l);e.push(x)}else e.push(l)}}try{rpc.pendingRequests[b.id].onComplete&&rpc.pendingRequests[b.id].onComplete(b,m)}catch(s){if(rpc.pendingRequests[b.id].onException)try{rpc.pendingRequests[b.id].onException(s)||e.push(s)}catch(u){e.push(s);e.push(u)}else e.push(s)}delete rpc.pendingRequests[b.id];if(e.length){var t;b="There "+(e.length==1?"was 1 uncaught exception":"were "+
e.length+" uncaught exceptions")+": ";for(m=0;m<e.length;m++){if(m)b+="; ";b+=e[m].message;if(e[m].code)t=e[m].code}c=new Error(b);c.code=t;throw c;}};
rpc.ServiceProxy.prototype.__toJSON=function(b){switch(typeof b){case "number":return isFinite(b)?b.toString():"null";case "boolean":return b.toString();case "string":var c={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\","/":"/"};return'"'+b.replace(/([\x00-\x1f\\"])/g,function(l,x){if(l=c[x])return l;l=x.charCodeAt();return"\\u00"+rpc.zeroPad(l.toString(16))})+'"';case "object":if(b===null)return"null";else if(b instanceof Array){for(var e=["["],g=0;g<b.length;g++){g&&
e.push(",");e.push(this.__toJSON(b[g]))}e.push("]");return e.join("")}else if(b instanceof Date)switch(this.__dateEncoding){case "classHinting":return'{"__jsonclass__":["Date",['+b.valueOf()+"]]}";case "@timestamp@":case "@ticks@":return'"@'+b.valueOf()+'@"';case "ASP.NET":return'"\\/Date('+b.valueOf()+')\\/"';default:return'"'+rpc.dateToISO8601(b)+'"'}else if(b instanceof Number||b instanceof String||b instanceof Boolean)return this.__toJSON(b.valueOf());else{g={}.hasOwnProperty?true:false;e=["{"];
for(var m in b)if(!g||b.hasOwnProperty(m)){e.length>1&&e.push(",");e.push(this.__toJSON(m)+":"+this.__toJSON(b[m]))}e.push("}");return e.join("")}}throw new TypeError('Unable to convert the value of type "'+typeof b+'" to JSON.');};rpc.isJSON=function(b){return/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(b.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))};a=rpc.ServiceProxy.prototype;
a.__evalJSON=function(b,c){b=b.replace(/^\/\*-secure-([\s\S]*)\*\/\s*$/,"$1");var e;try{if(!c||rpc.isJSON(b))return eval("("+b+")")}catch(g){e=g}throw new SyntaxError("Badly formed JSON string: "+b+" ... "+(e?e.message:""));};
a.__upgradeValuesFromJSON=function(b){var c,e={}.hasOwnProperty?true:false;for(var g in b)if(!e||b.hasOwnProperty(g))if(typeof b[g]=="string")if(b[g]=="0000-00-00")b[g]=null;else if(this.__decodeISO8601&&(c=b[g].match(/^(?:(\d\d\d\d)-(\d\d)(?:-(\d\d)(?:T(\d\d)(?::(\d\d)(?::(\d\d)(?:\.(\d+))?)?)?)?)?)$/))){b[g]=new Date(0);c[1]&&b[g].setUTCFullYear(parseInt(c[1],10));c[2]&&b[g].setUTCMonth(parseInt(c[2]-1,10));c[3]&&b[g].setUTCDate(parseInt(c[3],10));c[4]&&b[g].setUTCHours(parseInt(c[4],10));c[5]&&
b[g].setUTCMinutes(parseInt(c[5],10));c[6]&&b[g].setUTCMilliseconds(parseInt(c[6],10))}else if(c=b[g].match(/^@(\d+)@$/))b[g]=new Date(parseInt(c[1],10));else{if(c=b[g].match(/^\/Date\((\d+)\)\/$/))b[g]=new Date(parseInt(c[1],10))}else if(b[g]instanceof Object)if(b[g].__jsonclass__ instanceof Array){if(b[g].__jsonclass__[0]=="Date")b[g]=b[g].__jsonclass__[1]instanceof Array&&b[g].__jsonclass__[1][0]?new Date(b[g].__jsonclass__[1][0]):new Date}else this.__upgradeValuesFromJSON(b[g])};
a.__toXMLRPC=function(b){var c=["<value>"];switch(typeof b){case "number":if(isFinite(b))if(parseInt(b,10)==Math.ceil(b)){c.push("<int>");c.push(b.toString());c.push("</int>")}else{c.push("<double>");c.push(b.toString());c.push("</double>")}else c.push("<nil/>");break;case "boolean":c.push("<boolean>");c.push(b?"1":"0");c.push("</boolean>");break;case "string":c.push("<string>");c.push(b.replace(/[<>&]/,function(){}));c.push("</string>");break;case "object":if(b===null)c.push("<nil/>");else if(b instanceof
Array){c.push("<array><data>");for(var e=0;e<b.length;e++)c.push(this.__toXMLRPC(b[e]));c.push("</data></array>")}else if(b instanceof Date)c.push("<dateTime.iso8601>"+rpc.dateToISO8601(b)+"</dateTime.iso8601>");else if(b instanceof Number||b instanceof String||b instanceof Boolean)return rpc.dateToISO8601(b.valueOf());else{c.push("<struct>");e={}.hasOwnProperty?true:false;for(var g in b)if(!e||b.hasOwnProperty(g)){c.push("<member>");c.push("<name>"+g+"</name>");c.push(this.__toXMLRPC(b[g]));c.push("</member>")}c.push("</struct>")}break;
default:throw new TypeError('Unable to convert the value of type "'+typeof b+'" to XML-RPC.');}c.push("</value>");return c.join("")};
a.__parseXMLRPC=function(b){if(b.childNodes.length==1&&b.childNodes.item(0).nodeType==3)return b.childNodes.item(0).nodeValue;for(var c=0;c<b.childNodes.length;c++)if(b.childNodes.item(c).nodeType==1){c=b.childNodes.item(c);switch(c.nodeName.toLowerCase()){case "i4":case "int":b=parseInt(c.firstChild.nodeValue,10);if(isNaN(b))throw Error("XML-RPC Parse Error: The value provided as an integer '"+c.firstChild.nodeValue+"' is invalid.");return b;case "double":b=parseFloat(c.firstChild.nodeValue);if(isNaN(b))throw Error("XML-RPC Parse Error: The value provided as a double '"+
c.firstChild.nodeValue+"' is invalid.");return b;case "boolean":if(c.firstChild.nodeValue!="0"&&c.firstChild.nodeValue!="1")throw Error("XML-RPC Parse Error: The value provided as a boolean '"+c.firstChild.nodeValue+"' is invalid.");return Boolean(parseInt(c.firstChild.nodeValue,10));case "string":if(!c.firstChild)return"";return c.firstChild.nodeValue;case "datetime.iso8601":b=new Date(0);if(c=c.firstChild.nodeValue.match(/^(?:(\d\d\d\d)-(\d\d)(?:-(\d\d)(?:T(\d\d)(?::(\d\d)(?::(\d\d)(?:\.(\d+))?)?)?)?)?)$/)){c[1]&&
b.setUTCFullYear(parseInt(c[1],10));c[2]&&b.setUTCMonth(parseInt(c[2]-1,10));c[3]&&b.setUTCDate(parseInt(c[3],10));c[4]&&b.setUTCHours(parseInt(c[4],10));c[5]&&b.setUTCMinutes(parseInt(c[5],10));c[6]&&b.setUTCMilliseconds(parseInt(c[6],10));return b}throw Error("XML-RPC Parse Error: The provided value does not match ISO8601.");case "base64":throw Error("Not able to parse base64 data yet.");case "nil":return null;case "struct":for(var e={},g,m=0;g=c.childNodes.item(m);m++)if(g.nodeType==1&&g.nodeName==
"member"){var l="";b=null;for(var x,s=0;x=g.childNodes.item(s);s++)if(x.nodeType==1)if(x.nodeName=="name")l=x.firstChild.nodeValue;else if(x.nodeName=="value")b=x;if(l&&b)e[l]=this.__parseXMLRPC(b)}return e;case "array":e=[];for(c=c.firstChild;c&&(c.nodeType!=1||c.nodeName!="data");)c=c.nextSibling;for(b=c.firstChild;b;){if(b.nodeType==1)if(b.nodeName=="value")e.push(this.__parseXMLRPC(b));else throw Error("XML-RPC Parse Error: Illegal element child '"+b.nodeName+"' of an array's 'data' element.");
b=b.nextSibling}return e;default:throw Error("XML-RPC Parse Error: Illegal element '"+c.nodeName+"' child of the 'value' element.");}}return""};
a.__getXMLRPCResponse=function(b,c){var e={};if(!b.responseXML)throw Error("Malformed XML document.");b=b.responseXML.documentElement;if(b.nodeName!="methodResponse")throw Error("Invalid XML-RPC document.");b=b.getElementsByTagName("value")[0];if(b.parentNode.nodeName=="param"&&b.parentNode.parentNode.nodeName=="params")e.result=this.__parseXMLRPC(b);else if(b.parentNode.nodeName=="fault"){b=this.__parseXMLRPC(b);e.error={code:b.faultCode,message:b.faultString}}else throw Error("Invalid XML-RPC document.");
if(!e.result&&!e.error)throw Error("Malformed XML-RPC methodResponse document.");e.id=c;return e};
rpc.toQueryString=function(b){if(!(b instanceof Object||b instanceof Array)||b instanceof Date)throw Error("You must supply either an array or object type to convert into a query string. You supplied: "+b.constructor);var c="",e={}.hasOwnProperty?true:false;for(var g in b)if(e&&b.hasOwnProperty(g))if(b[g]instanceof Array)for(var m=0;m<b[g].length;m++){if(c)c+="&";c+=encodeURIComponent(g)+"=";if(b[g][m]instanceof Date)c+=encodeURIComponent(rpc.dateToISO8601(b[g][m]));else if(b[g][m]instanceof Object)throw Error("Unable to pass nested arrays nor objects as parameters while in making a cross-site request. The object in question has this constructor: "+
b[g][m].constructor);else c+=encodeURIComponent(String(b[g][m]))}else{if(c)c+="&";c+=encodeURIComponent(g)+"=";if(b[g]instanceof Date)c+=encodeURIComponent(rpc.dateToISO8601(b[g]));else if(b[g]instanceof Object)throw Error("Unable to pass objects as parameters while in making a cross-site request. The object in question has this constructor: "+b[g].constructor);else c+=encodeURIComponent(String(b[g]))}return c};
rpc.toArray=function(b){if(b instanceof Array)return b;for(var c=[],e=0;e<b.length;e++)c.push(b[e]);return c};rpc.dateToISO8601=function(b){return b.getUTCFullYear()+"-"+rpc.zeroPad(b.getUTCMonth()+1)+"-"+rpc.zeroPad(b.getUTCDate())+"T"+rpc.zeroPad(b.getUTCHours())+":"+rpc.zeroPad(b.getUTCMinutes())+":"+rpc.zeroPad(b.getUTCSeconds())+"."+rpc.zeroPad(b.getUTCMilliseconds(),3)};rpc.zeroPad=function(b,c){c||(c=2);for(b=b==undefined?"":String(b);b.length<c;)b="0"+b;return b};
var innService=new rpc.ServiceProxy("/services/APIController_class.php",{asynchronous:true,sanitize:false,methods:["getAlgorithmSelecter","retrieveProjectSharedUsers","getHelptip","authenticateUser","retrieveAllProjectsArray","getAlgorithmObject","getSimilarityMinMax","getPatentVisualization","getPatentCitationVisualization","getAutoCompleteData","getTooltip","getPatentGroupViewSort","getLitigationGroupViewSort","getPatentData","getClassificationData","getCompanyData","getCompanySimilarPortfolios",
"getCompanyNormalizations","getCompanySubsidiaries","reportNormalizationError","reportNormalizationSuggestion","lookupCompany","getOrganizationRemap","getIndustryData","getLitigationData","getLitigatedPatents","getPersonData","retrieveProjectSearch","createProject","createSurvey","retrieveProject","updateProject","deleteProject","createProjectUser","retrieveProjectUsers","retrieveUserAddressbook","deleteProjectUser","createProjectItem","createProjectItemsFromFile","completeImport","retrieveProjectItems",
"retrieveProjectItemUserData","retrieveProjectItemExport","updateProjectItems","deleteProjectItem","createProjectFile","createProjectSavedSearch","sendImageByEmail","retrieveProjectSavedSearch","deleteProjectSavedSearch","createProjectSavedSearchSubscription","retrieveAllProjectSavedSearchSubscriptions","deleteProjectSavedSearchSubscription","getProjectGridResults","getProjectGridTitles","getSearchResults","getPatentSearchResults","getPatentComboBox","getPatentGridResults","getPatentGridTitles","getLitigationGridTitles",
"getLitigationGridResults","getLitigationComboBox","getLitigationVisualization","getAccountSummary","listUsers","createGroup","updateGroup","deactivateGroup","createUser","changeUserInformation","changeUserPassword","suspendUser","unsuspendUser","resetUserPassword","getMaintenanceNotices","addUserToGroup","removeUserFromGroup","getPatentId","getExportableFields","downloadPNGImage","getAlgorithmSelector","canRunProjectAnalysis","getProjects","getWorkspaceGridResults","getProjectItemLabelList","searchProjectLabels",
"updateProjectItemLabel","whoami","getProjectItemGridTitles","getProjectItemGridResults","copyProjectItem","isProjectArchived","getTrademarkData","getTrademarkGridTitles","getTrademarkGridResults","getTrademarkComboBox","getTrademarkVisualization","getTrademarkGroupViewSort","generateExportFile","streamFile","generateGroupExportFile","getInstantAnalysisArray","getProjectPointers","requestReport","getReportFile","getReportImageData","saveItemImage","registerInvitedUser","searchProjectLabels"]});
jQuery.fn.tagalong_hide=function(){return this.each(function(){var b=$(this),c=b.doppel()[0];c&&c.hide?c.hide():b.hide()})};
$(document).ready(function(){var b="."+Entity.types.join(", .");$(b).live("mouseover",function(){if(!router.hover_entity||router.hover_entity.instance==undefined||router.hover_entity.instance[0]!=this)router.set_hover_entity($(this))}).live("mouseout",function(c){if(!$(c.relatedTarget).parents().andSelf().hasClass("tagalong")){router.set_hover_entity("");$(".tagalong").tagalong_hide()}});$(".tagalong").live("mouseout",function(c){c=$(c.relatedTarget);if(!router.hover_entity||!c.parents().andSelf().hasClass("tagalong")&&
router.hover_entity.instance[0]!=c[0])$(".tagalong").tagalong_hide()})});
(function(){var b=false,c=/xyz/.test(function(){})?/\b_super\b/:/.*/;this.Class=function(){};Class.prototype.toString=function(){if(this._toString==undefined)return"[object Object]";return this._toString()};Class.extend=function(e){function g(){!b&&this.init&&this.init.apply(this,arguments)}var m=this.prototype;b=true;var l=new this;b=false;for(var x in e)l[x]=typeof e[x]=="function"&&typeof m[x]=="function"&&c.test(e[x])?function(s,u){return function(){var t=this._super;this._super=m[s];var A=u.apply(this,
arguments);this._super=t;return A}}(x,e[x]):e[x];g.prototype=l;g.constructor=g;g.extend=arguments.callee;return g};Class.parse=function(e){if(!e||typeof e!="object")return e;if(e instanceof Array){for(var g=0;g<e.length;g++)e[g]=this.parse(e[g]);return e}if(e._c)e._className=e._c;if(!e._className)return e;e="new "+e._className+"("+JSON.stringify(e)+")";return eval(e)}})();
var entity_types=["Company","Classification","Patent","Litigation","SavedSearch","Project","Help","ProjectUser","ProjectItem","Trademark"],Entity=Class.extend({init:function(b){if(b instanceof jQuery){b=b.eq(0);var c=b.attr("class").split(" "),e=new RegExp(entity_types.join("|"));for(var g in c)if(e.test(c[g]))this.css_class=c[g];c=this.css_class.split("_");this.type=c[0];this.id=c[1];this.name=b.text();this.instance=b}else for(g in b)this[g]=b[g];if(this.id instanceof String&&this.id.indexOf(":")==
-1){b=parseInt(this.id);if(!isNaN(b))this.id=b}if(this._c)this._className=this._c;if(this._className)this.type=this._c=this._className;else if(this.type)this._className=this._c=this.type;if(this._n)this.name=this._n;if(this._v)this.id=this._v;if(!this.type)this.type="Entity";if(!this.css_class)this.css_class=this.type+"_"+this.id;this.url=["/",this.type.toLowerCase().plural(),"/",this.id].join("");this.link=['<a class="',this.type," ",this.css_class,'" href="',this.url,'">',this.name,"</a>"].join("");
if(this._className&&!this.instance)this.instance=$(this.link)},generate_report:function(){function b(){innService.requestReport({params:{typeIdArray:c},onSuccess:function(x){if(x.imageUrl){var s=document.createElement("iframe");s.src=x.imageUrl;s.setAttribute("height","0");s.setAttribute("width","0");document.body.appendChild(s)}innService.getReportFile({params:{reportId:x.reportId},onSuccess:function(u){e.next_page();$(".page_"+e.current_page+" .green").attr("href","/services/download/?fn="+u)},
onException:function(u){e.hide(function(){e.destroy()});Notifier.show({message:u.message,type:"failure"})}})},onException:function(x){Notifier.show({message:x.message,type:"failure"})}})}var c=this.type+":"+this.id,e=new Modal({title:this.type+" Report"}),g=0;if(router.page_entity.ultimate_parent){var m=router.page_entity.ultimate_parent;c=m.type+":"+m.id;l=new Form({name:"report_ultimate_parent",action:"",method:"post",enctype:"text/plain"});l.add(new Div({content:["Company reports are only available on the top level of a company heirarchy (aka the Ultimate Parent).<br><br>Would you like to bring up a report on the Ultimate Parent <b>"+
m.name+"</b>?"]}));l.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){e.next_page();b()}}));l.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){e.hide(function(){e.destroy()})}}));e.add(l,g++)}e.add(new Div({classes:["loading"],content:"Creating report file..."}),g++);var l=new Form({name:"report_download",action:"",method:"post",enctype:"text/plain"});l.add(new Div({classes:["downloadlink"],content:["Your file is ready for download"]}));l.add(new Button({content:["Download File"],
type:"confirm",on_click:function(){e.hide(function(){e.destroy()})}}));l.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){e.hide(function(){e.destroy()})}}));e.add(l,g++);e.show();router.page_entity.ultimate_parent||b()}});Entity.types=entity_types;
Entity.factory=function(b){var c;if(b instanceof jQuery){selection=b.eq(0);for(var e=["Company","Project","SavedSearch","ProjectUser","ProjectItem","Patent"],g=0;g<e.length;g++)if(selection.hasClass(e[g])){c=e[g];break}}else c=b.type;switch(c){case "Project":b=new Project(b);break;case "SavedSearch":b=new SavedSearch(b);break;case "ProjectUser":b=new ProjectUser(b);break;case "ProjectItem":b=new ProjectItem(b);break;case "Patent":b=new Patent(b);break;case "Company":b=new Company(b);break;default:b=
new Entity(b)}return b};
Entity.generate_file=function(b){b.fields[0]=="on"&&b.fields.shift();innService.generateExportFile({params:{sourceType:b.type,itemidArray:b.items,exportColumnsArray:b.fields,query:b.query,group:b.group,filters:b.filters,offset:b.offset,limit:b.limit,sort:b.sort,returnAttrs:b.return_attrs,algorithm:b.algorithm},onSuccess:function(c){$(".page_2 .green").attr("href","/services/download/?fn="+c);console.log("href","/services/download/?fn="+c);b.success()},onException:function(c){Notifier.show({message:c.message,type:"failure"})}})};
Entity.exportable_fields=function(b){innService.getExportableFields({params:{sourceType:b.type,typeid:b.type_id},onSuccess:function(c){var e=[];for(var g in c)e.push({label:c[g].replace("*",""),name:g,value:g});b.success(e)},onException:function(c){Notifier.show({message:c.message,type:"failure"})}})};
Entity.exporter=function(){var b=DataView.Grid.selected_items(),c=new Modal({title:"Export"}),e=b[0].split("_")[0],g=router.section=="projects"?router.subsection.singular().type_name2num():"",m=new Form({name:"export_params",action:"",method:"post",enctype:"text/plain"}),l=new CheckBoxGroup({label:"Exportable Fields",check_all:true,remember:"local"});Entity.exportable_fields({type:e,type_id:g,success:function(x){for(var s=0;s<x.length;s++)l.add(new CheckBox(x[s]))}});m.add(l);if(DataView.Grid.check_all_on()){g=
DataView.Grid.count("checked");g=g<=25E3?g:25E3;m.add(new TextInput({label:"Limit number of items to",name:"limit",note:"Min = 1, Max = "+g,required:true,value:g,data_type:"integer",max:g,min:1}))}m.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){if(m.is_ready()){c.next_page();var x="",s;switch(e){case "Patent":case "Litigation":case "Trademark":s=RefinePanel.assembleRefineData();x=Algorithm.getAlgorithm();break;case "Project":case "ProjectItem":s={query:router.GET.search_string?
router.GET.search_string:"",filters:"projectid="+router.entity+";typeid="+arrType[router.subsection],sort:router.GET.sort?router.GET.sort:""};break}Entity.generate_file({items:b,type:e,fields:m.content[0].val(),query:s.query,group:router.GET.group&&router.GET.group!="nogroup"?router.GET.group:"",filters:s.filters,offset:0,limit:m.fields.limit!==undefined?m.fields.limit.val():"",sort:s.sort,return_attrs:"",algorithm:x,success:function(){c.next_page()}})}}}));m.add(new Button({content:["Cancel"],type:"cancel",
on_click:function(){c.hide(function(){c.destroy()})}}));c.add(m,0);loadingMessage=m.fields.limit&&m.fields.limit.val()>100?"Preparing your file. Large exports could take a few minutes...":"Preparing your file...";c.add(new Div({classes:["loading"],content:loadingMessage}),1);g=new Form({name:"export_download",action:"",method:"post",enctype:"text/plain"});g.add(new Div({classes:["downloadlink"],content:["Your file is ready for download"]}));g.add(new Button({content:["Download File"],type:"confirm",
on_click:function(){c.hide(function(){c.destroy()})}}));g.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){c.hide(function(){c.destroy()})}}));c.add(g,2);c.show()};
Project=Entity.extend({init:function(b){if(b.val&&b.val()){this.id=parseInt(b.val(),10);this.name=b.text();this.instance=b}else if(b.value!==undefined)this.id=parseInt(b.value,10);else this._super(b)},show:function(){},rename:function(){var b=new Modal({title:"Updating Project"});b.add(new Div({classes:["loading"],content:["Updating Your Project..."]}));b.show();var c=$("input[name='title']").val();this.update({name:c},function(){b.hide(function(){b.destroy()});$("a.Project_"+router.entity).text(c)},
function(){})},archive:function(b){var c=new Modal({title:"Updating Project"});c.add(new Div({classes:["loading"],content:["Updating Your Project..."]}));c.show();this.update({isActive:b},function(){c.hide(function(){c.destroy()});if(b){$("#archive").show();$("#unarchive").hide()}else{$("#archive").hide();$("#unarchive").show()}},function(){})},update:function(b,c,e){Project.update(this.id,b,c,e)},deleter:function(){var b=this.id,c=new Modal({title:"Delete Project"}),e=new Form({name:"my_form",action:"",
method:"post",enctype:"text/plain"});e.add(new Div({content:["Are you sure you want to delete this project?"]}));e.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){c.next_page();Project.destroy({id:b,success:function(){router.location("/projects/")}})}}));e.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){c.hide(function(){c.destroy()})}}));c.add(e,0);c.add(new Div({classes:["loading"],content:["Deleting your project..."]}),1);c.show()},update_counts:function(){innService.getProjectItemGridTitles({params:{filters:"projectid="+
this.id,group:"typeid"},onSuccess:function(b){console.log(b);for(var c,e=0;e<b.data.length;e++){c=b.data[e].name.plural();if(c=="SavedSearches")c="Saved Searches";$(".tabs a:contains('"+c+"') .tabcount").html(" ("+b.data[e].count+")")}},onException:function(){}})},data_types:function(){var b=[];$("#main_content .tabs a:contains(' ')").each(function(){b.push($(this).text().split(" (")[0])});return b},generate_report:function(){for(var b=new Modal({title:"Generate Project Report"}),c=new Form({name:"project_report",
action:"",method:"post",enctype:"text/plain",remember:true}),e=new CheckBoxGroup({label:"Sections to Include",check_all:true}),g=this.data_types(),m,l=0;l<g.length;l++){m=g[l].toLowerCase().replace(" ","_");e.add(new CheckBox({name:m,value:m,label:g[l],checked:true}))}c.add(e);c.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){if(c.is_ready()){innService.getReportFile({params:{reportId:r.reportId},onSuccess:function(s){b.next_page();x.on_click(function(){window.location="/services/download/?fn="+
s})},onException:function(){}});b.next_page()}}}));c.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){b.hide(function(){b.destroy()})}}));b.add(c,0);b.add(new Div({classes:["loading"],content:"Preparing your report..."}),1);e=new Form({name:"report_download",action:"",method:"post",enctype:"text/plain"});e.add(new Div({classes:["downloadlink"],content:["Your file is ready for download"]}));var x=new Button({content:["Download File"],type:"confirm",on_click:function(){b.hide(function(){b.destroy()})}});
e.add(x);e.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){b.hide(function(){b.destroy()})}}));b.add(e,2);b.show()}});
Project.add=function(){var b=new Modal({title:"Create a New Project"}),c=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"});c.add(new TextInput({value:"",label:"Project Title",name:"project_title",required:true,maxlength:255}));c.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){console.log("hit the confirm button");if(c.is_ready()){b.next_page();Project.create(c.fields.project_title.val(),function(e){window.location="/projects/"+e+"/"},function(){b.hide(function(){b.destroy()})})}}}));
c.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){b.hide(function(){b.destroy()})}}));b.add(c,0);b.add(new Div({classes:["loading"],content:["Creating Project"]}),1);b.show()};Project.create=function(b,c,e){innService.createProject({params:{name:b,description:"",clientcode:""},onException:function(g){e(g);Notifier.show({message:"Couldn't Create Project",type:"failure"});return true},onSuccess:function(g){c(g);Notifier.show({message:"Project Successfully Created",type:"success"})}})};
Project.read=function(){};Project.update=function(b,c,e,g){innService.updateProject({params:{projectID:b,fieldValues:c},onException:function(){Notifier.show({message:"An error occured while updating your project.",type:"failure"});g();return true},onSuccess:function(m){console.log("Successfully changed project #",m);Notifier.show({message:"Your project has been updated.",type:"success"});e()}})};
Project.destroy=function(b){innService.deleteProject({params:{projectID:b.id},onException:function(){Notifier.show({message:"There was an error removing that project",type:"failure"});return true},onSuccess:function(c){b.success(c)}})};
Project.find=function(b){if(b.ids!="list")b.ids?innService.getProjectPointers({params:{projectids:[b.ids]},onException:function(c){b.failure(c)},onSuccess:function(c){b.success(c)}}):innService.retrieveAllProjectsArray({params:{},onException:function(c){b.failure(c)},onSuccess:function(c){b.success(c)}})};
$(document).ready(function(){$(".tabs a").click(function(){$(".tabs .active").removeClass("active");$(this).addClass("active");var b=$("#item_actions").addClass("disabled");DropDown.to_default($(".DropDown").not(b))});$("a:contains('+ New Project')").click(function(){Project.add()});$("#projects a:contains('Change Title')").click(function(){router.page_entity.rename()});$("#projects .button:contains('Delete Project')").click(function(){router.page_entity.deleter()});$("#projects .button:contains('Leave Project')").click(function(){ProjectUser.leave()});
$("#projects .button:contains('Archive Project')").click(function(){router.page_entity.archive(0)});$("#projects .button:contains('Unarchive Project')").click(function(){router.page_entity.archive(1)});router.subsection=="settings"&&ProjectUser.list();$("#project_report").click(function(){router.page_entity.generate_report()})});
SavedSearch=Entity.extend({init:function(b){if(b instanceof jQuery)this.subscribed=b.parents("tr").find("img[src*='subscribed']").length>0;this._super(b)},exporter:function(){var b=DataView.Chart.getPng();innService.downloadPNGImage({params:{filerpc:b,usefilecontents:true},onException:function(){Notifier.show({message:"Could not export image",type:"failure"});return true},onSuccess:function(){Notifier.show({message:"Image Downloaded",type:"success"})}})}});
SavedSearch.add_subscriptions=function(b,c){var e=new Modal({title:"Adding Subscriptions"});e.add(new Div({classes:["loading"],content:["Adding Subscriptions"]}));e.show();c.field="subscription";c.action="create";c.projectid=router.entity;c.guidArray=b;ProjectItem.update(c,function(){e.hide(function(){e.destroy()});refreshGrid()},function(){e.hide(function(){e.destroy()});showWait(false)})};
SavedSearch.delete_subscriptions=function(b,c){var e=new Modal({title:"Deleting Subscriptions"});e.add(new Div({classes:["loading"],content:["Deleting Subscriptions"]}));e.show();c.field="subscription";c.action="delete";c.projectid=router.entity;c.guidArray=b;ProjectItem.update(c,function(){e.hide(function(){e.destroy()});refreshGrid()},function(){e.hide(function(){e.destroy()});showWait(false)})};
SavedSearch.modify_subscriptions=function(b,c){var e=new Modal({title:"Modify Subscriptions"}),g=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"});g.add(new DropDown({outter_label:"Action",name:"label_action",color:"black",required:true,content:[new DropDownItem({content:"Add Subscriptions",value:"create",default_item:true}),new DropDownItem({content:"Delete Subscriptions",value:"delete"})]}));g.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){c.field="subscription";
c.action=g.fields.label_action.val();c.projectid=router.entity;c.guidArray=b;if(g.is_ready()){ProjectItem.update(c,function(){e.hide(function(){e.destroy()});refreshGrid()},function(){e.hide(function(){e.destroy()});showWait(false)});e.next_page()}}}));g.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){e.hide(function(){e.destroy()})}}));e.add(g,0);e.add(new Div({classes:["loading"],content:["Modifying Subscriptions"]}),1);e.show()};File=Entity.extend({});
File.attach=function(){var b=new Modal({title:"Add a Project File",unload_message:"You are attaching a file. Leaving the page will interrupt this action, are you sure you want to leave?"}),c=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"});c.add(new FileInput({value:"",label:"File to Add",name:"file",required:true}));c.add(new TextInput({value:"",label:"Labels",name:"file_label"}));c.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){var e=c.fields.file,
g=c.fields.file_label;b.next_page();innService.createProjectFile({params:{projectID:router.page_entity.id,fileName:e.val(),label:g.val()},onException:function(m){Notifier.show({message:m.message,type:"failure"})},onSuccess:function(m){var l=(new Date).getTime(),x="jUploadForm"+l,s="jUploadFile"+l,u=$(['<form action="',m.action,'" method="POST" name="',x,'" id="',x,'" enctype="multipart/form-data" style="position:absolute; top:-1200px; left:-1200px;"><input type="hidden" name="key" \t\t\t\t\tvalue="',
m.key,'"><input type="hidden" name="AWSAccessKeyId" \t\tvalue="',m.AWSAccessKeyId,'"><input type="hidden" name="acl" \t\t\t\t\tvalue="',m.acl,'"><input type="hidden" name="policy" \t\t\t\tvalue="',m.policy,'"><input type="hidden" name="signature" \t\t\t\tvalue="',m.signature,'"><input type="hidden" name="redirect" \t\t\t\tvalue="',window.location.protocol,"//",window.location.hostname,'/services/callback.php"><input type="hidden" name="Content-Disposition" \tvalue="',m.ContentDisposition,'"><input type="hidden" name="Content-Type" \t\t\tvalue="',
e.mime_type(),'"></form>'].join("")),t=e.instance.find("input"),A=t.clone();t.attr("id",s).before(A).appendTo(u);u.appendTo("body");$.ajaxFileUpload({url:m.action,secureuri:true,fileElementId:"input[name='file']",id:l,replaceForm:x,success:function(){b.hide(function(){b.destroy()});Notifier.show({message:"File successfully attached",type:"success"});refreshGrid();router.page_entity.update_counts()},error:function(D,H,T){console.log("ajaxupload error",D,H,T);ProjectItem.destroy([router.page_entity.id+
":7:"+m.itemid]);Notifier.show({message:"Error while trying to attach the file",type:"failure"});b.hide(function(){b.destroy()})}})}})}}));c.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){b.hide(function(){b.destroy()})}}));b.add(c,0);b.add(new Div({classes:["loading"],content:["Uploading File"]}),1);b.show()};
File.importer=function(){var b=new Modal({title:"Import Patents",unload_message:"You are importing a file. Leaving the page will interrupt this action, are you sure you want to leave?"}),c=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"});c.add(new FileInput({label:"File to Import",name:"file_to_import",required:true}));c.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){if(c.is_ready()){var g=b.instance.find(".page_2 div:first");File.identify_items(router.page_entity.id,
"input[name='file_to_import']",function(m){b.returned=m;if(m.matches)if(m.misses){var l=new List({label:"Documents not found",content:m.misses});m=m.matches+" patents will be added to the project. "+m.misses.length+" patent could not be identified."}else m=m.matches+" patents will be added to the project. To continue with the import click 'Confirm'. Click 'Cancel' to discard the import.";else m="No patents could be identified in this file. Click 'Cancel' to discard the import.";g.html(m);if(l){g.after(l.instance);
m=new Div({content:["To continue with the import click 'Confirm'. Click 'Cancel' to discard the import."]});l.instance.after(m.instance)}b.next_page()},function(){b.hide(function(){b.destroy()})});b.next_page()}}}));c.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){b.hide(function(){b.destroy()})}}));b.add(c,0);b.add(new Div({classes:["loading"],content:["Identifying and processing patents within the file"]}),1);var e=new Form({name:"my_form2",action:"",method:"post",enctype:"text/plain"});
e.add(new Div({content:["<h3>This many patents will be added</h3> To continue with the import click 'Confirm'. Click 'Cancel' to discard the import."]}));e.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){console.log("hit the confirm button");b.next_page();File.complete_import(router.page_entity.id,b.returned.importid,function(){b.hide(function(){b.destroy()});refreshGrid();router.page_entity.update_counts()},function(){b.hide(function(){b.destroy()})})}}));e.add(new Button({content:["Cancel"],
type:"cancel",on_click:function(){console.log("hit the cancel button");b.hide(function(){b.destroy()})}}));b.add(e,2);b.add(new Div({classes:["loading"],content:["Completing Import"]}),3);b.show()};File.identify_items=function(b,c,e,g){innService.createProjectItemsFromFile({params:{projectid:b,fileimport:c},onException:function(m){Notifier.show({message:m.message,type:"failure"});g(m)},onSuccess:function(m){e(m)}})};
File.complete_import=function(b,c,e,g){innService.completeImport({params:{projectid:router.page_entity.id,importid:c},onException:function(){Notifier.show({message:"Error on import. Please try again or contact support.",type:"failure"});g();return true},onSuccess:function(){Notifier.show({message:"Import complete",type:"success"});e()}})};$(document).ready(function(){$("#projects a:contains('Add File')").click(function(){File.attach()});$(".import").click(function(){File.importer()})});
User=Entity.extend({hasAccess:function(b){return jQuery.inArray(b,PHP.access)>-1}});User.login=function(b){innService.authenticateUser({params:{username:b.username,password:hex_md5(b.password),clientcode:b.client_code},onSuccess:function(c){b.success(c);Notifier.show({message:"Successfully logged in.",type:"success"})},onException:function(c){b.failure(c);Notifier.show({message:"There was an error logging in.",type:"failure"})}})};User.get_current_id=function(){return $.base64Decode($.cookie("authenticatedSession")).split("|")[1]};
User.create=function(b){innService.createUser({params:{groupID:b.group,username:b.username,first:b.first_name,middle:b.middle_name,last:b.last_name,email:b.email,alternativeEmail:b.alt_email,isAdmin:b.is_admin},onSuccess:function(){b.success();Notifier.show({message:"Successfully created user.",type:"success"})},onException:function(){b.failure();Notifier.show({message:"Cannot create user.",type:"failure"})}})};
User.register=function(b){innService.registerInvitedUser({params:{inviteCode:b.invite_code,email:b.email,password:hex_md5(b.password)},onSuccess:function(c){b.success&&b.success(c);Notifier.show({message:"Successfully registered",type:"success"})},onException:function(c){b.failure&&b.failure(c);c.message!="Error: Invite code has already been used."&&Notifier.show({message:c.message,type:"failure"})}})};var current_user=new User;
Patent=Entity.extend({exporter:function(){var b=DataView.Chart.getPng();innService.downloadPNGImage({params:{filerpc:b,usefilecontents:true},onException:function(){Notifier.show({message:"Could not export image",type:"failure"});return true},onSuccess:function(){Notifier.show({message:"Image Downloaded",type:"success"})}})}});
Patent.analyzer=function(){function b(u){if(u.length>0){for(var t="",A="",D=0;D<u.length;D++){A+=t+u[D];t=","}u="/patents/analysis/#/algorithm_id=list&algorithm_type=projects&algorithm_mode=view&algorithm_params="+A;if(l){l.location.href=u;l=false}else window.open(u,"loading"+c)}e.hide(function(){e.destroy()})}var c=(new Date).getTime();DataView.Grid.selected_items();var e=new Modal({title:"Analyze"}),g=DataView.Grid.data_type(),m,l=false,x=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"});
if(DataView.Grid.check_all_on()){var s=DataView.Grid.count("checked");s=s<=1E4?s:1E4;x.add(new TextInput({label:"Limit number of items to",name:"limit",note:"Min = 1, Max = "+s,required:true,value:s,data_type:"integer",max:s,min:1}));x.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){if(x.is_ready()){e.next_page();var u=DataView.Grid.search_params();u.type=g;u.itemidArray=DataView.Grid.selected_items();u.limit=x.fields.limit.val();innService.getInstantAnalysisArray({params:u,
onSuccess:function(t){m=t;e.next_page()},onException:function(t){Notifier.show({message:t.message,type:"failure"})}})}}}));x.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){e.hide(function(){e.destroy()})}}));e.add(x,0);e.add(new Div({classes:["loading"],content:["Gathering documents for analysis. This may take some time..."]}),1);s=new Form({name:"my_form2",action:"",method:"post",enctype:"text/plain"});s.add(new Div({content:["Your analysis is now ready. Click to open the analysis in a new window."]}));
s.add(new Button({content:["Open Window"],type:"confirm",on_click:function(){b(m)}}));s.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){e.hide(function(){e.destroy()})}}));e.add(s,2);e.show()}else{s=DataView.Grid.search_params();s.type=g;s.itemidArray=DataView.Grid.selected_items();l=window.open("/patents/analysis/#/loading","loading"+c);innService.getInstantAnalysisArray({params:s,onSuccess:b,onException:function(u){Notifier.show({message:u.message,type:"failure"})}})}};
Company=Entity.extend({init:function(b){if(!router){var c=this;$(document).ready(function(){var e=$("#ultimate_parent");if(e.length)c.ultimate_parent=Entity.factory(e)})}this._super(b)}});
Survey=Class.extend({prompt:function(){var b=new Modal({title:"Create Survey"});DataView.Grid.data_type();var c=0,e=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"}),g=DataView.Grid.count("checked");if(g>m||DataView.Grid.check_all_on()){var m=g<=100?g:100;e.add(new TextInput({label:"Limit number of items to",name:"limit",note:"Min = 1, Max = "+m,required:true,value:m,data_type:"integer",max:m,min:1}));e.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){e.is_ready()&&
b.next_page()}}));e.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){b.hide(function(){b.destroy()})}}));b.add(e,c++)}var l=new Form({name:"my_form2",action:"",method:"post",enctype:"text/plain"});l.add(new TextInput({value:"",label:"Survey Question",name:"survey_question",required:true,maxlength:255}));l.add(new TextInput({value:"",label:"Allowed Answers",name:"allowed_answers",required:true,note:"Separate with commas"}));l.add(new TextArea({value:"",label:"Email Addresses",name:"emails",
note:"Separate with commas",data_type:"emails",required:true,plugins:["autocomplete"],plugin_options:{startMessage:"Enter people to survey"}}));l.add(new Button({content:["Create"],type:"confirm",on_click:function(){if(l.is_ready()){var x=DataView.Grid.search_params();x.question=l.fields.survey_question.val();x.answers=l.fields.allowed_answers.val().split(",");x.items=DataView.Grid.selected_items();x.limit=e.fields.limit?e.fields.limit.val():0;x.emails=l.fields.emails.clean_val();for(var s=0,u=x.answers.length;s<
u;s++)x.answers[s]=x.answers[s].replace(/^[\s\"']+/g,"").replace(/[\s\"']+$/g,"");innService.createSurvey({params:x,onSuccess:function(){b.hide(function(){b.destroy()});Notifier.show({message:"Survey created and sent",type:"success"})},onException:function(t){b.hide(function(){b.destroy()});Notifier.show({message:t.message,type:"failure"})}})}}}));l.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){b.hide(function(){b.destroy()})}}));b.add(l,c++);b.show()}});
$.fn.multiEmailInput=function(b){var c={startMessage:"Enter people to invite",errorMessage:"Invalid e-mail address",onChange:function(){},emailSeparator:";,",url:"",autoComplete:null,autoCompleteMaxSize:10,autoCompleteMinChars:1};return this.each(function(){function e(){g();D.val(A.options.startMessage)}function g(){D.focus(function(){D.val()==A.options.startMessage&&D.val("");D.addClass("emailInputWithContent")});D.blur(function(){if(D.val()===""){D.val(A.options.startMessage);D.removeClass("emailInputWithContent")}});
D.keyup(function(F){F.keyCode==38||F.keyCode==40||F.keyCode==9||F.keyCode==13||A.parseInput()})}function m(F,N){F=F;F=F.replace(",","");return F=l(x(F,N),N)}function l(F,N){N=N||"\\s";return F.replace(new RegExp("^["+N+"]+","g"),"")}function x(F,N){N=N||"\\s";return F.replace(new RegExp("["+N+"]+$","g"),"")}function s(F){for(var N=[],h=0;h<F.length;h++)F[h]&&m(F[h])!==""&&N.push(F[h]);return N}function u(F){var N=[],h="";$("#currentlySharedWith-list a").each(function(){if($(this).attr("title"))N[$(this).attr("title")]=
true});for(var Y=[],E=0;E<F.length;E++){h=F[E].User.email;N[h]||Y.push(F[E])}return Y}function t(F){if(F.indexOf("&lt;")>1){F=F.substr(F.indexOf("&lt;")+4);F=F.substr(0,F.length-4)}else F=F;return F}var A=this;$(this);var D=$(":input:first",A),H="";this.options=$.extend(c,b);var T=new RegExp("["+this.options.emailSeparator+"]");this.autoCompleteSelectedIndex=-1;this.getValidList=function(F){var N={};N.valid=true;N.list=[];if(F===""||F==A.options.startMessage){N.valid=false;return N}validEmail=true;
F=F.split(T);F=s(F);for(var h=0;h<F.length;h++){var Y=m(F[h]);if(Y.is_email())F[h]=Y;else{N.valid=false;return N}}N.list=F;return N};this.parseInput=function(){if(D.val()===""||D.val()==A.options.startMessage){A.hideAutoComplete();return false}var F=D.val().split(T);if(F.length>0){H=F[F.length-1].replace(/\s+/g,"");A.autoComplete(H)}validEmail=true;for(var N=0;N<F.length-1;N++)if(!m(F[N]).is_email())break;return validEmail};this.autoComplete=function(F){F=F.replace(/\s+/g,"");F.length<A.options.autoCompleteMinChars?
A.hideAutoComplete():innService.retrieveUserAddressbook({params:{keyword:F},elementID:F,onSuccess:function(N,h){h!=H?console.log("search expired.  Ingored!"):A.showAutocompleteData(u(N))},onException:function(){alert("exception: Error retrieving data from address book.")}})};this.showAutocompleteData=function(F){var N=A.options.autoComplete,h=document.createElement("ul");N.html(h);$(h).empty();if(!F||F.length===0)A.hideAutoComplete();else{for(var Y=0;Y<F.length&&Y<A.options.autoCompleteMaxSize;Y++){N=
document.createElement("li");N.setAttribute("id",F[Y].User.id);N.innerHTML=F[Y].User.first||F[Y].User.last?F[Y].User.first+" "+F[Y].User.last+" &lt;"+F[Y].User.email+"&gt;":F[Y].User.email;h.appendChild(N);Y===0&&$(N).addClass("selected");$(N).hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).click(function(){A.autoCompleteSelectItem(this)})}A.options.autoComplete.show();A.autoCompleteUnBindKeys();A.autoCompleteBindKeys()}};this.autoCompleteBindKeys=function(){D.keydown(A.autoCompleteOnKeyDown);
A.autoCompleteSelectedIndex=0};this.autoCompleteOnKeyDown=function(F){lastKeyPressCode=F.keyCode;switch(F.keyCode){case 38:F.preventDefault();A.autoCompleteMoveSelect(-1);break;case 40:F.preventDefault();A.autoCompleteMoveSelect(1);break;case 13:F.preventDefault();break;case 9:A.autoCompleteSelectItem($("li:eq("+A.autoCompleteSelectedIndex+")",A.options.autoComplete).get(0));break}F.stopPropagation()};this.autoCompleteMoveSelect=function(F){A.autoCompleteSelectedIndex+=F;$itemList=$("li",A.options.autoComplete);
if(A.autoCompleteSelectedIndex<0)A.autoCompleteSelectedIndex=0;if(A.autoCompleteSelectedIndex>=$itemList.length)A.autoCompleteSelectedIndex=$itemList.length-1;$itemList.removeClass("selected");$("li:eq("+A.autoCompleteSelectedIndex+")",A.options.autoComplete).addClass("selected")};this.autoCompleteUnBindKeys=function(){D.unbind("keydown",A.autoCompleteOnKeyDown);autoCompleteSelectedIndex=-1};this.hideAutoComplete=function(){A.options.autoComplete.hide();A.autoCompleteUnBindKeys()};this.autoCompleteSelectItem=
function(F){F=t(F.innerHTML);var N=D.val().split(T);if(N.length>0)N[N.length-1]=F;F=N.join(", ")+", ";D.val(F).focus();A.hideAutoComplete()};e()})};
Router=Class.extend({init:function(){console.count("Router Initialized");this.path=window.location.pathname;this.search=window.location.search;this.full_path=window.location.href.split(window.location.host)[1];this.subdomain=window.location.hostname.split(".");this.subdomain=this.subdomain.length<3?"":this.subdomain[0];this.hash_search="";this.php_GET={};this.hash_GET={};this.GET={};this.hover_entity={};var b=this.path.substr(1).split("/");b[b.length-1]==""&&b.pop();var c=this.hash().split("/");c[0]==
""&&c.shift();this.php_GET=this.parse_GET(this.search.substr(1));for(var e in c)if(c[e].indexOf("=")>-1){this.hash_search+=(e==0?"":"&")+c[e];c.splice(e,1)}this.hash_GET=this.parse_GET(this.hash_search);this.GET=jQuery.extend({},this.php_GET);for(var g in this.hash_GET)this.GET[g]=this.hash_GET[g];this.url_items=b.concat(c);this.section=this.url_items[0]!=undefined?this.url_items[0]:"";this.entity=this.url_items[1]!=undefined?this.url_items[1]:"";this.subsection=this.url_items[2]!=undefined?this.url_items[2]:
"";this.type=this.url_items[3]!=undefined?this.url_items[3]:"";if(typeof SavedSearch!="undefined"&&typeof Project!="undefined"&&typeof Entity!="undefined")if(this.entity=="search"||this.entity=="analysis"||this.subsection=="analysis"||this.subsection=="portfolio"){b=this.GET.search_string?": "+jQuery.trim(this.GET.search_string):"";this.page_entity=new SavedSearch({type:"SavedSearch",id:this.full_path,name:jQuery.trim($("#title").text())+b})}else this.page_entity=this.section=="projects"&&$(".Project_"+
this.entity).length?new Project($(".Project_"+this.entity)):new Entity.factory({type:this.section.singular().capitalize(),id:this.entity,name:jQuery.trim($("#title").text())});Router[this.section]!=undefined&&Router[this.section]()},SET:function(b,c,e){e=e==undefined||e;var g=b.search_string?b.search_string:"",m=b.group&&b.group!="nogroup"?b.group:"",l=b.sort?b.sort:"",x=window.location.search;if(x.charAt(0)=="?")x=x.substring(1);x={search:x,hash:this.hash()};document.title=this.generateDocumentTitle(g,
m,l);for(var s in b)x=this.SET_helper(s,b[s],x,c,e);if(x.search!=window.location.search)window.location=window.location.pathname+(x.search?"?"+x.search:"")+(x.hash?"#"+x.hash:"");else x.hash!=this.hash()&&this.hash(x.hash)},SET_helper:function(b,c,e,g,m){c=(m=m==undefined||m)&&c!=null?this.encode(c):c;if(this.GET[b]==undefined){if(c==null)return e;if(!g||g=="hash")e.hash=e.hash+(e.hash.indexOf("=")<0?e.hash.charAt(e.hash.length-1)!="/"?"/":"":"&")+b+"="+c;else e.search=e.search+(e.search?"&":"")+
b+"="+c}else if(this.GET[b]!=c){var l=c==null?"":b+"="+c;if(g=="hash"||!g&&this.hash_GET[b]!=undefined){b=b+"="+(m?this.encode(this.hash_GET[b]):this.hash_GET[b]);if(c==null)if(e.hash.indexOf("&"+b)>-1)b="&"+b;else if(e.hash.indexOf(b+"&")>-1)b+="&";console.log("url",e.hash,"f",b,"r",l);e.hash=e.hash.replace(b,l)}else{b=b+"="+(m?this.encode(this.php_GET[b]):this.php_GET[b]);if(c==null&&e.search.indexOf("&"+b)>-1)b="&"+b;e.search=e.search.replace(b,l)}}return e},encode:function(b){return encodeURIComponent(b).replace(/'/g,
"%27").replace(/%20/g,"+").replace(/%7C/g,"|")},decode:function(b){b=b.replace(/\+(?=fulltext|exact|litigated|opposition)/g,"%2B");return decodeURIComponent(b.replace(/\+/g," "))},hash:function(b,c,e,g){if(b&&("#"+this.hash()!=b||c)){if(b.charAt(0)!="/"&&b.charAt(0)!="#")b="/"+b;if(g){if(b.charAt(b.length-1)!="/")b+="/";b+=this.hash_search}console.info("Called router.hash - changing window hash to ",b);window.location.hash=b;if(e==undefined||e)$.ajaxHistory.update(window.location.hash);this.init();
return true}else{b=String(window.location).split("#")[1];return b==undefined?"":b}},location:function(b){if(b){window.location.assign(b);b.split("#")[0]==this.path&&window.location.reload();return true}else return String(window.location)},set_hover_entity:function(b){this.hover_entity=b instanceof Entity?b:b instanceof jQuery?Entity.factory(b):null},parse_GET:function(b){var c={};b=b.split("&");b[0]==""&&b.shift();for(var e in b){v=b[e].split("=");c[v[0]]=this.decode(v[1])}return c},generateDocumentTitle:function(b,
c,e){function g(x){switch(x){case "plaintiffid":return"Plaintiff";case "defendantid":return"Defendant";case "ipcCode":return"IP Class";case "uscCode":return"USP Class";case "fileddate":return"Filing Year";case "litpatentid":return"Cited Patent";case "prioritydate":return"Priority Year";case "dbdate":return"Publication Year";case "inventor":return"Inventor";case "location":return"Location";case "organization":return"Owner";case "intltradeclasses":return"Intl. Trademark Class";default:return x}}function m(x){switch(x){case "":return"Relevance";
case "wordmarksort ASC":return"Wordmark";case "wordmarksort DESC":return"Wordmark";case "organizationsort ASC":return"Owner";case "organizationsort DESC":return"Owner";case "fileddate DESC":return"Filed Date";case "fileddate ASC":return"Filed Date";case "legalvalue DESC":return"Patent Strength";case "legalvalue ASC":return"Patent Strength";case "titlesort ASC":return"Patent Title";case "titlesort DESC":return"Patent Title";case "dbdate DESC":return"Publish Date";case "dbdate ASC":return"Publish Date";
case "sorttitle ASC":return"Case Title";case "sorttitle DESC":return"Case Title";case "sortcourt ASC":return"Court";case "sortcourt DESC":return"Court";default:return x}}var l="";if(router.section=="patents"&&router.entity=="search")l="Innography - Searching All Patents";else if(router.section=="patents"&&router.entity=="analysis")l="Innography - Patent List";else if(router.section=="patents"&&router.subsection=="analysis"){l=document.title.indexOf(String.fromCharCode(187),12);l=l>=0?document.title.substr(0,
l-1):document.title}else if(router.section=="litigation"&&router.entity=="search")l="Innography - Litigation Search";else if(router.section=="trademarks"&&router.entity=="search")l="Innography - Searching All Trademarks";else if(router.section=="companies"&&router.subsection=="analysis"){l=document.title.indexOf(String.fromCharCode(187),12);l=l>=0?document.title.substr(0,l-1):document.title}else if(router.section=="projects"&&router.subsection=="patents"){l=document.title.indexOf(String.fromCharCode(187),
document.title.indexOf(String.fromCharCode(187))+1);l=l>=0?document.title.substr(0,l-1):document.title}else if(router.section=="projects"&&router.subsection=="files"){l=document.title.indexOf(String.fromCharCode(187),document.title.indexOf(String.fromCharCode(187))+1);l=l>=0?document.title.substr(0,l-1):document.title}else return document.title;if(router.entity=="search"){sep=" ";if(b!=""){l+=" for "+String(b).truncate(25,true);sep=" , "}if(c!=""){l+=sep+"grouped by "+g(c);sep=" , "}if(e!="")l+=sep+
"sorted by "+m(e)}if(router.section=="projects"||router.section=="companies"){sep=" "+String.fromCharCode(187)+" ";if(b!=""){l+=sep+"searching for "+String(b).truncate(25,true);sep=" , "}if(c!=""){l+=sep+"grouped by "+g(c);sep=" , "}if(e!="")l+=sep+"sorted by "+m(e)}if((router.subsection=="analysis"||router.entity=="analysis")&&router.section!="companies"){sep=" "+String.fromCharCode(187)+" ";if(b!=""){l+=sep+" searching for "+String(b).truncate(25,true);sep=" , "}if(c!=""){l+=sep+"grouped by "+g(c);
sep=" , "}if(e!="")l+=sep+"sorted by "+m(e)}return l}});
Router.unauthorized=function(){var b=new Modal({title:"Login"}),c=new Form({name:"login",action:"",method:"post",enctype:"text/plain"});b.add(new Div({content:["Your login has expired. Please log back in before proceeding."]}));c.add(new TextInput({label:"Username",name:"username",required:true})).add(new TextInput({label:"Password",name:"password",data_type:"password",required:true})).add(new TextInput({label:"Client Code",name:"client_code"})).add(new Button({content:["Login"],type:"confirm",on_click:function(){c.is_ready()&&
User.login({username:c.fields.username.val(),password:c.fields.password.val(),client_code:c.fields.client_code.val(),success:function(){b.hide(function(){b.destroy()})},failure:function(){b.hide(function(){b.destroy()})}})}}));c.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){$.cookie("previous_page",router.full_path,{path:"/"});router.location("/")}}));b.add(c).show()};
Router.projects=function(){$(document).ready(function(){if(router.section=="projects"&&router.entity&&!router.subsection){var b=$(".tabs a.active").attr("href");window.location.hash=b;router.subsection=b.substring(2)}})};
Router.companies=function(){$(document).ready(function(){router.page_entity.ultimate_parent&&$("#sub_nav a").click(function(){var b=$(this),c=new Modal({title:"Ultimate Parent"}),e=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"});e.add(new Div({content:["This company's "+b.text().toLowerCase()+" can only be viewed through the "+b.text().toLowerCase()+" page its ultimate parent. Would you like to view it now?"]}));e.add(new Button({content:["View"],type:"confirm",on_click:function(){var g=
b.attr("href").split("/");router.location(router.page_entity.ultimate_parent.url+"/"+g[g.length-2]+"/")}}));e.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){c.hide(function(){c.destroy()})}}));c.add(e);c.show();return false})})};
Router.patents=function(){$(document).ready(function(){var b=HISTORY_ACTIVATED_ROUTER;HISTORY_ACTIVATED_ROUTER=false;if(b){b=router.GET.search_string?router.GET.search_string:"";console.log("search_string="+b);b={search_string:b,filters:router.GET.filters?router.GET.filters:"",group:router.GET.group?router.GET.group:"",view:router.GET.view?router.GET.view:"",sort:router.GET.sort?router.GET.sort:"",algorithm_id:router.GET.algorithm_id?router.GET.algorithm_id:"",algorithm_type:router.GET.algorithm_type?
router.GET.algorithm_type:"",algorithm_mode:router.GET.algorithm_mode?router.GET.algorithm_mode:"",algoparams:router.GET.algoparams?router.GET.algoparams:""};ALGORITHM_MODE=b.algorithm_mode;ALGORITHM_ID=b.algorithm_id;ALGORITHM_TYPE=b.algorithm_type;start_search_string=b.search_string;start_search_string=start_search_string.replace(/(\S)\+/g,"$1 ");$("#refinePanel-keywords").get(0).setValue(start_search_string);startGroup=b.group;startView=b.view;startSort=b.sort;startFilters=b.filters;ALGORITHM_URL_PARAMS=
ALGORITHM_MODE=="virtualentity"||ALGORITHM_MODE=="comparison"?b.algoparams:null;if(ALGORITHM_TYPE!=""){b=ALGORITHM_MODE&&ALGORITHM_MODE!="analysis"?ALGORITHM_MODE:"";ALGORITHM_MODE=="portfolio"?callPortfolioAlgorithmObject(ALGORITHM_TYPE,ALGORITHM_MODE,ALGORITHM_ID,false):callGetAlgorithmObject(ALGORITHM_TYPE,ALGORITHM_ID,b,true)}else{callGetGroupViewSort(false);$("#box-portfolio-comparison").hide()}}console.log("*************  ROUTER PATENTS   *****************")})};
Router.litigation=function(){$(document).ready(function(){var b=HISTORY_ACTIVATED_ROUTER;HISTORY_ACTIVATED_ROUTER=false;if(b){b={search_string:search_string,filters:router.GET.filters?router.GET.filters:"",group:router.GET.group?router.GET.group:"",view:router.GET.view?router.GET.view:"",sort:router.GET.sort?router.GET.sort:""};ALGORITHM_TYPE=ALGORITHM_ID=ALGORITHM_MODE="";ALGORITHM_URL_PARAMS=null;start_search_string=b.search_string;start_search_string=start_search_string.replace(/(\S)\+/g,"$1 ");
$("#refinePanel-keywords").get(0).setValue(start_search_string);startGroup=b.group;startView=b.view;startSort=b.sort;startFilters=b.filters;callGetLitigationGroupViewSort(false);$("#box-portfolio-comparison").hide()}console.log("*************  ROUTER PATENTS   *****************")})};
Router.trademarks=function(){$(document).ready(function(){var b=HISTORY_ACTIVATED_ROUTER;HISTORY_ACTIVATED_ROUTER=false;if(b){b={search_string:search_string,filters:router.GET.filters?router.GET.filters:"",group:router.GET.group?router.GET.group:"",view:router.GET.view?router.GET.view:"",sort:router.GET.sort?router.GET.sort:""};ALGORITHM_TYPE=ALGORITHM_ID=ALGORITHM_MODE="";ALGORITHM_URL_PARAMS=null;start_search_string=b.search_string;start_search_string=start_search_string.replace(/(\S)\+/g,"$1 ");
$("#refinePanel-keywords").get(0).setValue(start_search_string);startGroup=b.group;startView=b.view;startSort=b.sort;startFilters=b.filters;callGetTrademarkGroupViewSort(false);$("#box-portfolio-comparison").hide()}console.log("*************  ROUTER TRADEMARKS*************")})};var router=new Router;if(PHP)for(var i in PHP)PHP[i]=Class.parse(PHP[i]);
$(document).ready(function(){router.page_entity.name=router.subsection=="settings"?$("#title a.Project_"+router.entity).text():$("#title").text()+router.page_entity.name;$(window).load(function(){$.ajaxHistory.initialize()});$("a[href*='#']").live("click",function(b){var c=$(this).attr("href").split(window.location.pathname+window.location.search);c=c[c.length-1];if(c.charAt(0)=="#"){b.preventDefault();if(c.charAt(1)=="/"){c=false;if(b.clientX){if(this.hash==location.hash)return false;c=true}router.hash($(this).attr("href"),
true,c);$(b.target).trigger("clicked")}}});$("a.disabled").live("click",function(){return false})});ProjectItem=Entity.extend({init:function(b){this.sub_entity=Entity.factory(b.find("a:first"));this._super(b);this.is_owner=$("#my_projects ."+router.page_entity.css_class).length>0}});
ProjectItem.add=function(b,c){function e(t){for(var A=[],D=0;D<m.length;D++)m[D].label.toLowerCase().indexOf(t.toLowerCase())==0&&A.push(m[D]);return A}c||(c={});c||(c={});var g=new Modal({title:"Add to a Project"}),m=[],l=null;if(b instanceof Array){var x=DataView.Grid.count("checked");x=x<=1E4?x:1E4}var s=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"});s.add(new DropDown({outter_label:"Project",name:"project",color:"black",required:true,remember:"global",preselect:"Select a project",
content:[new DropDownItem({content:"+ Create A New Project",value:"new_project",classes:["add"]}),new DropDownItem({content:"Loading...",value:""})],on_open:function(){var t=$(this).find("ul");if(t.find("li:eq(1):contains('Loading...')").length){var A=$(this);Project.find({success:function(D){var H=[{name:"+ Create A New Project",value:"new_project"}];if(D)for(var T=0;T<D.length;T++)router.page_entity.type=="Project"&&router.page_entity.id==D[T].id||H.push({name:D[T].title.replace(/</g,"&lt;").replace(/>/g,
"&gt;"),value:D[T].id});else H.push({name:"You currently have no projects",value:"",classes:["disabled"]});DropDown.set_items(A,H);t.find("li:first").addClass("add")}})}},on_change:function(){if(s.fields.project.val()=="new_project"){s.fields.new_project.instance.show();s.fields.new_project.required=true}else{s.fields.new_project.instance.hide();s.fields.new_project.required=false}}}));s.add(new TextInput({value:"",label:"New Project Name",name:"new_project",required:false,style:"display:none",maxlength:255}));
b instanceof SavedSearch&&s.add(new TextInput({value:b.name,label:"Title",name:"title",required:true}));s.add(new AutocompleteTextInput({value:"",label:"Item Labels",name:"labels",onopen:function(){$("form[name='my_form']").find(".button.confirm:visible").removeClass("confirm").addClass("locked")},onclose:function(){$("form[name='my_form']").find(".button.locked:visible").removeClass("locked").addClass("confirm")},onGetList:function(t){function A(H){for(var T=[],F=0;F<H.length;F++)T.push({label:H[F],
value:H[F]});return T}if(t.text!="")if(t.text.substr(0,1).toLowerCase()==l){var D=e(t.text);t.element.setDataProvider(D);D.length>0?t.element.open():t.element.close()}else{l=t.text.substr(0,1).toLowerCase();innService.searchProjectLabels({cache:true,params:{queryLabel:l},elementID:t.text,onException:function(H){console.log("Autocomplete Exception ",H)},onSuccess:function(H,T){console.log("returned value");console.log(H);if(H)if(T!=t.element.getValue())console.log("search expired.  Ingored!");else{H=
A(H);if(H.length>0){m=H;t.element.setDataProvider(H);t.element.open()}else t.element.close()}else t.element.close()}})}}}));if(b instanceof SavedSearch)s.add(new CheckBox({label:"Subscribe to this Search",name:"subscribe",value:1}));else b instanceof Array&&DataView.Grid.check_all_on()&&s.add(new TextInput({label:"Limit number of items to",name:"limit",note:"Min = 1, Max = "+x,required:true,value:x,data_type:"integer",max:x,min:1}));var u=function(t){console.log("in do_create");console.log(c);var A=
c;A.labelText=s.fields.labels.val();A.subscribe=s.fields.subscribe!==undefined?s.fields.subscribe.checked():"";A.projectid=t.id;A.limit=s.fields.limit?s.fields.limit.val():"";t=function(){g.hide(function(){g.destroy()})};if(router.section=="projects"){if(!(b instanceof Array)){b=new Entity($(b.instance).parents("tr:first"));b=[b.css_class]}A.guidArray=b;ProjectItem.copy(A,t,t)}else{var D;if(b instanceof Array)D=b[0].split("_")[0];else if(b instanceof SavedSearch){var H=s.fields.title.val();b=b.id;
D="SavedSearch"}else{D=b.type;b=[b.type+"_"+b.id];A.bgIndexer=true}A.itemidArray=b;A.title=H?H:"";A.type=D;ProjectItem.create(A,t,t)}};s.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){if(s.is_ready()){var t=s.fields.project.val(),A=s.fields.project.text(),D=s.fields.new_project.val();if(t=="new_project"){g.next_page();Project.create(D,function(H){g.next_page();var T=$.cookie.json("forms","global");T.project={name:D,value:H};$.cookie.json("forms","global",T);u(new Project({id:H,
name:D}))})}else{g.jump_to_page(2);u(new Project({id:t,name:A}))}}}}));s.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){g.hide(function(){g.destroy()})}}));g.add(s,0);g.add(new Div({classes:["loading"],content:["Creating the project..."]}),1);loadingMessage=s.fields.limit&&s.fields.limit.val()>1E3?"Adding items to the project. Large sets could take a few minutes...":"Adding item(s) to the project...";g.add(new Div({classes:["loading"],content:loadingMessage}),2);g.show()};
ProjectItem.modify_labels=function(b,c){var e=new Modal({title:"Modify Project Items"}),g=[],m=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"}),l=new DropDown({outter_label:"Action",name:"label_action",color:"black",required:true,content:[new DropDownItem({content:"Add Labels",value:"add",default_item:true})],on_change:function(){console.log("change");var x=m.fields.new_labels,s=m.fields.existing_labels;switch(m.fields.label_action.val()){case "add":s.instance.hide();s.required=
false;x.instance.show();x.required=true;break;case "delete":s.instance.show();s.required=true;x.instance.hide();x.required=false;break;case "modify":s.instance.show();s.required=true;x.instance.show();x.required=true;break}}});m.add(l);m.add(new DropDown({outter_label:"Existing Labels",name:"existing_labels",preselect:"Select a Label",color:"black",style:"display:none",content:[new DropDownItem({content:"Loading...",value:""})],on_open:function(){var x=$(this);DropDown.set_items(x,g)}}));m.add(new TextInput({value:"",
label:"New Labels",name:"new_labels",required:true}));m.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){c.field="labels";c.action=m.fields.label_action.val();c.projectid=router.entity;c.guidArray=b;c.newLabelText=m.fields.new_labels.val();c.labelCRC=m.fields.existing_labels.val();if(m.is_ready()){ProjectItem.update(c,function(){e.hide(function(){e.destroy()});refreshGrid()},function(){e.hide(function(){e.destroy()});showWait(false)});e.next_page()}}}));m.add(new Button({content:["Cancel"],
type:"cancel",on_click:function(){e.hide(function(){e.destroy()})}}));e.add(m,0);e.add(new Div({classes:["loading"],content:["Modifying Item Labels"]}),1);ProjectItem.read({get:"labels",project_id:router.entity,items:b,success:function(x){g=x;x.length>0&&DropDown.set_items(l.instance,[{name:"Add Labels",value:"add"},{name:"Delete Labels",value:"delete"},{name:"Edit Labels",value:"modify"}])},failure:function(){}});e.show()};
ProjectItem.deleter=function(b,c){var e=DataView.Grid.count("checked"),g=new Modal({title:"Delete Project Item"+(e>1?"s":"")}),m=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"});m.add(new Div({content:[e+" item"+(e>1?"s":"")+" will be removed from this project."]}));m.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){ProjectItem.destroy(b,c,function(){if(DataView.Grid.count("checked")==DataView.Grid.count())window.location.reload();else{g.hide(function(){g.destroy()});
refreshGrid();router.page_entity.update_counts()}},function(){g.hide(function(){g.destroy()})});showWait(true);g.next_page()}}));m.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){g.hide(function(){g.destroy()})}}));g.add(m,0);g.add(new Div({classes:["loading"],content:["Deleting Items"]}),1);g.show()};
ProjectItem.create=function(b,c,e){var g=['Item(s) successfully added to project <a href="/projects/',b.projectid.id,'/">',b.projectid.name,"</a>"].join("");innService.createProjectItem({params:b,onException:function(m){e();Notifier.show({message:m.message,type:"failure"});return true},onSuccess:function(){c();Notifier.show({message:g,type:"success"})}})};
ProjectItem.copy=function(b,c,e){var g=[b.guidArray.length,' items successfully copied to project <a href="/projects/',b.projectid.id,'/">',b.projectid.name,"</a>"].join("");innService.copyProjectItem({params:b,onSuccess:function(){c();Notifier.show({message:g,type:"success"})},onException:function(m){e();Notifier.show({message:m.message,type:"failure"});return true}})};
ProjectItem.read=function(b){switch(b.get){case "labels":innService.getProjectItemLabelList({params:{projectid:b.project_id,guidArray:b.items},onSuccess:function(c){for(var e=[],g=0;g<c.length;g++)e.push({name:c[g].label,value:c[g].labelid});b.success(e)},onException:function(c){b.failure(c)}});break}};
ProjectItem.update=function(b,c,e){if(b.field=="labels")innService.updateProjectItemLabel({params:b,onSuccess:function(g){c();Notifier.show({message:g,type:"success"})},onException:function(g){e();Notifier.show({message:g.message,type:"failure"})}});else b.field=="subscription"&&innService[b.action+"ProjectSavedSearchSubscription"]({params:b,onException:function(g){e();Notifier.show({message:g.message,type:"failure"})},onSuccess:function(){c();Notifier.show({message:"Your subscriptions were successfully modified",
type:"success"})}})};ProjectItem.destroy=function(b,c,e,g){c=c||{};c.guidArray=b;c.projectid=router.page_entity.id;innService.deleteProjectItem({params:c,onSuccess:function(m){if(e){e();Notifier.show({message:m,type:"success"})}},onException:function(m){if(g){g();Notifier.show({message:m.message,type:"failure"})}}})};
ProjectUser=Entity.extend({deleter:function(){console.log("ProjectUser.deleter();");var b=this;this.id.split(":")[1]==User.get_current_id()?ProjectUser.leave():ProjectUser.destroy(this.id,function(){b.instance.parent().slideUp("normal",function(){$(this).remove()})},function(){})}});
ProjectUser.adder=function(){var b=new Modal({title:"Add to a Project"}),c=$("#user_name").text();form=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"});form.add(new TextArea({value:"",label:"Email Addresses to Add",name:"emails",note:"Separate with commas",data_type:"emails",required:true,plugins:["autocomplete"]}));form.add(new TextInput({value:c+" has shared the Innography project '"+router.page_entity.name+"' with you.",label:"Subject",name:"subject"}));form.add(new TextArea({value:c+
" has invited you to join the Innography project '"+router.page_entity.name+"' online.",label:"Message",name:"message"}));form.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){form.is_ready()&&ProjectUser.create(form.fields.emails.clean_val(),router.entity,{subject:form.fields.subject.val(),body:form.fields.message.val()},function(){ProjectUser.list();b.hide(function(){b.destroy()})},function(){b.hide(function(){b.destroy()})})}}));form.add(new Button({content:["Cancel"],type:"cancel",
on_click:function(){b.hide(function(){b.destroy()})}}));b.add(form);b.show()};
ProjectUser.list=function(){ProjectUser.find(router.page_entity.id,function(b){var c,e,g,m;c="";if(!b||!b.data.length)c='<li class="blank_slate">There are no users sharing this project. You may add users on the left.</li>';else{e=User.get_current_id();for(var l=0;l<b.data.length;l++){m=b.data[l].ProjectUser.id.split(":")[1];g=m==e?'<img src="/img/small_star.png">Me':b.data[l].ProjectUser.first+" "+b.data[l].ProjectUser.last;if(m==b.ownerID)g+='<span class="owner"> - Project Admin</span>';c+='<li><a href="mailto:'+
b.data[l].ProjectUser.email+'" class="ProjectUser ProjectUser_'+b.data[l].ProjectUser.id+'" title="'+b.data[l].ProjectUser.email+'">'+g+"</a></li>"}}$("#currentlySharedWith-list").html(c)},function(){})};ProjectUser.find=function(b,c,e){innService.retrieveProjectSharedUsers({params:{projectID:b},onException:function(){Notifier.show({message:failure,type:"failure"});e();return true},onSuccess:function(g){c(g)}})};
ProjectUser.leave=function(){var b=new Modal({title:"Leave Project"}),c=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"});c.add(new Div({content:["Leaving this project will remove it from your shared projects list and you will no longer be able to access its items. Are you sure you want to continue?"]}));c.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){ProjectUser.destroy(router.entity+":"+User.get_current_id(),function(){window.location="/projects/"},
function(){});b.hide(function(){b.destroy()})}}));c.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){b.hide(function(){b.destroy()})}}));b.add(c);b.show()};
ProjectUser.create=function(b,c,e,g,m){innService.createProjectUser({params:{newUserID:b,projectID:c,subject:e.subject,message:e.body},onSuccess:function(l){console.log("success creating user");g();l.ro.warning.length?Notifier.show({message:"Successfully added user(s) but "+l.ro.warning.join(" and "),type:"caution"}):Notifier.show({message:"Successfully added user(s)",type:"success"})},onException:function(l){m();Notifier.show({message:l.message,type:"failure"})}})};ProjectUser.read=function(){};
ProjectUser.update=function(){};ProjectUser.destroy=function(b,c,e){innService.deleteProjectUser({params:{removeProjectUserID:b},onException:function(g){console.log("failed",r);e();Notifier.show({message:g.message,type:"failure"});return true},onSuccess:function(g){console.log("success",g);c();Notifier.show({message:"removed user",type:"success"})}})};
$(document).ready(function(){$("a.ProjectUser").live("mouseover",function(){var b=router.hover_entity.id.split(":")[1],c=$("#sharing a:contains('Me - Project Admin')").length;if(c&&b!=User.get_current_id()||!c&&b==User.get_current_id()){b=$("#remove_button");c=$(this).offset().top+($(this).height()/2-2);var e=$(this).offset().left+$(this).width()-(b.width()-1);b.css({left:e,top:c});b.show()}});$("#add_user textarea").focus(function(){$("#add_user .controls").slideDown()});$("#show_message").click(function(){$("#add_message").slideDown()});
$("#projects a:contains('Add Users')").click(function(){ProjectUser.adder()})});
HTMLElement=Class.extend({init:function(b){b=this.map_params(b);for(var c in b)b[c]=Class.parse(b[c]);this._init(b)},_init:function(b){this.id=b.id?b.id:"";this.style=b.style?b.style:"";this.classes=b.classes?b.classes:[];this.content=b.content?b.content:[];this.parent=b.parent?b.parent:{};if(!(this.content instanceof Array))this.content=[this.content];if(this.content_location==undefined)this.content_location=".content:first"},map_params:function(b){if(b._n&&!b.title)b.title=b._n;if(b._v&&!b.content)b.content=
b._v;return b},add:function(b){b=Class.parse(b);return this._add(b)},_add:function(b){this.content.push(b);(this.content_location=="this"?this.instance:this.instance.find(this.content_location)).append(b.instance);return this},populate_content:function(b,c){if(b==undefined)b=this.content_location;if(c==undefined)c=this.content;b=b=="this"?this.instance:this.instance.find(b);for(var e=0;e<c.length;++e)c[e].instance!=undefined?b.append(c[e].instance):b.append(c[e]);this.instance.doppel(this)},clone:function(){var b=
jQuery.extend(true,{},this);b.instance=this.instance.clone(true);b.instance.doppel(b);for(var c=0;c<this.content.length;c++)this.content[c].attach_events!=undefined&&this.content[c].attach_events();return b},destroy:function(){this.instance.remove();this.instance=null}});
Div=HTMLElement.extend({_init:function(b){if(!this.content_location)this.content_location="this";this._super(b);this.generate()},generate:function(){this.instance=$(['<div id="',this.id,'" class="',this.classes.join(" "),'" style="',this.style,'"></div>'].join(""));this.populate_content()}});
Page=HTMLElement.extend({_init:function(b){this.columns=[];if(b.title)document.title=this.title=b.title;this.content_location="this";this._super(b);return this.generate()},generate:function(){this.instance=$('<div class="page"></div>');this.populate_content()},_add:function(b){b instanceof Column&&this.columns.push(b);this._super(b)},render:function(){this.instance.parent().length<=1&&$("#main_content").append(this.instance)}});
FormInput=HTMLElement.extend({_init:function(b){this.name=!b.name&&b.label?b.label.replace(" ","_"):b.name;this.value=b.value;this.label=b.label;this.note=b.note;this.data_type=b.data_type;this.max=b.max;this.min=b.min;this.required=!b.required||b.required==undefined?false:true;this.dependencies=b.dependencies;this.matches=b.matches;this.remember=b.remember;if(b.validate!=undefined)this.validate=b.validate;else if(this.data_type)this.validate=true;this.plugins=b.plugins;this.plugin_options=b.plugin_options;
this._super(b);this.classes.push("FormInput");this.data_type!=undefined&&this.classes.push(this.data_type);if(this.plugins!=undefined)this.classes=this.classes.concat(this.plugins)},val:function(b){return b!=undefined?this.instance.find(":input:first").val(b):this.instance.find(":input:first").val()},state:function(b){if(b)this.val(b);else return this.val()},clean_val:function(){if(!this.data_type)return this.val();switch(this.data_type){case "emails":case "email_addresses":var b=this.val();if(!b)return false;
b=jQuery.trim(b);b=b.split(/[;,] */);Array.clean(b,"");r=b;break}return r},is_valid:function(){if(this.validate&&(this.required||this.val()))if(this.data_type instanceof RegExp){if(!this.val().match(this.data_type))throw"The entry for that field is not valid";return true}else switch(this.data_type){case "email":case "email_address":if(!this.val().is_email())throw"Please enter a valid email address";break;case "emails":case "email_addresses":for(var b=this.clean_val(),c=0;c<b.length;c++)if(!b[c].is_email())throw"Please enter valid email addresses";
break;case "integer":v=parseInt(this.val(),10);if(isNaN(v))throw"Please enter a valid integer";if(v>this.max)throw"Please enter a number equal to or less than "+this.max;if(v<this.min)throw"Please enter a number equal to or more than "+this.min;break}return true},has_dependencies:function(){if(this.dependencies&&(this.required||this.val()))for(var b=0;b<this.dependencies.length;b++){var c=this.dependencies[b];if(this.parent.fields[c].val()==""||this.parent.fields[c].val()==undefined){this.parent.fields[c].add_error();
throw"Please fill out all related fields";}}return true},values_match:function(){if(this.matches){var b=this.parent.fields[this.matches];if(b.val()!=this.val()){this.add_error();b.add_error();throw this.label+" must match "+b.label;}}},store:function(){if(this.remember){var b=$.cookie.json("forms",this.remember);b||(b={});switch(this.remember){case "local":b[this.parent.name]||(b[this.parent.name]={});b[this.parent.name][this.name]=this.state();$.cookie.json("forms","local",b);break;case "global":b[this.name]=
this.state();$.cookie.json("forms","global",b);break}}},is_ready:function(){try{if(this.required&&this.val()=="")throw"Please fill out all required fields";this.parent=this.instance.parents("form").doppel()[0];this.is_valid();this.has_dependencies();this.values_match();this.store()}catch(b){this.add_error();throw b;}return true},add_error:function(){(this.instance.is(".status")?this.instance:this.instance.find(".status")).addClass("error")},remove_error:function(){(this.instance.is(".status")?this.instance:
this.instance.find(".status")).removeClass("error")}});
Button=HTMLElement.extend({_init:function(b){this._on_click=b.on_click;this.type=b.type;if(b.classes!=undefined)b.classes.push("button");else b.classes=["button"];if(b.color)this.color=b.color;else switch(this.type){case "confirm":this.color="green";break;case "cancel":this.color="grey";break}b.classes.push(this.color,this.type);this._super(b);this.content_location="span:first";this.generate()},on_click:function(b){typeof b=="function"&&this.instance.click(b)},generate:function(){this.instance=$(['<a href="#" class="',
this.classes.join(" "),'"><span></span></a>'].join(""));this.populate_content();this.on_click(this._on_click)}});
TextInput=FormInput.extend({_init:function(b){this.maxlength=b.maxlength;this._super(b);this.classes.push("TextInput");this.generate()},generate:function(){this.instance=$(['<div class="',this.classes.join(" "),'"',this.style?' style="'+this.style+'"':"",'><label for="',this.name,'">',this.label,'</label><div class="note">',this.note,'</div><div class="status"><input type="',this.data_type=="password"?"password":"text",'" name="',this.name,'" value="',this.value,'"',this.maxlength?' maxlength="'+
this.maxlength+'"':"",'></div><div class="plugin_holder"></div></div>'].join(""));this.instance.doppel(this)}});
AutocompleteTextInput=FormInput.extend({_init:function(b){this.maxlength=b.maxlength;this._super(b);this.classes.push("TextInput");this.onGetList=b.onGetList;this.onopen=b.onopen;this.onclose=b.onclose;this.generate()},generate:function(){context=this;this.instance=$(['<div class="',this.classes.join(" "),'"',this.style?' style="'+this.style+'"':"",'><label for="',this.name,'">',this.label,'</label><div class="note">',this.note,'</div><div class="status"><textarea name="',this.name,'" style="height:14px">',
this.value,'</textarea></div><div class="plugin_holder"></div></div>'].join(""));this.instance.hintInput({lineHeight:14,mode:"AC",initialValue:"",submitOnBlur:false,autoExpand:false,autocompleteTriggers:[64],charWidth:7,minChars:1,lineHeight:17,empty_message:"",cssBase:"jsAC",dataProvider:[],onchange:function(b){console.log(b);alert("clicked on item ")},onopen:function(){context.onopen()},onclose:function(){context.onclose()},onGetList:function(b){context.onGetList(b)},onInvalidSubmit:function(){}});
this.instance.doppel(this)}});
FileInput=FormInput.extend({_init:function(b){this._super(b);this.classes.push("FileInput");this.generate()},val:function(){var b=this.instance.find(":input")[0].value;b=b.split("\\");return b[b.length-1]},mime_type:function(){var b=this.val();b=b.substring(b.lastIndexOf("."));var c="";switch(b){case ".bmp":c="image/bmp";break;case ".gif":c="image/gif";break;case ".jpg":case ".jpeg":c="image/jpeg";break;case ".png":c="image/png";break;case ".avi":c="video/x-msvideo";break;case ".doc":case ".docx":c=
"application/msword";break;case ".html":case ".html":c="text/html";break;case ".ico":c="image/x-icon";break;case ".mov":c="video/quicktime";break;case ".mp3":c="audio/mpeg";break;case ".pdf":c="application/pdf";break;case ".ppt":case ".pptx":c="application/vnd.ms-powerpoint";break;case ".rtf":c="application/rtf";break;case ".txt":c="plain/text";break;case ".wav":c="audio/x-wav";break;case ".xls":case ".xlsx":c="application/octet-stream";break;case ".zip":c="application/zip";break;default:c="text/plain";
break}return c},generate:function(){this.instance=$(['<div class="',this.classes.join(" "),'"><label for="',this.name,'">',this.label,'</label><div class="note">',this.note,'</div><div class="status"><input type="file" name="',this.name,'"></div><div class="plugin_holder"></div></div>'].join(""));this.instance.doppel(this)}});
TextArea=FormInput.extend({_init:function(b){this._super(b);this.classes.push("TextArea");this.generate();if(this.plugins&&this.data_type&&this.plugins[0]=="autocomplete"&&this.data_type=="emails"){b=this.plugin_options||{};b.url=b.url||"/ajax/emaillist.php?email=";b.autoComplete=b.autoComplete||this.instance.find(".plugin_holder");this.instance.multiEmailInput(b);this.instance.find("textarea").focus(function(){$(this).parents("div.TextArea").topZIndex()})}},generate:function(){this.instance=$(['<div class="',
this.classes.join(" "),'"><label for="',this.name,'">',this.label,'</label><div class="note">',this.note,'</div><div class="status"><textarea name="',this.name,'">',this.value,'</textarea></div><div class="plugin_wrapper"><div class="plugin_holder"></div></div></div>'].join(""));this.instance.doppel(this);this.instance.keydown(function(b){b.keyCode==13&&b.stopPropagation()})}});var hasOpenedDropdown=false;
DropDown=FormInput.extend({_init:function(b){this._super(b);if(b.outter_label!==undefined)this.outter_label=b.outter_label;this.classes.push("DropDown","status");if(b.color!==undefined){this.color=b.color;this.classes.push(this.color)}if(b.preselect!==undefined)this.preselect=b.preselect;else this.set_to_default();if(b.on_open!==undefined)this.on_open=b.on_open;if(b.on_close!==undefined)this.on_close=b.on_close;if(b.on_select!==undefined)this.on_select=b.on_select;if(b.on_change!==undefined)this.on_change=
b.on_change;this.content_location="ul:first";this.generate()},val:function(b){var c=this.instance.find(".selection");if(b!==undefined){c.attr("rel",b);b=this.instance.find("ul li[rel='"+b+"']");b.length&&this.text(b.text());return this}else return c.attr("rel")},text:function(b){var c=this.instance.find(".selection");if(b!==undefined){c.text(b);return this}else return c.text()},state:function(b){if(b){b.value&&this.val(b.value);b.name&&this.text(b.name)}else return{name:this.text(),value:this.val()}},
set_to_default:function(){var b=0,c=0;a:for(;c<this.content.length;c++)if(this.content[c].default_item){b=c;break a}this.preselect=this.content[b].content;this.value=this.content[b].value},generate:function(){var b=['<div class="',this.classes.join(" "),'">','<a class="selection" rel="',this.value,'">',this.preselect,"</a>",'<div class="endcap"><div class="arrow"><p class="a9"></p><p class="a7"></p><p class="a5"></p><p class="a3"></p><p class="a1"></p></div></div>',this.label?'<div class="label">'+
this.label+"</div>":"","<ul></ul>","</div>"];if(this.outter_label!==undefined){b=['<div class="DropDownWrapper"',this.style?' style="'+this.style+'"':"",">",'<label for="',this.name,'">',this.outter_label,"</label>"].concat(b);b.push("</div>")}this.instance=$(b.join(""));this.attach_events();this.populate_content()},attach_events:function(){typeof this.on_open=="function"&&this.instance.bind("opened.DropDown",this.on_open);typeof this.on_close=="function"&&this.instance.bind("closed.DropDown",this.on_close);
typeof this.on_select=="function"&&this.instance.bind("selected.DropDown",this.on_select);typeof this.on_change=="function"&&this.instance.bind("changed.DropDown",this.on_change)}});DropDown.reset=function(b){var c=b.find(".selection").attr("rel");b.find(".active").removeClass("active");b.find("ul a[rel='"+c+"']").parent().addClass("active")};
DropDown.set=function(b){var c=b.find(".active a"),e=c.attr("rel");if(e!="action")b.hasClass("jump_menu")?router.location(e):b.find(".selection").attr("rel",e).text(c.text());b.trigger("changed.DropDown")};DropDown.to_default=function(b){return b.each(function(){var c=$(this).find(".default");c.length||(c=$(this).find("li a:first"));$(this).find(".selection").attr("rel",c.attr("rel")).text(c.text())})};
DropDown.select_item=function(b){var c=b.parent().parent();if(!b.hasClass("active")){c.find("li.active").removeClass("active");b.addClass("active")}b.trigger("selected.DropDown");DropDown.close_items(c)};
DropDown.set_items=function(b,c,e){var g=b.find("ul");g.empty();for(var m=0;m<c.length;m++){c[m].default_item&&b.find(".selection").attr("rel",c[m].value).text(c[m].name);g.append(["<li",c[m].classes?' class="'+c[m].classes.join("")+'"':"",'><a rel="',c[m].value,'">',c[m].name,"</a>"].join(""))}if(e||e===undefined)this.reset(b)};DropDown.close_items=function(b){hasOpenedDropdown=false;b.each(function(){$(this).removeClass("active");var c=$(this).find("ul");c.trigger("closed.DropDown");c.hide()})};
DropDown.open_items=function(b){hasOpenedDropdown=true;var c=$(window).height()+$(window).scrollTop();b.each(function(){var e=$(this),g=e.find("ul");e.addClass("active");g.trigger("opened.DropDown");e.add(e.parent("div.DropDownWrapper")).topZIndex();var m=e.offset().top+e.height()+g.height(),l=g.css("top")[0]!="-";if(m>c){l&&g.find("li").reverseOrder();g.css("top",-g.height()+"px")}else{l||g.find("li").reverseOrder();e=e.hasClass("inline")?19:21;g.css("top",e+"px")}g.show()})};
$(document).ready(function(){$.expr[":"].dpcontains=function(b,c,e){return(b.textContent||b.innerText||$(b).text()||"").toLowerCase().search(e[3])==0};$(document).click(function(b){$(b.target).parents().andSelf().is("div.DropDown")||DropDown.close_items($("div.DropDown:has(ul:visible)"))});$("div.DropDown:not(.disabled)").live("click",function(b){var c=$(this);if(c.find("ul").is(":hidden")){DropDown.reset(c);DropDown.close_items($("div.DropDown:has(ul:visible)"));DropDown.open_items(c)}else $(b.target).parents().is("ul")||
DropDown.close_items(c)});$("div.DropDown li:not(.disabled)").live("mouseover",function(){$this=$(this);$this.siblings().removeClass("active");$this.addClass("active")}).live("click",function(b){var c=$(this);DropDown.select_item(c);b.preventDefault();return false});$("div.DropDown.toggle_on_hover").live("mouseenter",function(){$(this).click()}).live("mouseleave",function(){$(this).click()});$(document).bind("selected.DropDown",function(b){DropDown.set($(b.target).parent().parent())});$(document).keydown(function(b){var c=
b.which;if(c==40||c==38||c==27||c==9||c==13||hasOpenedDropdown){c=$("div.DropDown ul:visible li[class='active']");var e=$("div.DropDown ul:visible");if(e.length){var g=e.css("top")[0]!="-";switch(true){case b.keyCode==40:if(!c.length&&g)$("div.DropDown ul:visible li:first").addClass("active");else c.next().length>0&&c.removeClass("active").next().addClass("active");b.preventDefault();return false;case b.keyCode==38:if(!c.length&&!g)$("div.DropDown ul:visible li:last").addClass("active");else c.prev().length>
0&&c.removeClass("active").prev().addClass("active");b.preventDefault();return false;case b.keyCode==27:DropDown.close_items($("div.DropDown:has(ul:visible)"));break;case b.keyCode==9:case b.keyCode==13:DropDown.select_item($("div.DropDown ul:visible .active"));break;case b.keyCode>=65&&b.keyCode<=89||b.keyCode>=48&&b.keyCode<=57:g=c.length>0&&c.find("a").html().toLowerCase().search(String.fromCharCode(b.keyCode).toLowerCase())==0?e.find("li").index(c):0;b=e.find("li a:gt("+g+'):dpcontains("'+String.fromCharCode(b.keyCode).toLowerCase()+
'"):eq(0)');if(b.length>0){c.length>0&&c.removeClass("active");b.parent().addClass("active");e.scrollTo(b.parent())}break}}}return true})});
DropDownItem=HTMLElement.extend({_init:function(b){this.content=b.content;this.value=b.value;this.action=b.action;this.default_item=b.default_item!=undefined&&b.default_item?true:false;this.content_location="a:first";this._super(b);this.generate()},generate:function(){this.instance=$(["<li",this.classes?' class="'+this.classes.join("")+'"':"",this.style?' style="'+this.style+'"':"",'><a rel="',this.value,'"></a></li>'].join(""));this.populate_content()}});
CheckBox=FormInput.extend({_init:function(b){this._super(b);this.classes.push("CheckBox");this.checked_onload=b.checked;this.generate()},checked:function(b){if(b!=undefined){this.instance.find("input:first").attr("checked",b);return this}else return this.instance.find("input:first").is(":checked")},state:function(b){if(b!=undefined)this.checked(b);else return this.checked()},val:function(b){if(b!=undefined)return this.instance.find(":input:first").val(b);else if(this.checked()){b=this.instance.find(":input:first").val();
return b===""?true:b}else return false},map_params:function(b){if(b._n&&!b.label)b.label=b._n;if(b._v&&!b.value)b.value=b._v;return b},generate:function(){this.instance=$(['<div class="',this.classes.join(" "),'"><div class="status"><input type="checkbox" name="',this.name,'" value="',this.value,'" ',this.checked_onload?"checked":"",'></div><label for="',this.name,'">',this.label,"</label></div>"].join(""));this.instance.doppel(this)}});
CheckBoxGroup=Div.extend({_init:function(b){this.label=b.label;this.check_all=b.check_all;this.remember=b.remember;this.fields={};if(b.classes)b.classes.push("CheckBoxGroup");else b.classes=["CheckBoxGroup"];this.content_location=".content";this._super(b)},val:function(){var b=[];this.instance.find(":checked").each(function(){b.push($(this).val())});return b},generate:function(){this.instance=$(['<div id="',this.id,'" class="',this.classes.join(""),'" style="',this.style,'">',this.check_all?'<input type="checkbox" class="check_all">':
"",this.label?"<h4>"+this.label+"</h4>":"",'<div class="content"></div></div>'].join(""));this.check_all&&this.instance.find(".check_all").click(function(){$(this).parent().find(":checkbox").attr("checked",$(this).is(":checked"))});this.populate_content()},_add:function(b){if(b instanceof CheckBox){this.fields[b.name]=b;if(this.remember)b.remember=this.remember;var c=this.instance.parents("form");if(c.length){c=c.doppel()[0];c.state(b);c.fields[b.name]=b}}c="even";if(this.instance.find(":checkbox").length%
2)c="odd";b.instance.addClass(c);this.content.push(b);this.instance.find(this.content_location).append(b.instance);return this},map_params:function(b){if(b._n&&!b.label)b.label=b._n;if(b._v&&!b.content)b.content=b._v;return b}});
Form=HTMLElement.extend({_init:function(b){this.name=b.name;this.action=b.action;var c=b.method.toLowerCase();if(c!="get"&&c!="post")throw b.method+" is not a valid value for a form's post attribute";this.method=c;c=b.enctype.toLowerCase();if(c!="text/plain"&&c!="multipart/form-data"&&c!="application/x-www-form-urlencoded")throw b.enctype+" is not a valid value for a form's enctype attribute";this.enctype=c;this.remember=b.remember;this.fields={};this.buttons=[];this.content_location=".fields";this._super(b);
this.classes.push("Form");this.generate()},generate:function(){this.instance=$(["<form ",this.id?' id="'+this.id+'"':"",this.classes.length?' class="'+this.classes.join(" ")+'"':"",'name="',this.name,'" action="',this.action,'" method="',this.method,'" enctype="',this.enctype,'"><div class="fields"></div><div class="error_message"></div><div class="buttons"></div></form>'].join(""));this.populate_content();this.populate_content(".buttons:first",this.buttons);this.instance.keydown(function(b){b.keyCode==
13&&$(this).find(".button.confirm:visible").click()})},is_valid:function(){for(var b in this.fields)if(!this.fields[b].is_valid())return false;return true},is_ready:function(){this.hide_errors();try{for(var b in this.fields)this.fields[b].is_ready();return true}catch(c){this.show_errors(c);return false}},show_errors:function(b){var c=this.instance.find(".error_message");b&&c.html(b);c.show()},hide_errors:function(){for(var b in this.fields)this.fields[b].remove_error();this.instance.find(".error_message").hide()},
state:function(b){var c=$.cookie.json("forms");if(c)if(c.global&&c.global[b.name])b.state(c.global[b.name]);else c.local&&c.local[this.name]&&c.local[this.name][b.name]&&b.state(c.local[this.name][b.name])},add_input:function(b){if(this.remember&&(!b.remember||b.remember!="global"))b.remember="local";this.state(b);this.fields[b.name]=b},_add:function(b){if(typeof b=="object"){if(b instanceof Button){this.buttons.push(b);this.instance.find(".buttons:first").append(b.instance);return this}b instanceof
FormInput&&this.add_input(b);if(b instanceof CheckBoxGroup)for(var c in b.fields)this.add_input(b.fields[c])}this.content.push(b);this.instance.find(this.content_location).append(b.instance);return this}});Grid=HTMLElement.extend({});
Grid.search_params=function(){var b;switch(router.section){case "projects":case "projectitems":b={filters:"projectid="+router.entity+";typeid="+arrType[router.subsection]};break;default:b=router.section=="companies"?"Patent":router.section.capitalize().singular();b=AjaxBus["assembleRefine"+b+"Data"]();break}return{query:router.GET.search_string?router.GET.search_string:"",group:router.GET.group&&router.GET.group!="nogroup"?router.GET.group:"",sort:router.GET.sort?router.GET.sort:"",filters:b&&b.filters?
b.filters:"",offset:router.GET.offset?router.GET.offset:"",limit:router.GET.limit?router.GET.limit:"",algorithm:window.AjaxBus?AjaxBus.getAlgorithm():""}};Grid.data_type=function(){return router.section=="projects"?"ProjectItem":Entity.factory($(".datatable:first a:first")).type};
Grid.mode=function(b){var c,e;e=RefinePanel.assembleRefineData();console.log("*********************     GRID MODE   *********************");console.log(b);switch(router.section){case "patents":case "companies":c="patent";c=function(){console.log("*** initializing GRID");DataView=new innoDataView({getTitlesCall:innService.getPatentGridTitles,getGridResultsCall:innService.getPatentGridResults,getChartCall:innService.getPatentVisualization,query:e.query,group:e.group,filters:e.filters,assembleRefineData:function(){return RefinePanel.assembleRefineData()},
onSummary:function(l){l.status=="empty"?$("#container-nodata").show():$("#container-nodata").hide();l.status=="error"?$("#container-dataerror").show():$("#container-dataerror").hide();l.status=="empty"||l.status=="error"?$("div.content").children(".nav-bar").hide():$("div.content").children(".nav-bar").show();$("#container-chart").hide();$("#treegrid").hide();$(".header .count").html(l.summary)},onAfterSubmit:function(){RefinePanel.changeQuery()}});var g=new innoGrid({htmlcontext:$("#treegrid"),handleNegates:true,
columns:[{headerContent:["#"],headerClass:"row_number",field:"num",linkField:"",fieldclass:"row_number"},{headerContent:["ID"],headerClass:"entity_id",field:"id",linkField:"",fieldclass:"entity_id",user:true},{headerContent:["Title"],headerClass:"auto",field:"title",linkField:"",fieldclass:"auto",user:true},{headerContent:["Assignee"],headerClass:"name",field:"col2",linkField:"",fieldclass:"name"},{headerContent:["Published"],headerClass:"date",field:"col3",linkField:"",fieldclass:"date"}],onGetRowData:function(l,
x){return{title:l.Patent.title?l.Patent.title:"No title available",num:x,type:"patents",id:l.Patent.id,visible_id:l.Patent.naturalid+" "+l.Patent.kindCode,col2:l.Patent.currentAssigneeName?l.Patent.currentAssigneeName:"",col3:Date.getUniversalDate(l.Patent.publishDate)}},onGetColumnContent:function(l,x,s){switch(l.field){case "id":return'<a href="/patents/'+x.id+'?st=1" class="'+s.singular().capitalize()+" "+s.singular().capitalize()+"_"+x.id+' sessvrpat">'+x.visible_id+"</a>";case "title":return'<a href="/patents/'+
x.id+'?st=1" class="'+s.singular().capitalize()+" "+s.singular().capitalize()+"_"+x.id+' sessvrpat">'+x.title+"</a>";default:return""}}},DataView),m=new newInnoChart({htmlcontext:$("#container-chart"),height:"525",onDataLoaded:function(l){console.log("is displaying chart");console.log(router.GET.view);var x=$("#group_by .selection").attr("rel"),s=$("#view_by .selection").attr("rel");l.setType(s,x);RefinePanel.triggerRefreshedEvent()}},DataView);DataView.add(g);DataView.add(m)};break;case "litigation":c=
"lit";c=function(){DataView=new innoDataView({getTitlesCall:innService.getLitigationGridTitles,getGridResultsCall:innService.getLitigationGridResults,getChartCall:innService.getLitigationVisualization,query:e.query,group:e.group,filters:e.filters,assembleRefineData:function(){return RefinePanel.assembleRefineData()},onSummary:function(l){l.status=="empty"?$("#container-nodata").show():$("#container-nodata").hide();l.status=="error"?$("#container-dataerror").show():$("#container-dataerror").hide();
l.status=="empty"||l.status=="error"?$("div.content").children(".nav-bar").hide():$("div.content").children(".nav-bar").show();$("#container-chart").hide();$("#treegrid").hide();$(".header .count").html(l.summary)},onAfterSubmit:function(){RefinePanel.changeQuery()}});var g=new innoGrid({htmlcontext:$("#treegrid"),handleNegates:true,columns:[{headerContent:["#"],headerClass:"row_number",field:"num",linkField:"",fieldclass:"row_number"},{headerContent:["ID"],headerClass:"entity_id",field:"id",linkField:"",
fieldclass:"entity_id",user:true},{headerContent:["Title"],headerClass:"auto",field:"title",linkField:"",fieldclass:"auto",user:true},{headerContent:["Court"],headerClass:"name",field:"col2",linkField:"",fieldclass:"name"},{headerContent:["Filed"],headerClass:"date",field:"col3",linkField:"",fieldclass:"date"}],onGetRowData:function(l,x){return{title:l.CourtCase.title?l.CourtCase.title:"No title available",num:x,type:"litigation",id:l.CourtCase.id,visible_id:l.CourtCase.globalCaseIdentifier,col2:l.CourtCase.court?
l.CourtCase.court:"",col3:Date.getUniversalDate(l.CourtCase.dateFiled)}},onGetColumnContent:function(l,x,s){switch(l.field){case "id":return'<a href="/'+s+"/"+x.id+'?st=1" class="'+s.singular().capitalize()+" "+s.singular().capitalize()+"_"+x.id+' sessvrpat">'+x.visible_id+"</a>";case "title":return'<a href="/'+s+"/"+x.id+'?st=1" class="'+s.singular().capitalize()+" "+s.singular().capitalize()+"_"+x.id+' sessvrpat">'+x.title+"</a>";default:return""}}},DataView),m=new newInnoChart({htmlcontext:$("#container-chart"),
height:"525",onDataLoaded:function(l){console.log("is displaying chart");var x=$("#group_by .selection").attr("rel"),s=$("#view_by .selection").attr("rel");l.setType(s,x);RefinePanel.triggerRefreshedEvent()}},DataView);DataView.add(g);DataView.add(m)};break;case "trademarks":c="trade";c=function(){DataView=new innoDataView({getTitlesCall:innService.getTrademarkGridTitles,getGridResultsCall:innService.getTrademarkGridResults,getChartCall:innService.getTrademarkVisualization,query:e.query,group:e.group,
filters:e.filters,assembleRefineData:function(){return RefinePanel.assembleRefineData()},onSummary:function(l){l.status=="empty"?$("#container-nodata").show():$("#container-nodata").hide();l.status=="error"?$("#container-dataerror").show():$("#container-dataerror").hide();l.status=="empty"||l.status=="error"?$("div.content").children(".nav-bar").hide():$("div.content").children(".nav-bar").show();$("#container-chart").hide();$("#treegrid").hide();$(".header .count").html(l.summary)},onAfterSubmit:function(){RefinePanel.changeQuery()}});
var g=new innoGrid({htmlcontext:$("#treegrid"),handleNegates:true,columns:[{headerContent:["#"],headerClass:"row_number",field:"num",linkField:"",fieldclass:"row_number"},{headerContent:["ID"],headerClass:"entity_id",field:"id",linkField:"",fieldclass:"entity_id",user:true},{headerContent:["Title"],headerClass:"auto",field:"title",linkField:"",fieldclass:"auto",user:true},{headerContent:["Court"],headerClass:"name",field:"col2",linkField:"",fieldclass:"name"},{headerContent:["Filed"],headerClass:"date",
field:"col3",linkField:"",fieldclass:"date"}],returnAttrs:["serial","ownerName1","filedDate"],onGetRowData:function(l,x){return{title:l.Trademark.wordmark?l.Trademark.wordmark:"No Wordmark",num:x,type:"trademarks",id:l.Trademark.id,visible_id:l.Trademark.serial,col2:l.Trademark.ownerName1?l.Trademark.ownerName1:"",col3:Date.getUniversalDate(l.Trademark.filedDate)}},onGetColumnContent:function(l,x,s){switch(l.field){case "id":return'<a href="/'+s+"/"+x.id+'?st=1" class="'+s.singular().capitalize()+
" "+s.singular().capitalize()+"_"+x.id+' sessvrpat">'+x.visible_id+"</a>";case "title":return'<a href="/'+s+"/"+x.id+'?st=1" class="'+s.singular().capitalize()+" "+s.singular().capitalize()+"_"+x.id+' sessvrpat">'+x.title+"</a>";default:return""}}},DataView),m=new newInnoChart({htmlcontext:$("#container-chart"),height:"525",onDataLoaded:function(l){console.log("is displaying chart");var x=$("#group_by .selection").attr("rel"),s=$("#view_by .selection").attr("rel");l.setType(s,x);RefinePanel.triggerRefreshedEvent()}},
DataView);DataView.add(g);DataView.add(m)};break}if(virgin===true){c();flgHasSubmitted&&RefinePanel.triggerRefineSubmit(23)}if(b=="grid"){b=DataView.getMode();DataView.setMode("grid");$("#treegrid").show();$("#container-chart").hide();$("#sort_by").show();$("#item_actions").show();if(virgin===true)virgin=false;else if(DataView.Grid.flagChanged||b!="grid")RefinePanel.triggerRefineSubmit(24)}else{DataView.setMode("chart");if(virgin===true)virgin=false;else{if(DataView.Chart.isClear())console.log("is triggering chart submit 1");
else{console.log("is triggering chart submit 2");DataView.Chart.setRefresh()}RefinePanel.triggerRefineSubmit()}$("#container-chart").attr("style","display:block");$("#treegrid").hide();$("#sort_by").hide();$("#item_actions").hide()}};Grid.toggle_actions=function(){$(".datatable :checkbox:checked").length?$("#item_actions").removeClass("disabled"):$("#item_actions").addClass("disabled")};
$(document).ready(function(){$(".table_header :checkbox:first").live("click",function(){$(this).is(":checked")?DataView.Grid.selectAll():DataView.Grid.unselectAll();Grid.toggle_actions()});$(".datatable :checkbox").live("click",function(){Grid.toggle_actions()});$("#sort_by").bind("changed.DropDown",function(){RefinePanel.triggerRefineSubmit(3)})});
TableCell=HTMLElement.extend({_init:function(b){this.content_location="this";this._super(b);this.generate()},generate:function(){this.instance=$(['<td id="',this.id,'" class="',this.classes.join(" "),'" style="',this.style,'"></td>'].join(""));this.populate_content()}});
TableHeader=HTMLElement.extend({_init:function(b){this.content_location="this";this._super(b);this.generate()},generate:function(){this.instance=$(['<th id="',this.id,'" class="',this.classes.join(" "),'" style="',this.style,'"></th>'].join(""));this.populate_content()}});
TableRow=HTMLElement.extend({_init:function(b){this.content_location="this";this._super(b);this.generate()},generate:function(){this.instance=$(['<tr id="',this.id,'" class="',this.classes.join(" "),'" style="',this.style,'"></tr>'].join(""));this.populate_content()}});
Table=HTMLElement.extend({_init:function(b){if(!this.content_location)this.content_location="tbody";this._super(b);this.generate()},generate:function(){this.instance=$(['<table id="',this.id,'" class="',this.classes.join(" "),'" style="',this.style,'"><tbody></tbody></table>'].join(""));this.populate_content()}});
List=HTMLElement.extend({_init:function(b){this.label=b.label;this._super(b);this.classes.push("List");this.content_location="ul";this.generate()},map_params:function(b){b=this._super(b);if(b.content)for(var c=0,e=b.content.length;c<e;c++)b.content[c]instanceof ListItem||(b.content[c]={_className:"ListItem",content:[function(g){return g}(b.content[c])]});return b},generate:function(){this.instance=$(['<div id="',this.id,'" class="',this.classes.join(""),'" style="',this.style,'">',this.label?"<h4>"+
this.label+"</h4>":"",'<div class="content"><ul></ul></div></div>'].join(""));this.populate_content()},_add:function(b){var c="even";if(this.instance.find("li").length%2)c="odd";b.instance.addClass(c);this.content.push(b);this.instance.find(this.content_location).append(b.instance);return this}});
ListItem=HTMLElement.extend({_init:function(b){this.content_location="this";this._super(b);this.generate()},generate:function(){this.instance=$(['<li id="',this.id,'" class="',this.classes.join(" "),'" style="',this.style,'"></li>'].join(""));this.populate_content()}});
HintBox=Div.extend({_init:function(b){if(b.lead_in){this.lead_in=b.lead_in;b.content[0]=['<a href="#">',this.lead_in,' <span class="more" href="#">more &raquo;</span></a><div class="more_info">',b.content[0],"</div>"].join("")}if(!b.classes)b.classes=[];b.classes.push("HintBox");this._super(b);this.instance.find("a:first").click(function(){var c=$(this).find(".more"),e=$(this).parent().find(".more_info");if(c.text()=="more \u00bb"){c.text("less \u00ab");e.slideDown()}else{c.text("more \u00bb");e.slideUp()}})}});
Column=Div.extend({init:function(b){if(b.classes)b.classes.push("column");else b.classes=["column"];if(!b.size)b.size="full";b.classes.push(b.size);this._super(b)}});
SideTable=Table.extend({_init:function(b){if(b.classes==undefined)b.classes=[];b.classes.push("SideTable");this._super(b)},map_params:function(b){b=this._super(b);if(b.content)for(var c=0,e=b.content.length;c<e;c++)if(!(b.content[c]instanceof TableRow)&&!b.content[c]._c&&!b.content[c]._className)b.content[c]={_className:"TableRow",content:[{_className:"TableHeader",content:[function(g){return g}(b.content[c]._n)]},{_className:"TableCell",content:function(g){return g instanceof Array?g:[g]}(b.content[c]._v)}]};
return b}});
Panel=HTMLElement.extend({_init:function(b){this.title=b.title;this.current_page=0;this._super(b);if(b.color){this.color=b.color;this.classes.push("color-"+this.color)}this.classes.push("panel","Panel");this.generate()},add:function(b,c){b=Class.parse(b);var e=this.content[0]&&jQuery.inArray("page",this.content[0].classes)>-1;if(c==undefined)c=0;if(c==0&&!e){this.content.push(b);this.instance.find(this.content_location).append(b.instance)}else{if(!e){this.content=[new Div({content:this.content,classes:["page",
"page_0"]})];this.instance.find(this.content_location).html(this.content[0].instance);this.page=this.content}if(this.content[c]==undefined){this.page[c]=new Div({content:b,classes:["page","page_"+c],style:"display:none;"});this.instance.find(this.content_location).append(this.page[c].instance)}else{this.page[c].content.push(b);this.page[c].instance.append(b.instance)}}return this},next_page:function(){++this.current_page;this.show_page()},prev_page:function(){--this.current_page;this.show_page()},
jump_to_page:function(b){this.current_page=b;this.show_page()},show_page:function(){this.instance.find(".page").hide();this.instance.find(".page_"+this.current_page).show()},generate:function(){this.instance=$(['<div class="',this.classes.join(" "),'"',this.id?' id="'+this.id+'"':"",'><div class="header"><div class="rounder r3 top"></div><div class="rounder r1 top"></div><div class="bg"><h2>',this.title,'</h2></div></div><div class="bg"><div class="content"></div></div><div class="footer"><div class="rounder r1 bottom"></div><div class="rounder r3 bottom"></div></div></div>'].join(""));
this.populate_content()}});Panel.test=function(b){panel=new Panel({title:"My Panel"});panel.add(Form.test());return HTMLElement.test(panel,b)};
Tooltip=Panel.extend({_init:function(b){this.delay=b.delay||0;if(b.classes)b.classes.unshift("Tooltip","tagalong");else b.classes=["Tooltip","tagalong"];this._super(b);this.instance.append('<div class="pointer"><div class="p1"></div><div class="p2"></div><div class="p3"></div><div class="p4"></div><div class="p5"></div><div class="p6"></div><div class="p7"></div></div>')},set_position:function(b){b=$(b);var c=this.instance,e=c.find(".pointer"),g=$(".tagalong:visible"),m=$(window).height()+$(window).scrollTop(),
l=b.offset().top-c.height()/2,x;if(l+c.height()>m)l=m-(c.height()+5);if(l<125)l=125;if($(window).scrollTop()>l)l=$(window).scrollTop()+5;m=x=b.offset().left-(c.width()+7);if(b[0]!=g[0])m=x-=g.width();if($(window).scrollLeft()+10>m){e.addClass("left");m=b.offset().left+b.width()+10;if(m+c.width()>$(window).width())m=x}b=g.length?g.offset().top:b.offset().top;if(l>b-2)l=b-2;e.css("top",b-l-16);c.css({top:l,left:m})},show:function(b){$("body").append(this.instance);this.set_position(b);this.instance.fadeIn("slow")},
hide:function(){this.instance.hide();this.destroy()}});
Modal=Panel.extend({_init:function(b){b.unload_message&&this.unload_message(b.unload_message);if(b.classes==undefined||!b.classes.length)b.classes=["Modal","modal"];else b.classes.unshift("Modal","modal");this._super(b);this.instance.jqm()},show:function(){console.log("Modal.show();");this.instance.parent().length<=1&&$("body").append(this.instance);this.instance.jqmShow()},hide:function(b){console.log("Modal.hide();");this.instance.jqmHide(b)},unload_message:function(b){window.onbeforeunload=b==
null?null:function(){return b}},destroy:function(){this._super();window.onbeforeunload=null}});Modal.test=function(){modal=new Modal({title:"Create a New Project"});modal.add(Form.test());modal.show();return modal};$(document).keydown(function(b){var c=b.which;if(c==27||c==13){c=$(".Modal:visible");if(c.length&&!c.find(".DropDown ul:visible").length)switch(b.keyCode){case 27:c.find(".button.cancel:visible").click();break;case 13:c.find(".button.confirm:visible").click();return false}}return true});
SubHeader=HTMLElement.extend({_init:function(b){if(!this.content_location)this.content_location="this";this.title=b.title?b.title:"";this.subnav=b.subnav?b.subnav:[];this._super(b);this.generate()},map_params:function(b){b=this._super(b);if(b.subnav)for(var c=0,e=b.subnav.length;c<e;c++)if(!(b.subnav[c]instanceof NavItem)&&!(b.subnav[c]instanceof DropDown)&&!b.subnav[c]._c&&!b.subnav[c]._className)b.subnav[c]._c="NavItem";return b},generate:function(){this.instance=$(['<div id="sub_header" class="',
this.classes.join(" "),'" style="',this.style,'">',this.title?'<div id="title">'+this.title+"</div>":"",this.subnav.length?'<ul id="sub_nav"></ul>':"","</div>"].join(""));this.subnav.length&&this.populate_content("#sub_nav",this.subnav);this.populate_content()}});
HyperLink=HTMLElement.extend({_init:function(b){if(!this.content_location)this.content_location="this";if(b.content==undefined)b.content=[b.href];this.title=b.title?b.title:"";this.target=b.target?b.target:"";this.href=b.href?b.href:"";this._super(b);this.generate()},map_params:function(b){if(b._n&&!b.content)b.content=b._n;if(b._v&&!b.href)b.href=b._v;return b},generate:function(){this.instance=$(['<a id="',this.id,'" class="',this.classes.join(" "),'" style="',this.style,'" href="',this.href,this.title?
'" title="'+this.title:"",this.target?'" target="'+this.target:"",'"></a>'].join(""));this.populate_content()}});NavItem=HyperLink.extend({_init:function(b){this._super(b);this.classes.push("NavItem")},generate:function(){this._super();this.instance=this.instance.wrap("<li>").parent();this.content_location="a:first"}});
DateInput=TextInput.extend({_init:function(b){if(!b.classes)b.classes=[];b.classes.push("DateInput");this._super(b)},generate:function(){this.instance=$(['<div class="',this.classes.join(" "),'"',this.style?' style="'+this.style+'"':"",'><label for="',this.name,'">',this.label,'</label><div class="note">',this.note,'</div><div class="status"><input class="month" type="text" name="month" value="',this.value,'" maxlength="2"><input class="day" type="text" name="day" value="',this.value,'" maxlength="2"><input class="year" type="text" name="year" value="',
this.value,'" maxlength="4"></div><div class="plugin_holder"></div></div>'].join(""));this.instance.doppel(this)}});
DateRangeInput=DateInput.extend({_init:function(b){if(!b.classes)b.classes=[];b.classes.push("DateRangeInput");this._super(b)},generate:function(){this.instance=$(['<div class="',this.classes.join(" "),'"',this.style?' style="'+this.style+'"':"",'><label for="',this.name,'">',this.label,'</label><div class="note">',this.note,'</div><div class="status"><input class="start month" type="text" name="start_month" value="',this.value,'" maxlength="2" placeholder="mm"><input class="start day" type="text" name="start_day" value="',
this.value,'" maxlength="2" placeholder="dd"><input class="start year" type="text" name="start_year" value="',this.value,'" maxlength="4" placeholder="yyyy"><span class="divider">-</span><input class="end month" type="text" name="end_month" value="',this.value,'" maxlength="2" placeholder="mm"><input class="end day" type="text" name="end_day" value="',this.value,'" maxlength="2" placeholder="dd"><input class="end year" type="text" name="end_year" value="',this.value,'" maxlength="4" placeholder="yyyy"></div><div class="plugin_holder"></div></div>'].join(""));
this.instance.doppel(this)}});
DoubleSlider=HTMLElement.extend({_init:function(b){this._super(b);this.classes.push("DoubleSlider");this.label=b.label?b.label:"";this.left_label=b.left_label?b.left_label:"";this.right_label=b.right_label?b.right_label:"";this.generate()},generate:function(){this.instance=$(['<div class="box-sliders"><p class="Help Help_10014">',this.label,'</p><div class="areaslider"><div class="ui-slider-box"><div class="ui-slider-cleft"></div><div class="ui-slider-rleft"></div><div id="patentSlider" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all"><div class="ui-slider-handle ui-state-default ui-corner-all" style="cursor: pointer; left: 0%;"></div><div class="ui-slider-handle ui-state-default ui-corner-all" style="left: 100%; cursor: pointer;"></div><div class="ui-slider-legend-1">',this.left_label,
'</div><div class="ui-slider-legend-2">',this.right_label,'</div><div class="showtip min" style="display: none;">0</div><div class="showtip max" style="display: none;">10</div><div class="showbigtip" style="display: none;"><div class="ui-slider-popupMessage"><center>Enter a date</center></div><div class="ui-slider-inputs"><input type="text" class="ui-popup-input" maxlength="2" name="date"><input type="text" class="ui-popup-input" maxlength="2" name="date"><input type="text" class="ui-popup-input year" maxlength="4" name="date"></div></div><div class="ui-slider-range ui-widget-header" style="left: 0%; width: 100%;"></div></div></div></div></div>'].join(""));
this.instance.doppel(this)}});
DropDownGroup=Div.extend({_init:function(b){this.label=b.label;this.remember=b.remember;this.fields={};if(b.classes)b.classes.push("DropDownGroup");else b.classes=["DropDownGroup"];this.content_location=".content";this._super(b)},val:function(){var b=[];for(var c in fields)b.push({name:c.name,value:c.val()});return b},generate:function(){this.instance=$(['<div id="',this.id,'" class="',this.classes.join(""),'" style="',this.style,'">',this.label?"<h4>"+this.label+"</h4>":"",'<div class="content"></div></div>'].join(""));
this.populate_content()},_add:function(b){if(b instanceof DropDown){this.fields[b.name]=b;if(this.remember)b.remember=this.remember;var c=this.instance.parents("form");if(c.length){c=c.doppel()[0];c.state(b);c.fields[b.name]=b}}c="even";if(this.instance.find(".DropDown").length%2)c="odd";b.instance.addClass(c);this.content.push(b);this.instance.find(this.content_location).append(b.instance);return this}});
PageActionsDropDown=DropDown.extend({_init:function(){params={id:"page_entity_actions",content:[{_className:"DropDownItem",value:"",content:["Actions"]},{_className:"DropDownItem",value:"add_to_project",content:["Add to Project"]},{_className:"DropDownItem",value:"share",content:["Share"]}]};this._super(params)}});
function submitTopSearch(b){b=path=b?b:"/search/";var c=$("#main_search form").serialize(),e=$.trim($("#current_scope").text());switch(e){case "Patent Keywords":path="/patents/search/";b=path+"#/"+c+"&group=nogroup&view=grid";break;case "Litigation Keywords":path="/litigation/search/";b=path+"#/"+c+"&group=nogroup&view=grid";break;case "Company Name":b="/companies/"+$("#search_string_wrapper").get(0).lastSearch.id;break;case "Trademark Keywords":path="/trademarks/search/";b=path+"#/"+c+"&group=nogroup&view=grid";
break}(c=$.cookie.json("forms","global"))||(c={});c.main_search=e;$.cookie.json("forms","global",c);router.location(b)}
function setTopACMode(b){console.info("The mode:"+b);if($("#search_string_wrapper").get(0)!==undefined)switch(b){case "Patent Number":$("#search_string_wrapper").get(0).setMode("AT");$("#search_string_wrapper").get(0).setDataProvider([]);$("#search_string_wrapper").get(0).options.autocompleteTriggers=[];break;case "Patent Keywords":$("#search_string_wrapper").get(0).setMode("AT");$("#search_string_wrapper").get(0).setDataProvider([{label:"@*",value:"All-field Search"},{label:"@title",value:"Title"},
{label:"@abstract",value:"Abstract"},{label:"@claims",value:"Claims"},{label:"@origOrgName",value:"Original Assignee (text)"},{label:"@organizationName",value:"Current Assignee (text)"},{label:"@ultimateParent",value:"Ultimate Parent Org (text)"},{label:"@normOrgName",value:"Current Assignee (norm)"},{label:"@inventor",value:"Inventor"},{label:"@patentNumber",value:"Patent Number"},{label:"@legalstatus",value:"Legal Status"}]);$("#search_string_wrapper").get(0).options.autocompleteTriggers=[64];break;
case "Litigation Keywords":$("#search_string_wrapper").get(0).setMode("AT");$("#search_string_wrapper").get(0).options.autocompleteTriggers=[64];$("#search_string_wrapper").get(0).setDataProvider([{label:"@*",value:"All-field Search"},{label:"@attorneyname",value:"Attorney"},{label:"@counterclaimant",value:"Counterclaimant"},{label:"@counterdefendant",value:"Counterdefendant"},{label:"@court",value:"Court (i.e. candce)"},{label:"@defendant",value:"Defendant"},{label:"@docketText",value:"Docket Text"},
{label:"@documenttext",value:"Document Text (Legal)"},{label:"@lawfirm",value:"Law Firm"},{label:"@patentabstract",value:"Patent Abstract"},{label:"@patentbody",value:"Patent Body"},{label:"@patentclaims",value:"Patent Claims"},{label:"@patentnumber",value:"Patent Number"},{label:"@patenttitle",value:"Patent Title"},{label:"@party",value:"Parties (All)"},{label:"@plaintiff",value:"Plaintiff"},{label:"@title",value:"Title"}]);break;case "Company Name":$("#search_string_wrapper").get(0).setMode("AC");
break;case "Trademark Keywords":$("#search_string_wrapper").get(0).setMode("AT");$("#search_string_wrapper").get(0).setDataProvider([{label:"@*",value:"All-field Search"},{label:"@attorney",value:"Attorney"},{label:"@goodservices",value:"Goods & Services"},{label:"@intentToUse",value:"Intent To Use"},{label:"@markDescription",value:"Mark Description"},{label:"@markType",value:"Mark Type"},{label:"@ownerAddress",value:"Owner Address"},{label:"@owner",value:"Owner"},{label:"@pseudoMark",value:"Psuedo Mark"},
{label:"@registrationNumber",value:"Registration Number"},{label:"@serial",value:"Serial Number"},{label:"@translation",value:"Translation"},{label:"@wordmark",value:"Word Mark"}]);$("#search_string_wrapper").get(0).options.autocompleteTriggers=[64];break}}
$(document).ready(function(){$("#magnifier").click(function(){$("#search_string_wrapper").get(0).forceSubmit()});$("#search_scope").click(function(){$(this).find("ul").toggle();$("#main_search .auto_complete").hide()});$("#search_scope").hover(function(){},function(){$(this).find("ul").hide()});$("#search_scope ul li").click(function(){setTopACMode($.trim($(this).text()));$("#main_search form").attr("action",void 0);$("#current_scope").html($(this).html());console.info("in search_scope: "+$(this).html());
$("#search_string_wrapper textarea").focus()});$("#action_bar .showhide").click(function(){var b=$(this).parent();hide_right="-"+(b.find("ul").width()+1)+"px";if(b.css("right")=="0px"){icon="\u00ab";move_to=hide_right}else{icon="\u00bb";move_to="0px"}b.animate({right:move_to},700,"swing");$(this).text(icon)})});
$(document).ready(function(){function b(t){return t<=0.5?"low":t>0.5&&t<=0.9?"medium":"high"}$(document).pngFix();$("a.Company, a.Patent, a.Litigation, a.Trademark").live("mouseover",function(){var t=$(this);if(t.hasClass("disabled"))return false;t.data("timeout",setTimeout(function(){innService.getTooltip({cache:true,params:{type:router.hover_entity.type,itemid:router.hover_entity.id},onException:function(){},onSuccess:function(A){if(router.hover_entity){var D=[],H;for(var T in A.Tooltip){H=A.Tooltip[T];
if(H===null)H="none";else if(H instanceof Date)H=Date.getUniversalDate(H);D.push({_n:T,_v:H})}A=new Tooltip({title:router.hover_entity._className,content:[new SideTable({content:D})]});router.hover_entity.type=="Patent"&&A.instance.find("tr:contains('Claims'), tr:contains('Fwd Citations'), tr:contains('Bwd Citations'),").each(function(){var F=$(this),N=F.find("td"),h=N.text(),Y,E;switch(F.find("th").text()){case "Claims":Y=b(h/26);E=(h/26).toFixed(2)+' times the average 26 claims"';break;case "Fwd Citations":Y=
b(h/5);E=(h/5).toFixed(2)+' times the average 5 forward references"';break;case "Bwd Citations":Y=b(h/18);E=(h/18).toFixed(2)+' times the average 18 backward citations"';break}N.addClass(Y).attr("title",E)});A.show(t)}}})},700))}).live("mouseout",function(){clearTimeout($(this).data("timeout"))});var c=$("#help_button");c.hover(function(){c.data("timeout",setTimeout(function(){innService.getHelptip({cache:true,params:{id:router.hover_entity.id},onException:function(){return true},onComplete:function(t){console.log(t);
(new Tooltip({title:t.result.title,color:"pink",content:[new Div({content:[t.result.description]})]})).show(c)}})},200))},function(){clearTimeout(c.data("timeout"))});var e=$("#project_info .content");e.find("a").hover(function(){var t=$(this).attr("id");e.find("a[class*='"+t+"']").addClass("related")},function(){e.find(".related").removeClass("related")});$(".try_select_skin").each(function(){selectContainer=$(this);selectContainer.removeClass(".try_select_skin");selectContainer.addClass("select_skin");
selectContainer.find("select").before('<div class="select-text">a</div>').each(function(){$(this).prev().html(this.options[0].innerHTML)});var t=selectContainer.find("select").prev();selectContainer.find("select").click(function(){t.html(this.options[this.selectedIndex].innerHTML)})});$(".view_all").click(function(){var t=$(this),A=t.parents(".panel").find(".over_flow");if(A.is(":visible")){A.slideUp();t.text("Show additional items")}else{A.slideDown();t.text("Hide additional items")}});$(".GroupedListPanel .group_header").live("click",
function(){var t=$(this).next(".items"),A=$(this).parents(".ul");t.is(":visible")?A.removeClass("open").addClass("closed"):A.removeClass("closed").addClass("open");t.slideToggle()});$("#remove_button").click(function(){router.hover_entity.deleter()});var g=$.cookie("panel_states");if(g){g=JSON.parse(g);console.log("cookie stuff",g);for(var m in g){var l,x,s;l=$(".header h2:contains('"+m+"')").parents(".panel");x=l.find(".bg").eq(1);if(g[m]=="Show"){s="Hide";x.show()}else{s="Show";x.hide()}l.find(".header .sub_nav a:contains('Hide')").text(s)}}$(".panel .header .sub_nav").find("a:contains('Hide'),a:contains('Show')").click(function(){var t,
A,D;D=$(this).parents(".panel");t=(t=$.cookie("panel_states"))?JSON.parse(t):{};A=D.find(".header h2").text();t[A]=$(this).text();$.cookie("panel_states",JSON.stringify(t));t=t[A]=="Hide"?"Show":"Hide";$(this).text(t);D.find(".bg").eq(1).slideToggle()});$("a.report_error").click(function(){u($(this).parents(".panel"))}).parents(".panel").find(".button.grey").click(function(){u($(this).parents(".panel"))}).parents(".edit_header").find(".button.green").click(function(){var t=$(this).parents(".panel"),
A=[];t.find("input:checked").each(function(){A.push(Entity.factory($(this).next()).id)});innService.reportNormalizationError({params:{currentCompanyID:router.page_entity.id,errorNorm:A},onSuccess:function(D){t.find(".message").text("These items have been reported to Innography. Thank you.");t.find(".edit_header").addClass("success");Notifier.show({message:D,type:"success"});setTimeout(function(){u(t)},2E3)},onException:function(D){t.find(".message").text("These items have been reported to Innography. Thank you.");
t.find(".edit_header").addClass("success");Notifier.show({message:D.message,type:"failure"});setTimeout(function(){u(t)},2E3)}})});var u=function(t){var A=t.find(".edit_header"),D=t.find("a.report_error");if(A.is(":visible")){D.removeClass("active").text("Report an Error");t.find(".content input").remove();t.find("li.active").removeClass("active").addClass("disabled");t.find("a").removeClass("disable_hover");A.slideUp(300,function(){A.removeClass("success");A.find(".message").text("Check the boxes of the erroneous items you'd like to report.")})}else{D.addClass("active").text("Cancel Error Report");
t.find(".content li").prepend('<input type="checkbox">').find("input").click(function(){$(this).parent().toggleClass("active")});t.find("a").addClass("disable_hover");A.slideDown()}};$("#report_an_error").click(function(){var t=new Modal({title:"Report a Normalization Error"}),A=new Form({name:"report_norm_error",action:"",method:"post",enctype:"text/plain"});A.add(new TextInput({value:"",label:"Company to which to normalize",name:"suggestion",data_type:"company",required:true,plugins:["autocomplete"]}));
A.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){A.is_ready()&&innService.reportNormalizationSuggestion({params:{currentCompanyID:router.page_entity.id,suggestion:A.fields.suggestion.val()},onSuccess:function(){Notifier.show({message:"Normalization suggestion sent.",type:"success"});t.hide(function(){t.destroy()})},onException:function(){Notifier.show({message:"An error occurred. Please try again.",type:"failure"});t.hide(function(){t.destroy()})}})}}));A.add(new Button({content:["Cancel"],
type:"cancel",on_click:function(){t.hide(function(){t.destroy()})}}));t.add(A);t.show()})});function Share(){}function getSubjectString(){return ALGORITHM_TYPE!==""?ALGORITHM_ID!=""?"Innography Research: Details of "+document.title.substr(13)+" has been shared with you":DataView.CURRENT_MODE=="grid"?"Innography Research: A list of results has been shared with you":"Innography Research: A landscape has been shared with you":document.title}
Share.page=function(){var b=new Modal({title:"Share Item"}),c=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"});c.add(new TextInput({value:"",label:"To",name:"to",required:true,data_type:"emails",validate:true}));c.add(new TextInput({value:getSubjectString(),label:"Subject",name:"subject",required:true}));c.add(new TextArea({value:"The following search information has been shared with you by an Innography user.  If you have an account, you can use the link below to go there now.",
label:"Message",name:"message",required:true}));c.add(new Button({content:["Confirm"],type:"confirm",on_click:function(){if(c.is_ready()){var e=c.fields,g="";try{g=DataView.Chart.getPng()}catch(m){}innService.sendImageByEmail({params:{to:e.to.val(),subject:e.subject.val(),message:e.message.val(),linkURL:router.location(),filerpc:g,usefilecontents:true},onException:function(){Notifier.show({message:"Could not send email",type:"failure"})},onSuccess:function(){Notifier.show({message:"Email Sent",type:"success"})}});
b.hide(function(){b.destroy()})}}}));c.add(new Button({content:["Cancel"],type:"cancel",on_click:function(){b.hide(function(){b.destroy()})}}));b.add(c);b.show()};Share.send=function(){};
$(document).ready(function(){var b=$("#add_button");$("a.Company, a.Patent, a.Litigation, a.SavedSearch, a.Trademark").live("mouseover",function(){var c=$(this);!c.hasClass("disable_hover")&&!c.hasClass("disabled")&&!c.hasClass("no_access")&&b.css({left:c.offset().left-(b.width()-1),top:c.offset().top-1}).show()});b.mousedown(function(){$(this).css("backgroundImage","url('/img/icon-add_pressed.png')")}).mouseup(function(){$(this).css("backgroundImage","url('/img/icon-add.png')")}).click(function(){$(this).data("timeout",
setTimeout(function(){ProjectItem.add(router.hover_entity)},250))}).dblclick(function(){clearTimeout($(this).data("timeout"));ProjectItem.add(router.hover_entity)})});
$(document).ready(function(){var b=$("#help_button");$(".Help").live("mouseover",function(){var c=$(this);c.data("timeout",setTimeout(function(){var e=c.offset().left+c.width();if(c.parent(".box-sliders").length>0)e=Number(e)-4;else if(c.parent().parent(".multilayer-combo").length>0)e=Number(e)+5;else if(c.parent("#refinePanel-dateRange-wrapper").length>0)e=Number(e)+5;if(e+b.width()>$(window).width())e=c.offset().left-b.width();b.css({top:c.offset().top-1,left:e}).fadeIn()},400))}).live("mouseout",
function(){clearTimeout($(this).data("timeout"))})});var Notifier=Class.extend({});Notifier.show=function(b){var c=62+$("#pager:visible").height();$(window).scrollTop()>c?notifier.css({position:"fixed",top:"0"}):notifier.css({position:"absolute",top:c+"px"});notifier.removeClass().addClass(b.type);notifier.find(".bg").html(b.message);notifier.slideDown();notifier.data("timeout",setTimeout(function(){notifier.slideUp()},3E3))};var notifier;
$(document).ready(function(){notifier=$("#notifier");var b=notifier.height();notifier.find(".close").click(function(){notifier.slideUp();clearTimeout(notifier.data("timeout"))});notifier.hover(function(){notifier.find(".close").show();notifier.height()>=b&&clearTimeout(notifier.data("timeout"))},function(){notifier.find(".close").hide();notifier.height()>=b&&notifier.data("timeout",setTimeout(function(){notifier.slideUp()},1500))})});
$(document).ready(function(){$("#add_to_project[class!='disabled']").click(function(){ProjectItem.add(router.page_entity,{})});$("#generate_report[class!='disabled']").click(function(){router.page_entity.generate_report()});$("#export[class!='disabled']").click(function(){if($(this).text()=="Export Groups")DataView.Grid&&DataView.Grid.export_groups();else router.page_entity.exporter()});$("#share[class!='disabled']").click(function(){Share.page(router.page_entity)})});
$(document).ready(function(){var b=!document.domain.match(/^((wroden)|(app))\.innography\.com/i);if(router.section=="projects")$("#item_actions").bind("opened.DropDown",function(){var e;if(current_user.hasAccess(router.subsection))switch(router.subsection){case "patents":e=[{name:"Analyze",value:"analyze"},{name:"Add to a Project",value:"add"},{name:"Modify Labels",value:"modify_labels"},{name:"Export",value:"export"},{name:"Delete",value:"delete"}];b&&e.push({name:"Create Survey",value:"create_survey"});
break;case "savedsearches":e=[{name:"Add to a Project",value:"add"},{name:"Modify Labels",value:"modify_labels"},{name:"Export",value:"export"},{name:"Delete",value:"delete"}];var g,m;$("#tableresults tr:has(:checked) .column_5").each(function(){m=$(this).text();if(g==undefined)g=m;else if(m!=g)g="Mixed"});if(g=="No")e.push({name:"Add Subscriptions",value:"add_subscriptions"});else g=="Yes"?e.push({name:"Delete Subscriptions",value:"delete_subscriptions"}):e.push({name:"Modify Subscriptions",value:"modify_subscriptions"});
break;default:e=[{name:"Add to a Project",value:"add"},{name:"Modify Labels",value:"modify_labels"},{name:"Export",value:"export"},{name:"Delete",value:"delete"}];break}else e=[{name:"Add to a Project",value:"add"},{name:"Modify Labels",value:"modify_labels"},{name:"Delete",value:"delete"}];DropDown.set_items($(this),e,false)});else{var c=[];c.push({name:"Add to a Project",value:"add"});if(router.section=="patents"){c.push({name:"Analyze",value:"analyze"});b&&c.push({name:"Create Survey",value:"create_survey"})}c.push({name:"Export",
value:"export"});DropDown.set_items($("#item_actions"),c,false)}$("#item_actions").bind("selected.DropDown",function(e){e.stopPropagation();switch($(e.target).find("a").attr("rel")){case "archive":break;case "add":ProjectItem.add(DataView.Grid.selected_items(),DataView.Grid.search_params());break;case "modify_labels":ProjectItem.modify_labels(DataView.Grid.selected_items(),DataView.Grid.search_params());break;case "delete":ProjectItem.deleter(DataView.Grid.selected_items(),DataView.Grid.search_params());
break;case "add_subscriptions":SavedSearch.add_subscriptions(DataView.Grid.selected_items(),DataView.Grid.search_params());break;case "delete_subscriptions":SavedSearch.delete_subscriptions(DataView.Grid.selected_items(),DataView.Grid.search_params());break;case "modify_subscriptions":SavedSearch.modify_subscriptions(DataView.Grid.selected_items(),DataView.Grid.search_params());break;case "analyze":Patent.analyzer();break;case "export":Entity.exporter(router.section);break;case "create_survey":(new Survey).prompt();
break}})});
URLRemap=function(){function b(y){return y>0&&y<2E7}function c(y,O,U,aa){var ga=/([^\=]+)=([^;]*);/g,la=/,?([^|]+)\|([^,]+)/g,ra,ma,sa;ga.lastIndex=la.lastIndex=0;G={__refresh__:function(){var ha,da,va;G.__by_id__={};for(ha in G.filters)if(G.filters.hasOwnProperty(ha)&&ha!="__by_id__"&&ha!="__refresh__"){da=0;for(va=G.filters[ha].length;da<va;da++)if($.inArray(ha,ka)>=0&&G.filters[ha][da].id){G.__by_id__[G.filters[ha][da].id]||(G.__by_id__[G.filters[ha][da].id]=[]);G.__by_id__[G.filters[ha][da].id].push(G.filters[ha][da])}}if(G.algo_params)for(da=0;da<
G.algo_params.length;da++)if(G.algo_params[da].id){G.__by_id__[G.algo_params[da].id]||(G.__by_id__[G.algo_params[da].id]=[]);G.__by_id__[G.algo_params[da].id].push(G.algo_params[da])}if(G.algorithm_id)if(G.algorithm_id.id){G.__by_id__[G.algorithm_id.id]||(G.__by_id__[G.algorithm_id.id]=[]);G.__by_id__[G.algorithm_id.id].push(G.algorithm_id)}if(G.queryid)if(G.queryid.id){G.__by_id__[G.queryid.id]||(G.__by_id__[G.queryid.id]=[]);G.__by_id__[G.queryid.id].push(G.queryid)}}};if(y)for(G.filters=[];ra=
ga.exec(y);){ma=ra[1];G.filters[ma]||(G.filters[ma]=[]);la.lastIndex=0;if(/\|/.test(ra[2]))for(;sa=la.exec(ra[2]);)G.filters[ma][G.filters[ma].length]={id:sa[1],label:l(sa[2]),value:0};else G.filters[ma][0]={value:ra[2]}}if(O!=""){if(!G.algo_params)G.algo_params=[];y=O.split(",");for(j=0;j<y.length;j++){O=y[j].split("|");G.algo_params.push({id:O[0],label:l(O[1]),value:0})}}if(aa!="")G.algorithm_id={id:aa,label:""};if(U!="")if(U.indexOf("A_")==0||U.indexOf("OA_")==0)G.queryid=U.split("_")[1]?{id:U.split("_")[1],
label:"",prefix:U.split("_")[0]+"_"}:null;G.__refresh__();return G}function e(){var y=[],O,U,aa,ga;for(U in G.filters)if(G.filters.hasOwnProperty(U)&&U!="__by_id__"&&U!="__refresh__"){O=[];aa=0;for(ga=G.filters[U].length;aa<ga;aa++)O[aa]=G.filters[U][aa].id+"|"+m(G.filters[U][aa].label);y[y.length]=U+"="+O.join(",")}return y.join(";")}function g(y){for(var O=[],U=0;U<y.length;U++)O.push(y[U].id+"|"+m(y[U].label));return O.join(",")}function m(y){return y.replace(/[|]+/g,"%X1").replace(/[,]+/g,"%X2").replace(/[:]+/g,
"%X3").replace(/[;]+/g,"%X4").replace(/[/]+/g,"%X5")}function l(y){y=y.replace(/(%X1)+/g,"|");y=y.replace(/(%X2)+/g,",");y=y.replace(/(%X3)+/g,":");y=y.replace(/(%X4)+/g,";");y=y.replace(/(%X5)+/g,"/");if(/\<|\>|&lt;|&gt;/g.test(y)){router.location("/error");throw new Error("Invalid URL.");}return y}function x(){G.filters.__refresh__()}function s(y){return G.filters&&G.filters[y]?G.filters[y]:[]}function u(y){return G.__by_id__[y]}function t(y){return G.filters&&G.filters[y]&&G.filters[y][0]?G.filters[y][0].value:
""}function A(y){y=G.filters&&G.filters[y]&&G.filters[y][0]?G.filters[y][0].value:"";if(/:/.test(y)){y=y.split(":");return{min:y[0],max:y[1]}}else return{min:"",max:"",preset:y}}function D(y){y=G.filters&&G.filters[y]&&G.filters[y][0]?G.filters[y][0].value:"";if(/:/.test(y)){y=y.split(":");return{min:y[0],max:y[1]}}else return{min:"",max:"",preset:y}}function H(y){if(!y)return false;return!(y.min==""&&y.max==""&&y.preset=="")}function T(y){var O=[];for(i in G.filters)G.filters.hasOwnProperty(i)&&
i!="__by_id__"&&i!="__refresh__"&&$.inArray(i,y)==-1&&O.push(i+"="+G.filters[i][0]);return O}function F(y){console.log(y);console.log(G);for(var O=0;O<y.length;O++)if(G.__by_id__[y[O].oldid])for(var U=0,aa=G.__by_id__[y[O].oldid].length;U<aa;U++)if(y[O].newid){y[O].newid==-1&&ja.push(G.__by_id__[y[O].oldid][U].label);G.__by_id__[y[O].oldid][U].id=y[O].newid;G.__by_id__[y[O].oldid][U].label=y[O].newname?y[O].newname:""}else{G.__by_id__[y[O].oldid][U].id=0;G.__by_id__[y[O].oldid][U].label="unknown"}console.log(G)}
function N(y){var O=[],U=0,aa=y.length;a:for(;U<aa;U++){for(var ga=0,la=O.length;ga<la;ga++)if(O[ga].id==y[U].id||y[U].id==-1)continue a;O[O.length]=y[U]}return O}function h(){var y=new Modal({title:"Companies Unavailable"}),O=new Form({name:"my_form",action:"",method:"post",enctype:"text/plain"});O.add(new Div({content:["The following companies were dropped from your query due to a system error. This error has been reported to Innography support."]}));O.add(new List({content:ja}));O.add(new Button({content:["Close"],
type:"confirm",on_click:function(){y.hide(function(){y.destroy()})}}));y.add(O);y.show()}function Y(){if(G.filters)for(i in G.filters)if(G.filters.hasOwnProperty(i)&&i!="__by_id__"&&i!="__refresh__")G.filters[i]=N(G.filters[i]);if(G.algo_params)G.algo_params=N(G.algo_params)}function E(){console.log("generating URL");var y=[];if(G.queryid)y.push("search_string="+G.queryid.prefix+router.encode(G.queryid.id));else router.GET.search_string&&y.push("search_string="+router.encode(router.GET.search_string));
console.log("1000");G.filters&&y.push("filters="+router.encode(e(G.filters))+"%3B");console.log("1010");G.algo_params&&y.push("algoparams="+router.encode(g(G.algo_params)));console.log("1020");G.algorithm_id&&y.push("algorithm_id="+router.encode(G.algorithm_id.id));console.log("1030");for(i in router.GET)i!="filters"&&i!="algoparams"&&i!="search_string"&&i!="algorithm_id"&&y.push(i+"="+router.GET[i]);y="https://"+document.domain+router.path+"#/"+y.join("&");console.log("newloc");console.log(y);console.log(ja);
router.location(y);ja.length>0&&h()}function Q(){var y=[];if(G.filters)for(i in G.filters){console.log(i);if(G.filters.hasOwnProperty(i)&&i!="__by_id__"&&i!="__refresh__"&&$.inArray(i,ka)>=0)for(var O=0;O<G.filters[i].length;O++)b(Number(G.filters[i][O].id))&&y.push(G.filters[i][O].id)}if(router.section=="companies"){G.algorithm_id&&b(Number(G.algorithm_id.id))&&y.push(G.algorithm_id.id);if(G.algo_params)for(O=0;O<G.algo_params.length;O++)b(Number(G.algo_params[O].id))&&y.push(G.algo_params[O].id)}G.queryid&&
b(Number(G.queryid.id))&&y.push(G.queryid.id);return y}function ia(y){y=y.join(",");innService.getOrganizationRemap({params:{oldids:y},onSuccess:function(O){F(O);Y();E()},onException:function(){}})}function na(y){console.log(y);c(y.filters,y.algorithm_params,y.query,y.algorithm_id);console.log("_url_params");console.log(G);y=Q();console.log("toRemap");console.log(y);if(y.length>0){ia(y);return false}else return true}var G,ja=[],ka=["organization","originalOrganization","plaintiffid","defendantid",
"partyid"];return{encode_url_params:e,decode_url_params:c,encodeRefineLabel:m,decodeRefineLabel:l,refreshFilterIdCache:x,getFilterData:s,getFilterDataById:u,getFilterValue:t,getFilterValueRange:A,getFilterDateRange:D,collectStrangeFilters:T,validRange:H,init:na}}();
var start_search_string=router.GET.search_string?router.GET.search_string:"",startGroup=router.GET.group?router.GET.group:"",startView=router.GET.view?router.GET.view:"",startSort=router.GET.sort?router.GET.sort:"",startFilters=router.GET.filters?router.GET.filters:"",ALGORITHM_ID="",ALGORITHM_TYPE="",ALGORITHM_MODE="",ALGORITHM_URL_PARAMS="",ALGORITHM_SELECTION_PARAMS="";
if(router.GET.algorithm_type||router.subsection=="analysis"||router.subsection=="portfolio"){ALGORITHM_ID=router.entity?router.entity:"";ALGORITHM_TYPE=router.section?router.section:"";if(router.GET.algorithm_type)ALGORITHM_TYPE=router.GET.algorithm_type;if(router.GET.algorithm_id)ALGORITHM_ID=router.GET.algorithm_id;console.log("router.subsection="+router.subsection);console.log("router.GET.algorithm_mode="+router.GET.algorithm_mode);ALGORITHM_MODE=router.GET.algorithm_mode?router.GET.algorithm_mode:
router.subsection?router.subsection:"";ALGORITHM_URL_PARAMS=ALGORITHM_MODE=="virtualentity"||ALGORITHM_MODE=="comparison"?router.GET.algoparams:null;ALGORITHM_SELECTION_PARAMS=router.GET.algorithm_params?router.GET.algorithm_params:""}else ALGORITHM_MODE=ALGORITHM_TYPE=ALGORITHM_ID="";URLRemap.init({query:start_search_string,filters:startFilters,algorithm_id:ALGORITHM_ID,algorithm_params:ALGORITHM_URL_PARAMS?ALGORITHM_URL_PARAMS:""});
$.fn.hintInput=function(b){var c={dataProvider:[],mode:"AT",autocomplete_container:"",autocompleteTriggers:[64,43],empty_message:"Enter Keywords",minChars:3,lineHeight:16,submitOnBlur:true,automaticClean:true,cssBase:"hintInput",classInputFocusIn:"-inputFocusIn",classInputFocusOut:"-inputFocusOut",initialValue:"",minLines:1,autoExpand:true,expandOnSetValue:true,charWidth:8,onchange:function(){},onopen:function(){},onclose:function(){},onblur:function(){},onGetList:function(){},triggerSubmit:function(){},
onInvalidSubmit:function(){}};return this.each(function(){function e(){$(E).append('<div class="'+E.options.cssBase+'-list" style="display:none;"></div>');$(E).addClass(E.options.cssBase);E.ctrl=$(E).find("textarea").get(0);E.options.dataProvider.length>0&&E.setDataProvider(E.options.dataProvider);$(E).data("status","closed");E.options.minLines>1&&Y(E.options.minLines);E.setValue(E.options.initialValue)}function g(){ja=true;setTimeout(function(){ja=false},1E3)}function m(y){for(var O="",U=$("<ul></ul>"),
aa=0;aa<y.length;aa++)O+=E.getMode()=="AT"?'<li id="hi_'+aa+'"><span class="list-value">'+y[aa].value+'</span><span class="list-label">'+y[aa].label+"</span></li>":'<li id="hi_'+aa+'"><span class="list-value" style="display:none">'+y[aa].value+'</span><span class="list-label">'+y[aa].label+"</span></li>";U.append(O);$(E).find("."+E.options.cssBase+"-list").html(U)}function l(y){y=$(E).find("li#hi_"+y+" .list-label").html();var O=u(),U=$(E).find("textarea").val();O=U.substr(0,na)+y+U.substr(na+O.length);
y=na+y.length;$(E).find("textarea").val(O);E.setCaractPosition(y);h()}function x(y){var O=$(E).find("li#hi_"+y+" .list-label").html();y=$(E).find("li#hi_"+y+" .list-value").html();$(E).find("textarea").val(O);E.options.triggerSubmit({element:E,text:E.getValue(),id:y});g()}function s(y){if(E.getMode()=="AT")l(y);else E.getMode()=="AC"&&x(y)}function u(){return $(E).find("textarea").val().substr(na,E.getCaractPosition()-na)}function t(y){for(var O=[],U=0;U<E.options.dataProvider.length;U++)E.options.dataProvider[U].label.indexOf(y)>=
0&&O.push(E.options.dataProvider[U]);return O}function A(){E.setDataProvider(E.options.dataProvider)}function D(y){if(y<0)G>0&&E.selectIt(G-1);else Number(G)+1<E.options.dataProvider.length&&E.selectIt(G+1)}function H(y){arr=y.split("_");if(arr.length<2)return-1;return Number(arr[1])}function T(){$(E).find("li").hover(function(){var y=H($(this).attr("id"));E.selectIt(y)},function(){}).click(function(y){y.stopPropagation();E.close();G>=0&&s(G)})}function F(y){y.focus();if(typeof y.selectionStart==
"number")return y.selectionStart;else if(document.selection){var O=document.selection.createRange().duplicate();if(O.parentElement()==y){var U=document.body.createTextRange();U.moveToElementText(y);U.setEndPoint("EndToStart",O);var aa=document.body.createTextRange();aa.moveToElementText(y);aa.setEndPoint("StartToEnd",O);var ga=y=false,la=false,ra,ma,sa,ha,da,va;ra=ma=U.text;sa=ha=O.text;da=va=aa.text;do{if(!y)if(U.compareEndPoints("StartToEnd",U)===0)y=true;else{U.moveEnd("character",-1);if(U.text==
ra)ma+="\r\n";else y=true}if(!ga)if(O.compareEndPoints("StartToEnd",O)===0)ga=true;else{O.moveEnd("character",-1);if(O.text==sa)ha+="\r\n";else ga=true}if(!la)if(aa.compareEndPoints("StartToEnd",aa)===0)la=true;else{aa.moveEnd("character",-1);if(aa.text==da)va+="\r\n";else la=true}}while(!y||!ga||!la);return ma.length}}}function N(){var y=$(E).find("textarea").width();return Math.floor(y/E.options.charWidth)}function h(){var y;if(E.options.autoExpand){y=$(E).find("textarea").val();if(y===""||y==E.options.empty_message)y=
E.options.minLines;else{y=Math.ceil(y.length/N());if(y===0)y=1}y!=ia&&Y(y)}}function Y(y){if(y<E.options.minLines)y=E.options.minLines;var O=y==1?E.options.lineHeight:20*y;$(E).find("textarea").css("height",O+"px");ia=y}var E=this;$(this);var Q=false;this.options=$.extend(c,b);this.ctrl=null;this.mode=this.options.mode;var ia=1,na=0,G=-1,ja=false,ka;$(document).click(function(){if($(E).data("status")=="open"){E.close();$(E).find("textarea").focus()}});$(document).keydown(function(y){var O=y.keyCode;
if(O==38||O==40||O==13)if($(E).data("status")=="open")switch(y.keyCode){case 38:y.preventDefault();D(-1);break;case 40:y.preventDefault();D(1);break;case 13:Q=true;G>=0&&s(G);y.preventDefault();E.close();break}else y.keyCode==13&&$(E).find("textarea").get(0).isFocused&&y.preventDefault()});$(E).find("textarea").each(function(){this.REFINE_KEYWORDS_MESSAGE=E.options.empty_message;$this=$(this);$(this).addClass(E.options.cssBase+E.options.classInputFocusOut);$(this).val(this.REFINE_KEYWORDS_MESSAGE).focus(function(){this.isFocused=
true;if($(this).val()==this.REFINE_KEYWORDS_MESSAGE){$(this).val("");$(this).addClass(E.options.cssBase+E.options.classInputFocusIn);$(this).removeClass(E.options.cssBase+E.options.classInputFocusOut)}}).keyup(function(y){if(y.keyCode==13){if(!Q){if($(this).val()!=E.options.initialValue)if(E.getMode()=="AT")E.options.triggerSubmit({element:E,text:this.getValue(),id:null});else if(E.getMode()=="AC")ja||E.options.onInvalidSubmit();E.options.initialValue=$(this).val()}}else h();Q=false}).blur(function(){this.isFocused=
false;if($(E).data("status")!="open"){var y=$(this).val();E.options.onblur(y);if(y===""){$(this).val(this.REFINE_KEYWORDS_MESSAGE);$(this).removeClass(E.options.cssBase+E.options.classInputFocusIn);$(this).addClass(E.options.cssBase+E.options.classInputFocusOut)}y!=E.options.initialValue&&E.getMode()=="AT"&&E.options.submitOnBlur&&E.options.triggerSubmit({element:E,text:this.getValue(),id:null});E.options.initialValue=y}}).change(function(){});this.getValue=function(){return $(this).val()==this.REFINE_KEYWORDS_MESSAGE?
"":$(this).val()};this.setValue=function(y){if(y===""&&!this.isFocused){$(this).val(this.REFINE_KEYWORDS_MESSAGE);$(this).addClass(E.options.cssBase+E.options.classInputFocusOut);$(this).removeClass(E.options.cssBase+E.options.classInputFocusIn)}else{$(this).val(y);$(this).removeClass(E.options.cssBase+E.options.classInputFocusOut);$(this).addClass(E.options.cssBase+E.options.classInputFocusIn)}}});$(E).find("textarea").keypress(function(y){if(E.getMode()=="AT")if($.inArray(y.charCode?y.charCode:
y.keyCode,E.options.autocompleteTriggers)>=0){na=E.getCaractPosition();E.open()}}).keyup(function(y){if(E.getMode()=="AT")$(E).data("status")=="open"&&y.keyCode!=38&&y.keyCode!=13&&y.keyCode!=40&&A();else if(E.getMode()=="AC")if(y.keyCode!=38&&y.keyCode!=13&&y.keyCode!=40)if(E.getValue().length>=E.options.minChars){ka&&clearTimeout(ka);$(E).find(".topAC-list").html("<ul><li>Loading... please wait.</li></ul>").show();ka=setTimeout(function(){E.options.onGetList({element:E,text:E.getValue()})},500)}else E.close()});
this.setDataProvider=function(y){E.options.dataProvider=y;if(E.getMode()=="AT"){y=u();y=t(y);if(y.length>0){m(y);T();E.selectIt(0)}else E.close()}else if(E.getMode()=="AC")if(y.length>0){m(y);T();E.selectIt(0)}else E.close()};this.unselectIt=function(y){$(E).find("li#hi_"+y).removeClass("hiSelected")};this.selectIt=function(y){G>=0&&E.unselectIt(G);$(E).find("li#hi_"+y).addClass("hiSelected");G=y};this.open=function(){E.options.onopen();$(E).find("."+E.options.cssBase+"-list").show();$(E).data("status",
"open")};this.close=function(){console.log("trying to close");E.options.onclose();$(E).find("."+E.options.cssBase+"-list").hide();$(E).data("status","closed")};this.getValue=function(){var y=$(E).find("textarea").get(0).getValue();if(E.options.automaticClean)y=y.substitute_plaintext_chars();return y};this.setValue=function(y){if(E.options.automaticClean)y=y.substitute_plaintext_chars();$(E).find("textarea").get(0).setValue(y);E.options.expandOnSetValue&&h()};this.getMode=function(){return E.mode};
this.setMode=function(y){console.info("setMode called: "+y);E.mode=y;E.options.initialValue=""};this.clearAll=function(){E.setValue("");E.options.initialValue=""};this.forceSubmit=function(){if(E.getValue()!="")if(E.getMode()=="AT")E.options.triggerSubmit({element:E,text:E.getValue(),id:null});else E.getMode()=="AC"&&E.options.onInvalidSubmit()};this.getCaractPosition=function(){return F(E.ctrl)};this.getCaractPosition_old=function(){var y=0;if(document.selection){E.ctrl.focus();y=document.selection.createRange();
y.moveStart("character",-E.ctrl.value.length);y=y.text.length}else if(E.ctrl.selectionStart||E.ctrl.selectionStart=="0")y=E.ctrl.selectionStart;return y};this.setCaractPosition=function(y){if(E.ctrl.setSelectionRange){E.ctrl.focus();E.ctrl.setSelectionRange(y,y)}else if(E.ctrl.createTextRange){var O=E.ctrl.createTextRange();O.collapse(true);O.moveEnd("character",y);O.moveStart("character",y);O.select()}};e()})};
$(document).ready(function(){function b(g){for(var m=[],l=0;l<g.length;l++)m.push({label:g[l].Company.name,value:g[l].Company.id});return m}$("#search_string_wrapper").hintInput({lineHeight:20,mode:"AC",initialValue:"",submitOnBlur:false,autocompleteTriggers:[64],charWidth:7,lineHeight:17,empty_message:"",cssBase:"topAC",dataProvider:[{label:"@title",value:"Title"},{label:"@organization",value:"Organization"},{label:"@originalorganization",value:"Original Organization"},{label:"@organizationName",
value:"Current Assignee (text)"}],onchange:function(g){console.log(g);alert("clicked on item ")},onopen:function(){},triggerSubmit:function(g){g.element.lastSearch=g;$.trim($("#current_scope").text())=="Patent Number"?innService.getPatentId({cache:true,params:{identifier:g.text},onException:function(){router.location($(this).attr("action")+"#/"+$(this).serialize());return true},onSuccess:function(m){m==0?Notifier.show({message:"Not a valid Patent #",type:"failure"}):submitTopSearch("/patents/"+m)}}):
submitTopSearch()},onGetList:function(g){innService.getAutoCompleteData({cache:true,params:{type:"Company",value:g.text},elementID:g.text,onException:function(m){console.log("Autocomplete Exception ",m)},onSuccess:function(m,l){if(l==g.element.getValue()){m=b(m);if(m.length>0){g.element.setDataProvider(m);g.element.open()}else $(g.element).find(".topAC-list").html("<ul><li>No match found.</li></ul>").show()}}})},onInvalidSubmit:function(){Notifier.show({message:"Please choose a company from the autocomplete list.",
type:"failure"})}});var c=$.cookie.json("forms","global");c=c&&c.main_search?c.main_search:"";var e=c.replace(" "," <span>")+"</span>";switch(c){case "Patent Keywords":case "Litigation Keywords":case "Patent Number":case "Company Name":case "Trademark Keywords":break;default:c=$.trim($("#search_scope li:eq(1)").text());e=$("#search_scope li:eq(1)").html();break}setTopACMode(c);$("#current_scope").html(e)});var Algorithm=null;
function AlgorithmClass(){var b="";this.setAlgorithm=function(c){b=c};this.getAlgorithm=function(){return b}}$(document).ready(function(){Algorithm=new AlgorithmClass});
(function(b){b.widget("ui.slider",b.extend({},b.ui.mouse,{_init:function(){var c=this,e=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=b([]);if(e.range){if(e.range===true){this.range=b("<div></div>");if(!e.values)e.values=[this._valueMin(),this._valueMin()];if(e.values.length&&e.values.length!=2)e.values=[e.values[0],e.values[0]]}else this.range=
b("<div></div>");this.range.appendTo(this.element).addClass("ui-slider-range");if(e.range=="min"||e.range=="max")this.range.addClass("ui-slider-range-"+e.range);this.range.addClass("ui-widget-header")}b(".ui-slider-handle",this.element).length==0&&b('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle");if(e.values&&e.values.length)for(;b(".ui-slider-handle",this.element).length<e.values.length;)b('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle");this.handles=
b(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")}).focus(function(){b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(g){b(this).data("index.ui-slider-handle",
g)});this.handles.keydown(function(g){var m=true,l=b(this).data("index.ui-slider-handle");if(!c.options.disabled){switch(g.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:m=false;if(!c._keySliding){c._keySliding=true;b(this).addClass("ui-state-active");c._start(g,l)}break}var x,s,u=c._step();x=c.options.values&&c.options.values.length?(s=c.values(l)):(s=c.value());switch(g.keyCode){case b.ui.keyCode.HOME:s=
c._valueMin();break;case b.ui.keyCode.END:s=c._valueMax();break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(x==c._valueMax())return;s=x+u;break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(x==c._valueMin())return;s=x-u;break}c._slide(g,l,s);return m}}).keyup(function(g){var m=b(this).data("index.ui-slider-handle");if(c._keySliding){c._stop(g,m);c._change(g,m);c._keySliding=false;b(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();
this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(c){var e=this.options;if(e.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var g={x:c.pageX,y:c.pageY},m=this._normValueFromMouse(g),l=this._valueMax()-this._valueMin()+1,x,s=this,
u;this.handles.each(function(t){var A=Math.abs(m-s.values(t));if(l>A){l=A;x=b(this);u=t}});if(e.range==true&&this.values(1)==e.min)x=b(this.handles[++u]);this._start(c,u);s._handleIndex=u;x.addClass("ui-state-active").focus();e=x.offset();this._clickOffset=!b(c.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:c.pageX-e.left-x.width()/2,top:c.pageY-e.top-x.height()/2-(parseInt(x.css("borderTopWidth"),10)||0)-(parseInt(x.css("borderBottomWidth"),10)||0)+(parseInt(x.css("marginTop"),
10)||0)};m=this._normValueFromMouse(g);this._slide(c,u,m);return true},_mouseStart:function(){return true},_mouseDrag:function(c){var e=this._normValueFromMouse({x:c.pageX,y:c.pageY});this._slide(c,this._handleIndex,e);return false},_mouseStop:function(c){this.handles.removeClass("ui-state-active");this._stop(c,this._handleIndex);this._change(c,this._handleIndex);this._clickOffset=this._handleIndex=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?
"vertical":"horizontal"},_normValueFromMouse:function(c){var e;if("horizontal"==this.orientation){e=this.elementSize.width;c=c.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{e=this.elementSize.height;c=c.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}e=c/e;if(e>1)e=1;if(e<0)e=0;if("vertical"==this.orientation)e=1-e;c=this._valueMax()-this._valueMin();c=e*c;e=c%this.options.step;c=this._valueMin()+c-e;if(e>this.options.step/2)c+=this.options.step;
return parseFloat(c.toFixed(5))},_start:function(c,e){var g={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){g.value=this.values(e);g.values=this.values()}this._trigger("start",c,g)},_slide:function(c,e,g){if(this.options.values&&this.options.values.length){var m=this.values(e?0:1);if(e==0&&g>=m||e==1&&g<=m)g=m;if(g!=this.values(e)){m=this.values();m[e]=g;m=this._trigger("slide",c,{handle:this.handles[e],value:g,values:m});this.values(e?0:1);m!==false&&
this.values(e,g,c.type=="mousedown"&&this.options.animate,true)}}else if(g!=this.value()){m=this._trigger("slide",c,{handle:this.handles[e],value:g});m!==false&&this._setData("value",g,c.type=="mousedown"&&this.options.animate)}},_stop:function(c,e){var g={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){g.value=this.values(e);g.values=this.values()}this._trigger("stop",c,g)},_change:function(c,e){var g={handle:this.handles[e],value:this.value()};if(this.options.values&&
this.options.values.length){g.value=this.values(e);g.values=this.values()}this._trigger("change",c,g)},value:function(c){if(arguments.length){this._setData("value",c);this._change(null,0)}return this._value()},values:function(c,e,g,m){if(arguments.length>1){this.options.values[c]=e;this._refreshValue(g);m||this._change(null,c)}return arguments.length?this.options.values&&this.options.values.length?this._values(c):this.value():this._values()},_setData:function(c,e,g){b.widget.prototype._setData.apply(this,
arguments);switch(c){case "orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(g);break;case "value":this._refreshValue(g);break}},_step:function(){return this.options.step},_value:function(){var c=this.options.value;if(c<this._valueMin())c=this._valueMin();if(c>this._valueMax())c=this._valueMax();return c},_values:function(c){if(arguments.length){var e=this.options.values[c];if(e<this._valueMin())e=
this._valueMin();if(e>this._valueMax())e=this._valueMax();return e}else return this.options.values},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(c){var e=this.options.range,g=this.options,m=this;if(this.options.values&&this.options.values.length)this.handles.each(function(u){var t=(m.values(u)-m._valueMin())/(m._valueMax()-m._valueMin())*100,A={};A[m.orientation=="horizontal"?"left":"bottom"]=t+"%";b(this).stop(1,1)[c?"animate":
"css"](A,g.animate);if(m.options.range===true)if(m.orientation=="horizontal"){u==0&&m.range.stop(1,1)[c?"animate":"css"]({left:t+"%"},g.animate);u==1&&m.range[c?"animate":"css"]({width:t-lastValPercent+"%"},{queue:false,duration:g.animate})}else{u==0&&m.range.stop(1,1)[c?"animate":"css"]({bottom:t+"%"},g.animate);u==1&&m.range[c?"animate":"css"]({height:t-lastValPercent+"%"},{queue:false,duration:g.animate})}lastValPercent=t});else{var l=this.value(),x=this._valueMin(),s=this._valueMax();l=s!=x?(l-
x)/(s-x)*100:0;x={};x[m.orientation=="horizontal"?"left":"bottom"]=l+"%";this.handle.stop(1,1)[c?"animate":"css"](x,g.animate);e=="min"&&this.orientation=="horizontal"&&this.range.stop(1,1)[c?"animate":"css"]({width:l+"%"},g.animate);e=="max"&&this.orientation=="horizontal"&&this.range[c?"animate":"css"]({width:100-l+"%"},{queue:false,duration:g.animate});e=="min"&&this.orientation=="vertical"&&this.range.stop(1,1)[c?"animate":"css"]({height:l+"%"},g.animate);e=="max"&&this.orientation=="vertical"&&
this.range[c?"animate":"css"]({height:100-l+"%"},{queue:false,duration:g.animate})}}}));b.extend(b.ui.slider,{getter:"value values",version:"1.7.1",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);
$.fn.advancedSlider=function(b){var c=$.extend({minVal:0,maxVal:100,dateSlider:true,onslider:function(){RefinePanel.triggerRefineEvent()}},b);return this.each(function(){function e(){$(s).data("sliderEnabled",true);$(s).data("activeHub",true);$(s).html("<div class='ui-slider-handle'></div><div class='ui-slider-handle'></div><div class='ui-slider-legend-1'>Low</div><div class='ui-slider-legend-2'>High</div><div class='showtip min'>"+c.minVal+"</div><div class='showtip max'>"+c.maxVal+"</div><div class='showbigtip'>   <div class='ui-slider-popupMessage'><center>Enter a date</center></div>   <div class='ui-slider-inputs'><input name='date' maxlength='2' type='text' class='ui-popup-input' /><input name='date' maxlength='2' type='text' class='ui-popup-input' /><input name='date' maxlength='4' type='text' class='ui-popup-input year' /></div></div>");
$(s).addClass("ui-slider");$(s).keyup(function(u){if(u.keyCode==27){$(".showbigtip",s).fadeOut();$(s).slider("enable");$(s).data("sliderEnabled",true)}});$(".showbigtip input",s).keyup(function(u){if(u.keyCode==27){$(".showbigtip",s).fadeOut();$(s).slider("enable");$(s).data("sliderEnabled",true)}else{$(".ui-slider-popupMessage",s).html("<center><a class='cancelData btnTooltip'>cancel</a> | <a class='submitData btnTooltip'>submit</a></center>");$(".submitData",s).click(function(){$(".showbigtip",
s).hide();$(".ui-slider-inputs input",s).each(x);$(s).slider("enable");$(s).slider("moveTo",$(s).data("totalMove"),$(s).data("currentHandle"));$(s).data("sliderEnabled",true)});$(".btnTooltip",s).css({cursor:"pointer"})}});$(".ui-slider-handle:last",s).css({left:$(s).width()-14+"px"});$(".ui-slider-handle",s).css({cursor:"pointer"});$("div.showtip.max",s).html(c.maxVal);$(".showtip",s).hide();$(".showbigtip",s).hide();$(".ui-slider-handle",s).css({cursor:"pointer"})}function g(){$(".ui-slider-handle",
s).mouseover(function(){if(!$(s).data("sliderEnabled"))return null;var u=$(this).position();if($(".ui-slider-handle",s).index(this)===0){$(".showtip:first",s).css({top:u.top-25,left:u.left-10});$(".showtip:first",s).show()}else{$(".showtip:last",s).css({top:u.top-25,left:u.left-10});$(".showtip:last",s).show()}});$(".ui-slider-handle",s).mouseout(function(){if(!$(s).data("sliderEnabled"))return null;$(".showtip",s).hide()});if(c.dateSlider){$(".ui-slider-legend-1",s).html(c.minVal===0?"0":c.minVal);
$(".ui-slider-legend-2",s).html(c.maxVal);$(".ui-slider-handle",s).dblclick(function(){if(!$(s).data("sliderEnabled"))return null;$(s).data("sliderEnabled",false);$(s).data("currentHandle",this);$(s).slider("disable");$(".showtip").hide();var u=$(this).position();$(".showbigtip",s).css({top:u.top-45,left:u.left-35});$(".ui-slider-popupMessage",s).html("<center>Enter a date</center>");$(".ui-popup-input",s).val("");$(".showbigtip",s).show();$(".ui-popup-input:first",s).focus()})}$(s).slider({range:true,
min:l(),max:m(),values:[l(),m()],animated:true,change:function(){$("div.showtip.min",s).html(s.getSliderVal(0));$("div.showtip.max",s).html(s.getSliderVal(1));$(s).data("activeHub")&&c.onslider({min:s.getSliderVal(0),max:s.getSliderVal(1)})},slide:function(){$("div.showtip.min",s).html(s.getSliderVal(0));$("div.showtip.max",s).html(s.getSliderVal(1));$(".ui-slider-handle",s).mouseover()}});$(window).bind("resize",function(){$(s).data("activeHub",false);var u=c.dateSlider?s.getSliderVal(1)*365.25:
s.getSliderVal(1);$(s).slider("moveTo",u,$(".ui-slider-handle:last",s));$(".showtip",s).hide();$(s).data("activeHub",true)})}function m(){return c.dateSlider?c.maxVal*365.25:c.maxVal}function l(){return c.dateSlider?c.minVal*365.25:c.minVal}function x(){var u=0;if($(".ui-slider-inputs input",s).index(this)==2){u+=32-(new Date(parseInt($(this).val(),10),parseInt($(".ui-slider-inputs input:eq(1)",s).val(),10),32)).getDate();u+=parseInt($(".ui-slider-inputs input:eq(0)",s).val(),10);u+=parseInt($(this).val(),
10)*365.25;$(s).data("totalMove",u)}}var s=this;this.getRange=function(){var u=s.getSliderVal(0)!=c.minVal||s.getSliderVal(1)!=c.maxVal;return{min:s.getSliderVal(0),max:s.getSliderVal(1),changed:u}};this.setRange=function(u){$(s).data("activeHub",false);minVal=c.dateSlider?u.min*365.25:u.min;maxVal=c.dateSlider?u.max*365.25:u.max;$(s).slider("values",0,minVal);$(s).slider("values",1,maxVal);$(s).data("activeHub",true)};this.getSliderVal=function(u){return c.dateSlider?$(s).slider("values",u)===0?
"0":Math.round($(s).slider("values",u)/365.25):$(s).slider("values",u)===0?"0":Math.round($(s).slider("values",u))};this.lock=function(){$(s).slider("disable");$(s).parent().parent().siblings("p").attr("style","color:#AAAAAA")};this.unlock=function(){$(s).slider("enable");$(s).parent().parent().siblings("p").removeAttr("style")};e();g()})};