Skip to content

Instantly share code, notes, and snippets.

@SlexAxton
Created April 1, 2014 18:05
Show Gist options
  • Save SlexAxton/9919620 to your computer and use it in GitHub Desktop.
Save SlexAxton/9919620 to your computer and use it in GitHub Desktop.
An updated copy of American Expresses code on the recent activity page with some errors removed.
This file has been truncated, but you can view the full file.
/* jQuery v1.7.1 jquery.com | jquery.org/license */
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement){cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close()
}d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;
for(g=1;g<i;g++){if(g===1){for(h in a.converters){typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h])}}l=k,k=d[g];if(k==="*"){k=l}else{if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g){i in d&&(c[g[i]]=d[i])
}while(f[0]==="*"){f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"))}if(h){for(i in e){if(e[i]&&e[i].test(h)){f.unshift(i);break}}}if(f[0] in d){j=f[0]}else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b)){f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)})}else{if(!c&&b!=null&&typeof b=="object"){for(var e in b){ca(a+"["+e+"]",b[e],c,d)
}}else{d(a,b)}}}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c){c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d])}e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++){l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)))}(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;
for(;e<g;e++){h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border"){for(;g<h;g++){c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0}}return d+"px"}d=bz(a,b,b);if(d<0||d==null){d=a.style[b]||0}d=parseFloat(d)||0;if(c){for(;g<h;g++){d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0)
}}return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio"){a.defaultChecked=a.checked
}}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object"){b.outerHTML=a.outerHTML}else{if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option"){b.selected=a.defaultSelected}else{if(c==="input"||c==="textarea"){b.defaultValue=a.defaultValue
}}}else{a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)}}b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i){for(d=0,e=i[c].length;d<e;d++){f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}}}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a
}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement){while(b.length){c.createElement(b.pop())}}return c}function T(a,b,c){b=b||0;if(f.isFunction(b)){return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c})}if(b.nodeType){return f.grep(a,function(a,d){return a===b===c})}if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b)){return f.filter(b,d,!c)}b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return !a||!a.parentNode||a.parentNode.nodeType===11
}function K(){return !0}function J(){return !1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b])){continue}if(b!=="toJSON"){return !1}}return !0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d
}catch(g){}f.data(a,c,d)}else{d=b}}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++){b[a[c]]=!0}return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()
},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a){return this}if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];
if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2]){return f.find(a)}this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return !d||d.jquery?(d||f).find(a):this.constructor(d).find(a)
}if(e.isFunction(a)){return f.ready(a)}a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");
return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;
typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++){if((a=arguments[j])!=null){for(c in a){d=i[c],f=a[c];if(i===f){continue}l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}}}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)
},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body){return setTimeout(e.ready,1)}e.isReady=!0;if(a!==!0&&--e.readyWait>0){return}A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete"){return setTimeout(e.ready,1)}if(c.addEventListener){c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1)}else{if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);
var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval" in a},isNumeric:function(a){return !isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a)){return !1}try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf")){return !1
}}catch(c){return !1}var d;for(d in a){}return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a){return !1}return !0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b){return null}b=e.trim(b);if(a.JSON&&a.JSON.parse){return a.JSON.parse(b)}if(n.test(b.replace(o,"@").replace(p,"]").replace(q,""))){return(new Function("return "+b))()}e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))
}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a){if(c.apply(a[f],d)===!1){break}}}else{for(;
g<h;){if(c.apply(a[g++],d)===!1){break}}}}else{if(i){for(f in a){if(c.call(a[f],f,a[f])===!1){break}}}else{for(;g<h;){if(c.call(a[g],g,a[g++])===!1){break}}}}return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H){return H.call(b,a,c)
}d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++){if(c in b&&b[c]===a){return c}}}return -1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number"){for(var f=c.length;e<f;e++){a[d++]=c[e]}}else{while(c[e]!==b){a[d++]=c[e++]}}a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++){e=!!b(a[f],f),c!==e&&d.push(a[f])}return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));
if(k){for(;i<j;i++){f=c(a[i],i,d),f!=null&&(h[h.length]=f)}}else{for(g in a){f=c(a[g],g,d),f!=null&&(h[h.length]=f)}}return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a)){return b}var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c){e.access(a,j,c[j],f,g,d)}return a}if(d!==b){f=!h&&f&&e.isFunction(d);
for(var k=0;k<i;k++){g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h)}return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));
return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())
});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++){g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)}},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++){if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))
}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++){for(var f=0;f<c.length;f++){if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique){break}}}}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++){if(a===c[b]){return !0}}}return !1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return !c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return !d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));
return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return !!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);
return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null){a=h}else{for(var b in h){a[b]=h[b]}}return a}},i=h.promise({}),j;for(j in g){i[j]=g[j].fire,i[j+"With"]=g[j].fireWith
}i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++){b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g
}g||j.resolveWith(j,b)}else{j!==a&&j.resolveWith(j,d?[a]:[])}return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e){return{}}g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;
try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);
if(q.attachEvent){for(o in {submit:1,change:1,focusin:1}){n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p}}k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div><table "+n+" cellpadding='0' cellspacing='0'><tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))
});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return !!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b){return
}n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function"){e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c)}g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c]){return g.events}k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k]){return}if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));
for(e=0,g=b.length;e<g;e++){delete d[b[e]]}if(!(c?m:f.isEmptyObject)(d)){return}}}if(!c){delete j[k].data;if(!m(j[k])){return}}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b){return b!==!0&&a.getAttribute("classid")===b}}return !0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;
if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++){g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]))}f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object"){return this.each(function(){f.data(this,a)})}d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));
return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))
}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b){return f.queue(this[0],a)
}return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;
while(g--){if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0)){h++,l.add(m)}}m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)
},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a)){return this.each(function(b){f(this).addClass(a.call(this,b,this.className))})}if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1){if(!e.className&&b.length===1){e.className=a
}else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++){~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ")}e.className=f.trim(g)}}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a)){return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))})}if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className){if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++){h=h.replace(" "+c[i]+" "," ")
}g.className=f.trim(h)}else{g.className=""}}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a)){return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)})}return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++]){i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}}else{if(c==="undefined"||c==="boolean"){this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""
}}})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++){if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1){return !0}}return !1},val:function(a){var c,d,e,g=this[0];if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];
if(!c||!("set" in c)||c.set(this,h,"value")===b){this.value=h}}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get" in c&&(d=c.get(g,"value"))!==b){return d}d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return !b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0){return null}c=j?g:0,d=j?g+1:i.length;
for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j){return b}h.push(b)}}if(j&&!h.length&&i.length){return f(i[g]).val()}return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;
if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn){return f(a)[c](d)}if(typeof a.getAttribute=="undefined"){return f.prop(a,c,d)}i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set" in h&&i&&(g=h.set(a,d,c))!==b){return g}a.setAttribute(c,""+d);return d}if(h&&"get" in h&&i&&(g=h.get(a,c))!==null){return g}g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;
for(;h<g;h++){e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode){f.error("type property can't be changed")}else{if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button")){return w.get(a,b)}return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button")){return w.set(a,b,c)
}a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set" in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get" in g&&(e=g.get(a,c))!==null?e:a[c]
}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;
d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);
return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value
}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b)){return a.checked=f.inArray(f(a).val(),b)>=0}}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b
},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b
},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1){a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0
}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o){f.event.remove(a,j+b[h],c,d,!0)}continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++){s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s))
}r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered)){return}h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h]){return
}c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j){j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0)}return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1){return
}r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode){r.push([m,s]),n=m}n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++){m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault()}c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));
return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++){r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r)
}q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace)){c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))
}}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;
a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando]){return a}var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;
a=f.Event(g);for(d=i.length;d;){e=i[--d],a[e]=g[e]}a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});
d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event)){return new f.Event(a,b)}a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0
},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;
if(!d||d!==c&&!f.contains(c,d)){a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b}return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form")){return !1}f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)
})},teardown:function(){if(f.nodeName(this,"form")){return !1}f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio"){f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))})
}return !1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox"){return a.handleObj.handler.apply(this,arguments)}},teardown:function(){f.event.remove(this,"._change");
return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a){this.on(i,c,d,a[i],g)}return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));
if(e===!1){e=J}else{if(!e){return this}}g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a){this.off(g,c,a[g])}return this
}if(c===!1||typeof c=="function"){d=c,c=b}d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)
})},triggerHandler:function(a,b){if(this[0]){return f.event.trigger(a,b,this[0],!0)}},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length){b[d++].guid=c}return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.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 contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);
return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else{if(m.filter(b,[j]).length>0){k=j;break}}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;
h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;
var h=d;if(d.nodeType!==1&&d.nodeType!==9){return[]}if(!b||typeof b!="string"){return e}var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b)){if(w.length===2&&o.relative[w[0]]){j=y(w[0]+w[1],d,f)}else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length){b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}}}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);
if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length){q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}}else{k=w=[]}}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]"){if(!u){e.push.apply(e,k)}else{if(d&&d.nodeType===1){for(t=0;k[t]!=null;t++){k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t])}}else{for(t=0;
k[t]!=null;t++){k[t]&&k[t].nodeType===1&&e.push(j[t])}}}}else{s(k,e)}l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h){for(var b=1;b<a.length;b++){a[b]===a[b-1]&&a.splice(b--,1)}}}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a){return[]}for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);
if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter){if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\"){continue}s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);
if(!f){g=i=!0}else{if(f===!0){continue}}}if(f){for(n=0;(j=s[n])!=null;n++){j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0))}}if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g){return[]}break}}}if(a===q){if(g==null){m.error(a)}else{break}}q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string"){return a.textContent}if(typeof a.innerText=="string"){return a.innerText.replace(k,"")
}for(a=a.firstChild;a;a=a.nextSibling){e+=n(a)}}else{if(d===3||d===4){return a.nodeValue}}}else{for(b=0;c=a[b];b++){c.nodeType!==8&&(e+=n(c))}}return e},o=m.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|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")
},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++){if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;
e<f;e++){c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b)}d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);
for(var e=0,f=d.length;e<f;e++){d[e].getAttribute("name")===a[1]&&c.push(d[e])}return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined"){return b.getElementsByTagName(a[1])}}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f){return a}for(var g=0,h;(h=b[g])!=null;g++){h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1))}return !1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()
},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else{a[2]&&m.error(a[0])}a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not"){if((a.exec(b[3])||"").length>1||/^\w/.test(b[3])){b[3]=m(b[3],null,null,c)
}else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return !1}}else{if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0])){return !0}}return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return !!a.firstChild},empty:function(a){return !a.firstChild
},has:function(a,b,c){return !!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type
},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement
}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f){return f(a,c,b,d)}if(e==="contains"){return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0}if(e==="not"){var g=b[3];
for(var h=0,i=g.length;h<i;h++){if(g[h]===a){return !1}}return !0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling){if(l.nodeType===1){return !1}}if(k==="first"){return !0}l=a;case"last":while(l=l.nextSibling){if(l.nodeType===1){return !1}}return !0;case"nth":c=b[2],e=b[3];if(c===1&&e===0){return !0}f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling){l.nodeType===1&&(l.nodeIndex=++i)
}g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1
},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f){return f(a,c,b,d)}}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match){o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q))}var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];
if(g.call(a)==="[object Array]"){Array.prototype.push.apply(d,a)}else{if(typeof a.length=="number"){for(var e=a.length;c<e;c++){d.push(a[c])}}else{for(;a[c];c++){d.push(a[c])}}}return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition){return a.compareDocumentPosition?-1:1}return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex){return a.sourceIndex-b.sourceIndex
}var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i){return v(a,b)}if(!g){return -1}if(!i){return 1}while(j){e.unshift(j),j=j.parentNode}j=i;while(j){f.unshift(j),j=j.parentNode}c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++){if(e[k]!==f[k]){return v(e[k],f[k])}}return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b){return c}var d=a.nextSibling;while(d){if(d===b){return -1}d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;
a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");
a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++){c[e].nodeType===1&&d.push(c[e])}c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";
b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1]){return s(e.getElementsByTagName(b),f)}if(h[2]&&o.find.CLASS&&e.getElementsByClassName){return s(e.getElementsByClassName(h[2]),f)}}if(e.nodeType===9){if(b==="body"&&e.body){return s([e.body],f)}if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode){return s([],f)
}if(i.id===h[3]){return s([i],f)}}try{return s(e.querySelectorAll(b),f)}catch(j){}}else{if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p){return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}}catch(r){}finally{l||k.removeAttribute("id")}}}}return a(b,e,f,g)};for(var e in a){m[e]=a[e]}b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;
if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a)){try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11){return f}}}catch(g){}}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";
if(a.getElementsByClassName("e").length===1){return}o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c){return b.getElementsByClassName(a[1])}},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return !!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return !1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;
return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a)){f+=d[0],a=a.replace(o.match.PSEUDO,"")}a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++){m(a,g[h],e,c)}return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};
f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string"){return f(a).filter(function(){for(c=0,d=b.length;c<d;c++){if(f.contains(b[c],this)){return !0}}})}var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0){for(h=g;h<e.length;h++){for(i=0;i<g;i++){if(e[i]===e[h]){e.splice(h--,1);break}}}}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++){if(f.contains(this,b[a])){return !0}}})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)
},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return !!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++){f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h})}g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;
d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11){break}}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a){return this[0]&&this[0].parentNode?this.prevAll().length:-1}if(typeof a=="string"){return f.inArray(this[0],f(a))}return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);
return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")
},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());
return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d))){g.nodeType===1&&e.push(g),g=g[c]}return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c]){if(a.nodeType===1&&++e===b){break}}return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling){a.nodeType===1&&a!==b&&c.push(a)
}return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={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,"",""]},bh=U(c);
bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a)){return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))})}if(typeof a!="object"&&a!==b){return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))}return f.text(this)},wrapAll:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapAll(a.call(this,b))
})}if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1){a=a.firstChild}return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapInner(a.call(this,b))})}return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)
})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)})}if(arguments.length){var a=f.clean(arguments);
a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)})}if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++){if(!a||f.filter(a,[d]).length){!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d)
}}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild){b.removeChild(b.firstChild)}}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null}if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");
try{for(var c=0,d=this.length;c<d;c++){this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}}catch(e){this.empty().append(a)}}else{f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a)}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a)){return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))})}typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;
f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j)){return this.each(function(){f(this).domManip(a,c,d,!0)})}if(f.isFunction(j)){return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)})}if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;
if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++){d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);
return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);
if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g){e[g]&&bk(d[g],e[g])}}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g){bj(d[g],e[g])}}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k){continue}if(typeof k=="string"){if(!_.test(k)){k=b.createTextNode(k)
}else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--){o=o.lastChild}if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i){f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes
}}var r;if(!f.support.appendChecked){if(k[0]&&typeof(r=k.length)=="number"){for(i=0;i<r;i++){bn(k[i])}}else{bn(k)}}k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return !a.type||be.test(a.type)};for(j=0;h[j];j++){if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript")){e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j])}else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])
}}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()]){continue}c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events){e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle)}b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;
f.fn.css=function(a,c){if(arguments.length===2&&c===b){return this}return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];
c=f.cssProps[i]||i;if(d===b){if(k&&"get" in k&&(g=k.get(a,!1,e))!==b){return g}return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d)){return}h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set" in k)||(d=k.set(a,d))!==b){try{j[c]=d}catch(l){}}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get" in g&&(e=g.get(a,!0,d))!==b){return e}if(bz){return bz(a,c)
}},swap:function(a,b,c){var d={};for(var e in b){d[e]=a.style[e],a.style[e]=b[e]}c.call(a);for(e in b){a.style[e]=d[e]}}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0){return bC(a,b,d)}f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b)){return b}b=parseFloat(b);if(b>=0){return b+"px"}}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""
},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter){return}}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;
b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));
return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return !f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];
try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS){return bS.apply(this,arguments)}if(!this.length){return this}var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a
}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}
}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);
return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;
var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified")){f.lastModified[k]=y}if(z=v.getResponseHeader("Etag")){f.etag[k]=z}}if(a===304){w="notmodified",o=!0}else{try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}}else{u=w;if(!w||a){w="error",a<0&&(a=0)}}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))
}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n)){o[c[1].toLowerCase()]=c[2]}}c=o[a.toLowerCase()]
}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2){for(b in a){j[b]=[j[b],a[b]]}}else{b=a[v.status],v.then(b,b)}}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);
if(s===2){return !1}t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);
for(u in d.headers){v.setRequestHeader(u,d.headers[u])}if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return !1}for(u in {success:1,error:1,complete:1}){v[u](d[u])}p=b$(bU,d,c,v);if(!p){w(-1,"No Transport")}else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2){w(-1,z)}else{throw z}}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)
};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a)){f.each(a,function(){e(this.name,this.value)})}else{for(var g in a){ca(g,a[g],c,e)}}return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";
if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");
return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;
return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState)){d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")}},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch){ch[a](0,1)}}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return !this.isLocal&&ci()||cj()
}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials" in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields){for(j in c.xhrFields){h[j]=c.xhrFields[j]}}c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");
try{for(j in e){h.setRequestHeader(j,e[j])}}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e){h.readyState!==4&&h.abort()}else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)
},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0){return this.animate(cu("show",3),a,b,c)}for(var g=0,h=this.length;g<h;g++){d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)))
}for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none"){d.style.display=f._data(d,"olddisplay")||""}}}return this},hide:function(a,b,c){if(a||a===0){return this.animate(cu("hide",3),a,b,c)}var d,e,g=0,h=this.length;for(;g<h;g++){d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e))}for(g=0;g<h;g++){this[g].style&&(this[g].style.display="none")}return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";
f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";
if(h==="hide"&&d||h==="show"&&!d){return b.complete.call(this)}c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a){j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""))
}return !0}var e=f.speed(b,c,d);if(f.isEmptyObject(a)){return this.each(e.complete,[!1])}a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null){for(b in g){g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b)}}else{g[b=a+".run"]&&g[b].stop&&h(this,g,b)
}for(b=e.length;b--;){e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1))}(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};
d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0){d.queue="fx"}d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+0.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}
}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)
},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;
if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties){i.animatedProperties[b]!==!0&&(g=!1)}if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show){for(b in i.animatedProperties){f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0)}}d=i.complete,d&&(i.complete=!1,d.call(h))
}return !1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return !0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++){a=b[c],!a()&&b[c]===a&&b.splice(c--,1)}b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)
},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect" in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a){return this.each(function(b){f.offset.setOffset(this,a,b)
})}if(!b||!b.ownerDocument){return null}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b)}try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b)){return c?{top:c.top,left:c.left}:{top:0,left:0}}var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}
}:f.fn.offset=function(a){var b=this[0];if(a){return this.each(function(b){f.offset.setOffset(this,a,b)})}if(!b||!b.ownerDocument){return null}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b)}var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed"){break}c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c
}if(k.position==="relative"||k.position==="static"){l+=i.offsetTop,m+=i.offsetLeft}f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");
var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using" in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0]){return null}var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();
c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static"){a=a.offsetParent}return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];
if(!e){return null}g=cy(e);return g?"pageXOffset" in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null
},f.fn[d]=function(a){var e=this[0];if(!e){return a==null?null:this}if(f.isFunction(a)){return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))})}if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9){return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c])}if(a===b){var i=f.css(e,d),j=parseFloat(i);
return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.core.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(f,e){function l(d,q){var p=d.nodeName.toLowerCase();if("area"===p){var o=d.parentNode,n=o.name,m;return !d.href||!n||o.nodeName.toLowerCase()!=="map"?!1:(m=f("img[usemap=#"+n+"]")[0],!!m&&h(m))
}return(/input|select|textarea|button|object/.test(p)?!d.disabled:"a"==p?d.href||q:q)&&h(d)}function h(c){return !f(c).parents().andSelf().filter(function(){return f.curCSS(this,"visibility")==="hidden"||f.expr.filters.hidden(this)}).length}f.ui=f.ui||{};if(f.ui.version){return}f.extend(f.ui,{version:"1.8.20",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,WINDOWS:91}}),f.fn.extend({propAttr:f.fn.prop||f.fn.attr,_focus:f.fn.focus,focus:function(d,m){return typeof d=="number"?this.each(function(){var c=this;
setTimeout(function(){f(c).focus(),m&&m.call(c)},d)}):this._focus.apply(this,arguments)},scrollParent:function(){var c;return f.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?c=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(f.curCSS(this,"position",1))&&/(auto|scroll)/.test(f.curCSS(this,"overflow",1)+f.curCSS(this,"overflow-y",1)+f.curCSS(this,"overflow-x",1))}).eq(0):c=this.parents().filter(function(){return/(auto|scroll)/.test(f.curCSS(this,"overflow",1)+f.curCSS(this,"overflow-y",1)+f.curCSS(this,"overflow-x",1))
}).eq(0),/fixed/.test(this.css("position"))||!c.length?f(document):c},zIndex:function(p){if(p!==e){return this.css("zIndex",p)}if(this.length){var o=f(this[0]),n,m;while(o.length&&o[0]!==document){n=o.css("position");if(n==="absolute"||n==="relative"||n==="fixed"){m=parseInt(o.css("zIndex"),10);if(!isNaN(m)&&m!==0){return m}}o=o.parent()}}return 0},disableSelection:function(){return this.bind((f.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(c){c.preventDefault()})
},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),f.each(["Width","Height"],function(r,q){function m(s,v,u,t){return f.each(p,function(){v-=parseFloat(f.curCSS(s,"padding"+this,!0))||0,u&&(v-=parseFloat(f.curCSS(s,"border"+this+"Width",!0))||0),t&&(v-=parseFloat(f.curCSS(s,"margin"+this,!0))||0)}),v}var p=q==="Width"?["Left","Right"]:["Top","Bottom"],o=q.toLowerCase(),n={innerWidth:f.fn.innerWidth,innerHeight:f.fn.innerHeight,outerWidth:f.fn.outerWidth,outerHeight:f.fn.outerHeight};
f.fn["inner"+q]=function(d){return d===e?n["inner"+q].call(this):this.each(function(){f(this).css(o,m(this,d)+"px")})},f.fn["outer"+q]=function(d,s){return typeof d!="number"?n["outer"+q].call(this,d):this.each(function(){f(this).css(o,m(this,d,!0,s)+"px")})}}),f.extend(f.expr[":"],{data:function(m,o,n){return !!f.data(m,n[3])},focusable:function(c){return l(c,!isNaN(f.attr(c,"tabindex")))},tabbable:function(c){var n=f.attr(c,"tabindex"),m=isNaN(n);return(m||n>=0)&&l(c,!m)}}),f(function(){var d=document.body,m=d.appendChild(m=document.createElement("div"));
m.offsetHeight,f.extend(m.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),f.support.minHeight=m.offsetHeight===100,f.support.selectstart="onselectstart" in m,d.removeChild(m).style.display="none"}),f.extend(f.ui,{plugin:{add:function(m,q,p){var o=f.ui[m].prototype;for(var n in p){o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([q,p[n]])}},call:function(n,m,q){var p=n.plugins[m];if(!p||!n.element[0].parentNode){return}for(var o=0;o<p.length;o++){n.options[p[o][0]]&&p[o][1].apply(n.element,q)
}}},contains:function(d,c){return document.compareDocumentPosition?d.compareDocumentPosition(c)&16:d!==c&&d.contains(c)},hasScroll:function(m,p){if(f(m).css("overflow")==="hidden"){return !1}var o=p&&p==="left"?"scrollLeft":"scrollTop",n=!1;return m[o]>0?!0:(m[o]=1,n=m[o]>0,m[o]=0,n)},isOverAxis:function(m,d,n){return m>d&&m<d+n},isOver:function(m,r,q,p,o,n){return f.ui.isOverAxis(m,q,o)&&f.ui.isOverAxis(r,p,n)}})})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.widget.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(f,e){if(f.cleanData){var l=f.cleanData;
f.cleanData=function(c){for(var o=0,n;(n=c[o])!=null;o++){try{f(n).triggerHandler("remove")}catch(m){}}l(c)}}else{var h=f.fn.remove;f.fn.remove=function(d,m){return this.each(function(){return m||(!d||f.filter(d,[this]).length)&&f("*",this).add([this]).each(function(){try{f(this).triggerHandler("remove")}catch(c){}}),h.call(f(this),d,m)})}}f.widget=function(m,r,q){var p=m.split(".")[0],o;m=m.split(".")[1],o=p+"-"+m,q||(q=r,r=f.Widget),f.expr[":"][o]=function(d){return !!f.data(d,m)},f[p]=f[p]||{},f[p][m]=function(d,c){arguments.length&&this._createWidget(d,c)
};var n=new r;n.options=f.extend(!0,{},n.options),f[p][m].prototype=f.extend(!0,n,{namespace:p,widgetName:m,widgetEventPrefix:f[p][m].prototype.widgetEventPrefix||m,widgetBaseClass:o},q),f.widget.bridge(m,f[p][m])},f.widget.bridge=function(n,m){f.fn[n]=function(p){var o=typeof p=="string",d=Array.prototype.slice.call(arguments,1),c=this;return p=!o&&d.length?f.extend.apply(null,[!0,p].concat(d)):p,o&&p.charAt(0)==="_"?c:(o?this.each(function(){var r=f.data(this,n),q=r&&f.isFunction(r[p])?r[p].apply(r,d):r;
if(q!==r&&q!==e){return c=q,!1}}):this.each(function(){var q=f.data(this,n);q?q.option(p||{})._init():f.data(this,n,new m(p,this))}),c)}},f.Widget=function(d,c){arguments.length&&this._createWidget(d,c)},f.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(m,o){f.data(o,this.widgetName,this),this.element=f(o),this.options=f.extend(!0,{},this.options,this._getCreateOptions(),m);var n=this;this.element.bind("remove."+this.widgetName,function(){n.destroy()
}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return f.metadata&&f.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(o,n){var m=o;if(arguments.length===0){return f.extend({},this.options)
}if(typeof o=="string"){if(n===e){return this.options[o]}m={},m[o]=n}return this._setOptions(m),this},_setOptions:function(d){var m=this;return f.each(d,function(n,c){m._setOption(n,c)}),this},_setOption:function(d,c){return this.options[d]=c,d==="disabled"&&this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(m,r,q){var p,o,n=this.options[m];
q=q||{},r=f.Event(r),r.type=(m===this.widgetEventPrefix?m:this.widgetEventPrefix+m).toLowerCase(),r.target=this.element[0],o=r.originalEvent;if(o){for(p in o){p in r||(r[p]=o[p])}}return this.element.trigger(r,q),!(f.isFunction(n)&&n.call(this.element[0],r,q)===!1||r.isDefaultPrevented())}}})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.mouse.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(e,d){var f=!1;e(document).mouseup(function(c){f=!1
}),e.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var c=this;this.element.bind("mousedown."+this.widgetName,function(h){return c._mouseDown(h)}).bind("click."+this.widgetName,function(h){if(!0===e.data(h.target,c.widgetName+".preventClickEvent")){return e.removeData(h.target,c.widgetName+".preventClickEvent"),h.stopImmediatePropagation(),!1}}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)
},_mouseDown:function(c){if(f){return}this._mouseStarted&&this._mouseUp(c),this._mouseDownEvent=c;var m=this,l=c.which==1,h=typeof this.options.cancel=="string"&&c.target.nodeName?e(c.target).closest(this.options.cancel).length:!1;if(!l||h||!this._mouseCapture(c)){return !0}this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){m.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)){this._mouseStarted=this._mouseStart(c)!==!1;
if(!this._mouseStarted){return c.preventDefault(),!0}}return !0===e.data(c.target,this.widgetName+".preventClickEvent")&&e.removeData(c.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(n){return m._mouseMove(n)},this._mouseUpDelegate=function(n){return m._mouseUp(n)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),c.preventDefault(),f=!0,!0},_mouseMove:function(c){return !e.browser.msie||document.documentMode>=9||!!c.button?this._mouseStarted?(this._mouseDrag(c),c.preventDefault()):(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,c)!==!1,this._mouseStarted?this._mouseDrag(c):this._mouseUp(c)),!this._mouseStarted):this._mouseUp(c)
},_mouseUp:function(c){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,c.target==this._mouseDownEvent.target&&e.data(c.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(c)),!1},_mouseDistanceMet:function(c){return Math.max(Math.abs(this._mouseDownEvent.pageX-c.pageX),Math.abs(this._mouseDownEvent.pageY-c.pageY))>=this.options.distance},_mouseDelayMet:function(c){return this.mouseDelayMet
},_mouseStart:function(c){},_mouseDrag:function(c){},_mouseStop:function(c){},_mouseCapture:function(c){return !0}})})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.position.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(m,l){m.ui=m.ui||{};var s=/left|center|right/,r=/top|center|bottom/,q="center",p={},o=m.fn.position,n=m.fn.offset;m.fn.position=function(d){if(!d||!d.of){return o.apply(this,arguments)}d=m.extend({},d);
var v=m(d.of),u=v[0],t=(d.collision||"flip").split(" "),f=d.offset?d.offset.split(" "):[0,0],e,c,w;return u.nodeType===9?(e=v.width(),c=v.height(),w={top:0,left:0}):u.setTimeout?(e=v.width(),c=v.height(),w={top:v.scrollTop(),left:v.scrollLeft()}):u.preventDefault?(d.at="left top",e=c=0,w={top:d.of.pageY,left:d.of.pageX}):(e=v.outerWidth(),c=v.outerHeight(),w=v.offset()),m.each(["my","at"],function(){var h=(d[this]||"").split(" ");h.length===1&&(h=s.test(h[0])?h.concat([q]):r.test(h[0])?[q].concat(h):[q,q]),h[0]=s.test(h[0])?h[0]:q,h[1]=r.test(h[1])?h[1]:q,d[this]=h
}),t.length===1&&(t[1]=t[0]),f[0]=parseInt(f[0],10)||0,f.length===1&&(f[1]=f[0]),f[1]=parseInt(f[1],10)||0,d.at[0]==="right"?w.left+=e:d.at[0]===q&&(w.left+=e/2),d.at[1]==="bottom"?w.top+=c:d.at[1]===q&&(w.top+=c/2),w.left+=f[0],w.top+=f[1],this.each(function(){var F=m(this),E=F.outerWidth(),D=F.outerHeight(),C=parseInt(m.curCSS(this,"marginLeft",!0))||0,B=parseInt(m.curCSS(this,"marginTop",!0))||0,A=E+C+(parseInt(m.curCSS(this,"marginRight",!0))||0),z=D+B+(parseInt(m.curCSS(this,"marginBottom",!0))||0),y=m.extend({},w),x;
d.my[0]==="right"?y.left-=E:d.my[0]===q&&(y.left-=E/2),d.my[1]==="bottom"?y.top-=D:d.my[1]===q&&(y.top-=D/2),p.fractions||(y.left=Math.round(y.left),y.top=Math.round(y.top)),x={left:y.left-C,top:y.top-B},m.each(["left","top"],function(G,h){m.ui.position[t[G]]&&m.ui.position[t[G]][h](y,{targetWidth:e,targetHeight:c,elemWidth:E,elemHeight:D,collisionPosition:x,collisionWidth:A,collisionHeight:z,offset:f,my:d.my,at:d.at})}),m.fn.bgiframe&&F.bgiframe(),F.offset(m.extend(y,{using:d.using}))})},m.ui.position={fit:{left:function(f,u){var t=m(window),h=u.collisionPosition.left+u.collisionWidth-t.width()-t.scrollLeft();
f.left=h>0?f.left-h:Math.max(f.left-u.collisionPosition.left,f.left)},top:function(f,u){var t=m(window),h=u.collisionPosition.top+u.collisionHeight-t.height()-t.scrollTop();f.top=h>0?f.top-h:Math.max(f.top-u.collisionPosition.top,f.top)}},flip:{left:function(e,y){if(y.at[0]===q){return}var x=m(window),w=y.collisionPosition.left+y.collisionWidth-x.width()-x.scrollLeft(),v=y.my[0]==="left"?-y.elemWidth:y.my[0]==="right"?y.elemWidth:0,u=y.at[0]==="left"?y.targetWidth:-y.targetWidth,t=-2*y.offset[0];
e.left+=y.collisionPosition.left<0?v+u+t:w>0?v+u+t:0},top:function(e,y){if(y.at[1]===q){return}var x=m(window),w=y.collisionPosition.top+y.collisionHeight-x.height()-x.scrollTop(),v=y.my[1]==="top"?-y.elemHeight:y.my[1]==="bottom"?y.elemHeight:0,u=y.at[1]==="top"?y.targetHeight:-y.targetHeight,t=-2*y.offset[1];e.top+=y.collisionPosition.top<0?v+u+t:w>0?v+u+t:0}}},m.offset.setOffset||(m.offset.setOffset=function(t,z){/static/.test(m.curCSS(t,"position"))&&(t.style.position="relative");var y=m(t),x=y.offset(),w=parseInt(m.curCSS(t,"top",!0),10)||0,v=parseInt(m.curCSS(t,"left",!0),10)||0,u={top:z.top-x.top+w,left:z.left-x.left+v};
"using" in z?z.using.call(t,u):y.css(u)},m.fn.offset=function(d){var e=this[0];return !e||!e.ownerDocument?null:d?this.each(function(){m.offset.setOffset(this,d)}):n.call(this)}),function(){var f=document.getElementsByTagName("body")[0],z=document.createElement("div"),y,x,w,v,u;y=document.createElement(f?"div":"body"),w={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},f&&m.extend(w,{position:"absolute",left:"-1000px",top:"-1000px"});for(var t in w){y.style[t]=w[t]}y.appendChild(z),x=f||document.documentElement,x.insertBefore(y,x.firstChild),z.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",v=m(z).offset(function(d,c){return c
}).offset(),y.innerHTML="",x.removeChild(y),u=v.top+v.left+(f?2000:0),p.fractions=u>21&&u<22}()})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.draggable.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(d,c){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()
},destroy:function(){if(!this.element.data("draggable")){return}return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(e){var f=this.options;return this.helper||f.disabled||d(e.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(e),this.handle?(f.iframeFix&&d(f.iframeFix===!0?"iframe":f.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(d(this).offset()).appendTo("body")
}),!0):!1)},_mouseStart:function(e){var f=this.options;return this.helper=this._createHelper(e),this._cacheHelperProportions(),d.ui.ddmanager&&(d.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},d.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,f.cursorAt&&this._adjustOffsetFromHelper(f.cursorAt),f.containment&&this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),d.ui.ddmanager&&!f.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,e),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(e,!0),d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,e),!0)
},_mouseDrag:function(e,h){this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute");if(!h){var f=this._uiHash();if(this._trigger("drag",e,f)===!1){return this._mouseUp({}),!1}this.position=f.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}return d.ui.ddmanager&&d.ui.ddmanager.drag(this,e),!1},_mouseStop:function(h){var o=!1;
d.ui.ddmanager&&!this.options.dropBehaviour&&(o=d.ui.ddmanager.drop(this,h)),this.dropped&&(o=this.dropped,this.dropped=!1);var n=this.element[0],m=!1;while(n&&(n=n.parentNode)){n==document&&(m=!0)}if(!m&&this.options.helper==="original"){return !1}if(this.options.revert=="invalid"&&!o||this.options.revert=="valid"&&o||this.options.revert===!0||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,o)){var l=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){l._trigger("stop",h)!==!1&&l._clear()
})}else{this._trigger("stop",h)!==!1&&this._clear()}return !1},_mouseUp:function(e){return this.options.iframeFix===!0&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,e),d.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){var f=!this.options.handle||!d(this.options.handle,this.element).length?!0:!1;
return d(this.options.handle,this.element).find("*").andSelf().each(function(){this==e.target&&(f=!0)}),f},_createHelper:function(e){var h=this.options,f=d.isFunction(h.helper)?d(h.helper.apply(this.element[0],[e])):h.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return f.parents("body").length||f.appendTo(h.appendTo=="parent"?this.element[0].parentNode:h.appendTo),f[0]!=this.element[0]&&!/(fixed|absolute)/.test(f.css("position"))&&f.css("position","absolute"),f},_adjustOffsetFromHelper:function(e){typeof e=="string"&&(e=e.split(" ")),d.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left" in e&&(this.offset.click.left=e.left+this.margins.left),"right" in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top" in e&&(this.offset.click.top=e.top+this.margins.top),"bottom" in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)
},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie){e={top:0,left:0}}return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}
},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}
},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var h=this.options;h.containment=="parent"&&(h.containment=this.helper[0].parentNode);if(h.containment=="document"||h.containment=="window"){this.containment=[h.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,h.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(h.containment=="document"?0:d(window).scrollLeft())+d(h.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(h.containment=="document"?0:d(window).scrollTop())+(d(h.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]
}if(!/^(document|window|parent)$/.test(h.containment)&&h.containment.constructor!=Array){var o=d(h.containment),n=o[0];if(!n){return}var m=o.offset(),l=d(n).css("overflow")!="hidden";this.containment=[(parseInt(d(n).css("borderLeftWidth"),10)||0)+(parseInt(d(n).css("paddingLeft"),10)||0),(parseInt(d(n).css("borderTopWidth"),10)||0)+(parseInt(d(n).css("paddingTop"),10)||0),(l?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(d(n).css("borderLeftWidth"),10)||0)-(parseInt(d(n).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(l?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(d(n).css("borderTopWidth"),10)||0)-(parseInt(d(n).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=o
}else{h.containment.constructor==Array&&(this.containment=h.containment)}},_convertPositionTo:function(h,p){p||(p=this.position);var o=h=="absolute"?1:-1,n=this.options,m=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,l=/(html|body)/i.test(m[0].tagName);return{top:p.top+this.offset.relative.top*o+this.offset.parent.top*o-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():l?0:m.scrollTop())*o),left:p.left+this.offset.relative.left*o+this.offset.parent.left*o-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():l?0:m.scrollLeft())*o)}
},_generatePosition:function(u){var t=this.options,s=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,r=/(html|body)/i.test(s[0].tagName),q=u.pageX,p=u.pageY;if(this.originalPosition){var o;if(this.containment){if(this.relative_container){var n=this.relative_container.offset();o=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]}else{o=this.containment
}u.pageX-this.offset.click.left<o[0]&&(q=o[0]+this.offset.click.left),u.pageY-this.offset.click.top<o[1]&&(p=o[1]+this.offset.click.top),u.pageX-this.offset.click.left>o[2]&&(q=o[2]+this.offset.click.left),u.pageY-this.offset.click.top>o[3]&&(p=o[3]+this.offset.click.top)}if(t.grid){var m=t.grid[1]?this.originalPageY+Math.round((p-this.originalPageY)/t.grid[1])*t.grid[1]:this.originalPageY;p=o?m-this.offset.click.top<o[1]||m-this.offset.click.top>o[3]?m-this.offset.click.top<o[1]?m+t.grid[1]:m-t.grid[1]:m:m;
var l=t.grid[0]?this.originalPageX+Math.round((q-this.originalPageX)/t.grid[0])*t.grid[0]:this.originalPageX;q=o?l-this.offset.click.left<o[0]||l-this.offset.click.left>o[2]?l-this.offset.click.left<o[0]?l+t.grid[0]:l-t.grid[0]:l:l}}return{top:p-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():r?0:s.scrollTop()),left:q-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():r?0:s.scrollLeft())}
},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,h,f){return f=f||this._uiHash(),d.ui.plugin.call(this,e,[h,f]),e=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),d.Widget.prototype._trigger.call(this,e,h,f)},plugins:{},_uiHash:function(e){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}
}}),d.extend(d.ui.draggable,{version:"1.8.20"}),d.ui.plugin.add("draggable","connectToSortable",{start:function(h,o){var n=d(this).data("draggable"),m=n.options,l=d.extend({},o,{item:n.element});n.sortables=[],d(m.connectToSortable).each(function(){var e=d.data(this,"sortable");e&&!e.options.disabled&&(n.sortables.push({instance:e,shouldRevert:e.options.revert}),e.refreshPositions(),e._trigger("activate",h,l))})},stop:function(f,m){var l=d(this).data("draggable"),h=d.extend({},m,{item:l.element});
d.each(l.sortables,function(){this.instance.isOver?(this.instance.isOver=0,l.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(f),this.instance.options.helper=this.instance.options._helper,l.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",f,h))})},drag:function(h,o){var n=d(this).data("draggable"),m=this,l=function(x){var w=this.offset.click.top,v=this.offset.click.left,u=this.positionAbs.top,t=this.positionAbs.left,s=x.height,r=x.width,q=x.top,p=x.left;
return d.ui.isOver(u+w,t+v,q,p,s,r)};d.each(n.sortables,function(e){this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=d(m).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return o.helper[0]
},h.target=this.instance.currentItem[0],this.instance._mouseCapture(h,!0),this.instance._mouseStart(h,!0,!0),this.instance.offset.click.top=n.offset.click.top,this.instance.offset.click.left=n.offset.click.left,this.instance.offset.parent.left-=n.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=n.offset.parent.top-this.instance.offset.parent.top,n._trigger("toSortable",h),n.dropped=this.instance.element,n.currentItem=n.element,this.instance.fromOutside=n),this.instance.currentItem&&this.instance._mouseDrag(h)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",h,this.instance._uiHash(this.instance)),this.instance._mouseStop(h,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),n._trigger("fromSortable",h),n.dropped=!1)
})}}),d.ui.plugin.add("draggable","cursor",{start:function(f,m){var l=d("body"),h=d(this).data("draggable").options;l.css("cursor")&&(h._cursor=l.css("cursor")),l.css("cursor",h.cursor)},stop:function(e,h){var f=d(this).data("draggable").options;f._cursor&&d("body").css("cursor",f._cursor)}}),d.ui.plugin.add("draggable","opacity",{start:function(f,m){var l=d(m.helper),h=d(this).data("draggable").options;l.css("opacity")&&(h._opacity=l.css("opacity")),l.css("opacity",h.opacity)},stop:function(e,h){var f=d(this).data("draggable").options;
f._opacity&&d(h.helper).css("opacity",f._opacity)}}),d.ui.plugin.add("draggable","scroll",{start:function(e,h){var f=d(this).data("draggable");f.scrollParent[0]!=document&&f.scrollParent[0].tagName!="HTML"&&(f.overflowOffset=f.scrollParent.offset())},drag:function(h,o){var n=d(this).data("draggable"),m=n.options,l=!1;if(n.scrollParent[0]!=document&&n.scrollParent[0].tagName!="HTML"){if(!m.axis||m.axis!="x"){n.overflowOffset.top+n.scrollParent[0].offsetHeight-h.pageY<m.scrollSensitivity?n.scrollParent[0].scrollTop=l=n.scrollParent[0].scrollTop+m.scrollSpeed:h.pageY-n.overflowOffset.top<m.scrollSensitivity&&(n.scrollParent[0].scrollTop=l=n.scrollParent[0].scrollTop-m.scrollSpeed)
}if(!m.axis||m.axis!="y"){n.overflowOffset.left+n.scrollParent[0].offsetWidth-h.pageX<m.scrollSensitivity?n.scrollParent[0].scrollLeft=l=n.scrollParent[0].scrollLeft+m.scrollSpeed:h.pageX-n.overflowOffset.left<m.scrollSensitivity&&(n.scrollParent[0].scrollLeft=l=n.scrollParent[0].scrollLeft-m.scrollSpeed)}}else{if(!m.axis||m.axis!="x"){h.pageY-d(document).scrollTop()<m.scrollSensitivity?l=d(document).scrollTop(d(document).scrollTop()-m.scrollSpeed):d(window).height()-(h.pageY-d(document).scrollTop())<m.scrollSensitivity&&(l=d(document).scrollTop(d(document).scrollTop()+m.scrollSpeed))
}if(!m.axis||m.axis!="y"){h.pageX-d(document).scrollLeft()<m.scrollSensitivity?l=d(document).scrollLeft(d(document).scrollLeft()-m.scrollSpeed):d(window).width()-(h.pageX-d(document).scrollLeft())<m.scrollSensitivity&&(l=d(document).scrollLeft(d(document).scrollLeft()+m.scrollSpeed))}}l!==!1&&d.ui.ddmanager&&!m.dropBehaviour&&d.ui.ddmanager.prepareOffsets(n,h)}}),d.ui.plugin.add("draggable","snap",{start:function(f,m){var l=d(this).data("draggable"),h=l.options;l.snapElements=[],d(h.snap.constructor!=String?h.snap.items||":data(draggable)":h.snap).each(function(){var e=d(this),n=e.offset();
this!=l.element[0]&&l.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:n.top,left:n.left})})},drag:function(M,L){var K=d(this).data("draggable"),J=K.options,I=J.snapTolerance,H=L.offset.left,G=H+K.helperProportions.width,F=L.offset.top,E=F+K.helperProportions.height;for(var D=K.snapElements.length-1;D>=0;D--){var C=K.snapElements[D].left,B=C+K.snapElements[D].width,A=K.snapElements[D].top,z=A+K.snapElements[D].height;if(!(C-I<H&&H<B+I&&A-I<F&&F<z+I||C-I<H&&H<B+I&&A-I<E&&E<z+I||C-I<G&&G<B+I&&A-I<F&&F<z+I||C-I<G&&G<B+I&&A-I<E&&E<z+I)){K.snapElements[D].snapping&&K.options.snap.release&&K.options.snap.release.call(K.element,M,d.extend(K._uiHash(),{snapItem:K.snapElements[D].item})),K.snapElements[D].snapping=!1;
continue}if(J.snapMode!="inner"){var y=Math.abs(A-E)<=I,x=Math.abs(z-F)<=I,w=Math.abs(C-G)<=I,v=Math.abs(B-H)<=I;y&&(L.position.top=K._convertPositionTo("relative",{top:A-K.helperProportions.height,left:0}).top-K.margins.top),x&&(L.position.top=K._convertPositionTo("relative",{top:z,left:0}).top-K.margins.top),w&&(L.position.left=K._convertPositionTo("relative",{top:0,left:C-K.helperProportions.width}).left-K.margins.left),v&&(L.position.left=K._convertPositionTo("relative",{top:0,left:B}).left-K.margins.left)
}var u=y||x||w||v;if(J.snapMode!="outer"){var y=Math.abs(A-F)<=I,x=Math.abs(z-E)<=I,w=Math.abs(C-H)<=I,v=Math.abs(B-G)<=I;y&&(L.position.top=K._convertPositionTo("relative",{top:A,left:0}).top-K.margins.top),x&&(L.position.top=K._convertPositionTo("relative",{top:z-K.helperProportions.height,left:0}).top-K.margins.top),w&&(L.position.left=K._convertPositionTo("relative",{top:0,left:C}).left-K.margins.left),v&&(L.position.left=K._convertPositionTo("relative",{top:0,left:B-K.helperProportions.width}).left-K.margins.left)
}!K.snapElements[D].snapping&&(y||x||w||v||u)&&K.options.snap.snap&&K.options.snap.snap.call(K.element,M,d.extend(K._uiHash(),{snapItem:K.snapElements[D].item})),K.snapElements[D].snapping=y||x||w||v||u}}}),d.ui.plugin.add("draggable","stack",{start:function(h,o){var n=d(this).data("draggable").options,m=d.makeArray(d(n.stack)).sort(function(e,f){return(parseInt(d(e).css("zIndex"),10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(!m.length){return}var l=parseInt(m[0].style.zIndex)||0;d(m).each(function(e){this.style.zIndex=l+e
}),this[0].style.zIndex=l+m.length}}),d.ui.plugin.add("draggable","zIndex",{start:function(f,m){var l=d(m.helper),h=d(this).data("draggable").options;l.css("zIndex")&&(h._zIndex=l.css("zIndex")),l.css("zIndex",h.zIndex)},stop:function(e,h){var f=d(this).data("draggable").options;f._zIndex&&d(h.helper).css("zIndex",f._zIndex)}})})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.droppable.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(d,c){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var e=this.options,f=e.accept;
this.isover=0,this.isout=1,this.accept=d.isFunction(f)?f:function(h){return h.is(f)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},d.ui.ddmanager.droppables[e.scope]=d.ui.ddmanager.droppables[e.scope]||[],d.ui.ddmanager.droppables[e.scope].push(this),e.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var e=d.ui.ddmanager.droppables[this.options.scope];for(var f=0;f<e.length;f++){e[f]==this&&e.splice(f,1)}return this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable"),this
},_setOption:function(e,f){e=="accept"&&(this.accept=d.isFunction(f)?f:function(h){return h.is(f)}),d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var f=d.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),f&&this._trigger("activate",e,this.ui(f))},_deactivate:function(e){var f=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),f&&this._trigger("deactivate",e,this.ui(f))},_over:function(e){var f=d.ui.ddmanager.current;
if(!f||(f.currentItem||f.element)[0]==this.element[0]){return}this.accept.call(this.element[0],f.currentItem||f.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(f)))},_out:function(e){var f=d.ui.ddmanager.current;if(!f||(f.currentItem||f.element)[0]==this.element[0]){return}this.accept.call(this.element[0],f.currentItem||f.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(f)))
},_drop:function(f,m){var l=m||d.ui.ddmanager.current;if(!l||(l.currentItem||l.element)[0]==this.element[0]){return !1}var h=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var e=d.data(this,"droppable");if(e.options.greedy&&!e.options.disabled&&e.options.scope==l.options.scope&&e.accept.call(e.element[0],l.currentItem||l.element)&&d.ui.intersect(l,d.extend(e,{offset:e.element.offset()}),e.options.tolerance)){return h=!0,!1}}),h?!1:this.accept.call(this.element[0],l.currentItem||l.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",f,this.ui(l)),this.element):!1
},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),d.extend(d.ui.droppable,{version:"1.8.20"}),d.ui.intersect=function(C,B,A){if(!B.offset){return !1}var z=(C.positionAbs||C.position.absolute).left,y=z+C.helperProportions.width,x=(C.positionAbs||C.position.absolute).top,w=x+C.helperProportions.height,v=B.offset.left,u=v+B.proportions.width,t=B.offset.top,s=t+B.proportions.height;switch(A){case"fit":return v<=z&&y<=u&&t<=x&&w<=s;
case"intersect":return v<z+C.helperProportions.width/2&&y-C.helperProportions.width/2<u&&t<x+C.helperProportions.height/2&&w-C.helperProportions.height/2<s;case"pointer":var r=(C.positionAbs||C.position.absolute).left+(C.clickOffset||C.offset.click).left,q=(C.positionAbs||C.position.absolute).top+(C.clickOffset||C.offset.click).top,p=d.ui.isOver(q,r,t,v,B.proportions.height,B.proportions.width);return p;case"touch":return(x>=t&&x<=s||w>=t&&w<=s||x<t&&w>s)&&(z>=v&&z<=u||y>=v&&y<=u||z<v&&y>u);default:return !1
}},d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(l,r){var q=d.ui.ddmanager.droppables[l.options.scope]||[],p=r?r.type:null,o=(l.currentItem||l.element).find(":data(droppable)").andSelf();g:for(var n=0;n<q.length;n++){if(q[n].options.disabled||l&&!q[n].accept.call(q[n].element[0],l.currentItem||l.element)){continue}for(var m=0;m<o.length;m++){if(o[m]==q[n].element[0]){q[n].proportions.height=0;continue g}}q[n].visible=q[n].element.css("display")!="none";if(!q[n].visible){continue
}p=="mousedown"&&q[n]._activate.call(q[n],r),q[n].offset=q[n].element.offset(),q[n].proportions={width:q[n].element[0].offsetWidth,height:q[n].element[0].offsetHeight}}},drop:function(e,h){var f=!1;return d.each(d.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options){return}!this.options.disabled&&this.visible&&d.ui.intersect(e,this,this.options.tolerance)&&(f=this._drop.call(this,h)||f),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,h))
}),f},dragStart:function(e,f){e.element.parents(":not(body,html)").bind("scroll.droppable",function(){e.options.refreshPositions||d.ui.ddmanager.prepareOffsets(e,f)})},drag:function(e,f){e.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(e,f),d.each(d.ui.ddmanager.droppables[e.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var n=d.ui.intersect(e,this,this.options.tolerance),m=!n&&this.isover==1?"isout":n&&this.isover==0?"isover":null;if(!m){return
}var l;if(this.options.greedy){var h=this.element.parents(":data(droppable):eq(0)");h.length&&(l=d.data(h[0],"droppable"),l.greedyChild=m=="isover"?1:0)}l&&m=="isover"&&(l.isover=0,l.isout=1,l._out.call(l,f)),this[m]=1,this[m=="isout"?"isover":"isout"]=0,this[m=="isover"?"_over":"_out"].call(this,f),l&&m=="isout"&&(l.isout=0,l.isover=1,l._over.call(l,f))})},dragStop:function(e,f){e.element.parents(":not(body,html)").unbind("scroll.droppable"),e.options.refreshPositions||d.ui.ddmanager.prepareOffsets(e,f)
}}})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.resizable.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(f,e){f.widget("ui.resizable",f.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var m=this,s=this.options;
this.element.addClass("ui-resizable"),f.extend(this,{_aspectRatio:!!s.aspectRatio,aspectRatio:s.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:s.helper||s.ghost||s.animate?s.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(f('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=s.handles||(f(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");
if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var r=this.handles.split(",");this.handles={};for(var q=0;q<r.length;q++){var p=f.trim(r[q]),o="ui-resizable-"+p,n=f('<div class="ui-resizable-handle '+o+'"></div>');n.css({zIndex:s.zIndex}),"se"==p&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[p]=".ui-resizable-"+p,this.element.append(n)}}this._renderAxis=function(t){t=t||this.element;for(var x in this.handles){this.handles[x].constructor==String&&(this.handles[x]=f(this.handles[x],this.element).show());
if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var w=f(this.handles[x],this.element),v=0;v=/sw|ne|nw|se|n|s/.test(x)?w.outerHeight():w.outerWidth();var u=["padding",/ne|nw|n/.test(x)?"Top":/se|sw|s/.test(x)?"Bottom":/^e$/.test(x)?"Right":"Left"].join("");t.css(u,v),this._proportionallyResize()}if(!f(this.handles[x]).length){continue}}},this._renderAxis(this.element),this._handles=f(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!m.resizing){if(this.className){var c=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)
}m.axis=c&&c[1]?c[1]:"se"}}),s.autoHide&&(this._handles.hide(),f(this.element).addClass("ui-resizable-autohide").hover(function(){if(s.disabled){return}f(this).removeClass("ui-resizable-autohide"),m._handles.show()},function(){if(s.disabled){return}m.resizing||(f(this).addClass("ui-resizable-autohide"),m._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(c){f(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()
};if(this.elementIsWrapper){d(this.element);var m=this.element;m.after(this.originalElement.css({position:m.css("position"),width:m.outerWidth(),height:m.outerHeight(),top:m.css("top"),left:m.css("left")})).remove()}return this.originalElement.css("resize",this.originalResizeStyle),d(this.originalElement),this},_mouseCapture:function(m){var o=!1;for(var n in this.handles){f(this.handles[n])[0]==m.target&&(o=!0)}return !this.options.disabled&&o},_mouseStart:function(c){var r=this.options,q=this.element.position(),p=this.element;
this.resizing=!0,this.documentScroll={top:f(document).scrollTop(),left:f(document).scrollLeft()},(p.is(".ui-draggable")||/absolute/.test(p.css("position")))&&p.css({position:"absolute",top:q.top,left:q.left}),this._renderProxy();var o=l(this.helper.css("left")),n=l(this.helper.css("top"));r.containment&&(o+=f(r.containment).scrollLeft()||0,n+=f(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:o,top:n},this.size=this._helper?{width:p.outerWidth(),height:p.outerHeight()}:{width:p.width(),height:p.height()},this.originalSize=this._helper?{width:p.outerWidth(),height:p.outerHeight()}:{width:p.width(),height:p.height()},this.originalPosition={left:o,top:n},this.sizeDiff={width:p.outerWidth()-p.width(),height:p.outerHeight()-p.height()},this.originalMousePosition={left:c.pageX,top:c.pageY},this.aspectRatio=typeof r.aspectRatio=="number"?r.aspectRatio:this.originalSize.width/this.originalSize.height||1;
var m=f(".ui-resizable-"+this.axis).css("cursor");return f("body").css("cursor",m=="auto"?this.axis+"-resize":m),p.addClass("ui-resizable-resizing"),this._propagate("start",c),!0},_mouseDrag:function(A){var z=this.helper,y=this.options,x={},w=this,v=this.originalMousePosition,u=this.axis,t=A.pageX-v.left||0,s=A.pageY-v.top||0,r=this._change[u];if(!r){return !1}var q=r.apply(this,[A,t,s]),p=f.browser.msie&&f.browser.version<7,o=this.sizeDiff;this._updateVirtualBoundaries(A.shiftKey);if(this._aspectRatio||A.shiftKey){q=this._updateRatio(q,A)
}return q=this._respectSize(q,A),this._propagate("resize",A),z.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(q),this._trigger("resize",A,this.ui()),!1},_mouseStop:function(v){this.resizing=!1;var u=this.options,t=this;if(this._helper){var s=this._proportionallyResizeElements,r=s.length&&/textarea/i.test(s[0].nodeName),q=r&&f.ui.hasScroll(s[0],"left")?0:t.sizeDiff.height,p=r?0:t.sizeDiff.width,o={width:t.helper.width()-p,height:t.helper.height()-q},n=parseInt(t.element.css("left"),10)+(t.position.left-t.originalPosition.left)||null,m=parseInt(t.element.css("top"),10)+(t.position.top-t.originalPosition.top)||null;
u.animate||this.element.css(f.extend(o,{top:m,left:n})),t.helper.height(t.size.height),t.helper.width(t.size.width),this._helper&&!u.animate&&this._proportionallyResize()}return f("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",v),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(m){var d=this.options,r,q,p,o,n;n={minWidth:h(d.minWidth)?d.minWidth:0,maxWidth:h(d.maxWidth)?d.maxWidth:Infinity,minHeight:h(d.minHeight)?d.minHeight:0,maxHeight:h(d.maxHeight)?d.maxHeight:Infinity};
if(this._aspectRatio||m){r=n.minHeight*this.aspectRatio,p=n.minWidth/this.aspectRatio,q=n.maxHeight*this.aspectRatio,o=n.maxWidth/this.aspectRatio,r>n.minWidth&&(n.minWidth=r),p>n.minHeight&&(n.minHeight=p),q<n.maxWidth&&(n.maxWidth=q),o<n.maxHeight&&(n.maxHeight=o)}this._vBoundaries=n},_updateCache:function(d){var c=this.options;this.offset=this.helper.offset(),h(d.left)&&(this.position.left=d.left),h(d.top)&&(this.position.top=d.top),h(d.height)&&(this.size.height=d.height),h(d.width)&&(this.size.width=d.width)
},_updateRatio:function(m,d){var q=this.options,p=this.position,o=this.size,n=this.axis;return h(m.height)?m.width=m.height*this.aspectRatio:h(m.width)&&(m.height=m.width/this.aspectRatio),n=="sw"&&(m.left=p.left+(o.width-m.width),m.top=null),n=="nw"&&(m.top=p.top+(o.height-m.height),m.left=p.left+(o.width-m.width)),m},_respectSize:function(D,C){var B=this.helper,A=this._vBoundaries,z=this._aspectRatio||C.shiftKey,y=this.axis,x=h(D.width)&&A.maxWidth&&A.maxWidth<D.width,w=h(D.height)&&A.maxHeight&&A.maxHeight<D.height,v=h(D.width)&&A.minWidth&&A.minWidth>D.width,u=h(D.height)&&A.minHeight&&A.minHeight>D.height;
v&&(D.width=A.minWidth),u&&(D.height=A.minHeight),x&&(D.width=A.maxWidth),w&&(D.height=A.maxHeight);var t=this.originalPosition.left+this.originalSize.width,s=this.position.top+this.size.height,r=/sw|nw|w/.test(y),q=/nw|ne|n/.test(y);v&&r&&(D.left=t-A.minWidth),x&&r&&(D.left=t-A.maxWidth),u&&q&&(D.top=s-A.minHeight),w&&q&&(D.top=s-A.maxHeight);var d=!D.width&&!D.height;return d&&!D.left&&D.top?D.top=null:d&&!D.top&&D.left&&(D.left=null),D},_proportionallyResize:function(){var m=this.options;if(!this._proportionallyResizeElements.length){return
}var r=this.helper||this.element;for(var q=0;q<this._proportionallyResizeElements.length;q++){var p=this._proportionallyResizeElements[q];if(!this.borderDif){var o=[p.css("borderTopWidth"),p.css("borderRightWidth"),p.css("borderBottomWidth"),p.css("borderLeftWidth")],n=[p.css("paddingTop"),p.css("paddingRight"),p.css("paddingBottom"),p.css("paddingLeft")];this.borderDif=f.map(o,function(t,s){var v=parseInt(t,10)||0,u=parseInt(n[s],10)||0;return v+u})}if(!f.browser.msie||!f(r).is(":hidden")&&!f(r).parents(":hidden").length){p.css({height:r.height()-this.borderDif[0]-this.borderDif[2]||0,width:r.width()-this.borderDif[1]-this.borderDif[3]||0})
}else{continue}}},_renderProxy:function(){var m=this.element,q=this.options;this.elementOffset=m.offset();if(this._helper){this.helper=this.helper||f('<div style="overflow:hidden;"></div>');var p=f.browser.msie&&f.browser.version<7,o=p?1:0,n=p?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+n,height:this.element.outerHeight()+n,position:"absolute",left:this.elementOffset.left-o+"px",top:this.elementOffset.top-o+"px",zIndex:++q.zIndex}),this.helper.appendTo("body").disableSelection()
}else{this.helper=this.element}},_change:{e:function(m,d,n){return{width:this.originalSize.width+d}},w:function(n,m,r){var q=this.options,p=this.originalSize,o=this.originalPosition;return{left:o.left+m,width:p.width-m}},n:function(n,m,r){var q=this.options,p=this.originalSize,o=this.originalPosition;return{top:o.top+r,height:p.height-r}},s:function(m,d,n){return{height:this.originalSize.height+n}},se:function(m,o,n){return f.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[m,o,n]))
},sw:function(m,o,n){return f.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[m,o,n]))},ne:function(m,o,n){return f.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[m,o,n]))},nw:function(m,o,n){return f.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[m,o,n]))}},_propagate:function(d,m){f.ui.plugin.call(this,d,[m,this.ui()]),d!="resize"&&this._trigger(d,m,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}
}}),f.extend(f.ui.resizable,{version:"1.8.20"}),f.ui.plugin.add("resizable","alsoResize",{start:function(m,q){var p=f(this).data("resizable"),o=p.options,n=function(c){f(c).each(function(){var d=f(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10)})})};typeof o.alsoResize=="object"&&!o.alsoResize.parentNode?o.alsoResize.length?(o.alsoResize=o.alsoResize[0],n(o.alsoResize)):f.each(o.alsoResize,function(c){n(c)
}):n(o.alsoResize)},resize:function(m,t){var s=f(this).data("resizable"),r=s.options,q=s.originalSize,p=s.originalPosition,o={height:s.size.height-q.height||0,width:s.size.width-q.width||0,top:s.position.top-p.top||0,left:s.position.left-p.left||0},n=function(c,u){f(c).each(function(){var d=f(this),x=f(this).data("resizable-alsoresize"),w={},v=u&&u.length?u:d.parents(t.originalElement[0]).length?["width","height"]:["width","height","top","left"];f.each(v,function(z,y){var A=(x[y]||0)+(o[y]||0);A&&A>=0&&(w[y]=A||null)
}),d.css(w)})};typeof r.alsoResize=="object"&&!r.alsoResize.nodeType?f.each(r.alsoResize,function(d,c){n(d,c)}):n(r.alsoResize)},stop:function(d,m){f(this).removeData("resizable-alsoresize")}}),f.ui.plugin.add("resizable","animate",{stop:function(w,v){var u=f(this).data("resizable"),t=u.options,s=u._proportionallyResizeElements,r=s.length&&/textarea/i.test(s[0].nodeName),q=r&&f.ui.hasScroll(s[0],"left")?0:u.sizeDiff.height,p=r?0:u.sizeDiff.width,o={width:u.size.width-p,height:u.size.height-q},n=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,m=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null;
u.element.animate(f.extend(o,m&&n?{top:m,left:n}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var d={width:parseInt(u.element.css("width"),10),height:parseInt(u.element.css("height"),10),top:parseInt(u.element.css("top"),10),left:parseInt(u.element.css("left"),10)};s&&s.length&&f(s[0]).css({width:d.width,height:d.height}),u._updateCache(d),u._propagate("resize",w)}})}}),f.ui.plugin.add("resizable","containment",{start:function(C,B){var A=f(this).data("resizable"),z=A.options,y=A.element,x=z.containment,w=x instanceof f?x.get(0):/parent/.test(x)?y.parent().get(0):x;
if(!w){return}A.containerElement=f(w);if(/document/.test(x)||x==document){A.containerOffset={left:0,top:0},A.containerPosition={left:0,top:0},A.parentData={element:f(document),left:0,top:0,width:f(document).width(),height:f(document).height()||document.body.parentNode.scrollHeight}}else{var v=f(w),u=[];f(["Top","Right","Left","Bottom"]).each(function(m,d){u[m]=l(v.css("padding"+d))}),A.containerOffset=v.offset(),A.containerPosition=v.position(),A.containerSize={height:v.innerHeight()-u[3],width:v.innerWidth()-u[1]};
var t=A.containerOffset,s=A.containerSize.height,r=A.containerSize.width,q=f.ui.hasScroll(w,"left")?w.scrollWidth:r,c=f.ui.hasScroll(w)?w.scrollHeight:s;A.parentData={element:w,left:t.left,top:t.top,width:q,height:c}}},resize:function(E,D){var C=f(this).data("resizable"),B=C.options,A=C.containerSize,z=C.containerOffset,y=C.size,x=C.position,w=C._aspectRatio||E.shiftKey,v={top:0,left:0},u=C.containerElement;u[0]!=document&&/static/.test(u.css("position"))&&(v=z),x.left<(C._helper?z.left:0)&&(C.size.width=C.size.width+(C._helper?C.position.left-z.left:C.position.left-v.left),w&&(C.size.height=C.size.width/C.aspectRatio),C.position.left=B.helper?z.left:0),x.top<(C._helper?z.top:0)&&(C.size.height=C.size.height+(C._helper?C.position.top-z.top:C.position.top),w&&(C.size.width=C.size.height*C.aspectRatio),C.position.top=C._helper?z.top:0),C.offset.left=C.parentData.left+C.position.left,C.offset.top=C.parentData.top+C.position.top;
var t=Math.abs((C._helper?C.offset.left-v.left:C.offset.left-v.left)+C.sizeDiff.width),s=Math.abs((C._helper?C.offset.top-v.top:C.offset.top-z.top)+C.sizeDiff.height),r=C.containerElement.get(0)==C.element.parent().get(0),q=/relative|absolute/.test(C.containerElement.css("position"));r&&q&&(t-=C.parentData.left),t+C.size.width>=C.parentData.width&&(C.size.width=C.parentData.width-t,w&&(C.size.height=C.size.width/C.aspectRatio)),s+C.size.height>=C.parentData.height&&(C.size.height=C.parentData.height-s,w&&(C.size.width=C.size.height*C.aspectRatio))
},stop:function(y,x){var w=f(this).data("resizable"),v=w.options,u=w.position,t=w.containerOffset,s=w.containerPosition,r=w.containerElement,q=f(w.helper),p=q.offset(),o=q.outerWidth()-w.sizeDiff.width,n=q.outerHeight()-w.sizeDiff.height;w._helper&&!v.animate&&/relative/.test(r.css("position"))&&f(this).css({left:p.left-s.left-t.left,width:o,height:n}),w._helper&&!v.animate&&/static/.test(r.css("position"))&&f(this).css({left:p.left-s.left-t.left,width:o,height:n})}}),f.ui.plugin.add("resizable","ghost",{start:function(m,q){var p=f(this).data("resizable"),o=p.options,n=p.size;
p.ghost=p.originalElement.clone(),p.ghost.css({opacity:0.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof o.ghost=="string"?o.ghost:""),p.ghost.appendTo(p.helper)},resize:function(m,p){var o=f(this).data("resizable"),n=o.options;o.ghost&&o.ghost.css({position:"relative",height:o.size.height,width:o.size.width})},stop:function(m,p){var o=f(this).data("resizable"),n=o.options;o.ghost&&o.helper&&o.helper.get(0).removeChild(o.ghost.get(0))
}}),f.ui.plugin.add("resizable","grid",{resize:function(w,v){var u=f(this).data("resizable"),t=u.options,s=u.size,r=u.originalSize,q=u.originalPosition,p=u.axis,o=t._aspectRatio||w.shiftKey;t.grid=typeof t.grid=="number"?[t.grid,t.grid]:t.grid;var n=Math.round((s.width-r.width)/(t.grid[0]||1))*(t.grid[0]||1),m=Math.round((s.height-r.height)/(t.grid[1]||1))*(t.grid[1]||1);/^(se|s|e)$/.test(p)?(u.size.width=r.width+n,u.size.height=r.height+m):/^(ne)$/.test(p)?(u.size.width=r.width+n,u.size.height=r.height+m,u.position.top=q.top-m):/^(sw)$/.test(p)?(u.size.width=r.width+n,u.size.height=r.height+m,u.position.left=q.left-n):(u.size.width=r.width+n,u.size.height=r.height+m,u.position.top=q.top-m,u.position.left=q.left-n)
}});var l=function(c){return parseInt(c,10)||0},h=function(c){return !isNaN(parseInt(c,10))}})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.button.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(v,u){var t,s,r,q,p="ui-button ui-widget ui-state-default ui-corner-all",o="ui-state-hover ui-state-active ",n="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var c=v(this).find(":ui-button");
setTimeout(function(){c.button("refresh")},1)},l=function(f){var x=f.name,w=f.form,h=v([]);return x&&(w?h=v(w).find("[name='"+x+"']"):h=v("[name='"+x+"']",f.ownerDocument).filter(function(){return !this.form})),h};v.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",m),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.propAttr("disabled"):this.element.propAttr("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");
var d=this,w=this.options,f=this.type==="checkbox"||this.type==="radio",e="ui-state-hover"+(f?"":" ui-state-active"),c="ui-state-focus";w.label===null&&(w.label=this.buttonElement.html()),this.buttonElement.addClass(p).attr("role","button").bind("mouseenter.button",function(){if(w.disabled){return}v(this).addClass("ui-state-hover"),this===t&&v(this).addClass("ui-state-active")}).bind("mouseleave.button",function(){if(w.disabled){return}v(this).removeClass(e)}).bind("click.button",function(h){w.disabled&&(h.preventDefault(),h.stopImmediatePropagation())
}),this.element.bind("focus.button",function(){d.buttonElement.addClass(c)}).bind("blur.button",function(){d.buttonElement.removeClass(c)}),f&&(this.element.bind("change.button",function(){if(q){return}d.refresh()}),this.buttonElement.bind("mousedown.button",function(h){if(w.disabled){return}q=!1,s=h.pageX,r=h.pageY}).bind("mouseup.button",function(h){if(w.disabled){return}if(s!==h.pageX||r!==h.pageY){q=!0}})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(w.disabled||q){return !1
}v(this).toggleClass("ui-state-active"),d.buttonElement.attr("aria-pressed",d.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(w.disabled||q){return !1}v(this).addClass("ui-state-active"),d.buttonElement.attr("aria-pressed","true");var h=d.element[0];l(h).not(h).map(function(){return v(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){if(w.disabled){return !1
}v(this).addClass("ui-state-active"),t=this,v(document).one("mouseup",function(){t=null})}).bind("mouseup.button",function(){if(w.disabled){return !1}v(this).removeClass("ui-state-active")}).bind("keydown.button",function(h){if(w.disabled){return !1}(h.keyCode==v.ui.keyCode.SPACE||h.keyCode==v.ui.keyCode.ENTER)&&v(this).addClass("ui-state-active")}).bind("keyup.button",function(){v(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(h){h.keyCode===v.ui.keyCode.SPACE&&v(this).click()
})),this._setOption("disabled",w.disabled),this._resetButton()},_determineButtonType:function(){this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":this.type="button";if(this.type==="checkbox"||this.type==="radio"){var e=this.element.parents().filter(":last"),d="label[for='"+this.element.attr("id")+"']";this.buttonElement=e.find(d),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(d),this.buttonElement.length||(this.buttonElement=e.find(d))),this.element.addClass("ui-helper-hidden-accessible");
var f=this.element.is(":checked");f&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.attr("aria-pressed",f)}else{this.buttonElement=this.element}},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(p+" "+o+" "+n).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title"),v.Widget.prototype.destroy.call(this)
},_setOption:function(d,e){v.Widget.prototype._setOption.apply(this,arguments);if(d==="disabled"){e?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1);return}this._resetButton()},refresh:function(){var c=this.element.is(":disabled");c!==this.options.disabled&&this._setOption("disabled",c),this.type==="radio"?l(this.element[0]).each(function(){v(this).is(":checked")?v(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):v(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")
}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var h=this.buttonElement.removeClass(n),z=v("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(h.empty()).text(),y=this.options.icons,x=y.primary&&y.secondary,w=[];
y.primary||y.secondary?(this.options.text&&w.push("ui-button-text-icon"+(x?"s":y.primary?"-primary":"-secondary")),y.primary&&h.prepend("<span class='ui-button-icon-primary ui-icon "+y.primary+"'></span>"),y.secondary&&h.append("<span class='ui-button-icon-secondary ui-icon "+y.secondary+"'></span>"),this.options.text||(w.push(x?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||h.attr("title",z))):w.push("ui-button-text-only"),h.addClass(w.join(" "))}}),v.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")
},_init:function(){this.refresh()},_setOption:function(d,e){d==="disabled"&&this.buttons.button("option",d,e),v.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var c=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return v(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(c?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(c?"ui-corner-left":"ui-corner-right").end().end()
},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return v(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),v.Widget.prototype.destroy.call(this)}})})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.dialog.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(l,h){var p="ui-dialog ui-widget ui-widget-content ui-corner-all ",o={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},n={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},m=l.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};
l.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(d){var e=l(this).css(d).offset().top;e<0&&l(this).css("top",d.top-e)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1000},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;
var y=this,x=y.options,w=x.title||"&#160;",v=l.ui.dialog.getTitleId(y.element),u=(y.uiDialog=l("<div></div>")).appendTo(document.body).hide().addClass(p+x.dialogClass).css({zIndex:x.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(d){x.closeOnEscape&&!d.isDefaultPrevented()&&d.keyCode&&d.keyCode===l.ui.keyCode.ESCAPE&&(y.close(d),d.preventDefault())}).attr({role:"dialog","aria-labelledby":v}).mousedown(function(d){y.moveToTop(!1,d)}),t=y.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(u),s=(y.uiDialogTitlebar=l("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(u),r=l('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){r.addClass("ui-state-hover")
},function(){r.removeClass("ui-state-hover")}).focus(function(){r.addClass("ui-state-focus")}).blur(function(){r.removeClass("ui-state-focus")}).click(function(d){return y.close(d),!1}).appendTo(s),q=(y.uiDialogTitlebarCloseText=l("<span></span>")).addClass("ui-icon ui-icon-closethick").text(x.closeText).appendTo(r),c=l("<span></span>").addClass("ui-dialog-title").attr("id",v).html(w).prependTo(s);l.isFunction(x.beforeclose)&&!l.isFunction(x.beforeClose)&&(x.beforeClose=x.beforeclose),s.find("*").add(s).disableSelection(),x.draggable&&l.fn.draggable&&y._makeDraggable(),x.resizable&&l.fn.resizable&&y._makeResizable(),y._createButtons(x.buttons),y._isOpen=!1,l.fn.bgiframe&&u.bgiframe()
},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var c=this;return c.overlay&&c.overlay.destroy(),c.uiDialog.hide(),c.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),c.uiDialog.remove(),c.originalTitle&&c.element.attr("title",c.originalTitle),c},widget:function(){return this.uiDialog},close:function(f){var s=this,r,q;if(!1===s._trigger("beforeClose",f)){return}return s.overlay&&s.overlay.destroy(),s.uiDialog.unbind("keypress.ui-dialog"),s._isOpen=!1,s.options.hide?s.uiDialog.hide(s.options.hide,function(){s._trigger("close",f)
}):(s.uiDialog.hide(),s._trigger("close",f)),l.ui.dialog.overlay.resize(),s.options.modal&&(r=0,l(".ui-dialog").each(function(){this!==s.uiDialog[0]&&(q=l(this).css("z-index"),isNaN(q)||(r=Math.max(r,q)))}),l.ui.dialog.maxZ=r),s},isOpen:function(){return this._isOpen},moveToTop:function(q,u){var t=this,s=t.options,r;return s.modal&&!q||!s.stack&&!s.modal?t._trigger("focus",u):(s.zIndex>l.ui.dialog.maxZ&&(l.ui.dialog.maxZ=s.zIndex),t.overlay&&(l.ui.dialog.maxZ+=1,t.overlay.$el.css("z-index",l.ui.dialog.overlay.maxZ=l.ui.dialog.maxZ)),r={scrollTop:t.element.scrollTop(),scrollLeft:t.element.scrollLeft()},l.ui.dialog.maxZ+=1,t.uiDialog.css("z-index",l.ui.dialog.maxZ),t.element.attr(r),t._trigger("focus",u),t)
},open:function(){if(this._isOpen){return}var e=this,q=e.options,f=e.uiDialog;return e.overlay=q.modal?new l.ui.dialog.overlay(e):null,e._size(),e._position(q.position),f.show(q.show),e.moveToTop(!0),q.modal&&f.bind("keydown.ui-dialog",function(r){if(r.keyCode!==l.ui.keyCode.TAB){return}var u=l(":tabbable",this),t=u.filter(":first"),s=u.filter(":last");if(r.target===s[0]&&!r.shiftKey){return t.focus(1),!1}if(r.target===t[0]&&r.shiftKey){return s.focus(1),!1}}),l(e.element.find(":tabbable").get().concat(f.find(".ui-dialog-buttonpane :tabbable").get().concat(f.get()))).eq(0).focus(),e._isOpen=!0,e._trigger("open"),e
},_createButtons:function(f){var t=this,s=!1,r=l("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),q=l("<div></div>").addClass("ui-dialog-buttonset").appendTo(r);t.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof f=="object"&&f!==null&&l.each(f,function(){return !(s=!0)}),s&&(l.each(f,function(c,v){v=l.isFunction(v)?{click:v,text:c}:v;var u=l('<button type="button"></button>').click(function(){v.click.apply(t.element[0],arguments)}).appendTo(q);l.each(v,function(e,d){if(e==="click"){return
}e in m?u[e](d):u.attr(e,d)}),l.fn.button&&u.button()}),r.appendTo(t.uiDialog))},_makeDraggable:function(){function r(c){return{position:c.position,offset:c.offset}}var q=this,u=q.options,t=l(document),s;q.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(e,c){s=u.height==="auto"?"auto":l(this).height(),l(this).height(l(this).height()).addClass("ui-dialog-dragging"),q._trigger("dragStart",e,r(c))},drag:function(d,e){q._trigger("drag",d,r(e))
},stop:function(d,c){u.position=[c.position.left-t.scrollLeft(),c.position.top-t.scrollTop()],l(this).removeClass("ui-dialog-dragging").height(s),q._trigger("dragStop",d,r(c)),l.ui.dialog.overlay.resize()}})},_makeResizable:function(v){function q(c){return{originalPosition:c.originalPosition,originalSize:c.originalSize,position:c.position,size:c.size}}v=v===h?this.options.resizable:v;var u=this,t=u.options,s=u.uiDialog.css("position"),r=typeof v=="string"?v:"n,e,s,w,se,sw,ne,nw";u.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:u.element,maxWidth:t.maxWidth,maxHeight:t.maxHeight,minWidth:t.minWidth,minHeight:u._minHeight(),handles:r,start:function(d,e){l(this).addClass("ui-dialog-resizing"),u._trigger("resizeStart",d,q(e))
},resize:function(d,c){u._trigger("resize",d,q(c))},stop:function(d,e){l(this).removeClass("ui-dialog-resizing"),t.height=l(this).height(),t.width=l(this).width(),u._trigger("resizeStop",d,q(e)),l.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var c=this.options;return c.height==="auto"?c.minHeight:Math.min(c.minHeight,c.height)},_position:function(f){var s=[],r=[0,0],q;if(f){if(typeof f=="string"||typeof f=="object"&&"0" in f){s=f.split?f.split(" "):[f[0],f[1]],s.length===1&&(s[1]=s[0]),l.each(["left","top"],function(d,c){+s[d]===s[d]&&(r[d]=s[d],s[d]=c)
}),f={my:s.join(" "),at:s.join(" "),offset:r.join(" ")}}f=l.extend({},l.ui.dialog.prototype.options.position,f)}else{f=l.ui.dialog.prototype.options.position}q=this.uiDialog.is(":visible"),q||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(l.extend({of:window},f)),q||this.uiDialog.hide()},_setOptions:function(d){var r=this,q={},e=!1;l.each(d,function(f,c){r._setOption(f,c),f in o&&(e=!0),f in n&&(q[f]=c)}),e&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",q)
},_setOption:function(c,u){var t=this,s=t.uiDialog;switch(c){case"beforeclose":c="beforeClose";break;case"buttons":t._createButtons(u);break;case"closeText":t.uiDialogTitlebarCloseText.text(""+u);break;case"dialogClass":s.removeClass(t.options.dialogClass).addClass(p+u);break;case"disabled":u?s.addClass("ui-dialog-disabled"):s.removeClass("ui-dialog-disabled");break;case"draggable":var r=s.is(":data(draggable)");r&&!u&&s.draggable("destroy"),!r&&u&&t._makeDraggable();break;case"position":t._position(u);
break;case"resizable":var q=s.is(":data(resizable)");q&&!u&&s.resizable("destroy"),q&&typeof u=="string"&&s.resizable("option","handles",u),!q&&u!==!1&&t._makeResizable(u);break;case"title":l(".ui-dialog-title",t.uiDialogTitlebar).html(""+(u||"&#160;"))}l.Widget.prototype._setOption.apply(t,arguments)},_size:function(){var q=this.options,u,t,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),q.minWidth>q.width&&(q.width=q.minWidth),u=this.uiDialog.css({height:"auto",width:q.width}).height(),t=Math.max(0,q.minHeight-u);
if(q.height==="auto"){if(l.support.minHeight){this.element.css({minHeight:t,height:"auto"})}else{this.uiDialog.show();var r=this.element.css("height","auto").height();s||this.uiDialog.hide(),this.element.height(Math.max(r,t))}}else{this.element.height(Math.max(q.height-u,0))}this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),l.extend(l.ui.dialog,{version:"1.8.20",uuid:0,maxZ:0,getTitleId:function(d){var c=d.attr("id");return c||(this.uuid+=1,c=this.uuid),"ui-dialog-title-"+c
},overlay:function(c){this.$el=l.ui.dialog.overlay.create(c)}}),l.extend(l.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:l.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(c){return c+".dialog-overlay"}).join(" "),create:function(d){this.instances.length===0&&(setTimeout(function(){l.ui.dialog.overlay.instances.length&&l(document).bind(l.ui.dialog.overlay.events,function(c){if(l(c.target).zIndex()<l.ui.dialog.overlay.maxZ){return !1}})},1),l(document).bind("keydown.dialog-overlay",function(f){d.options.closeOnEscape&&!f.isDefaultPrevented()&&f.keyCode&&f.keyCode===l.ui.keyCode.ESCAPE&&(d.close(f),f.preventDefault())
}),l(window).bind("resize.dialog-overlay",l.ui.dialog.overlay.resize));var e=(this.oldInstances.pop()||l("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});return l.fn.bgiframe&&e.bgiframe(),this.instances.push(e),e},destroy:function(e){var q=l.inArray(e,this.instances);q!=-1&&this.oldInstances.push(this.instances.splice(q,1)[0]),this.instances.length===0&&l([document,window]).unbind(".dialog-overlay"),e.remove();var f=0;l.each(this.instances,function(){f=Math.max(f,this.css("z-index"))
}),this.maxZ=f},height:function(){var d,e;return l.browser.msie&&l.browser.version<7?(d=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),e=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),d<e?l(window).height()+"px":d+"px"):l(document).height()+"px"},width:function(){var d,e;return l.browser.msie?(d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),d<e?l(window).width()+"px":d+"px"):l(document).width()+"px"
},resize:function(){var c=l([]);l.each(l.ui.dialog.overlay.instances,function(){c=c.add(this)}),c.css({width:0,height:0}).css({width:l.ui.dialog.overlay.width(),height:l.ui.dialog.overlay.height()})}}),l.extend(l.ui.dialog.overlay.prototype,{destroy:function(){l.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.slider.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(e,d){var f=5;e.widget("ui.slider",e.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var c=this,q=this.options,p=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",n=q.values&&q.values.length||1,m=[];
this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"+(q.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),q.range&&(q.range===!0&&(q.values||(q.values=[this._valueMin(),this._valueMin()]),q.values.length&&q.values.length!==2&&(q.values=[q.values[0],q.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(q.range==="min"||q.range==="max"?" ui-slider-range-"+q.range:"")));
for(var l=p.length;l<n;l+=1){m.push(o)}this.handles=p.add(e(m.join("")).appendTo(c.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(h){h.preventDefault()}).hover(function(){q.disabled||e(this).addClass("ui-state-hover")},function(){e(this).removeClass("ui-state-hover")}).focus(function(){q.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")
}),this.handles.each(function(h){e(this).data("index.ui-slider-handle",h)}),this.handles.keydown(function(w){var v=e(this).data("index.ui-slider-handle"),u,t,s,r;if(c.options.disabled){return}switch(w.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:w.preventDefault();if(!c._keySliding){c._keySliding=!0,e(this).addClass("ui-state-active"),u=c._start(w,v);
if(u===!1){return}}}r=c.options.step,c.options.values&&c.options.values.length?t=s=c.values(v):t=s=c.value();switch(w.keyCode){case e.ui.keyCode.HOME:s=c._valueMin();break;case e.ui.keyCode.END:s=c._valueMax();break;case e.ui.keyCode.PAGE_UP:s=c._trimAlignValue(t+(c._valueMax()-c._valueMin())/f);break;case e.ui.keyCode.PAGE_DOWN:s=c._trimAlignValue(t-(c._valueMax()-c._valueMin())/f);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(t===c._valueMax()){return}s=c._trimAlignValue(t+r);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t===c._valueMin()){return
}s=c._trimAlignValue(t-r)}c._slide(w,v,s)}).keyup(function(r){var h=e(this).data("index.ui-slider-handle");c._keySliding&&(c._keySliding=!1,c._stop(r,h),c._change(r,h),e(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){return 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(),this
},_mouseCapture:function(w){var v=this.options,u,t,s,r,q,p,o,n,m;return v.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),u={x:w.pageX,y:w.pageY},t=this._normValueFromMouse(u),s=this._valueMax()-this._valueMin()+1,q=this,this.handles.each(function(h){var l=Math.abs(t-q.values(h));s>l&&(s=l,r=e(this),p=h)}),v.range===!0&&this.values(1)===v.min&&(p+=1,r=e(this.handles[p])),o=this._start(w,p),o===!1?!1:(this._mouseSliding=!0,q._handleIndex=p,r.addClass("ui-state-active").focus(),n=r.offset(),m=!e(w.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=m?{left:0,top:0}:{left:w.pageX-n.left-r.width()/2,top:w.pageY-n.top-r.height()/2-(parseInt(r.css("borderTopWidth"),10)||0)-(parseInt(r.css("borderBottomWidth"),10)||0)+(parseInt(r.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(w,p,t),this._animateOff=!0,!0))
},_mouseStart:function(c){return !0},_mouseDrag:function(l){var h={x:l.pageX,y:l.pageY},m=this._normValueFromMouse(h);return this._slide(l,this._handleIndex,m),!1},_mouseStop:function(c){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(c,this._handleIndex),this._change(c,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"
},_normValueFromMouse:function(l){var h,p,o,n,m;return this.orientation==="horizontal"?(h=this.elementSize.width,p=l.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(h=this.elementSize.height,p=l.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),o=p/h,o>1&&(o=1),o<0&&(o=0),this.orientation==="vertical"&&(o=1-o),n=this._valueMax()-this._valueMin(),m=this._valueMin()+o*n,this._trimAlignValue(m)},_start:function(l,h){var m={handle:this.handles[h],value:this.value()};
return this.options.values&&this.options.values.length&&(m.value=this.values(h),m.values=this.values()),this._trigger("start",l,m)},_slide:function(l,h,p){var o,n,m;this.options.values&&this.options.values.length?(o=this.values(h?0:1),this.options.values.length===2&&this.options.range===!0&&(h===0&&p>o||h===1&&p<o)&&(p=o),p!==this.values(h)&&(n=this.values(),n[h]=p,m=this._trigger("slide",l,{handle:this.handles[h],value:p,values:n}),o=this.values(h?0:1),m!==!1&&this.values(h,p,!0))):p!==this.value()&&(m=this._trigger("slide",l,{handle:this.handles[h],value:p}),m!==!1&&this.value(p))
},_stop:function(l,h){var m={handle:this.handles[h],value:this.value()};this.options.values&&this.options.values.length&&(m.value=this.values(h),m.values=this.values()),this._trigger("stop",l,m)},_change:function(l,h){if(!this._keySliding&&!this._mouseSliding){var m={handle:this.handles[h],value:this.value()};this.options.values&&this.options.values.length&&(m.value=this.values(h),m.values=this.values()),this._trigger("change",l,m)}},value:function(c){if(arguments.length){this.options.value=this._trimAlignValue(c),this._refreshValue(),this._change(null,0);
return}return this._value()},values:function(h,o){var n,m,l;if(arguments.length>1){this.options.values[h]=this._trimAlignValue(o),this._refreshValue(),this._change(null,h);return}if(!arguments.length){return this._values()}if(!e.isArray(arguments[0])){return this.options.values&&this.options.values.length?this._values(h):this.value()}n=this.options.values,m=arguments[0];for(l=0;l<n.length;l+=1){n[l]=this._trimAlignValue(m[l]),this._change(null,l)}this._refreshValue()},_setOption:function(h,n){var m,l=0;
e.isArray(this.options.values)&&(l=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(h){case"disabled":n?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();
break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(m=0;m<l;m+=1){this._change(null,m)}this._animateOff=!1}},_value:function(){var c=this.options.value;return c=this._trimAlignValue(c),c},_values:function(l){var h,n,m;if(arguments.length){return h=this.options.values[l],h=this._trimAlignValue(h),h}n=this.options.values.slice();for(m=0;m<n.length;m+=1){n[m]=this._trimAlignValue(n[m])}return n
},_trimAlignValue:function(l){if(l<=this._valueMin()){return this._valueMin()}if(l>=this._valueMax()){return this._valueMax()}var h=this.options.step>0?this.options.step:1,n=(l-this._valueMin())%h,m=l-n;return Math.abs(n)*2>=h&&(m+=n>0?h:-h),parseFloat(m.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var u=this.options.range,t=this.options,s=this,r=this._animateOff?!1:t.animate,q,p={},o,n,m,l;this.options.values&&this.options.values.length?this.handles.each(function(c,h){q=(s.values(c)-s._valueMin())/(s._valueMax()-s._valueMin())*100,p[s.orientation==="horizontal"?"left":"bottom"]=q+"%",e(this).stop(1,1)[r?"animate":"css"](p,t.animate),s.options.range===!0&&(s.orientation==="horizontal"?(c===0&&s.range.stop(1,1)[r?"animate":"css"]({left:q+"%"},t.animate),c===1&&s.range[r?"animate":"css"]({width:q-o+"%"},{queue:!1,duration:t.animate})):(c===0&&s.range.stop(1,1)[r?"animate":"css"]({bottom:q+"%"},t.animate),c===1&&s.range[r?"animate":"css"]({height:q-o+"%"},{queue:!1,duration:t.animate}))),o=q
}):(n=this.value(),m=this._valueMin(),l=this._valueMax(),q=l!==m?(n-m)/(l-m)*100:0,p[s.orientation==="horizontal"?"left":"bottom"]=q+"%",this.handle.stop(1,1)[r?"animate":"css"](p,t.animate),u==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[r?"animate":"css"]({width:q+"%"},t.animate),u==="max"&&this.orientation==="horizontal"&&this.range[r?"animate":"css"]({width:100-q+"%"},{queue:!1,duration:t.animate}),u==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[r?"animate":"css"]({height:q+"%"},t.animate),u==="max"&&this.orientation==="vertical"&&this.range[r?"animate":"css"]({height:100-q+"%"},{queue:!1,duration:t.animate}))
}}),e.extend(e.ui.slider,{version:"1.8.20"})})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.datepicker.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))
}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);if(!c.length){return}c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);if($.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])||!d.length){return}d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover")
})}function extendRemove(a,b){$.extend(a,b);for(var c in b){if(b[c]==null||b[c]==undefined){a[c]=b[c]}}return a}function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}$.extend($.ui,{datepicker:{version:"1.8.20"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv
},setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);
var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}
},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);if(c.hasClass(this.markerClassName)){return}this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a)},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");
b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]),!1
})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++){a[d].length>b&&(b=a[d].length,c=d)}return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName)){return
}c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block")},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)
}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f),this
},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName)){return}var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);
if(!b.hasClass(this.markerClassName)){return}var d=a.nodeName.toLowerCase();if(d=="input"){a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})
},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName)){return}var d=a.nodeName.toLowerCase();if(d=="input"){a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b
}),this._disabledInputs[this._disabledInputs.length]=a},_isDisabledDatepicker:function(a){if(!a){return !1}for(var b=0;b<this._disabledInputs.length;b++){if(this._disabledInputs[b]==a){return !0}}return !1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string"){return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null
}var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)
}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);return c&&!c.inline&&this._setDateFromField(c,b),c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");
b._keyEvent=!0;if($.datepicker._datepickerShowing){switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else{$.datepicker._hideDatepicker()}return !1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");
break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");
break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}}else{a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1
}c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal){try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));
c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(d){$.datepicker.log(d)}}return !0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if($.datepicker._isDisabledDatepicker(a)||$.datepicker._lastInput==a){return}var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));
var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1){return}extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){return e|=$(this).css("position")=="fixed",!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);
var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");
if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);
instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();
if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();
return b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0),b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a))){a=a[c?"previousSibling":"nextSibling"]}var d=$(a).offset();return[d.left,d.top]
},_hideDatepicker:function(a){var b=this._curInst;if(!b||a&&b!=$.data(a,PROP_NAME)){return}if(this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=function(){$.datepicker._tidyDialog(b)};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,e):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,e),c||e(),this._datepickerShowing=!1;var f=this._get(b,"onClose");f&&f.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1
}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!$.datepicker._curInst){return}var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()
},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);if(this._isDisabledDatepicker(d[0])){return}this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e)},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay){c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear}else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()
}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if($(d).hasClass(this._unselectableClass)||this._isDisabledDatepicker(e[0])){return}var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))
},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");
if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/86400000)/7)+1},parseDate:function(a,b,c){if(a==null||b==null){throw"Invalid arguments"}b=typeof b=="object"?b.toString():b+"";
if(b==""){return null}var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;return c&&s++,c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);
if(!f){throw"Missing number at position "+r}return r+=f[0].length,parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return -(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase()){return f=c[0],r+=d.length,!1}});if(f!=-1){return f+1}throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s)){throw"Unexpected literal at position "+r}r++},r=0;for(var s=0;s<a.length;
s++){if(m){a.charAt(s)=="'"&&!n("'")?m=!1:q()}else{switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/10000);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}}}if(r<b.length){throw"Extra/unparsed characters found in date: "+b.substring(r)
}i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;do{var u=this._getDaysInMonth(i,j-1);if(k<=u){break}j++,k-=u}while(!0)}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k){throw"Invalid date"}return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*10000000,formatDate:function(a,b,c){if(!b){return""
}var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;return c&&m++,c},i=function(a,b,c){var d=""+b;if(h(a)){while(d.length<c){d="0"+d}}return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b){for(var m=0;m<a.length;m++){if(l){a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m)
}else{switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/86400000),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*10000+this._ticksTo1970;break;
case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}}}}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;return c&&e++,c};for(var e=0;e<a.length;e++){if(c){a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e)}else{switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}}}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]
},_setDateFromField:function(a,b){if(a.input.val()==a.lastVal){return}var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))
},_determineDate:function(a,b,c){var d=function(a){var b=new Date;return b.setDate(b.getDate()+a),b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;
break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());return f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0)),this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){return a?(a.setHours(a.getHours()>12?a.getHours()+2:0),a):null
},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));
return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;
n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p){n--,n<0&&(n=11,o--)}}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\" title=\""+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");
s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;
u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\">"+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);
y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";
if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1){switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead><tr>';
var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));
for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?"&#xa0;":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)
}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}return K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),a._keyEvent=!1,K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";
if(f||!i){m+='<span class="ui-datepicker-month">'+g[b]+"</span>"}else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" >";for(var p=0;p<12;p++){(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>")}m+="</select>"}k||(l+=m+(f||!i||!j?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(f||!j){l+='<span class="ui-datepicker-year">'+c+"</span>"
}else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" >";for(;t<=u;t++){a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>"
}a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}return l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?"&#xa0;":"")+m),l+="</div>",l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)
},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;return e=d&&e>d?d:e,e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()
},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));return b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");
return b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10),{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));
return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length){return this}$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return typeof a!="string"||a!="isDisabled"&&a!="getDate"&&a!="widget"?a=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)
}):$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.20",window["DP_jQuery_"+dpuuid]=$})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.progressbar.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(d,c){d.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=d("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()
},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),d.Widget.prototype.destroy.apply(this,arguments)},value:function(e){return e===c?this._value():(this._setOption("value",e),this)},_setOption:function(e,f){e==="value"&&(this.options.value=f,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),d.Widget.prototype._setOption.apply(this,arguments)
},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var f=this.value(),e=this._percentage();this.oldValue!==f&&(this.oldValue=f,this._trigger("change")),this.valueDiv.toggle(f>this.min).toggleClass("ui-corner-right",f===this.options.max).width(e.toFixed(0)+"%"),this.element.attr("aria-valuenow",f)}}),d.extend(d.ui.progressbar,{version:"1.8.20"})
})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.effects.core.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
jQuery.effects||function(x,w){function v(d){var e;return d&&d.constructor==Array&&d.length==3?d:(e=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(d))?[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)]:(e=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(d))?[parseFloat(e[1])*2.55,parseFloat(e[2])*2.55,parseFloat(e[3])*2.55]:(e=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(d))?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:(e=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(d))?[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]:(e=/rgba\(0, 0, 0, 0\)/.exec(d))?t.transparent:t[x.trim(d).toLowerCase()]
}function u(c,h){var f;do{f=x.curCSS(c,h);if(f!=""&&f!="transparent"||x.nodeName(c,"body")){break}h="backgroundColor"}while(c=c.parentNode);return v(f)}function q(){var h=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,f={},z,y;if(h&&h.length&&h[0]&&h[h[0]]){var l=h.length;while(l--){z=h[l],typeof h[z]=="string"&&(y=z.replace(/\-(\w)/g,function(d,c){return c.toUpperCase()}),f[y]=h[z])}}else{for(z in h){typeof h[z]=="string"&&(f[z]=h[z])}}return f}function p(e){var h,f;
for(h in e){f=e[h],(f==null||x.isFunction(f)||h in r||/scrollbar/.test(h)||!/color/i.test(h)&&isNaN(parseFloat(f)))&&delete e[h]}return e}function o(f,e){var l={_:0},h;for(h in e){f[h]!=e[h]&&(l[h]=e[h])}return l}function n(f,y,l,h){typeof f=="object"&&(h=y,l=null,y=f,f=y.effect),x.isFunction(y)&&(h=y,l=null,y={});if(typeof y=="number"||x.fx.speeds[y]){h=l,l=y,y={}}return x.isFunction(l)&&(h=l,l=null),y=y||{},l=l||y.duration,l=x.fx.off?0:typeof l=="number"?l:l in x.fx.speeds?x.fx.speeds[l]:x.fx.speeds._default,h=h||y.complete,[f,y,l,h]
}function m(c){return !c||typeof c=="number"||x.fx.speeds[c]?!0:typeof c=="string"&&!x.effects[c]?!0:!1}x.effects={},x.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(c,d){x.fx.step[d]=function(e){e.colorInit||(e.start=u(e.elem,d),e.end=v(e.end),e.colorInit=!0),e.elem.style[d]="rgb("+Math.max(Math.min(parseInt(e.pos*(e.end[0]-e.start[0])+e.start[0],10),255),0)+","+Math.max(Math.min(parseInt(e.pos*(e.end[1]-e.start[1])+e.start[1],10),255),0)+","+Math.max(Math.min(parseInt(e.pos*(e.end[2]-e.start[2])+e.start[2],10),255),0)+")"
}});var t={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},s=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};
x.effects.animateClass=function(f,y,l,h){return x.isFunction(l)&&(h=l,l=null),this.queue(function(){var z=x(this),e=z.attr("style")||" ",d=p(q.call(this)),c,A=z.attr("class")||"";x.each(s,function(B,C){f[C]&&z[C+"Class"](f[C])}),c=p(q.call(this)),z.attr("class",A),z.animate(o(d,c),{queue:!1,duration:y,easing:l,complete:function(){x.each(s,function(B,C){f[C]&&z[C+"Class"](f[C])}),typeof z.attr("style")=="object"?(z.attr("style").cssText="",z.attr("style").cssText=e):z.attr("style",e),h&&h.apply(this,arguments),x.dequeue(this)
}})})},x.fn.extend({_addClass:x.fn.addClass,addClass:function(f,y,l,h){return y?x.effects.animateClass.apply(this,[{add:f},y,l,h]):this._addClass(f)},_removeClass:x.fn.removeClass,removeClass:function(f,y,l,h){return y?x.effects.animateClass.apply(this,[{remove:f},y,l,h]):this._removeClass(f)},_toggleClass:x.fn.toggleClass,toggleClass:function(A,z,y,l,h){return typeof z=="boolean"||z===w?y?x.effects.animateClass.apply(this,[z?{add:A}:{remove:A},y,l,h]):this._toggleClass(A,z):x.effects.animateClass.apply(this,[{toggle:A},z,y,l])
},switchClass:function(h,A,z,y,l){return x.effects.animateClass.apply(this,[{add:A,remove:h},z,y,l])}}),x.extend(x.effects,{version:"1.8.20",save:function(e,d){for(var f=0;f<d.length;f++){d[f]!==null&&e.data("ec.storage."+d[f],e[0].style[d[f]])}},restore:function(e,d){for(var f=0;f<d.length;f++){d[f]!==null&&e.css(d[f],e.data("ec.storage."+d[f]))}},setMode:function(d,c){return c=="toggle"&&(c=d.is(":hidden")?"show":"hide"),c},getBaseline:function(f,e){var l,h;switch(f[0]){case"top":l=0;break;case"middle":l=0.5;
break;case"bottom":l=1;break;default:l=f[0]/e.height}switch(f[1]){case"left":h=0;break;case"center":h=0.5;break;case"right":h=1;break;default:h=f[1]/e.width}return{x:h,y:l}},createWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent()}var y={width:f.outerWidth(!0),height:f.outerHeight(!0),"float":f.css("float")},l=x("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),h=document.activeElement;return f.wrap(l),(f[0]===h||x.contains(f[0],h))&&x(h).focus(),l=f.parent(),f.css("position")=="static"?(l.css({position:"relative"}),f.css({position:"relative"})):(x.extend(y,{position:f.css("position"),zIndex:f.css("z-index")}),x.each(["top","left","bottom","right"],function(c,e){y[e]=f.css(e),isNaN(parseInt(y[e],10))&&(y[e]="auto")
}),f.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),l.css(y).show()},removeWrapper:function(e){var h,f=document.activeElement;return e.parent().is(".ui-effects-wrapper")?(h=e.parent().replaceWith(e),(e[0]===f||x.contains(e[0],f))&&x(f).focus(),h):e},setTransition:function(f,y,l,h){return h=h||{},x.each(y,function(d,z){var e=f.cssUnit(z);e[0]>0&&(h[z]=e[0]*l+e[1])}),h}}),x.fn.extend({effect:function(l,E,D,C){var B=n.apply(this,arguments),A={options:B[1],duration:B[2],callback:B[3]},z=A.options.mode,y=x.effects[l];
return x.fx.off||!y?z?this[z](A.duration,A.callback):this.each(function(){A.callback&&A.callback.call(this)}):y.call(this,A)},_show:x.fn.show,show:function(d){if(m(d)){return this._show.apply(this,arguments)}var c=n.apply(this,arguments);return c[1].mode="show",this.effect.apply(this,c)},_hide:x.fn.hide,hide:function(d){if(m(d)){return this._hide.apply(this,arguments)}var c=n.apply(this,arguments);return c[1].mode="hide",this.effect.apply(this,c)},__toggle:x.fn.toggle,toggle:function(d){if(m(d)||typeof d=="boolean"||x.isFunction(d)){return this.__toggle.apply(this,arguments)
}var e=n.apply(this,arguments);return e[1].mode="toggle",this.effect.apply(this,e)},cssUnit:function(e){var h=this.css(e),f=[];return x.each(["em","px","%","pt"],function(d,c){h.indexOf(c)>0&&(f=[parseFloat(h),c])}),f}}),x.easing.jswing=x.easing.swing,x.extend(x.easing,{def:"easeOutQuad",swing:function(h,A,z,y,l){return x.easing[x.easing.def](h,A,z,y,l)},easeInQuad:function(h,f,z,y,l){return y*(f/=l)*f+z},easeOutQuad:function(h,f,z,y,l){return -y*(f/=l)*(f-2)+z},easeInOutQuad:function(h,f,z,y,l){return(f/=l/2)<1?y/2*f*f+z:-y/2*(--f*(f-2)-1)+z
},easeInCubic:function(h,f,z,y,l){return y*(f/=l)*f*f+z},easeOutCubic:function(h,f,z,y,l){return y*((f=f/l-1)*f*f+1)+z},easeInOutCubic:function(h,f,z,y,l){return(f/=l/2)<1?y/2*f*f*f+z:y/2*((f-=2)*f*f+2)+z},easeInQuart:function(h,f,z,y,l){return y*(f/=l)*f*f*f+z},easeOutQuart:function(h,f,z,y,l){return -y*((f=f/l-1)*f*f*f-1)+z},easeInOutQuart:function(h,f,z,y,l){return(f/=l/2)<1?y/2*f*f*f*f+z:-y/2*((f-=2)*f*f*f-2)+z},easeInQuint:function(h,f,z,y,l){return y*(f/=l)*f*f*f*f+z},easeOutQuint:function(h,f,z,y,l){return y*((f=f/l-1)*f*f*f*f+1)+z
},easeInOutQuint:function(h,f,z,y,l){return(f/=l/2)<1?y/2*f*f*f*f*f+z:y/2*((f-=2)*f*f*f*f+2)+z},easeInSine:function(h,f,z,y,l){return -y*Math.cos(f/l*(Math.PI/2))+y+z},easeOutSine:function(h,f,z,y,l){return y*Math.sin(f/l*(Math.PI/2))+z},easeInOutSine:function(h,f,z,y,l){return -y/2*(Math.cos(Math.PI*f/l)-1)+z},easeInExpo:function(h,f,z,y,l){return f==0?z:y*Math.pow(2,10*(f/l-1))+z},easeOutExpo:function(h,f,z,y,l){return f==l?z+y:y*(-Math.pow(2,-10*f/l)+1)+z},easeInOutExpo:function(h,f,z,y,l){return f==0?z:f==l?z+y:(f/=l/2)<1?y/2*Math.pow(2,10*(f-1))+z:y/2*(-Math.pow(2,-10*--f)+2)+z
},easeInCirc:function(h,f,z,y,l){return -y*(Math.sqrt(1-(f/=l)*f)-1)+z},easeOutCirc:function(h,f,z,y,l){return y*Math.sqrt(1-(f=f/l-1)*f)+z},easeInOutCirc:function(h,f,z,y,l){return(f/=l/2)<1?-y/2*(Math.sqrt(1-f*f)-1)+z:y/2*(Math.sqrt(1-(f-=2)*f)+1)+z},easeInElastic:function(y,l,E,D,C){var B=1.70158,A=0,z=D;if(l==0){return E}if((l/=C)==1){return E+D}A||(A=C*0.3);if(z<Math.abs(D)){z=D;var B=A/4}else{var B=A/(2*Math.PI)*Math.asin(D/z)}return -(z*Math.pow(2,10*(l-=1))*Math.sin((l*C-B)*2*Math.PI/A))+E
},easeOutElastic:function(y,l,E,D,C){var B=1.70158,A=0,z=D;if(l==0){return E}if((l/=C)==1){return E+D}A||(A=C*0.3);if(z<Math.abs(D)){z=D;var B=A/4}else{var B=A/(2*Math.PI)*Math.asin(D/z)}return z*Math.pow(2,-10*l)*Math.sin((l*C-B)*2*Math.PI/A)+D+E},easeInOutElastic:function(y,l,E,D,C){var B=1.70158,A=0,z=D;if(l==0){return E}if((l/=C/2)==2){return E+D}A||(A=C*0.3*1.5);if(z<Math.abs(D)){z=D;var B=A/4}else{var B=A/(2*Math.PI)*Math.asin(D/z)}return l<1?-0.5*z*Math.pow(2,10*(l-=1))*Math.sin((l*C-B)*2*Math.PI/A)+E:z*Math.pow(2,-10*(l-=1))*Math.sin((l*C-B)*2*Math.PI/A)*0.5+D+E
},easeInBack:function(h,B,A,z,y,l){return l==w&&(l=1.70158),z*(B/=y)*B*((l+1)*B-l)+A},easeOutBack:function(h,B,A,z,y,l){return l==w&&(l=1.70158),z*((B=B/y-1)*B*((l+1)*B+l)+1)+A},easeInOutBack:function(h,B,A,z,y,l){return l==w&&(l=1.70158),(B/=y/2)<1?z/2*B*B*(((l*=1.525)+1)*B-l)+A:z/2*((B-=2)*B*(((l*=1.525)+1)*B+l)+2)+A},easeInBounce:function(h,A,z,y,l){return y-x.easing.easeOutBounce(h,l-A,0,y,l)+z},easeOutBounce:function(h,f,z,y,l){return(f/=l)<1/2.75?y*7.5625*f*f+z:f<2/2.75?y*(7.5625*(f-=1.5/2.75)*f+0.75)+z:f<2.5/2.75?y*(7.5625*(f-=2.25/2.75)*f+0.9375)+z:y*(7.5625*(f-=2.625/2.75)*f+0.984375)+z
},easeInOutBounce:function(h,A,z,y,l){return A<l/2?x.easing.easeInBounce(h,A*2,0,y,l)*0.5+z:x.easing.easeOutBounce(h,A*2-l,0,y,l)*0.5+y*0.5+z}})}(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.effects.blind.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(d,c){d.effects.blind=function(e){return this.queue(function(){var s=d(this),r=["position","top","bottom","left","right"],q=d.effects.setMode(s,e.options.mode||"hide"),p=e.options.direction||"vertical";
d.effects.save(s,r),s.show();var o=d.effects.createWrapper(s).css({overflow:"hidden"}),n=p=="vertical"?"height":"width",m=p=="vertical"?o.height():o.width();q=="show"&&o.css(n,0);var l={};l[n]=q=="show"?m:0,o.animate(l,e.duration,e.options.easing,function(){q=="hide"&&s.hide(),d.effects.restore(s,r),d.effects.removeWrapper(s),e.callback&&e.callback.apply(s[0],arguments),s.dequeue()})})}})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.effects.drop.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(d,c){d.effects.drop=function(e){return this.queue(function(){var s=d(this),r=["position","top","bottom","left","right","opacity"],q=d.effects.setMode(s,e.options.mode||"hide"),p=e.options.direction||"left";
d.effects.save(s,r),s.show(),d.effects.createWrapper(s);var o=p=="up"||p=="down"?"top":"left",n=p=="up"||p=="left"?"pos":"neg",m=e.options.distance||(o=="top"?s.outerHeight({margin:!0})/2:s.outerWidth({margin:!0})/2);q=="show"&&s.css("opacity",0).css(o,n=="pos"?-m:m);var l={opacity:q=="show"?1:0};l[o]=(q=="show"?n=="pos"?"+=":"-=":n=="pos"?"-=":"+=")+m,s.animate(l,{queue:!1,duration:e.duration,easing:e.options.easing,complete:function(){q=="hide"&&s.hide(),d.effects.restore(s,r),d.effects.removeWrapper(s),e.callback&&e.callback.apply(this,arguments),s.dequeue()
}})})}})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.effects.fade.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(d,c){d.effects.fade=function(e){return this.queue(function(){var h=d(this),f=d.effects.setMode(h,e.options.mode||"hide");h.animate({opacity:f},{queue:!1,duration:e.duration,easing:e.options.easing,complete:function(){e.callback&&e.callback.apply(this,arguments),h.dequeue()}})})}})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.effects.highlight.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(d,c){d.effects.highlight=function(e){return this.queue(function(){var n=d(this),m=["backgroundImage","backgroundColor","opacity"],l=d.effects.setMode(n,e.options.mode||"show"),h={backgroundColor:n.css("backgroundColor")};
l=="hide"&&(h.opacity=0),d.effects.save(n,m),n.show().css({backgroundImage:"none",backgroundColor:e.options.color||"#ffff99"}).animate(h,{queue:!1,duration:e.duration,easing:e.options.easing,complete:function(){l=="hide"&&n.hide(),d.effects.restore(n,m),l=="show"&&!d.support.opacity&&this.style.removeAttribute("filter"),e.callback&&e.callback.apply(this,arguments),n.dequeue()}})})}})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.effects.pulsate.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(d,c){d.effects.pulsate=function(e){return this.queue(function(){var r=d(this),q=d.effects.setMode(r,e.options.mode||"show"),p=(e.options.times||5)*2-1,o=e.duration?e.duration/2:d.fx.speeds._default/2,n=r.is(":visible"),m=0;
n||(r.css("opacity",0).show(),m=1),(q=="hide"&&n||q=="show"&&!n)&&p--;for(var l=0;l<p;l++){r.animate({opacity:m},o,e.options.easing),m=(m+1)%2}r.animate({opacity:m},o,e.options.easing,function(){m==0&&r.hide(),e.callback&&e.callback.apply(this,arguments)}),r.queue("fx",function(){r.dequeue()}).dequeue()})}})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.effects.slide.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(d,c){d.effects.slide=function(e){return this.queue(function(){var s=d(this),r=["position","top","bottom","left","right"],q=d.effects.setMode(s,e.options.mode||"show"),p=e.options.direction||"left";
d.effects.save(s,r),s.show(),d.effects.createWrapper(s).css({overflow:"hidden"});var o=p=="up"||p=="down"?"top":"left",n=p=="up"||p=="left"?"pos":"neg",m=e.options.distance||(o=="top"?s.outerHeight({margin:!0}):s.outerWidth({margin:!0}));q=="show"&&s.css(o,n=="pos"?isNaN(m)?"-"+m:-m:m);var l={};l[o]=(q=="show"?n=="pos"?"+=":"-=":n=="pos"?"-=":"+=")+m,s.animate(l,{queue:!1,duration:e.duration,easing:e.options.easing,complete:function(){q=="hide"&&s.hide(),d.effects.restore(s,r),d.effects.removeWrapper(s),e.callback&&e.callback.apply(this,arguments),s.dequeue()
}})})}})(jQuery);
/* jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.effects.transfer.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(d,c){d.effects.transfer=function(e){return this.queue(function(){var q=d(this),p=d(e.options.to),o=p.offset(),n={top:o.top,left:o.left,height:p.innerHeight(),width:p.innerWidth()},m=q.offset(),l=d('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(e.options.className).css({top:m.top,left:m.left,height:q.innerHeight(),width:q.innerWidth(),position:"absolute"}).animate(n,e.duration,e.options.easing,function(){l.remove(),e.callback&&e.callback.apply(q[0],arguments),q.dequeue()
})})}})(jQuery);(function(c){var d=0;c.fn.identify=function(){this.each(function(){var f=c(this);if(f.attr("id")){return}do{var e="anon_"+d++}while(c("#"+e).length);f.attr("id",e)});return this.eq(0).attr("id")}})(jQuery);(function(d){var c={init:function(){this.data("hasData",false);this.data("expanded",false);this.data("loading",false);this.data("details",d("#x"+this.attr("id")));return this},getRocId:function(){return this.attr("id").substring(4)},getPRocId:function(){return this.attr("id").substring(5)
},getDetails:function(){return this.data("details")},setDetails:function(e){var f=this.attr("id");this.data("details").html(e);if(!d.isUndefined(this.data("hideLoadDetails"))&&this.data("hideLoadDetails")==false){if(!d.isUndefined(this.data("parent").options.loadImg)&&this.data("parent").options.loadImg!=null){d("#i"+f).attr({"class":"minus minusGrey",title:"Hide Details"});d("#i"+f).find("img:first").attr({alt:"Collapse row "+(parseInt(f.substring(4))+1)})}if(d.isUndefined(this.data("parent").options.loadMessage)||this.data("parent").options.loadMessage==null){this.record("showDetails")
}}this.data("loading",false)},setQbRocDetails:function(f){var h=this.attr("id");var e=h.split("-")[2];this.data("details").html(f);if(!d.isUndefined(this.data("hideLoadDetails"))&&this.data("hideLoadDetails")==false){if(d.isUndefined(this.data("parent").options.loadMessage)||this.data("parent").options.loadMessage==null){this.record("showQbRocDetails")}}this.data("loading",false)},cancelLoad:function(){var e=this.attr("id");if(!d.isUndefined(this.data("parent").options.loadImg)&&this.data("parent").options.loadImg!=null){d("#i"+e).attr({"class":"plus",title:"Show Details"});
d("#i"+e).find("img:first").attr({alt:"Expand row "+(parseInt(e.substring(4))+1)})}if(d.isUndefined(this.data("parent").options.loadMessage)||this.data("parent").options.loadMessage==null||this.data("expanded")){this.record("hideDetails")}this.data("loading",false)},expand:function(e){var h=this.attr("id");if(this.data("expanded")){return}var f=d("#c"+h);if(!f.hasClass("print")){return this}if(e){this.data("hasData",false)}if(!this.data("hasData")&&!this.data("loading")){this.data("loading",true);
if(!d.isUndefined(this.data("hideLoadDetails"))&&this.data("hideLoadDetails")==false){if(!d.isUndefined(this.data("parent").options.loadMessage)&&this.data("parent").options.loadMessage!=null){this.record("getDetails").html(this.data("parent").options.loadMessage);this.record("showDetails")}if(!d.isUndefined(this.data("parent").options.loadImg)&&this.data("parent").options.loadImg!=null){d("#i"+h).attr("class",this.data("parent").options.loadImg);d("#i"+h).find("img:first").attr("alt","")}this.data("expanded",true)
}this.data("parent").table.trigger("amex:rocLoad",{object:this})}else{if(!d.isUndefined(this.data("hideLoadDetails"))&&this.data("hideLoadDetails")==false){this.record("showDetails");this.data("expanded",true);this.data("parent").table.trigger("amex:rocExpand",{object:this})}List.deferred.resolve(true)}if(Pending.isOpen){Omniture.report("list_pending_expand")}else{Omniture.report("list_expand")}},expandQbROC:function(f){var h=this.attr("id");var e=h.split("-")[2];if(this.data("expanded")){return}if(f){this.data("hasData",false)
}if(!this.data("hasData")&&!this.data("loading")){this.data("loading",true);if(!d.isUndefined(this.data("hideLoadDetails"))&&this.data("hideLoadDetails")==false){if(!d.isUndefined(this.data("parent").options.loadMessage)&&this.data("parent").options.loadMessage!=null){this.record("getDetails").html(this.data("parent").options.loadMessage);this.record("showQbRocDetails")}if(!d.isUndefined(this.data("parent").options.loadImg)&&this.data("parent").options.loadImg!=null){d("#qbroc-"+e).attr("class",this.data("parent").options.loadImg);
d("#qbroc-"+e).find("img:first").attr("alt","")}this.data("expanded",true)}this.data("parent").table.trigger("amex:rocLoad",{object:this})}else{if(!d.isUndefined(this.data("hideLoadDetails"))&&this.data("hideLoadDetails")==false){this.record("showQbRocDetails");this.data("expanded",true);this.data("parent").table.trigger("amex:rocExpand",{object:this})}qbList.deferred.resolve(true)}if(Pending.isOpen){Omniture.report("list_pending_expand")}else{Omniture.report("list_expand")}},collapse:function(e){if(!this.data("expanded")||this.data("loading")){return
}this.record("hideDetails");if(e){this.record("getDetails").html("");this.data("hasData",false)}this.data("expanded",false);this.data("parent").table.trigger("amex:rocCollapse",{object:this});if(Pending.isOpen){Omniture.report("list_pending_collapse")}else{Omniture.report("list_collapse")}},hideDetails:function(){var h=this.attr("id");var f=d("#x"+h);var e=f.find(".expando");e.slideUp(300,"swing",function(){f.hide();d("#i"+h).attr({"class":"plus plusGrey",title:"Show Details"});d("#i"+h).find("img:first").attr("alt","Expand row "+(parseInt(h.substring(4))+1))
})},showDetails:function(){var n=this.attr("id");var m=d("#x"+n);var e=d(".listViewDispFormat24",m);var l=m.find(".expando");var f;l.hide();if(this.data("xheight")){m.show()}else{l.css({visibility:"hidden",position:"absolute"});m.show();l.removeAttr("style").hide()}l.slideDown(500,"swing",function(){d("#i"+n).attr("class","minus minusGrey");d("#i"+n).attr("title","Hide Details");d("#i"+n).find("img:first").attr("alt","Collapse row "+(parseInt(n.substring(4))+1))})},showQbRocDetails:function(){var o=this.attr("id");
var e=o.split("-")[2];var n=d("#x"+o);var f=d(".listViewDispFormat24",n);var m=n.find(".expando");var l;if(this.data("xheight")){n.show()}else{n.show()}m.slideDown(500,"swing",function(){d("#qbroc-"+e).removeClass("plus icon-load").addClass("icon-etd minus active");d("#qbroc-"+e).attr("title","Hide Details")})},enableSelect:function(e){var f=this.attr("id");if(!e){d("#i"+f).hide()}d("#c"+f).show()},disableSelect:function(){var e=this.attr("id");d("#c"+e).hide();d("#i"+e).show()},check:function(){var e=this.attr("id");
d("#c"+e).prop("checked",true);this.data("parent").selected[e]=this[0]},uncheck:function(){var e=this.attr("id");d("#c"+e).prop("checked",false);delete this.data("parent").table.selected[e]},fireEvent:function(e){this.data("parent").table.trigger(e,{object:this})}};d.fn.record=function(e){if(c[e]){return c[e].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof e==="object"||!e){return c.init.apply(this,arguments)}else{d.error("Method "+e+" does not exist on jQuery.record")}}}})(jQuery);
(function(c){c.extend(String.prototype,{startsWith:function(d){return this.indexOf(d)===0},endsWith:function(d){return this.match(d+"$")==d},trim:function(){return c.trim(this)},isBlank:function(){return/^\s*$/.test(this)},escape:function(){return this.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescape:function(){return this.replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">")
}})})(jQuery);(function(d){var c=function(f){this.seg=[];var m=-1,o="",h="",l=0;for(var e=0;e<f.length;e++){var n=f.charAt(e);switch(n){case"{":if(o=="#"){m=e-1;h=""}break;case"}":if(m>=0){this.seg.push(f.substring(l,m));this.seg.push(h.trim());m=-1;l=e+1}break;default:if(m>=0){h+=n}break}o=n}this.seg.push(f.substring(l))};c.prototype.process=function(f){var e="";d.each(this.seg,function(l,h){if(l%2==0){e+=h}else{e+=f[h]}});return e};d.extend({template:function(e){return new c(e)}})})(jQuery);(function(c){c.isString=function(d){return typeof d==="string"
};c.isUndefined=function(d){return typeof d==="undefined"};c.isElement=function(d){return(d&&d.nodeType==1)}})(jQuery);(function(c){c.widget("ui.dialog",{_create:function(){c.ui.dialog.prototype._create.apply(this,arguments);this.widget().css("opacity",0.999);if(this.options.secondary){var d=c("<a/>").attr({id:this.options.secondary.id,href:"#"}).addClass(this.options.secondary["class"]).css({"float":"right",marginTop:"12px"}).html(this.options.secondary.text);this.widget().find(".ui-dialog-buttonset").append(d);
d.on("click.secondary",this.options.secondary.click)}}})})(jQuery);(function(c){c.widget("ui.callout",{options:{direction:"up",closeButton:false,width:300,autoClose:true},_create:function(){var w=this,y=w.options,f=w.element,r=y.width,e=y.padding||15,d=4,m=r+2*(e+d),s=y.direction;if(s==="left"||s==="right"){m+=20}var l=c("<div/>").addClass("ui-widget ui-callout").css({width:m+"px",zIndex:7001,display:"none"});l.addClass(s);if(y.theme){l.addClass(y.theme)}var o=c("<div/>").addClass("ui-callout-content").css({width:r+"px",padding:e+"px",border:d+"px solid #787a7b",backgroundColor:"#FFFFFF"});
var p=y.content||"";if(typeof(p)==="string"){p="<p>"+p+"</p>"}o.html(p);l.append(o);l.insertAfter(f);if(y.closeButton){var q=c("<a/>").addClass("ui-callout-close").attr({href:"#",title:"Close"});o.append(q);q.on("click",function(x){x.stopPropagation();x.preventDefault();w.autoClose();f.focus()});q.on("blur",function(){f.focus();w.autoClose()})}var u;var t=c("<div/>").addClass("ui-callout-pointer");l.append(t);var n=0;var v=0;var h=f.position();if(s==="up"){u=(r-t.outerWidth())/2;t.css({left:u+"px"});
l.css({height:(l.outerHeight()+20)+"px"});n=(h.left+f.outerWidth()/2-l.outerWidth()/2);v=(h.top-l.outerHeight())}else{if(s==="right"){o.css({left:"0px"});u=(l.outerHeight()-t.outerHeight())/2;t.css({top:u+"px"});n=(h.left+f.outerWidth())+20;v=(h.top+f.outerHeight()/2-l.outerHeight()/2)}else{if(s==="down"){o.css({top:"0px"});u=(r-t.outerWidth())/2;l.css({height:(l.outerHeight()+20)+"px"});t.css({right:u+"px"});n=(h.left+f.outerWidth()/2-l.outerWidth()/2);v=(h.top+f.outerHeight())}else{if(s==="left"){u=(l.outerHeight()-t.outerHeight())/2;
if(y.theme){t.css({top:u+"px"})}else{t.css({top:u/2+"px"})}n=(h.left-l.outerWidth());v=(h.top+f.outerHeight()/2-l.outerHeight()/2)}else{throw new Error("Invalid direction for callout: '"+s+"'")}}}}n=Math.floor(n+0.5)+"px";v=Math.floor(v+0.5)+"px";l.css({position:"absolute",top:v,left:n});c(document).on("click",function(){w.autoClose()}).on("mousedown",function(){w.autoClose()})},_init:function(){this.open()},open:function(){this.closeOthers();this.element.next().fadeIn(300);c(".ui-callout-close").focus()
},close:function(){this.element.next().fadeOut(300)},autoClose:function(){if(this.options.autoClose){this.close()}},closeOthers:function(){c(":ui-callout").not(this.element).each(function(){var d=c(this);d.callout("autoClose")})},toggle:function(){if(this.element.next().is(":visible")){this.close()}else{this.open()}},destroy:function(){this.element.next().remove();c.Widget.prototype.destroy.call(this);c(document).off("click.callout")},_setOption:function(e,f){c.Widget.prototype._setOption.apply(this,arguments);
var d=this.element;switch(e){case"closeButton":var h=d.next().find(".ui-callout-close");if(f){h.show()}else{h.hide()}break}}})})(jQuery);(function(c,d){c.widget("ui.shoebox",{options:{pageNum:1,noOfRows:0,noOfImages:0,noOfColsPerPage:4,noOfRowsPerPage:2,noOfPages:0,add:false,zoom:false,appendImgArray:null,noReceiptsMsg:null,imageController:null,imageCollection:[],imageWidth:151,imageHeight:196,lastReceipt:false,shoeboxType:"matched",addReceiptLinkId:null,printReceiptLinkId:null,receiptTitleTxt:null,rcptDeleted:null},_create:function(){var f=this,l=f.element;
var h=l.attr("id");if(f.options.imageCollection!=null&&f.options.imageCollection.length!=0){f._buildShoeBox(l)}else{var e=c("<div/>").attr("id",h+"_emptyShoebox").addClass("ui-shoebox-content");e.css("margin-left","70px");var m=c("<span/>").attr("id",h+"_noImgsMsg");m.html(f.options.noReceiptsMsg);if(f.options.add){m.addClass("ui-shoebox-noImagesMsg");e.append(f.options.imageController.getAddImage(h,f.options.shoeboxType))}else{m.addClass("ui-shoebox-noAddImagesMsg")}e.append(m);l.append(e)}},_init:function(){var e=this;
e._refreshPage()},destroy:function(){var e=this;c.Widget.prototype.destroy.call(e);e.element.empty()},_preparePage:function(){var e=this;var h=e.element.attr("id");var o=e.options.imageCollection;var l=c();var n=Math.max(0,(e.options.pageNum-1)*e.options.noOfRowsPerPage*e.options.noOfColsPerPage-(e.options.add?1:0));var m=(e.options.pageNum-1)*e.options.noOfRowsPerPage+1;var p=e.options.noOfRowsPerPage*e.options.noOfColsPerPage;rowElement=c("<ul/>").attr("id",h+"_imgRow_"+m++).addClass("ui-shoebox-imgRow");
for(var f=0;f<p;f++){if(n>=o.length){break}if(e.options.add&&e.options.pageNum==1&&f==0){rowElement.append(e.options.imageController.getAddImage(h,e.options.shoeboxType))}else{rowElement.append(e._prepareImage(o[n++]))}}l.push(rowElement[0]);e.options.noOfPages=Math.ceil((o.length+(e.options.add?1:0))/p);return l},_prepareImage:function(u){var v=this;el=v.element;var q=el.attr("id");var n=c("<li/>");if(v.options.shoeboxType=="matched"){n.addClass(v.options.imageController.matchedSpanClass)}else{if(v.options.shoeboxType=="unmatched"){n.addClass(v.options.imageController.unMatchedSpanClass)
}}var t=c("<div/>").attr("id",q+"_imgBorder_"+u.imageId).addClass("receipt_inner");var p=c("<span/>");var s=c("<a/>").attr("id",q+"_imgLink_"+u.imageId).attr("href","#").attr("title",v.options.receiptTitleTxt);var o=c('<img id="'+q+"_img_"+u.imageId+'" src="'+u.thumbnailURL+'" alt="'+q+"_img_"+u.imageId+'"/>').addClass("receipt");s.html(o);s.focusin({imageObject:u},v.options.imageController.onMouseOverImage);s.focusout({imageObject:u},v.options.imageController.onMouseOutImage);t.append(p);t.append(s);
if(v.options.zoom){var e=c("<img/>").attr({id:q+"_zoomImg_"+u.imageId,src:c("#locImages").val()+"/zoomin.png"}).addClass("shoeBoxZoomIcon");t.append(e)}var h=c("<div/>").addClass("receipt_outer");h.append(t);n.append(h);if(v.options.shoeboxType=="matched"){var r=c("<div/>").addClass("receiptDesc");var m=c("<div/>");m.html(u.descLine3);var l=c("<div/>");l.html(u.descLine4);var f=c("<div/>");f.html(u.memberName);r.append(m);r.append(l);r.append(f);n.append(r)}t.on("mouseenter.shoebox",{imageObject:u},v.options.imageController.onMouseOverImage).on("mouseleave.shoebox",{imageObject:u},v.options.imageController.onMouseOutImage);
if(v.options.imageController.imgSelect1){t.on("click.shoebox",{imageObject:u},v.options.imageController.onImageSelect)}if(v.options.imageController.imgDetails){t.on("click.shoebox",{imageObject:u},v.options.imageController.onImageClick)}if(v.options.zoom){e.on("click.shoebox",{imageObject:u},v.options.imageController.onImageZoomClick)}return n},_deleteImage:function(h){var f=this;el=f.element;var m=el.attr("id");var e=c.inArray(h,f.options.imageCollection);f.options.imageCollection.splice(e,1);if(f.options.imageCollection.length>0){var o=f.options.noOfRowsPerPage*f.options.noOfColsPerPage;
f.options.noOfPages=Math.ceil((f.options.imageCollection.length+(f.options.add?1:0))/o);if(f.options.pageNum>f.options.noOfPages){f.options.pageNum=f.options.noOfPages}if(f.options.noOfPages==f.options.pageNum+1||f.options.noOfPages==f.options.pageNum){if(!f.options.lastReceipt){var l=false;if(f.options.shoeboxType=="matched"){l=true}f.options.lastReceipt=f.options.imageController.fetchReceiptsInfo(f.options.imageCollection.length,l,m,true)}}f._refreshPage()}else{c("#"+m+"_pageno").remove();c("#"+m+"_prev").remove();
c("#"+m+"_shoeBox").remove();c("#"+m+"_next").remove();c("#"+m+"_mainDiv").remove();f._showEmptyShoebox();if(f.options.printReceiptLinkId&&f.options.printReceiptLinkId!=""){var n=c("#"+f.options.printReceiptLinkId);n.addClass("shoeboxPrintDisable");n.removeClass("blue1")}}},_updateImage:function(f){var e=this;c.each(e.options.imageCollection,function(h,l){if(l.imageId===f.receiptID){l.comments=f.comments}});e._refreshPage()},_addImage:function(f){var e=this;el=e.element;var h=el.attr("id");if(e.options.imageCollection.length>0){e.options.imageCollection.unshift(f);
e.options.pageNum=1;e._refreshPage()}else{c("#"+h+"_emptyShoebox").remove();e._buildShoeBox(el);e.options.imageCollection.unshift(f);e.options.pageNum=1;e._refreshPage();if(e.options.printReceiptLinkId&&e.options.printReceiptLinkId!=""){var l=c("#"+e.options.printReceiptLinkId);l.removeClass("shoeboxPrintDisable");l.addClass("blue1")}}},_appendImages:function(e){var f=this;el=f.element;var h=el.attr("id");c.merge(f.options.imageCollection,e);if(f.options.rcptDeleted==null||f.options.rcptDeleted=="false"){f._displayNextPage()
}},_updateAddReceiptLink:function(){var e=this;if(e.options.addReceiptLinkId&&e.options.addReceiptLinkId!=""){var f=c("#"+e.options.addReceiptLinkId);if(e.options.pageNum>1&&!f.is(":visible")){f.show()}if(e.options.pageNum==1){f.hide()}}},_setButtonState:function(){var e=this;var h=e.element.find(".ui-shoebox-prev a");var f=e.element.find(".ui-shoebox-next a");if(e.options.pageNum==1){h.attr({disabled:true,title:""}).addClass("ui-state-disabled")}else{h.attr({disabled:false,title:"Previous Page"}).removeClass("ui-state-disabled")
}if(e.options.pageNum==e.options.noOfPages&&e.options.lastReceipt){f.attr({disabled:true,title:""}).addClass("ui-state-disabled")}else{f.attr({disabled:false,title:"Next Page"}).removeClass("ui-state-disabled")}},_updatePageNumber:function(){var e=this;var f="";if(e.options.noOfPages>1){var f="Page "+e.options.pageNum;if(e.options.lastReceipt){f+=" of "+e.options.noOfPages}}c(".ui-shoebox-pageNo",e.element).html(f)},_displayNextPage:function(){var e=this;if(e.options.pageNum<e.options.noOfPages){++e.options.pageNum;
e._refreshPage()}},_refreshPage:function(){var e=this;var l=e.element.find(".ui-shoebox-content");var h=e.element.find("ul[id*=_imgRow_]");var f=e._preparePage().css({visibility:"hidden",position:"absolute",display:"block"}).appendTo(l);h.remove();f.find("img.receipt").loadimg();f.css({visibility:"",position:"",display:"none"});f.fadeIn();e._updateAddReceiptLink();e._setButtonState();e._updatePageNumber()},_buildShoeBox:function(e){var u=this;var r=e.attr("id");var m=c("<div/>").addClass("ui-shoebox-pageNo").attr("id",r+"_pageno").html("Page 1");
e.append(m);var h=c("<div/>").attr("id",r+"_mainDiv").addClass("ui-showbox-widget");var t=c("<div/>").addClass("ui-shoebox-prev");var q=c("<a/>").attr("id",r+"_prev").attr("href","#");var n=c("<span/>").addClass("ui-shoebox-prevContent");q.append(n);t.append(q);h.append(t);var s=c("<div/>").addClass("ui-shoebox-img");var f=c("<div/>").attr({id:r+"_shoeBox",valign:"center"}).addClass("ui-shoebox-content");s.append(f);var o=c("<div/>").addClass("ui-shoebox-next");var p=c("<a/>").attr("id",r+"_next").attr("href","#");
var l=c("<span/>").addClass("ui-shoebox-nextContent");p.append(l);o.append(p);s.append(o);h.append(s);e.append(h);c("#"+r+"_next").off("click.shoebox");c("#"+r+"_prev").off("click.shoebox");c("#"+r+"_next").on("click.shoebox",function(x){x.preventDefault();var v=false;if(u.options.noOfPages==u.options.pageNum+1||u.options.noOfPages==u.options.pageNum){if(!u.options.lastReceipt){var w=false;if(u.options.shoeboxType=="matched"){w=true}v=true;u.options.lastReceipt=u.options.imageController.fetchReceiptsInfo(u.options.imageCollection.length,w,r,false)
}}if(!v){u._displayNextPage()}});c("#"+r+"_prev").on("click.shoebox",function(v){v.preventDefault();if(u.options.pageNum>1){--u.options.pageNum;u._refreshPage()}});u._setButtonState()},_showEmptyShoebox:function(){var f=this;el=f.element;var h=el.attr("id");var e=c("<div/>").attr("id",h+"_emptyShoebox").addClass("ui-shoebox-content");e.css("margin-left","70px");var l=c("<span/>").attr("id",h+"_noImgsMsg");l.html(f.options.noReceiptsMsg);if(f.options.add){l.addClass("ui-shoebox-noImagesMsg");e.append(f.options.imageController.getAddImage(h,f.options.shoeboxType))
}else{l.addClass("ui-shoebox-noAddImagesMsg")}e.append(l);el.append(e)},_updateLastReceipt:function(f){var e=this;e.options.lastReceipt=f},_updateImgDeleteStatus:function(f){var e=this;e.options.rcptDeleted=f},_setOption:function(f,h){c.Widget.prototype._setOption.apply(this,arguments);var e=this;switch(f){case"appendImgs":e._appendImages(h);break;case"deleteImg":e._deleteImage(h);break;case"updateImg":e._updateImage(h);break;case"addImg":e._addImage(h);break;case"hasReceipts":e._updateLastReceipt(h);
break;case"updateDeleteStatus":e._updateImgDeleteStatus(h);break}}});c.extend(c.ui.mywidget,{instances:[]})}(jQuery));(function(c){c.widget("ui.tagbar",{_create:function(){this.rocId=this.element.attr("id").split("_")[1]},_init:function(){},_gettagbar:function(){var d=[];this.element.find("span.tagText").each(function(){d.push(c(this).html().unescape())});return d},_getextendedtagbar:function(){var e=[];var d=this;d.element.children().each(function(){var h=this.id.split("_")[2];var f=c(this).find("span.tagText").html().unescape();
e.push({id:h,name:f})});return e},getfulltagbar:function(){var d=this._getextendedtagbar();var e=[];c.each(d,function(f){e.push(TagList.getObjectForNameId(d[f].name,d[f].id))});return e},remove:function(d){var e=c("#tb_"+this.rocId+"_"+d.id);if(e.length){e.remove();if(TagUI.ID==this.rocId){c("#tchk_"+d.id).prop("checked",false)}}},removetag:function(d){c("#tb_"+this.rocId+"_"+d.id).remove()},insert:function(d){this.applytag(d);if(TagUI.ID==this.rocId){c("#tchk_"+d.id).prop("checked",true)}},applytag:function(e){var h=this.getfulltagbar();
var d=Tag.findObject(e,h,this._tagbarcomparator);if(!d[0]){var f=this._rendertagbarobj(e);if(d[1]==h.length){this.element.append(f)}else{this.element.children().eq(d[1]).before(f)}}},_rendertagbarobj:function(d){var m=this.rocId+"_"+d.id;var h=c("<span/>").attr("id","tb_"+m).addClass("tagright tagX");var e=c("<a/>").attr({href:"#",title:"Remove this Tag"}).addClass("tagxgrey tagX");var f=c("<img/>").attr({id:"cb_"+m,src:c("#locImages").val()+"/clear.gif",alt:"X",title:"Remove this Tag"}).addClass("tagX");
e.append(f);h.append(e);ispan=c("<span/>").addClass("tagleft tagX");var l=c("<span/>").addClass("tagText tagX").html(d.name.escape());ispan.append(l);h.append(ispan);return h},rocid:function(){return this.rocId},hastagname:function(f){var h=this._gettagbar();var d=f.toLowerCase();for(var e=0;e<h.length;e++){if(h[e].toLowerCase()==d){return true}}return false},destroy:function(){c.Widget.prototype.destroy.call(this)},_tagbarcomparator:function(f,e){var l=f.name.toLowerCase();var h=e.name.toLowerCase();
var d=f.shared?"1":"0";var m=e.shared?"1":"0";if(l<h){return -1}if(l>h){return 1}if(d<m){return -1}if(d>m){return 1}return 0}})})(jQuery);(function(c){c.widget("ui.loadimg",{options:{duration:400,timer:30000,loadInterval:null,isLoaded:null},_create:function(){},_init:function(){var e=this;var f=e.options;e.image=e.element;if(e.element[0].complete&&e.element.outerWidth()>50){e.element.css("visibility","hidden");e.element.css("visibility","visible");e._callback("loaded","image");e._callback("complete",true);
return}var h=e.element.attr("src");e.element.removeAttr("src");var d=e.element.clone().css({position:"absolute",visibility:"hidden"}).insertAfter(e.element);e.element.attr("src",e.options.placeholder);e._callback("loaded","placeholder");e.image=d;e.options.isLoaded=false;e.options.loadInterval=setTimeout(function(){e._loadCheck(e,d)},e.options.timer);d.load(function(m){clearTimeout(e.options.loadInterval);e.options.isLoaded=true;var l=c(this);l.unbind("load");l.unbind("error");e._revealImage(l);e._callback("loaded","image");
e._callback("complete",true)}).error(function(m){clearTimeout(e.options.loadInterval);e.options.isLoaded=true;var l=c(this);l.unbind("load error");e.element.attr("src",e.options.broken);e._callback("complete",false);l.remove()}).attr("src",h)},_revealImage:function(e){var d=this;d.element.remove();e.hide().css({visibility:"",position:""});e.fadeIn(d.options.duration).css({display:"inline-block"});d.destroy()},_callback:function(f){var d=this;var e=[].slice.call(arguments);e.shift();if(c.isFunction(d.options[f])){d.options[f].apply(d.image,e)
}},destroy:function(){c.Widget.prototype.destroy.call(this);this.element.remove()},_loadCheck:function(e,d){if(!e.options.isLoaded||(e.element.attr("src")==e.options.placeholder)){d.unbind("load error");e.element.attr("src",e.options.broken);e._callback("complete",false);d.remove()}}})})(jQuery);(function(c){c.widget("ui.zoomer",{options:{size:200,round:false,shadow:false,inset:false},_create:function(){var d=this;var e=d.options;var h=c("<div/>").css({cursor:"crosshair",backgroundColor:"white",backgroundRepeat:"no-repeat",width:e.size+"px",height:e.size+"px",overflow:"hidden",border:"1px solid black",position:"absolute",top:0,left:0}).addClass("ui-zoomer");
h.css("backgroundImage","url("+d.element.attr("src")+")");c("<img/>").appendTo(c(document.body)).load(function(l){d.dimX=c(this).outerWidth();d.dimY=c(this).outerHeight();c(this).remove()}).css({visibility:"hidden"}).attr("src",d.element.attr("src"));var f=d._getZIndex();h.css("zIndex",f+1).appendTo(c(document.body));if(e.round){h.css("borderRadius",e.size/2)}if(e.shadow){h.css("boxShadow","5px 5px 15px 5px #333333 inset")}d.magnifier=h;d.element.on("mouseenter.zoomer",function(l){d.show(l.pageX,l.pageY)
}).on("touchstart.zoomer",function(l){l.preventDefault();var m=l.originalEvent.touches[0];d.show(m.pageX,m.pageY)});d.magnifier.on("touchend.zoomer",function(l){l.preventDefault();d.hide()})},_init:function(){this.hide()},hide:function(){var d=this;d.magnifier.css("display","none");c(document).off("mousemove.zoomer")},show:function(f,e){var d=this;d.imgLeft=d.element.offset().left;d.imgTop=d.element.offset().top;d.imgWidth=d.element.outerWidth();d.imgHeight=d.element.outerHeight();c(document).on("mousemove.zoomer",function(h){if(h.pageX<d.imgLeft||h.pageY<d.imgTop||h.pageX>(d.imgWidth+d.imgLeft)||h.pageY>(d.imgHeight+d.imgTop)){d.hide()
}else{d._position(h.pageX,h.pageY)}});d.magnifier.css("display","block");d._position(f,e)},_position:function(h,f){var e=this;var l=(h-e.element.offset().left)/e.element.outerWidth();var m=(f-e.element.offset().top)/e.element.outerHeight();var d=e.options.size/2-e.dimX*l;var n=e.options.size/2-e.dimY*m;e.magnifier.css({backgroundPosition:d+"px "+n+"px",left:(h-e.options.size/2)+"px",top:(f-e.options.size/2)+"px"})},_getZIndex:function(){var d=this;var f=0;var h=d.element;while(!h.is("html")){var e=h.css("zIndex");
if(c.isNumeric(e)){f=Math.max(f,e)}h=h.parent()}return f},destroy:function(){var d=this;c.Widget.prototype.destroy.call(d);d.element.off("mouseover.zoomer touchstart.zoomer");c(document).off("mousemove.zoomer");d.magnifier.remove()}})})(jQuery);(function(e){e.cookie=function(h,l,f){if(typeof(l)=="undefined"){return c(h)}return d(h,l,f)};e.deleteCookie=function(f){d(f,"",-1)};function d(h,r,n){var m="";var s=e.extend({},n);if(s.seconds||s.minutes||s.days){var q=new Date();var f;if(s.days){f=1000*60*60*24*s.days
}if(s.minutes){f=1000*60*s.minutes}if(s.seconds){f=1000*s.seconds}q.setTime(q.getTime()+f);m="; expires="+q.toGMTString()}var l=document.domain.split(".");var p=l.length;var o=null;if(p==0){o=null}else{if(p==1){o=l[0]}else{if(p==2){o=l[0]+"."+l[1]}else{o="."+l[p-2]+"."+l[p-1]}}}if(o){document.cookie=h+"="+r+m+"; path=/; domain="+o}else{document.cookie=h+"="+r+m+"; path=/"}}function c(h){var m=h+"=",f=document.cookie.split(";");for(var l=0,n;l<f.length;l++){n=f[l];while(n.charAt(0)==" "){n=n.substring(1,n.length)
}if(n.indexOf(m)==0){return n.substring(m.length,n.length)}}return null}})(jQuery);(function(h){var l={urlPath:"/"};function f(n){var o=n.isEligible();if(!h.cookie("popeye")&&n.layerKey=="ic"&&Boot.icCheck==1&&(o==undefined)){if(!(h("#environment").val()=="E1_INTG"||h("#environment").val()=="E0")){setTimeout(function(){f(n)},2000)}}else{if(!h.cookie("popeye")&&o){if(n.isAmexWindow()){e(n)}else{d(n)}}}}function d(n){var p;h.ajax({url:n.htmlFile,async:false,cache:true,success:function(q){p=q}});h.cookie("popeye",true);
var o=h.message({theme:"white",center:true,msg:h("<p/>").css("width","auto").html(p)});if(n.value.length&&n.value=="dct"){h("#InterstitialImage").parents(".ui-messagebox").addClass("paperLeafBack")}if(h().on){h(document.body).append("<div id='cover'></div> ").on("click",function(q){if(q.target.id=="cover"){o.message("close",true);h("#cover").css({display:"none"})}})}else{h(document.body).append("<div id='cover'></div> ").bind("click",function(q){if(q.target.id=="cover"){o.message("close",true);h("#cover").css({display:"none"})
}})}o.message("msg").find("button").click(function(){o.message("close",true);h("#cover").css({display:"none"});var r;if(h.browser.msie&&parseInt(h.browser.version)==7){r=h(this).val()}else{r=this.value}if(n[r]){if(h.isNumeric(n[r])){n.isPreferenceData(r)?m(n.prefsKey,n[r]):"";var q=n.layerKey+"_"+r;Omniture.report(q)}else{if(h.isFunction(n[r])){n[r].call(n);var q=n.layerKey+"_"+r;Omniture.report(q)}}}});o.promise().done(function(){var q=o.message("buttons");if(q.length>0){q[0].click(function(r){o.message("close",true)
});q[1].click(function(r){o.message("close",true);QB.getRequestToken();qbUI.redirectMessage()})}});Omniture.report(n.layerName)}function e(n){h.cookie("popeye",true);var p=new Amex.Window({modal:true,theme:"amexWindow",buttons:["close"],shadow:{size:6,color:"#666666",background:"url('"+h("#locImages").val()+"/shadow.png') bottom right no-repeat"}});var o;h.ajax({url:n.htmlFile,async:false,cache:true,success:function(q){o=q}});p.update(o);p.render(document.body);p.centerInViewport();p.open();Omniture.report(n.layerName);
p.element.on("click","button",function(r){var s=this.value;if(n[s]){if(h.isNumeric(n[s])){n.isPreferenceData(s)?m(n.prefsKey,n[s]):"";var q=n.layerKey+"_"+s;Omniture.report(q)}else{if(h.isFunction(n[s])){n[s].call(n);var q=n.layerKey+"_"+s;Omniture.report(q)}}}p.close();p.element.remove()}).on("amex:close",function(r){p.element.remove();if(n.close){n.isPreferenceData("close")?m(n.prefsKey,n.close):"";var q=n.layerKey+"_close";Omniture.report(q)}});Amex.PageOverlay._element.on("click",function(q){if(p.visible()){p.close()
}})}function m(n,p){h("#prefRequestType").val(n);var o=h("#"+Page.form.id).serializeArray();o.push({name:"prefInterstitialDays",value:p});h.ajax("preferredView.do",{type:"POST",data:o,success:function(q,s,r){if(r.getResponseHeader("MYCAError")==null){}}})}var c={load:function(p,o){var n=p;if(!h.isArray(p)){n=[p]}if(n){var q=h.extend({},l,o);return h.each(n,function(r,s){if(h.cookie("popeye")){return false}h.ajax({dataType:"script",url:q.urlPath+s+".popeye.txt",async:false,error:function(t,v,u){}})
})}},run:function(o){var n=o.getExecutionOrder();if(n){h.each(n,function(q,r){var p=r;if(h.cookie("popeye")){return false}f(r)})}},init:function(p,o){var n=null;if(h.isArray(p)){n=p}else{if(typeof(p)=="string"){n=[p]}}if(n){var q=h.extend({},l,o);return h.each(n,function(r,s){if(h.cookie("popeye")){return false}h.ajax({dataType:"script",url:q.urlPath+s+".popeye.txt",async:false,error:function(t,v,u){}})})}f(p)},option:function(n,o){if(typeof(o)=="undefined"){return l[n]}return l[n]=o}};h.popeye=function(n){if(c[n]){return c[n].apply(this,Array.prototype.slice.call(arguments,1))
}else{return c.init.apply(this,arguments)}}})(jQuery);(function(m){var x={version:"3.6",delim_open:"{:",delim_close:":}",prefix_special:"@",prefix_url:"@",prefix_select:"#",prefix_escape:"\\",extension:"html",compact:true,strip_comments:true,urlPath:"",verbose:false,cache:true};var f={},e={},w={};var o={event:function(){var C=Array.prototype.slice.call(arguments,0);var D=C.pop();if(!m.isArray(C[0])){C=[C]}if(!D.events){D.events=[]}D.events.push(C);return'event="'+(D.events.length-1)+'"'},iif:function(E,C,D){return E?C:D
}};var z={each:function(E,D){var C="$.each("+D+",function(keyindex_"+E+","+E+"){";return C},"else":function(){return"} else {"},elseif:function(C){return"} else if("+C+"){"},endeach:function(){return"});"},endif:function(){return"}"},"=":function(C){return"$_out +="+C+";"},"if":function(C){return"if("+C+"){"},index:function(C){return"keyindex_"+C},insert:function(C){f.template=C.slice(1,-1);var D=y.init(f);return D.f.toString().split('var $_out="";\n')[1].split("\n").slice(0,-2).join("\n")},include:function(D,C){var E="this";
if(arguments.length>1){E=C}return'$_out += $.jcp("run",'+D+","+E+",{$_jcp:$_jcp});"},key:function(C){return"keyindex_"+C}};var y={init:function(D){var L,F=null;delete f.direct;delete f.selector;delete f.url;delete f.extension;f=m.extend({},x,D);var C=f.template,J=f.template.charAt(0),K,G;if(f.verbose&&window.console){}if(J===f.prefix_url){C=C.slice(1);if(!C.match(/^[\.\\/]/)){C=f.urlPath+C}var I=C.split("#");if(I.length>1){C=I[0];K=I[1]}var E=C.lastIndexOf(".");var H=C.lastIndexOf("/");if(E>H){f.extension=C.slice(E+1)
}else{C+="."+f.extension}C=B(C);if(I.length==1){f.url=F=C}else{G=C;f.url=F=G+"#"+K}}else{if(J===f.prefix_select){f.selector=F=C}else{if(J===f.prefix_escape){f.direct=C.slice(1)}else{f.direct=C}}}if(F&&e[F]){return e[F]}L=new A();if(F){e[F]=L;L.id=F;if(f.templateObj){L.templateObj=f.templateObj}}if(f.verbose&&window.console){}return L},extend:function(D,C){o[D]=C},macro:function(D,C){z[D]=C},fn:function(D){var C=Array.prototype.slice.call(arguments,1);return o[D].apply(this,C)},instance:function(C){return e[p(C)]
},instances:function(){return e},resources:function(){return w},load:function(E,C){var D=m.extend({template:E},C);return y.init(D)},release:function(C){delete e[p(C)]},register:function(E,F,C){var D=m.extend({template:E},C);return y.init(D).register(F,{})},resource:function(E){E=E.slice(1);if(!E.match(/^[\.\\/]/)){E=x.urlPath+E}var C=E.lastIndexOf(".");var D=E.lastIndexOf("/");if(C<=D){E+="."+x.extension}E=B(E);return w[E]||h(E)},run:function(D,F,C){var E=m.extend({template:D},C);var G=E.$_jcp||{};
return y.init(E).run(F,G)},option:function(){if(arguments.length===0){return x}if(arguments.length===1){if(typeof(arguments[0])==="object"){return m.extend(x,arguments[0])}return x[arguments[0]]}x[arguments[0]]=arguments[1];return x[arguments[0]]},version:function(){return x.version},destroy:function(){}};function c(F,G){var D=this;var C=m(D.run(F,G));var E=C.find("[event]").andSelf().filter("[event]");E.each(function(H,K){var J=m(K);var L=J.attr("event");var I=G.events[L];J.removeAttr("event");m.each(I,function(M,N){J.on.apply(J,N)
})});if(window.console&&f.verbose){}return C}function q(E,F){var C=this;var D=C.f.call(E,m,F);if(f.verbose&&window.console){}return D}function n(E){var G="",I=false;function D(L,M){var K;if(M&&(L==='""')){return""}if(!M){K=(I?";\n":"")+L+"\n"}else{if(I){K="+"+L}else{K="$_out += "+L}}I=M;return K}if(f.strip_comments){E=v(E)}E=E.replace(/\r\n/gm,"\n").replace(/\"/g,'\\"');if(f.compact){E=E.replace(/^\s*/gm,"").replace(/\s*$/gm,"").replace(/\n/gm,"")}else{E=E.replace(/\n/gm,"\\n");if(f.selector){E=E.replace(/^(\r?\n*)/,"")
}}var F=new RegExp("(.*?)("+f.delim_open+"(.*?)"+f.delim_close+"|$)","g");var C;do{C=F.exec(E);G+=D('"'+C[1]+'"',true);if(C[3]){var J=C[3].replace(/\\n/gm,"").replace(/(\s*$)/gm,"").replace(/^(=?)\s*/,"$1").replace(/\\"/gm,'"');var H=t(J);G+=(J.charAt(0)==="=")?D(H.slice(1),true):D(H,false)}}while(C[3]);if(I){G+=";\n"}return G}function u(F){var C="";if(F.type==="text"){C=F.value}else{if(F.type!=="root"){C="<"+F.name;for(var E=0;E<F.attr.length;E++){C+=" "+F.attr[E].name;if(F.attr[E].value!==""){C+="="+F.attr[E].value
}}if(F.type==="void"){C+=" /"}C+=">"}if(F.type!=="void"){for(var D=0;D<F.children.length;D++){C+=Boot.writeNode(F.children[D])}}if(F.type!=="root"&&F.type!=="void"){C+="</"+F.name+">"}}return C}function l(C,D){for(var E=0;E<C.length;E++){if(C[E].name===D){return C[E].value}}return undefined}function d(F){var R="",P,Q,K,L,N,E,I=false,J;var M=x.delim_open,D=x.delim_close;if(F.type==="text"){R=F.value}else{K=L=N="";if(F.type!=="root"){for(var H=0;H<F.attr.length;H++){Q=F.attr[H].name;P=F.attr[H].value;
if(Q.slice(0,4)!=="jcp-"){K+=" "+Q;if(P!==""){K+="="+P}}else{P=P.slice(1,-1);if(Q==="jcp-if"){L+=M+"@if("+P+")"+D;N=M+"@endif"+D+N}else{if(Q==="jcp-if-start"){L+=M+"@if("+P+")"+D}else{if(Q==="jcp-if-end"){N=M+"@endif"+D+N}else{if(Q==="jcp-else"){L+=M+"@else"+D}else{if(Q==="jcp-elseif"){L+=M+"@elseif("+P+")"+D}else{if(Q==="jcp-else-end"){L+=M+"@else"+D;N=M+"@endif"+D+N}else{if(Q==="jcp-elseif-end"){L+=M+"@elseif("+P+")"+D;N=M+"@endif"+D+N}else{if(Q==="jcp-each"){E=P.split(" in ");L+=M+"@each("+E[0]+","+E[1]+")"+D;
N=M+"@endeach"+D+N}else{if(Q==="jcp-each-start"){E=P.split(" in ");L+=M+"@each("+E[0]+","+E[1]+")"+D}else{if(Q==="jcp-each-end"){N=M+"@endeach"+D+N}else{if(Q==="jcp-event"){K+=" "+M+"=@event("+P+")"+D}else{if(Q==="jcp-script"){L+=M+P+D}}}}}}}}}}}}}}if(F.name==="jcpif"){L+=M+"@if("+l(F.attr,"condition").slice(1,-1)+")"+D;N=M+"@endif"+D+N;I=true}else{if(F.name==="jcpeach"){L+=M+"@each("+l(F.attr,"index").slice(1,-1)+","+l(F.attr,"collection").slice(1,-1)+")"+D;N=M+"@endeach"+D+N;I=true}else{if(F.name==="jcpinclude"){L+=M+"@include("+l(F.attr,"url");
J=l(F.attr,"data");if(J!==undefined){L+=","+J}L+=")"+D;I=true}else{if(F.name==="jcpinsert"){L+=M+"@insert("+l(F.attr,"url");J=l(F.attr,"data");if(J!==undefined){L+=","+J}L+=")"+D;I=true}else{if(F.name==="jcpscript"){L+=M;N=D+N;I=true}else{if(F.name==="jcpout"){L+=M+"=";N=D+N;I=true}}}}}}if(L!==""){R+=L}if(!I){R+="<"+F.name;if(K!=""){R+=K}if(F.type==="void"){R+=" /"}R+=">"}}if(F.type!=="void"){for(var G=0;G<F.children.length;G++){R+=d(F.children[G])}}if(F.type!=="root"&&F.type!=="void"){if(!I){R+="</"+F.name+">"
}}if(F.type!=="root"){if(N!==""){R+=N}}}return R}function s(I){var J,G="",M,N=[],S=0,O=0,C=[],T="",W,D="",V=0,R=false,U="",Q="",K="",H=false;I=I.replace(/<!--[\s\S]*?-->/g,"");var L=["area","base","br","col","command","embed","hr","img","input","jcpinclude","jcpinsert","keygen","link","meta","param","source","track","wbr"];var F=new RegExp(/\s/);var E=[{type:"root",children:[]}];for(var P=0;P<I.length;P++){T=I.charAt(P);if(T==='"'&&R){if(C[C.length-1]==="q"){V=C.length--}else{C[C.length]="q"}}if(T==="'"&&R){if(C[C.length-1]==="a"){V=C.length--
}else{C[C.length]="a"}}if(C.length||V){D+=T;if(!C.length){if(U){N.push({name:Q,value:D});U=false;Q=""}D="";V=0}continue}if(T===">"){if(J){J=false;G=G.toLowerCase();if(G.slice(-1)==="/"){G=G.slice(0,-1)}R=false;if(G.charAt(0)==="/"){if(E.length>1){E[E.length-2].children.push(E[E.length-1]);E.length--}}else{if(m.inArray(G,L)>=0){E[E.length-1].children.push({type:"void",name:G,attr:N});N=[]}else{if(Q!==""){N.push({name:Q,value:""});Q="";H=false}W={type:"node",name:G,attr:N,children:[]};E.push(W);N=[]
}}continue}}if(T==="<"){if(!J){J=true;R=false;G="";if(K!==""){E[E.length-1].children.push({type:"text",value:K})}K="";continue}}if(J&&!R){if(F.test(T)){R=true;U=false;Q=""}else{G+=T}continue}if(J&&R){if(F.test(T)){H=true;continue}if(T==="="){U=true;H=false;continue}if(H&&(Q!=="")){N.push({name:Q,value:""});H=false;Q=""}Q+=T;H=false;continue}K+=T;continue}if(K!==""){E[E.length-1].children.push({type:"text",value:K})}return E[0]}function h(D){var C;m.ajax({url:D,cache:f.cache,success:function(J,K,I){var H=s(I.responseText);
var G={};for(var F=0;F<H.children.length;F++){if(H.children[F].type==="node"&&H.children[F].name==="jcptemplate"){H.children[F].type="root";for(var E=0;E<H.children[F].attr.length;E++){if(H.children[F].attr[E].name==="id"){G[H.children[F].attr[E].value.slice(1,-1)]=H.children[F];break}}}}C=w[D]=G},async:false});return C}function r(C){var F="",H;if(C.direct){H=C.direct}if(C.selector){if(C.templateObj){H=m(C.selector,C.templateObj).prop("outerHTML")}else{H=m(C.selector).prop("outerHTML")}}if(C.url){var G=C.url.split("#"),D,E;
if(G.length>1){C.url=G[0];var D=G[1];if(w[C.url]){E=w[C.url]}else{E=h(C.url)}H=d(E[D])}else{m.ajax({url:C.url,cache:C.cache,success:function(J,K,I){H=I.responseText},async:false});if(C.extension.toLowerCase()==="html"){H=d(s(H))}}}F+=n(H);return F}function t(L){if(L===""){return""}var M=L.indexOf(f.prefix_special);if(M===-1){return L}if(M>0){return L.slice(0,M)+t(L.slice(M))}var H=L.charAt(0);var Q=L.slice(1);var K=[];var G;if(H===f.prefix_special){var J=Q.match(/^@?([=\w]*)([^\w])/);if(J){if(J[2]!=="("){G=J[1];
Q=Q.slice(J[1].length)}else{var I=Q.indexOf("(");G=Q.slice(0,I);var F=1,E=0,O=0,N=0,D=0;Q=Q.slice(++I);I=0;while(I<Q.length){var C=Q.charAt(I++);if(C==='"'){E=1-E}else{if(C==="'"){O=1-O}else{if(C===","){if(F===1&&O===0&&E===0&&N===0&&D===0){K.push(Q.slice(0,I-1));Q=Q.slice(I);I=0}}else{if(C==="{"){N++}else{if(C==="}"){N--}else{if(C==="["){D++}else{if(C==="]"){D--}else{if(C==="("){F++}else{if(C===")"){--F;if(F===0&&O===0&&E===0&&N===0&&D===0){K.push(Q.slice(0,I-1));break}}}}}}}}}}}Q=Q.slice(I);m.each(K,function(S,R){K[S]=t(R)
})}}else{G=Q;Q=""}var P;if(o[G]){P='$.jcp("fn","'+G+'",'+K.join(",")+",$_jcp)"}else{if(z[G]){P=z[G].apply({},K)}else{P=f.prefix_special+G}}return P+(Q.length?t(Q):"")}}function v(J){var C="",G,I=false,D=false,F=false,E=false;J=J.replace(/<!--[\s\S]*?-->/g,"");for(var H=0;H<J.length;H++){G=J.charAt(H);if(I){if(G==="*"&&J.charAt(H+1)==="/"){H++;I=false}}else{if(D){if(G==="\n"){C+=G;D=false}}else{if(F){C+=G;if(G==="'"){F=false}}else{if(E){C+=G;if(G==='"'){E=false}}else{if(G==="'"){F=true;C+=G}else{if(G==='"'){E=true;
C+=G}else{if(G==="/"&&J.charAt(H+1)==="/"){H++;D=true}else{if(G==="/"&&J.charAt(H+1)==="*"){H++;I=true}else{C+=G}}}}}}}}}return C}function p(D){var E=D,C=D.charAt(0),F;if(C===f.prefix_url){E=E.slice(1);if(!E.match(/^[\.\\/]/)){E=f.urlPath+E}if(E.slice(-(f.extension.length+1)).toLowerCase()!=="."+f.extension.toLowerCase()){E+="."+f.extension}F=B(E)}else{if(C===f.prefix_select){F=E}else{F=""}}return F}function B(C){var E=location.pathname.lastIndexOf("/");var I=location.pathname.substring(0,E+1);var H=C;
if(H.charAt(0)!=="/"){H=I+H}var G=[];var F=H.split("/");for(var D=0;D<F.length;D++){if(F[D]===".."){G.pop()}else{if(F[D]!=="."){G.push(F[D])}}}return G.join("/")}var A=function(){var C=this;var D='var self=this;\nvar $_out="";\n'+r(f)+"return $_out;";C.f=new Function("$","$_jcp",D);C.register=c;C.run=q};m.jcp=function(C){if(y[C]){return y[C].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof C==="object"||!C){return y.init.apply(this,arguments)}else{m.error("Method "+C+" does not exist on jQuery.jcp")
}}}})(jQuery);(function(f){var l=['<div class="ui-overlay-needhelp">',' <a href="#">',' <span class="helpicon"></span>Need Help'," </a>","</div>"].join("\n");var h=['<div class="ui-overlay-panel">',' <div class="ui-overlay-contentbox">',' <div class="ui-overlay-content"></div>'," </div>","</div>"].join("\n");var p=['<div class="ui-overlay">',' <div tabindex="0" style="height:0px" class="ui-overlay-firstfocus"></div>',' <div class="ui-overlay-titlearea">',' <div class="ui-overlay-titlebox">',' <h2 class="ui-overlay-maintitle">Overlay Tour</h2>',' <div class="ui-overlay-closebox">',' <div class="ui-overlay-close">',' <a href="#">',' <span class="closeicon"></span>'," </a>"," </div>"," </div>",' <h3 class="ui-overlay-subtitle">Displays the various features of the Overlay plugin</h3>'," </div>"," </div>",' <div class="ui-overlay-background">',' <div class="ui-overlay-shadow"></div>',' <div class="ui-overlay-buttonarea">',' <div class="ui-overlay-buttons cf"></div>'," </div>"," </div>","</div>"].join("\n");
var A={titleWidth:"900px",contentWidth:"900px",buttonWidth:"900px",panel:0,subtitle:"",buttons:[],transition:"next",showSeparator:true,scrollTop:false,showDelay:750,hideDelay:750,needhelp:false};var y=null,t=null,w=null,d=0,c=null;var B={init:function(H){var E=f.extend({},A,H),I,G,F;if(y===null){y=f(p).hide();y.find(".ui-overlay-close").on("click",function(J){f(J.target).trigger("close.overlay")});if(E.needhelp){y.find(".ui-overlay-closebox").prepend(f(l))}y.keydown(function(J){if(J.which===27){y.trigger("close.overlay")
}if(J.which===9){var K=f(":focus");if(J.shiftKey){if(K.hasClass("ui-overlay-firstfocus")){J.preventDefault();y.find("button.primary").focus()}}else{if(K.is("button.primary")){J.preventDefault();y.find(".ui-overlay-firstfocus").focus()}}}});f(document.body).prepend(y);y=f(".ui-overlay")}y.off("close.overlay");y.on("close.overlay",B.close);f(".ui-overlay").css("width",f(window).width());f(window).on("resize",function(){y.css("width",f(document).innerWidth())});t=E.trigger||null;if(y.is(":hidden")){return e(E)
}else{return u(E)}},refocus:function(){y.find(".ui-overlay-firstfocus").focus()},buttons:function(){return f.map(y.find(".ui-overlay-buttons button"),function(F,E){return f(F)})},show:function(F,I){var J=[];var H=y.find(".ui-overlay-panel");F=q(H,F);var E=H.eq(F);var G=A.showDelay;G=(I&&I.delay)?I.delay:G;if(I&&I.scrollTop){J.push(f("html, body").animate({scrollTop:0},G).promise())}if(I&&I.backgroundColor){E.css("backgroundColor",I.backgroundColor)}J.push(E.slideDown(G).promise());return f.when.apply(null,J)
},hide:function(F,I){var J=[];var H=y.find(".ui-overlay-panel");F=q(H,F);var E=H.eq(F);var G=A.hideDelay;G=(I&&I.delay)?I.delay:G;if(I&&I.scrollTop){J.push(f("html, body").animate({scrollTop:0},G).promise())}J.push(E.slideUp(G).promise());return f.when.apply(null,J)},update:function(E){return u(E)},"delete":function(F,I){var E,H=y.find(".ui-overlay-panel");if(typeof(F)!=="undefined"){F=q(H,F);E=H.eq(F)}else{E=H}var G=A.hideDelay;G=(I&&I.delay)?I.delay:G;var J=E.slideUp(G).promise();J.done(function(){E.remove()
});return J},erase:function(){y.find(".ui-overlay-panel").remove()},insert:function(M){var K=y.find(".ui-overlay-panel"),L;M=f.extend({},A,M);var F=q(K,M.panel);var J=M.content;if(!f.isArray(J)){J=[J]}if(F<K.length){L=K.eq(F)}else{L=y.find(".ui-overlay-shadow");F=K.length}var H;for(var I=0;I<J.length;I++){var E=f.extend({},A,M,J[I],{panel:F++});r(E,L);H=z(E)}if(M.scrollTop){var G=M.delay||A.showDelay;H.push(f("html, body").animate({scrollTop:0},G).promise())}return f.when.apply(null,H)},snapshot:function(G){var F=y.find(".ui-overlay-panel");
var H=[],E={};E.title=f(".ui-overlay-maintitle").text();E.subtitle=f(".ui-overlay-subtitle").text();F.each(function(I){var J={html:f(this).find(".ui-overlay-content").contents()};J.backgroundColor=f(this).css("backgroundColor");J.contentWidth=f(this).find(".ui-overlay-contentbox").outerWidth();H.push(J)});E.content=H;return E},element:function(){return y},close:function(F){var G=document.documentElement.clientHeight+d;var E=A.hideDelay;E=(F&&F.delay)?F.delay:E;f("html, body").animate({scrollTop:d+"px"},E);
return y.animate({top:G+"px",opacity:0},E,function(){y.hide();if(t){t.focus()}}).promise()}};function q(F,G){var E=0;if(typeof(G)==="number"){return G}F.each(function(H){if(this.id==="OV_"+G){E=H;return}});return E}function m(P){var M=P.content,O;var L=[];var K=M.length;var N=y.find(".ui-overlay-panel");var F=q(N,P.panel);var G=Math.max(M.length,N.length-F);for(var J=0,H=F;J<G;J++,H++){var E=f.extend({},A,P,M[J],{panel:H});if(J>=M.length){if(P.trim){L.push(f.overlay("delete",H))}}else{if(H>=N.length){r(E,y.find(".ui-overlay-shadow"));
E.transition=E.transition==="fade"?"reveal":E.transition}else{E.transition=E.transition==="reveal"?"fade":E.transition}if(!E.content){E.transition="fade"}L=L.concat(z(E))}}if(P.scrollTop){var I=P.delay||A.showDelay;L.push(f("html, body").animate({scrollTop:0},I).promise())}return L}function z(E){switch(E.transition){case"next":case"back":return o(E);break;case"reveal":return D(E);break;case"fade":return s(E);break;case"none":return x(E);break}}function x(E){var F=y.find(".ui-overlay-panel").eq(E.panel);
if(E.html){F.find(".ui-overlay-content").html(E.html)}if(E.backgroundColor){F.css("backgroundColor",E.backgroundColor)}if(E.preload){E.preload()}var G=new f.Deferred();G.resolve();return[G.promise()]}function D(H){var K=y.find(".ui-overlay-panel").eq(H.panel);var F=K.find(".ui-overlay-contentbox");F.wrap(f("<div/>").addClass("ui-overlay-transition"));var I=F.parent();I.wrap(f("<div/>").addClass("ui-overlay-transitioncontainer").css("height","0"));var E=I.parent();K.find(".ui-overlay-content").html(H.html);
if(H.preload){H.preload()}var G=H.delay||A.showDelay;var J=I.outerHeight(true);var L=E.animate({height:J+"px"},G).promise();L.done(function(){F.unwrap().unwrap()});return[L]}function s(O){var K=[];var F=y.find(".ui-overlay-panel").eq(O.panel);var L=O.delay||A.showDelay;if(O.html){var H=F.find(".ui-overlay-contentbox").css("overflow","auto");var J=f("<div/>").addClass("ui-overlay-content").html(O.html);var I=parseInt(H.css("marginLeft"))+H.position().left;var G=f("<div/>").addClass("ui-overlay-contentbox").css({overflowY:"auto",top:0,left:I+"px",position:"absolute",width:O.contentWidth}).html(J).hide().appendTo(F);
if(O.preload){O.preload()}var M=F.outerHeight(true);F.css("height",M+"px");var E=G.outerHeight(true);var L=O.delay||A.showDelay;H.fadeOut(L);G.fadeIn(L);var N=F.animate({height:E+"px"},L).promise();N.done(function(){H.remove();G.css({position:"static",top:"auto",left:"auto"});F.css("height","auto")});K.push(N)}if(O.backgroundColor){K.push(F.animate({backgroundColor:O.backgroundColor},L).promise())}return K}function o(Q){var K=[];var N=y.find(".ui-overlay-panel").eq(Q.panel);var H=N.find(".ui-overlay-contentbox");
H.wrap(f("<div/>").addClass("ui-overlay-transition"));var L=H.parent();L.wrap(f("<div/>").addClass("ui-overlay-transitioncontainer"));var I=L.parent();var F=I.outerHeight(true);I.css("height",F+"px");if(Q.transition==="back"){I.css("left","-100%");I.css("left",I.position().left+"px");L.css("float","right")}var M=f("<div/>").addClass("ui-overlay-content");M.html(Q.html);var O=f("<div/>").addClass("ui-overlay-transition");var G=f("<div/>").addClass("ui-overlay-contentbox").css({width:Q.contentWidth});
if(Q.maxHeight){G.css("maxHeight",Q.maxHeight)}G.append(M);O.append(G);I.append(O);var J=Q.delay||A.showDelay;var E=O.outerHeight(true);if(Q.backgroundColor){K.push(N.animate({backgroundColor:Q.backgroundColor},J).promise())}var P;if(Q.preload){Q.preload()}if(Q.transition==="back"){P=I.animate({left:0,height:E+"px"},J).promise()}else{P=I.animate({left:"-100%",height:E+"px"},J).promise()}P.done(function(){L.remove();G.unwrap().unwrap()});K.push(P);return K}function n(N){var H=N.delay||A.showDelay;
var I=f(".ui-overlay-titlearea");I.css("height",I.height());var G=f(".ui-overlay-maintitle");var K=f(".ui-overlay-subtitle");var E=G.position().top;var L=K.position().top;if(N.title){G.css({position:"absolute",top:E+"px","float":"none"});var F=G.clone().html(N.title).insertAfter(G).hide();G.fadeOut(H);F.fadeIn(H,function(){G.remove();F.css({position:"static","float":"left"});I.css("height","auto")})}if(N.subtitle){K.css({position:"absolute",top:L+"px",clear:"none"});var J=K.clone().html(N.subtitle).insertAfter(K).hide();
var M=L+J.height();I.animate({height:M+"px"},H);K.fadeOut(H);J.fadeIn(H,function(){K.remove();J.css({position:"static",clear:"both"});I.css("height","auto")})}}function C(N){var F=f.extend({},A,N);var J=v(N.buttons);var K=J.eq(0);var M=y.find(".ui-overlay-buttons");var L=f("<div/>").addClass("ui-overlay-buttons cf").css({maxWidth:F.buttonWidth}).html(J);var I=y.find(".ui-overlay-buttonarea");var E=I.outerHeight();var G=f("<div/>").addClass("ui-overlay-buttonarea").css({position:"relative",top:(-1*E)+"px",opacity:0}).html(L);
y.find(".ui-overlay-background").append(G);var H=F.delay||A.showDelay;I.animate({opacity:0},H);return G.animate({opacity:1},H,function(){I.remove();G.css("position","static")}).promise()}function u(E){var F=[];if(E.title||E.subtitle){F.push(n(E))}if(E.buttons){F.push(C(E))}if(E.content){F=F.concat(m(E))}return f.when.apply(null,F)}function e(F){d=f(document).scrollTop();var G=document.documentElement.clientHeight+d;y.css({top:G+"px",opacity:0});y.find(".ui-overlay-maintitle").html(F.title);y.find(".ui-overlay-subtitle").html(F.subtitle);
if(F.content&&!f.isArray(F.content)){F.content=[F.content]}f(".ui-overlay-panel",y).remove();var K=f(".ui-overlay-shadow",y);f.each(F.content,function(L,N){var M=f.extend({},A,F,N,{panel:L});r(M,K);x(M)});y.find(".ui-overlay-closebox").css("maxWidth",F.titleWidth);y.find(".ui-overlay-titlebox").css("maxWidth",F.titleWidth);y.find(".ui-overlay-background").css("minHeight",f(document).height()+"px");y.find(".ui-overlay-buttons").css("maxWidth",F.buttonWidth);var H=y.find(".ui-overlay-buttons").empty();
var J=v(F.buttons);H.append(J);var I=J.eq(0);var E=F.delay||A.showDelay;f("html, body").animate({scrollTop:0},E);return y.show().animate({top:0,opacity:1},E,function(){y.find(".ui-overlay-firstfocus").focus()}).promise()}function r(G,F){var H=f(h);var E=H.find(".ui-overlay-contentbox").css({width:G.contentWidth});if(G.maxHeight){E.css("maxHeight",G.maxHeight)}if(G.backgroundColor){H.css("backgroundColor",G.backgroundColor)}H.insertBefore(F);H.find(".ui-overlay-contentbox").css("overflowY","auto");
H.find(".ui-overlay-content").html("&nbsp;");if(G.id){H.attr("id","OV_"+G.id)}if(G["class"]){H.addClass(G["class"])}return H}function v(E){var F=f();f.each(E,function(G,I){var H=f("<button />");H.addClass(I["class"]);H.html("<span>"+I.label+"</span>");F=F.add(H)});return F}f.overlay=function(E){if(B[E]){return B[E].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof E==="object"||!E){return B.init.apply(this,arguments)}else{f.error("Method "+E+" does not exist on overlay")}}}})(jQuery);
(function(c,d){c.widget("ui.coatree",{options:{tags:null,selectAllId:"",showSelect:false,search:true,selectedIds:[],selectedExtRefs:[]},_create:function(){var e=this,h=e.element;var f=h.attr("id");var m=e._buildSeachDiv(e);var l=e._buildErrorDiv(f);if(e.options.search){h.append(m);h.append(l)}e._buildCOATree(e.options.tags)},_init:function(){var e=this},destroy:function(){var e=this;c.Widget.prototype.destroy.call(e);e.element.empty()},_lookahead:function(l){if(l.keyCode==37||l.keyCode==39){return false
}var m=l.data.obj;var e=l.data.widget;var h=e.element.attr("id");var p=c(this).val();var q=c(this).attr("id");if(c("#"+q).val()=="."){return}if(c("#"+q).val()==""){c("#coaErrMsg_"+h).hide();e.element.find(".ui-coa-qbtags").empty().remove();e._buildCOATree(e.options.tags);c(".ui-coa-qbtags").height("300px").scrollbar().css("overflow-y","hidden");c("#"+q).focus();return}e.element.find(".ui-coa-qbtags").empty().remove();e._buildCOATree(e.options.tags);c(".ui-coa-root").hide();var f=c(".ui-coa-root").find(":containsic("+p+")").closest("div");
if(f.length==0){c("#coaErrMsg_"+h).show();c(".ui-coa-qbtags").css("overflow-y","hidden");return}else{c("#coaErrMsg_"+h).hide();var n={words:c(this).val()};e._highlight(m.attr("id"),n);f.find(".qbHighlight").closest("div").show();c(".qbHighlight").closest("li").siblings().hide();c(".qbHighlight").closest("li").show()}c("input[id^=COAContainer_chk]").off("click",e._updateSelectAll);c("input[id^=COAContainer_chk]").on("click",{obj:m,widget:e},e._updateSelectAll);c(".ui-coa-qbtags").height("300px").scrollbar().css("overflow-y","hidden")
},_removeDefaultText:function(f){var l=f.data.obj;var e=f.data.widget;var h=c(this).val();if("searchforacategoryfromyourchartofaccounts"==(h.replace(/\W/g,"")).toLowerCase()){c(this).val("")}},_resetDefaultText:function(f){var l=f.data.obj;var e=f.data.widget;var h=c(this).val();if(""==h){c(this).val("Search for a category from your Chart of Accounts")}},_buildSeachDiv:function(e){var f=e.element.attr("id");var l=c("<input type='text' id='coasearch_"+f+"' maxlength='30' class='ui-coa-input-text pull-right' class='field' value='Search for a category from your Chart of Accounts' title='Search for Chart of Accounts'/>");
l.off("keyup",e._lookahead);l.off("focus",e._removeDefaultText);l.off("blur",e._resetDefaultText);l.on("keyup",{obj:e.element,widget:e},e._lookahead);l.on("focus",{obj:e.element,widget:e},e._removeDefaultText);l.on("blur",{obj:e.element,widget:e},e._resetDefaultText);var h=c("<div></div>").addClass("ui-coa-input-wrapper cf");h.append(c("<i></i>").addClass("pull-left ui-coa-input-icon"));h.append(l);return h},_buildErrorDiv:function(e){var f=c("<div id='coaErrMsg_"+e+"' class='ui-coa-error-msg'/>").hide();
f.html("No results found for given search criteria");return f},_buildCOATree:function(n){var z=this,h=z.element;var D=h.attr("id");var p=c("<div class='ui-coa-qbtags'/>");h.append(p);n=c.isArray(n)?n:[n];for(var P=0;P<n.length;P++){if(n[P].active){var f=(n[P].name.replace(/\W/g,"")).toLowerCase();var L=n[P].name;var F=c("<ul id='ul_"+D+f+"' class='coacollapse ui-coa-list'/>");var u=c("<div class='ui-coa-root'/>");var M=c("<span/>").css("display","inline-block");u.append(F);var t=n[P].subTagGroups;
if((t!=d&&t.length>0)||n[P].tags.length>0){p.append(u)}var m=null;if(t!=d&&t.length>0){t=c.isArray(t)?t:[t];for(var N=0;N<t.length;N++){level=1;var v=null;z._getLevelOfTree(t[N]);m=null;v=t[N];var s=true;var O=null;var C="";for(var E=0;E<level;E++){if(v!=d&&v.length!=0){v=c.isArray(v)?v:[v];var I=m;for(var H=0;H<v.length;H++){var K=(v[H].name.replace(/\W/g,"")).toLowerCase();if(v.length>1){m=I}if(v[H].active){m=z._createTree(v[H],m,L);if(s){var w=c("<li/>");if(z.options.showSelect){var r=D+"_chk"+(v[H].name.replace(/\W/g,"")).toLowerCase();
var B=z._buildCheckbox(r,"ui-coa-root-head",h,z,v[H].externalRefId);w.append(B);w.append(c("<label style='margin-left: 15px;' for='"+r+"'>"+v[H].name+" &mdash; <i>"+L+"</i></label>"))}else{w.append(c("<input type='hidden' value='"+v[H].externalRefId+"'/>"));if(c.inArray(v[H].externalRefId,z.options.selectedExtRefs)!=-1){w.attr("data-selected","true")}w.append(v[H].name+" &mdash; <i>"+L+"</i>")}w.append(m);O=w;s=false}}}var o=v.subTagGroups;if(o==d&&v[0]!=d){v=v[0].subTagGroups}else{v=v.subTagGroups
}}}var e=c("#ul_"+D+f);e.append(O);if(!z.options.showSelect){e.find("li").hide();e.find("li[data-selected=true]").show();e.find("li[data-selected=true]").find("*").show()}}}var x=n[P].tags;if(x!=d){for(var H=0;H<x.length;H++){if(x[H].active){var G=c("<span/>");var y=D+"_chk"+(x[H].name.replace(/\W/g,"")).toLowerCase();var B=null;if(z.options.showSelect){B=z._buildCheckbox(y,"ui-coa-root-head",h,z,x[H].externalRefId)}var J=c("<li data='"+x[H].externalRefId+"' class='last'></li>");var q=0;if(!z.options.showSelect){q=c.inArray(J.attr("data"),z.options.selectedExtRefs)
}else{q=0}if(q>-1){var A=c("<label style='margin-left: 15px;' for='"+y+"'/>");A.append(x[H].name+" &mdash; <i>"+L+"</i>");J.append(B);J.append(A);F.append(J)}}}}}}c("input[id^=COAContainer_chk]").removeAttr("checked");c.each(z.options.selectedIds,function(Q,l){c("#"+l).attr("checked",true)});if(!z.options.showSelect&&!z.options.search){c(".ui-coa-root").children(":not(:visible)").parent().remove()}},_getLevelOfTree:function(h){var f=this,m=f.element;var l=m.attr("id");var e=h;if(e!=d){level=level+1;
var n=e.subTagGroups;if(n==d&&e[0]!=d){f._getLevelOfTree(e[0].subTagGroups)}else{f._getLevelOfTree(e.subTagGroups)}}},_createTree:function(n,s,t){var x=this,l=x.element;var r=l.attr("id");if(n!=d){var h=n.tags;var e=n.name;var p=n.externalRefId;if(p==d&&n[0]!=d){p=n[0].externalRefId}if(h==d&&n[0]!=d){h=n[0].tags}if(e==d&&n[0]!=d){e=n[0].name}var w=c("<li/>");var o=c("<ul data='"+p+"' class='coacollapse' />").attr("id",r+"_"+(e.replace(/\W/g,"")).toLowerCase());var q=c("<label class='ui-coa-subroot-head' id='subroot_"+r+"_"+(e.replace(/\W/g,"")).toLowerCase()+"'/>");
var f=c("<span class='ui-coa-root-head'/>");q.append(e+" &mdash; <i>"+t+"</i>");if(h!=d){for(var m=0;m<h.length;m++){if(h[m].active){if(h[m].externalRefId!=p){var u=c("<label/>");var v=c("<li data='"+h[m].externalRefId+"' class='last'></li>");u.append(h[m].name+" &mdash; <i>"+t+"</i>");v.append(u);o.append(v)}}}}if(s==null){s=o}else{w.append(q).append(o);s.append(w);s=o}}return s},_buildCheckbox:function(n,l,m,f,h){var e=c("<input id='"+n+"' type='checkbox' value='"+h+"' />");e.off("click",f._updateSelectAll);
e.on("click",{obj:m,widget:f},f._updateSelectAll);return e},_highlight:function(p,l){var e=this,h=e.element;var f=h.attr("id");var n={words:"",caseSensitive:false,wordsOnly:true,template:'$1<span class="qbHighlight">$2</span>$3'},m;c.extend(true,n,l||{});if(n.words.length==0){return}m=new RegExp("(>[^<]*)("+n.words+")([^<]*)",n.caseSensitive?"":"ig");c("#"+p).find(".ui-coa-root:containsic("+n.words+")").each(function(){var o=c(this).html().replace(/&amp;/g,"&");if(!o){return}c(this).html(o.replace(m,n.template))
})},_updateSelectAll:function(l){l.stopPropagation();var h=l.data.obj;var e=l.data.widget;var f=e.element.attr("id");if(c(h).find("input[type=checkbox]:not(:checked)").length==0){c("#"+e.options.selectAllId).attr("checked",true);c("#"+e.options.selectAllId).siblings().addClass("selected select")}else{c("#"+e.options.selectAllId).removeAttr("checked");c("#"+e.options.selectAllId).siblings().removeClass("selected select")}if(c(h).find("input[type=checkbox]:checked").length>0){c(".primary").removeClass("disabled")
}else{c(".primary").addClass("disabled")}e._updateSelectedIds("checked")},_updateSelectedIds:function(m){var e=this,l=e.element;var h=l.attr("id");var f=l.find("input[type=checkbox]");e.options.selectedIds=[];if(m=="checked"){c.each(f,function(o,n){if(c(n).is(":checked")){e.options.selectedIds.push(c(n).attr("id"))}})}},_setOption:function(f,h){c.Widget.prototype._setOption.apply(this,arguments);var e=this;switch(f){case"updateSelectedIds":e._updateSelectedIds(h);break}}});c.extend(c.ui.mywidget,{instances:[]})
}(jQuery));(function(c){c.widget("ui.amexcheck",{_create:function(){var e=this;var d=c("<a/>").attr("href","#").addClass("amexcheck");if(e.element.is(":checked")){d.addClass("select")}e.element.hide();d.insertAfter(e.element);d.mouseenter(function(f){c(this).addClass("hover")}).mouseleave(function(f){c(this).removeClass("hover")}).mousedown(function(f){c(this).addClass("down");c.ui.amexcheck.inprocess=c(this);return false}).mouseup(function(f){c(this).removeClass("down").toggleClass("select");e.element.prop("checked",c(this).hasClass("select")).trigger("change");
return false}).click(function(f){return false}).keydown(function(f){if(f.which===32){c(this).addClass("down");return false}}).keyup(function(f){if(f.which===32){c(this).removeClass("down").toggleClass("select");e.element.prop("checked",c(this).hasClass("select")).trigger("change");return false}});c(document).mouseup(function(f){if(c.ui.amexcheck.inprocess){c.ui.amexcheck.inprocess.removeClass("down");delete c.ui.amexcheck.inprocess}})},_init:function(){},destroy:function(){var d=this;c.Widget.prototype.destroy.call(d);
d.element.next().remove();d.element.show()}})})(jQuery);
/*
* jQuery UI Autocomplete 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Autocomplete
*
* Depends:
* jquery.ui.core.js
* jquery.ui.widget.js
* jquery.ui.position.js
*/
(function(c,d){var e=0;c.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var f=this,l=this.element[0].ownerDocument,h;
this.isMultiLine=this.element.is("textarea");this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(m){if(f.options.disabled||f.element.propAttr("readOnly")){return}h=false;var n=c.ui.keyCode;switch(m.keyCode){case n.PAGE_UP:f._move("previousPage",m);break;case n.PAGE_DOWN:f._move("nextPage",m);break;case n.UP:f._keyEvent("previous",m);break;case n.DOWN:f._keyEvent("next",m);
break;case n.ENTER:case n.NUMPAD_ENTER:if(f.menu.active){h=true;m.preventDefault()}case n.TAB:if(!f.menu.active){return}f.menu.select(m);break;case n.ESCAPE:f.element.val(f.term);f.close(m);break;default:clearTimeout(f.searching);f.searching=setTimeout(function(){if(f.term!==f.element.val()){f.selectedItem=null;f.search(null,m)}},f.options.delay);break}}).bind("keypress.autocomplete",function(m){if(h){h=false;m.preventDefault()}}).bind("focus.autocomplete",function(){if(f.options.disabled){return
}f.selectedItem=null;f.previous=f.element.val()}).bind("blur.autocomplete",function(m){if(f.options.disabled){return}clearTimeout(f.searching);f.closing=setTimeout(function(){f.close(m);f._change(m)},150)});this._initSource();this.menu=c("<ul></ul>").addClass("ui-autocomplete").appendTo(c(this.options.appendTo||"body",l)[0]).mousedown(function(m){var n=f.menu.element[0];if(!c(m.target).closest(".ui-menu-item").length){setTimeout(function(){c(document).one("mousedown",function(o){if(o.target!==f.element[0]&&o.target!==n&&!c.ui.contains(n,o.target)){f.close()
}})},1)}setTimeout(function(){clearTimeout(f.closing)},13)}).menu({focus:function(n,o){var m=o.item.data("item.autocomplete");if(false!==f._trigger("focus",n,{item:m})){if(/^key/.test(n.originalEvent.type)){f.element.val(m.value)}}},selected:function(o,p){var n=p.item.data("item.autocomplete"),m=f.previous;if(f.element[0]!==l.activeElement){f.element.focus();f.previous=m;setTimeout(function(){f.previous=m;f.selectedItem=n},1)}if(false!==f._trigger("select",o,{item:n})){f.element.val(n.value)}f.term=f.element.val();
f.close(o);f.selectedItem=n},blur:function(m,n){if(f.menu.element.is(":visible")&&(f.element.val()!==f.term)){f.element.val(f.term)}}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");if(c.fn.bgiframe){this.menu.element.bgiframe()}f.beforeunloadHandler=function(){f.element.removeAttr("autocomplete")};c(window).bind("beforeunload",f.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");
this.menu.element.remove();c(window).unbind("beforeunload",this.beforeunloadHandler);c.Widget.prototype.destroy.call(this)},_setOption:function(f,h){c.Widget.prototype._setOption.apply(this,arguments);if(f==="source"){this._initSource()}if(f==="appendTo"){this.menu.element.appendTo(c(h||"body",this.element[0].ownerDocument)[0])}if(f==="disabled"&&h&&this.xhr){this.xhr.abort()}},_initSource:function(){var f=this,l,h;if(c.isArray(this.options.source)){l=this.options.source;this.source=function(n,m){m(c.ui.autocomplete.filter(l,n.term))
}}else{if(typeof this.options.source==="string"){h=this.options.source;this.source=function(n,m){if(f.xhr){f.xhr.abort()}f.xhr=c.ajax({url:h,data:n,dataType:"json",success:function(o){m(o)},error:function(){m([])}})}}else{this.source=this.options.source}}},search:function(h,f){h=h!==null?h:this.element.val();this.term=this.element.val();if(h.length<this.options.minLength){return this.close(f)}clearTimeout(this.closing);if(this._trigger("search",f)===false){return}return this._search(h)},_search:function(f){this.pending++;
this.element.addClass("ui-autocomplete-loading");this.source({term:f},this._response())},_response:function(){var h=this,f=++e;return function(l){if(f===e){h.__response(l)}h.pending--;if(!h.pending){h.element.removeClass("ui-autocomplete-loading")}}},__response:function(f){if(!this.options.disabled&&f&&f.length){f=this._normalize(f);this._suggest(f);this._trigger("open")}else{this.close()}},close:function(f){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();
this.menu.deactivate();this._trigger("close",f)}},_change:function(f){if(this.previous!==this.element.val()){this._trigger("change",f,{item:this.selectedItem})}},_normalize:function(f){if(f.length&&f[0].label&&f[0].value){return f}return c.map(f,function(h){if(typeof h==="string"){return{label:h,value:h}}return c.extend({label:h.label||h.value,value:h.value||h.label},h)})},_suggest:function(f){var h=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(h,f);this.menu.deactivate();
this.menu.refresh();h.show();this._resizeMenu();h.position(c.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next(new c.Event("mouseover"))}},_resizeMenu:function(){var f=this.menu.element;f.outerWidth(Math.max(f.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(l,h){var f=this;c.each(h,function(m,n){f._renderItem(l,n)})},_renderItem:function(f,h){return c("<li></li>").data("item.autocomplete",h).append(c("<a></a>").text(h.label)).appendTo(f)
},_move:function(h,f){if(!this.menu.element.is(":visible")){this.search(null,f);return}if(this.menu.first()&&/^previous/.test(h)||this.menu.last()&&/^next/.test(h)){this.element.val(this.term);this.menu.deactivate();return}this.menu[h](f)},widget:function(){return this.menu.element},_keyEvent:function(h,f){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(h,f);f.preventDefault()}}});c.extend(c.ui.autocomplete,{escapeRegex:function(f){return f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")
},filter:function(l,f){var h=new RegExp(c.ui.autocomplete.escapeRegex(f),"i");return c.grep(l,function(m){return h.test(m.label||m.value||m)})}})}(jQuery));(function(c){c.widget("ui.menu",{_create:function(){var d=this;this.element.addClass("ui-menu ui-widget ui-widget-content").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(e){if(!c(e.target).closest(".ui-menu-item a").length){return}e.preventDefault();d.select(e)});this.refresh()},refresh:function(){var e=this;
var d=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");d.children("a").attr("tabindex",-1).mouseenter(function(f){e.activate(f,c(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(h,f){this.deactivate();if(this.hasScroll()){var l=f.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();if(l<0){this.element.scrollTop(d+l)}else{if(l>=e){this.element.scrollTop(d+l-e+f.height())}}}this.active=f.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();
this._trigger("focus",h,{item:f})},deactivate:function(){if(!this.active){return}this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null},next:function(d){this.move("next",".ui-menu-item:first",d)},previous:function(d){this.move("prev",".ui-menu-item:last",d)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(h,f,e){if(!this.active){this.activate(e,this.element.children(f));
return}var d=this.active[h+"All"](".ui-menu-item").eq(0);if(d.length){this.activate(e,d)}else{this.activate(e,this.element.children(f))}},nextPage:function(f){if(this.hasScroll()){if(!this.active||this.last()){this.activate(f,this.element.children(".ui-menu-item:first"));return}var h=this.active.offset().top,e=this.element.height(),d=this.element.children(".ui-menu-item").filter(function(){var l=c(this).offset().top-h-e+c(this).height();return l<10&&l>-10});if(!d.length){d=this.element.children(".ui-menu-item:last")
}this.activate(f,d)}else{this.activate(f,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))}},previousPage:function(f){if(this.hasScroll()){if(!this.active||this.first()){this.activate(f,this.element.children(".ui-menu-item:last"));return}var h=this.active.offset().top,e=this.element.height(),d=this.element.children(".ui-menu-item").filter(function(){var l=c(this).offset().top-h+e-c(this).height();return l<10&&l>-10});if(!d.length){d=this.element.children(".ui-menu-item:first")
}this.activate(f,d)}else{this.activate(f,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))}},hasScroll:function(){return this.element.height()<this.element[c.fn.prop?"prop":"attr"]("scrollHeight")},select:function(d){this._trigger("selected",d,{item:this.active})}})}(jQuery));(function(c){c.widget("ui.coamenu",{options:{tagsJSON:null},_create:function(){this.element.hide();this.content=c("<div></div>").addClass("ui-coamenu-content");this.wrapper=c("<div>").addClass("ui-coamenu-wrapper").insertAfter(this.element);
this._createDropdownButton()},_createDropdownButton:function(){var d=this;c("<a></a>").html("<span class = 'ui-coamenu-droptext'>Select one...</span>").attr("tabIndex",-1).attr("title","Show All Items").prependTo(d.wrapper).addClass("ui-coamenu-dropbutton").append(c("<i class = 'ui-coamenu-dropicon'></i>")).click(function(){if(d.content.is(":visible")){d.content.hide();return}else{d.content.show()}d._evaluate();d._buildAutocompleteInsideContent();d.input.focus();d._bindCustomEventHandlers()})},_buildAutocompleteInsideContent:function(){if(c(".ui-coamenu-content").length>0){c(".ui-coamenu-content").empty().remove()
}var f=this.content;var l=this.wrapper;l.append(f);var e=this.element;var h="";this.input=c("<input/>").appendTo(f).val(h).attr("placeHolder","Search...").addClass("ui-coamenu-searchbox ").autocomplete({appendTo:f,delay:0,minLength:0,source:c.proxy(this,"_source"),messages:{noResults:"",results:function(){}},select:function(p,q){var o=c(q.item.option);var n=o.text();var r=n.lastIndexOf("-");n=n.substring(0,r);var m=c("<label class = 'tempLabel'></label>").html(n).attr("title",o.text()).attr("data-tagid",o.val()).attr("id","tempLabel_"+e.attr("id").split("_")[1]);
l.hide().after(m);QBTags.manageLabel(o,m,TagAction.action.APPLY_EXISTING_TAG)},close:function(m,n){if(f.find(".ui-coamenu-searchbox").val()===""){f.hide()}}}).on("focus",function(){c(this).autocomplete("search","")});this.input.bind("autocompleteselect",function(m,n){n.item.option.selected=true;c(this).trigger("select",m,{item:n.item.option})});var d=this;this.input.bind("autocompletechange",{self:d},function(p,r){var n=p.data.self;if(r.item){return}var q=n.input.val(),m=q.toLowerCase(),o=false;n.element.children("option").each(function(){if(c(this).text().toLowerCase()===m){n.selected=o=true;
return false}});if(o){return}n.element.val("")})},_evaluate:function(){c("[id^=COASelect_]").filter(function(){return c(this).children("option").length>1}).empty();var e=this.element;var d=this.options.tagsJSON;c.each(d,function(h,f){if(f.active){var m=f.name;if(typeof(f.grpType)!=="undefined"){m=m+" - <i>"+f.grpType+"</i>"}var l="<option value = '"+f.id+"'>"+m+"</option>";e.append(l)}})},_bindCustomEventHandlers:function(){var d=this.content;var e=this.wrapper;c(document).on("click",function(){c(".ui-coamenu-content").empty().remove()
});c(e).on("click",function(f){f.stopPropagation()});c(d).on("click",function(f){f.stopPropagation()});c(".ui-coamenu-dropbutton").on("click",function(){var f=c(".ui-coamenu-content:visible");f.children(".ui-coamenu-searchbox").val("")})},_source:function(e,d){var f=new RegExp(c.ui.autocomplete.escapeRegex(e.term),"i");d(this.element.children("option").map(function(){var h=c(this).text();if(this.value&&(!e.term||f.test(h))){return{label:h,value:h,option:this}}}))},_destroy:function(){this.content.remove();
this.element.show()}})})(jQuery);(function(c,d){c.widget("ui.qbprogressbar",{options:{stepsDetail:[],step:0},_create:function(){var q=this;var h=q.element;var l=q.options.step;var n=q.options.stepsDetail[l].stepTitle;var o=q.options.stepsDetail[l].activeClass;var p=c("<div></div>").addClass("stepTexts");var e=[];c.each(q.options.stepsDetail,function(s,r){e.push(r.stepText);var t=c("<div></div>").addClass("stepText").attr("id","stepText_"+s).html(r.stepText);if(l===s){t.addClass("stepTextActive")}p.append(t)
});h.addClass("ui-qbprogressbar");var m=c("<div></div>").addClass(o);var f=c("<div></div>").addClass("description").html(n);h.append(f);h.append(m);h.append(p)},_init:function(){var e=this},destroy:function(){var e=this;c.Widget.prototype.destroy.call(e);e.element.empty()},_updateProgressbar:function(m){var h=this;var l=h.element;var o=h.options.stepsDetail;try{var f=l.find(".description");f.empty().html(o[m].stepTitle);l.find("div.progressbar").removeAttr("class").addClass(o[m].activeClass);l.find(".stepTextActive").removeClass("stepTextActive");
l.find("#stepText_"+m).addClass("stepTextActive")}catch(n){}},_setOption:function(f,h){c.Widget.prototype._setOption.apply(this,arguments);var e=this;switch(f){case"updateprogressbar":e._updateProgressbar(h);break}}});c.extend(c.ui.mywidget,{instances:[]})}(jQuery));(function(c,d){c.message=function(e){return c("<div/>").message(e)};c.widget("ui.message",{options:{},_create:function(){var e=this;var f=e.options;var n=e.element;n.addClass("ui-messagebox").css({position:"absolute",zIndex:4002,cursor:"default",display:"none"}).html(f.msg);
c('<div tabindex="0" style="height:0px" class="ui-messagebox-firstfocus" />').prependTo(n);if(!f.center){n.css({left:f.left+"px",top:f.top+"px"})}if(f.theme){n.addClass(f.theme)}if(f.buttons){var h=c("<div/>").addClass("ui-messagebox-buttons");c.each(f.buttons,function(q,p){var r=p.type||"button";var o=c("<"+r+" />").addClass(p["class"]);if(p.type==="a"){o.attr("href","#")}o.html("<span>"+p.label+"</span>");o.appendTo(h)});h.appendTo(n)}n.appendTo(document.body);n.keypress(function(p){var o=p.which||p.keyCode;
if(o===27){e.destroy();return false}});var m=c.map(n.find("button,a,input"),function(p,o){return c(p)});if(m.length){var l=m[m.length-1];m[0].keypress(function(p){var o=p.which||p.keyCode;if(o===9&&p.shiftKey){l.focus();return false}});l.on("keypress keydown",function(p){var o=p.which||p.keyCode;if(o===9&&!p.shiftKey){m[0].focus();return false}})}if(f.center){n.css({marginLeft:n.outerWidth()/-2+"px",left:"50%",top:(c(document).scrollTop()+c(window).height()/2-n.outerHeight()/2)+"px"})}n.fadeIn(300,function(){n.find(".ui-messagebox-firstfocus").focus()
})},_init:function(){},destroy:function(){var e=this;c.Widget.prototype.destroy.call(e);e.element.remove()},close:function(f){var e=this;e.element.fadeOut(300,function(){if(f){e.destroy()}})},buttons:function(){var e=this;return c.map(c(".ui-messagebox-buttons",e.element).find("button,a"),function(h,f){return c(h)})},_setOption:function(f,h){c.Widget.prototype._setOption.apply(this,arguments);var e=this;switch(f){case"futureoption":e._somefunction(h);break}}})}(jQuery));(function(c){c.widget("ui.scrollbar",{options:{theme:"round",fullTrack:false,fullTrackAdjustTop:0,fullTrackAdjustBottom:0,fullTrackAdjustLeft:0,fullTrackAdjustRight:0},_create:function(){var s=this;
var p=null,n,d;if(!c.contains(document.documentElement,s.element[0])){p=s.element.parents().last();n=p.css("position");d=p.css("visibility");c(document.body).append(p.css({position:"absolute",visibility:"hidden"}))}s.vertScroll=s.element.css("overflow-y")==="scroll";s.horzScroll=s.element.css("overflow-x")==="scroll";s._save=s.element.clone().empty();s.element.css("overflow-x","");s.element.css("overflow-y","");s.scroller=c("<div/>").addClass("ui-scrollbar-scroller");var m=c("<div/>").addClass("ui-scrollbar-content");
s.element.addClass("ui-scrollbar").attr("tabindex","0");if(s.options.theme){s.element.addClass(s.options.theme)}s.element.contents().wrapAll(m);s.element.contents().wrap(s.scroller);s.content=s.element.children().children();s.content.css({position:"relative",overflow:"auto"});function t(u){return(--u)*u*u+1}function o(u){return u?s.vthumb.offset().top:s.hthumb.offset().left}function h(u){return u?s.vthumb.outerHeight():s.hthumb.outerWidth()}function f(u){return u?s.vthumbrange:s.hthumbrange}function e(u){return u?s.vpagerange:s.hpagerange
}function q(v,u){return u?v.pageY:v.pageX}function l(u){return u?s._adjustVert:s._adjustHorz}function r(w){if(!c(w.target).hasClass("ui-scrollbar-vcontainer")&&!c(w.target).hasClass("ui-scrollbar-hcontainer")){return false}var u=c(w.target).hasClass("ui-scrollbar-vcontainer");s._repeat=true;var A=true;var y=0;var z=0;var x=function(){if(!s._repeat){return}if(q(w,u)<o(u)+h(u)/3){if(y===2){return}y=1;z=e(u)*t((o(u)+h(u)/3-q(w,u))/f(u));l(u).call(this,z)}else{if(q(w,u)>(o(u)+2*h(u)/3)){if(y===1){return
}y=2;z=e(u)*t((q(w,u)-(o(u)+2*h(u)/3))/f(u));l(u).call(this,-z)}else{return}}if(s._repeat&&Math.abs(z)>0.01){setTimeout(function(){x()},A?300:50);A=false}};x()}if(s.vertScroll){s.vcontainer=c("<div/>").addClass("ui-scrollbar-vcontainer");s.vthumb=c("<div/>").addClass("ui-scrollbar-vthumb").appendTo(s.vcontainer);s.mid=c("<div/>").addClass("ui-scrollbar-trackmid");s.top=c("<div/>").addClass("ui-scrollbar-tracktop");s.bot=c("<div/>").addClass("ui-scrollbar-trackbot");s.vtrack=c("<div/>").addClass("ui-scrollbar-vtrack").append(s.top).append(s.mid).append(s.bot).append(s.vcontainer);
s.bot.click(function(u){s._adjustVert(-20)});s.top.click(function(u){s._adjustVert(20)});s.vcontainer.mousedown(r)}if(s.horzScroll){s.hcontainer=c("<div/>").addClass("ui-scrollbar-hcontainer");s.hthumb=c("<div/>").addClass("ui-scrollbar-hthumb").appendTo(s.hcontainer);s.ctr=c("<div/>").addClass("ui-scrollbar-trackctr");s.left=c("<div/>").addClass("ui-scrollbar-tracklf");s.right=c("<div/>").addClass("ui-scrollbar-trackrt");s.htrack=c("<div/>").addClass("ui-scrollbar-htrack").append(s.left).append(s.ctr).append(s.right).append(s.hcontainer);
s.right.click(function(u){s._adjustHorz(-20)});s.left.click(function(u){s._adjustHorz(20)});s.hcontainer.mousedown(r)}if(s.vertScroll||s.horzScroll){s.element.on("mouseup mouseleave",function(u){s._repeat=false});s.element.on("mousewheel DOMMouseScroll",function(w){var x=c(this),z,y=w.originalEvent,u=s.vertScroll;if(y.wheelDelta){z=-y.wheelDelta}if(y.detail){z=y.detail}if(z<0){l(u).call(this,20)}else{if(z>0){l(u).call(this,-20)}}return false})}s.scroller=s.element.children();if(s.vertScroll){s.element.prepend(s.vtrack);
s.content.css({height:"auto"})}if(s.horzScroll){s.element.append(s.htrack)}s.resize();s._position={top:0,left:0};s._adjustVert=function(w){var u=s.content.position().top+w;if(w>=0){u=Math.min(u,0)}else{u=Math.max(u,-s.vscrollrange)}if(u!==parseInt(s.content.position().top,10)&&s.vertScroll){var v=s.vthumbrange*(-u/s.vscrollrange);s.vthumb.css("top",v+"px");s.content.css("top",u+"px")}};s._adjustHorz=function(w){var v=s.content.position().left+w;if(w>=0){v=Math.min(v,0)}else{v=Math.max(v,-s.hscrollrange)
}if(v!==parseInt(s.content.position().left,10)&&s.horzScroll){var u=s.hthumbrange*(-v/s.hscrollrange);s.hthumb.css("left",u+"px");s.content.css("left",v+"px")}};s._scrollcheck=function(v){var x=c(".ui-scrollbar-content",s.element).position();if(x.top!==s._position.top){var w=s.vthumbrange*(-x.top/s.vscrollrange);s.vthumb.css("top",w+"px")}if(x.left!==s._position.left){var u=s.hthumbrange*(-x.left/s.hscrollrange);s.hthumb.css("left",u+"px")}s._position=x};s._keyhandler=function(w){var v=w.which||w.keyCode;
var u=false;if(v===40){s._adjustVert(-20)}else{if(v===38){s._adjustVert(20)}else{if(v===34){s._adjustVert(-s.vpagerange)}else{if(v===33){s._adjustVert(s.vpagerange)}else{if(v===36){s._adjustVert(-s.content.position().top)}else{if(v===35){s._adjustVert(-s.vscrollrange-s.content.position().top)}else{if(v===39){s._adjustHorz(-20)}else{if(v===37){s._adjustHorz(+20)}else{u=true}}}}}}}}if(!u){return u}};s.element.keydown(s._keyhandler);s.element.on("focus","*",function(u){setTimeout(s._scrollcheck,50);
return false});if(p){p.css({position:n,visibility:d}).detach()}},_init:function(){},destroy:function(){var d=this;c.Widget.prototype.destroy.call(this);d._restore()},resize:function(f){var e=this;if(f&&f.width){e.element.css("width",f.width+"px")}if(f&&f.height){e.element.css("height",f.height+"px")}e.w=e.element.outerWidth();e.h=e.element.outerHeight();e.scroller.css({width:e.w+"px",height:e.h+"px"});if(e.vertScroll){e.vtrack.css("height",(e.h-(e.horzScroll?e.htrack.outerHeight():0))+"px");e.mid.css("height",(e.vtrack.outerHeight()-e.top.outerHeight()-e.bot.outerHeight())+"px");
e.scroller.css("width",(e.w-e.vtrack.outerWidth())+"px");if(e.horzScroll){e.content.css({width:e.options.width+"px"})}else{e.content.css("width",(e.w-e.vtrack.outerWidth())+"px")}if(e.options.fullTrack){var d=e.vtrack.outerHeight()-e.options.fullTrackAdjustTop+e.options.fullTrackAdjustBottom;e.vcontainer.css({position:"absolute",top:e.options.fullTrackAdjustTop+"px",height:d+"px"})}else{e.vcontainer.css({position:"absolute",top:e.mid.position().top+"px",height:e.mid.outerHeight()+"px"})}e.vthumbrange=e.vcontainer.outerHeight()-e.vthumb.outerHeight();
e.vscrollrange=Math.max(0,e.content.outerHeight()-e.scroller.outerHeight());e.vpagerange=e.scroller.outerHeight();if(e.vpagerange>=e.content.outerHeight()){e.vtrack.hide()}else{e.vtrack.show()}var l=e.vthumbrange*(-e.content.position().top/e.vscrollrange);e.vthumb.css("top",l+"px");e.vthumb.draggable({axis:"y",containment:"parent",drag:function(o,p){var n=e.vscrollrange*((p.position.top)/e.vthumbrange);e.content.css("top","-"+n+"px")}})}if(e.horzScroll){e.htrack.css("width",(e.w-(e.vertScroll?e.vtrack.outerWidth():0))+"px");
e.ctr.css("width",(e.htrack.outerWidth()-e.left.outerWidth()-e.right.outerWidth())+"px");e.scroller.css("height",(e.h-e.htrack.outerHeight())+"px");e.content.css({width:e.options.width+"px"});if(e.options.fullTrack){var m=e.htrack.outerWidth()-e.options.fullTrackAdjustLeft+e.options.fullTrackAdjustRight;e.hcontainer.css({position:"absolute",left:e.options.fullTrackAdjustLeft+"px",width:m+"px"})}else{e.hcontainer.css({position:"absolute",left:e.ctr.position().left+"px",width:e.ctr.outerWidth()+"px"})
}e.hthumbrange=e.hcontainer.outerWidth()-e.hthumb.outerHeight();e.hscrollrange=Math.max(0,e.content.outerWidth()-e.scroller.outerWidth());e.hpagerange=e.scroller.outerWidth();if(e.hpagerange>=e.content.outerWidth()){e.htrack.hide()}else{e.htrack.show()}var h=e.hthumbrange*(-e.content.position().left/e.hscrollrange);e.hthumb.css("left",h+"px");e.hthumb.draggable({axis:"x",containment:"parent",drag:function(o,p){var n=e.hscrollrange*((p.position.left)/e.hthumbrange);e.content.css("left","-"+n+"px")
}})}},_restore:function(){var d=this;var e=c(".ui-scrollbar-content",d.element).contents();d.element.replaceWith(e);e.wrapAll(d._save);d.element=e.parent()},_setOption:function(e,f){var d=this;switch(e){case"theme":d.element.removeClass(d.options.theme).addClass(f);d.resize(d.options);break}c.Widget.prototype._setOption.apply(this,arguments)}})})(jQuery);(function(c){c.widget("ui.cardselect",{options:{cardsList:[],newOption:null,cardsObj:null,displayText:"Select one...",isReturnKeyUp:false,clicky:false,isUpdate:false},_create:function(){this.element.hide();
this.content=c("<div></div>").addClass("ui-cardselect-content");this.wrapper=c("<div>").addClass("ui-cardselect-wrapper").insertAfter(this.element);this._evaluate();this._createDropdownButton(this.options.displayText)},_evaluate:function(){var h=[];var e=this.element;var d=this;var f=this.options.cardsList;c.each(f,function(m,l){var p=e.attr("id").split("_")[1];var n=c("<option value = '"+l.qbExpAcctID+"'></option>");n.text(Receipt.unescapeHTML(l.qbExpAcctName));var o=d.options.cardsObj.isSelectedExpenseById(l.qbExpAcctID,p);
if(o!==null){n.addClass("selectedOption");d.options.displayText=n.text()}if(l.olbIndicator&&l.olbDisplayAccount===d.options.cardsObj.getAcctNumberBySortedIndex(p)){n.addClass("olb");if(d.options.isUpdate&&d.options.cardsObj.getMappedOLBSortedIndex(l.qbExpAcctID)!==null&&d.options.cardsObj.getMappedOLBSortedIndex(l.qbExpAcctID)!==p){n.addClass("expenseOptionDisabled")}h.push(n)}else{if(l.olbIndicator&&(l.olbDisplayAccount===undefined||l.olbDisplayAccount===null||l.olbDisplayAccount==="")){n.addClass("olblank");
h.push(n);if(d.options.isUpdate&&d.options.cardsObj.getMappedOLBSortedIndex(l.qbExpAcctID)!==null&&d.options.cardsObj.getMappedOLBSortedIndex(l.qbExpAcctID)!==p){n.addClass("expenseOptionDisabled")}}else{if(!l.olbIndicator){n.addClass("nolb");h.push(n)}}}});c.each(h,function(l,m){e.append(m)});e.prop("selectedIndex",-1)},_createDropdownButton:function(e){var d=this;d.button=c("<a href ='#'></a>").html(c("<span class = 'ui-cardselect-droptext'></span>").text(e)).prependTo(d.wrapper).addClass("ui-cardselect-dropbutton").append(c("<span class = 'ui-cardselect-droparrow'></span>").append(c("<i class = 'ui-cardselect-dropicon'></i>"))).click(function(f){f.preventDefault();
f.stopPropagation();if(c(this).hasClass("expenseDisabled")){return false}if(d.content.is(":visible")){d.content.hide();c(this).find(".ui-cardselect-droparrow").children().removeClass("ui-cardselect-dropicon-expand");c(this).find(".ui-cardselect-droparrow").children().addClass("ui-cardselect-dropicon");return}else{d.content.show();c(".ui-cardselect-droparrow").children().removeClass("ui-cardselect-dropicon-expand");c(".ui-cardselect-droparrow").children().addClass("ui-cardselect-dropicon");c(this).find(".ui-cardselect-droparrow").children().addClass("ui-cardselect-dropicon-expand");
c(this).find(".ui-cardselect-droparrow").children().removeClass("ui-cardselect-dropicon")}d._buildCardSelectMenu();d._bindEvents();c(".ui-cardselect-create-input").val("").parent(".ui-cardselect-input-wrapper").remove();c(".ui-cardselect-dropbutton").show();d._getKeyboardAccessibility()}).on("focus",function(){c(".ui-cardselect-dropbutton").css("outline","");c(this).css("outline","1px dotted #222")}).on("blur",function(){c(this).css("outline","")})},_buildCardSelectMenu:function(){if(c(".ui-cardselect-content").length>0){c(".ui-cardselect-content").empty().remove()
}var f=this.content;var l=this.wrapper;var e=this.element;var d=this;d.menu=c("<ul class = 'ui-cardselect-menu' tabindex=-2></ul>");var h=d.menu;h.append(c("<li class = 'ui-cardselect-menu-option ui-cardselect-disabled' tabindex='-1'>Select One...</li>"));h.append(c("<li class = 'ui-cardselect-create ui-cardselect-menu-option'>Create New Account</li>"));l.append(f.append(d.menu));c.each(e.children("option"),function(m,n){var o=c("<li class = 'ui-cardselect-menu-option'></li>").text(c(n).text());if(c(n).hasClass("selectedOption")){o.addClass("ui-cardselect-menu-option-selected");
e.find(".ui-cardselect-droptext").text(c(n).text()).attr("title",c(n).text())}if(!(c(n).hasClass("expenseOptionDisabled"))){h.append(o)}});f.show();h.focus()},_bindEvents:function(){var e=this;var l=this.content;var n=this.wrapper;var h=this.element;var f=this.button;var m=this.menu;this.input=c("<input type='text' class = 'ui-cardselect-create-input pull-left' placeHolder='Create New Account'/>");var d=this.input;c(document).on("click",function(){c(".ui-cardselect-content").empty().remove();e._removeInputBox();
f.find(".ui-cardselect-droparrow").children().removeClass("ui-cardselect-dropicon-expand");f.find(".ui-cardselect-droparrow").children().addClass("ui-cardselect-dropicon");f.show()});c(n,l).on("click",function(o){o.stopPropagation()});c(".ui-cardselect-disabled").on("click",function(p){var o=null;o=h.children(".selectedOption").removeClass("selectedOption");m.children(".ui-cardselect-menu-option-selected").removeClass("ui-cardselect-menu-option-selected");h.prop("selectedIndex",-1).change();f.find(".ui-cardselect-droptext").html("Select one...");
l.hide();c(".expenseOptionDisabled").removeClass("expenseOptionDisabled");e.options.cardsObj.deleteExpenseSelectedAcctList(h.attr("id").split("_")[1])});c(".ui-cardselect-create").on("click",function(){if(c(this).hasClass("ui-cardselect-menu-option-selected")){c(this).removeClass("ui-cardselect-menu-option-selected")}var q;var r=h.attr("id").split("_")[1];var p=e.options.cardsObj.getNewAccountIdBySortedIndex(r);var s=e.options.cardsObj.getNewCardDefaultTxt(r);var o=null;if(p!==null){o=e.options.cardsObj.getNewAccountById(p)
}if(o!==null){q=Receipt.unescapeHTML(o.qbExpAcctName)}else{q=s}QB.renderNewAccount(q,r)});c(".ui-cardselect-menu-option").on("click",function(){c(".expenseAcctError").remove();if(c(this).hasClass("ui-cardselect-disabled")||c(this).hasClass("ui-cardselect-create")||c(this).hasClass("ui-cardselect-menu-option-selected")){f.find(".ui-cardselect-droparrow").children().removeClass("ui-cardselect-dropicon-expand");f.find(".ui-cardselect-droparrow").children().addClass("ui-cardselect-dropicon");l.hide();
return false}if(d.is(":visible")){e._removeInputBox();f.show()}f.find(".ui-cardselect-droparrow").children().removeClass("ui-cardselect-dropicon-expand");f.find(".ui-cardselect-droparrow").children().addClass("ui-cardselect-dropicon");var r=c(this).text();var q=c(h.children("option")).filter(function(){return(c(this).hasClass("selectedOption")===true)});var o=c(h.children("option")).filter(function(){return(c(this).text()===r)});o.prop("selected",true).addClass("selectedOption").siblings().removeClass("selectedOption");
o.parent().change();var p=h.attr("id").split("_")[1];e.options.cardsObj.updateExpenseSelectedAcctList(p,o.val(),o.text());f.find(".ui-cardselect-droptext").text(r).attr("title",r);e._highlight(this);l.hide();c.each(c(":ui-cardselect"),function(u,s){var v=c(s).data().cardselect.element;var t=v.find("[option[value="+o.val()+"]");if(t.length>0&&u.toString!=p&&t.hasClass("olblank")){if(!t.hasClass("selectedOption")){t.addClass("expenseOptionDisabled")}}if(t.length>0&&u.toString()!==p&&t.hasClass("olb")){if(t.val()===o.val()){t.addClass("expenseOptionDisabled")
}}});if(q.hasClass("olblank")||q.hasClass("olb")){c.each(c(":ui-cardselect"),function(u,s){var w=c(s).data().cardselect.element;var v=w.attr("id").split("_")[1];var t=w.find("[option[value="+q.val()+"]");if(e.options.isUpdate){if(!e.options.cardsObj.isMappedCard(q.val(),p)){t.removeClass("expenseOptionDisabled")}}else{if(t.length>0){t.removeClass("expenseOptionDisabled")}}})}})},_removeInputBox:function(){this.input.val("").parent(".ui-cardselect-input-wrapper").remove()},_highlight:function(d){c(d).addClass("ui-cardselect-menu-option-selected").siblings().removeClass("ui-cardselect-menu-option-selected")
},_getKeyboardAccessibility:function(){var d=this;var l=d.menu;var f=d.content;var e=d.button;var h=l.children("li");l.on("keydown",function(q){var m=q.keyCode;var o=h.filter(".ui-cardselect-menu-option-hover");var n=o||h.first();var p=n;h.removeClass("ui-cardselect-menu-option-hover");if(m===40){if(!n.length||n.is(":last-child")){p=h.eq(0)}else{p=n.next().addClass("ui-cardselect-menu-option-hover")}}else{if(m===38){if(!n.length||n.is(":first-child")){p=h.last()}else{p=n.prev().addClass("ui-cardselect-menu-option-hover")
}}else{if(m===9||m===27){f.empty().remove()}else{if(m===13){d.options.isReturnKeyUp=true;n.click();f.empty().remove();e.focus();q.preventDefault();q.stopPropagation()}}}}p.addClass("ui-cardselect-menu-option-hover");return false})},_destroy:function(){var d=this;c.Widget.prototype.destroy.call(d);d.wrapper.empty().remove();d.element.empty()},destroy:function(){this._destroy()}})})(jQuery);(function(e,f){var d;var c=!("placeholder" in document.createElement("input"))||window.chrome||(/Trident\/7\./).test(navigator.userAgent);
e.widget("amex.picker",{options:{theme:"default",type:"select",search:true,searchPlaceholder:"Search",allSelectable:false,autoOpen:false,destroyOnClose:false,useSpacers:false,noneId:"_none",noneName:"--(none)",noResultsText:"No results matched your query.",selectedId:"__placeholder"},_create:function(){var h=this;var m=h.element;var l=h.options;var n=l.data1=l.data||l.data1;l.dataOptions1=l.dataOptions||l.dataOptions1;if(!n){throw new Error("Required property 'data' not given")}h.initTime=new Date().getTime();
h._elemClick=function(o){h.show(o);o.stopPropagation()};h._htmlClick=function(o){if(new Date().getTime()-h.initTime>200){h.hide()}};h._htmlOtherMenuOpen=function(o){if(h!=d){h.hide()}};m.on("click.picker",h._elemClick);e("html").on("click.picker",h._htmlClick);e("html").on("menu.picker",h._htmlOtherMenuOpen);if(l.selectedId=="__placeholder"){l.selectedId=l.noneId}h._buildMenu();h._bindMenuKeyHandler();if(l.autoOpen){h.show(l.event)}},destroy:function(){this._menu.remove();this.element.off("click.picker",this._elemClick);
e("html").off("click.picker",this._htmlClick);e("html").off("menu.picker",this._htmlOtherMenuOpen);e.Widget.prototype.destroy.call(this)},show:function(n){var p=this._menu;var l=this._input;if(n){if(n.pageX){this._calcRenderPosition(n.pageX,n.pageY)}else{this._calcRenderPosition(e(n.target).offset().left,e(n.target).offset().top)}}p.fadeIn(50);var h=e(":focus");if(!h.is("ui-picker *")){this._storedFocus=h}e(".ui-picker-highlighted").removeClass("ui-picker-highlighted");if(l){l.focus();var m=p.find(".ui-picker-item-selected");
if(m.length){var o=p.find(".ui-picker-tree-group");o.scrollTop(0);o.scrollTop(m.position().top-(o.height()-m.height())/2);m.addClass("ui-picker-highlighted")}else{p.find(".ui-picker-item-selectable.ui-picker-item-enabled:visible").first().addClass("ui-picker-highlighted")}}else{p.find(".ui-picker-item-selected .ui-picker-item-anchor").focus()}this.element.trigger("show");d=this;e("html").trigger("menu.picker")},hide:function(){var h=this;h._menu.fadeOut(50,function(){h.element.trigger("hide-animation-done");
if(h.options.destroyOnClose){h.destroy()}});h.element.trigger("hide")},size:function(p){var o=this._dataTrees;if(p===f){var m=0;for(var n=0,h=o.length;n<h;n++){m+=o[n].size}return m}else{if(p<0||p>=o.length){throw new Error("Index out of bounds for subtree: "+p)}return o[p].size}},insert:function(o,p,q,m){p=p||0;var h=this._dataTrees[p];var n=this._cloneAndSanitize(o);var l=this._insertHelper(h,n,0,q,m);if(l){h.size+=1+n.size}this._updateFocusables();return l},setSelected:function(o){this.options.selectedId=o;
var n=this._dataTrees;this._menu.find(".ui-picker-item").removeClass("ui-picker-item-selected");for(var m=0,h=n.length;m<h;m++){this._setSelected(o,n[m])}},setEnabled:function(h,l){if(l){this._traverse(function(m,n){if(m.id===n.id){if(h){m.li.removeClass("ui-picker-item-disabled").addClass("ui-picker-item-enabled")}else{m.li.removeClass("ui-picker-item-enabled").addClass("ui-picker-item-disabled")}}},{id:l})}else{if(h){this._menu.find(".ui-picker-item-disabled").removeClass("ui-picker-item-disabled").addClass("ui-picker-item-enabled")
}else{this._menu.find(".ui-picker-item-enabled").removeClass("ui-picker-item-enabled").addClass("ui-picker-item-disabled")}}this._focusables=null},containsName:function(o,m,q){var n;if(q===f){n=this._dataTrees}else{n=[this._dataTrees[q]]}if(!m){o=o.toLowerCase()}for(var p=0,h=n.length;p<h;p++){if(this._containsName(n[p],o,m)){return true}}return false},getPathString:function(h){if(h===f){h="/"}var l=this._menu.find(".ui-picker-item-selected").data("ui-picker-item");var m=[];while(l){if(!l.isRoot){m.unshift(l.name)
}l=l.parent}return m.join(h)},scrollTo:function(p,o){var m;if(o===f){m=this._dataTrees}else{m=[this._dataTrees[o]]}for(var n=0,h=m.length;n<h;n++){if(this._scrollTo(m[n],p)){return true}}return false},_traverse:function(p,o,q){var m;if(q===f){m=this._dataTrees}else{m=[this._dataTrees[q]]}for(var n=0,h=m.length;n<h;n++){if(this._traverseTree(m[n],p,o)){return true}}return false},_traverseTree:function(m,r,q){var h=r(m,q);if(h){return true}var p=m.children;if(p){for(var o=0,n=p.length;o<n;o++){if(this._traverseTree(p[o],r,q)){return true
}}}return false},_setOption:function(h,l){switch(h){case"footer":this._setFooter(l);break;default:if(options[h]){throw new Error("Option '"+h+"' cannot be changed")}else{throw new Error("Option '"+h+"' does not exist")}break}this.options[h]=l},_scrollTo:function(h,s){if(s===h.id){var r=this._menu;var p=h.li;var q=r.find(".ui-picker-tree-group");q.scrollTop(0);q.scrollTop(p.position().top-(q.height()-p.height())/2);return true}var o=h.children;if(o){for(var n=0,m=o.length;n<m;n++){if(this._scrollTo(o[n],s)){return true
}}}return false},_containsName:function(h,o,n){if(n){if(h.name===o){return true}}else{if(h.name&&h.name.toLowerCase()===o){return true}}var q=h.children;if(q){for(var p=0,m=q.length;p<m;p++){if(this._containsName(q[p],o,n)){return true}}}return false},_insertHelper:function(z,o,t,u,q){var n=z.children;if(!u||u==z.id){o.parent=z;var A=z.li;if(!z.isRoot){A.removeClass("ui-picker-item-child").addClass("ui-picker-item-parent")}var w=z.ul;if(!w){w=z.ul=e('<ul class="ui-picker-item-group"/>').insertAfter(element)
}var v=this._buildTree(o,t+1);if(q===f){var x=o.name.toLowerCase();var r=0,y=n.length-1;while(r<y){q=Math.floor((r+y)/2);var h=n[q].name.toLowerCase();if(x<h){y=q}else{r=q+1}}q=Math.floor((r+y)/2);if(x>n[q].name.toLowerCase()){q++}}if(q<=0){n.splice(0,0,o);w.prepend(v)}else{if(q>=n.length){n.push(o);w.append(v)}else{n.splice(q,0,o);w.children(":eq("+q+")").before(v)}}return true}else{if(n){for(var s=0,p=n.length;s<p;s++){var m=n[s];if(this._insertHelper(m,o,t+1,u,q)){m.size+=1+o.size;return true}}}return false
}},_setSelected:function(q,p){if(p.id==q){var h=p.li;if(h){h.addClass("ui-picker-item-selected")}}var o=p.children;if(o){for(var n=0,m=o.length;n<m;n++){this._setSelected(q,o[n])}}},_buildMenu:function(){var y=this;var l=y._menu=e('<div class="ui-picker"/>');var r=e('<div class="ui-picker-not-footer"/>').appendTo(l);var A=y.options;var m=A.useSpacers;var n=y._dataTrees=[];if(y.options.theme!="none"){l.addClass(A.theme)}l.on("click.picker",function(B){B.stopPropagation()});l.on("click.picker",".ui-picker-item-selectable.ui-picker-item-enabled",function(B){y._itemSelect(this,B)
});l.on("mouseenter",".ui-picker-item-selectable.ui-picker-item-enabled",function(){l.find(".ui-picker-highlighted").removeClass("ui-picker-highlighted")});if(A.search){var x=y._buildSearchBar();r.append(x)}var w=y._noResultsDiv=e('<div class="ui-picker-no-results" style="display: none"/>').appendTo(r);w.html(A.noResultsText);var h=y._treesHolder=e('<div class="ui-picker-tree-group"/>').appendTo(r);for(var p=1;true;p++){var q=y.options["data"+p];var o=y.options["dataOptions"+p];if(!q){break}if(m&&p>1){h.append('<div class="ui-picker-spacer"/>')
}var v;if(!q.children){v={id:"__root",name:"__root",children:q}}else{v=q}var u=y._cloneAndSanitize(v);if(o&&o.none){u.children=u.children||[];u.children.unshift({id:A.noneId,name:A.noneName,category:"",selectable:true})}u.isRoot=true;n.push(u);var s=u.ul=e('<ul class="ui-picker-item-group"/>');var z=y._buildTree(u,0);s.append(z);var t=e('<div class="ui-picker-tree-wrapper"/>').append(s);h.append(t)}if(y._hasCategories){l.addClass("ui-picker-contains-categories")}r.append('<div class="ui-picker-spacer ui-picker-footer-spacer"/>');
l.append('<div class="ui-picker-footer"/>');this._setFooter(A.footer);e(document.body).append(l)},_setFooter:function(l){var h=this._menu;if(l){h.find(".ui-picker-footer-spacer").show();h.find(".ui-picker-footer").show().html(l)}else{h.find(".ui-picker-footer-spacer").hide();h.find(".ui-picker-footer").hide()}},_bindMenuKeyHandler:function(){var h=this;var l=h._menu;l.on("keydown",".ui-picker-not-footer",function(p){switch(p.which){case 9:var n=e(":focus");if(p.shiftKey){if(n.is(".ui-picker-search, .ui-picker-item-anchor")){p.stopPropagation();
p.preventDefault()}}else{if(n.is(".ui-picker-item-anchor, .ui-picker-search-clear-button")){p.stopPropagation();p.preventDefault()}}break;case 13:e(".ui-picker-highlighted").trigger("click");break;case 27:h._returnFocus();p.stopPropagation();p.preventDefault();break;case 38:var q=h._getFocusables().filter(":visible");var o=q.index(e(":focus"));var m=q[o-1];if(m!=f){m=e(m);if(m.hasClass("ui-picker-item-anchor")){m.focus()}else{h._input.focus()}}l.find(".ui-picker-highlighted").removeClass("ui-picker-highlighted");
p.stopPropagation();p.preventDefault();break;case 40:var q=h._getFocusables().filter(":visible");var n=e(":focus");var o=q.index(n)+1;if(n.is(".ui-picker-search")){o++}var m=q.slice(o,o+1).filter(".ui-picker-item-anchor").focus();l.find(".ui-picker-highlighted").removeClass("ui-picker-highlighted");p.stopPropagation();p.preventDefault();break;default:break}})},_getFocusables:function(){if(!this._focusables){this._updateFocusables()}return this._focusables},_updateFocusables:function(){this._focusables=e(".ui-picker-item-enabled .ui-picker-item-anchor, .ui-picker-search, .ui-picker-search-clear-button")
},_returnFocus:function(){var h=this._storedFocus;if(h){h.focus();this.hide()}else{throw new Error("No focus was stored")}},_cloneAndSanitize:function(r){if(typeof r!=="object"){r={id:r,name:r}}var m=r.id+"";var h=r.name+"";var n=r.category?r.category+"":"";var v=r.selectable;if(v!==f){v=v?true:false}var w={id:m,name:h,category:n,selectable:v};var p=r.children;if(p&&p.length){var q=[];for(var t=0,s=p.length;t<s;t++){var o=p[t];while(e.isArray(o)){Array.prototype.splice.apply(p,[t,1].concat(o));o=p[t];
s=p.length}var u=this._cloneAndSanitize(o);u.parent=w;q.push(u)}w.children=q}return w},_buildSearchBar:function(){var l=this;var h=l._input=e('<input type="text" placeholder="'+l.options.searchPlaceholder+'" class="ui-picker-search"/>');var n=e('<div class="ui-picker-search-wrapper"/>');var m=e('<button class="ui-picker-search-clear-button ui-picker-search-clear-button-empty"></button>');n.append(this._buildIEPlaceholder(h,l.options.searchPlaceholder));n.append(h);n.append(m);h.on("change input keyup",function(){var o=e(this);
if(o.val()){m.removeClass("ui-picker-search-clear-button-empty").addClass("ui-picker-search-clear-button-full")}else{m.addClass("ui-picker-search-clear-button-empty").removeClass("ui-picker-search-clear-button-full")}clearTimeout(l._searchTimer);l._searchTimer=setTimeout(function(){var q=o.val();var p=l._treesHolder;if(q){p.css("height",p.css("height"))}else{p.css("height","")}l._filter(q)},200)});m.on("click",function(o){h.val("");h.focus();h.trigger("change");l._filter("");m.addClass("ui-picker-search-clear-button-empty").removeClass("ui-picker-search-clear-button-full");
o.stopPropagation();o.preventDefault()});m.on("keydown",function(o){o.stopPropagation()});return n},_buildTree:function(n,p){var t="";var r="";if(!n.isRoot){t=this._buildItem(n,p)}var m=n.children;var u=0;if(m){r=n.ul=e('<ul class="ui-picker-item-group"/>');for(var q=0,o=m.length;q<o;q++){var h=m[q];var s=this._buildTree(h,p+1);u+=1+h.size;r.append(s)}}n.size=u;return e(t).add(r)},_buildItem:function(u,s){var n=u.id;var m=u.name;var o=u.category;var h="ui-picker-item-selectable ui-picker-item-enabled";
var t=true;var v=m;if(o){v+=" / "+o}if(u.children){if(!this.options.allSelectable||u.selectable===false){h="ui-picker-item-unselectable";t=false}}else{if(u.selectable===false){h="ui-picker-item-unselectable";t=false}}var l="ui-picker-item-child";if(u.children){l="ui-picker-item-parent"}var p="";for(var r=0;r<s-1;r++){p+='<span class="ui-picker-item-indent"/>'}var q=u.li=e('<li class="ui-picker-item '+l+" "+h+'"/>');q.attr("Title",v);q.append('<span class="ui-picker-item-name-wrapper">'+p+'<span class="ui-picker-item-name">'+u.name+"</span></span>");
if(t){q.wrapInner('<a class="ui-picker-item-anchor" href="#" onclick="return false"/>')}if(o){this._hasCategories=true;q.append('<span class="ui-picker-item-category">'+u.category+"</span>")}if(n==this.options.noneId){q.addClass("ui-picker-item-none")}if(n==this.options.selectedId){q.addClass("ui-picker-item-selected")}q.data("ui-picker-item",u);return q},_itemSelect:function(h,n){h=e(h);var o=h.data("ui-picker-item");var p=o.id;var l=o.name;var m=o.category;this.setSelected(p);this.hide();this._returnFocus();
this.element.trigger("select",{id:p,name:l,category:m})},_setVisibility:function(m,q,r){var s=false;var p=m.children;if(p){for(var o=0,n=p.length;o<n;o++){s=this._setVisibility(p[o],q)||s}}var h=m.li;if(r){h.show();h.find(".ui-picker-item-name").html(m.name);h.find(".ui-picker-item-category").html(m.category);return true}else{if(m.name.match(q)||m.category.match(q)){h.show();h.next("ul").find(".ui-picker-item").show();h.find(".ui-picker-item-name").html(m.name.replace(q,'<mark class="ui-picker-mark">$1</mark>'));
h.find(".ui-picker-item-category").html(m.category.replace(q,'<mark class="ui-picker-mark">$1</mark>'));return true}else{if(s){h.show();h.find(".ui-picker-item-name").html(m.name.replace(q,'<mark class="ui-picker-mark">$1</mark>'));h.find(".ui-picker-item-category").html(m.category.replace(q,'<mark class="ui-picker-mark">$1</mark>'));return true}else{m.li.hide();h.find(".ui-picker-item-name").html(m.name);h.find(".ui-picker-item-category").html(m.category);return false}}}},_filter:function(r){if(r==this._previousFilterString||r===""&&this._previousFilterString==f){return
}else{this._previousFilterString=r}var m=new Date().getTime();var h=this._menu;var u=this._dataTrees;var q=false;for(var p=0,n=u.length;p<n;p++){for(var o=0,t=u[p].children,s=t.length;o<s;o++){q|=this._setVisibility(t[o],new RegExp("("+r+")","ig"),r==="")}}e(".ui-picker-highlighted").removeClass("ui-picker-highlighted");if(q){this._menu.find(".ui-picker-item-selectable.ui-picker-item-enabled:visible").first().addClass("ui-picker-highlighted");this._noResultsDiv.hide()}else{this._noResultsDiv.show()
}this._calcRenderPosition(parseInt(h.css("left")),parseInt(h.css("top")));this._handleIERenderBug();window.console&&console.log("Search took "+(new Date().getTime()-m)+"ms")},_calcRenderPosition:function(q,p){var m=document.body.scrollLeft||document.documentElement.scrollLeft;var l=document.body.scrollTop||document.documentElement.scrollTop;q-=m;p-=l;var h=this._menu;var s=h.outerWidth(true);var r=h.outerHeight(true);var o=e(window).width();var n=e(window).height();if(q+s>o){q=Math.max(m,m+o-s)}else{q=q+m
}if(r>n){p=l}else{if(p+r>n){p=l+p-r;if(p<l){p=l+n-r}}else{p=p+l}}h.css("left",q);h.css("top",p)},_handleIERenderBug:function(){var h=e('<div style="margin: 0; padding: 0; width: 100%; height: 100%; position: fixed; z-index: 10000; background: rgba(255, 0, 0, 0)"/>');e("body").append(h);setTimeout(function(){h.remove()},1)},_buildIEPlaceholder:function(l,m){if(c){if("placeholder" in document.createElement("input")){l.attr("placeholder","")}var h=e('<div style="position: absolute; top: 4px; left: 6px; color: #999"/>').disableSelection().css("webkit-user-select","none");
function n(){if(l.val().length){h.html("")}else{h.html(m)}}l.on("change input keyup",n);n();return h}else{return""}}})})(jQuery);Date.$VERSION=1.02;Date.LZ=function(c){return(c<0||c>9?"":"0")+c};Date.monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");Date.monthAbbreviations=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Date.dayNames=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
Date.dayAbbreviations=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");Date.preferAmericanFormat=true;if(!Date.prototype.getFullYear){Date.prototype.getFullYear=function(){var c=this.getYear();return(c<1900?c+1900:c)}}Date.parseString=function(L,E){if(typeof(E)=="undefined"||E==null||E==""){var s=new Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d","MMM-d","d-MMM");var f=new Array("M/d/y","M-d-y","M.d.y","M/d","M-d");var r=new Array("d/M/y","d-M-y","d.M.y","d/M","d-M");var h=new Array(s,Date.preferAmericanFormat?f:r,Date.preferAmericanFormat?r:f);
for(var C=0;C<h.length;C++){var A=h[C];for(var B=0;B<A.length;B++){var F=Date.parseString(L,A[B]);if(F!=null){return F}}}return null}this.isInteger=function(d){for(var c=0;c<d.length;c++){if("1234567890".indexOf(d.charAt(c))==-1){return false}}return true};this.getInt=function(N,y,M,l){for(var c=l;c>=M;c--){var d=N.substring(y,y+c);if(d.length<M){return null}if(this.isInteger(d)){return d}}return null};L=L+"";E=E+"";var K=0;var v=0;var H="";var n="";var J="";var p,o;var q=new Date().getFullYear();
var I=1;var G=1;var e=0;var D=0;var z=0;var u="";while(v<E.length){H=E.charAt(v);n="";while((E.charAt(v)==H)&&(v<E.length)){n+=E.charAt(v++)}if(n=="yyyy"||n=="yy"||n=="y"){if(n=="yyyy"){p=4;o=4}if(n=="yy"){p=2;o=2}if(n=="y"){p=2;o=4}q=this.getInt(L,K,p,o);if(q==null){return null}K+=q.length;if(q.length==2){if(q>70){q=1900+(q-0)}else{q=2000+(q-0)}}}else{if(n=="MMM"||n=="NNN"){I=0;var t=(n=="MMM"?(Date.monthNames.concat(Date.monthAbbreviations)):Date.monthAbbreviations);for(var C=0;C<t.length;C++){var m=t[C];
if(L.substring(K,K+m.length).toLowerCase()==m.toLowerCase()){I=(C%12)+1;K+=m.length;break}}if((I<1)||(I>12)){return null}}else{if(n=="EE"||n=="E"){var t=(n=="EE"?Date.dayNames:Date.dayAbbreviations);for(var C=0;C<t.length;C++){var w=t[C];if(L.substring(K,K+w.length).toLowerCase()==w.toLowerCase()){K+=w.length;break}}}else{if(n=="MM"||n=="M"){I=this.getInt(L,K,n.length,2);if(I==null||(I<1)||(I>12)){return null}K+=I.length}else{if(n=="dd"||n=="d"){G=this.getInt(L,K,n.length,2);if(G==null||(G<1)||(G>31)){return null
}K+=G.length}else{if(n=="hh"||n=="h"){e=this.getInt(L,K,n.length,2);if(e==null||(e<1)||(e>12)){return null}K+=e.length}else{if(n=="HH"||n=="H"){e=this.getInt(L,K,n.length,2);if(e==null||(e<0)||(e>23)){return null}K+=e.length}else{if(n=="KK"||n=="K"){e=this.getInt(L,K,n.length,2);if(e==null||(e<0)||(e>11)){return null}K+=e.length;e++}else{if(n=="kk"||n=="k"){e=this.getInt(L,K,n.length,2);if(e==null||(e<1)||(e>24)){return null}K+=e.length;e--}else{if(n=="mm"||n=="m"){D=this.getInt(L,K,n.length,2);if(D==null||(D<0)||(D>59)){return null
}K+=D.length}else{if(n=="ss"||n=="s"){z=this.getInt(L,K,n.length,2);if(z==null||(z<0)||(z>59)){return null}K+=z.length}else{if(n=="a"){if(L.substring(K,K+2).toLowerCase()=="am"){u="AM"}else{if(L.substring(K,K+2).toLowerCase()=="pm"){u="PM"}else{return null}}K+=2}else{if(L.substring(K,K+n.length)!=n){return null}else{K+=n.length}}}}}}}}}}}}}}if(K!=L.length){return null}if(I==2){if(((q%4==0)&&(q%100!=0))||(q%400==0)){if(G>29){return null}}else{if(G>28){return null}}}if((I==4)||(I==6)||(I==9)||(I==11)){if(G>30){return null
}}if(e<12&&u=="PM"){e=e-0+12}else{if(e>11&&u=="AM"){e-=12}}return new Date(q,I-1,G,e,D,z)};Date.isValid=function(d,c){return(Date.parseString(d,c)!=null)};Date.prototype.isBefore=function(c){if(c==null){return false}return(this.getTime()<c.getTime())};Date.prototype.isAfter=function(c){if(c==null){return false}return(this.getTime()>c.getTime())};Date.prototype.equals=function(c){if(c==null){return false}return(this.getTime()==c.getTime())};Date.prototype.equalsIgnoreTime=function(e){if(e==null){return false
}var d=new Date(this.getTime()).clearTime();var c=new Date(e.getTime()).clearTime();return(d.getTime()==c.getTime())};Date.prototype.format=function(L){L=L+"";var r="";var B=0;var O="";var n="";var q=this.getYear()+"";var o=this.getMonth()+1;var N=this.getDate();var u=this.getDay();var t=this.getHours();var D=this.getMinutes();var w=this.getSeconds();var z,A,f,x,P,l,J,I,F,v,R,t,Q,p,e,G;var C=new Object();if(q.length<4){q=""+(+q+1900)}C.y=""+q;C.yyyy=q;C.yy=q.substring(2,4);C.M=o;C.MM=Date.LZ(o);C.MMM=Date.monthNames[o-1];
C.NNN=Date.monthAbbreviations[o-1];C.d=N;C.dd=Date.LZ(N);C.E=Date.dayAbbreviations[u];C.EE=Date.dayNames[u];C.H=t;C.HH=Date.LZ(t);if(t==0){C.h=12}else{if(t>12){C.h=t-12}else{C.h=t}}C.hh=Date.LZ(C.h);C.K=C.h-1;C.k=C.H+1;C.KK=Date.LZ(C.K);C.kk=Date.LZ(C.k);if(t>11){C.a="PM"}else{C.a="AM"}C.m=D;C.mm=Date.LZ(D);C.s=w;C.ss=Date.LZ(w);while(B<L.length){O=L.charAt(B);n="";while((L.charAt(B)==O)&&(B<L.length)){n+=L.charAt(B++)}if(typeof(C[n])!="undefined"){r=r+C[n]}else{r=r+n}}return r};Date.prototype.getDayName=function(){return Date.dayNames[this.getDay()]
};Date.prototype.getDayAbbreviation=function(){return Date.dayAbbreviations[this.getDay()]};Date.prototype.getMonthName=function(){return Date.monthNames[this.getMonth()]};Date.prototype.getMonthAbbreviation=function(){return Date.monthAbbreviations[this.getMonth()]};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};Date.prototype.add=function(c,e){if(typeof(c)=="undefined"||c==null||typeof(e)=="undefined"||e==null){return this
}e=+e;if(c=="y"){this.setFullYear(this.getFullYear()+e)}else{if(c=="M"){this.setMonth(this.getMonth()+e)}else{if(c=="d"){this.setDate(this.getDate()+e)}else{if(c=="w"){var d=(e>0)?1:-1;while(e!=0){this.add("d",d);while(this.getDay()==0||this.getDay()==6){this.add("d",d)}e-=d}}else{if(c=="h"){this.setHours(this.getHours()+e)}else{if(c=="m"){this.setMinutes(this.getMinutes()+e)}else{if(c=="s"){this.setSeconds(this.getSeconds()+e)}}}}}}}return this};Date.prototype.diff=function(d,e){var c="d";if(e){c=e
}var f=Math.abs((this.getTime()-d.getTime())/1000);switch(c){case"s":return Math.floor(f);case"m":return Math.floor(f/60);case"h":return Math.floor(f/(60*60));case"w":return Math.floor(f/(60*60*24*7));case"d":return Math.floor(f/(60*60*24));case"M":return Math.floor(f/(60*60*24*30));case"Y":return Math.floor(f/(60*60*24*365));default:throw"Unknown difference unit specified."}};if(typeof(Amex)=="undefined"){var Amex={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45};
Amex.info="AMEX Global Namespace";Amex._internal={zindex:{flyout:4000,window:5000,pageOverlay:6001,modalWindow:7000,messageBox:9000},windows:{normalCount:0,modalCount:0,openModals:0},flyout:{openCount:0}}}Amex.Observable=function(c){if(typeof c!="undefined"){if(c instanceof jQuery){this.element=c}else{this.element=$("#"+c)}}};Amex.Observable.prototype={constructor:Amex.Observable,on:function(c,d){this.element.on("amex:"+c,d)},off:function(c,d){this.element.off("amex:"+c,d)},fire:function(c,e){var d={object:this};
if(typeof(e)!="undefined"){$.extend(d,e)}this.element.trigger("amex:"+c,d)}};if(typeof(Amex.Observable)=="undefined"){throw ("Amex.Container : error : This component requires Amex.Observable to be included.")}Amex.Container=function(c,d){if(arguments.length===0){return}this.element=null;this._content=null;this._focusable=d;this._focus=false;Amex.Observable.prototype.constructor.call(this,c);if(typeof(c)=="undefined"||c==null){this._content=$("<span/>")}else{this._content=this.element}this.element.identify();
this.setFocusable(d);if($.isFunction(this._keyEventHandler)){this._keyboardHandler=$.proxy(this._keyEventHandler,this);this.element.keydown(this._keyboardHandler)}};Amex.Container.prototype=$.extend(new Amex.Observable,{getId:function(){return this.element.identify()},getElement:function(){return this.element},render:function(d){var e;if($.isString(d)){e=$("#"+d)}else{e=$(d)}e.append(this.element);return this},getPosition:function(){return this.element.offset()},getStyle:function(c){return this.element.css(c)
},css:function(){return this.element.css.apply(this.element,arguments)},attr:function(){return this.element.attr.apply(this.element,arguments)},addClass:function(c){this.element.addClass(c)},removeClass:function(c){this.element.removeClass(c)},update:function(c){this._content.html(c);if(c instanceof jQuery){$(c).show()}this.setFocusable(this._focusable);return this},insertBefore:function(c){this._content.insertBefore(c)},append:function(c){return this._content.append(c)},prepend:function(c){return this._content.prepend(c)
},destroy:function(){if(this.element!=null&&this.element[0].parentNode!=null){this.element.remove()}delete (this._isA);delete (this.element);return this},show:function(){this.element.show()},hide:function(){this.element.hide()},toggle:function(){this.element.toggle()},isA:function(){return"Amex.Container"},block:function(){Amex.OverlayManager.init().block(this.element.attr("id"))},unblock:function(){Amex.OverlayManager.init().unblock(true,this.element.attr("id"))},visible:function(){return this.element.is(":visible")
},focus:function(){if(this._focus.length){if(null!=this._focus.get(0)){this._focus.get(0).focus()}this.fire("focus")}return this},blur:function(){if(this._focus){this._focus.blur();this.fire("blur")}},setFocusable:function(m){if(m){var f=this.element;var h=f.find(".focusNode");try{if(h.length){this._focus=h.eq(0)}else{if(this._canFocus()){this._focus=this.element}else{h=f.find("a[href], button");if(h.length){this._focus=h.eq(0)}}}}catch(l){}if(this._focus){var c=function(e){if(!this.inFocus){if(this._focus){this.inFocus=true;
this.focus()}}else{this.inFocus=false}};var d=function(e){if(this.inFocus){if(this._focus){this.inFocus=false;this.blur()}}else{this.inFocus=false}};this._focusHandler=$.proxy(c,this);this._blurHandler=$.proxy(d,this);this._focus.focus(this._focusHandler);this._focus.blur(this._blurHandler)}}else{this._focus=false}},isFocusable:function(){return(this._focus!=false)},_keyEventHandler:null,_canFocus:function(){if(this.element!=null){var c=this.element.prop("tagName");if("A"==c){return this.element.is("[href]")
}else{if("INPUT"==c){return !this.element.is(":hidden")}else{return(("BUTTON"==c)||("SELECT"==c))}}return false}}});Amex.Container.prototype.constructor=Amex.Container;if(typeof(Amex.Container)=="undefined"){throw ("Amex.BlockContainer : error : This component requires Amex.Container to be included.")}Amex.BlockContainer=function(c,d){if(arguments.length===0){return}if(typeof(c)=="undefined"||c==null){Amex.Container.prototype.constructor.call(this,$("<div/>"),d)}else{Amex.Container.prototype.constructor.call(this,c,d)
}};Amex.BlockContainer.prototype=$.extend(new Amex.Container,{constructor:Amex.BlockContainer,outerWidth:function(){return this.element.outerWidth()},outerHeight:function(){return this.element.outerHeight()},isA:function(){return"Amex.BlockContainer"}});Amex.BlockContainer.prototype.constructor=Amex.BlockContainer;if(typeof(Amex.BlockContainer)=="undefined"){throw ("Amex.FloatingContainer : error : Requires Amex.BlockContainer to be included.")}Amex.FloatingContainer=function(d,f){if(arguments.length===0){return
}this.options=d;Amex.BlockContainer.prototype.constructor.call(this,$("<div/>"),f);this.css({display:"none",position:"absolute",backgroundColor:"transparent",padding:0,margin:0,border:"none"});if($.isNumeric(this.options.top)&&$.isNumeric(this.options.bottom)){throw ("Amex.FloatingContainer : error : You canot give top & bottom options at the same time")}if($.isNumeric(this.options.left)&&$.isNumeric(this.options.right)){throw ("Amex.FloatingContainer : error : You canot give left & right options at the same time")
}if($.isNumeric(this.options.top)){this.element.css({top:this.options.top+"px"})}if($.isNumeric(this.options.left)){this.element.css({left:this.options.left+"px"})}if($.isNumeric(this.options.bottom)){this.element.css({bottom:this.options.bottom+"px"})}if($.isNumeric(this.options.right)){this.element.css({right:this.options.right+"px"})}if($.isUndefined($(document.body).css("boxShadow"))){if(!(typeof(this.options.shadow)=="undefined")&&this.options.shadow!=null){var c=$("<div/>");var e=this.options.shadow.size;
c.css({margin:e+"px 0 "+e+"px "+e+"px",padding:e+"px"});if($.isString(this.options.shadow.background)){c.css({background:this.options.shadow.background})}else{c.css({backgroundColor:this.options.shadow.color})}this._content=$("<div/>");this._content.css({margin:(-2*e)+"px 0 0 "+(-2*e)+"px",padding:0,border:"none"});c.append(this._content);this.element.append(c)}else{this._content=this.element}}this.render(document.body)};Amex.FloatingContainer.prototype=$.extend(new Amex.BlockContainer,{constructor:Amex.FloatingContainer,open:function(){if(!this.element.is(":visible")){if(this.options.openEffect&&$()[this.options.openEffect.name]){try{var c=this.options.openEffect.options;
var f=c.duration?c.duration:300;var d=[f];var h=c.easing;if(!(typeof h=="undefined")){d.push(h)}if(this._focus){d.push($.proxy(this._focus.get(0).focus,this._focus.get(0)))}this.element[this.options.openEffect.name].apply(this.element,d)}catch(e){this.element.show();this.focus()}}else{this.element.show();this.focus()}}return this},close:function(){if(this.element.is(":visible")){if(this.options.closeEffect&&$()[this.options.closeEffect.name]){try{var c=this.options.openEffect.options;var f=c.duration?c.duration:300;
var h=c.easing;var d=[f];if(!(typeof h=="undefined")){d.push(h)}this.element[this.options.closeEffect.name].apply(this.element,d)}catch(e){this.element.hide()}}else{this.element.hide()}}return this},toggle:function(){if(this.element.is(":visible")){this.close()}else{this.open()}},setPosition:function(d,c){this.element.css({top:d+"px",left:c+"px"});return this},setPositionRelative:function(m,d,f,h){var c;if(typeof f=="string"){c=$("#"+f)}else{c=$(f)}if(c.length){var l=c.position();var e=1;if($.browser.msie&&parseInt($.browser.version)==7&&c.hasClass("submenu")){var n=document.body.getBoundingClientRect();
e=(n.right-n.left)/document.body.clientWidth;l.top=l.top/e;l.left=l.left/e}if($.isString(h)){var o=h.toLowerCase();if(o=="tr"){l.left+=c.outerWidth()}else{if(o=="bl"){l.top+=c.outerHeight()}else{if(o=="br"){l.left+=c.outerWidth();l.top+=c.outerHeight();if(this.options.shadow&&!$.browser.msie){l.left+=this.options.shadow.size}}}}}this.element.css({top:l.top+m+"px",left:l.left+d+"px"})}return this},centerInViewport:function(){var c=((($(window).height()-this.outerHeight())/2)+$(window).scrollTop());
if(c<=0){c=1}this.css({left:((($(window).width()-this.outerWidth())/2)+$(window).scrollLeft())+"px",top:c+"px"});return this},centerAbove:function(e){var c=$(e);if(c!=null){var d=c.position();this.css({left:((d.left+c.outerWidth()-this.outerWidth())/2)+"px",top:((d.top+c.outerHeight()/2)-(this.outerHeight()/2))+"px",zIndex:c.css("zIndex")+1})}return this},isA:function(){return"Amex.FloatingContainer"}});Amex.FloatingContainer.prototype.constructor=Amex.FloatingContainer;if(typeof(Amex)=="undefined"){throw ("Amex.ToggleButton : error : This component requires Amex.js to be included.")
}Amex.ToggleButton=function(h,e){if(arguments.length===0){return}Amex.Container.prototype.constructor.call(this,h,true);this.options={};var m={normalClass:null,hoverClass:null,downClass:null,disableClass:null,downLabel:null,upLabel:null,downTitle:null,upTitle:null};$.extend(this.options,m,e||{});this.enabled=true;this._up=true;if(typeof(this.options.normalClass)=="undefined"||this.options.normalClass==null){this.options.normalClass=this.element.attr("class")}var l=function(o){Amex.Util.closeFlyouts();
obj=o.data;if(obj.enabled){obj.element.trigger("amex:click",{object:obj});if(obj._up){obj.down(true)}else{obj.up(true)}}};var f=function(o){obj=o.data;if(obj._up){obj.element.attr({"class":obj.options.normalClass})}else{obj.element.attr({"class":obj.options.downClass})}};var n=function(o){obj=o.data;if($.isString(obj.options.hoverClass)){obj.element.attr({"class":obj.options.hoverClass})}};var d=function(o){Amex.Util.closeFlyouts();obj=o.data;if(obj._up){obj.element.attr({"class":obj.options.downClass})
}else{obj.element.attr({"class":obj.options.normalClass});if(obj.options.upText!=null){obj.element.update=obj.options.upText}}};var c=function(o){obj=o.data;if(obj._up){obj.element.attr({"class":obj.options.normalClass})}else{obj.element.attr({"class":obj.options.downClass})}};this._mouseDown=d;this.element.on("mousedown",this,this._mousedown);this._mouseUp=c;this.element.on("mouseup",this,this._mouseUp);this._mouseOver=n;this.element.on("mouseenter",this,this._mouseOver);this._mouseOut=f;this.element.on("mouseleave",this,this._mouseOut);
this._click=l;this.element.on("click",this,this._click)};Amex.ToggleButton.prototype=$.extend(new Amex.Container,{constructor:Amex.ToggleButton,isA:function(){return"ToggleButton"},getElement:function(){return this.element},isUp:function(){return this._up},isDown:function(){return !this._up},getId:function(){return this.element.attr("id")},up:function(c){if(!this._up&&this.enabled){this._up=true;this.element.attr({"class":this.options.normalClass});if(this.options.downLabel!=null){this.element.html("<SPAN>"+this.options.downLabel+"</SPAN>");
this.element.attr({title:this.options.downTitle})}if(c){this.element.trigger("amex:up",{object:this})}}},down:function(c){if(this.enabled&&this._up){this._up=false;this.element.attr({"class":this.options.downClass});if(this.options.upLabel!=null){this.element.html("<SPAN>"+this.options.upLabel+"</SPAN>");this.element.attr({title:this.options.upTitle})}if(c){this.element.trigger("amex:down",{object:this})}}},enable:function(){if(!this.enabled){this.enabled=true;if(this._up){this.element.attr({"class":this.options.normalClass})
}else{this.element.attr({"class":this.options.downClass})}}},disable:function(){if(this.enabled){this.enabled=false;this.element.attr({"class":this.options.disableClass})}},setLabel:function(c){if($.isString(c)){this.element.children().eq(0).update(c)}},setClassNames:function(c){$.extend(this.options,c);if(this.enabled){if(this._up){this.element.attr({"class":this.options.normalClass})}else{this.element.attr({"class":this.options.downClass})}}else{this.element.attr({"class":this.options.disableClass})
}},destroy:function(){this.element.attr({"class":this.options.normalClass});this.element.off("mousedown",this._mousdown);delete (this._mousedown);this.element.off("mouseup",this._mouseup);delete (this._mouseup);this.element.off("mouseover",this._mouseover);delete (this._mouseover);this.element.off("mouseout",this._mouseout);delete (this._mouseout);this.element.off("click",this._click);delete (this._click)},show:function(){this.element.show()},hide:function(){this.element.hide()},focus:function(){Amex.Util.closeFlyouts();
if(this.element!=null){if($.isString(this.options.hoverClass)){this.element.attr({"class":this.options.hoverClass})}}},blur:function(){if(this._up){this.element.attr({"class":this.options.normalClass})}else{this.element.attr({"class":this.options.downClass})}}});Amex.ToggleButton.prototype.constructor=Amex.ToggleButton;ToggleButton=Amex.ToggleButton;if(typeof(Amex)=="undefined"){throw ("Amex.NavBar : error : This component requires Amex.js to be included.")}Amex.NavBar=function(){this.buttons=undefined;
this.selected=null};Amex.NavBar.prototype={constructor:Amex.NavBar,register:function(d){if(typeof(this.buttons)=="undefined"||!$.isArray(this.buttons)){this.buttons=[]}var c=function(h){var e=h.data.button;var f=h.data.bar;f.selected=e;var l=f.buttons;for(i=0;i<l.length;i++){if(l[i].getId()!=e.getId()){l[i].enable();l[i].up(false)}else{l[i].down(false);l[i].disable()}}};d._navBarListener=c;d.getElement().on("amex:click",{button:d,bar:this},d._navBarListener);this.buttons.push(d)},activateById:function(e,d){for(i=0;
i<this.buttons.length;i++){var c=this.buttons[i];if(c.getId()==e){if(c.isUp()){c.down(d);c.disable();this.selected=c}}else{c.enable();c.up(d)}}},getSelected:function(){return this.selected},destroy:function(){for(i=0;i<this.buttons.length;i++){var c=this.buttons[i];c.element.off("amex:down",c._navBarListener);delete (c._navBarListener)}delete (this.buttons)},isA:function(){return"Amex.NavBar"}};Amex.NavBar.prototype.constructor=Amex.NavBar;if(typeof(Amex.PageOverlay)=="undefined"){Amex.PageOverlay={ignoreHide:false}
}Amex.PageOverlay.init=function(f,d){if($.isUndefined(Amex.PageOverlay._element)){var e=$("<div/>").css({display:"none"});$(document.body).append(e);Amex.PageOverlay._element=e;Amex.PageOverlay.setStyle(f,d)}else{return Amex.PageOverlay}if($.browser.msie){var c=function(h){if(Amex.PageOverlay._element.is(":visible")){Amex.PageOverlay._prepareIE()}};$(window).on("resize.overlay",c)}Amex.PageOverlay._element.click(function(h){return false});return Amex.PageOverlay};Amex.PageOverlay.setStyle=function(e,c){if($.isUndefined(Amex.PageOverlay._element)){throw ("Amex.PageOverlay : error : The PageOverlay has to be initialized first. Please call Amex.PageOverlay.init(...) first.")
}var f={display:"none",top:0,left:0,width:"100%",height:"100%",zIndex:Amex._internal.zindex.pageOverlay};var d=$.extend(e,f);delete (d.right);delete (d.bottom);delete (d.visibility);if(!($.isString(d.background)||$.isString(d.backgroundColor)||$.isString(d.backgroundImage))){d.backgroundColor="#000000"}if(Amex.PageOverlay._element.is(":visible")){d.display=Amex.PageOverlay._element.css("display")}if($.browser.msie){d.position="absolute"}else{d.position="fixed"}Amex.PageOverlay._element.css(d);Amex.PageOverlay._element.css("opacity",$.isNumeric(c)?c:0.7);
return Amex.PageOverlay};Amex.PageOverlay.setIgnoreHide=function(c){Amex.PageOverlay.ignoreHide=c};Amex.PageOverlay.show=function(){if(!Amex.PageOverlay.showInProgress){Amex.PageOverlay.showInProgress=true;var c=Amex.PageOverlay;if($.isUndefined(c._element)){throw ("Amex.PageOverlay : error : The PageOverlay has to be initialized first. Please call Amex.PageOverlay.init(...) first.")}c._prepareIE();c._element.show();Amex.PageOverlay.showInProgress=false}return c};Amex.PageOverlay.hide=function(d){var c=Amex.PageOverlay;
if($.isUndefined(c._element)){throw ("Amex.PageOverlay : error : The PageOverlay has to be initialized first. Please call Amex.PageOverlay.init(...) first.")}if(!c.ignoreHide||d){c._element.hide()}return c};Amex.PageOverlay.enableAlertMode=function(){Amex.PageOverlay._element.css({zIndex:(Amex._internal.zindex.messageBox-4)})};Amex.PageOverlay.disableAlertMode=function(){Amex.PageOverlay._element.css({zIndex:Amex._internal.zindex.pageOverlay})};Amex.PageOverlay.toggle=function(){var c=Amex.PageOverlay;
if($.isUndefined(c._element)){throw ("Amex.PageOverlay : error : The PageOverlay has to be initialized first. Please call Amex.PageOverlay.init(...) first.")}if(c._element.is(":visible")){c.hide()}else{c.show()}return c};Amex.PageOverlay.destroy=function(){if(Amex.PageOverlay._element){if($.browser.msie){$(window).off("resize.overlay");if(Amex.PageOverlay._shim){Amex.PageOverlay._shim.destroy();delete (Amex.PageOverlay._shim)}}Amex.PageOverlay._element.remove();delete (Amex.PageOverlay._element)}};
Amex.PageOverlay.isActive=function(){return Amex.PageOverlay._element.is(":visible")};Amex.PageOverlay._prepareIE=function(){if($.browser.msie){var c=$(document).width();var d=$(document).body;if(c<$(document).prop("scrollWidth")){c=$(document).prop("scrollWidth")}var e=$(document).height();if(e<$(document).prop("scrollHeight")){e=$(document).prop("scrollHeight")}Amex.PageOverlay._element.css({height:e+"px",width:c+"px"})}};if(typeof(Amex.Container)=="undefined"){throw ("Amex.Crumb: error : This component requires Amex.Container to be included.")
}Amex.Crumb=function(e,d,c){this.key=e;this.label=d;this.options={};$.extend(this.options,c?c:{});Amex.Container.prototype.constructor.call(this,$("<a/>"));if(!$.isUndefined(this.options)&&$.isString(this.options.theme)){this.addClass(this.options.theme)}else{this.addClass("crumb")}this.element.html(this.label);this.enabled=true;var f=function(l){var h=l.data;if(h.enabled){h.element.trigger("amex:click",{object:h})}};this._onClick=f;this.element.on("click",this,this._onClick)};Amex.Crumb.prototype=$.extend(new Amex.Container,{constructor:Amex.Crumb,getKey:function(){return this.key
},disable:function(){this.enabled=false;if(!$.isUndefined(this.options)&&$.isString(this.options.disableClass)){this.element.addClass(this.options.disableClass)}else{this.element.addClass("disable")}},enable:function(){this.enabled=true;if(!$.isUndefined(this.options)&&$.isString(this.options.disableClass)){this.element.removeClass(this.options.disableClass)}else{this.element.removeClass("disable")}},destroy:function(){this.element.off("click",this._onClick);Amex.Container.prototype.destroy.call(this)
},isA:function(){return"Amex.Crumb"}});Amex.Crumb.prototype.constructor=Amex.Crumb;if(typeof(Amex.Crumb)=="undefined"){throw ("Amex.FilterBreadcrumb : error : This component requires Crumb.js to be included.")}Amex.FilterBreadcrumb=function(c){this.crumbs=[];Amex.Container.prototype.constructor.call(this,$("<span/>"));this.options=c;if(!$.isUndefined(this.options)&&$.isString(this.options.theme)){this.addClass(this.options.theme)}else{this.addClass("breadcrumb")}var d=function(l,f){l.stopPropagation();
var e=f.object;var h=l.data;h.remove(e)};this._onClick=d;this.element.on("amex:click",this,this._onClick);return this};Amex.FilterBreadcrumb.prototype=$.extend(new Amex.Container,{constructor:Amex.FilterBreadcrumb,add:function(c){var d=null;c._s=null;if($.isString(this.options.separator)&&this.crumbs.length>0){var d=$("<span/>");d.html(this.options.separator);this.append(d);c._s=d}this.crumbs.push(c);this.append(c.getElement());return this},remove:function(c){var e=null;if($.isString(c)){e=c}else{if(!$.isUndefined(c.getKey)){e=c.getKey()
}else{return this}}var d=-1;for(i=0;i<this.crumbs.length;i++){if(this.crumbs[i].getKey()==e){d=i;break}}if(d!=-1){var f=this.crumbs[d];if(f._s!=null){f._s.remove()}f.destroy();this.crumbs.splice(d,1);if(d==0&&this.crumbs.length>0){var h=this.crumbs[0];if(h._s!=null){h._s.remove();h._s=null}}this.element.trigger("amex:removed",{object:this,key:e})}return this},clear:function(d){for(i=this.crumbs.length-1;i>=0;i--){var c=this.crumbs[i];if(c._s!=null){c._s.remove()}c.destroy()}this.crumbs.length=0;if(d){this.element.trigger("amex:removed",{object:this})
}return this},getCrumbs:function(){return this.crumbs},getCrumb:function(d){var c=-1;for(i=0;i<this.crumbs.length;i++){if(this.crumbs[i].getKey()==d){c=i;break}}if(c!=-1){return this.crumbs[i]}else{return null}},destroy:function(){for(i=this.crumbs.length-1;i>=0;i--){crt=this.crumbs[i];if(crt._s!=null){crt._s.remove()}crt.destroy()}if(this.crumbs.length>0){this.element.trigger("amex:removed",{object:null})}delete (this.crumbs);this.element.off("amex:click",this._onClick);delete (this._onClick);Amex.Container.prototype.destroy.call(this);
delete (this.options)},isA:function(){return"Amex.FilterBreadcrumb"}});Amex.FilterBreadcrumb.prototype.constructor=Amex.FilterBreadcrumb;if(typeof(Amex.FilterBreadcrumb)=="undefined"){throw ("Amex.Breadcrumb : error : This component requires Breadcrumb.js to be included.")}Amex.Breadcrumb=function(c){Amex.FilterBreadcrumb.prototype.constructor.call(this,c)};Amex.Breadcrumb.prototype=$.extend(new Amex.FilterBreadcrumb,{constructor:Amex.Breadcrumb,add:function(c){var d=this.crumbs[this.crumbs.length-1];
if(!$.isUndefined(d)){d.enable()}Amex.FilterBreadcrumb.prototype.add.call(this,c);c.disable()},remove:function(c){var e=null;if($.isString(c)){e=c}else{if(!$.isUndefined(c.getKey)){e=c.getKey()}else{return this}}var d=-1;for(i=0;i<this.crumbs.length;i++){if(this.crumbs[i].getKey()==e){d=i;break}}if(d!=-1){var f=this.crumbs.splice(d,this.crumbs.length-d);for(i=f.length-1;i>=0;i--){crt=f[i];if(crt._s!=null){crt._s.remove()}crt.destroy()}if(this.crumbs.length>0){this.crumbs[this.crumbs.length-1].disable()
}this.element.trigger("amex:removed",{object:this})}return this},isA:function(){return"Amex.Breadcrumb"}});Amex.Breadcrumb.prototype.constructor=Amex.Breadcrumb;if(typeof(Amex.FloatingContainer)=="undefined"){throw ("Amex.Flyout : error : This component requires Amex.FloatingContainer to be included.")}Amex.Flyout=function(c,e){if(arguments.length===0){return}Amex.FloatingContainer.prototype.constructor.call(this,c,e);this.css({display:"none",position:"absolute",zIndex:Amex._internal.zindex.flyout+Amex._internal.flyout.openCount,backgroundColor:"transparent",padding:0,margin:0,border:"none"});
Amex._internal.flyout.openCount++;var d=function(f){Amex._internal.ignoreAutoClose=$(arguments[1]).attr("id")};this._onClick=function(f){d(f,this)};this.element.click(this._onClick)};Amex.Flyout.prototype=$.extend(new Amex.FloatingContainer,{constructor:Amex.Flyout,destroy:function(){this.element.off("click",this._onClick);if(this.options.autoClose&&!(typeof(Amex._internal.autoCloseFlyouts)=="undefined")){delete Amex._internal.autoCloseFlyouts[this.getId()]}},isA:function(){return"Amex.Flyout"},open:function(){if(this.options.autoClose){if(typeof(Amex._internal.autoCloseFlyouts)=="undefined"){Amex._internal.autoCloseFlyouts={};
Amex._internal.flyoutCloseListener=Amex.Flyout.autoCloseFlyouts;$(document).on("click",Amex._internal.flyoutCloseListener)}Amex._internal.autoCloseFlyouts[this.getId()]=this}Amex.FloatingContainer.prototype.open.call(this)},toggle:function(){if(this.options.autoClose){Amex._internal.ignoreAutoClose=this.getId()}else{Amex._internal.ignoreAutoClose=null}Amex.FloatingContainer.prototype.toggle.call(this)},setAutoClose:function(c){this.options.autoClose=c},close:function(){Amex.FloatingContainer.prototype.close.call(this);
if(this.options.autoClose&&!(typeof(Amex._internal.autoCloseFlyouts)=="undefined")){delete Amex._internal.autoCloseFlyouts[this.getId()]}},hide:function(){Amex.FloatingContainer.prototype.hide.call(this);if(this.options.autoClose&&!(typeof(Amex._internal.autoCloseFlyouts)=="undefined")){delete Amex._internal.autoCloseFlyouts[this.getId()]}}});Amex.Flyout.autoCloseFlyouts=function(){$.each(Amex._internal.autoCloseFlyouts,function(c,d){if(c!=Amex._internal.ignoreAutoClose){d.close();delete Amex._internal.autoCloseFlyouts[c]
}});Amex._internal.ignoreAutoClose=null};Amex.Flyout.prototype.constructor=Amex.Flyout;Amex.OverlayManager={init:function(c){Amex.OverlayManager.pWin=new Amex.Window({shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});Amex.OverlayManager.pWin.css({zIndex:Amex._internal.zindex.messageBox});Amex.OverlayManager.pWin.update(c);Amex.OverlayManager.pWin.render(document.body);c.show()},reposition:function(c){Amex.OverlayManager.pWin.centerInViewport();
return false},block:function(){Amex.PageOverlay.enableAlertMode();Amex.PageOverlay.show();Amex.OverlayManager.pWin.centerInViewport();Amex.OverlayManager.pWin.open();$(window).on("resize.manager",Amex.OverlayManager.reposition);return Amex.OverlayManager},unblock:function(c){$(window).off("resize.manager");Amex.OverlayManager.pWin.close();Amex.PageOverlay.hide();Amex.PageOverlay.disableAlertMode();return Amex.OverlayManager}};if(typeof(Amex.FloatingContainer)=="undefined"){throw ("Amex.Window : error : This component requires Amex.FloatingContainer to be included.")
}if(typeof(Amex.PageOverlay)=="undefined"){throw ("Amex.Window : error : This component requires Amex.PageOverlay to be included.")}Amex.Window=function(d){if(arguments.length===0){return}Amex.FloatingContainer.prototype.constructor.call(this,d,true);this._trigger=null;this._lastFocusNode=null;if(this.options.modal){if(this.options.zIndex){this.css({zIndex:this.options.zIndex})}else{this.css({zIndex:(Amex._internal.zindex.modalWindow+(Amex._internal.windows.modalCount*2))});Amex._internal.windows.modalCount++
}}else{this.css({zIndex:(Amex._internal.zindex.window+(Amex._internal.windows.normalCount*2))});Amex._internal.windows.normalCount++}var c=this.newContent();if($.isArray(this.options.buttons)){var f=c.find("[class='buttons']");var h=this.options.buttons;var e=this;$.each(h,function(o,m){var q;var l="";if("close"==m){q="Close this window";l="focusNode "}else{q=m}if($.browser.webkit){var n=$("<button/>").attr({title:q})}else{var n=$("<a/>").attr({title:q,href:"#"})}n.click(function(){return false});
n.addClass(l+m);var p=function(t){var r=t.data.object;var s=t.data.evType;r.element.trigger("amex:"+s,r)};n._click=p;n.on("click",{object:e,evType:m},n._click);if("close"==m){n.html("<span class='accessText'>"+e.options.title+", pop up layer. </span>close");e.element.on("amex:close",function(r,s){if($.isFunction(s.options.onClose)){if(s.options.onClose()==true){s.close()}else{r.stopPropagation();r.preventDefault()}}else{s.close()}})}else{if("minimize"==m){e.element.on("amex:minimize",function(r){r.data.object.minimize()
})}else{if("maximize"==m){e.element.on("amex:maximize",function(r){r.data.object.maximize()})}}}f.append(n)})}this.title=c.find("[class='titleText']");if(this.options.title!=null){this.title.html("<h2>"+this.options.title+"</h2>")}this._content.html(c);this._content=c.find("[class='content']");this._setFocusCycle();if(this.options.trigger){this.setTriggerNode(this.options.trigger)}if($.isUndefined(this.options.draggable)||this.options.draggable){this.element.draggable({handle:".title"})}};Amex.Window.prototype=$.extend(new Amex.FloatingContainer,{constructor:Amex.Window,newContent:function(){var c=$("<div/>");
c.addClass(this.options.theme);c.html("<table border='0' cellpadding='0' cellspacing='0'><tr class='title'><td scope='row' class='titleText' tabindex='1'></td><td class='buttons'></td></tr><tr><td colspan='2' scope='row' class='content' id=''></tr></table>");return c},open:function(){this.fire("open");if(this.options.modal&&!this.visible()){Amex._internal.windows.openModals++;Amex.PageOverlay.init().show();Amex.FloatingContainer.prototype.open.call(this)}else{if(!this.options.modal){Amex.FloatingContainer.prototype.open.call(this)
}}},close:function(){if(this.options.modal&&this.visible()){Amex._internal.windows.openModals--;if(Amex._internal.windows.openModals<=0){Amex.PageOverlay.init().hide();Amex._internal.windows.openModals=0}Amex.FloatingContainer.prototype.close.call(this)}else{if(!this.options.modal){Amex.FloatingContainer.prototype.close.call(this)}}if(this._trigger){this._trigger.focus()}},setTitle:function(c){this.title.html("<h2>"+c+"</h2>")},setOnClose:function(c){this.options.onClose=c},centerInViewport:function(){var f=1;
if($.browser.msie&&parseInt($.browser.version)==7){var c=document.body.getBoundingClientRect();f=(c.right-c.left)/document.body.clientWidth}var e=(($(window).width()/f)-this.element.outerWidth())/2+($(window).scrollLeft()/f);var d=(($(window).height()/f)-this.element.outerHeight())/2+($(window).scrollTop()/f);this.setPosition((d>0)?d:1,(e>0)?e:1)},update:function(c){Amex.FloatingContainer.prototype.update.call(this,c);this._setFocusCycle()},_setFocusCycle:function(d){if(this._lastFocusNode!=null){this._lastFocusNode.off("keydown")
}this._lastFocusNode=null;if(d){if($.isString(d)){this._lastFocusNode=$("#"+d)}else{this._lastFocusNode=$(d)}}else{var c=this._content.find(".lastFocus");if(c.length>0){this._lastFocusNode=c}}if(this._lastFocusNode){if(this._focus){this._shiftTabKeyListener=function(e){if((Amex.KEY_TAB==e.which)&&e.shiftKey){e.stopPropagation();e.preventDefault();this._lastFocusNode.focus()}};this._focus.keydown($.proxy(this._shiftTabKeyListener,this))}this._tabKeyListener=function(e){if((Amex.KEY_TAB==e.which)&&!e.shiftKey){e.stopPropagation();
e.preventDefault();this.focus()}};this._lastFocusNode.keydown($.proxy(this._tabKeyListener,this))}},setTriggerNode:function(c){this._trigger=($.isString(c)?$("#"+c):c);return this},isA:function(){return"Amex.Window"}});Amex.Window.fadeInEffect={name:"fadeIn",options:{duration:300}};Amex.Window.fadeOutEffect={name:"fadeOut",options:{duration:300}};Amex.Window.prototype.constructor=Amex.Window;if(typeof(Amex.Window)=="undefined"){throw ("Amex.ReceiptWindow : error : This component requires Amex.Window to be included.")
}Amex.ReceiptWindow=function(c){Amex.Window.prototype.constructor.call(this,c)};Amex.ReceiptWindow.prototype=$.extend(new Amex.Window,{constructor:Amex.ReceiptWindow,newContent:function(){var c=$("<div/>");c.addClass(this.options.theme);c.html("<div class='title'><div class='buttons'/></div><div class='content' id=''></div>");return c},close:function(){if(this.options.modal&&this.visible()){Amex._internal.windows.openModals--;Amex.PageOverlay.init().hide();Amex.FloatingContainer.prototype.close.call(this)
}else{if(!this.options.modal){Amex.FloatingContainer.prototype.close.call(this)}}if(this._trigger){this._trigger.focus()}},isA:function(){return"Amex.ReceiptWindow"}});Amex.ReceiptWindow.prototype.constructor=Amex.ReceiptWindow;Amex.MenuItem=function(h,e){if(arguments.length===0){return}Amex.BlockContainer.prototype.constructor.call(this,$("<li/>"),false);this.id=h;this._menu=null;this._parentMenu=null;this._enabled=true;this._selectable=false;this._hover=true;this.addClass("menuItem");this.element.html(e);
var f=function(n){var m=this;if(m._enabled){if(m._hover){m.addClass("hover")}var l=m._parentMenu;if(l!=null){l.closeSubmenus();if(l._crtHighItem!=null){l._crtHighItem.removeClass("hover")}l._crtHighIdx=m._index;if(!m._selectable){m.focus()}}if(m._menu!=null){m._menu.setPositionRelative(m._menu.options.top,m._menu.options.left,m.getElement(),"tr");m._menu.open()}}};var c=function(m){var l=this;if(l._enabled){l.removeClass("hover")}};var d=function(n){n.stopPropagation();var m=n.data;if(m._enabled){m.focus();
var l=m._parentMenu;if(m._menu!=null){n.preventDefault();if(l!=null){l.closeSubmenus()}m._menu.open()}else{if(l!=null){l.close();l.fire("click",{object:m})}}}else{n.preventDefault()}};this._mouseOver=$.proxy(f,this);this._mouseOut=$.proxy(c,this);this._click=d;this.element.hover(this._mouseOver,this._mouseOut);this.element.on("click",this,this._click);this.setFocusable(true)};Amex.MenuItem.prototype=$.extend(new Amex.BlockContainer,{constructor:Amex.MenuItem,isA:function(){return"Amex.MenuItem"},setMenu:function(c){this.addClass("submenu");
this._menu=c;this._menu.setParent(this)},getMenu:function(){return this._menu},getParent:function(){return this._parentMenu},setParent:function(c){this._parentMenu=c;return this},setEnabled:function(c){this._enabled=c;if(this._enabled){this.removeClass("disable")}else{this.addClass("disable")}return this},enable:function(){this.setEnabled(true);return this},disable:function(){this.setEnabled(false);return this},isEnabled:function(){return this._enabled},show:function(){Amex.BlockContainer.prototype.show.call(this);
if(this._parentMenu!=null){this._parentMenu._updateScroll(1)}return this},hide:function(){Amex.BlockContainer.prototype.hide.call(this);return this},focus:function(){Amex.BlockContainer.prototype.focus.call(this);if(this._enabled){if(this._hover){this.addClass("hover")}}var c=this._parentMenu;return this},showMenu:function(){if(this._enabled&&this._menu!=null){this._menu.open()}},hideMenu:function(){if(this._menu!=null){this._menu.close()}},isFocusable:function(){return((this._focus!=null)&&this.visible()&&this._enabled)
},_keyEventHandler:function(c){var e=this;var d=c.which;if(Amex.KEY_TAB==d){c.preventDefault();if(!e._selectable){if(c.shiftKey){e._parentMenu._focusPrev()}else{e._parentMenu._focusNext()}}else{}}else{if(Amex.KEY_RIGHT==d&&e._menu!=null){e.showMenu();e._menu.focus()}else{if(Amex.KEY_RETURN==d){if(e._menu!=null){e.showMenu();e._menu.focus()}else{if(e.parentMenu!=null){e._parentMenu.close();e._parentMenu.fire("click",{object:this})}}}}}}});Amex.MenuItem.prototype.constructor=Amex.MenuItem;Amex.MenuSeparator=function(c){Amex.BlockContainer.prototype.constructor.call(this,$("<li/>"),false);
this.element.attr("className","menuSeparator");this.update(c)};Amex.MenuSeparator.prototype=$.extend(new Amex.BlockContainer,{constructor:Amex.MenuSeparator,isFocusable:function(){return false},isA:function(){return"Amex.MenuSeparator"}});Amex.MenuSeparator.prototype.constructor=Amex.MenuSeparator;Amex.Menu=function(d,c){d.autoClose=true;d.position=d.position?d.position:"tr";Amex.Flyout.prototype.constructor.call(this,d);this._parent=null;this._visibleItems=0;this._crtHighIdx=-1;this._crtHighItem=null;
var h=$("<ul/>");h.addClass(this.options.theme);this.items=$.isUndefined(c)?[]:c;var f=this;$.each(this.items,function(l,m){m.setParent(f);m._index=l;if(m.isEnabled()){f._visibleItems++}if($.isNumeric(f.options.width)){m.css({width:f.options.width+"px"})}if((f.items.length-1)!=l){if(f.items[l+1].isA()=="Amex.MenuSeparator"){m.element.addClass("lastMenuItem")}}h.append(m.getElement())});var e=this.items[this.items.length-1];if(!(typeof(e)=="undefined")&&e.isA()!="Amex.MenuSeparator"){e.element.addClass("lastMenuItem")
}this._content.html(h);this._scrollDiv=this._content;this._updateScroll(0);this._content=h};Amex.Menu.prototype=$.extend(new Amex.Flyout,{constructor:Amex.Menu,_updateScroll:function(d){if(typeof(this.options.scroll)!="undefined"&&this.options.scroll!=null&&this.options.scroll.className){this._visibleItems=this._visibleItems+d;if(this._visibleItems<0){this._visibleItems=0}else{if(this._visibleItems>this.items.length){this._visibleItems=this.items.length}}var c=$.browser.mozilla?this.options.scroll.className+"FF":this.options.scroll.className;
if(this._visibleItems>this.options.scroll.visible){this._scrollDiv.addClass(c)}else{this._scrollDiv.removeClass(c)}}},isA:function(){return"Amex.Menu"},addItem:function(c){lastItem=this.items[this.items.length-1];if(typeof(lastItem)!="undefined"){lastItem.removeClass("lastItem")}c.setParent(this);this.items.push(c);this.append(c.getElement());this._updateScroll(1)},close:function(){Amex.Flyout.prototype.close.call(this);this.closeSubmenus();this.fire("menuclose");return this},closeSubmenus:function(){$.each(this.items,function(d,c){c.hideMenu()
});return this},open:function(){if(this._parent!=null){this.setPositionRelative(this.options.top,this.options.left,this._parent.getElement(),this.options.position)}Amex.Flyout.prototype.open.call(this);this.fire("open");return this},fire:function(c,d){if(this._parent!=null){this._parent.fire(c,d)}Amex.Flyout.prototype.fire.call(this,c,d);return this},setParent:function(c){this._parent=c;return this},getParent:function(){return this._parent},hideItem:function(d){var c=this;$.each(this.items,function(e,f){if(f.id==d&&f.visible()){f.hide();
c._updateScroll(-1);return false}});return this},showItem:function(d){var c=this;$.each(this.items,function(e,f){if(f.id==d&&!f.visible()){f.show();this._updateScroll(1);return false}});return this},focus:function(){this._crtHighIdx=-1;this._focusNextItem()},_keyEventHandler:function(c){var d=c.which;if(Amex.KEY_UP==d||Amex.KEY_DOWN==d||Amex.KEY_LEFT==d||Amex.KEY_RIGHT==d||Amex.KEY_TAB==d){c.stopPropagation();c.preventDefault()}var f=this;var e=f.items[f._crtHighIdx];if(Amex.KEY_DOWN==d){f._focusNextItem()
}else{if(Amex.KEY_UP==d){f._focusPrevItem()}else{if(Amex.KEY_LEFT==d&&f.options.position!="bl"){f.close();f._crtHighIdx=-1;if(f._parent!=null){f._parent.focus()}}else{if(Amex.KEY_ESC==d){f.close();f._crtHighIdx=-1;if(f._parent!=null){f._parent.focus()}else{if(f.options.nextFocus!=null){$("#"+f.options.nextFocus).focus()}}}else{if(Amex.KEY_TAB==d){if(f.options.nextFocus!=null){$("#"+f.options.nextFocus).focus()}}}}}}},_focusNextItem:function(){var d=this._crtHighIdx;var e=this.items;var c=e.length-1;
if(d<c){var f=false;while(d<c&&!f){if(e[++d].isFocusable()){f=true}}if(f){if(this._crtHighItem!=null){this._crtHighItem.removeClass("hover")}this._crtHighIdx=d;this._crtHighItem=e[d];e[d].focus()}}else{if(this._crtHighItem!=null){this._crtHighItem.removeClass("hover")}this._crtHighIdx=0;this._crtHighItem=this.items[0];this._crtHighItem.focus()}},_focusPrevItem:function(){var c=this._crtHighIdx;var d=this.items;if(c>0){var e=false;while(c>0&&!e){if(d[--c].isFocusable()){e=true}}if(e){if(this._crtHighItem!=null){this._crtHighItem.removeClass("hover")
}this._crtHighIdx=c;this._crtHighItem=d[c];d[c].focus()}}else{if(this._crtHighItem!=null){this._crtHighItem.removeClass("hover")}this._crtHighIdx=this.items.length-1;this._crtHighItem=this.items[this._crtHighIdx];this._crtHighItem.focus()}},_focusNext:function(){if(this._parent!=null){this._parent._focusNext()}else{if(this.options.nextFocus!=null){this.hide();if(typeof(this.options.nextFocus)=="string"){$("#"+this.options.nextFocus).focus()}else{this.options.nextFocus.focus()}}}},_focusPrev:function(){if(this._parent!=null){this._parent._focusPrev()
}else{if(this.options.prevFocus!=null){this.hide();if(typeof(this.options.prevFocus)=="string"){$("#"+this.options.prevFocus).focus()}else{this.options.prevFocus.focus()}}}}});Amex.Menu.prototype.constructor=Amex.Menu;Amex.MenuButton=function(d,c){if(arguments.length===0){return}Amex.ToggleButton.prototype.constructor.call(this,d,c,true);if(this.options.menu){this.options.menu.render(document.body);this.options.menu.setParent(this)}this._focusHandler=null;var e=function(h){var f=h.data;f.toggleMenu()
};this.element.off("click",this._click);this._click=e;this.element.on("click",this,this._click)};Amex.MenuButton.prototype=$.extend(new Amex.ToggleButton,{constructor:Amex.MenuButton,showMenu:function(){if(this.options.menu){this.options.menu.open()}return this},hideMenu:function(){if(this.options.menu){this.options.menu.close();this.focus()}return this},toggleMenu:function(){if(this.options.menu){if(this.options.menu.getElement().is(":visible")){this.options.menu.close()}else{Amex._internal.ignoreAutoClose=this.options.menu.getId();
this.options.menu.open()}}return this},focus:function(){Amex.Util.closeFlyouts();this._focus.focus();return this},getMenu:function(){return this.options.menu},setMenu:function(c){this.options.menu=c;return this},isA:function(){return"Amex.MenuButton"},_keyEventHandler:function(c){var d=c.which;if(d==Amex.KEY_UP||d==Amex.KEY_DOWN||d==Amex.KEY_SPACE||d==Amex.KEY_ESC||d==Amex.KEY_RETURN){c.stopPropagation();c.preventDefault()}var e=this;if(d==Amex.KEY_RETURN||d==Amex.KEY_SPACE||d==Amex.KEY_DOWN){e.showMenu();
e.getMenu().focus()}else{if(d==Amex.KEY_UP||d==Amex.KEY_ESC){e.hideMenu();this.focus()}}},_focusNext:function(){if(this.options.nextFocus!=null){this.hideMenu();if($.isString(this.options.nextFocus)){$("#"+this.options.nextFocus).focus()}else{this.options.nextFocus.focus()}}},_focusPrev:function(){if(this.options.prevFocus!=null){this.hideMenu();if($.isString(this.options.prevFocus)){$("#"+this.options.prevFocus).focus()}else{this.options.prevFocus.focus()}}}});Amex.MenuButton.prototype.constructor=Amex.MenuButton;
Amex.MessageBox={information:"information",msgConfirm:"confirm",_window:null,_layout:null,_options:null,_modal:null,_onClose:null,_icon:null,_text:null,_buttons:null,_defaultButton:null,holdElement:null};Amex.MessageBox.init=function(d,c){Amex.MessageBox._layout=d;Amex.MessageBox._options=c};Amex.MessageBox._init=function(e){if(Amex.MessageBox._options){Amex.MessageBox._options.modal=false;Amex.MessageBox._options.title=e}else{Amex.MessageBox._options={modal:false,title:e}}Amex.MessageBox._window=new Amex.Window(Amex.MessageBox._options);
var d=Amex.MessageBox._window;d.update(Amex.MessageBox._layout);d.css({zIndex:Amex._internal.zindex.messageBox});d.getElement().on("click",function(f){f.stopPropagation();f.preventDefault()});d.setOnClose(function(){if(Amex.MessageBox._modal){if(!Amex.MessageBox._overlayActive||Amex._internal.windows.openModals<=0){Amex.PageOverlay.hide()}Amex.PageOverlay.disableAlertMode()}if(Amex.MessageBox._defaultButton!=null){Amex.MessageBox._processButtonClick(Amex.MessageBox._defaultButton)}Amex.MessageBox._defaultButton==null;
return true});d.render(document.body);var c=d._content;Amex.MessageBox._icon=c.find(".amexMsgIcon:first");Amex.MessageBox._text=c.find(".amexMsgText:first");Amex.MessageBox._buttons=c.find("[class^=amexMsgButton]");Amex.MessageBox._buttons.each(function(f){var h=$(this);h.attr("_uid",h.attr("class").substring(13));h.on("click",Amex.MessageBox._buttonClick)})};Amex.MessageBox.show=function(q,s,o,r,n,l,p,h,f,e){if(Amex.MessageBox._window==null){Amex.MessageBox._init(q)}if(e==null){Amex.MessageBox._text.css({width:"500px"})
}else{Amex.MessageBox._text.css({width:e+"px"})}Amex.MessageBox._defaultButton=l;Amex.MessageBox._text.html(s);Amex.MessageBox._icon.attr({"class":o});Amex.MessageBox._modal=r;Amex.MessageBox._onClose=p;var m=Amex.MessageBox._buttons;var c=n;var d=null;m.each(function(w){var v=$(this);var u=v.attr("_uid");if($.inArray(u,c)!=-1){if("CONTINUE"==u){v.attr({title:h})}else{if("CONFIRM"==u){v.attr({title:h})}else{if("CANCEL"==u){v.attr({title:f})}}}var t=v.parent();if(t.is("span")){t.show();t.css({visibility:"visible"})
}else{v.show();v.css({visibility:"visible"})}d=v}else{var t=v.parent();if(t.is("span")){t.hide();t.css({visibility:"hidden"})}else{v.hide();v.css({visibility:"hidden"})}}});Amex.MessageBox._window._setFocusCycle(d);if(r){Amex.PageOverlay.enableAlertMode();Amex.MessageBox._overlayActive=Amex.PageOverlay.isActive();if(!Amex.MessageBox._overlayActive){Amex.PageOverlay.show()}}Amex.MessageBox._window.setTitle(q);Amex.MessageBox._window.centerInViewport();Amex.MessageBox._window.open()};Amex.MessageBox.setTriggerNode=function(c){if(c instanceof jQuery){c=c[0]
}if(Amex.MessageBox._window!=null){Amex.MessageBox._window.setTriggerNode(c)}};Amex.MessageBox.hide=function(){if(Amex.MessageBox._window!=null){Amex.MessageBox._window.close();Amex.MessageBox._window.setTriggerNode(null)}};Amex.MessageBox._buttonClick=function(d){d.stopPropagation();d.preventDefault();var c=$(d.target);while(c.length&&$.isUndefined(c.attr("_uid"))){c=c.parent()}Amex.MessageBox._processButtonClick(c.attr("_uid"));return false};Amex.MessageBox._processButtonClick=function(c){if(Amex.MessageBox._modal){if(!Amex.MessageBox._overlayActive||Amex._internal.windows.openModals<=0){Amex.PageOverlay.hide()
}Amex.PageOverlay.disableAlertMode()}Amex.MessageBox._defaultButton=null;Amex.MessageBox._window.close();if($.isFunction(Amex.MessageBox._onClose)){Amex.MessageBox._onClose.call(null,c);Amex.MessageBox._onClose=null}};Amex.MessageBox.alert=function(f,d,c,h,e){Amex.MessageBox.show(f,d,"msgIconAlert",c,["OK"],"OK",h,"","",e)};Amex.MessageBox.error=function(e,d,c,f){Amex.MessageBox.show(e,d,"msgIconAlert",c,["OK"],"OK",f,"","")};Amex.MessageBox.confirm=function(e,d,c,f){Amex.MessageBox.show(e,d,"msgIconQuestion",c,["YES","NO"],"NO",f,"","")
};Amex.MessageBox.confirmContinue=function(h,e,d,c,f,l){Amex.MessageBox.show(h,e,"msgIconQuestion",d,["CONTINUE","CANCEL"],"CANCEL",l,c,f)};Amex.MessageBox.confirmDelete=function(h,e,d,c,f,l){Amex.MessageBox.show(h,e,"msgIconQuestion",d,["CONFIRM","CANCEL"],"CANCEL",l,c,f)};Amex.Msg=Amex.MessageBox;Amex.Util={addScript:function(d,f){var e=$("head");if(e.length>0){var c=document.createElement("script");c.type="text/javascript";c.src=d;if(typeof(f)=="function"){if($.isUndefined(c.onreadystatechange)){c.onload=f
}else{c.onreadystatechange=f}}e.append(c)}},addStylesheet:function(c,f){var d=$("head");if(d.length>0){var e=document.createElement("link");e.type="text/css";e.rel="stylesheet";e.href=c;if(typeof(f)=="function"){if($.isUndefined(e.onreadystatechange)){e.onload=f}else{e.onreadystatechange=f}}d.append(e)}},setCookie:function(e,m,o){var f="";if(o){var n=new Date();n.setTime(n.getTime()+(o*1000));f="; expires="+n.toGMTString()}var l=document.domain.split(".");var c=l.length;var h=null;if(c==0){h=null
}else{if(c==1){h=l[0]}else{if(c==2){h=l[0]+"."+l[1]}else{h="."+l[c-2]+"."+l[c-1]}}}if(h){document.cookie=e+"="+m+f+"; path=/; domain="+h}else{document.cookie=e+"="+m+f+"; path=/"}},getCookie:function(e){var h=e+"=",d=document.cookie.split(";");for(var f=0,l;f<d.length;f++){l=d[f];while(l.charAt(0)==" "){l=l.substring(1,l.length)}if(l.indexOf(h)==0){return l.substring(h.length,l.length)}}return null},deleteCookie:function(c){Amex.Util.setCookie(c,"",-1)},showElements:function(){var c=$.makeArray(arguments);
$("#"+c.join(",#")).show()},hideElements:function(){var c=$.makeArray(arguments);$("#"+c.join(",#")).hide()},closeFlyouts:function(c){if(!$.isUndefined(Amex._internal.autoCloseFlyouts)){$.each(Amex._internal.autoCloseFlyouts,function(d,e){if(d!=Amex._internal.ignoreAutoClose){e.close();Amex._internal.autoCloseFlyouts.unset(d)}});Amex._internal.ignoreAutoClose=null}}};if($.isUndefined(Amex)){throw ("Des : error : Des namespace us based on classes in Amex namespace.")}if($.isUndefined(Des)){var Des={}
}Des.CardSelectItem=function(f,e,c){this.data=e;this.template=c;var d=c.process(this.data);Amex.MenuItem.prototype.constructor.call(this,f,d)};Des.CardSelectItem.prototype=$.extend(new Amex.MenuItem,{constructor:Des.CardSelectItem,setData:function(c){this.data=c},getData:function(){return this.data},isA:function(){return"Des.CardSelectItem"}});Des.CardSelectItem.prototype.constructor=Des.CardSelectItem;Des.CardSelectButton=function(e,d){d.normalClass=$("#"+e).attr("class");d.hoverClass=d.normalClass;
d.downClass=d.normalClass;d.disableClass=d.normalClass;var l=d.items;var c={};this.selected=null;this.suppLookup={};var f=this;$.each(l,function(n,m){var o=new Des.CardSelectItem(n,m,d.templates[m.template]);o.addClass(m.template+"Card");if(m.template!="supp"){if(n==0){o.css({borderTop:"none"})}var p=c[m.index];if($.isUndefined(p)){c[m.index]={main:o,supp:[]}}else{p.main=o}}else{var p=c[m.index];if($.isUndefined(p)){c[m.index]={main:null,supp:[o]}}else{p.supp.push(o)}}if(m.display==false){o.hide()
}if(m.selected){f.selected=o;o.addClass("selected")}});this.menuItems=c;d.menu=new Amex.Menu(d.menu);$.each(c,function(o,n){d.menu.addItem(n.main);if(n.supp.length>2){var m=new Amex.MenuItem("_x"+o,"<a href='#' onclick='return false;' title=''>Individual Cards on this Account</a>");m.addClass("suppCard");var p=new Amex.Menu({theme:"subcardSelectMenu",scroll:{className:"subcardScroll",visible:6},left:-10,top:0,position:"tr",columns:1,shadow:{size:4,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}},n.supp);
m.setMenu(p);p.render(d.menu.element);d.menu.addItem(m)}else{for(j=0;j<n.supp.length;j++){d.menu.addItem(n.supp[j])}}});Amex.MenuButton.prototype.constructor.call(this,e,d);this.name=this.getElement().find(".cardName").first();this.description=this.getElement().find(".description").first();var h=function(n){var p=this;var o=arguments[1].object.getData();var m=p.selected==null?null:p.selected.getData();if(m==null||m.index!=o.index||m.supp!=o.supp||o.index==-99){p.setSelected(arguments[1].object,true)
}};this._amexClick=h;this.options.menu.on("click",$.proxy(this._amexClick,this));if(this.selected!=null){var l=this.selected.getData();this.setLabel(l.description,l.account)}};Des.CardSelectButton.prototype=$.extend(new Amex.MenuButton,{constructor:Des.CardSelectButton,setLabel:function(c,d){this.name.html(c);this.description.html(d)},setSelected:function(c,e){if(this.selected!=null){this.selected.removeClass("selected")}c.addClass("selected");var d=c.getData();this.setLabel(d.description,d.account);
this.selected=c;if(e){this.fire("change",{object:d})}},selectByIndex:function(h,e,m){for(var l in this.menuItems){var d=this.menuItems[l];var c=d.main.getData();if(c.index==h){if($.isUndefined(e)||e.isBlank()){this.setSelected(d.main,m);return this}else{if(c.index==h&&c.supp==e){this.setSelected(d.main,m);return this}else{for(var f=0;f<d.supp.length;f++){if(d.supp[f].getData().supp==e){this.setSelected(d.supp[f],m);return this}}}}}}},hideByIndex:function(e,c){for(var f in this.menuItems){var h=this.menuItems[f];
if(h.main.getData().index==e){if($.isUndefined(c)||c.isBlank()){this.menuItems[f].main.hide();return this}else{for(var d=0;d<h.supp.length;d++){if(h.supp[d].getData().supp==c){h.supp[d].hide();return this}}}}}},showByIndex:function(d,c){for(var e in this.menuItems){var f=this.menuItems[e];if(f.main.getData().index==d){if($.isUndefined(c)||c.isBlank()){this.menuItems[e].main.show();return this}else{for(j=0;j<f.supp.length;j++){if(f.supp[j].getData().supp==c){f.supp[j].show();return this}}}}}},updateCancelled:function(c){if(c){var d=c;
var f=this.menuItems[this.getSelected().index].supp;this.options.menu._visibleItems=0;for(var e=0;e<f.length;e++){if($.inArray(f[e].data.supp,d)!=-1){f[e].show()}else{f[e].hide()}}}},getSelectedItem:function(){return this.selected},getSelected:function(){if(this.selected!=null){return this.selected.getData()}return null},append:function(d){var e=$("<tr/>");var c=$("<td/>");c.html(d);e.append(c);this.options.menu.append(e)},isA:function(){return"Des.CardSelectButton"}});Des.CardSelectButton.prototype.constructor=Des.CardSelectButton;
Des.PeriodSelectButton=function(d,c){c.normalClass=$("#"+d).attr("class");c.hoverClass=c.normalClass;c.downClass=c.normalClass;c.disableClass=c.normalClass;var h=c.items;this.selected=null;c.menu=new Amex.Menu(c.menu,[]);var e=this;$.each(h,function(q,m){var u=new Des.CardSelectItem(q,m,c.templates[m.template]);u.addClass(m.template);if(q==0){u.css({borderTop:"none"})}if(m.display==false){u.hide()}if(m.disabled){u.disable()}if(m.selected){e.selected=u;e.selected.addClass("selected")}var o=m.subMenu;
if(!$.isUndefined(o)&&o.length>0){var t=[];var s=o.length;for(var p=0;p<s;p++){var r=o[p];var n=new Des.CardSelectItem(p,r,c.templates[r.template]);t.push(n);if(r.selected){e.selected=n;n.addClass("selected")}}var l=new Amex.Menu({theme:"subPeriodMenu",left:-10,top:0,width:150,scroll:{className:"subPeriodScroll",visible:12},height:186,columns:1,shadow:{size:4,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}},t,"bl");u.setMenu(l);l.render(c.menu.element)
}c.menu.addItem(u)});Amex.MenuButton.prototype.constructor.call(this,d,c);this.name=this.getElement().find(".name").first();this.description=this.getElement().find(".description").first();var f=function(n,l){var m=this;var o=l.object.getData();if(m.selected==null||m.selected.getData().BPIndex!=o.BPIndex){m.setSelected(l.object);m.fire("change",{data:o})}};this._amexClick=f;this.options.menu.on("click",$.proxy(this._amexClick,this));if(this.selected!=null){var h=this.selected.getData();this.setLabel(h.name,h.description)
}};Des.PeriodSelectButton.prototype=$.extend(new Amex.MenuButton,{constructor:Des.PeriodSelectButton,setSelected:function(c){if(this.selected!=null){this.selected.removeClass("selected")}this.selected=c;this.selected.addClass("selected");var d=c.getData();this.setLabel(d.name,d.description)},getMenu:function(){return this.options.menu},setLabel:function(c,d){this.name.html(c);this.description.html(d)},selectByIndex:function(d,f){for(i=0;i<this.options.menu.items.length;i++){var e=this.options.menu.items[i];
var c=e.getData();if(c.BPIndex==d){if(f){e.fire("click",{object:e})}this.setSelected(e);break}}},selectByMultiCardIndex:function(f,m){for(i=0;i<this.options.menu.items.length;i++){var h=this.options.menu.items[i];var c=h.getData();if(h.getMenu()!=null){var d=h.getMenu().items;for(var e=0;e<d.length;e++){var n=d[e];var l=d[e].getData();if(l.multiCardBPIndex==f){this.setSelected(n)}}}}},hideByIndex:function(d){for(i=0;i<this.options.menu.items.length;i++){var e=this.options.menu.items[i];var c=e.getData();
if(c.BPIndex==d){e.data.display=false;e.hide();break}}},showByIndex:function(d){for(i=0;i<this.options.menu.items.length;i++){var e=this.options.menu.items[i];var c=e.getData();if(c.BPIndex==d){e.data.display=true;e.show();break}}},append:function(d){var c=$("<div/>");c.html(d);this.options.menu.append(c)},getSelected:function(){if(this.selected!=null){return this.selected.getData()}else{return null}},clearSelected:function(){if(this.selected!=null){this.selected.removeClass("selected");this.selected=null
}},isA:function(){return"Des.PeriodSelectButton"}});Des.PeriodSelectButton.prototype.constructor=Des.PeriodSelectButton;Des.CategoryButton=function(e,c){if(arguments.length===0){return}Amex.MenuButton.prototype.constructor.call(this,e,c);this.selectedId="";this.handler=this.element.find(".dropHandler").first();this.label=this.element.find(".label").first();this.element.off("click",this._click);this._amexClick=Des.amexClick;this.options.menu.on("click",$.proxy(Des.amexClick,this));var d=function(h){h.preventDefault();
var f=h.data;Amex._internal.ignoreAutoClose=f.options.menu.getId();Amex.Util.closeFlyouts();f.toggleMenu()};this._initial=true;this._initialClick=d;this._elementClick=d;this.element.on("click",this,this._elementClick)};Des.CategoryButton.prototype=$.extend(new Amex.MenuButton,{constructor:Des.CategoryButton,setLabel:function(c){this.label.html(c)},getLabel:function(){return this.label.html()},getSelectedId:function(){return this.selectedId},isA:function(){return"Des.CategoryButton"}});Des.amexClick=function(h,l){var d=this;
var e=l.object;var c=arguments[1].object.getElement().find("button").html();d.setLabel(c);if(d._initial){d.label.off("click",d._initialClick);delete (d._initialClick);var f=function(n){n.stopPropagation();n.preventDefault();var m=n.data;if(m.enabled&&m.isUp()){m.down(false);m.fire("click");return false}Amex._internal.ignoreAutoClose=m.options.menu.getId();Amex.Util.closeFlyouts();m.toggleMenu()};d._click=f;d.label.on("click",d,d._click);d.selectedId=e.id;d.reportType=e.id;d.down(false);d._initial=false;
d.fire("click")}else{if(d.isUp()){d.down(false);d.fire("click")}else{if(d.selectedId!=e.id){d.selectedId=e.id;d.reportType=e.id;d.down(false);d.fire("click")}else{d.fire("click")}}}};Des.CategoryButton.prototype.constructor=Des.CategoryButton;(function(d){d(window).resize(function(){d(".td-inner-wrapper").each(function(){var e=d(this);var m=e.parent();m.css("padding","");var q=m.css("paddingTop");var h=m.css("paddingRight");var f=m.css("paddingBottom");var l=m.css("paddingLeft");var n=m.css("overflow");
var o=m.css("textOverflow");var p="padding-top: "+q+"; padding-right: "+h+"; padding-bottom: "+f+"; padding-left: "+l+"; overflow: "+n+"; text-overflow: "+o+";";e.css({paddingTop:q,paddingRight:h,paddingBottom:f,paddingLeft:l,overflow:n,textOverflow:o});m.css("padding","0px")})});function c(e){e.find("td").each(function(){var n=d(this);var h=n.children();if(h.size()!=1||!h.hasClass("td-inner-wrapper")){var r=n.css("paddingTop");var l=n.css("paddingRight");var f=n.css("paddingBottom");var m=n.css("paddingLeft");
var o=n.css("overflow");var p=n.css("textOverflow");var q="padding-top: "+r+"; padding-right: "+l+"; padding-bottom: "+f+"; padding-left: "+m+"; overflow: "+o+"; text-overflow: "+p+";";n.wrapInner('<div class="td-inner-wrapper" style="'+q+'"/>');n.css("padding","0px")}})}d.fn.trSlideToggle=function(e){if(this.is(":hidden")){return this.trSlideDown(e)}else{return this.trSlideUp(e)}};d.fn.trSlideUp=function(h){if(!h){h=400}c(this);this.children().animate({opacity:0},h);var e=this.find(".td-inner-wrapper");
var f=this;return e.stop().slideUp(h,function(){f.hide()}).promise()};d.fn.trSlideDown=function(h){if(!h){h=400}c(this);var e=this.children();e.css({opacity:0});e.animate({opacity:1},h);this.show();var f=this.find(".td-inner-wrapper");f.hide();return f.stop().slideDown(h).promise()}})(jQuery);$.widget("amex.amexswiper",{options:{theme:"default",swipingTimer:1000,swipedir:"",startx:0,startX:0,startY:0,distX:0,distY:0,elapsedTime:0,startTime:0,boxleft:0,heightscrollcontent:0,dist:0},_create:function(){var e=this;
this.element.addClass("swiper-entry-holder");var f=this.element.children();f.addClass("swiper-entry");f.eq(0).addClass("visible");var h=this.element.wrap('<div class="swiper-viewport"/>').parent();var c=h.wrap('<div class="swiper-viewport-wrapper"/>').parent();var d=this.swiper=c.wrap('<div class="swiper"/>').parent();d.addClass(this.options.theme);$('<div class="swiper-arrow-block"><a href="#" class="swiper-arrow left inactive" onclick="return false"></a></div>').click(function(){clearTimeout(e.options.swipingTimer);
e.swipe(true)}).insertBefore(c);$('<div class="swiper-arrow-block"><a href="#" class="swiper-arrow right active" onclick="return false"></a></div>').click(function(){clearTimeout(e.options.swipingTimer);e.swipe(false)}).insertAfter(c);e.element.on("touchstart",function(l){e.swipeTouchStart(l)});e.element.on("touchmove",function(l){e.swipeTouchMove(l)});e.element.on("touchend",function(l){e.swipeTouchEnd(l)});this.fixWidths=function(n){var m=h.width();h.find(".swiper-entry").css("width",m+"px");var l=h.find(".swiper-entry").filter(".visible");
if(l.length){var o=parseInt(l.position().left);e.element.css("left",-o+"px")}};$(window).on("resize",this.fixWidths);this.fixWidths()},destroy:function(){this.element.removeClass("swiper-entry-holder");this.element.children().removeClass("swiper-entry");this.element.removeAttr("style");this.swiper.find(".swiper-arrow-block").remove();this.element.unwrap().unwrap().unwrap();$(window).off("resize",this.fixWidths);$.Widget.prototype.destroy.call(this)},_fixArrows:function(){var d=this.element.children().filter(".visible");
var e=this.swiper.find(".left");var c=this.swiper.find(".right");if(d.prev().length){e.removeClass("inactive").addClass("active")}else{e.removeClass("active").addClass("inactive")}if(d.next().length){c.removeClass("inactive").addClass("active")}else{c.removeClass("active").addClass("inactive")}},swipeTo:function(o,l,m){var c;var q=this;var d=this.swiper.find(".swiper-viewport");var p=d.children();var e=p.children();if(o>=e.length){return false}var n=$(e[o]);e.removeClass("visible");n.addClass("visible");
var f=parseInt(n.position().left);this._fixArrows();if(!m){$("select").prop("disabled",true);this.element.trigger("change.amexswiper",{index:n.index(),element:n})}var h=l?0:600;p.animate({left:-f+"px"},h,"easeOutExpo");$("#listData").addClass("opacityClass");this.options.swipingTimer=setTimeout(function(){if(!m){return q.element.trigger("animation-done.amexswiper",{index:n.index(),element:n})}},1000)},swipe:function(f,h,l){var o=this;var c=this.swiper.find(".swiper-viewport");var n=c.children();var d=n.children();
var e=d.filter(".visible");var m;if(f){m=e.prev()}else{m=e.next()}if(m.size()){return this.swipeTo(m.index(),h,l)}else{this.options.swipingTimer=setTimeout(function(){if(!l){return o.element.trigger("animation-done.amexswiper",{index:e.index(),element:e})}},2000)}},setTheme:function(c){this.swiper.removeClass(this.options.theme);this.options.theme=c;this.swiper.addClass(c);this.fixWidths()},viewedIndex:function(){var c=this.element.children().filter(".visible");if(c.size()){return c.index()}else{return -1
}},viewedElement:function(){return this.element.children().filter(".visible")},update:function(d){var c=$(d);if(c.is("ul,ol")){c=c.children()}c=c.filter("li");this.element.html(c);c.addClass("swiper-entry");c.eq(0).addClass("visible");this.element.css("left","0");this.fixWidths()},swipeTouchStart:function(d){var c=this;clearTimeout(c.options.swipingTimer);touchobj=d.originalEvent.changedTouches[0];c.options.boxleft=parseInt(c.element.css("left"));c.options.startx=parseInt(touchobj.clientX);c.options.swipedir="none";
c.options.dist=0;c.options.startX=touchobj.pageX;c.options.startY=touchobj.pageY;c.options.startTime=new Date().getTime();d.preventDefault()},swipeTouchMove:function(h){var c=this;touchobj=h.originalEvent.changedTouches[0];c.options.dist=parseInt(touchobj.clientX)-c.options.startx;c.options.distY=touchobj.pageY-c.options.startY;var e=parseInt(c.element.find(".visible").css("width"));var f=c.element.css("left");c.options.heightscrollcontent=parseInt(c.element.css("height"));var l=c.element.find("li").size();
if(c.options.distY<c.options.heightscrollcontent&&c.options.distY>-c.options.heightscrollcontent){if((Math.abs(parseInt((c.options.boxleft+c.options.dist),10))<e*(l-1))&&parseInt(f,10)<=0){if(c.options.dist>e){c.options.dist=e}if(parseInt((c.options.boxleft+c.options.dist),10)>e){c.element.css("left",(c.options.boxleft+c.options.dist)+e+"px")}else{if(parseInt((c.options.boxleft+c.options.dist),10)<=0){c.element.css("left",(c.options.boxleft+c.options.dist)+"px");var d=1-Math.abs((parseInt(c.options.dist))/e);
if(d<0.4){d=0.4}$("#listData").css("opacity",d)}}}}h.preventDefault()},swipeTouchEnd:function(c){var n=this;c.preventDefault();var m=c.originalEvent.changedTouches[0];n.options.distX=m.pageX-n.options.startX;n.options.elapsedTime=new Date().getTime()-n.options.startTime;var f=parseInt(n.element.find(".visible").css("width"));var o=(Math.abs(parseInt((n.options.boxleft+n.options.dist),10))%f);var h=120;var l=0;var d=Math.abs(n.options.distX)/n.options.elapsedTime;if(n.options.distX!=0){if((Math.abs(n.options.distX)<h&&d<0.1)){if(n.options.distX<0){l=(parseInt((n.options.boxleft+n.options.dist),10))+o
}else{if(parseInt(n.element.css("left"),10)<0){var e=(Math.abs(parseInt((n.options.boxleft+n.options.dist),10))/f);l=-(f*(parseInt(e,10)+1))}else{n.element.css("left","0")}}n.element.animate({left:l+"px"},500,"easeOutBounce");$("#listData").removeAttr("style")}else{n.options.swipedir=(n.options.distX<0)?"left":"right"}if(n.options.swipedir==="left"){n.swipe(false)}if(n.options.swipedir==="right"){n.swipe(true)}}}});$.widget("amex.amexselect",{_create:function(){var d=this.element;this.element.addClass("estmt-select");
d.wrap('<div class="estmt-select-outer-container"/>').wrap('<div class="estmt-select-inner-container"/>');d.parent().append($('<div class="estmt-select-text"/>'));var c=this.setText=function(){d.parent().find(".estmt-select-text").html(d.val())};d.parent().parent().prepend('<div class="estmt-select-button"></div>');d.on("change",c);c()},destroy:function(){this.element.removeClass("estmt-select");this.element.parent().find(".estmt-select-text").remove();this.element.unwrap().unwrap();this.element.off("change",this.setText);
$.Widget.prototype.destroy.call(this)}});var Page={form:{id:"EstatementFormBean",reportType:"reportType",viewType:"viewType",submit:function(d){var c=document.getElementById(this.id);c.action=d;c.submit()}},topLinks:{id:"topLinks",billing:"LinkBilling",download:"topLinkDownload",print:"topLinkPrint",help:"needhelp",downloadDialog:"downloadDialogContent"},t1:{id:"tier1",card:"cardSelect",cardSelect:"cardSelectList",period:"periodSelect",periodSelect:"periodSelectList",search:""},t2:{id:"tier2",list:"nav_1",category:"nav_5",merchant:"nav_3",due:"nav_7",tags:"nav_6",change:"navChangeView",category_time:"nav_12",cardmember:"nav_4"},title:{id:"title"},app:"app",footer:"footer",list:{table:"listData",qbtable:"qblistData"}};
var App={maxIdle:601,alertIdle:480,maxFailures:3,pingInterval:235,checkPingMethodInterval:30,checkAlertInterval:10,lastRequest:null,lastPingCheck:null,alertExecuter:null,pingExecuter:null,continueMsg:"Your session is about to expire. Click CANCEL to log out or CONTINUE to refresh your session. Thank you.",continueBtnTitle:"Continue working on this page",cancelBtnTitle:"Log out of the current session",popUpShown:false,checkPingStatus:false,inactivityInterval:240,idlePeriodDifference:480,sessionPopUpIdle:600,startIdleDetect:function(){App.lastRequest=new Date();
App.lastPingCheck=App.lastRequest;App.failCount=0;App.pingExecuter=setInterval(App.checkPingInterval,App.checkPingMethodInterval*1000);App.alertExecuter=setInterval(App.checkAlertIdleTime,App.checkAlertInterval*1000);$(document).mousedown(function(){App.lastRequest=new Date()}).ajaxComplete(function(){App.lastRequest=new Date()})},checkAlertIdleTime:function(){var c=(new Date()).getTime();var d=(c-App.lastRequest)/1000;if(d>=App.idlePeriodDifference){if(App.popUpShown==false){Amex.Msg.hide();Amex.Msg.confirmContinue("confirm",App.continueMsg,true,App.continueBtnTitle,App.cancelBtnTitle,function(f){if("CONTINUE"==f){App.idlePeriodDifference=App.alertIdle;
App.checkPingStatus=false;App.failCount=0;App.ping();clearInterval(App.pingExecuter);clearInterval(App.alertExecuter);App.startIdleDetect();if(downloadpara!=null){var e=downloadpara.getoverlayValue();if(e=="true"){Amex.PageOverlay.show()}else{Amex.PageOverlay.disableAlertMode()}}App.popUpShown=false}else{App.logout("User Chose to Logout")}});App.popUpShown=true}if(d>=App.sessionPopUpIdle&&App.popUpShown==true){App.timeout("No activity in the last "+d+" seconds.")}}},firePingEvent:function(){App.ping();
var c=0;while((App.failCount>0)&&(c<App.maxFailures)){wait(5000);App.ping();c=c+1}},checkPingInterval:function(){var d=(new Date()).getTime();var c=(d-App.lastPingCheck)/1000;if(App.checkPingStatus==false&&c>=App.pingInterval){App.checkPingStatus=true;App.firePingEvent();App.idlePeriodDifference=App.alertIdle-App.inactivityInterval}else{if(c>=App.pingInterval&&App.popUpShown==false){var e=(d-App.lastRequest)/1000;if(e>App.pingInterval){App.firePingEvent();App.idlePeriodDifference=App.alertIdle}App.lastPingCheck=new Date()
}}},logout:function(d){var c=$("#logoutURL").val();window.location=c},timeout:function(e){var c=$("#estatementURL").val();if($("#multiCardView").val()=="true"){c=c+"&sorted_index=0"}else{var f=T1.card.getSelected();if(f){c=c+"&sorted_index="+f.index}else{c=c+"&sorted_index=0"}var d=T1.period.getSelected();if(d&&d.BPIndex){c=c+"&BPIndex="+d.BPIndex}var h=$("#userInPreferredView").val();if(h=="true"){c=c+"&preferredView=true"}}window.location=c},fail:function(){App.failCount++},ping:function(){$.ajax("ping.do",{data:{Face:"en_US",request_type:"authreg_Statement"},success:function(c,e,d){if("1"==c){App.failCount=0
}else{App.fail()}},error:function(c){App.failCount++}})},wait:function(d){var e=new Date().getTime();var c=e;while(c-e<d){c=new Date().getTime()}},noAccess:function(){Amex.Msg.alert(Amex.Msg.information,"This process is not currently enabled online for Account Managers. Please either ask the Basic to log in, or you can call our Telephone Service Center where a Customer Care Professional will be happy to assist you.",true,null)}};App.pznCall=function(){try{if($("#pznKillFlag").length&&$("#entryPoint").val()!="keynote"){var c=$("#pznKillFlag").val();
if(c!=""){PZN_PES.OfferService.init("DES","RTD",estatPESOffers,getEstatDefaults,"/Internet/PZN/en_US/AmexUSMarket/Default/Estatement.html","",c)}}}catch(d){}getCustomUrl=function(h){var e=$("#estatementURL").val();if($("#multiCardView").val()=="true"){e=e+"&sorted_index=0"}else{var l=T1.card.getSelected();if(l){e=e+"&sorted_index="+l.index}else{e=e+"&sorted_index=0"}var f=T1.period.getSelected();if(f&&f.BPIndex){e=e+"&BPIndex="+f.BPIndex}var m=$("#userInPreferredView").val();if(m=="true"){e=e;$("#preferredView").val(true)
}}e=e+"&Face=en_US";return e}};var UIController={};UIController.checkStatus=function(c){if(c.listView){ListUIController.check(c)}else{if(c.listOnly){ListUIController.checkList(c)}else{if(c.summaryView){SummaryUIController.check(c)}else{if(c.graphView){GraphUIController.check(c)}else{if(c.search){SearchUIController.check(c)}else{if(c.chartDetails){GraphUIController.checkDetails(c)}else{if(c.detailsOnly){GraphUIController.checkDetailsOnly(c)}else{if(c.qblistOnly){ListUIController.qbcheckList(c)}}}}}}}}};
UIController.startLoad=function(){if($("#keyWord").val().isBlank()){Search.field.value=Search.title}else{var c=$("#keyWord").val().replace(/~_/,"_");c=(c).replace(/~%/,"%");Search.field.value=c}};UIController.updateStatus=function(){if(typeof(T2)!="undefined"){Status.current.selectedT2=T2.bar.getSelected()}Status.current.reportType=$("#"+Page.form.reportType).val();Status.current.viewType=$("#"+Page.form.viewType).val();Status.current.period=T1.period.getSelected();Status.current.card=T1.card.getSelected();
Omniture.setPropVar();var c=$("#cancelcards");if(c.length&&!c.val().isBlank()){T1.card.updateCancelled(c.val().split("~"));c.val("");$("#updateSuppDisplay").val("false")}UIController.updatePrint()};UIController.revertStatus=function(){UIController.revertTimePeriod();T2.bar.activateById(Status.current.selectedT2.getId(),false);$("#"+Page.form.reportType).val(Status.current.reportType);$("#"+Page.form.viewType).val(Status.current.viewType);UIController.revertChangeView()};UIController.revertTimePeriod=function(){if(Status.current.period){$("#bPIndex").val(Status.current.period.BPIndex);
$("#startDate").val(Status.current.period.startDate);$("#endDate").val(Status.current.period.endDate);$("#multiCardTPIndex").val(Status.current.period.multiCardBPIndex);var e=$("#multiCardView");if(e.val()=="true"&&Status.current.period.multiCardBPIndex!=null){T1.period.selectByMultiCardIndex(Status.current.period.multiCardBPIndex,false)}else{T1.period.selectByIndex(Status.current.period.BPIndex,false)}}else{var d=Date.parseString($("#"+CustomPeriod.fromField).val(),"M/d/y");var c=Date.parseString($("#"+CustomPeriod.toField).val(),"M/d/y");
T1.period.setLabel("Date Range","from "+d.format("NNN dd, yyyy")+" to "+c.format("NNN dd, yyyy"));T1.period.selected=null}};UIController.revertChangeView=function(){if(Status.current.viewType=="G"){T2.change.down(false)}else{T2.change.up(false)}};UIController.updatePrint=function(){var c=$("#blackStar");var e=$("#goldStar");var d=false;var f=false;var h=(!($("#bPIndex").val()=="0"||$("#bPIndex").val()=="-97"));if($("#pendingOpen").val()=="true"&&!$('#listData>tbody[id^="roc_"]').length){d=true}else{if(h&&!$('#listData>tbody[id^="roc_"]').length){f=true
}}if(($("listData")==null&&$("summary-table")==null)||($("#viewType")=="L"&&$$('#listData tbody[id^="roc_"]')=="")){$("#topLinkPrint").hide();$("#topLinkPrintDis").show();if($("#dynaColPreview").length){if($("#cardTypePref").length){if($("#cardTypePref").val()=="allopen"){$("#dynaColPreview").html("CARDMEMBER")}if($("#cardTypePref").val()=="basicwithsupp"){$("#dynaColPreview").html("CARDMEMBER")}if($("#cardTypePref").val()=="basiconly"){$("#dynaColPreview").html("HIDDEN")}if($("#cardTypePref").val()=="supponly"){$("#dynaColPreview").html("HIDDEN")
}}}}else{$("#topLinkPrintDis").hide();$("#topLinkPrint").show()}};UIController.replaceHtml=function(c){var d=new RegExp(">[ \\s\\r\\n\\t]*<","g");c=c.replace(d,"><");return c};var Status={current:{reportType:null,viewType:null,selectedT2:null,period:null,card:null,selMaxPerPage:null},loadEvents:null,loading:false,source:null,loadingButton:null};Status.init=function(){Status.loadEvents={};Status.loading=false;$(document).on("amex:status",Status.listener)};Status.listener=function(c,d){Status.update(d)
};Status.update=function(c){if(Status.loading){Status.loadEvents[c.source+"_"+c.name]=c;UIController.checkStatus(Status.loadEvents)}else{}};Status.startLoad=function(c){if(!Status.loading){Status.loading=true;Status.source=c;Status.loadEvents={};Status.loadEvents[c]=true;UIController.startLoad()}else{}};Status.endLoad=function(){Status.loading=false;Status.loadingButton=null};Status.fireSuccess=function(d,c){$(document).trigger("amex:status",{name:"end",source:d,response:c})};Status.fireMycaError=function(d,c){$(document).trigger("amex:status",{name:"end",source:d,response:c,error:{key:c.getResponseHeader("MYCAError"),message:c.getResponseHeader("MYCAErrorMessage")}})
};Status.fireHttpError=function(d,c){$(document).trigger("amex:status",{name:"end",source:d,response:c,error:{key:c.status,message:c.statusText}})};Status.fireStart=function(d,c){$(document).trigger("amex:status",{name:"start",source:d,request:c})};var Preferences={url:null,title:null,window:null,dynaCol:4,showDynaCols:false,isDynaColShown:null,dynaHeads:null,tbl:null,cmNameTh:null,cmNameCols:null,catCols:null,catTh:null,foreignSpendCols:null,foreignSpendTh:null,dynaNav:null,selDynaHead:null,dynaCols:null,requestType:null,currDynaCol:null,cmName:null,catSubCatTh:null,init:function(){if($("#listData").length){this.dynaHeads=$("#listData .dynaColHead");
this.tbl=$("#listData");if($("#displayCMName").length&&$("#displayCMName").val()=="true"){if($("#multiCardView").val()=="true"){if($("#thNameNoSort").length){this.cmNameTh=$("#thNameNoSort");this.cmName=this.cmNameTh}}else{if($("#thName").length){this.cmNameTh=$("#thName");this.cmName=this.cmNameTh.children()}}}else{this.cmNameTh=null}this.cmNameCols=this.tbl.find(".colName");this.catCols=this.tbl.find(".colCat");this.catSubCatCols=this.tbl.find(".colCatSubCat");this.catTh=$("#thCat");this.catSubCatTh=$("#thCatSubCat");
this.foreignSpendCols=this.tbl.find(".colForAmmount");this.foreignSpendTh=$("#thForAmmount");this.dynaNav=this.tbl.find(".thDyna");this.dynaCols=this.tbl.find(".colDyna");this.currDynaCol=$("#currDynaCol").val()}if($("#userHasDownloadPrefs").length){if($("#userHasDownloadPrefs").val()=="true"){if($("#saveDownloadViewButton").length){$("#saveDownloadViewButton").hide()}}else{if($("#saveDownloadViewButton").length){$("#saveDownloadViewButton").show()}}}},showPreferenceInterstitial:function(){if(Preferences.window==null){Preferences.window=new Amex.Window({modal:true,top:200,trigger:"topLinkPref",theme:"amexWindow",buttons:["close"],onClose:function(){$("#saveDownloadViewButton").hide();
Amex.PageOverlay.hide();return true},shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});Preferences.window.render(document.body);var d=$("#prefMyDiv").html();Preferences.window.update(d);$("#prefMyDiv").remove();Preferences.window.centerInViewport();Preferences.window.open()}var c=$("#closePrefIn");if(c.length>0){c.on("click",Preferences.close)}Omniture.report("Interstitial_Track")},close:function(){if(Preferences.window!=null){Preferences.window.close();
$("#saveDownloadViewButton").hide();Omniture.reportClick("closePrefInst")}},showHideColumn:function(){var d=$("#sortClicked").val();var e=$("#curSavCol");if(this.showDynaCols){if(this.currDynaCol!=null&&this.currDynaCol!="HIDDEN"&&this.currDynaCol!="hidden"){if(this.currDynaCol=="0"){if(this.cmNameTh!=null){this.cmNameTh.show();this.cmNameTh.addClass("selectedDynaCol");this.currDynaCol=0;if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("CARDMEMBER")
}this.cmNameCols.show()}else{this.catTh.show();this.catTh.addClass("selectedDynaCol");this.currDynaCol=5;if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("<p style='text-transform: uppercase;'>"+this.catTh.children().html()+"</p>")}this.catCols.show()}}}else{if($("#sortClicked").val()!="true"&&$("#curSavCol").length&&Preferences.isDynaSavCol()){var c=$("#curSavCol").val();if($("#curSavCol").val()=="0"){if(this.cmNameTh!=null){this.cmNameTh.show();
this.cmNameTh.addClass("selectedDynaCol");this.currDynaCol=0;if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("CARDMEMBER")}this.cmNameCols.show()}else{this.catTh.show();this.catTh.addClass("selectedDynaCol");this.currDynaCol=5;if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("<p style='text-transform: uppercase;'>"+this.catTh.children().html()+"</p>")}this.catCols.show()}}else{if($("#curSavCol").val()=="5"&&this.catTh!=null){this.catTh.show();
this.catTh.addClass("selectedDynaCol");this.currDynaCol=5;if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("<p style='text-transform: uppercase;'>"+this.catTh.children().html()+"</p>")}this.catCols.show()}else{if($("#curSavCol").val()=="51"&&this.catSubCatTh!=null){this.catSubCatTh.show();this.catSubCatTh.addClass("selectedDynaCol");this.currDynaCol=51;if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("<p style='text-transform: uppercase;'>SUBCATEGORY</p>")
}this.catSubCatCols.show()}else{if($("#curSavCol").val()=="30"&&this.foreignSpendTh!=null){this.foreignSpendTh.show();this.foreignSpendTh.addClass("selectedDynaCol");this.currDynaCol=30;if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("<p style='text-transform: uppercase;'>FOREIGN SPEND AMOUNT</p>")}this.foreignSpendCols.show()}}}}}else{if(this.cmNameTh!=null){this.cmNameTh.show();this.cmNameTh.addClass("selectedDynaCol");this.currDynaCol=0;
if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("CARDMEMBER")}this.cmNameCols.show()}else{if(this.catTh!=null){this.catTh.show();this.catTh.addClass("selectedDynaCol");this.currDynaCol=5;if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("<p style='text-transform: uppercase;'>"+this.catTh.children().html()+"</p>")}this.catCols.show()}else{if(this.catSubCatTh!=null){this.catSubCatTh.show();
this.catSubCatTh.addClass("selectedDynaCol");this.currDynaCol=51;if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("<p style='text-transform: uppercase;'>SUBCATEGORY</p>")}this.catSubCatCols.show()}else{if(this.foreignSpendTh!=null){this.foreignSpendTh.show();this.foreignSpendTh.addClass("selectedDynaCol");this.currDynaCol=30;if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("<p style='text-transform: uppercase;'>FOREIGN SPEND AMOUNT</p>")
}this.foreignSpendCols.show()}}}}}}if(this.dynaHeads.size()>1){this.dynaNav.show();this.dynaCols.show()}$("#currDynaCol").val(this.currDynaCol)}else{if(this.cmNameTh!=null&&this.cmNameTh.hasClass("selectedDynaCol")){this.cmNameTh.hide();this.cmNameCols.hide()}else{if(this.catTh.length&&this.catTh.hasClass("selectedDynaCol")){this.catTh.hide();this.catCols.hide()}else{if(this.catSubCatTh.length&&this.catSubCatTh.hasClass("selectedDynaCol")){this.catSubCatTh.hide();this.catSubCatCols.hide()}else{if(this.foreignSpendTh.length&&this.foreignSpendTh.hasClass("selectedDynaCol")){this.foreignSpendTh.hide();
this.foreignSpendCols.hide()}}}}if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("HIDDEN");$("#currDynaCol").val("hidden")}this.dynaNav.hide();this.dynaCols.hide()}},showHiddenColumns:function(c){if($("#listData").length){if(this.showDynaCols){if($("#cardSortSpan1").length){$("#cardSortSpan1").hide()}$("#thDesc").addClass("thDescRightBorder");this.showHideColumn();if($("#cardSortSpan").length){if(this.dynaHeads!=null&&this.dynaHeads.size()>0){$("#cardSortSpan").show()
}}this.showDynaCols=false;this.isDynaColShown=true}else{if($("#cardSortSpan").length&&$("#cardSortSpan1").length){$("#cardSortSpan").hide();$("#thDesc").removeClass("thDescRightBorder");this.showHideColumn();if(this.dynaHeads!=null&&this.dynaHeads.size()>0){$("#cardSortSpan1").show()}this.showDynaCols=true;this.isDynaColShown=false}}}},slideColumns:function(c){if(c=="next"){$("#cmNext").focus();for(var d=0;d<this.dynaHeads.size();d++){if($(this.dynaHeads[d]).hasClass("selectedDynaCol")){$(this.dynaHeads[d]).removeClass("selectedDynaCol");
this.selDynaHead=this.dynaHeads[d];if(d==this.dynaHeads.size()-1){this.switchColumns(this.dynaHeads[0]);return true}else{this.switchColumns(this.dynaHeads[d+1]);return true}}}}else{if(c=="prev"){$("#cmPrev").focus();for(var e=this.dynaHeads.size()-1;e>=0;e--){if($(this.dynaHeads[e]).hasClass("selectedDynaCol")){$(this.dynaHeads[e]).removeClass("selectedDynaCol");this.selDynaHead=this.dynaHeads[e];if(e==0){this.switchColumns(this.dynaHeads[this.dynaHeads.size()-1]);return true}else{this.switchColumns(this.dynaHeads[e-1]);
return true}}}}}},switchColumns:function(e){var c=e.id;var d=this.selDynaHead.id;if(c=="thName"||c=="thNameNoSort"){if(this.cmNameTh.length){this.cmNameTh.show();this.cmNameTh.addClass("selectedDynaCol");$("#currDynaCol").val(0);this.currDynaCol=0;this.cmNameCols.show()}}this.currDynaCol=parseInt($("#currDynaCol").val());if(e.id=="thName"||e.id=="thNameNoSort"){if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){$("#dynaColPreview").html("CARDMEMBER")}}else{if($("#viewType").val()=="L"||$("#viewType").val()=="S"||$("#viewType").val()=="G"){if(c=="thCatSubCat"){if($("#dynaColPreview").length){$("#dynaColPreview").html("<p style='text-transform: uppercase;'>SUBCATEGORY</p>")
}}else{if(c=="thForAmmount"){if($("#dynaColPreview").length){$("#dynaColPreview").html("<p style='text-transform: uppercase;'>FOREIGN SPEND AMOUNT</p>")}}else{if($("#dynaColPreview").length){$("#dynaColPreview").html("<p style='text-transform: uppercase;'>"+$(e).children().html()+"</p>")}}}}}this.hideSelDynaHead(d);if($("#shouldDisplayCat").length){$("#shouldDisplayCat").val("false")}},hideSelDynaHead:function(c){if(c=="thCat"){this.catTh.hide();this.catCols.hide()}else{if(c=="thCatSubCat"){this.catSubCatTh.hide();
this.catSubCatCols.hide()}else{if(c=="thName"||c=="thNameNoSort"){this.cmNameTh.hide();this.cmNameCols.hide()}else{if(c=="thForAmmount"){this.foreignSpendTh.hide();this.foreignSpendCols.hide()}}}}},getSortOptions:function(e,c){var d="";if(e==0&&$("#multiCardView").val()!="true"){d="CARDMEMBER ";if(c=="A"){d=d+"(Basic Cardmember on top)"}else{d=d+"(Additional Cardmember(s) on top)"}}else{if(e==1){d="Date ";if(c=="A"){d=d+"(Oldest on Top)"}else{d=d+"(Newest on Top)"}}else{if(e==2){d="Description ";
if(c=="A"){d=d+"(A to Z)"}else{d=d+"(Z to A)"}}else{if(e==4){d="Amount ";if(c=="A"){d=d+"(Smallest on top)"}else{d=d+"(Greatest on top)"}}else{if(e==0&&$("#multiCardView").val()=="true"){d="CARD ";if(c=="A"){d=d+"(A to Z)"}else{d=d+"(Z to A)"}}}}}}return d},getAdditionalCol:function(c){if(c==0){if($("#dynaColPreview").length){$("#dynaColPreview").html("CARDMEMBER")}}else{if(c==5){if($("#dynaColPreview").length){$("#dynaColPreview").html("CATEGORY")}}else{if(c==30){if($("#dynaColPreview").length){$("#dynaColPreview").html("FOREIGN SPEND AMOUNT")
}}else{if(c==51){if($("#dynaColPreview").length){$("#dynaColPreview").html("SUBCATEGORY")}}else{if($("#dynaColPreview").length){$("#dynaColPreview").html("HIDDEN")}}}}}},setFocus:function(c){if($("#"+c).length){$("#"+c).focus()}},isDynaSavCol:function(){var c=$("#curSavCol").val();return($("#curSavCol").val()=="0"||$("#curSavCol").val()=="5"||$("#curSavCol").val()=="51"||$("#curSavCol").val()=="30")}};if(typeof(Amex.BlockContainer)=="undefined"){throw ("Amex.ListTable : error : This component requires BlockContainer.js to be included.")
}var ListTable=function(d,c){this.table=$("#"+d);this._allExtended=false;Amex.BlockContainer.prototype.constructor.call(this,this.table);this.options=c;defaults={hoverClassName:"rowHover",loadImg:"load",loadMessage:"Please wait loading ..."};this.options=$.extend(defaults,c||{});this.selected={}};ListTable.prototype=$.extend(new Amex.BlockContainer,{constructor:ListTable,toggleROC:function(c,e){var f=$("#"+c);var d=f.find('[id^="offerIcon_"]');if(!($.isUndefined(f.data("expanded")))&&!(f.data("expanded"))&&d.hasClass("handImage")){d.removeClass("handImage")
}else{if(!($.isUndefined(f.data("expanded")))&&f.data("expanded")&&d.hasClass("offerTrans")){d.addClass("handImage")}}if($.isUndefined(f.data("hasData"))){f.data("parent",this);f.record()}if(f.data("expanded")){f.record("collapse",false)}else{if(!$.isUndefined(e)){if(e){f.data("hideLoadDetails",true)}else{f.data("hideLoadDetails",false)}}f.record("expand",false)}},togglePendingROC:function(c){var d=$("#proc_"+c);if($.isUndefined(d.data("hasData"))){d.data("parent",this);d.record()}if(d.data("expanded")){d.record("collapse",false);
d.find("tr:first").children().css({borderBottom:"1px solid #cccccc"})}else{d.data("hideLoadDetails",false);d.record("expand",false);if(d.data("hasData")){d.find("tr:first").children().css({border:"none"})}}},checkROC:function(e){e=$(e);var f=$("#"+e.identify().substring(1));var c=f.attr("id").split("_")[1];var d=$("#itag_"+c);if(e.is(":checked")){if($.isUndefined(f.data("hasData"))){f.data("parent",this);f.record()}if(f.attr("id").split("_")[0]=="roc"){if(d.attr("class")=="greyTag"||d.attr("class")=="greyTag itagAnchorAlign"){d.attr({"class":"goldTag",title:"Hide Tag Inline view"})
}}this.selected[f.attr("id")]=f[0]}else{if(f.attr("id").split("_")[0]=="roc"){$("#checkAll").attr("checked",false);if(d.length&&d.attr("class")=="goldTag"){d.attr({"class":"greyTag",title:"Show Tag Inline view"})}}delete this.selected[f.attr("id")]}},getSelectedIds:function(){var c=[];$.each(this.selected,function(d,e){c.push(e.id.split("_")[1])});return c},getSelected:function(){var c=[];for(key in this.selected){c.push(this.selected[key])}return c},hasSelected:function(){for(key in this.selected){return true
}return false},enableSelect:function(c){this.table.removeClass("checkOff");if(!c){this.table.addClass("expandOff")}return this},disableSelect:function(){this.table.removeClass("expandOff");this.table.addClass("checkOff");return this},checkAll:function(){return this.apply(["check"])},uncheckAll:function(){$.each(this.selected,function(c,d){$("#c"+d.id).attr("checked",false)});Tag.unHighLightTagIcon();$("#checkAll").attr("checked",false);this.selected={};return this},uncheckAllPending:function(){$.each(this.selected,function(c,e){var f=e.id.split("_")[0];
var d=e.id.split("_")[1];if(f=="proc"){delete List.table.selected["proc_"+d];$("#c"+e.id).attr("checked",false)}});return this},collapseAll:function(){return this.apply(["collapse"])},expandAll:function(){return this.apply(["expand"])},apply:function(d){var c=this;this.table.find("tbody[id^=roc_]").each(function(){var e=$(this);if(!c._allExtended&&$.isUndefined(e.data("hasData"))){e.data("parent",c);e.record()}$.each(d,function(f,h){e.record(h)})});this._allExtended=true;return this},isA:function(){return"ListTable"
},selectedKeys:function(){var c=[];for(key in this.selected){c.push(key)}return c}});ListTable.prototype.constructor=ListTable;var List_mb={pageNumber:"pageNumber",deferred:null,displaytimePeriodDataList:null,postedError:'<tbody class="noPostedMatch postedError"><tr class="error-background"><td colspan="3" style="padding:0px;border-top: 1px solid #cccccc;"><div class="noListResultsDisplay">There is no activity that meets your selected criteria.</div></td></tr></tbody> ',pendingError:'<tbody class="noPendingMatch pendingerrors pending-item-body open"><tr class="error-background"><td colspan="3" style="padding:0px;"><div class="noListResultsDisplay">There are no transactions meeting the selected criteria.</div></td></tr></tbody> ',searchError:'<tbody class="noPostedMatch searchMessage postedError"><tr class="error-background"><td colspan="3" style="padding:0px;border-top: 1px solid #cccccc;"><div class="noListResultsDisplay">There is no activity that meets your selected criteria.</div></td></tr></tbody> '};
var monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];List_mb.init=function(){if(channelType==="M"){if(typeof($("#listDataWrapper").val())!="undefined"){$("#listDataWrapper").off("mouseover mouseout click").on("click","a.plus, a.minus",function(c){c.preventDefault()}).on("click",".pending-icon",function(c){c.preventDefault()}).on("click",'tbody[id*="roc"]',List_mb.ETDClick).on("click","#appendTransaction",List_mb.showMore)}}$("#pendingHdr").on("click",List_mb.togglePending);
List_mb.loadOfferCondition(listResponse)};List_mb.load=function(d,h,f){var l=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c&&(d==="filterlist.do"||d==="tpChange.do"||d==="listControls.do")){l=formParameters.getParams(d);if(h=="filter"){if($("#fromAmount").length&&$("#toAmount").length){l.push({name:"filterFromAmnt",value:$("#fromAmount").val()});l.push({name:"filterToAmnt",value:$("#toAmount").val()})}}}else{if(channelType==="M"&&(d==="cardChangeList.do")){l=formParameters.getParams(d)
}}$("#postedErrorResultsDisplay").remove();$("#responsiveWrapper_main").addClass("disabledmb").removeClass("enabledmb");var e=$.ajax(d,{type:"POST",data:l,timeout:20000,success:function(r,p,n){if(n.getResponseHeader("MYCAError")==null){$("#listData").removeClass("opacityClass");$("#responsiveWrapper_main").removeClass("opacityClass");if(n.getResponseHeader("liteEnabled")==null){if($("#searchText").val()!=null&&$("#searchText").val().length>0){r.searchText=true}if(channelType==="M"){if(f!=null){var u=((r.displayTimePeriodDataList));
var q=JSON.parse(u);List_mb.displaytimePeriodDataList=q;var o=$.jcp("run","@mb/timePeriod",q);$("#scroller-content").amexswiper("update",o).trigger("create");var v=$("#scroller-content li").length;if(v===1){$("#bPIndex").val(0)}else{if(r.pendingCharges){$("#bPIndex").val(0)}}$("#scroller-content").amexswiper("swipeTo",$("#bPIndex").val(),true,true);$(".mobileLoader").remove();$("#startDate").val($.trim($("#scroller-content").find(".visible").attr("data-startDate")));$("#endDate").val($.trim($("#scroller-content").find(".visible").attr("data-endDate")))
}if((h!=="mobilePagination")&&(h!=="searchAjax")&&(h!=="filterlistClearSearch")){r.BPIndex=parseInt($("#bPIndex").val());var m=$.jcp("run","@list/list",r);$("#listTemplate").html(m)}else{if(h==="mobilePagination"){var m=$.jcp("run","@list/list_showmore",r);$("#appendSpinner").remove();$("#appendTransaction").before((m)).trigger("create");List_mb.paginationText(r)}else{if(h==="searchAjax"||h==="filterlistClearSearch"){$(".postedError").remove();$("#listData").show();if(h==="filterlistClearSearch"){r.filterlistClearSearch=true;
$(".posted-trans-head").data("allTransactionsFetched",true)}else{$(".posted-trans-head").data("allTransactionsFetched",false)}var m=$.jcp("run","@list/list_showmore",r);$(".posted-trans").remove();$(".posted-trans-head").after((m)).trigger("create");List_mb.paginationText(r)}}}}if($("#searchText").val()!=null&&$("#searchText").val().length>0){if(r.transactionList===null){if($("#listMsg").length===0&&$(".postedError").length===0){$(".posted-trans-head").after($(List_mb.searchError)).trigger("create");
$("#transCostPostedSpan").text("")}}else{var s=List_mb.addMark($("#searchText").val(),null,null);if((h==="searchAjax")||(h==="mobilePagination")){var t=List_mb.setTableData(s,"searchAjax")}else{var t=List_mb.setTableData(s)}}}if((h==="mobilePagination")||(h==="searchAjax")||(h==="filterlistClearSearch")){}else{List_mb.init()}List_mb.resizeFunction();if(h==="tpChangeSearch"||h==="cardChangeListSearch"||h==="cardSearch"){$(".posted-trans-head").data("allTransactionsFetched",false)}if(channelType==="M"&&(h==="mobilePagination")){List_mb.loadOfferCondition(r)
}$("#responsiveWrapper_main").addClass("enabledmb").removeClass("disabledmb")}}else{List_mb.mycaError()}},error:function(m,o,n){List_mb.mycaError()}})};List_mb.paginationText=function(d){if(d.paginationData!==null){var e=d.paginationData.totalTrans;var c=d.paginationData.endRow;List_mb.showingText("posted",e,c);if(e==c){$("#appendTransaction").hide()}else{if(e>c){$("#appendTransaction").show()}}}};List_mb.mycaError=function(){if($("#postedErrorResultsDisplay").length==0||$(".mobileLoader").length==0){var c=$("#bPIndex").val();
$("#listData").removeAttr("style");$("#listData").removeClass("opacityClass");$("#responsiveWrapper_main").removeClass("opacityClass");$(".mobileLoader").remove();if(parseInt(c)!=0){$("#pendingHdr").hide()}else{$("#pendingHdr").show()}$("#listData").find("tbody").remove();var d=$('<tbody id="postedErrorResultsDisplay" class="postedWindowLoad"><tr><td colspan="3"><div class="postedErrorResultsDisplay" style="font-style:normal;">We are currently experiencing difficulties retrieving your transactions. Please try again shortly.</div></td></tr></tbody>');
$(".posted-trans-head").after(d).trigger("create");$("#transCostPostedSpan").text("");$("#transCostPendingSpan").text("");$("#listData").show();$("#responsiveWrapper_main").addClass("enabledmb").removeClass("disabledmb")}};List_mb.searchFocus=function(c){var d=$(c).val();if(d!=null&&d.length>=1){$("#closeId").removeClass("magnifier_button").addClass("close_button")}else{$("#closeId").removeClass("close_button").addClass("magnifier_button")}$("#keyWord").val(d);List_mb.setFilterString(d)};List_mb.addMark=function(d,f,c){var e=".posted-trans";
if(f!==null){e=".pending-trans";$("#listData").find(".pending-trans").hide()}else{if(c===null){$("#listData").find(".posted-trans").hide()}}return $("#listData").find(e).filter(function(){var m=new RegExp("("+d+")","gi");var h=m.test($(this).find(".desc-trans").text());if(h){var l=$(this).find(".desc-trans");l.html(l.text().replace(m,"<mark class='highlighted'>$1</mark>"));return true}})};List_mb.setFilterString=function(f){var n=false;var h=0;if($("#listData").find(".pending-trans").length>0){var d=List_mb.addMark(f,"pendingSearch",null);
List_mb.pendingMatchedElement(d)}else{if($("#listData").find(".pendingErrorDisplay").length>0){$(".pendingErrorDisplay").hide();$(".pendingerrors").remove();if($(".pendingerrors").length<1){var m=$(List_mb.pendingError);$("#pendingHdr").after(m).trigger("create").show()}}}if(($(".posted-trans-head").data("allTransactionsFetched")==false)||($("#appendTransaction").is(":visible"))){n=true;if(($(".posted-trans-head").data("allTransactionsFetched")==false)){if(f.length===0){clearTimeout(this.typingTimer);
this.typingTimer=setTimeout(function(){if($("#listData").find("mark").length>0||$("#listData").find(".postedError").length>0){$("#search").blur();$("#pageNumber").val(1);$("#listData").addClass("opacityClass");$("#responsiveWrapper_main").addClass("opacityClass");List_mb.load("filterlist.do","filterlistClearSearch");if($("#listData").find(".pendingErrorDisplay").length>0){$(".pendingerrors").remove();$(".pendingErrorDisplay").show()}}},3000)}}}else{if(!n){$("#listData").find(".posted-trans").hide();
var c=List_mb.addMark(f,null,null);var l=List_mb.setTableData(c);if(l===0){$(".noPostedMatch").remove();if($("#listMsg").length===0){$(".postedError").remove();var e=$(List_mb.postedError);$(".posted-trans-head").after(e).trigger("create").show()}List_mb.showingText("posted",0,0)}}}};List_mb.pendingMatchedElement=function(c){var e=0;if($("#listData").find(".pending-trans").length>0){c.each(function(){e=e+1;$(this).show();$(".noPendingMatch").remove()});$("#listData").find(".pending-trans:visible:odd").css("background-color"," #FFFFFF");
$("#listData").find(".pending-trans:visible:even").css("background-color"," #F1F1F1");if(e==0){$("#pendinghelp-tbody").hide();$(".pendingerrors").remove();var d=$(List_mb.pendingError);$("#pendingHdr").after(d).trigger("create").show()}else{$("#pendinghelp-tbody").show();$(".showMessage").show()}List_mb.showingText("pending",e,e)}};List_mb.setTableData=function(c,e){var f=0;c.each(function(){if($(this).hasClass("posted-trans")){f=f+1}});if(f>0){$(".noPostedMatch").remove();if(e==null){List_mb.showingText("posted",f,f)
}c.show();$("#listData").find(".posted-trans:visible:odd").css("background-color"," #FFFFFF");$("#listData").find(".posted-trans:visible:even").css("background-color"," #F1F1F1")}else{$(".noPostedMatch").remove();if($("#listMsg").length===0){var d=$(List_mb.postedError);$(".posted-trans-head").after(d).trigger("create").show()}}return f};List_mb.filterajaxCall=function(){$("#keyword").val($("#searchText").val());List_mb.load("filterlist.do","searchAjax")};List_mb.clearSearch=function(){$("#searchText").attr("placeholder","Search Transactions");
if($("#listData").find(".pending-trans").length>0){var c=List_mb.addMark("","pendingSearch",null);List_mb.pendingMatchedElement(c)}else{if($("#listData").find(".pendingErrorDisplay").length>0){$(".pendingerrors").remove();$(".pendingErrorDisplay").show()}}if(!$("#appendTransaction").is(":visible")&&!($(".posted-trans-head").data("allTransactionsFetched")==false)){List_mb.unmark();List_mb.setTableData($("#listData").find(".posted-trans"))}else{if(($(".posted-trans-head").data("allTransactionsFetched")==false)){List_mb.removeTable();
$("#pageNumber").val(1);List_mb.load("filterlist.do","filterlistClearSearch")}}};List_mb.unmark=function(){$("#listData").find("mark").each(function(){$(this).replaceWith($(this).html());$(this).remove("mark")})};List_mb.closeButton=function(d,c){$("#searchText").val("");$("#keyWord").val("");if($(c).hasClass("close_button")){$(c).removeClass("close_button").addClass("magnifier_button");List_mb.clearSearch()}d.preventDefault()};List_mb.cardSelection=function(n,f){var c=$(f).find("a").attr("data-id");
if(c.length==0){c=0}$("input").blur();iNavNGI.iNToggleMenu();if(parseInt(c,10)!=$("#sorted_index").val()){$("#iNCardSelector").find("li").each(function(){if($(this).hasClass("iNSelCard")){$(this).removeClass("iNSelCard")}});$(f).closest("li").addClass("iNSelCard");searchString=$("#searchText").val();$("#sorted_index").val(c);subCardData.selectedIndex=parseInt(c,10);$("#suppIndex").val("");$("#pageNumber").val(1);if($("#suppCardId").length>0){$(".estmt-select-outer-container").remove();$("#suppCardId").remove();
$(".estmt-select-button").remove()}var d=$.jcp("run","@mb/cardDetail",subCardData);$("#cardDropDownChange").after(d).trigger("create");$(".estmt-select").amexselect();$("#responsiveWrapper_main").addClass("opacityClass");Omniture.report("card_change");if($("#searchText").val()!=null&&$("#searchText").val().length>0){List_mb.load("cardChangeList.do","cardSearch","mobileCardChange")}else{List_mb.load("cardChangeList.do","cardChangeList","mobileCardChange")}var m=iNavCardSelectorData.cards;for(var h=0;
h<m.length;h++){if(m[h].sortedIndex==c){$("#cardActivityDescription").text(m[h].cardName);var l=m[h].cardLastFive;$("#cardActivitynumber").text("-"+l.substring(0,5));$("#cardActivityName").text(m[h].cardmemberName);$("#cardArtImageId").attr("src",m[h].cardArtURISmall)}}}};List_mb.removeTable=function(){$("#listData").addClass("opacityClass")};List_mb.showMore=function(e){if($("#listData").find("#appendSpinner").length==0){var d=$('<tbody id ="appendSpinner"><tr class="spinnerPending"><td colspan="3"class="spinnerETD"></td></tr></tbody>');
$("#appendTransaction").before((d)).trigger("create");var f=e.currentTarget.id;var c=parseInt($("#"+f).attr("data-pageNumber"),10);c=c+1;$("#pageNumber").val(c);$("#"+f).attr("data-pageNumber",c);List_mb.load("listControls.do","mobilePagination");Omniture.report("listView_showMore")}};List_mb.showingText=function(c,f,e){var d="";if(c=="posted"){d="Showing "+e+" of "+f;if(parseInt(f,10)===0){$("#transCostPostedSpan").text("")}else{if(f.toString().length>=4){$("#transCostPostedSpan").text(d).addClass("bigValue")
}else{$("#transCostPostedSpan").text(d).removeClass("bigValue").show()}}}else{if(f===0){$("#transCostPendingSpan").text("")}else{if(parseInt(e,10)>1){d=e+" Items"}else{d=e+" Item"}$("#transCostPendingSpan").text(d).removeClass("bigValue").show()}}return d};List_mb.toggleROC=function(c,h){var l=$("#"+c);var d=l.find('[id^="offerIcon_"]');var f=$("#i"+c);if(f.hasClass("plus")&&d.hasClass("handImage")){d.removeClass("handImage")}else{if(f.hasClass("minus")){if(d.hasClass("offerTrans")){d.addClass("handImage")
}}}var e=$("#i"+c);if(e.hasClass("minus")){Omniture.report("list_collapse");List_mb.hideDetails(c)}else{if(e.hasClass("plus")){Omniture.report("list_expand");var n=l.find(".expando");if(n.length>0){List_mb.showDetails(c)}else{$("#x"+c).find(".etd-errorcss").remove();var m=l.find(".plus");$(m).attr("class","load");if(channelType==="M"){List_mb.loadROCDetails(c)}else{List.loadROCDetails(c)}}}}};List_mb.showDetails=function(o,e){var n=$("#x"+o);var c=$("#i"+o);if(!($.isUndefined(e))){$(n).append(e);
var d=$("#listHead").find("th:visible").length;if(d>0&&$(n).find(".etd-errorcss").length>0){$(".etd-errorcss").attr("colspan",d)}}var f=$(".listViewDispFormat24",n);var m=n.find(".expando");var l;m.hide();m.css({visibility:"hidden",position:"absolute"});n.show();m.css("width",f.width()+"px");m.removeAttr("style").hide();m.slideDown(500,"swing",function(){c.attr({"class":"minus minusGrey",title:"Hide Details"}).find("img:first").attr("alt","Collapse row "+(parseInt(o.substring(4))+1))})};List_mb.hideDetails=function(h){var f=$("#x"+h);
var c=$("#i"+h);var e=f.find(".expando");var d=f.find(".etd-error");if(e.length>0){e.slideUp(300,"swing",function(){f.hide();c.attr({"class":"plus plusGrey",title:"Show Details"}).find("img:first").attr("alt","Expand row "+(parseInt(h.substring(4))+1))})}else{if(d.length>0){d.slideUp(300,"swing",function(){f.hide();c.attr({"class":"plus plusGrey",title:"Show Details"}).find("img:first").attr("alt","Expand row "+(parseInt(h.substring(4))+1))})}}};List_mb.loadROCDetails=function(h){var f=$("#"+h);var d=false;
var m=$(f).attr("id").split("_")[0];if(m=="roc"){var c="postroc_"+f.attr("id").substring(4);if($("#postroc_"+f.attr("id").substring(4)).hasClass("dclOfferCedit")){d=true}$("#refSeNumber").val(f.attr("data-ref"));$("#pendingRequest").val("N")}if(m=="proc"){$("#refSeNumber").val($("#cproc_"+f.attr("id").substring(5)).val());$("#pendingRequest").val("Y")}$("#isPrintReq").val("");$("#exRocType").val("");$("#fetchPreferences").val(false);$("#jsonEtd").val(true);var l=[];l=formParameters.getParams("exroc.do");
l.push({name:"hasclass",value:d});var e=$.ajax("exroc.do",{type:"POST",data:l,success:function(q,o,s){if(s.getResponseHeader("MYCAError")==null){$.extend(q,{rocId:f.attr("id").substring(4)});$.extend(q,{colSpanVal:List_mb.colSpanValue()});q.channelType=channelType;var p=$.jcp("run","@list/etd",q);List_mb.showDetails(f.attr("id"),p);f.data("hasData",true);var n="offerIcon_"+f.attr("id").substring(4);if($("#"+n).hasClass("handImage")){$("#"+n).removeClass("handImage")}if($("#thStatus").length&&$("#thStatus").is(":visible")==true){var r="xlistDatarow_"+f.attr("id").substring(4);
$("#"+r).attr("colspan",5)}}else{List_mb.etdCommonError(h)}List_mb.deferred.resolve(true)},error:function(n){List_mb.etdCommonError(h);List_mb.deferred.resolve(true)}});$("#jsonEtd").val(false);$("#fetchPreferences").val(true);$("#pendingRequest").val("N")};List_mb.etdCommonError=function(d){var c=$("#"+d);var e="<td colspan='3' class='etd-errorcss'><div class='etd-error'>Unable to load transaction details.</div></td>";List_mb.showDetails(c.attr("id"),e);$("#i"+d).attr("class","minus minusGrey");
c.data("hasData",false)};List_mb.ETDClick=function(c,m){List_mb.deferred=$.Deferred();var h=$(c.target);var d;var o=false;if(channelType!=="M"){o=List.multiTagViewEnabled}if(!o){var f=h.closest("tbody[id]");var d=f.attr("id").split("_")[1];if(channelType!=="M"){var e=h.attr("id");if(!$.isUndefined(e)&&e.indexOf("inlineExploreOffers_")!=-1){c.preventDefault();EnterpriseOffers.getDeoOfferUrl()}var n=h.attr("id");if(!$.isUndefined(n)&&n.indexOf("delta_")!=-1){c.preventDefault();LegalPopUp.OpenLayer()
}}var l=h.closest("tbody[id*='roc']>tr");if(l.is("[id]")){if(l.attr("id").split("_")[0]=="postroc"){d="roc_"+d}else{if(l.attr("id").split("_")[0]=="pendroc"){d="proc_"+d}}if(!$.isUndefined(m)){List_mb.toggleROC(d,m)}else{List_mb.toggleROC(d,false)}}}return List_mb.deferred};List_mb.JCPDate=function(e){var c=new Date(parseInt(e,10));var d=monthNames[c.getMonth()]+" "+c.getDate()+" "+c.getFullYear();return d};List_mb.JCPReceiptDate=function(e){var c=new Date(parseInt(e,10));var d=("0"+(c.getMonth()+1)).slice(-2)+"/"+("0"+c.getDate()).slice(-2)+"/"+c.getFullYear();
return d};List_mb.JCPMonth=function(e){var c=new Date(parseInt(e,10));var d=monthNames[c.getMonth()];return d};List_mb.JCPYear=function(e){var c=new Date(parseInt(e,10));var d=c.getFullYear();return d};List_mb.JCPDateValue=function(e){var c=new Date(parseInt(e,10));var d=c.getDate();return d};List_mb.loadOfferCondition=function(c){if(c.creditRefIds!=null&&c.creditRefIds.length>0){List_mb.loadOfferRocs(c.creditRefIds)}};List_mb.loadOfferRocs=function(c){params=formParameters.getParams("exroc.do");
params.push({name:"filterOfferRequest",value:true});$.each(c,function(d,e){params.push({name:"refSeNumbers",value:c[d]})});$.ajax("exroc.do",{type:"POST",data:params,success:function(f,d,l){if(l.getResponseHeader("MYCAError")==null){if(l.getResponseHeader("OFFERSTRANSACTIONID")!=null){var e=l.getResponseHeader("OFFERSTRANSACTIONID");var h=new Array();if(e!=null){if(e.indexOf("-")==-1){h[0]=e}else{h=e.split("-")}$.each(h,function(n,p){var m=$("input.multiCheck[value*="+h[n]+"]").closest("tbody");var o=m.find('[id^="postroc_"]');
o.addClass("dclOfferCedit");var q=m.find('[id^="offerIcon_"]');m.find(".colAmmount").css({color:"#00693C","font-weight":"bold"});q.addClass("handImage offerTrans")})}}}},error:function(d){}})};$.isUndefined=function(c){return typeof c==="undefined"};List_mb.etdDetails=function(){var c=$("#listHead").find("th:visible").length;if(c===0){c=$(".trans-labels-head").find("td:visible").length}return c};List_mb.togglePending=function(c){c.preventDefault();if($("#recentTrans").hasClass("expanded")){Pending.RemoveRows();
$("#recentTrans").removeClass("expanded");if($("#topLinkPrintDis").length){$("#topLinkPrintDis").hide();$("#topLinkPrint").show()}$("#pendingOpen").val("false");$('tbody[id*="proc"]').remove();Pending.isOpen=false;$("#transCostPendingSpan").text("")}else{$("#recentTrans").addClass("expanded");$("#pendingOpen").val("true");Pending.open();Pending.isOpen=true}return false};$(window).resize(function(c){List_mb.resizeFunction();c.preventDefault()});List_mb.colSpanValue=function(){if(channelType==="M"){return 3
}else{return $("#listHead").find("th:visible").length}};List_mb.getTPType=function(c){switch(c){case 0:return"TimePeriod:Recent Activity";case 1:return"TimePeriod:Current Statement";case 2:return"TimePeriod:Previous Statement 1";case 3:return"TimePeriod:Previous Statement 2";case 4:return"TimePeriod:Previous Statement 3";case 5:return"TimePeriod:Previous Statement 4";case 6:return"TimePeriod:Previous Statement 5"}};List_mb.resizeFunction=function(){var c=parseInt($("body").css("width"),10);var d=$("#listHead").find("th:visible").length;
if(!$("#qblistData").is(":visible")){if($("body").hasClass("res_Small")||$("body").hasClass("Mobile")){$(".etd-details").attr("colspan",3);$(".postedHeader").attr("colspan",2);$(".pending-header").attr("colspan",1);$(".colSpanValue1").attr("colspan",3);$("#proc_error").find("td").attr("colspan",3);$("#listMsg").attr("colspan",3);$("#appendTransaction").find("td").attr("colspan",3)}else{if(d>0){$(".pending-header").attr("colspan",d-2);$(".etd-details").attr("colspan",d);$(".postedHeader").attr("colspan",d-1);
$(".colSpanValue1").attr("colspan",d).css("width","84%");$("#proc_error").find("td").attr("colspan",d);$("#listMsg").attr("colspan",d)}}}};var List={table:undefined,pageNumber:"pageNumber",numberOfPages:"numberOfPages",paginitationMsg:"Your selection will not be saved. Click on CANCEL to return to this page or CONTINUE to proceed to the next page.",selectEnabled:false,rpMenu:null,receiptId:null,prevPageNumber:1,container:null,paginationId:"",multiTagViewEnabled:false,highlight:[],rcCardHash:null,deferred:null};
List.init=function(){Filter.init();List.container=$("#listDataWrapper");if(Print.inPrintMode){Amex.Util.hideElements("listNavRPTop","listNavRPBottom")}if(List.table!=null){delete (List.table);List.table=null}if($("#"+Page.list.table).length){List.table=new ListTable(Page.list.table,{hoverClassName:"rowHover",expandClassName:"xrowExpand",plusImg:"plus",minusImg:"minux",loadImg:"load",loadMessage:null});List.table.on("rocLoad",List.loadROCDetails);List.table.on("rocClick",function(h){List.table.toggleROC($(h.target).attr("id"))
});if(List.selectEnabled){List.table.enableSelect()}if($("#listHead").length){$("#listHead").on("click",List.sort)}var d=$("#pageNumTop");if(d.length){List.prevPageNumber=d.val();d.keydown(List.go).focus(List.focusNavField).blur(List.blurNavField)}if($("#pageNumBottom").length){$("#pageNumBottom").keydown(List.go).focus(List.focusNavField).blur(List.blurNavField)}if($("#recentTransaction").length){$("#recentTransaction").on("mouseover",function(){$(this).css({cursor:"pointer"})});$("#recentTransaction").on("mouseout",function(){if($("#pendingHelp").is(":ui-callout")){$("#pendingHelp").callout("close")
}});$("#pendingHelp").css({cursor:"pointer"})}$("#pendingHelp").css({cursor:"pointer"})}if($("#shouldDisplayCat").val()=="true"){Preferences.showDynaCols=true}if(typeof($("#listDataWrapper").val())!="undefined"){$("#listDataWrapper").off("mouseover mouseout click").on("click","img.tagX",Tag.quickRemove).on("click","#autoTagRuleId",Tag.toggleInlineRulesView).on("click","a.greyTag, a.goldTag",Tag.toggleInlineView).on("click","a.plus, a.minus",function(h){h.preventDefault()}).on("click",".pending-icon",function(h){h.preventDefault()
}).on("click",".close-helpcharges",function(h){h.preventDefault()}).on("click","#createMerRule",Tag.createMerchantRule).on("click","#closeMerRule",Tag.closeMerchantRule).on("click","input.multiCheck",List.multiCheck).on("click","input.multiTagCheckBox",List.multiTagCheckBox).on("click","a.printLink",List.printLink).on("click","a.receiptLink",Receipt.viewReceipts).on("click",'tbody[id*="roc"]',List.ETDClick).on("mouseover",List.fireMouseOn).on("mouseout",List.fireMouseOff).on("click","a.editRcptLink",ReceiptUI.viewRcptDetails).on("click","a.addReceiptLink",ReceiptUI.addReceipt);
$(document.body).on("click","#tagListBlock input",Tag.check)}List_mb.init();ListLinks.init();var e=$("#offerLinkEligible").val();if(e=="false"){App.pznCall()}if(!QB.isQBTransOpen){OfferDetail.initSpendBasedOffer();EnterpriseOffers.initEOSffer()}var c=$("#startDate").val();var f=$("#endDate").val();if(c!=null&&f!=null){c=c.slice(-4);f=f.slice(-4);if(c==f){$(".estmt-year").hide()}}$(".tagBarROC").tagbar();$(".close-helpcharges").on("click",Pending.closeHelp);if($("#pendingHelp").length){$("#pendingHelp").on("click",Pending.closeHelp).on("click",Pending.initDisclosure)
}};List.focusNavField=function(c){this.oldValue=this.value};List.blurNavField=function(c){this.value=this.oldValue};List.isPendingVisible=function(){var c=$("#"+List.pageNumber).val();if(c>1&&channelType!=="M"){$("#recentTransaction").hide();$("#pendingHelp").hide()}else{$("#recentTransaction").show()}};List.load=function(d,h,f){if(d=="tpChange.do"){Rewards.rewardsBoxContent="";Rewards.eosOffersTBContent="";Rewards.featuredBoxContent="";Rewards.featuredBoxEPPContent="";Rewards.QbBoxContent="";Rewards.receiptTBContent="";
Rewards.tagsBoxContent="";Rewards.yesOfferBoxContent=""}if($("#pendingOpen").val()=="false"){if($("#pendingItems").length&&$("#pendingTransCount").length){$("#pendingItems").html("");$("#pendingTransCount").val("")}}if(channelType!=="M"){Amex.OverlayManager.block()}Tag.close();var l=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c&&(d=="filterlist.do"||d=="tpChange.do"||d=="listControls.do")){l=formParameters.getParams(d);if(h=="filter"){if($("#fromAmount").length&&$("#toAmount").length){l.push({name:"filterFromAmnt",value:$("#fromAmount").val()});
l.push({name:"filterToAmnt",value:$("#toAmount").val()})}}}else{if(channelType==="M"&&(d=="cardChangeList.do")){l=formParameters.getParams(d)}else{l=$("#"+Page.form.id).serializeArray()}}if(QB.isQBTransOpen){l.push({name:"qbSortOrder",value:$("#sortOrder").val()});l.push({name:"qbSortBy",value:$("#sortBy").val()})}var e=$.ajax(d,{type:"POST",data:l,success:function(u,y,A){if(A.getResponseHeader("MYCAError")==null){$("#spinnerTimePeriod").hide();if(A.getResponseHeader("liteEnabled")==null){$("#normalViewCardChanged").val("false");
Status.fireSuccess("list",A);if($("#tagEligible").val()=="true"){Tag.init()}List.isPendingVisible();if(h=="listSort"){$('#listHead [class^="sort"]').prev().focus();if($("#recentTransaction").length&&($("#pendingOpen").length)&&($("#pendingOpen").val()=="true")){$("#sortClicked").val(true);if(!QB.isQBTransOpen){Pending.open()}}Amex.OverlayManager.unblock(false,"mainContentData")}else{if(h=="tpChange"){$("#expandTP").focus();Pending.RemovePendingCountItems()}else{if(h=="pagination"||h=="rowsPerPage"){$("#"+List.paginationId).focus();
if($("#pageChange").val()=="true"){List.rpMenu.toggle();$("#pageChange").val("false")}}else{if(h=="refreshView"){$("#tagOperation").val(TagAction.action.GET_RULES);if(TagUI.tagRulesLayer&&TagUI.tagRulesLayer.visible()){Amex.PageOverlay.show()}TagAction.getRules();TagUI.tagRulesLayer._focus.focus()}else{if(h=="filter"){if($("#recentTransaction")!=null&&($("#pendingOpen").length)&&($("#pendingOpen").val()=="true")){if(!Filter.tagsSelectedCnt>0){Pending.pendingCharges()}else{if(!$("#recentTrans").hasClass("expanded")){$("#recentTrans").addClass("expanded")
}var s=$("<tbody/>").attr("id","proc_error");var r=$("<tr/>");var E=$("<td/>").attr({colSpan:"9",align:"middle",style:{padding:"0px"}});var v=$("<div/>").addClass("noListResultsDisplay");var D=document.createTextNode("There are no transactions meeting the selected criteria.");v.append(D);E.append(v);r.appendChild(E);s.appendChild(r);$("#pendingHdr").after(s);var s=$("<tbody/>").attr("id","proc_total");var r=$("<tr/>");var E=$("<td/>").attr({colSpan:"8"}).addClass("pendingMiniSummary");var v=$("<div/>").attr("id","summaryPendingTable");
var p=$("<span/>").addClass("summaryPendingTotal");var m=document.createTextNode("Total");p.append(m);var q=$("<span/>").addClass("summaryPendingData");q.append(document.createTextNode("0.00"));var t=$("<div/>").addClass("dots");t.append(p);t.append(q).append(t);E.append(v);r.append(E);s.append(r);$("#proc_error").after(s);Amex.OverlayManager.unblock(false,"mainContentData")}}}else{if(h=="qbTransactions"){$("#openManageQBTrans").val("N");$("#syncConfirmDiv").remove();$("#qbChangeType").val("");if($("#qbJSONData").val()!=null&&$("#qbJSONData").val()!=""){qbData=$.parseJSON($("#qbJSONData").val());
QB.manageCardData=qbData;if(QB.manageCardData.displayQBCardList.listOfEnrolledCards.length>0){QB.isQBTransChanged=true;if(!QBDropDown.isCardChange&&!QBDropDown.isTimePeriodChange){QB.showTransactionsLayer()}else{QBDropDown.isCardChange=false;QBDropDown.isTimePeriodChange=false;QBDropDown.period=null;QB.periodList=QB.manageCardData.qbTimePeriodList;QBDropDown.init();if(Preferences.showDynaCols){$("#cardSortSpan1").css("margin-left","635px")}else{$("#cardSortSpan").css("margin-left","461px")}$(".qbSynced").closest("tbody").find("[id^=croc_]").prop("disabled",true);
if($("#eligibleForSyncAndCP").val()!=="true"){$("#listData :checkbox").each(function(F,G){$(G).prop("disabled","disabled")});$(".primary").attr("disabled","disabled");$(".primary").addClass("qbPanelDisable")}var z=QBDropDown.period.getSelected();if(z==null){var B=Date.parseString($("#startDate").val(),"MMddyyyy");if(B){$("#"+QBDropDown.fromField).val(B.format("MM/dd/yyyy"))}B=Date.parseString($("#endDate").val(),"MMddyyyy");if(B){$("#"+QBDropDown.toField).val(B.format("MM/dd/yyyy"))}}Omniture.report("QB_ManageTrans_Change")
}$("#qbtimePeriodDesc").html(QB.manageCardData.displaySelCycleDesc);$("#qbtimePeriodSelectedCycle").html(QB.manageCardData.displaySelectedCycle);if($("#bPIndex").val()==="-99"){var x=Date.parseString($("#"+QBDropDown.fromField).val(),"M/d/y");var C=Date.parseString($("#"+QBDropDown.toField).val(),"M/d/y");var w="from "+x.format("NNN dd, yyyy")+" to "+C.format("NNN dd, yyyy");$("#qbtimePeriodSelectedCycle").html(w)}if($("#listData").length==0){$.overlay("buttons")[2].addClass("disabled")}else{if($.overlay("buttons")[2].hasClass("disabled")){$.overlay("buttons")[2].removeClass("disabled")
}}QB.bindTransEvents();QB.transCountDisplay(QB.manageCardData.totalTransCount,QB.manageCardData.totalTransNotSync)}else{if($(".ui-overlay:visible").length){QB.showQBErrorMessage("You are not having any cards mapped to QuickBooks")}else{Amex.Msg.error("error processing request","You are not having any cards mapped to QuickBooks",true,null)}}}}else{if(h=="pendingTagFilter"){if($("#recentTransaction")!=null&&($("#pendingOpen").length)&&($("#pendingOpen").val()=="true")&&!QB.isQBTransOpen){if(!$("#recentTrans").hasClass("expanded")){$("#recentTrans").addClass("expanded")
}var s=$("<tbody/>").attr("id","proc_error");var r=$("<tr/>");var E=$("<td/>").attr({colSpan:"9",align:"middle",style:{padding:"0px"}});var v=$("<div/>").addClass("noListResultsDisplay");var D=document.createTextNode("There are no transactions meeting the selected criteria.");v.append(D);E.append(v);r.append(E);s.append(r);$("#pendingHdr").after(s);Amex.OverlayManager.unblock(false,"mainContentData");Pending.RemovePendingCountItems()}}else{if(h=="search"){if(!QB.isQBTransOpen){Pending.open()}}}}}}}}}if(QB.isQBTransOpen){$(".thCOA, .colCOA, .thStatus, .colStatus").show();
$("#recentTransaction, #summaryTable, #tbllinks, #disputelnk, #footNotes, #cmSnapshot, .tagBarROC, #triggerMSG, #plumMessage").hide();$(".postedTransDivHeader").closest("tbody").hide();$("#pendingHdr").hide();$("#proc_error").hide();if($("#blackStar").length){$("#blackStar").hide()}if($("#goldStar").length){$("#goldStar").hide()}$(".qbCheckAll").show().on("click",function(){if($(this).is(":checked")){QBTags.toggleCheckAll(true)}else{QBTags.toggleCheckAll(false)}});$(".colCOA").on("click",function(){return false
});$(".COASelect").coamenu({tagsJSON:QB.manageCardData.qbTagList});$(".COASelect.display_none").next(".ui-coamenu-wrapper").hide();if(!List.container.hasClass("printMode")){List.container.addClass("printMode")}$(".COATagX").off("click",QBTags.removeCOA);$(".COATagX").on("click",QBTags.removeCOA);if($("#qbJSONData").val()!=null&&$("#qbJSONData").val()!=""){var n=$.parseJSON($("#qbJSONData").val());QB.transCountDisplay(n.totalTransCount,n.totalTransNotSync)}if($("#listMsg").length){if($("#multiCardView").val()==="true"){$("#listMsg").attr("colspan",12)
}else{$("#listMsg").attr("colspan",11)}}if($(".qbNotSynced").length==0){$(".qbCheckAll").prop("disabled",true);$.overlay("buttons")[2].addClass("disabled")}$(".qbSynced").closest("tr").find("input[type=checkbox][id^=croc_]").prop("disabled",true)}}else{var o="list.do?request_type=authreg_Statement&sorted_index=0&Face=en_US&liteEnabled=true";Page.form.submit(o)}if(Print.individualPrintMode){Print.initIndividual();$("#"+List.paginationId).focus()}}else{Status.fireMycaError("list",A);if(h=="listSort"){if($("#preferenceDisabled").val()=="false"){$("#sortClicked").val("false")
}Amex.Msg.setTriggerNode($('#listHead [class^="sort"]').prev())}else{if(h=="tpChange"){Amex.Msg.setTriggerNode("expandTP")}else{if(h=="pagination"||h=="rowsPerPage"){Amex.Msg.setTriggerNode(List.paginationId)}else{if(h=="qbTransactions"){if(QBDropDown.isCardChange){$("#qbcarddescription").html(QB.manageCardData.displayCardDesc);$("#qbaccount").html(QB.manageCardData.displayCardAcct)}else{if(QBDropDown.isTimePeriodChange){$("#qbtimePeriodDesc").html(QB.manageCardData.displaySelCycleDesc);$("#qbtimePeriodSelectedCycle").html(QB.manageCardData.displaySelectedCycle)
}}}}}}}$("#listJson").val("false");List_mb.resizeFunction()},error:function(n){Status.fireHttpError("list",n);$("#listJson").val("false");if(h=="listSort"){if($("#preferenceDisabled").val()=="false"){$("#sortClicked").val("false")}var m=$("#listHead").select('[class^="sort"]');Amex.Msg.setTriggerNode($('#listHead [class^="sort"]').prev())}else{if(h=="tpChange"){Amex.Msg.setTriggerNode("expandTP")}else{if(h=="pagination"||h=="rowsPerPage"){Amex.Msg.setTriggerNode(List.paginationId)}else{if(h=="qbTransactions"){$("#qbChangeType").val("");
if(QBDropDown.isCardChange){$("#qbcarddescription").html(QB.manageCardData.displayCardDesc);$("#qbaccount").html(QB.manageCardData.displayCardAcct)}else{if(QBDropDown.isTimePeriodChange){$("#qbtimePeriodDesc").html(QB.manageCardData.displaySelCycleDesc);$("#qbtimePeriodSelectedCycle").html(QB.manageCardData.displaySelectedCycle)}}}}}}}});Status.fireStart("list",e)};List.checkROC=function(f){f=$(f);if(List.table!=null){List.table.checkROC(f);var d=List.table.selectedKeys().length;var h=$("#listData tbody").length;
if(List.multiTagViewEnabled&&TagList.selectedTags.length>0){var c=f.attr("id").split("_")[1];if(f.attr("type")=="checkbox"&&f.is(":checked")){Tag.report("tag_multi_apply_roc");Tag.applyTag(c,TagList.selectedTags,$("#itag_"+c))}else{Tag.report("tag_multi_remove_roc");Tag.removeTag(c,TagList.selectedTags,$("#itag_"+c))}}}};List.checkFocus=function(c){$(c).addClass("focused")};List.checkBlur=function(c){$(c).removeClass("focused")};List.paFocus=function(c){var d=$(c).attr("id")+"Lbl";if($("#"+d)){$("#"+d).addClass("focused")
}};List.paBlur=function(c){var d=$(c).attr("id")+"Lbl";if($(d)){$(d).removeClass("focused")}};List.setSelectEnabled=function(c,d){if(List.table){if(!List.selectEnabled&&c){List.table.enableSelect(d)}else{if(List.selectEnabled&&!c){List.table.disableSelect()}}List.selectEnabled=c}};List.enablePrintMode=function(){if(List.container!=null){List.container.addClass("printMode")}};List.disablePrintMode=function(){if(List.container!=null){List.container.removeClass("printMode")}};List.enableTagMode=function(){if(List.container!=null){List.multiTagViewEnabled=true;
List.container.addClass("tagMode")}if(List.table!=null){List.table.uncheckAll()}};List.disableTagMode=function(){if(List.container!=null){List.multiTagViewEnabled=false;$("#checkAll").prop("checked",false);Tag.unHighLightTagIcon();List.container.removeClass("tagMode")}if(List.table!=null){List.table.uncheckAll()}};List.loadROCDetails=function(d,c){var p=c.object;var o=false;var n=$(p).attr("id").split("_")[0];if(n=="roc"){var e="postroc_"+p.attr("id").substring(4);if($("#postroc_"+p.attr("id").substring(4)).hasClass("dclOfferCedit")){o=true
}var q="rcptIdInline_"+p.attr("id").substring(4);var m="rcCardHashInline_"+p.attr("id").substring(4);$("#refSeNumber").val(p.attr("data-ref"));$("#pendingRequest").val("N")}if(n=="proc"){$("#refSeNumber").val($("#cproc_"+p.attr("id").substring(5)).val());$("#pendingRequest").val("Y")}$("#isPrintReq").val("");$("#exRocType").val("");$("#fetchPreferences").val(false);$("#jsonEtd").val(true);var f=[];f=formParameters.getParams("exroc.do");var l=$("#multiCardView").val()=="true"?true:false;if(!l){f=formParameters.getParams("exroc.do");
f.push({name:"hasclass",value:o})}else{f=$("#"+Page.form.id).serialize()}var h=$.ajax("exroc.do",{type:"POST",data:f,success:function(x,w,t){if(t.getResponseHeader("MYCAError")==null){var z=p.attr("id").split("_")[1];DisputeNotification.disputeIndex=z;$.extend(x,{rocId:p.attr("id").substring(4)});$.extend(x,{colSpanVal:List_mb.colSpanValue()});var s=$.jcp("run","@list/etd",x);var u=$.jcp("run","@list/etd-resource14#etd-main",x);var r=$(p).attr("id").split("_")[1];$("#roc_"+r).data($(p).attr("id"),u);
p.record("setDetails",$.jcp("run","@list/etd",x));p.data("hasData",true);var y="offerIcon_"+p.attr("id").substring(4);if($("#"+y).hasClass("handImage")){$("#"+y).removeClass("handImage")}List.receiptId=q;List.rcCardHash=m;ReceiptUI.index=p.attr("id").substring(4);if($("#mpcdEligible").val()=="true"){if($("#corporate").val()=="false"){if(p.attr("id").split("_")[0]=="proc"){DisputeNotification.init("unMarkedDiv_"+DisputeNotification.disputeIndex,DisputeNotification.disputeIndex,"proc_")}}}if($("#thStatus").length&&$("#thStatus").is(":visible")==true){var v="xlistDatarow_"+p.record("getRocId");
$("#"+v).attr("colspan",5)}}else{p.record("setDetails","<td colspan='3' class='etd-errorcss'><div class='etd-error'>Unable to load transaction details.</div></td>");p.data("hasData",false);$(".etd-errorcss").attr("colspan",List_mb.colSpanValue)}if(null!=List.deferred){List.deferred.resolve(true)}},error:function(r){p.record("setDetails","<td colspan='3' class='etd-errorcss'><div class='etd-error'>Unable to load transaction details.</div></td>");p.data("hasData",false);$(".etd-errorcss").attr("colspan",List_mb.colSpanValue);
List.deferred.resolve(true)}});$("#jsonEtd").val(false);$("#fetchPreferences").val(true);$("#pendingRequest").val("N")};List.nav=function(c){Tag.close();if((Print.inPrintMode)&&List.table.hasSelected()||(QB.isQBTransOpen&&QBTags.isAnyRowChecked())){List.navDir=c;Amex.Msg.confirmContinue(Amex.Msg.msgConfirm,List.paginitationMsg,true,"","",function(d){if("CONTINUE"==d){List._nav(List.navDir)}else{val=$("#"+List.pageNumber).val();$("#pageNumTop").val(val);$("#pageNumBottom").val(val)}});Amex.Msg.setTriggerNode(c)
}else{List._nav(c)}};List.go=function(d){Tag.close();if(d.which==Amex.KEY_RETURN){d.stopPropagation();var c=parseInt($(d.target).val());var e=$(d.target).attr("id");if(isNaN(c)){val=$("#"+List.pageNumber).val();$("#pageNumTop").val(val);$("#pageNumBottom").val(val)}else{List.pageToGo=c;if("pageNumTop"==e){List.nav("pageNumTop")}else{List.nav("pageNumBottom")}}}};List._nav=function(f){var e=parseInt($("#"+List.pageNumber).val());List.prevPageNumber=e;var c=parseInt($("#"+List.numberOfPages).val());
var d=-1;if("FTop"==f||"FBottom"==f){d=1;Omniture.report("pag_first")}else{if("PTop"==f||"PBottom"==f){d=e-1;Omniture.report("pag_prev")}else{if("NTop"==f||"NBottom"==f){d=e+1;Omniture.report("pag_next")}else{if("LTop"==f||"LBottom"==f){d=c;Omniture.report("pag_last")}else{if("pageNumTop"==f){d=List.pageToGo;Omniture.report("pag_go")}else{if("pageNumBottom"==f){d=List.pageToGo;Omniture.report("pag_go")}}}}}}List.paginationId=f;if((d!=e)&&(d>=1)&&(d<=c)){$("#pendingOpen").val("false");$("#"+List.pageNumber).val(d);
Status.startLoad("listOnly");if(QB.isQBTransOpen){$("#intuitRequestType").val("getListQBData");$("#connectionId").val(QB.connectionId)}List.load("listControls.do","pagination")}else{$("#pageNumTop").val(e);$("#pageNumBottom").val(e)}Pending.RemovePendingCountItems()};List.sort=function(c){var e=false;var l=$(c.target);if(l.hasClass("thDyna")||l.closest(".thDyna").length){e=true}if(Print.inPrintMode||QB.isQBTransApprove){if(l.hasClass("thCheck")||l.hasClass("spanCheckAll")||l.hasClass("qbCheckAll")){return
}if(!e){var f="Sorting is inactive when you are in print mode.";if(QB.isQBTransApprove){f="Sorting is inactive when you are on approval screen."}Amex.Msg.alert(Amex.Msg.information,f,true,null,350);if(l.length&&l.tagName=="A"){Amex.Msg.setTriggerNode(l.attr("id"))}else{Amex.Msg.setTriggerNode(l.children()[0].id)}}return}if(TagUI!=null&&TagUI.isMultiTagView&&!e){if(l.hasClass("thCheck")||l.hasClass("spanCheckAll")){return}if(!l.is("input")){Amex.Msg.alert(Amex.Msg.information,"Sorting is inactive when you are in Multi Tag View.",true,null,400);
if(l.is("a")){Amex.Msg.setTriggerNode(l.attr("id"))}else{Amex.Msg.setTriggerNode(l.children.attr(d))}}return}var h=$(c.target).attr("id");if(l.is("span")&&(l.hasClass("sortAsc")||l.hasClass("sortDesc"))){var d=l.parent("th").attr("id");h=d}else{var d=l.closest("th").attr("id")}if(!($("#preferenceDisabled").val()=="false")){h=d}var o=null;var n=$("#sortBy");if("thCheck"==h||"thPlus"==h){return true}else{if("thDate"==h||"dateHead"==h){o=$("#sortOrderDate");n.val(1);Omniture.report("list_sort_date")
}else{if("thDesc"==h||"descHead"==h){o=$("#sortOrderDesc");n.val(2);Omniture.report("list_sort_desc")}else{if("thReceipt"==h){return true}else{if("thForAmmount"==h||"forAmtHead"==h){o=$("#sortOrderForAmount");n.val(30);Omniture.report("list_sort_fs")}else{if("thCat"==h||"catHead"==h){o=$("#sortOrderCategory");n.val(5);Omniture.report("list_sort_category")}else{if("thCatSubCat"==h||"cat_subCatHead"==h){o=$("#sortOrderCatSubCat");n.val(51);Omniture.report("list_sort_category")}else{if("thName"==h||"cmNameHead"==h){o=$("#sortOrderCM");
n.val(0);Omniture.report("list_sort_cm")}else{if("thAmmount"==h||"amtHead"==h){o=$("#sortOrderAmount");n.val(4);Omniture.report("list_sort_amount")}else{if("thCard"==h||"cardNameHead"==h){o=$("#sortOrderCard");n.val(0);Omniture.report("list_sort_card")}else{return}}}}}}}}}}if(o.val()=="A"){o.val("D")}else{o.val("A")}$("#sortOrder").val(o.val());var m=$("#pageNum");if(m.length){$("#"+List.pageNumber).val(m.val())}$("#currentSortCol").val($("#sortBy").val());$("#currentSortOrder").val($("#sortOrder").val());
if($("#preferenceDisabled").val()=="false"){$("#sortClicked").val("true")}Status.startLoad("listOnly");if(QB.isQBTransOpen){$("#intuitRequestType").val("getListQBData");$("#connectionId").val(QB.connectionId)}if(QB.isQBTransOpen&&QBTags.isAnyRowChecked()){Amex.Msg.confirmContinue(Amex.Msg.msgConfirm,List.paginitationMsg,true,"","",function(p){if("CONTINUE"==p){List.load("listControls.do","listSort")}else{return}})}else{List.load("listControls.do","listSort")}};List.togglePlum=function(){var c=$("#plumText");
if(c.is(":visible")){c.slideUp([0.3]);if($("#plumLink").hasClass("plumMinus")){$("#plumLink").removeClass("plumMinus");$("#plumLink").addClass("plumPlus")}Omniture.report("plum_collapse")}else{c.slideDown([0.3]);if($("#plumLink").hasClass("plumPlus")){$("#plumLink").removeClass("plumPlus");$("#plumLink").addClass("plumMinus")}Omniture.report("plum_expand")}};List.toggleFPO=function(){var c=$("#fpoText");if(c.is(":visible")){Effect.BlindUp(c.id,{duration:0.3});if($("#fpoText").hasClass("plumMinus")){$("#fpoText").removeClass("plumMinus");
$("#fpoText").addClass("plumPlus")}Omniture.report("fpo_collapse")}else{Effect.BlindDown(c.id,{duration:0.3});if($("#fpoText").hasClass("plumPlus")){$("#fpoText").removeClass("plumPlus");$("#fpoText").addClass("plumMinus")}Omniture.report("fpo_expand")}};List.destroy=function(){if(List.table!=null){List.table.off("rocLoad",List.loadROCDetails)}if($("#listHead").length){$("#listHead").off("click",List.sort)}};List.rowsPerPage=function(c){$("#pageChange").val("true");if(List.rpMenu==null){List.rpMenu=new Amex.Menu({theme:"listNavMenu",nextFocus:"dateHead",position:"br",style:{width:"80px"},columns:1,shadow:{size:4,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}},[new Amex.MenuItem("rp100","<a title='' href='#' onclick='{return false;}'>100 per page</a>"),new Amex.MenuItem("rp200","<a title='' href='#' onclick='{return false;}'>200 per page</a>"),new Amex.MenuItem("rp300","<a title='' href='#' onclick='{return false;}'>300 per page</a>")]);
List.rpMenu.render(document.body);List.rpMenu.on("click",function(e,h){$("#pageChange").val("false");var l=h.object.id;List.paginationId=c.id;var f=l.substring(2,l.length);var d=$("#maxPerPage");Status.current.selMaxPerPage=d.val();if(d.val()!=f){d.val(f);$("#"+List.pageNumber).val(1);Status.startLoad("listOnly");List.load("listControls.do","rowsPerPage");Omniture.report("pag_by",f)}})}List.rpMenu.setPositionRelative(0,0,c,"bl");List.rpMenu.toggle()};List.checkAllROC=function(d){var c=null;if(!d.is(":checked")){c=List.table.getSelectedIds()
}if(d.attr("type")=="checkbox"){$(".multiCheck").each(function(){var e=$(this);if(e.attr("id")!="checkAll"){if(e.attr("type")=="checkbox"){e.prop("checked",d.is(":checked"))}List.table.checkROC(e)}});if(TagList.selectedTags.length>0){if(d.is(":checked")){c=List.table.getSelectedIds();Tag.report("tag_multi_selectall");Tag.applyTag(c,TagList.selectedTags,$("#sChkAll"))}else{Tag.report("tag_multi_unselectall");Tag.removeTag(c,TagList.selectedTags,$("#sChkAll"))}}}return true};List.multiCheck=function(c){c.stopPropagation();
var d=$(this);if(TagLock.check(d.val())>0){}else{List.checkROC(d)}};List.multiTagCheckBox=function(c){c.stopPropagation();if($.isEmptyObject(TagLock.locks)){}List.checkAllROC($(c.target))};List.printLink=function(c){var d=$(this);if(List.multiTagViewEnabled==false){Print.rocDetails(d.attr("id").split("printrocLink")[1]);Omniture.report("printrocLink")}return false};List.ETDClick=function(f,e){List.deferred=$.Deferred();var m=$(f.target);var n;if(List.multiTagViewEnabled==false){var d=m.closest("tbody[id]");
var n=d.attr("id").split("_")[1];if(channelType!=="M"){var l=m.attr("id");if(!$.isUndefined(l)&&l.indexOf("inlineExploreOffers_")!=-1){f.preventDefault();EnterpriseOffers.getDeoOfferUrl()}var c=m.attr("id");if(!$.isUndefined(c)&&c.indexOf("delta_")!=-1){f.preventDefault();Omniture.report("delta_click");LegalPopUp.OpenLayer()}}var h=m.closest("tbody[id*='roc']>tr");if(h.is("[id]")){if(h.attr("id").split("_")[0]=="postroc"){n="roc_"+n}else{if(h.attr("id").split("_")[0]=="pendroc"){n="proc_"+n}}if(!$.isUndefined(e)){List.table.toggleROC(n,e)
}else{List.table.toggleROC(n,false)}}}return List.deferred};List.fireMouseOn=function(f){if(f){var d=$(f.target);if(d.hasClass("tagX")){d.closest("span.tagright").find("a").addClass("tagxred")}if(d.hasClass("plus")){d.removeClass("plusGrey");d.addClass("plusBright")}if(d.hasClass("minus")){d.removeClass("minusGrey");d.addClass("minusBright")}d=d.closest("tbody.even, tbody.odd");if(d.length){if(List.highlight.length>0){for(var c=0;c<List.highlight.length;c++){List.highlight[c].removeClass("rowHover")
}List.highlight.length=0}d.addClass("rowHover");List.highlight.push(d)}}};List.fireMouseOff=function(d){if(d){var c=$(d.target);if(c.hasClass("tagX")){d.stopPropagation();c.closest("span.tagright").find("a").removeClass("tagxred");return}if(c.hasClass("plus")){c.removeClass("plusBright");c.addClass("plusGrey")}if(c.hasClass("minus")){c.removeClass("minusBright");c.addClass("minusGrey")}c=c.closest("tbody");if(c.length){c.removeClass("rowHover")}}};List.getDate=function(f){var h=new Date(parseInt(f,10));
var c=h.getDate();var e=((("0"+(h.getMonth()+1)).slice(-2))+"/"+(("0"+h.getDate()).slice(-2))+"/"+h.getFullYear());return e};List.getDeltaURL=function(){window.open("http://www.delta.com/firstbagfree")};var LegalPopUp={window:null,OpenLayer:function(){if(LegalPopUp.window==null){LegalPopUp.window=new Amex.Window({modal:true,left:150,top:200,buttons:["close"],title:"",zIndex:9000,theme:"amexWindow",onClose:LegalPopUp.close,shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});
var d=null;var c=null;c="List.getDeltaURL();";var d='<div class="contanierSize"><div style="display:inline-block"><img src="images/061011_prefedint_CCSG_Logo.jpg" style="float: left;"></div><p class="exitMessage"><b>You are now leaving this American Express website.</b></p><br><p class="exitMessage">You are about to enter a third-party website where all use is governed by that website\'s terms and conditions and subject to its privacy and security policies and practices. In no event will American Express be liable or responsible for any loss, damage, cost or expense arising from or in connection with your access to and use of the third-party website.</p> <div class=\'textAlign continuePlace\'><button id="continueButtonExitMessage" class="blueButton continuePlacer lastFocus" onclick="{LegalPopUp.close();'+c+'return false;}" title="Continue" type="button"><span class="blueWrapper lastFocus">Continue</span> </button></div></div>';
LegalPopUp.window.update(d);LegalPopUp.window.render(document.body)}LegalPopUp.window.centerInViewport();LegalPopUp.window.open();LegalPopUp.window._setFocusCycle("continueButtonExitMessage");Amex.PageOverlay.enableAlertMode()},close:function(){LegalPopUp.window.close();Amex.PageOverlay.disableAlertMode()}};List.list_template=function(n){try{var x=this,y=1422;var e="";var K="false";var m="false";var D=false;y=1428;if(x.rcCardEligible){if(!x.liteEnabled){K="true"}}var r="false";if(x.shouldDisplayCMNameColumn){m="true"
}var C="";var s="showMoreNone";var u=document.getElementById("imgLocation").value;y=1446;e+='<input type="hidden" name="sortBy" id="sortBy" value=\''+x.paginationData.sortBy+'\' /><input type="hidden" name="sortOrder" id="sortOrder" value=\''+x.paginationData.sortOrder+'\' /><input type="hidden" name="unPostedSortBy" id="unPostedSortBy" value=\''+x.paginationData.sortBy+'\' /><input type="hidden" name="unPostedSortOrder" id="unPostedSortOrder" value=\''+x.paginationData.sortOrder+'\' /><input type="hidden" id="curSavCol" value="'+x.currSortSaveCol+'" /><input type="hidden" id="curSavOrdder" value="'+x.currSortSaveOrder+'" /><input type="hidden" id="curSelCol" value="'+x.currDynaCol+'" /><input type="hidden" id="addnCol" value="'+x.additionalCol+'" /><table id="listData" cellpadding="0" cellspacing="0" border="0" class="checkOff estmt-trans listdata-style">';
C=x.searchText?"searchText":"";e+='<thead id="tableHeaderBox" class="trans-labels-head mobile-tableheader '+C+'"><tr id="mobile-trdata"><td class="trans-expander-header" scope="row"></td><td class="trans-date-header">DATE</td><td class="trans-cost-header">AMOUNT </td></tr></thead><thead class="desktop-tableheader"><tr id="listHead">';y=1452;if(x.customerRole!="AA"&&x.tagEligible){e+='<th scope="col" style="border-left: 1px solid #cccccc;" class="padding-heading thCheck listViewDispFormat20 trans-date-header trans-headerline trans-head-border" id="listDatacol1"><div id="sChkAll" class="spanCheckAll checkAllAlign"><img alt="" src="'+u+'/clear.gif" title="" class="checkAllImageAlign" />';
e+='<input type="checkbox" name="checkAll" id="checkAll" class="multiTagCheckBox tag1 printSelectAllCheck posAbsolute" title="" />';e+='<label for="checkAll" class="accessText">Select all Transactions. </label></div></th>'}else{if(!x.tagEligible){e+='<th scope="col" class="padding-heading thCheck listViewDispFormat20 trans-date-header trans-headerline" id="listDatacol1">';e+='<input type="checkbox" name="checkAll" id="checkAll" class="multiTagCheckBox tag1 printSelectAllCheck" title="" />';e+='<label for="checkAll" class="accessText">Select all Transactions. </label></th>'
}else{e+='<th scope="col" class="padding-heading thCheckAA listViewDispFormat20 trans-date-header trans-headerline" id="listDatacol1">';e+='<input type="checkbox" name="checkAll" id="checkAll" class="multiTagCheckBox tag1 printSelectAllCheck" title="" />';e+='<label for="checkAll" class="accessText">Select all Transactions. </label></th>'}}y=1468;e+='<th scope="col" class="padding-heading thCheck trans-date-header trans-headerline trans-head-border" id="listDatacol2">&nbsp;</th><th scope="col" class="padding-heading thDate trans-date-header trans-headerline trans-head-border border-corner" id="thDate"><a href="#" id="dateHead" title="Sort transactions by Date" onclick="{return false;}"><span class="accessText">Sort transactions by</span>Date</a>';
if(x.paginationData!=null&&x.paginationData.sortBy=="1"){if(x.paginationData.sortOrder=="A"){e+='<span class="sortAsc">&nbsp;</span><input type="hidden" name="sortOrderDate" id="sortOrderDate" value="A" />'}if(x.paginationData.sortOrder=="D"){e+='<span class="sortDesc">&nbsp;</span><input type="hidden" name="sortOrderDate" id="sortOrderDate" value="D" />'}}if(x.paginationData.sortBy!="1"){e+='<input type="hidden" name="sortOrderDate" id="sortOrderDate" value="D" />'}e+="</th>";C="";var L="";if(K=="false"&&m=="false"){C="nocmrecep-desc"
}else{if(K=="false"){C="noreceipt-desc"}else{if(m=="false"){C="nocm-desc"}else{C="descClass"}}}if(x.multiCardView){L="multi-desc"}y=1497;e+='<th scope="col" class="'+C+" "+L+' padding-heading thDesc thDescRightBorder trans-desc-header trans-headerline trans-head-border border-corner" id="thDesc"><a href="#" id="descHead" title="Sort transactions by Description" onclick="{return false;}"><span class="accessText">Sort transactions by</span>Description</a>';if(x.paginationData.sortBy=="2"){if(x.paginationData.sortOrder=="A"){e+='<span class="sortAsc">&nbsp;</span><input type="hidden" name="sortOrderDesc" id="sortOrderDesc" value="A" />'
}if(x.paginationData.sortOrder=="D"){e+='<span class="sortDesc">&nbsp;</span><input type="hidden" name="sortOrderDesc" id="sortOrderDesc" value="D" />'}}if(x.paginationData.sortBy!="2"){e+='<input type="hidden" name="sortOrderDesc" id="sortOrderDesc" value="D" />'}e+="</th>";if(K=="true"){e+='<th scope="col" class="padding-heading thReceipt trans-rec-header trans-headerline trans-head-border border-corner" id="thReceipt">Receipt</th>'}if(x.shouldDisplayCMNameColumn){C="";L=x.multiCardView?"multi-card":"";
C=K=="false"?"noreceipt-cardmember":"carmemClass";if(!x.multiCardView){e+='<th scope="col" class="'+C+" "+L+' padding-heading thCMName dynaColHead trans-mem-header trans-headerline trans-head-border border-corner" id="thName">';if(!x.multiCardView){e+='<a href="#" id="cmNameHead" title="Sort transactions by Cardmember" onclick="{return false;}"><span class="accessText">Sort transactions by</span>Card Member</a>'}if(!x.multiCardView){if(x.paginationData.sortBy=="0"){if(x.paginationData.sortOrder=="A"){e+='<span class="sortAsc">&nbsp;</span><input type="hidden" name="sortOrderCM" id="sortOrderCM" value="A" />'
}if(x.paginationData.sortOrder=="D"){e+='<span class="sortDesc">&nbsp;</span><input type="hidden" name="sortOrderCM" id="sortOrderCM" value="D" />'}}if(x.paginationData.sortBy!="0"){e+='<input type="hidden" name="sortOrderCM" id="sortOrderDesc" value="D" />'}}e+="</th>"}if(x.multiCardView){e+='<th scope="col" class="'+C+" "+L+' padding-heading thCMName dynaColHead trans-mem-header trans-headerline trans-head-border border-corner" id="thMultiName"><span id="multiCMNameHead" title="">Card Member</span></th>'
}}y=1544;e+='<th scope="col" class="thForAmmount dynaColHead display_none border-corner" id="thForAmmount"><a href="#" id="forAmtHead" title="Sort transactions by Foreign Amount" onclick="{return false;}"><span class="accessText">Sort transactions by</span>Foreign Spend <br /> Amount</a>';if(x.paginationData.sortBy=="30"){if(x.paginationData.sortOrder=="A"){e+='<span class="sortAsc">&nbsp;</span><input type="hidden" name="sortOrderForAmount" id="sortOrderForAmount" value="A" />'}if(x.paginationData.sortOrder=="D"){e+='<span class="sortDesc">&nbsp;</span><input type="hidden" name="sortOrderForAmount" id="sortOrderForAmount" value="D" />'
}}if(x.paginationData.sortBy!="30"){e+='<input type="hidden" name="sortOrderForAmount" id="sortOrderForAmount" value="D" />'}e+="</th>";if(x.multiCardView){e+='<th scope="col" class="padding-heading thCard border-corner trans-headerline" id="thCard"><a href="#" id="cardNameHead" title="Sort transactions by Card Name" onclick="{return false;}"><span class="accessText">Sort transactions by</span>Card Name</a>';if(x.paginationData.sortBy=="0"){if(x.paginationData.sortOrder=="A"){e+='<span class="sortAsc">&nbsp;</span><input type="hidden" name="sortOrderCard" id="sortOrderCard" value="A" />'
}if(x.paginationData.sortOrder=="D"){e+='<span class="sortDesc">&nbsp;</span><input type="hidden" name="sortOrderCard" id="sortOrderCard" value="D" />'}}if(x.paginationData.sortBy!="0"){e+='<input type="hidden" name="sortOrderCard" id="sortOrderCard" value="D" />'}e+="</th>"}y=1575;e+='<th scope="col" class="padding-heading thAmmount trans-cost-header trans-headerline border-corner" id="thAmmount"><a href="#" id="amtHead" title="Sort transactions by Amount" onclick="{return false;}"><span class="accessText">Sort transactions by</span>Amount</a>';
if(x.paginationData.sortBy=="4"){if(x.paginationData.sortOrder=="A"){e+='<span class="sortAsc">&nbsp;</span><input type="hidden" name="sortOrderAmount" id="sortOrderAmount" value="A" />'}if(x.paginationData.sortOrder=="D"){e+='<span class="sortDesc">&nbsp;</span><input type="hidden" name="sortOrderAmount" id="sortOrderAmount" value="D" />'}}if(x.paginationData.sortBy!="4"){e+='<input type="hidden" name="sortOrderAmount" id="sortOrderAmount" value="D" />'}e+="</th></tr></thead>";var J=((!x.BPIndex==0)&&(!x.BPIndex==-97))?"display:none":"";
if(x.pendingCharges){e+='<thead id="pendingHdr" data-dataAppended="false" style="'+J+'" class="pending-trans-head trans-expander-head closed"><tr><td class="trans-expander-header mobile-border bordermb-bottom border-leftclass" scope="row"><div id="recentTransaction"><a id="recentTrans" href="#" title="Expand Pending Charges" onclick="return false" class="trans-list-expander-button"></a></div></td>';var f=0;if(K=="false"&&m=="false"){f=3}else{if(K=="false"||m=="false"){f=4}else{f=5}}e+='<td class="pending-header trans-date-header mobile-border bordermb-bottom" colspan=\''+f+'\'><span class="picon-paddright">Pending Charges</span></td><td class="pendingHeader trans-cost-header mobile-border bordermb-bottom border-rightclass"><div id="pendingItems" class="paginationItems"></div><span id="transCostPendingSpan"></span></td></tr></thead>'
}y=1604;e+='<thead data-endRow="'+x.paginationData.endRow+'" data-totalTrans="'+x.paginationData.totalTrans+'" class="posted-trans-head trans-expander-head open"><tr><td class="trans-expander-header mobile-border border-leftclass" scope="row"></td>';var f=0;if(K=="false"&&m=="false"){f=4}else{if(K=="false"||m=="false"){f=5}else{f=6}}e+="<td colspan='"+f+'\' class="postedHeader colSpanValue trans-cost-header mobile-border border-rightclass"><span id="posted-header">Posted Transactions</span>';if(x.transactionList!=null&&x.transactionList.transactionList.length!=0){e+='<span class="postListViewDispFormat12">'+x.paginationData.startRow+" - "+x.paginationData.endRow+" of "+x.paginationData.totalTrans;
var t=" Transaction";if(x.paginationData.totalTrans>1){t=" Transactions"}e+=t+"</span>"}e+='<span id="transCostPostedSpan">';if(x.paginationData.totalTrans!=0){e+="Showing "+x.paginationData.endRow+" of "+x.paginationData.totalTrans}y=1629;e+="</span></td></tr></thead>";if(x.transactionList===null||x.transactionList.transactionList===null||!x.transactionList.transactionList.length){e+='<tbody class="noPostedMatch postedError"><tr>';var f=0;f=x.multiCardView?7:6;e+='<td id="listMsg" style="width:auto;" colspan="'+f+'">';
if(!x.dispCycleCutMsg){if(!x.bpnotAvailableInd&&!x.cmldIndicator){e+='<div class="noListResultsDisplay">There is no activity that meets your selected criteria.</div>'}if(x.bpnotAvailableInd){e+='<div class="noListResultsDisplay">There is no Billing Statement available for the Time Period selected.</div>'}}if(x.dispCycleCutMsg){e+='<div class="noListResultsDisplay">Your statement is currently being prepared. Please come back later.</div>'}e+="</td></tr></tbody>"}if(x.paginationData!=null){var A=x.paginationData.endRow;
var B=x.paginationData.totalTrans}y=1656;if(x.transactionList!=null&&x.transactionList.transactionList.length!=0){for(var d=0;d<x.transactionList.transactionList.length;d++){var E=x.transactionList.transactionList[d];y=1662;var q=d;var z=q%2==0?"even":"odd";if(E.postDateIndicator){r="true"}e+='<tbody class="'+z+' posted-item-body posted-trans" id="roc_'+q+'" data-ref="'+E.ref+'" data-transId="'+E.transId+'">';var N=E.shldHighlightRoc?"offerCredit":"";e+='<tr id="postroc_'+q+'" class="'+N+'">';var l="croc_"+q;
var I="";var p=E.ref;var w=0;if(E.tags!=null){w=E.tags.length}var M="";var h="";var H="";var G="";M=M+"multiCheck";if(E.tagEligible){M=M+" tag1";H=H+"greyTag";G=G+"tagBarROC"}else{G=G+"hideTagBarROC"}if(p==null||p==""){h=h+"hidden"}else{h=h+"plus";h=h+" plusGrey";M=M+" print"}y=1698;var v=M+" posAbsolute";if(x.customerRole!="AA"){if(x.tagEligible){e+='<td class="tdTag trans-expander mobile-border" scope="row" id="listDatarow'+q+'">';if(E.hasMerchant){e+='<input type="hidden" name="rocInfoDetails" value="'+E.seNumber+"~"+E.displayRefNum+"~"+E.categoryName+"~"+E.subCategoryName+'" />'
}e+='<div class="itagDivAlign"><a title="Tag this Transaction" id="itag_'+q+'" class="greyTag tag-icon " href="#" onclick="return false;"></a>';e+='<input type="checkbox" value="'+p+'" name="refSeNumbers" class="'+v+'" id="'+l+'" title="" />';e+='</div><label for="'+l+'" class="accessText">'+E.description+E.date+"</label></td>"}}if(!x.tagEligible){e+='<td class="colCheck" scope="row" id="listDatarow'+q+'">';e+='<input type="checkbox" value="'+p+'" name="refSeNumbers" class="'+M+'" id="'+l+'" title="" />';
e+='<label for="'+l+'" class="accessText">'+E.description+E.date+"</label></td>"}if(x.customerRole=="AA"){e+='<td class="colCheck" scope="row" id="listDatarow'+q+'">';e+='<input type="checkbox" value="'+p+'" name="refSeNumbers" class="'+M+'" id="'+l+'" title="" />';e+='<label for="'+l+'" class="accessText">'+E.description+E.date+"</label></td>"}if(q===(B-1)){I="bor-bottom"}e+='<td class="colPlus mobl-border '+I+'" headers="listDatarow'+q+' listDatacol2"><a title="Show Details" id="iroc_'+q+'" class="'+h+'" href="#" onclick="return false;"><img src="'+u+'/clear.gif" alt="Expand row '+q+1+'" title="" /></a></td><td class="date-col colDate" headers="listDatarow'+q+' thDate"><span id="date_roc_'+d+'" data-date="'+List_mb.JCPReceiptDate(E.date)+'" class="trans-date-text">'+List_mb.JCPDate(E.date)+'</span><div class="estmtdate-desktop"><span class="estmt-month">'+List_mb.JCPMonth(E.date)+'</span><span class="estmt-date">'+List_mb.JCPDateValue(E.date)+'</span><span class="estmt-year">'+List_mb.JCPYear(E.date)+"</span></div>";
if(E.postDateIndicator){e+="<sup>*</sup>"}e+='<span class="normalGray"></span></td><td class="desc-behav colDesc '+I+'" headers="listDatarow'+q+' thDesc"><div class="desc-trans">'+E.description+'</div><div class="'+G+'" id="troc_'+q+'">';y=1731;for(var F=0;F<w;F++){var O=E.tags[F];if(x.customerRole!="AA"){e+='<span id="tb_'+q+"_"+O.id+'" class="tagright tagX"><a title="Remove this Tag" href="#" class="tagX tagxgrey"><img title="Remove this Tag" alt="X" id="cb_'+q+"_"+O.id+'" class="tagX" src="'+u+'/clear.gif" /></a><span class="tagleft tagX"><span class="tagText tagX">'+O.name+"</span></span></span>"
}else{e+='<span id="tb_'+q+"_"+O.id+'" class="tagrightAA tagX"><span class="tagleft tagX"><span class="tagText tagX">'+O.name;if(F!=(w-1)){e+=","}e+="</span></span></span>"}}y=1747;e+="</div></td>";if((!x.liteEnabled)&&(x.rcCardEligible)){if(E.rcRocEligible){e+='<td class="colReceipt" headers="listDatarow'+q+' thReceipt">';if(E.receiptId==null){if(!x.thirdParty){e+='<div><a onclick="return false;" id="addReceiptLink_'+q+'" href="#" class="addReceiptLink" title="Add Receipt"><img src="'+u+'/add-receipt-small.png" alt="Add Receipt" title="Add Receipt" /></a></div>'
}else{e+='<div><a onclick="return false;" id="addReceiptLink_'+q+'" title="Add Receipt" href="#" class="addReceiptLink disableTPReceiptIcon"><img src="'+u+'/add-receipt-small.png" class="disableTPReceiptImg" /></a></div>'}}if(E.receiptId!=null){e+='<input type="hidden" id="rocRcptId_'+q+'" />';if(!x.thirdParty){e+='<div><a onclick="return false;" id="editRcptLink_'+q+'" href="#" class="editRcptLink" title="View/Edit Receipt"><img src="'+u+'/receipt-small.png" alt="View/Edit Receipt" title="View/Edit Receipt" /></a></div>'
}else{e+='<div><a href="#" id="editRcptLink_'+q+'" class="editRcptLink" onclick="return false;" title="View Receipt"><img src="'+u+'/receipt-small.png" alt="View Receipt" title="View Receipt" /></a></div>'}}e+="</td>"}else{if((!E.rcRocEligible)){e+='<td class="colReceipt" headers="listDatarow'+q+' thReceipt"></td>'}else{e+='<td class="colReceipt"></td>'}}}y=1776;if(x.shouldDisplayCMNameColumn){e+='<td class="colName" headers="listDatarow'+q+' thName">';if(E.memberName!=null){e+=E.memberName}e+="</td>"
}if(x.multiCardView){e+='<td class="colCard card-name-value" headers="listDatarow'+q+' thCard"><div>'+E.cardDesc+"</div></td>"}var c=E.shldHighlightRoc?"border-right: 1px solid #cccccc;padding-top:18px;color: #00693C;font-weight:bold;":"";e+='<td class="colAmmount '+I+'" data-amount="'+E.amount+'" headers="listDatarow'+q+' thAmmount" style="'+c+'"><div>'+E.dispAmount+"</div>";if(E.offerTransaction){e+='<div id="offerIcon_'+d+'" class="handImage"></div>'}else{e+='<div id="offerIcon_'+d+'"></div>'}e+='</td></tr><tr class="display_none trans-etd '+N+'" id="xroc_'+q+'"></tr><tr class="display_none" id="xtag_'+q+'"><td colspan="6" scope="row" class="xlistDataarowAlign" id="xtaglist_'+q+'" headers="xlistDatarow'+q+'"></td></tr></tbody>'
}}y=1799;if((x.paginationData!=null&&A<B)){s="showMoreDisplay"}if(x.channelType=="M"){e+='<tbody class="'+s+'" id="appendTransaction" data-pageNumber="'+x.paginationData.pageNumber+'" data-totalTrans="'+B+'" data-endRow="'+A+'"><tr><td colspan="3"><div class="trans-showmore">Show More</div></td></tr></tbody>'}e+="</table>";if(r=="true"){e+='<div class="postDtIndicator">* Indicates posting date </div>'}y=1812}catch(o){Boot_common.logErrorJSON("ERROR ("+o.message+") in List.list_template at "+y);throw o
}return e};var ListUIController={};ListUIController.check=function(c){var d=c.list_end;if(!$.isUndefined(d)){Amex.OverlayManager.unblock(false,"app");if($.isUndefined(d.error)||d.error==null){ListUIController.success(d)}else{ListUIController.error(d)}Status.endLoad()}else{}};ListUIController.success=function(f){try{List.destroy()}catch(c){}if($.browser.msie&&parseInt($.browser.version)==9){$("#app").html(UIController.replaceHtml(f.response.responseText))}else{$("#app").html(f.response.responseText)
}$.extend(listResponse,{BPIndex:$("#bPIndex").val()});var h=$.jcp("run","@list/list",listResponse);$("#listTemplate").html(h);List.init();Rewards.init();List_mb.resizeFunction();var e=$("#rcCardEligible").val();var l=$("#liteEnabled").val();if(e=="true"&&l!="true"){Receipt.checkReceiptEnrollStatus()}var d=$("#eligibleForQB").val();if(d=="true"){QB.init()}if($("#tagEligible").val()=="true"){Tag.init()}Filter.init();UIController.updateStatus();if(Graph.ManageTag!=null){if(Graph.ManageTag.visible()){Graph.ManageTag.update("");
Graph.ManageTag.close();Amex.PageOverlay.hide()}}if(Summary.ManageTag!=null){if(Summary.ManageTag.visible()){Summary.ManageTag.update("");Summary.ManageTag.close();Amex.PageOverlay.hide()}}Preferences.init();Rewards.rightColumnLocation();if($("#entryPoint").val()!="keynote"){if($("#advSWF").length){if(typeof(createSWF)=="function"){createSWF()}else{try{Boot.initPAW()}catch(c){}}}}};ListUIController.qbcheckList=function(c){var d=c.list_end;if(!$.isUndefined(d)){if($("#recentTransaction").length||$("#pendingOpen").length||$("#pendingOpen").val()=="false"){Amex.OverlayManager.unblock(false,"listDataWrapper")
}if($.isUndefined(d.error)){ListUIController.qbsuccessList(d)}else{ListUIController.errorList(d)}Status.endLoad()}};ListUIController.qbsuccessList=function(c){qbList.destroy();if($.browser.msie&&parseInt($.browser.version)==9){$("#qbListDataWrapper").html(UIController.replaceHtml(c.response.responseText))}else{$("#qbListDataWrapper").html(c.response.responseText)}UIController.updateStatus()};ListUIController.error=function(c){Amex.Msg.error("error processing request",c.response.responseText,true,null);
UIController.revertStatus()};ListUIController.checkList=function(c){var d=c.list_end;if(!$.isUndefined(d)){if($("#recentTransaction").length||$("#pendingOpen").length||$("#pendingOpen").val()=="false"){Amex.OverlayManager.unblock(false,"listDataWrapper")}if($.isUndefined(d.error)){ListUIController.successList(d)}else{ListUIController.errorList(d)}Status.endLoad()}};ListUIController.qbcheckList=function(c){var d=c.list_end;if(!$.isUndefined(d)){if($("#recentTransaction").length||$("#pendingOpen").length||$("#pendingOpen").val()=="false"){Amex.OverlayManager.unblock(false,"listDataWrapper")
}if($.isUndefined(d.error)){ListUIController.qbsuccessList(d)}else{ListUIController.errorList(d)}Status.endLoad()}};ListUIController.qbsuccessList=function(c){qbList.destroy();if($.browser.msie&&parseInt($.browser.version)==9){$("#qbListDataWrapper").html(UIController.replaceHtml(c.response.responseText))}else{$("#qbListDataWrapper").html(c.response.responseText)}UIController.updateStatus()};ListUIController.successList=function(c){List.destroy();if($.browser.msie&&parseInt($.browser.version)==9){$("#listDataWrapper").html(UIController.replaceHtml(c.response.responseText))
}else{$("#listDataWrapper").html(c.response.responseText)}$.extend(listResponse,{BPIndex:$("#bPIndex").val()});var d=$.jcp("run","@list/list",listResponse);$("#listTemplate").html(d);List.init();Filter.init();UIController.updateStatus();Rewards.rightColumnLocation()};ListUIController.errorList=function(d){Amex.Msg.error("error processing request",d.response.responseText,true,null);$("#maxPerPage").val(Status.current.selMaxPerPage);var c=$("#pageNumTop");if(c.length){c.val(List.prevPageNumber);$("#pageNumBottom").val(List.prevPageNumber);
$("#"+List.pageNumber).val(List.prevPageNumber)}};var ListLinks={lmtsummary:undefined,apr_window:undefined,messages:{genericMessage:"We are experiencing intermittent delays. Please try again later.",suppMessage:"Interest Charges are not displayed for Additional Cardmembers.",chargeMessage:"No Interest Charge information is available."}};ListLinks.init=function(){$("#aprlnk").on("click",ListLinks.openAPR);$("#vwbill").on("click",ListLinks.downLoadPdf);$("#limitSummary").on("click",ListLinks.openSpendinLimit);
$("#intChargelink").on("click",ListLinks.openIntChargelink);$("#miniSummaryData").off().on("click",ListLinks.SummaryStart);$("#cmldPDF").on("click",ListLinks.downLoadPdf);var l=$("#OBCOpenLayerStatus").val();var f=$("#openLayer").val();var e=$("#flex").val();var d=$("#cardChgMessage").val();var h=$("#intChargelink").length;var c=$("#zeroBiller").val();if(f!=""&&f=="A"){if(l=="AO"){if(h===0&&c=="false"){Amex.Msg.error("error processing request",ListLinks.messages.genericMessage,true,null)}else{ListLinks.openIntChargelink()
}}else{if(l=="AS"){Amex.Msg.alert("ALERT",ListLinks.messages.suppMessage,true,null,450)}else{if(l=="AC"&&e=="true"){ListLinks.openIntChargelink()}else{if(l=="AC"){Amex.Msg.alert("ALERT",ListLinks.messages.chargeMessage,true,null,450)}else{if(l=="AE"&&d!="Y"){Amex.Msg.error("error processing request",ListLinks.messages.genericMessage,true,null)}}}}}$("#openLayer").val("")}};ListLinks.openAPR=function(c){if($.isUndefined(ListLinks.apr_window)){ListLinks.apr_window=new Amex.Window({modal:true,left:150,top:380,theme:"amexWindow",buttons:["close"],title:"interest charge calculation",trigger:"aprlnk",shadow:{size:6,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},onClose:function(){Amex.PageOverlay.hide();
return true}})}ListLinks.apr_window.update("<div style='background-color:#FFFFFF;width:700px;'>"+$("#apr").html()+"<fieldset><legend><span class='accessText'>INTEREST CHARGE CALCULATION</span></legend><span style='margin-left:auto;margin-right:auto;margin-top:20px;display:block;width:30px;margin-bottom:5px;'><button type='button' title='Close APR Window' id='closeAPRButton' onclick='ListLinks.apr_window.close();Amex.PageOverlay.hide();' class='blueButton lastFocus'><span class='blueWrapper'>CLOSE</span></button></span></fieldset></div>");
ListLinks.apr_window.render(document.body);ListLinks.apr_window.setTriggerNode("aprlnk");ListLinks.apr_window.centerInViewport();ListLinks.apr_window.open()};ListLinks.downLoadPdf=function(c){Pdf.verify()};ListLinks.openSpendinLimit=function(){if($.isUndefined(ListLinks.lmtsummary_window)){ListLinks.lmtsummary_window=new Amex.Window({modal:true,left:150,top:380,theme:"amexWindow",buttons:["close"],title:"spending limit summary",trigger:"limitSummary",shadow:{size:6,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});
$("#Limitspend").css({display:"block"});ListLinks.lmtsummary_window.render(Page.form.id);ListLinks.lmtsummary_window.update($("#Limitspend"))}ListLinks.lmtsummary_window.setTriggerNode("limitSummary");ListLinks.lmtsummary_window.centerInViewport();ListLinks.lmtsummary_window.open()};ListLinks.openIntChargelink=function(d){var c=$.ajax("interestChargeLayer.do",{data:$("#"+Page.form.id).serialize(),type:"POST",success:function(f,e,h){},error:function(e){}});if($.isUndefined(ListLinks.intCharge_window)){ListLinks.intCharge_window=new Amex.Window({modal:true,left:150,top:380,theme:"amexWindow",buttons:["close"],title:"interest charge calculation",trigger:"intChargelink",shadow:{size:6,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},onClose:function(){Amex.PageOverlay.hide();
return true}})}ListLinks.intCharge_window.update("<div class = 'intchargelayer_main'>"+$("#intCharge").html()+"<div id='closeIntChargeButtons'><button type='button' title='Close Interest Charge Window' id='closeIntChargeButton' class='blueButton lastFocus'><span class='blueWrapper'>close</span></button></div></div>");ListLinks.intCharge_window.render(document.body);ListLinks.intCharge_window.setTriggerNode("intChargelink");ListLinks.intCharge_window.centerInViewport();ListLinks.intCharge_window.open();
Omniture.report("InterestCalc_Track");if($("#closeIntChargeButton").length){$("#closeIntChargeButton").on("click",function(){ListLinks.intCharge_window.close();Amex.PageOverlay.hide()})}};ListLinks.SummaryStart=function(f){var e=$("#miniSummaryData");var d=e.hasClass("collapseSummary");var c=$("#minSummaryTble");if(d){e.removeClass("collapseSummary");e.addClass("expandSummary");$("#minSummaryTble").removeClass("expanded");$("#minSummaryTble").addClass("collapsed");$("#ViewBillingStatementTD").show();
$("#closingDate").show()}else{$("#minSummaryTble").removeClass("collapsed");$("#minSummaryTble").addClass("expanded");e.removeClass("expandSummary");e.addClass("collapseSummary");$("#ViewBillingStatementTD").hide();$("#closingDate").hide()}e.focus()};ListLinks.payBillAction=function(){var c=$("#paybill").val();var d=T1.card.getSelected();if(d){c+="&linknav=us-"+d.cardProduct+"-eStatement-main-paybill"}window.location=c};var Pdf={example:null,activeWindow:null,paperLessWindow:undefined,winShadow:{size:6,color:"#666666",background:"url('../../../images/shadow.png') bottom right no-repeat"},messages:{errorMessage:"The information you entered for the Card account does not match our records.<br>Please review your entries and make any necessary changes.",errorNumericMessage:"Information you entered for the Card account should be numeric.<br>Please review your entries and make any necessary changes."}};
var downloadpara=new Downloadpara();function Downloadpara(e,d,h){var f=e;var c=d;var l=h;this.getdateValue=function(){return f};this.setdateValue=function(m){f=m};this.getsortedValue=function(){return c};this.setsortedValue=function(m){c=m};this.getoverlayValue=function(){return l};this.setoverlayValue=function(m){l=m}}Pdf.verify=function(){if($("#cpwRequired").val()=="true"&&$("#cpwReAuth").val()!="true"){downloadpara.setdateValue($("#cycleDate").val());downloadpara.setsortedValue($("#sorted_index").val());
Pdf.verifyUser()}else{Pdf.Download($("#cycleDate").val(),$("#sorted_index").val())}};Pdf.verifyUser=function(){var c=downloadpara.getsortedValue();var d=downloadpara.getdateValue();var e="&cardindex="+c+"&Statement_Date="+d;var f="Face=en_US&request_type=authreg_StatementImage"+e;url=$("#statementAppURL").val();$.ajax(url,{type:"POST",data:f,success:function(l,h,m){if(m.getResponseHeader("error")==null&&m.getResponseHeader("MYCAError")==null){PdfValid.open(l,m.getResponseHeader("error"))}else{if(m.getResponseHeader("MYCAError")!=null){Amex.Msg.error("error processing request",l,true,null)
}else{if(m.getResponseHeader("error")==10){Pdf.Download(downloadpara.getdateValue(),downloadpara.getsortedValue())}else{PdfValid.open(l,m.getResponseHeader("error"))}}}}})};Pdf.validateinput=function(){url=$("#statementAppURL").val();var m=downloadpara.getsortedValue();var L="false";var N="false";var f="false";var H="false";var C="false";var e=$("#BPLACE");var K=$("#MOTHERNAME");var c=$("#SPASSWORD");var x=$("#MM");var B=$("#DD");var z=$("#ElemSchool");var u=$("#Pin");var t=$("#NATIONAL");var I=$("#Code");
var w=$("#member_mm");var D=$("#member_dd");var d=$("#member_yyyy");var o=$("#WorkPhone");var y=null;var s=null;if(e.length){var M=$("#BPLACE").val();if(!checkEmpty(M)){return false}var e=encodeValue(M);N="true"}if(K.length){var G=$("#MOTHERNAME").val();if(!checkEmpty(G)){return false}var K=encodeValue(G);N="true"}if(c.length){var J=$("#SPASSWORD").val();if(!checkEmpty(J)){return false}var c=encodeValue(J);N="true"}if(x.length){var x=$("#MM").val();if(!checkEmpty(x)){return false}N="true"}if(B.length){B=$("#DD").val();
if(!checkEmpty(B)){return false}N="true";var q=x+B;var s=encodeValue(q)}if(z.length){var p=$("#ElemSchool").val();if(!checkEmpty(p)){return false}var z=encodeValue(p);N="true"}if(u.length){var F=$("#Pin").val();if(!checkEmpty(F)){return false}var u=encodeValue(F);N="true"}if(t.length){var h=$("#NATIONAL").val();if(!checkEmpty(h)){return false}var t=encodeValue(h);L="true"}if(w.length){var r=$("#member_mm").val();if(!checkEmpty(r)){return false}var w=encodeValue(r)}if(D.length){var v=$("#member_dd").val();
if(!checkEmpty(v)){return false}var D=encodeValue(v);H="true"}if(d.length){var n=$("#member_yyyy").val();if(!checkEmpty(n)){return false}var d=encodeValue(n);memberBirthday=w+D+d}if(o.length){var E=$("#WorkPhone").val();if(!checkEmpty(E)){return false}var o=encodeValue(E);C="true";y=o}if(I.length){var A=$("#Code").val();if(!checkEmpty(A)){return false}var I=encodeValue(A);f="true"}var l="&Reauth=true&Face=en_US&sorted_index=0&request_type=authreg_StatementImage&cardindex="+m+"&isNationalIdAvailable="+L+"&isCustomerPasswordAvailable="+N+"&iszipAvailable="+f+"&iscardmembirthAvailable="+H+"&isphoneAvailable="+C+"&Birthplace="+e+"&phone="+y+"&NATIONALID="+t+"&MaidenName="+K+"&Password="+c+"&School="+z+"&SecurePin="+u+"&motherbirthday="+s+"&zip="+I+"&DATEYYYY="+d+"&DATEMM="+w+"&DATEDD="+D;
$.ajax(url,{type:"POST",data:l,success:function(P,O,Q){if(Q.getResponseHeader("error")==1){Amex.Msg.alert(Amex.Msg.information,Pdf.messages.errorMessage,true,null,550)}else{$("#cpwReAuth").val("true");PdfValid.closeLayer();Amex.Msg.confirmContinue(Amex.Msg.msgConfirm,"Please select Continue to Download the PDF.",true,"Continue","Cancel",function(R){if("CONTINUE"==R){Pdf.Download(downloadpara.getdateValue(),downloadpara.getsortedValue())}})}}})};function isNumeric(d){var c=$("#pdfdownloadContinueButton");
if(!(d.val()==""||d.val().charAt(0)==" ")){if(d.value.length>=1){$("#pdfdownloadContinueButton").removeClass("disabled");$("#pdfdownloadContinueButton").removeAttr("disabled");$("#pdfdownloadCancelButton").removeClass("lastFocus");$("#pdfdownloadContinueButton").addClass("lastFocus");PdfValid.window._setFocusCycle($("#pdfdownloadContinueButton"))}}else{$("#pdfdownloadContinueButton").attr("disabled",true);$("#pdfdownloadContinueButton").addClass("disabled");$("#pdfdownloadContinueButton").removeClass("lastFocus");
$("#pdfdownloadCancelButton").addClass("lastFocus");if(c.length){c.unbind("mouseover");c.unbind("mouseout")}PdfValid.window._setFocusCycle($("#pdfdownloadCancelButton"))}}var PdfValid={window:null,buttons:null,init:function(){if(PdfValid.window==null){PdfValid.window=new Amex.Window({modal:true,left:150,top:180,theme:"amexWindow",buttons:["close"],title:"ENTER SECURITY INFORMATION",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:PdfValid.closeLayer});
PdfValid.window.render(Page.form.id)}return PdfValid},open:function(c,d){PdfValid.init();if(PdfValid.window!=null){PdfValid.updateData(c);PdfValid.window.centerInViewport();PdfValid.window.open();downloadpara.setoverlayValue("true");$("#pdfdownloadCancelButton").on("click",function(e){PdfValid.closeLayer()});$("#pdfdownloadContinueButton").on("click",function(e){Pdf.validateinput()});$("#pdfCloseButton").on("click",function(e){PdfValid.closeLayer()})}return PdfValid},updateData:function(c){PdfValid.window.update(c)
},closeLayer:function(){Amex.PageOverlay.hide(true);PdfValid.window.hide();downloadpara.setoverlayValue("false");$("#vwbill").focus()}};Pdf.Download=function(e,d){var c=$("#statementAppURL").val()+"Face=en_US&sorted_index="+d+"&Statement_Date="+e+"&Download=true&request_type=authreg_StatementImage";Page.form.submit(c)};function encodeValue(e){var c="";var d="";c=escape(e);c=c.replace(/\//g,"%2F");c=c.replace(/\?/g,"%3F");c=c.replace(/=/g,"%3D");c=c.replace(/&/g,"%26");c=c.replace(/@/g,"%40");d=c;
return d}function regIsNumber(d){var c=/^[0-9]+$/;if(d.match(c)){return true}else{Amex.Msg.alert(Amex.Msg.information,Pdf.messages.errorNumericMessage,true,null,550);return false}}function checkEmpty(c){if(c==""){Amex.Msg.alert("Information",'Please enter the required information and then click "Continue"',true,null);return false}return true}var SummaryUIController={};SummaryUIController.check=function(c){var d=c.summary_end;if(!$.isUndefined(d)){Amex.PageOverlay.setIgnoreHide(false);if($.isUndefined(d.error)||d.error==null){SummaryUIController.success(d)
}else{SummaryUIController.error(d)}Status.endLoad()}};SummaryUIController.success=function(c){if(Summary.splitter!=null){Summary.splitter.destroy();Summary.splitter=null}if($.browser.msie&&parseInt($.browser.version)==9){$("#app").html(UIController.replaceHtml(c.response.responseText))}else{$("#app").html(c.response.responseText)}Summary.init();UIController.updateStatus();Amex.OverlayManager.unblock(false,"app");if(Graph.ManageTag!=null){if(Graph.ManageTag.visible()){Graph.ManageTag.update("");Graph.ManageTag.close();
Amex.PageOverlay.hide()}}if(Summary.ManageTag!=null){if(Summary.ManageTag.visible()){Summary.ManageTag.update("");Summary.ManageTag.close();Amex.PageOverlay.hide()}}};SummaryUIController.error=function(c){Amex.OverlayManager.unblock(false,"app");Amex.Msg.error("error processing request",c.response.responseText,true,null);UIController.revertStatus()};var Summary={splitter:null,hScrollPos:0,visibleColumns:0,rowArray:[],rowState:["0","0","0","0","0","0","0","0","0"],colState:["0","0","0","0","0","0","0","0","0","0"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],hlElement:null,firstBC:"",breadCrumbValues:["Default","List Only","Category","Merchant","Cardmember","Category by Cardmember","Tag","Pay In Full/Pay Over Time"],unClickableBC:"",drillDownMainRowId:"",rowExpColBCFlag:0,colExpColBCFlag:0,drillDownMainColId:""};
Summary.initScroll=function(m){Summary.visibleColumns=m;Summary.rowArray.length=0;for(var e=0;e<Summary.rowState.length;e++){Summary.rowState[e]=0}for(var e=0;e<Summary.colState.length;e++){Summary.colState[e]=0}var d=0;var c=0;var h;while(true){h=$("#data-row"+d);if(h.length){Summary.rowArray[c++]=h}else{break}d++}var f=$("#content-scroll");var l=$("#total-row");$("#total-row-scroll").scroll(Summary.horzScroll);f.mouseover(Summary.onMouseOverFn);f.mouseout(Summary.onMouseOutFn);l.mouseover(Summary.onMouseOverFn);
l.mouseout(Summary.onMouseOutFn);$("#catTableHdr").click(Summary.sort);$("#tableHdr").click(Summary.sort);$("#totalHdr").click(Summary.sort)};Summary.setScroll=function(f){var h=$("#total-row-scroll").scrollLeft();if((Summary.hScrollPos!=h)||f){for(var e=0;e<Summary.rowArray.length;e++){Summary.rowArray[e].scrollLeft(h)}var d=$("#header-scroll");if(d.length){d.scrollLeft(h)}var c=$("#quarter-scroll");if(c.length){c.scrollLeft(h)}Summary.hScrollPos=h}};Summary.horzScroll=function(){Summary.setScroll(false)
};Summary.defaultColExp=function(){if($("#isColExp").val()=="true"){if(parseInt($("#subColCount").val())<=3){Summary.expandColumn(0)}else{if((parseInt($("#subColCount").val())>=3)&&(parseInt($("#subColCount").val())<=6)){Summary.expandColumn(0);Summary.expandColumn(1)}}}};Summary.expandColumn=function(h){var f=$("#img"+h);var s;var d=$("#hscroll");var r=$("#tscroll");var l;var t=$("#fillTotal");var e;if(f.attr("src").indexOf("plus")==-1){Summary.colState[h]=0;Summary.visibleColumns-=2;if((h==Summary.drillDownMainColId)&&(Summary.colExpColBCFlag==0)){Summary.rowExpColBC();
Summary.colExpColBCFlag=1}$("#c"+h+"h_0").toggle();$("#c"+h+"h_1").toggle();var v=$("#c"+h+"t_0");if(v.length){v.toggle();$("#c"+h+"t_1").toggle()}var m=r.outerWidth()-266-8;if(Summary.visibleColumns<4){if(Summary.visibleColumns==1){if(t.length){t.css({width:"399px"})}m+=266}else{if(Summary.visibleColumns==2){if(t.length){t.css({width:"266px"})}m+=266}else{if(t.length){t.css({width:"133px"})}m+=133}}}r.css({width:m+"px"});l=d.outerWidth()-266-8;var p;var u=0;while(true){var o=$("#c"+h+"r"+u+"_0");
var n=$("#c"+h+"r"+u+"_1");if(o.length===0){break}o.show();n.hide();s=$("#scroll"+u);s.css({width:l+"px"});u++}d.css({width:l+"px"});Summary.setScroll(true);$("#expand"+h).css({width:"126px"});f.attr("src",$("#locImages").val()+"/img_boxplus.gif")}else{var m=r.outerWidth()+266+8;Summary.colState[h]=1;Summary.visibleColumns+=2;if((h==Summary.drillDownMainColId)&&(Summary.colExpColBCFlag==0)){Summary.rowExpColBC();Summary.colExpColBCFlag=1}l=d.outerWidth()+266+8;var u=0;while(true){var c="c"+h+"r"+u;
var o=$("#c"+h+"r"+u+"_0");var n=$("#c"+h+"r"+u+"_1");if(o.length===0){break}o.hide();n.show();s=$("#scroll"+u);s.css({width:l+"px"});u++}if(Summary.visibleColumns>=4){var q=0;if(t.length!=0){q=t.outerWidth();t.css({width:"0px"})}else{if(Summary.visibleColumns-2<4){q=133*(4-(Summary.visibleColumns-2))}}m-=q}else{if(t.length!=0){t.css({width:"133px"})}m-=266}r.css({width:m+"px"});var v=$("#c"+h+"t_0");if(v.length){v.toggle();$("#c"+h+"t_1").toggle()}d.css({width:l+"px"});$("#c"+h+"h_0").toggle();$("#c"+h+"h_1").toggle();
Summary.setScroll(true);if($.browser.msie&&$.browser.version==9){$("#expand"+h).css({width:"395px"})}else{$("#expand"+h).css({width:"398px"})}f.attr("src",$("#locImages").val()+"/img_boxminus.gif")}};Summary.toggleRow=function(p){Summary.rowState[p]=1-Summary.rowState[p];var c;var d;c=$("#table-row"+p).children()[2].id;d=c.substring(10);if((d==Summary.drillDownMainRowId)&&(Summary.rowExpColBCFlag==0)){Summary.rowExpColBC();Summary.rowExpColBCFlag=1}var l=$("#content-scroll");var f=$("#sub-table-row"+p);
var m=l[0].scrollHeight;$("#table-row"+p).toggle();$("#sub-table-row"+p).toggle();var h=f.height();var o=l[0].scrollHeight;var e=l.height();if(Summary.rowState[p]==1){if(e<9*53){Summary.setTableHeight(Math.min(9*53,o))}}else{if((m-h+53)<e){Summary.setTableHeight(m-h+53)}}var n=$("#content-scroll");n.scrollTop=n.scrollTop;Summary.setScroll(true)};Summary.onMouseOverFn=function(d){var c=$(d.target);while(c[0].nodeName.toLowerCase()!="div"){c=$(c.parent())}if(Summary.hlElement!=null){Summary.hlElement.removeClass("activeCell");
Summary.hlElement=null}if(c.attr("id")!="total-row-scroll"&&c.attr("id")!="content-scroll"){c.addClass("activeCell");Summary.hlElement=c}};Summary.onMouseOutFn=function(d){var c=$(d.target);while(c[0].nodeName.toLowerCase()!="div"){c=$(c.parent())}if(c.id=="total-row-scroll"||c.id=="content-scroll"){if(Summary.hlElement!=null){Summary.hlElement.removeClass("activeCell");Summary.hlElement=null}}c.removeClass("activeCell")};Summary.getColValue=function(f){var h=null;if(f.indexOf("~")!=-1){h="Previous Transactions"
}else{if(f.indexOf("Q")!=-1){var e=f.substring(0,4);var c=f.substring(5);switch(c){case"1":c="1st";break;case"2":c="2nd";break;case"3":c="3rd";break;case"4":c="4th";break;default:break}h=e+" "+c+" Quarter"}else{if(f.indexOf("M")!=-1){var l=parseInt(f.substring(5));h=Summary.months[l-1]}else{if(f=="1000"){h="Total"}else{h=$("#col-value-"+f).children().html().trim();var m=h.toLowerCase().indexOf("<br>");if(m!=-1){var d=h.substring(m+4).replace(/^\s+|\s+$/g,"");h=h.substring(0,m).replace(/^\s+|\s+$/g,"");
h+="-"+d}h=h.replace(/(<([^>]+)>)/ig,"").replace(/^\s+|\s+$/g,"")}}}}return h};Summary.getRowValue=function(d){var c=null;if(d=="Total"){c="Total"}else{c=$("#row-value-"+d).html().trim()}return c};Summary.getSubRowValue=function(d){var c=null;if(d!=""&&$("#subrow-value-"+d).length&&""!=$("#subrow-value-"+d).html()){c=$("#subrow-value-"+d).html().trim()}return c};Summary.getDrillDownBC=function(c,e,d){var f=null;var h=c;if(e!=null){h=e}if(c=="Total"&&d=="Total"){f="Total Spending"}else{if(c=="Total"){f=d+" Total"
}else{if(d=="Total"){f=h+" Total"}else{f=h+" for "+d}}}return f};Summary.rowExpColBC=function(){Summary.breadcrumb.clear();Summary.breadcrumb.add(new Amex.Crumb(1,Summary.firstBC));if(Summary.isRowColExp()==1){Summary.breadcrumb.getCrumb(1).enable()}else{Summary.breadcrumb.getCrumb(1).disable()}$("#splitPaneState").val("N");$("#summaryList").addClass("hidden")};Summary.isRowColExp=function(){for(var c=0;c<Summary.rowState.length;c++){if(Summary.rowState[c]==1){return 1}}for(var c=0;c<Summary.colState.length;
c++){if(Summary.colState[c]==1){return 1}}};Summary.drillDown=function(l,d,f,t){Tag.close();Amex.OverlayManager.block("app");$("#summaryXAxis").val("");$("#summaryYAxis").val("");$("#summarySubYAxis").val("");$("#pageNumber").val(1);$("#summaryXAxis").val(f);if(d!=""){$("#summarySubYAxis").val(d)}$("#summaryYAxis").val(l);var s=$("#multiCardView").val();var q=$("#reportType").val();var r;var h;var p;var v;var u;var e;var c;var n=$("#reportType").val();Omniture.report("report_"+n);var m=[];var o=$("#multiCardView").val()=="true"?true:false;
if(!o){m=formParameters.getParams("drilldown.do")}else{m=$("#"+Page.form.id).serializeArray()}$.ajax("drilldown.do",{type:"post",data:m,success:function(A,w,D){Amex.PageOverlay.setIgnoreHide(false);if(D.getResponseHeader("MYCAError")==null){if($("#preferenceDisabled").val()=="false"){$("#prefsortdiv").removeClass("prefSortHideDiv");$("#prefsortdiv").addClass("prefSortShowDiv");if($("#sortColDesc").length&&$("#summarySortDesc").length){var z=$("#sortColDesc").val();$("#summarySortDesc").html("<p style='text-transform: uppercase;'>"+z+"</p>")
}if($("#s_topLinkPref").length){if($("#s_topLinkPref").hasClass("bold")){$("#s_topLinkPref").removeClass("bold");$("#userInPreferredView").val("false")}}if($("#normalViewCardChanged").length){$("#normalViewCardChanged").val("false")}}if($.browser.msie&&parseInt($.browser.version)==9){$("#summaryList").html(UIController.replaceHtml(D.responseText))}else{$("#summaryList").html(D.responseText)}v=Summary.getRowValue(l);u=Summary.getSubRowValue(d);e=Summary.getColValue(f);Summary.rowExpColBCFlag=0;Summary.colExpColBCFlag=0;
Summary.drillDownMainRowId=l;Summary.drillDownMainColId=t;var C="";if($("#regzeStmtKillFlag").length){C=$("#regzeStmtKillFlag").val()}if(C=="true"){var x=["Default","List Only","Category","Merchant","Cardmember","Category by Cardmember","Tag","Due In Full/Flexible"]}else{var x=["Default","List Only","Category","Merchant","Cardmember","Category by Cardmember","Tag","Pay In Full/Pay Over Time"]}var y=x[q];if(s!=null&&s=="true"){if(q==4){y="Card"}else{if(q==5){y="Category by Card"}}}Summary.firstBC=y;
if(d!=""){c=v}Summary.unClickableBC=Summary.getDrillDownBC(v,u,e);Summary.breadcrumb.clear();Summary.breadcrumb.add(new Amex.Crumb(1,Summary.firstBC));if(d!=""){Summary.breadcrumb.add(new Amex.Crumb(2,c))}Summary.breadcrumb.add(new Amex.Crumb(3,Summary.unClickableBC));$("#splitPaneState").val("Y");$("#manageTagMessageSumm").removeClass("hidden");$("#summaryList").removeClass("hidden");var B=$.jcp("run","@list/list",listResponse);$("#listTemplate").html(B);List.init();List_mb.resizeFunction();if(TagList.tagArr){$("#manageTagIconSumm").click(Tag.showManageTagLayer);
$("#refreshViewIconSumm").click(Tag.runFilter)}Amex.OverlayManager.unblock(false,"app")}else{Amex.OverlayManager.unblock(false,"app");Amex.Msg.error("error processing request",D.responseText,true,null)}$("#listJson").val("false")},error:function(w){Amex.OverlayManager.unblock(false,"app");Amex.Msg.error("error processing request",w.responseText,true,null);$("#listJson").val("false")}})};Summary.setTableHeight=function(c){$("#content-scroll").css({height:c+"px"});var e=$("#content-scroll").height();
var d;if($("#isColExp").val()=="true"){d=e+32+34+$("#tblmsg1").height()+28+20}else{d=e+32+34+$("#tblmsg1").height()+28}$("#summaryTbl").css({height:d+"px"});$("#summaryTableOuter").css({height:d+"px"})};Summary.load=function(){var e=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){e=formParameters.getParams("summary.do")}else{e=$("#"+Page.form.id).serializeArray()}var d=$.ajax("summary.do",{type:"post",data:e,success:function(h,f,m){if(m.getResponseHeader("MYCAError")==null){if($("#preferenceDisabled").val()=="false"){if($("#sortBy").length&&$("#sortOrder").length){var l=Preferences.getSortOptions($("#sortBy").val(),$("#sortOrder").val());
$("#sortColDesc").val(l)}if($("#s_topLinkPref").length){if($("#s_topLinkPref").hasClass("bold")){$("#s_topLinkPref").removeClass("bold");$("#userInPreferredView").val("false")}}if($("#normalViewCardChanged").length){$("#normalViewCardChanged").val("false")}}Status.fireSuccess("summary",m)}else{Status.fireMycaError("summary",m)}},error:function(f){Status.fireHttpError("summary",f)}});Status.fireStart("summary",null)};Summary.init=function(){if($("#currDynaCol").length){Preferences.getAdditionalCol($("#currDynaCol").val())
}var f=$("#content-scroll");Filter.init();Summary.drillDownMainColId=-1;Summary.rowExpColBCFlag=0;Summary.colExpColBCFlag=0;Summary.drillDownMainRowId=-1;if($("#deltaDeepLink").length){$("#deltaDeepLink").click(Summary.showDeltaSummary)}Summary.breadcrumb=new Amex.Breadcrumb({separator:">> "});Summary.breadcrumb.on("click",function(n,o){if(o.object.getKey()==1){T2.changeReportType()}else{if(o.object.getKey()==2){Summary.rowExpColBC()}}});Summary.breadcrumb.render("breadcrumb");var e=$("#reportType").val();
var m=$("#multiCardView").val();var h=$("#regzeStmtKillFlag").val();if(h=="true"){var c=["Default","List Only","Category","Merchant","Cardmember","Category by Cardmember","Tag","Due In Full/Flexible"]}else{var c=["Default","List Only","Category","Merchant","Cardmember","Category by Cardmember","Tag","Pay In Full/Pay Over Time"]}var d=c[e];if(m!=null&&m=="true"){if(e==4){d="Card"}else{if(e==5){d="Category by Card"}}}Summary.breadcrumb.add(new Amex.Crumb(1,d));if(f==null){Summary.unblock();return}if($("#preferenceDisabled").val()=="false"&&$("#sortBy").length&&$("#sortOrder").length){var l=Preferences.getSortOptions($("#sortBy").val(),$("#sortOrder").val());
$("#sortColDesc").val(l)}Summary.initScroll(parseInt($("#columnCount").val()));Summary.defaultColExp();Summary.unblock();Filter.init();App.pznCall()};Summary.showDeltaSummary=function(){if(!Rewards.loading){Rewards.loading=true;Omniture.reportClick("deltaDeepLink");var d=$("#sorted_index").val();$("#reportType").val("1");$("#viewType").val("L");var c="list.do?request_type=authreg_Statement&sorted_index="+d+"&BPIndex=1&Face=en_US";$("#showRewardsRRB").val("true");Page.form.submit(c)}};Summary.unblock=function(){Amex.PageOverlay.setIgnoreHide(false);
Amex.OverlayManager.unblock()};Summary.sort=function(d){var c=$(d.target);var e=c.attr("id");if((e=="tableHdr")||(e=="catTableHdr")){Summary.displaySortedSummary(10)}else{if(e=="totalHdr"){Summary.displaySortedSummary(1000)}}};Summary.displaySortedSummary=function(d){var c=$("#summarySortOrder").val();var e=$("#summarySortBy").val();$("#summarySortBy").val(d);if(e==""||e==d){if(c==""){$("#summarySortOrder").val("A")}else{if(c=="A"){$("#summarySortOrder").val("D")}else{$("#summarySortOrder").val("A")
}}}else{$("#summarySortOrder").val("A")}$("#splitPaneState").val("N");T2.loadSummaryView()};var Graph={splitter:null,lastFnArgs:null,valueCheck:false,showByCardValue:""};var GRAPH_PRINT_LAYER=undefined;var regZKilled=$("#regzeStmtKillFlag").val();if(regZKilled=="true"){var breadCrumbValues=["","Transaction Details","Category","Merchant","Cardmember","Category by Cardmember","Tag","Due In Full/Flexible"]}else{var breadCrumbValues=["","Transaction Details","Category","Merchant","Cardmember","Category by Cardmember","Tag","Pay In Full/Pay Over Time"]
}var displayBreadCrumbMessage="";var cmId=-1;Graph.load=function(){$("#summaryXAxis").val("");$("#summaryYAxis").val("");$("#summarySubYAxis").val("");$("#splitPaneState").val("N");var h=$("#multiCardView").val();var d=$("#reportType").val();if($("#chartType").val()=="piechart"){$("#suppInclude").val("")}var f=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){f=formParameters.getParams("graph.do")}else{f=$("#"+Page.form.id).serializeArray()}var e=$.ajax("graph.do",{type:"post",data:f,success:function(m,l,n){if(n.getResponseHeader("MYCAError")==null){displayBreadCrumbMessage=breadCrumbValues[d];
if(h!=null&&h=="true"){if(d==4){displayBreadCrumbMessage="Card"}else{if(d==5){displayBreadCrumbMessage="Category by Card"}}}cmId=-1;$("#graphDisplayString").val("");Status.fireSuccess("graph",n)}else{Status.fireMycaError("graph",n)}},error:function(l){Status.fireHttpError("graph",l)}});Status.fireStart("graph",e)};Graph.loadSupps=function(){var d=$("#reportType").val();Omniture.report("graph_showcm_"+d);$("#summaryYAxis").val("");if(d!=2&&d!=5){$("#summaryXAxis").val("")}else{if((d==2||d==5)&&$("#summaryXAxis").val()=="C4"){$("#summaryXAxis").val("")
}}var f=breadCrumbValues[d];var l=$("#multiCardView").val();if(l!=null&&l=="true"){if(d==4){f="Card"}else{if(d==5){f="Category by Card"}}}if((d==2||d==5)&&$("#summaryXAxis").val()!=""){displayBreadCrumbMessage='<a href="javascript:T2.loadGraphView()" class="crumb">'+f+"</a> >> "+$("#graphDisplayString").val()}else{displayBreadCrumbMessage=f}Graph.suppInclude=$("#suppInclude").is(":checked");var h=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){h=formParameters.getParams("graph.do");Graph.showByCardValue="";
if($("#suppInclude").is(":checked")&&!Graph.valueCheck){Graph.showByCardValue="Y";h.push({name:"showByCard",value:Graph.showByCardValue});Graph.valueCheck=true}else{h.push({name:"showByCard",value:Graph.showByCardValue});Graph.valueCheck=false}}else{h=$("#"+Page.form.id).serializeArray()}var e=$.ajax("graph.do",{type:"post",data:h,success:function(n,m,o){if(o.getResponseHeader("MYCAError")==null){Status.fireSuccess("graph",o)}else{Status.fireMycaError("graph",o);$("#suppInclude").prop("checked", !Graph.suppInclude)
}},onFailure:function(m){Status.fireHttpError("graph",m);$("#suppInclude").prop("checked", !Graph.suppInclude)}});Status.fireStart("graph",e)};Graph.init=function(){Filter.init();$("#splitPaneState").val("N");var c=$("#reportType").val();var d=breadCrumbValues[c];var e=$("#multiCardView").val();if(e!=null&&e=="true"){if(c==4){d="Card"}else{if(c==5){d="Category by Card"}}}if((c==2||c==5)&&$("#summaryXAxis").val()!=""){displayBreadCrumbMessage='<a href="javascript:T2.loadGraphView()" class="crumb">'+d+"</a> >> "+$("#graphDisplayString").val()
}else{displayBreadCrumbMessage=d}$("#breadcrumb").html(displayBreadCrumbMessage);App.pznCall();Graph.loadFusionChart();$("#printGraph").off().on("click",Graph.printChart)};Graph.loadDrillDown=function(m){Tag.close();if($("#disableGraphDD").length){Amex.Msg.alert(Amex.Msg.information,"To view details, please choose this Card from the Card Activity dropdown.",true,null);return}Graph.lastFnArgs=m;Amex.OverlayManager.block("app");var h=m.split("~~");$("#summaryXAxis").val(h[0]);$("#summaryYAxis").val(h[1]);
$("#summarySubYAxis").val(h[2]);$("#splitPaneState").val("Y");var q=h[3];var d=h[4].replace(/\\/g,"");var l=$("#reportType").val();var f=$("#chartType").val();if(f=="default"){if(l==2||l==4||l==7){f="piechart"}else{f="barchart"}}Omniture.report("graph_dd_"+l);var p=$("#multiCardView").val();if((q!=0&&(l==2||l==5))||(q!=0&&l==4&&p=="true")||f=="piechart"){Status.startLoad("chartDetails");var c=[];var e=$("#multiCardView").val()=="true"?true:false;if(!e){c=formParameters.getParams("graph.do")}else{c=$("#"+Page.form.id).serializeArray()
}var o=$.ajax("graph.do",{type:"post",data:c,success:function(s,r,t){if(t.getResponseHeader("MYCAError")==null){cmId=h[1];if(q!=0){$("#graphDisplayString").val(d)}Status.fireSuccess("chart",t)}else{Status.fireMycaError("chart",t)}},error:function(r){Status.fireHttpError("chart",r)}});Status.fireStart("chart",o)}else{if((l==2||l==5)&&h[0]=="C4"){$("#graphDisplayString").val(d)}Status.startLoad("detailsOnly")}$("#pageNumber").val(1);var c=[];var e=$("#multiCardView").val()=="true"?true:false;if(!e){c=formParameters.getParams("drilldown.do")
}else{c=$("#"+Page.form.id).serializeArray()}var n=$.ajax("drilldown.do",{type:"POST",data:c,success:function(s,r,u){if(u.getResponseHeader("MYCAError")==null){var t=breadCrumbValues[l];if(p!=null&&p=="true"){if(l==4){t="Card"}else{if(l==5){t="Category by Card"}}}if((l==2||l==5)&&q==0&&h[0]!="C4"){displayBreadCrumbMessage='<a href="javascript:T2.loadGraphView()" class="crumb">'+t+'</a> >> <a class="crumb" href="javascript:Graph.bcClick(\''+h[0]+"','"+cmId+"','-1','1','"+$("#graphDisplayString").val()+"')\">"+$("#graphDisplayString").val()+"</a> >> "+d
}else{displayBreadCrumbMessage='<a href="javascript:T2.loadGraphView()" class="crumb">'+t+"</a> >> "+d}$("#topLinkPrintDis").hide();$("#topLinkPrint").show();Status.fireSuccess("list",u)}else{Status.fireMycaError("list",u)}},error:function(r){Status.fireHttpError("list",r)}});$("#listJson").val("false");Status.fireStart("list",n)};Graph.bcClick=function(h,f,d,e,c){Graph.loadDrillDown($A([h,f,d,e,c]).join("~~"))};Graph.changeGraphClick=function(c){Omniture.report("graph_change_"+$("#reportType").val(),c);
$("#viewType").val("G");$("#chartType").val(c);var d=$("#suppInclude");if(d.length){d[0].checked=false}if($("#summaryXAxis").val()==""){T2.loadGraphView()}else{Graph.loadChangeType()}};Graph.loadChangeType=function(){Amex.OverlayManager.block("app");var e=[$("#summaryXAxis").val(),$("#summaryYAxis").val(),$("#summarySubYAxis").val()];$("#splitPaneState").val("Y");var h=$("#reportType").val();var n=$("#multiCardView").val();var f=$("#chartType").val();if(f=="default"){if(h==2||h==4||h==7){f="piechart"
}else{f="barchart"}}Status.startLoad("chartDetails");if($("#chartType").val()=="piechart"){$("#suppInclude").val("")}var m=[];var d=$("#multiCardView").val()=="true"?true:false;if(!d){m=formParameters.getParams("graph.do")}else{m=$("#"+Page.form.id).serializeArray()}var c=$.ajax("graph.do",{type:"POST",data:m,success:function(p,o,q){if(q.getResponseHeader("MYCAError")==null){cmId=e[1];Status.fireSuccess("chart",q)}else{Status.fireMycaError("chart",q)}},error:function(o){Status.fireHttpError("chart",o)
}});Status.fireStart("chart",c);$("#pageNumber").val(1);var m=[];var d=$("#multiCardView").val()=="true"?true:false;if(!d){m=formParameters.getParams("drilldown.do")}else{m=$("#"+Page.form.id).serializeArray()}var l=$.ajax("drilldown.do",{type:"POST",data:m,success:function(p,o,q){if(q.getResponseHeader("MYCAError")==null){Status.fireSuccess("list",q)}else{Status.fireMycaError("list",q)}},error:function(o){Status.fireHttpError("list",o)}});$("#listJson").val("false");Status.fireStart("list",l)};Graph.closeGraphPrintLayer=function(){GRAPH_PRINT_LAYER.toggle()
};Graph.print=function(){Omniture.report("graph_print_"+$("#reportType").val());if($("#printGraph").is(":ui-callout")){$("#printGraph").callout("toggle")}else{$("#printGraph").callout({direction:"left",width:200,closeButton:false,content:'To print, right-click on the chart and choose "Print Chart"'})}return false};Graph.initSplitter=function(){Amex.OverlayManager.unblock(false,"app");$("#breadcrumb").html(displayBreadCrumbMessage);if($("#graph").length){List.init();$("#manageTagMessage").removeClass("hidden");
$("#summaryList").removeClass("hidden");if(TagList.tagArr){$("#manageTagIcon").click(Tag.showManageTagLayer);$("#refreshViewIcon").on("click",Tag.runFilter)}Graph.loadFusionChart()}};Graph.retreat=function(e){var c=e.split("~~");var d=$("#reportType").val();if(d==2){if(c[0]=="C4"){T2.loadGraphView()}else{c[2]="-1";c[3]="1";c[4]=$("#graphDisplayString").val();Graph.loadDrillDown($A([c[0],c[1],c[2],c[3],c[4]]).join("~~"))}}else{T2.loadGraphView()}};Graph.loadFusionChart=function(){FusionCharts._fallbackJSChartWhenNoFlash();
if(!($.browser.msie&(parseInt($.browser.version)==9||parseInt($.browser.version)==10))){FusionCharts.printManager.enabled(true)}var d=$("#locSwf").val()+"/"+$("#StackedBar").val();var c=new FusionCharts(d,d,"925","370","0","1");c.setXMLData($("#graphXmlString").html());c.render("embedObject")};Graph.printChart=function(d){d.stopPropagation();d.preventDefault();var c=$("#embedObject").children("object");if($.isUndefined(c)){Print.print($("#embedObject").html())}else{Graph.print()}};var onGraphClick=Graph.loadDrillDown;
var onGraphReset=Graph.retreat;var GraphUIController={};GraphUIController.check=function(c){var d=c.graph_end;if(!$.isUndefined(d)){Amex.PageOverlay.setIgnoreHide(false);Status.endLoad();if($.isUndefined(d.error)||d.error==null){GraphUIController.success(d)}else{GraphUIController.error(d)}}};GraphUIController.success=function(c){Amex.OverlayManager.unblock(false,"app");if($.browser.msie&&(parseInt($.browser.version)==9||parseInt($.browser.version)==10)){$("#app").html(UIController.replaceHtml(c.response.responseText))
}else{$("#app").html(c.response.responseText)}Graph.init();UIController.updateStatus();if(Graph.ManageTag!=null){if(Graph.ManageTag.visible()){Graph.ManageTag.html("");Graph.ManageTag.close();Amex.PageOverlay.hide()}}if(Summary.ManageTag!=null){if(Summary.ManageTag.visible()){Summary.ManageTag.html("");Summary.ManageTag.close();Amex.PageOverlay.hide()}}};GraphUIController.error=function(c){Amex.OverlayManager.unblock(false,"app");Amex.Msg.error("error processing request",c.response.responseText,true,null);
UIController.revertStatus()};GraphUIController.checkDetails=function(c){var e=c.chart_end;var d=c.list_end;if(!$.isUndefined(e)&&!$.isUndefined(d)){Amex.OverlayManager.unblock(false,"app");if(($.isUndefined(e.error)||e.error==null)&&($.isUndefined(d.error)||d.error==null)){GraphUIController.successDetails(e,d)}else{GraphUIController.errorDetails(e,d)}Status.endLoad()}};GraphUIController.checkDetailsOnly=function(c){var d=c.list_end;if(!$.isUndefined(d)){Amex.OverlayManager.unblock(false,"app");if($.isUndefined(d.error)||d.error==null){GraphUIController.successDetails(null,d)
}else{GraphUIController.errorDetails(null,d)}Status.endLoad()}};GraphUIController.successDetails=function(h,f){if(h!=null){if($.browser.msie&&(parseInt($.browser.version)==9||parseInt($.browser.version)==10)){$("#app").html(UIController.replaceHtml(h.response.responseText))}else{$("#app").html(h.response.responseText)}}var d=$("#elLinksPZN").children();if(d!=null&&d.length>=1){if(!$("#dataWrapper").length){var c=$("#graphTop");c.css({height:c.height()+30+"px"})}}if($.browser.msie&&(parseInt($.browser.version)==9||parseInt($.browser.version)==10)){$("#summaryList").html(UIController.replaceHtml(f.response.responseText))
}else{$("#summaryList").html(f.response.responseText)}Graph.initSplitter();if($("#preferenceDisabled").val()=="false"){$("#prefsortdiv").removeClass("prefSortHideDiv");$("#prefsortdiv").addClass("prefSortShowDiv");if($("#sortColDesc").length>0&&$("#graphSortDesc").length>0){var e=$("#sortColDesc").val();$("#graphSortDesc").html("<p style='text-transform: uppercase;'>"+e+"</p>")}}var l=$.jcp("run","@list/list",listResponse);$("#listTemplate").html(l);List.init();List_mb.resizeFunction();Rewards.rightColumnLocation()
};GraphUIController.errorDetails=function(d,c){Amex.OverlayManager.unblock(false,"app");if(d!=null&&d.error!=null){Amex.Msg.error("error processing request",d.response.responseText,true,null)}else{if(c!=null&&c.error!=null){Amex.Msg.error("error processing request",c.response.responseText,true,null)}else{Amex.Msg.error("error processing request","Application error",true,null)}}};var Rewards={intPro_window:undefined,savAcc_window:undefined,gumby_window:undefined,rrb_window:undefined,mr_error_window:undefined,rewardsPromise:null,BottomDetach:"",RightDetach:"",rewardsBoxContent:"",eosOffersTBContent:"",featuredBoxContent:"",featuredBoxEPPContent:"",QbBoxContent:"",receiptTBContent:"",tagsBoxContent:"",yesOfferBoxContent:"",messages:{genericMessage:"We are experiencing intermittent delays. Please try again later."}};
Rewards.init=function(){Rewards.load();if($("#manageReceipts").length){$("#manageReceipts").on("click",ReceiptUI.openMatchShoeBoxHandler)}if($("#qbConnect").length&&$("#liteEnabled").val()!="true"){$("#qbConnect").on("click",function(){Tag.close();if($("#vamDisabled").val()=="false"){QB.authenticate()}else{qbUI.showIntuitLayer()}})}if($("#qbLearn").length&&$("#liteEnabled").val()!="true"){$("#qbLearn").on("click",function(){Tag.close();qbUI.learnCategories()})}if($("#qbTransactionsButton").length&&$("#liteEnabled").val()!="true"){$("#qbTransactionsButton").on("click",function(){if(QB.setUpComplete&&QB.isacctMappingPending){QB.enrollPromise=null;
QB.enrollStatusUpdated=true;QB.setUpComplete=false;QB.load();$.when(QB.enrollPromise).then(function(){if(!QB.isacctMappingPending){itag_events="event51";itag_products=";US:Ser:eStatement:QB:ManageTransactions";QB.openQBTransactions();QB.enrollStatusUpdated=false;QB.enrollPromise=null}})}else{itag_events="event51";itag_products=";US:Ser:eStatement:QB:ManageTransactions";QB.openQBTransactions()}})}if($("#qbContinueSetup").length&&$("#liteEnabled").val()!="true"){$("#qbContinueSetup").on("click",function(){Tag.close();
QB.continueSetup()})}if($("#liteEnabled").val()!="true"){$("#qbControlPanel").on("click",function(){Tag.close();QB.showControlPanel()})}};Rewards.rightColumnLocation=function(){if(channelType=="T"&&$("body").hasClass("res_Medium")){$(".reward-columns").css({display:"block"});$(".reward-column.col-1").append(Rewards.rewardsBoxContent);$(".reward-column.col-1").append(Rewards.eosOffersTBContent);$(".reward-column.col-1").append(Rewards.featuredBoxContent);$(".reward-column.col-1").append(Rewards.featuredBoxEPPContent);
$(".reward-column.col-2").append(Rewards.QbBoxContent);$(".reward-column.col-2").append(Rewards.receiptTBContent);$(".reward-column.col-3").append(Rewards.tagsBoxContent);$(".reward-columns").append(Rewards.yesOfferBoxContent)}else{if(channelType=="T"&&$("body").hasClass("res_Large")){$(".reward-columns").css({display:"none"});Rewards.rewardsBoxContent=$("#rewardsBox").detach();$(".reward-columns-right").append(Rewards.rewardsBoxContent);Rewards.QbBoxContent=$("#QbBox").detach();$(".reward-columns-right").append(Rewards.QbBoxContent);
Rewards.featuredBoxContent=$("#featuredBox").detach();$(".reward-columns-right").append(Rewards.featuredBoxContent);Rewards.featuredBoxEPPContent=$("#featuredBoxEPP").detach();$(".reward-columns-right").append(Rewards.featuredBoxEPPContent);Rewards.receiptTBContent=$("#receiptTB").detach();$(".reward-columns-right").append(Rewards.receiptTBContent);Rewards.tagsBoxContent=$("#tagsBox").detach();$(".reward-columns-right").append(Rewards.tagsBoxContent);Rewards.eosOffersTBContent=$("#eosOffersTB").detach();
$(".reward-columns-right").append(Rewards.eosOffersTBContent);Rewards.yesOfferBoxContent=$("#yesOfferBox").detach();$(".reward-columns-right").append(Rewards.yesOfferBoxContent)}}};Rewards.load=function(){var c=$("#viewRewards");if(c.val()=="true"){$("#fetchPreferences").val(false);var e=[];e=formParameters.getParams("rewards.do");var d=Rewards.rewardsPromise=$.ajax("rewards.do",{type:"POST",data:e}).then(function(p,h,m){if(m.getResponseHeader("MYCAError")==null){$("#rewards").html(m.responseText);
$("#rewardsBox").css({display:"block"});var o=$("#rrbOpenLayerStatus").val();var q=$("#openLayer").val();var s=$("#zeroBiller").val();var f=$("#liteEnabled").val();if(q=="R"){if(o!=null&&o=="RO"){showCobrandSummary()}else{if(o!=null&&o=="RO"&&f=="true"){showCobrandSummary()}else{if(o!=null&&o=="RE"&&s=="false"){Amex.Msg.error("error processing request",Rewards.messages.genericMessage,true,null)}}}$("#openLayer").val("")}else{if(q!=null&&q=="E"){if($("#edrLayerEligible").length&&$("#edrLayerEligible").val()=="true"&&$("#edrLayerLink").val()!=""){var r=$("#edrLayerLink").val();
EDR.open(r)}$("#openLayer").val("")}}var l=$("#plumActive").val();var n=$("#openPlumWindow").val();var s=$("#zeroBiller").val();var t=$("#bPIndex").length?$("#bPIndex").val():"-1";if(n=="Y"){if(l!=null&&l=="true"){Rewards.showBusinessFlex()}else{if(s=="false"){if(t=="1"){Amex.Msg.error("error processing request",Rewards.messages.genericMessage,true,null)}}}}$("#openPlumWindow").val("N")}else{$("#rewardsBox").hide()}},function(f){$("#rewardsBox").hide()});$("#fetchPreferences").val(true)}else{if($("#yourReceipts").length){$("#yourReceipts").on("click",ReceiptUI.openMatchShoeBoxHandler)
}}};showCobrandSummary=function(){if(!Rewards.loading){Rewards.loading=true;$("#fetchPreferences").val(false);var c=[];c=formParameters.getParams("cobrandSummary.do");new $.ajax("cobrandSummary.do",{type:"POST",data:c,success:function(e,h,f){if(f.getResponseHeader("Rewards_Summary_Error")==null){Rewards.cobrandLayer(e);if($("#rrbContainer").length){var d=RewardsPanel.init("rrbContainer")}}else{Rewards.mrErrorLayer()}},error:function(d){Rewards.mrErrorLayer()}});$("#fetchPreferences").val(true)}};
Rewards.cobrandLayer=function(d){if($.browser.msie&&parseInt($.browser.version)==9){d=UIController.replaceHtml(d)}if($.isUndefined(Rewards.rrb_window)){Rewards.rrb_window=new Amex.Window({modal:true,left:250,top:200,theme:"amexWindow",buttons:["close"],title:"reward details",trigger:"cobrandViewMore",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){Rewards.loading=false;
Amex.PageOverlay.hide();return true}});Rewards.rrb_window.css({position:"absolute"})}Rewards.rrb_window.update("<div style='padding: 5px;height:420px;width:710px;'>"+d+"</div>");Rewards.rrb_window.setTriggerNode("cobrandViewMore");Rewards.rrb_window.centerInViewport();Rewards.rrb_window.open();var c=$("#closeRewardsWindowButton")};Rewards.closeRRBLayer=function(){Rewards.loading=false;Rewards.rrb_window.close();Amex.PageOverlay.hide()};Rewards.mrErrorLayer=function(){Amex.Msg.error("We Are Sorry","We apologize for the inconvenience, the system is currently unavailable.<br /> Please try your request again later.",true,function(c){Rewards.loading=false
});if($("#cobrandViewMore").length){Amex.Msg.setTriggerNode("cobrandViewMore")}else{if($("#busFlexId").length){Amex.Msg.setTriggerNode("busFlexId")}}};Rewards.showBusinessFlex=function(){if(!Rewards.loading){Rewards.loading=true;$("#fetchPreferences").val(false);var c=[];c=formParameters.getParams("businessFlex.do");new $.ajax("businessFlex.do",{type:"POST",data:c,success:function(d,f,e){if(e.getResponseHeader("Rewards_Summary_Error")!=null){Rewards.mrErrorLayer()}else{if(e.getResponseHeader("MYCAError")!=null){Rewards.mrErrorLayer()
}else{Rewards.businessFlexLayer(e.getResponseHeader("RewardsWindowTitle"),e.responseText)}}},error:function(d){Rewards.mrErrorLayer()}});$("#fetchPreferences").val(true)}};Rewards.businessFlexLayer=function(d,c){if($.isUndefined(Rewards.gumby_window)){Rewards.gumby_window=new Amex.Window({modal:true,left:250,top:200,theme:"amexWindow",buttons:["close"],title:"plum card history",trigger:"busFlexId",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){Rewards.loading=false;
Amex.PageOverlay.hide();return true}})}Rewards.gumby_window.setTitle(d);Rewards.gumby_window.update(c);Rewards.gumby_window.setTriggerNode("busFlexId");Rewards.gumby_window.centerInViewport();Rewards.gumby_window.open()};Rewards.closePlumLayer=function(){Rewards.loading=false;Rewards.gumby_window.close();Amex.PageOverlay.hide()};Rewards.showSavingsAccelerator=function(){if(!$.isUndefined(Rewards.intPro_window)){Rewards.intPro_window.close()}if($.isUndefined(Rewards.savAcc_window)){Rewards.savAcc_window=new Amex.Flyout({autoClose:true,right:195,top:290,theme:"amexWindow",trigger:"savingsAccId"});
Rewards.savAcc_window.update($("#savingsAccelerator").html())}Rewards.savAcc_window.setPositionRelative(-5,-540,"savingsAccId","lt");$("#savinAce").on("click",Rewards.closeSavAccLayer);Rewards.savAcc_window.toggle();var c=$("#savinAce");if(c.length){c.focus()}$("#savAcceleratorCloseButton").on("keydown",function(d){if(Amex.KEY_TAB==d.keyCode&&!d.shiftKey){d.stopPropagation();d.preventDefault();$("#savinAce").focus()}});$("#savinAce").on("keydown",function(d){if(Amex.KEY_TAB==d.keyCode&&d.shiftKey){d.stopPropagation();
d.preventDefault();$("#savAcceleratorCloseButton").focus()}})};Rewards.closeSavAccLayer=function(){Rewards.savAcc_window.close();Amex.PageOverlay.hide();$("#savingsAccId").focus()};Rewards.showInterestProtection=function(){if(!$.isUndefined(Rewards.savAcc_window)){Rewards.savAcc_window.close()}if($.isUndefined(Rewards.intPro_window)){Rewards.intPro_window=new Amex.Flyout({autoClose:true,right:350,top:400,theme:"amexWindow"});$("#intProCls").die().live("click",function(c){Rewards.closeIntProtLayer(c)
});Rewards.intPro_window.update($("#interestProtection").html())}Rewards.intPro_window.setPositionRelative(320,400,"interestProtId","bl");Rewards.intPro_window.toggle();$("#intProtCloseButton").on("keydown",function(c){if(Amex.KEY_TAB==c.keyCode&&!c.shiftKey){c.stopPropagation();c.preventDefault();$("#intProCls").focus()}});$("#intProCls").on("keydown",function(c){if(Amex.KEY_TAB==c.keyCode&&c.shiftKey){c.stopPropagation();c.preventDefault();$("#intProtCloseButton").focus()}})};Rewards.closeIntProtLayer=function(c){Rewards.intPro_window.close();
$("#interestProtId").focus();Amex.PageOverlay.hide()};Rewards.showRewards=function(d){var c=document.getElementById("sorted_index").value;var e="Face=en_US&request_type=authreg_Statement&sorted_index="+c+"&BPIndex=1";$("#fetchPreferences").val(false);new $.ajax("cobrandSummary.do",{type:"POST",data:e,success:function(h,m,l){if(l.getResponseHeader("Rewards_Summary_Error")==null){Rewards.cobrandLayer(h);if($("#rrbContainer").length){var f=RewardsPanel.init("rrbContainer")}}else{Rewards.errorMrLayer()
}$("#showRewardsRRB").val("false")},error:function(f){Rewards.errorMrLayer()}});$("#fetchPreferences").val(true)};Rewards.errorMrLayer=function(){Amex.Msg.error("error processing request",Rewards.messages.genericMessage,true,function(c){Rewards.loading=false})};var RewardsPanel={selected:null,tabs:null,tabHeader:null,overTab:null,tabElement:null,classNames:{tabHeader:"tabHeader",tabContent:"tabContent",over:"over",selected:"selected"}};RewardsPanel.init=function(d){var c=$("#"+d);this.tabHeaders=c.find("."+this.classNames.tabHeader);
this.selected=c.find("."+this.classNames.selected);this.tabs=c.find("."+this.classNames.tabContent);c.click(this.mouseClickListener);for(var e=0;e<this.tabHeaders.size();e++){this.tabHeaders[e].focus(this.focusListener);this.tabHeaders[e].blur(this.blurListener);if(e==0){this.tabElement=this.tabs[0];this.showTabElems(this.tabElement)}}};RewardsPanel.focusListener=function(c){if(this.overTab){this.overTab.removeClass(this.classNames.over)}this.overTab=c.target.addClass(this.classNames.over)};RewardsPanel.blurListener=function(c){c.target.removeClass(this.classNames.over)
};RewardsPanel.mouseClickListener=function(d){d.preventDefault();var c=$(d.target);if(c.hasClass(RewardsPanel.classNames.tabHeader)&&!c.hasClass("selected")){if(RewardsPanel.selected||RewardsPanel.selected.length){RewardsPanel.selected.removeClass(RewardsPanel.classNames.selected);$(RewardsPanel.tabs[RewardsPanel.selected.attr("id").substring(6)]).hide();RewardsPanel.selected=c;RewardsPanel.selected.addClass(RewardsPanel.classNames.selected);RewardsPanel.tabElement=RewardsPanel.tabs[c.attr("id").substring(6)];
$(".tabEle").each(function(e){$(this).hide()});$(RewardsPanel.tabs[c.attr("id").substring(6)]).fadeIn(1000);RewardsPanel.showTabElems(RewardsPanel.tabElement)}}};RewardsPanel.showTabElems=function(d){var c=$(d).nextAll();$.each(c,function(e){if($(this).hasClass("tabContent")){return false}else{$(this).fadeIn(1000)}})};var BonusPoints={window:null,skipTimer:true,init:function(c){BonusPoints.window=new Amex.Window({modal:true,theme:"amexWindow",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});
BonusPoints.window.update("<div><iframe src='"+c+"' scrolling='NO' frameborder='0'style='width: 784px; height: 556px;'></iframe></div>");BonusPoints.window.render(document.body);return BonusPoints},open:function(e){var c=$("#startDate").val();var d=$("#endDate").val();e=e+"&sorted_index="+T1.card.getSelected().index+"&BPIndex="+T1.period.getSelected().BPIndex+"&startDate="+c+"&endDate="+d;BonusPoints.init(e);BonusPoints.window.render(document.body);BonusPoints.window.centerInViewport();BonusPoints.window.open();
if(null!=$("#bonusOffersDetailData")){parent.BonusPopUp.OpenLayer($("#bonusOffersDetailData").html())}Omniture.report("RWD_ViewBonusDetails")},close:function(){Amex.PageOverlay.disableAlertMode();BonusPoints.window.close();BonusPoints.window.destroy()},block:function(){Amex.PageOverlay.enableAlertMode()},unblock:function(){Amex.PageOverlay.disableAlertMode()},deleteTimer:function(){BonusPoints.skipTimer=false}};function closeBonusPoints(){BonusPoints.close()}function blockBonusPoints(){BonusPoints.block()
}function unblockBonusPoints(){BonusPoints.unblock()}function clickListener(c){App.lastClick=new Date()}function requestListener(){App.lastRequest=new Date()}var BonusPopUp={window:null,OpenLayer:function(c){BonusPopUp.window=new Amex.Window({modal:true,left:50,top:50,zIndex:9000});BonusPopUp.window.update("<div>"+c+"</div>");BonusPopUp.window.render(document.body);BonusPopUp.window.centerInViewport();BonusPopUp.window.open();window.setTimeout(function(){BonusPoints.closeTimer()},10000)},close:function(){BonusPopUp.window.close();
Amex.PageOverlay.disableAlertMode();BonusPoints.deleteTimer()},block:function(){Amex.PageOverlay.enableAlertMode()},unblock:function(){Amex.PageOverlay.disableAlertMode()}};BonusPoints.closeTimer=function(){if(BonusPoints.skipTimer){BonusPoints.close();parent.BonusPopUp.close();Amex.Msg.alert(Amex.Msg.information,"We are experiencing intermittent delays. Please try again later.",true,null);BonusPoints.skipTimer=true}};var Filter={id:"filter",window:null,element:undefined,data:null,changed:0};Filter.init=function(){var d=$("#filterData");
if(d.length){Filter.data=d.html();d.remove();if(Filter.window==null){Filter.window=new Amex.Window({modal:true,theme:"amexWindow",buttons:["close"],title:"Filter By",trigger:"applyfilter",onClose:Filter._onClose,shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect});Filter.window.update(Filter.data);Filter.window.render(Page.form.id);var e=Filter.window.getElement();
e.click(Filter._clickListener);e.keydown(function(h){var f=(h.keyCode?h.keyCode:h.which);if(f==13&&$(h.target).nodeName=="input"){h.stopPropagation()}else{if(f==27){Filter.close()}}})}}else{}if($("#filterApplied").val()==="true"){Filter.applied=true;$("#clearfilter").show();var c=$("#mainContentRewards");if(c.length){if($.browser.msie){c.css({marginTop:"22px"})}else{c.css({marginTop:"24px"})}}}else{if($("#filterApplied").val()==="false"){Filter.applied=false;$("#clearfilter").hide();var c=$("#mainContentRewards");
if(c!=null){c.css({marginTop:""})}}}};Filter.open=function(){if(T2.bar.getSelected()==null){Amex.Msg.alert(Amex.Msg.information,T1.buttonNotSelected,true,null);return}if(Filter.window!=null){Tag.close();if(TagList.tagArr){TagUI.updateFilter()}if($("#"+Page.form.viewType).val()!="L"){$("#paymentMsg").show()}else{$("#paymentMsg").hide()}Filter.initFrom=$("#fromAmount").val().replace(/\W/g,"");Filter.initTo=$("#toAmount").val().replace(/\W/g,"");Filter.window.centerInViewport();Filter.changed=0;Filter.window.open();
$("#fromAmount").focus()}Omniture.report("Filters_Track")};Filter.close=function(){if(Filter._onClose()){Filter.window.close();Amex.PageOverlay.hide(true)}};Filter._onClose=function(c){if(Filter.isChanged()){Amex.Msg.confirm(Amex.Msg.msgConfirm,"Your changes will not be applied. Are you sure you want to cancel?",true,function(d){if("YES"==d){Filter.window.close();Amex.PageOverlay.hide(true);Filter.window.update(Filter.data)}else{if("NO"==d){$("#filterCanButton").focus()}}});Amex.Msg.setTriggerNode("filterCanButton");
return false}else{Amex.PageOverlay.hide(true);return true}};Filter.isChanged=function(){return(Filter.changed!=0)||(Filter.initFrom!=$("#fromAmount").val().replace(/\W/g,""))||(Filter.initTo!=$("#toAmount").val().replace(/\W/g,""))};Filter.apply=function(){var c=Filter.isChanged();if(c||Filter.applied){if(Filter.isValidAmount()){if(c){Amex.PageOverlay.setIgnoreHide(true);Filter.window.close();Filter.run()}else{Filter.window.close();Amex.PageOverlay.hide(true)}}}else{Amex.Msg.alert(Amex.Msg.information,"Please select at least one Filter to continue.",true);
Amex.Msg.setTriggerNode("filterContButton")}Omniture.report("filter_apply")};Filter.run=function(){$("#pageNumber").val(1);var c=$("#"+Page.form.viewType).val();if(c=="L"){Status.startLoad("search");if(QB.isQBTransOpen){$("#intuitRequestType").val("getListQBData");$("#connectionId").val(QB.connectionId)}if($("#recentTransaction").length&&($("#pendingOpen").length)&&($("#pendingOpen").val()=="true")){if(null!=$("#listTag input:checked")&&($("#listTag input:checked").length)===0){List.load("filterlist.do","search")
}else{List.load("filterlist.do","pendingTagFilter")}}else{List.load("filterlist.do");if($("#pendingItems").length){$("#pendingItems").html("");$("#pendingTransCount").val("")}}}else{if(c=="S"){$("#splitPaneState").val("N");T2.loadSummaryView()}else{T2.loadGraphView()}}};Filter.isValidAmount=function(){var e=$("#fromAmount").val();var d=$("#toAmount").val();var c=true;if(!e.isBlank()||!d.isBlank()){e=parseFloat(e);d=parseFloat(d);if(isNaN(e)||isNaN(d)){c=false}else{if(e>d){c=false}else{if(e<0||d<0||e>2147483647||d>2147483647){c=false
}}}if(!c){Amex.Msg.alert(Amex.Msg.information,"Please enter numeric values, where the 'To' amount is greater than or equal to the 'From' amount.",true);Amex.Msg.setTriggerNode("fromAmount")}else{$("#fromAmount").val(e);$("#toAmount").val(d)}}return c};Filter.clear=function(m){var e=$("#list"+m);if(e.length){if(e.attr("id")=="listAmount"){$("#toAmount").val("");$("#fromAmount").val("");$("#toAmount").css({color:"black",border:"1px solid #bbb"});$("#fromAmount").css({color:"black",border:"1px solid #bbb"})
}else{var l=e.find("input");var c=l.length;for(var h=0;h<c;h++){var d=$(l[h]);var f=d.is(":checked");if(f!=false){if(d.initial!=undefined&&d.initial==false){Filter.changed--}else{d.initial=f;Filter.changed++}d.removeAttr("checked")}}}}};Filter.clearAll=function(){Amex.OverlayManager.block();Filter.clear("Amount");Filter.clear("Tran");Filter.clear("Cat");Filter.clear("Tag");$("#defaultSort").val("N");Search.clear();$("#applyfilter").focus();Omniture.report("filter_clear")};Filter.remove=function(d){$("#defaultSort").val("N");
if(d===1){Amex.OverlayManager.block();Search.clear();Omniture.report("search_bclear")}else{if(d===2){Amex.OverlayManager.block();Filter.clear("Amount")}else{if(d===3){Amex.OverlayManager.block();Filter.clear("Tran")}else{if(d===4){Amex.OverlayManager.block();var c=$("#listCat").find("input[id^='catId']");c.each(function(e){if($(this).is(":checked")==true){$(this).removeAttr("checked");var f=$("#subcatId"+$(this).val());f.find("input").each(function(h){$(this).removeAttr("checked")})}})}else{if(d==5){Amex.OverlayManager.block();
var c=$("#listCat").find('input[id^="catId"]');c.each(function(e){if($(this).attr("checked")==undefined){var f=$("#subcatId"+$(this).val());f.find("input").each(function(h){$(this).removeAttr("checked")})}})}else{if(d==6){Amex.OverlayManager.block();Filter.clear("Tag")}}}}}Filter.run();Omniture.report("filter_bclear")}};Filter.amountFocus=function(c){$(c).css({color:"black",border:"1px solid #bbb"});c.select()};Filter.amountBlur=function(c){if(c.value.isBlank()){c.value="";return}var d=parseFloat(c.value.replace(/[^\.,\d]/g,""));
if(isNaN(d)){$(c).css({color:"#d90000",border:"1px solid #d90000"})}else{$(c).css({color:"black",border:"1px solid #bbb"});c.value=d}};Filter._clickListener=function(c){var f=$(c.target);var d=f.attr("id");if(d&&f.is($(":checkbox"))){var t=f.initial;var e=f.is(":checked");if(t!=undefined){Filter.changed+=(e==t)?-1:1}else{Filter.changed++;f.initial=!e}if(d.startsWith("catId")){var l=$("#sub"+d);if(l.length){if(l.boxes==undefined){l.boxes=l.find("input")}var o=l.boxes.length;for(var m=0;m<o;m++){var r=$(l.boxes[m]);
var p=r.is(":checked");if(r.initial==undefined){r.initial=p;Filter.changed++}else{if(p!=e){Filter.changed+=(r.initial==e)?-1:1}}r.prop("checked",e)}if(!l.is(":visible")){l.show();var n=$("#toggle_sub"+d);if(n.length){n.html("[-]")}}}}else{if(d.startsWith("subcatId")){var s=false;var h=$("#catId"+(f.val()).split("~")[0]);if(f.is(":checked")){var q=f.parent().parent().find("input");var o=q.length;if(o>0){s=true}for(var m=0;m<o;m++){if(!$(q[m]).is(":checked")){s=false;break}}}if(h.is(":checked")!=s){if(h.initial=="undefined"){Filter.changed++;
h.initial=h.is(":checked")}else{Filter.changed+=(h.initial==s)?-1:1}h.attr("checked",s)}}}if(Filter.changed==0){Filter.changed=null}}else{if(d&&d.startsWith("toggle_subcatId")){var l=$("#"+d.substring(7));if(l.length){if(l.boxes==undefined){l.boxes=l.find("input")}if(l.is(":visible")){var o=l.boxes.length;for(var m=0;m<o;m++){if($(l.boxes[m]).is(":checked")&&l.is(":visible")){Amex.Msg.alert(Amex.Msg.information,"A Category can't be collapsed when a Subcategory has been selected. Please use the scroll bar to view more Categories.",true);
Amex.Msg.setTriggerNode(d);return}}l.hide();f.html("[+]");f.attr("title","Expand Category")}else{l.show();f.html("[-]");f.attr("title","Collapse Category")}}}else{if(d&&d.startsWith("clr")){Filter.clear(d.substring(3))}}}};var Search={f:"search",go:"go",title:"Search Transactions",validationMsg:'Search string cannot contain the following special characters: \\ ~ "',field:null};Search.init=function(){Search.field=$("#"+Search.f);Search.field.on("focus",Search.focusField).on("blur",Search.blurField).on("keydown",Search.keydown);
$("#"+Search.go).on("click",function(c){c.preventDefault();Search.search();Omniture.report("search")});if(!$("#keyWord").val()==""){Search.field.val(($("#keyWord").val()).replace(/~_/g,"_"));Search.field.val((Search.field.val()).replace(/~%/g,"%"))}};Search.focusField=function(c){if(Search.isDefault()){Search.field.val("");Search.field.select();Amex.Util.closeFlyouts()}};Search.blurField=function(d){if(Search.field.val()==""){if($("#keyWord").val()==""){Search.field.val(Search.title)}else{var c=($("#keyWord").val()).replace(/~_/g,"_");
c=(c).replace(/~%/g,"%");Search.field.val(c)}}};Search.isDefault=function(){return("searchtransactions"==Search.field.val().replace(/\W/g,"").toLowerCase())};Search.search=function(d){var e=$("#"+Page.form.viewType).val();if(!Search.isDefault()&&Search.validate(Search.field.val())){var c=(Search.field.val()).replace(/%/g,"~%");c=(c).replace(/_/g,"~_");$("#keyWord").val(c);$("#pageNumber").val(1);if(e=="L"){Amex.OverlayManager.block("mainContentData");Status.startLoad("search");if(QB.isQBTransOpen){$("#intuitRequestType").val("getListQBData");
$("#connectionId").val(QB.connectionId)}if($("#recentTransaction").length&&($("#pendingOpen").length)&&($("#pendingOpen").val()=="true")){List.load("filterlist.do","search")}else{List.load("filterlist.do");if($("#pendingItems").length){$("#pendingItems").html("");$("#pendingTransCount").val("")}}}else{if(e=="S"){T2.loadSummaryView()}else{T2.loadGraphView()}}}};Search.keydown=function(d){var c=(d.keyCode?d.keyCode:d.which);if(c===13){d.stopPropagation();if(Search.field.val()==""){Search.clear()}else{Search.search(d)
}Omniture.report("search")}};Search.validate=function(c){if(T2.bar.getSelected()==null){Amex.Msg.alert(Amex.Msg.information,T1.buttonNotSelected,true,null);return false}var d=/[~"]/;if(d.test(c)||c.indexOf("\\")!=-1){Amex.Msg.alert(Amex.Msg.information,Search.validationMsg,true,null);return false}else{return true}};Search.clear=function(){Search.field.val("");$("#keyWord").val("");Search.search();Search.field.val(Search.title)};var SearchUIController={};SearchUIController.check=function(c){var d=c.list_end;
if(!$.isUndefined(d)){Amex.PageOverlay.setIgnoreHide(false);Amex.OverlayManager.unblock(false,"mainContentData");if($.isUndefined(d.error)||d.error==null){SearchUIController.success(d)}else{SearchUIController.error(d)}Status.endLoad()}else{}};SearchUIController.success=function(c){if($.browser.msie&&parseInt($.browser.version)==9){$("#mainContentData").html(UIController.replaceHtml(c.response.responseText))}else{$("#mainContentData").html(c.response.responseText)}$.extend(listResponse,{BPIndex:$("#bPIndex").val()});
var d=$.jcp("run","@list/list",listResponse);$("#listTemplate").html(d);List.init();List_mb.resizeFunction();if($("#_filterApplied").length){$("#clearfilter").show()}else{$("#clearfilter").hide()}UIController.updateStatus();Rewards.rightColumnLocation()};SearchUIController.error=function(c){Amex.Msg.error("error processing request",c.response.responseText,true,null)};var TopLinks={download:null,print:null,learn:null,help:null,COOKIE_NAME:"rntcookie",COOKIE_EXP:10,DOMAIN:null,height_add1:155,IFRAMEHEIGHT:230,LAYERHEIGHT:340,height_add1:155,height_add2:160};
TopLinks.init=function(){$("#"+Page.topLinks.download).on("click",TopLinks.downloadAction);$("#topLinkPrint").on("click",TopLinks.printAction);$("#topLinkExpReport").on("click",TopLinks.expenseAction);$("#LinkYESPDF").on("click",TopLinks.downloadMktPDF);$("#"+Page.topLinks.help).on("click",TopLinks.helpAction);if($("#showRewardsRRB").length){if($("#showRewardsRRB").val()=="true"){Rewards.showRewards()}}};TopLinks.expenseAction=function(d){var f=T1.period.getSelected();if(f==null||f.BPIndex==-97||f.BPIndex==-98){Amex.Msg.alert(Amex.Msg.information,"Please select a Billing Statement Time Period to create an expense report.",true)
}else{Omniture.reportClick("LinkBilling");var e=new String(window.location);var c=e.substring(0,e.indexOf("/myca/"));c+="/myca/expensereport/us/welcome.do?request_type=authreg_SERDest&Face=en_US_corp";c+="&sorted_index="+T1.card.getSelected().index+"&BPIndex="+f.BPIndex;window.location=c}};TopLinks.downloadAction=function(c){c.preventDefault();if(T2.bar.getSelected()==null){Amex.Msg.alert(Amex.Msg.information,T1.buttonNotSelected,true,null);return false}Download.open()};TopLinks.printAction=function(e){var c=$("#viewType").val();
e.preventDefault();if(TopLinks.print==null){TopLinks.individualItem=new Amex.MenuItem("printIndividual","<div class='iconMenu'><a href='#' class='subMenu' onclick='{return false;}'>Individual Transactions</a></div>");TopLinks.thisPageItem=new Amex.MenuItem("printCrtPage","<div class='iconMenu'><a href='#' class='subMenu' onclick='{return false;}'>This Page Only</a></div>");TopLinks.allItem=new Amex.MenuItem("printAllTrans","<div class='iconMenu pdfIcon'><a href='#' class='subMenu' onclick='{return false;}' >All Transactions</a></div>");
TopLinks.print=new Amex.Menu({theme:"amexMenu",left:790,top:118,prevFocus:"topLinkPrint",nextFocus:"needhelp",columns:1,shadow:{size:4,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}},[TopLinks.individualItem,TopLinks.thisPageItem,TopLinks.allItem]);TopLinks.print.setPositionRelative(1,-TopLinks.print.outerWidth(),"topLinkPrint","br");TopLinks.print.render(document.body);var d=TopLinks.print.getElement();d.on("amex:click",Print.init)}var f=$("#viewType").val();
if(f=="S"){if($("#listData").length===0){TopLinks.individualItem.disable();TopLinks.thisPageItem.disable()}else{TopLinks.individualItem.enable();TopLinks.thisPageItem.enable()}if($("#summary-table").length===0){TopLinks.allItem.disable()}else{TopLinks.allItem.enable()}}else{if(f=="G"){if($("#listData").length===0){TopLinks.individualItem.disable();TopLinks.thisPageItem.disable();TopLinks.allItem.disable()}else{TopLinks.individualItem.enable();TopLinks.thisPageItem.enable();TopLinks.allItem.enable()
}}else{if($("#listData").length===0){TopLinks.individualItem.disable();TopLinks.thisPageItem.disable();TopLinks.allItem.disable()}else{TopLinks.individualItem.enable();TopLinks.thisPageItem.enable();TopLinks.allItem.enable()}}}TopLinks.print.toggle()};TopLinks.helpAction=function(d){try{if(window.IOASSIST){IOASSIST.ioaBox.iOALayerFaqCall("",2.838,d||window.evt)}}catch(c){}};TopLinks.createCookie=function(e,l,f,h){if(f){var d=new Date();d.setTime(d.getTime()+(f*60*1000));var c="; expires="+d.toGMTString()
}else{var c=""}if(h){document.cookie=e+"="+l+c+"; path=/; domain="+h}else{document.cookie=e+"="+l+c+"; path=/"}};TopLinks.eraseCookie=function(c){TopLinks.createCookie(c,"",-1,TopLinks.DOMAIN);$("#iframe_layer").attr("src","")};function resizeToContent(d){var e=$(parent).find("#iframe_layer").outerHeight()||TopLinks.IFRAMEHEIGHT;var c=$(parent).find("#widgetLayer").outerHeight()||TopLinks.LAYERHEIGHT;if(d=="open"){if(e<=TopLinks.IFRAMEHEIGHT){e+=TopLinks.height_add1}if(c<=TopLinks.LAYERHEIGHT){c+=TopLinks.height_add2
}}else{if(d=="close"){e-=TopLinks.height_add1;c-=TopLinks.height_add2}}$(parent).find("#iframe_layer").css("height",e+"px");$(parent).find("#widgetLayer").css("height",c+"px")}TopLinks.downloadMktPDF=function(c){Page.form.submit("marketingPDF.do")};var T1={card:null,period:null,ace:null,cardChnMsg:'Your Tag selection will not be maintained. All other choices will persist. Click "OK" to continue with your Card selection.',buttonNotSelected:'You must select a "View By" view to continue.',cardChnMsg2:'Your Tag selection will not be maintained. Click "OK" to continue with your Card selection.',eSDRLite:null};
T1.init=function(){T1.card=new Des.CardSelectButton("cardSelect",{menuPosition:"bl",prevFocus:"needhelp",nextFocus:"expandTP",menu:{theme:"cardSelectMenu",left:0,top:0,width:320,position:"bl",shadow:{size:4,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}},items:_cardsList,templates:{basic:$.template('<a href="#" title="" hidefocus="hidefocus" onclick="{return false;}"><span class="cardListdescription" title="#{description}">#{description}</span> - <span class=\'cardListaccount\' title=\'#{account}\'>#{account}</span></a>'),supp:$.template('<a href="#" title="" hidefocus="hidefocus" onclick="{return false;}"><span class="suppcardListname" title="#{name}">#{name}</span> - <span class="suppcardListaccount" title="#{account}">#{account}</span></a>'),allOpen:$.template('<a href="#" title="" hidefocus="hidefocus" onclick="{return false;}"><span style="font-weight: bold;">#{description}</span></a>')}});
T1.card.options.menu.render("cardMenuPlaceholder");var d=$("#aaLink");if(d.length){var c=new Amex.MenuItem("aaCard",d.show());T1.card.options.menu.addItem(c)}T1.period=new Des.PeriodSelectButton("periodSelect",{menuPosition:"bl",prevFocus:"cardExpand",nextFocus:"s",menu:{theme:"periodSelectMenu",left:0,top:0,width:287,position:"bl",shadow:{size:4,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}},items:_periodList,templates:{main:$.template("<a title='' href='#' hidefocus='hidefocus' onclick='{return false;}'><span class='periodListName' >#{name}</span><span class='peroidListDescription' >#{description}&nbsp;</span><span class='tpClear'></span></a>"),sub:$.template("<a title='' hidefocus='hidefocus' href='#' onclick='{return false;}'><span class='peroidListSpace' >&nbsp;</span><span class='peroidListDescription' >#{description}&nbsp;</span><span class='tpClear'></span></a>"),subMenu:$.template("<a title='' hidefocus='hidefocus' href='#' onclick='{return false;}'><span class='floatSubMenu'>#{description}</span><span class='tpClear'></span></a>")}});
T1.period.options.menu.render("periodMenuPlaceholder");T1.card.on("change",T1.changeCard);T1.period.on("change",T1.changePeriod);T1.period.on("open",CustomPeriod.revert);var e=T1.period.getSelected();if(e&&e.zeroBiller){$("#zeroBiller").val(e.zeroBiller)}else{$("#zeroBiller").val("false")}};T1.changeCard=function(c,e){var f=e.object,d=null;if($("#pendingTransCount").length){$("#pendingTransCount").val("")}if($("#refreshCache").length){$("#refreshCache").val(true)}if(f.index==-99){AllOpen.openCardSelect();
return}if(T2.bar.getSelected()==null){T1.card.selectByIndex(Status.current.card.index,Status.current.card.supp,false);Amex.Msg.alert(Amex.Msg.information,T1.buttonNotSelected,true,null);return}$("#updateSuppDisplay").val("true");if(Status.current.card){if(Status.current.card.flex&&!f.flex){var n=$("#transactionTypes_1");if(n.length&&n.is(":checked")&&n.val()==3){$("#transactionTypes_0").prop("checked",true);n.prop("checked",false)}}}$("#sorted_index").val(f.index);$("#suppIndex").val(f.supp);var l=$("#multiCardView");
if(l.val()=="true"){l.val(false);$("#bPIndex").val(0);$("#viewType").val("L");$("#resetRequested").val(true);if($("#userInPreferredView").val()=="true"){$("#preferredView").val(true);$("#cardChanged").val(true)}else{$("#normalViewCardChanged").val(true)}}else{$("#resetRequested").val(false);var o=T1.period.getSelected();if(o!=null){$("#bPIndex").val(o.BPIndex);$("#startDate").val(o.startDate);$("#endDate").val(o.endDate);$("#zeroBiller").val(o.zeroBiller)}}var h=$("#viewType").val();if(h=="S"){if(T1.isLiteCard(f.index)){$("#viewType").val("L");
$("#reportType").val("1");$("#listJson").val("true");d="cardChangeList.do"}else{d="defaultsummary.do"}}else{if(h=="L"){$("#listJson").val("true");d="cardChangeList.do"}else{if(h=="G"){$("#summaryXAxis").val("");$("#summaryYAxis").val("");$("#summarySubYAxis").val("");$("#splitPaneState").val("N");if($("#suppInclude").is(":checked")){$("#suppInclude").prop("checked",false)}if(T1.isLiteCard(f.index)){$("#reportType").val("1")}d="defaultgraph.do"}}}if(Status.current.card.index!=f.index){var p=$("#OMNFilterString");
if(p.length){var m=p.val().indexOf("Tags");if(m!=-1){if(p.val().length==4&&p.val().toLowerCase()=="tags"){Amex.Msg.alert(Amex.Msg.information,"Your Tag selection will not be maintained.<br />Click OK to continue with your card selection.",true,function(q){Filter.clear("Tag");Amex.OverlayManager.block();Omniture.report("card_change");T1.checkLite(f.index);if($("#userInPreferredView").val()=="true"){$("#preferredView").val(true);$("#cardChanged").val(true)}else{$("#normalViewCardChanged").val(true)
}Page.form.submit(d)});return}else{Amex.Msg.alert(Amex.Msg.information,"Your Tag selection will not be maintained. All other choices will persist. <br />Click OK to continue with your card selection.",true,function(q){Filter.clear("Tag");Amex.OverlayManager.block();Omniture.report("card_change");T1.checkLite(f.index);if($("#userInPreferredView").val()=="true"){$("#preferredView").val(true);$("#cardChanged").val(true)}else{$("#normalViewCardChanged").val(true)}Page.form.submit(d)});return}}else{Amex.OverlayManager.block();
Omniture.report("card_change");T1.checkLite(f.index);if($("#userInPreferredView").val()=="true"){$("#preferredView").val(true);$("#cardChanged").val(true)}else{$("#normalViewCardChanged").val(true)}Page.form.submit(d)}}else{Amex.OverlayManager.block();Omniture.report("card_change");T1.checkLite(f.index);if($("#userInPreferredView").val()=="true"){$("#preferredView").val(true);$("#cardChanged").val(true)}else{$("#normalViewCardChanged").val(true)}Page.form.submit(d)}}else{Amex.OverlayManager.block();
Omniture.report("card_change");$("#cardChanged").val(false);$("#normalViewCardChanged").val(true);T1.checkLite(f.index);Page.form.submit(d)}$("#listJson").val("false")};T1.checkLite=function(e){var d=$("#cardsInLite").val();var c="";if($("#mycaLite").val()=="true"){c=$("#allCardsInLite").val()+e+","}if(d!=null&&d!=""){$("#mycaLite").val("false");if(d.indexOf(e+",")!=-1){$("#liteEnabled").val("true")}else{$("#liteEnabled").val("false")}}else{if(c!=null&&c!=""){$("#liteEnabled").val("false");if(c.indexOf(e+",")!=-1){$("#mycaLite").val("true")
}else{$("#mycaLite").val("false")}}}};T1.isLiteCard=function(d){var c=$("#cardsInLite").val();if(c.indexOf(d+",")!=-1){return true}else{return false}};T1.changePeriod=function(c,e){if(T2.bar.getSelected()==null){UIController.revertTimePeriod();Amex.Msg.alert(Amex.Msg.information,T1.buttonNotSelected,true,null);Amex.Msg.setTriggerNode($("#periodDropArrow").children()[0].id);return false}var d=e.object.getSelected();$("#bPIndex").val(d.BPIndex);$("#startDate").val(d.startDate);$("#endDate").val(d.endDate);
$("#zeroBiller").val(d.zeroBiller);$("#inCycleCut").val(d.inCycleCut);if(d.BPIndex!=-99){CustomPeriod.revert();Omniture.report("period_change",T1.getTPType(d.BPIndex))}T2.changeTimePeriod()};T1.showHideAceMsg=function(d,c){if(T1.ace==null){T1.ace=new Amex.Flyout({autoClose:true,shadow:{size:4,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect});T1.ace.update($("#aceMessage"));T1.ace.render(document.body);
T1.ace.setPositionRelative(0,0,"aceAnchor","br")}if(d=="show"){T1.ace.open()}else{if(d=="hide"){T1.ace.close()}}};T1.getTPType=function(c){switch(c){case 0:return"TimePeriod:Recent Activity";case 1:return"TimePeriod:Current Statement";case 2:return"TimePeriod:Previous Statement 1";case 3:return"TimePeriod:Previous Statement 2";case 4:return"TimePeriod:Previous Statement 3";case 5:return"TimePeriod:Previous Statement 4";case 6:return"TimePeriod:Previous Statement 5";case -97:return"TimePeriod:YearToDate";
case -98:return"TimePeriod:YearEndSummary"}};T1.showHideMycaLiteMsg=function(d,c){if(T1.eSDRLite==null){T1.eSDRLite=new Amex.Flyout({autoClose:true,shadow:{size:4,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect});T1.eSDRLite.update($("#aceMessage"));T1.eSDRLite.render(document.body);T1.eSDRLite.setPositionRelative(0,0,"mycaLiteAnchor","br")}if(d=="show"){T1.eSDRLite.open()}else{if(d=="hide"){T1.eSDRLite.close()
}}};var CustomPeriod={element:"customPeriod",from:"startDateTxtField",fromField:"startDateTxt",fromFieldRC:"startDateTxtRC",fromLink:"startDateTxtLink",to:"endDateTxtField",toField:"endDateTxt",toFieldRC:"endDateTxtRC",toLink:"endDateTxtLink",go:"periodGo",maxDate:null,minDate:null,validated:true,rcMinDate:null};CustomPeriod.init=function(){CustomPeriod.maxDate=new Date();CustomPeriod.maxDate.setTime($("#_maxDate").val());CustomPeriod.minDate=new Date();CustomPeriod.minDate.setTime($("#_minDate").val());
CustomPeriod.minDate.setHours(0);CustomPeriod.minDate.setMinutes(0);CustomPeriod.rcMinDate=new Date();CustomPeriod.rcMinDate.setTime($("#_rcMinDate").val());CustomPeriod.rcMinDate.setHours(0);CustomPeriod.rcMinDate.setMinutes(0);if(T1&&T2){var e=T1.period.getSelected();if(e==null){var f=Date.parseString($("#startDate").val(),"MMddyyyy");if(f){$("#"+CustomPeriod.fromField).val(f.format("MM/dd/yyyy"))}f=Date.parseString($("#endDate").val(),"MMddyyyy");if(f){$("#"+CustomPeriod.toField).val(f.format("MM/dd/yyyy"))
}}var c=new Amex.MenuItem("");c.update($("#"+CustomPeriod.element).show());c.css({padding:"0px"});c._selectable=true;T1.period.getMenu().addItem(c);c._focus=$("#"+CustomPeriod.fromField);c._hover=false;$("#"+CustomPeriod.fromField).focus(CustomPeriod.focus);$("#"+CustomPeriod.toField).focus(CustomPeriod.focus);$("#"+CustomPeriod.fromField).blur(CustomPeriod.blur);$("#"+CustomPeriod.toField).blur(CustomPeriod.blur);$("#"+CustomPeriod.fromField).keydown(function(d){if(d.which===Amex.KEY_TAB){if(d.shiftKey){$("#"+CustomPeriod.go).focus()
}else{$("#"+CustomPeriod.toField).focus()}}else{d.stopPropagation()}});$("#"+CustomPeriod.toField).keydown(function(d){if(d.keyCode===Amex.KEY_TAB){if(d.shiftKey){$("#"+CustomPeriod.fromField).focus()}else{$("#"+CustomPeriod.go).focus()}}else{d.stopPropagation()}});$("#"+CustomPeriod.go).keydown(function(d){if(d.keyCode===Amex.KEY_TAB){if(d.shiftKey){$("#"+CustomPeriod.toField).focus()}else{$("#"+CustomPeriod.fromField).focus()}}});$("#"+CustomPeriod.fromField).datepicker({changeMonth:true,changeYear:true,showOn:"button",buttonImage:$("#locImages").val()+"/icon_dropcalendar.png",buttonImageOnly:true,buttonText:"Open calendar for Start Date",showButtonPanel:true,showOtherMonths:true,selectOtherMonths:true,minDate:CustomPeriod.minDate,maxDate:CustomPeriod.maxDate,defaultDate:null,beforeShow:function(){T1.period.options.menu.closeSubmenus();
var d=Date.parseString($("#"+CustomPeriod.fromField).val(),"M/d/y");if(d){$("#"+CustomPeriod.fromField).val(d.format("MM/dd/yyyy"))}else{$("#"+CustomPeriod.fromField).val((new Date()).format("MM/dd/yyyy"))}}});$("#"+CustomPeriod.fromField).datepicker("widget").click(function(d){d.stopPropagation()});$("#"+CustomPeriod.toField).datepicker({changeMonth:true,changeYear:true,showOn:"button",buttonImage:$("#locImages").val()+"/icon_dropcalendar.png",buttonImageOnly:true,buttonText:"Open calendar for End Date",showButtonPanel:true,showOtherMonths:true,selectOtherMonths:true,minDate:CustomPeriod.minDate,maxDate:CustomPeriod.maxDate,defaultDate:null,beforeShow:function(){T1.period.options.menu.closeSubmenus();
var d=Date.parseString($("#"+CustomPeriod.toField).val(),"M/d/y");var h=Date.parseString($("#"+CustomPeriod.fromField).val(),"M/d/y");if(d){if(h&&h.isBefore(d)){CustomPeriod.setTo(d)}else{CustomPeriod.setTo(h)}}else{if(h&&h.isBefore(CustomPeriod.maxDate)){CustomPeriod.setTo(h)}else{CustomPeriod.setTo(new Date())}}}});$("#"+CustomPeriod.toField).datepicker("widget").click(function(d){d.stopPropagation()});$("#"+CustomPeriod.toField).datepicker("widget").addClass("amexCalendar");$("#"+CustomPeriod.go).click(CustomPeriod.goClick);
$("#"+CustomPeriod.element).on("click",function(d){return false})}else{}$.datepicker._gotoToday=function(m){var l=$(m);var h=this._getInst(l[0]);if(this._get(h,"gotoCurrent")&&h.currentDay){h.selectedDay=h.currentDay;h.drawMonth=h.selectedMonth=h.currentMonth;h.drawYear=h.selectedYear=h.currentYear}else{var d=new Date();h.selectedDay=d.getDate();h.drawMonth=h.selectedMonth=d.getMonth();h.drawYear=h.selectedYear=d.getFullYear();this._setDateDatepicker(l,d);this._selectDate(m,this._getDateDatepicker(l))
}this._notifyChange(h);this._adjustDate(l)};$(".ui-datepicker").off("change",CustomPeriod.onDatePickerChange);$(".ui-datepicker").on("change",CustomPeriod.onDatePickerChange)};CustomPeriod.onDatePickerChange=function(e){var f=e.target;if($(f).hasClass("ui-datepicker-year")||$(f).hasClass("ui-datepicker-month")){var d=$("#periodMenuPlaceholder .periodSelectMenu");var c=d.length-1;Amex._internal.ignoreAutoClose=$(d[c]).closest("div").attr("id")}};CustomPeriod.fromCheck=function(c){return c.isAfter(CustomPeriod.minDate)&&c.isBefore(CustomPeriod.maxDate)
};CustomPeriod.toCheck=function(c){var d=Date.parseString($("#"+CustomPeriod.fromField).val());if(d){d.add("d",-1);return c.isAfter(d)&&c.isBefore(CustomPeriod.maxDate)}else{return c.isAfter(CustomPeriod.minDate)&&c.isBefore(CustomPeriod.maxDate)}};CustomPeriod.setFrom=function(c){if(c){$("#"+CustomPeriod.fromField).val(c.format("MM/dd/yyyy"));$("#"+CustomPeriod.fromField).css({backgroundColor:"#ffffff"})}};CustomPeriod.setTo=function(c){if(c){$("#"+CustomPeriod.toField).val(c.format("MM/dd/yyyy"));
$("#"+CustomPeriod.fromField).css({backgroundColor:"#ffffff"})}};CustomPeriod.goClick=function(e){CustomPeriod.validated=true;CustomPeriod.validate(CustomPeriod,false);if(CustomPeriod.validated){T1.period.options.menu.closeSubmenus();var d=Date.parseString($("#"+CustomPeriod.fromField).val(),"M/d/y");var c=Date.parseString($("#"+CustomPeriod.toField).val(),"M/d/y");T1.period.setLabel("Date Range","from "+d.format("NNN dd, yyyy")+" to "+c.format("NNN dd, yyyy"));$("#bPIndex").val(-99);$("#startDate").val(d.format("MMddyyyy"));
$("#endDate").val(c.format("MMddyyyy"));Omniture.report("period_change","TimePeriod:Date Range");T1.period.getMenu().close();T1.period.clearSelected();T2.changeTimePeriod()}};CustomPeriod.focus=function(d){var c=$(d.target);T1.period.options.menu.closeSubmenus();c.css({backgroundColor:"#ffffff"});if(c.val().replace(/\s/g,"").toUpperCase()=="MM/DD/YYYY"){c.val("")}c.select()};CustomPeriod.blur=function(e){var d=$(e.target);if(d.val().isBlank()){d.val("MM/DD/YYYY")}else{if(d.val().replace(/\s/g,"").toUpperCase()!="MM/DD/YYYY"){var c=Date.parseString(d.val(),"M/d/y");
if(c){d.val(c.format("MM/dd/yyyy"));if(c.isBefore(CustomPeriod.minDate)||c.isAfter(CustomPeriod.maxDate)){d.css({backgroundColor:"#FAFA9E"})}}else{d.css({backgroundColor:"#FAFA9E"})}}}};CustomPeriod.revert=function(c){if($("#bPIndex").val()!=-99){$("#"+CustomPeriod.fromField).val("MM/DD/YYYY");$("#"+CustomPeriod.toField).val("MM/DD/YYYY");$("#"+CustomPeriod.fromFieldRC).val("MM/DD/YYYY");$("#"+CustomPeriod.toFieldRC).val("MM/DD/YYYY")}else{$("#"+CustomPeriod.fromField).val(Date.parseString($("#startDate").val(),"MMddyyyy").format("MM/dd/yyyy"));
$("#"+CustomPeriod.toField).val(Date.parseString($("#endDate").val(),"MMddyyyy").format("MM/dd/yyyy"))}};CustomPeriod.validate=function(c,e){var h=$("#"+c.fromField).val();var o=$("#"+c.toField).val();var m=Date.parseString(h,"M/d/y");var f=Date.parseString(o,"M/d/y");var n=[];var l=new Date();l.setTime($("#_minDate").val());var d=new Date();d.setTime($("#_rcMinDate").val());if(m==null&&h.toUpperCase()!="MM/DD/YYYY"){Amex.Msg.alert(Amex.Msg.information,"Please enter the date in the following format: MM/DD/YYYY",true);
Amex.Msg.setTriggerNode(c.fromField);c.validated=false}else{if(f==null&&o.toUpperCase()!="MM/DD/YYYY"){Amex.Msg.alert(Amex.Msg.information,"Please enter the date in the following format: MM/DD/YYYY",true);Amex.Msg.setTriggerNode(c.toField);c.validated=false}else{if(h.toUpperCase()==="MM/DD/YYYY"){Amex.Msg.alert(Amex.Msg.information,'Please select a "from" date.',true,null,350);Amex.Msg.setTriggerNode(c.fromField);c.validated=false}else{if(o.toUpperCase()==="MM/DD/YYYY"){Amex.Msg.alert(Amex.Msg.information,'Please select a "to" date.',true,null,350);
Amex.Msg.setTriggerNode(c.toField);c.validated=false}else{if(m&&f){if(!e&&m.isBefore(CustomPeriod.minDate)){Amex.Msg.alert(Amex.Msg.information,'Your "from" or "to" date should not be prior to '+l.format("NNN dd,yyyy"),true);Amex.Msg.setTriggerNode(c.fromField);c.validated=false}else{if(e&&m.isBefore(CustomPeriod.rcMinDate)){Amex.Msg.alert(Amex.Msg.information,'Your "from" or "to" date should not be prior to '+d.format("NNN dd,yyyy"),true);Amex.Msg.setTriggerNode(c.fromField);c.validated=false}else{if(m.isAfter(CustomPeriod.maxDate)){Amex.Msg.alert(Amex.Msg.information,'Please enter valid "from" and "to" dates.',true,null,350);
Amex.Msg.setTriggerNode(c.fromField);c.validated=false}else{if(f){if(f.isAfter(CustomPeriod.maxDate)){Amex.Msg.alert(Amex.Msg.information,'Please enter valid "from" and "to" dates.',true,null,350);Amex.Msg.setTriggerNode(c.fromField);c.validated=false}else{if(f.isBefore(m)){Amex.Msg.alert(Amex.Msg.information,'Your "from" date should be the same or an earlier date than your "to" date. ',true);Amex.Msg.setTriggerNode(c.fromField);c.validated=false}}}else{Amex.Msg.alert(Amex.Msg.information,"Please enter valid To Date.",true);
Amex.Msg.setTriggerNode(c.fromField);c.validated=false}}}}}else{Amex.Msg.alert(Amex.Msg.information,"Please enter the date in the following format: MM/DD/YYYY",true);Amex.Msg.setTriggerNode(c.fromField);c.validated=false}}}}}};var T2={bar:null,listOnly:null,category:null,merchant:null,due:null,tags:null,change:null,cardmember:null,category_time:null,action:null};T2.init=function(){var d=$("#reportType").val();T2.bar=new Amex.NavBar();if($("#"+Page.t2.list).length){T2.list=new ToggleButton(Page.t2.list,{normalClass:"navButtonNormal",hoverClass:"navButtonHover",downClass:"navButtonDown",disableClass:"navButtonDown"});
T2.bar.register(T2.list);T2.list.reportType=1;if(d==1){T2.bar.activateById(T2.list.getId())}T2.list.on("click",T2.changeReportType);T2.list.on("click",function(){Omniture.report("nav_details")})}if($("#"+Page.t2.category).length){var e=[];var c=$("#multiCardView").val()=="true"?true:false;if(c){e.push(new Amex.MenuItem("5","<button type='button' title='Show a summary of transactions by Category and Card'>CATEGORY BY CARD</button>"))}else{e.push(new Amex.MenuItem("5","<button type='button' title='Show a summary of transactons by Category and Cardmember'>CATEGORY BY CARDMEMBER</button>"))
}e.push(new Amex.MenuItem("2","<button type='button' title='Show a summary of transactions by Category and Time'>CATEGORY BY TIME</button>"));T2.category=new Des.CategoryButton(Page.t2.category,{normalClass:"navButtonNormal",hoverClass:"navButtonHover",downClass:"navButtonDown",disableClass:"navButtonDown",menuPosition:"bl",nextFocus:"nav_5",trigger:"nav_5",baseLabel:"CATEGORY",isMultiCard:c,menu:new Amex.Menu({theme:"categoryMenu",position:"bl",left:1,top:-1,prevFocus:"nav_1",nextFocus:"nav_5",trigger:"nav_5",columns:1,shadow:{size:4,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}},e)});
T2.bar.register(T2.category);if(d==5){if(c){T2.category.setLabel("CATEGORY BY CARD")}else{T2.category.setLabel("CATEGORY BY CARDMEMBER")}T2.category.reportType=5;T2.bar.activateById(T2.category.getId())}else{if(d==2){T2.category.setLabel("CATEGORY BY TIME");T2.category.reportType=2;T2.bar.activateById(T2.category.getId())}}T2.category.on("click",T2.categoryClick)}if($("#"+Page.t2.merchant).length){T2.merchant=new ToggleButton(Page.t2.merchant,{normalClass:"navButtonNormal",hoverClass:"navButtonHover",downClass:"navButtonDown",disableClass:"navButtonDown"});
T2.bar.register(T2.merchant);T2.merchant.reportType=3;if(d==3){T2.bar.activateById(T2.merchant.getId())}T2.merchant.on("click",T2.changeReportType);T2.merchant.on("click",function(){Omniture.report("nav_merchant")})}if($("#"+Page.t2.member).length){T2.member=new ToggleButton(Page.t2.member,{normalClass:"navButtonNormal",hoverClass:"navButtonHover",downClass:"navButtonDown",disableClass:"navButtonDown"});T2.bar.register(T2.member);T2.member.reportType=4;if(d==4){T2.bar.activateById(T2.member.getId())
}T2.member.on("click",T2.changeReportType);T2.member.on("click",function(){Omniture.report("nav_member")})}if($("#"+Page.t2.due).length){T2.due=new ToggleButton(Page.t2.due,{normalClass:"navButtonNormal",hoverClass:"navButtonHover",downClass:"navButtonDown",disableClass:"navButtonDown"});T2.bar.register(T2.due);T2.due.reportType=7;if(d==7){T2.bar.activateById(T2.due.getId())}T2.due.on("click",T2.changeReportType);T2.due.on("click",function(){Omniture.report("nav_due")})}if($("#"+Page.t2.tags).length){T2.tags=new ToggleButton(Page.t2.tags,{normalClass:"navButtonNormal",hoverClass:"navButtonHover",downClass:"navButtonDown",disableClass:"navButtonDown"});
T2.bar.register(T2.tags);T2.tags.reportType=6;if(d==6){T2.bar.activateById(T2.tags.getId())}T2.tags.on("click",T2.changeReportType);T2.tags.on("click",function(){Omniture.report("nav_tags")})}if($("#"+Page.t2.cardmember).length){T2.cardmember=new ToggleButton(Page.t2.cardmember,{normalClass:"navButtonNormal",hoverClass:"navButtonHover",downClass:"navButtonDown",disableClass:"navButtonDown"});T2.bar.register(T2.cardmember);T2.cardmember.reportType=4;if(d==4){T2.bar.activateById(T2.cardmember.getId())
}T2.cardmember.on("click",T2.changeReportType);T2.cardmember.on("click",function(){Omniture.report("nav_member")})}if($("#"+Page.t2.category_time).length){T2.category_time=new ToggleButton(Page.t2.category_time,{normalClass:"navButtonNormal",hoverClass:"navButtonHover",downClass:"navButtonDown",disableClass:"navButtonDown"});T2.bar.register(T2.category_time);T2.category_time.reportType=2;if(d==2){T2.bar.activateById(T2.category_time.getId())}T2.category_time.on("click",T2.changeReportType);T2.category_time.on("click",function(){Omniture.report("nav_category_time")
})}T2.change=new ToggleButton("navChangeView",{normalClass:"navGraphView",hoverClass:null,downClass:"navListView",downLabel:"GRAPH ON",upLabel:"GRAPH OFF",downTitle:"Show the selected transactions in a graph",upTitle:"Hide this graph"});if($("#viewType").val()=="G"){T2.change.down(false)}T2.change.on("click",T2.changeViewType)};T2.categoryClick=function(d){var c=arguments[1].object;$("#nav_5")[0].focus();Tag.close();if(typeof(c.reportType)!="undefined"&&$("#reportType").val()!=c.reportType){Amex.OverlayManager.block("app");
T2.change.up();$("#reportType").val(c.reportType);$("#viewType").val("S");$("#defaultSort").val("N");$("#splitPaneState").val("N");T2.loadSummaryView();$("#defaultSort").val("");if($("#reportType").val()==2){Omniture.report("nav_category_time")}else{Omniture.report("nav_category_member")}}};T2.changeReportType=function(c,d){if(c){$("#reportType").val(d.object.reportType)}else{$("#reportType").val(T2.bar.getSelected().reportType)}if($("#viewType").val()=="G"){T2.change.up()}Tag.close();if($("#reportType").val()==1){$("#viewType").val("L");
T2.action="transacitionDetails";T2.loadListView()}else{$("#viewType").val("S");$("#defaultSort").val("N");$("#splitPaneState").val("N");T2.loadSummaryView();$("#defaultSort").val("")}};T2.changeTimePeriod=function(e,d){if(e){$("#reportType").val(d.object.reportType)}else{$("#reportType").val(T2.bar.getSelected().reportType)}var c=$("#updateSuppDisplay");c.val("true");Tag.close();if($("#viewType").val()!="G"){if($("#reportType").val()==1){$("#viewType").val("L");T2.action="tpChange";T2.loadListView()
}else{$("#viewType").val("S");$("#defaultSort").val("N");$("#splitPaneState").val("N");T2.loadSummaryView();$("#expandTP").focus();$("#defaultSort").val("")}}else{T2.loadGraphView()}c.val("false")};T2.changeViewType=function(c){if(T2.bar.getSelected()==null){Amex.Msg.alert(Amex.Msg.information,T1.buttonNotSelected,true,null);if(Status.current.viewType=="G"){T2.change.up(false)}else{T2.change.down(false)}return}Tag.close();if($("#viewType").val()=="G"){if($("#reportType").val()==1){$("#viewType").val("L");
T2.action="";T2.loadListView()}else{$("#viewType").val("S");$("#defaultSort").val("N");$("#splitPaneState").val("N");T2.loadSummaryView();$("#defaultSort").val("")}T2.change.down();Omniture.report("nav_graph_off")}else{$("#viewType").val("G");$("#chartType").val("default");T2.change.up();T2.loadGraphView();Omniture.report("nav_graph_on")}};T2.loadListView=function(c){T2.updateForm();Amex.OverlayManager.block("app");Status.startLoad("listView");List.load("tpChange.do",T2.action)};T2.loadSummaryView=function(c){T2.updateForm();
Amex.OverlayManager.block("app");Status.startLoad("summaryView");Summary.load();$("#defaultSort").val("")};T2.loadGraphView=function(){T2.updateForm();Amex.OverlayManager.block("app");$("#viewType").val("G");Status.startLoad("graphView");Graph.load()};T2.loadGraphSuppsView=function(){T2.updateForm();Amex.OverlayManager.block("app");$("#viewType").val("G");Status.startLoad("graphView");Graph.loadSupps()};T2.updateForm=function(f){if(f){var d=$("#pageNumTop");if(d.length){$("#pageNumber").val(d.val())
}else{$("#pageNumber").val(1)}}else{$("#pageNumber").val(1)}var e=T1.card.getSelected();if(e!=null){$("#sorted_index").val(e.index);$("#suppIndex").val(e.supp)}var c=T1.period.getSelected();if(c!=null){if($("#multiCardView").val()=="true"){$("#bPIndex").val((c.BPIndex+"").substring(0,4));$("#multiCardTPIndex").val(c.multiCardBPIndex)}else{$("#bPIndex").val(c.BPIndex)}$("#startDate").val(c.startDate);$("#endDate").val(c.endDate);$("#pendingOpen").val("false")}};var AllOpen={_window:null,_data:null,_cards:null,_allCardsCheck:null,_continue:null,validate:false,_createWindow:function(){var d=this._window;
if(d==null){var e=$("#_allOpenContent");if(e.length){d=new Amex.Window({modal:true,theme:"amexWindow",buttons:["close"],title:"select cards",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){AllOpen._window.update(AllOpen._data);AllOpen._cards=null;T1.card.selectByIndex(Status.current.card.index,Status.current.card.supp,false);return true}});this._data=e.html();
d.setTriggerNode("cardExpand");d.update(this._data);d.render(Page.form.id);e.remove();d.getElement().on("click",AllOpen.checkboxChangeHanlder);this._window=d}}},init:function(){if($("#multiCardView").val()=="true"){this._createWindow()}},openCardSelect:function(){if(this._window==null){this._createWindow()}this._window.centerInViewport();this._window.open();return this},cancel:function(c){this._window.close();T1.card.selectByIndex(Status.current.card.index,Status.current.card.supp,false);this._cards=null;
this._window.update(AllOpen._data);return this},change:function(){if(AllOpen._cards==null){AllOpen._cards=$("#allOpenCards").find('[id^="allOpenCardsCheck_"]')}if((!AllOpen.validate)&&(AllOpen._cards==null)){Amex.Msg.alert(Amex.Msg.information,"Please select at least two cards to continue.",true);Amex.Msg.setTriggerNode("allOpenCheck");return}var e=0;var h=0;var l=AllOpen._cards;var d=l.length;for(var f=0;f<d;f++){if($(l[f]).is(":checked")){e++;if(e>1){break}}}if(e>1){this._window.close();$("#sorted_index").val(0);
var n=$("#multiCardView");if(n.val()!="true"){$("#multiCardView").val("true");$("#bPIndex").val(-100);$("#multiCardTPIndex").val("M0");$("#reportType").val(1);$("#viewType").val("L");$("#resetRequested").val(true);if($("#userInPreferredView").val()=="true"){$("#preferredView").val(true);$("#cardChanged").val(true)}else{if($("#normalViewCardChanged").length){$("#normalViewCardChanged").val(true)}}}else{var m=T1.period.getSelected();$("#resetRequested").val(false);if(m!=null){$("#bPIndex").val((m.BPIndex+"").substring(0,4));
$("#multiCardTPIndex").val(m.multiCardBPIndex)}else{$("#bPIndex").val(-99);$("#multiCardTPIndex").val(-99)}}var c=$("#viewType").val();if(c=="S"){url="defaultsummary.do"}else{if(c=="L"){url="cardChangeList.do";$("#listJson").val("true")}else{if(c=="G"){$("#summaryXAxis").val("");$("#summaryYAxis").val("");$("#summarySubYAxis").val("");$("#splitPaneState").val("N");url="defaultgraph.do"}}}$("#liteEnabled").val("false");Amex.OverlayManager.block();Omniture.report("allOpen_chgcard");Page.form.submit(url);
$("#listJson").val("false")}else{Amex.Msg.alert(Amex.Msg.information,"Please select at least two cards to continue.",true)}return this},checkboxChangeHanlder:function(h){AllOpen._enableContinue();var e=$(h.target);if(!e.attr("id").startsWith("allOpen")){return}if(AllOpen._cards==null||AllOpen._allCardsCheck==null){AllOpen._cards=$("#allOpenCards").find('[id^="allOpenCardsCheck_"]');AllOpen._allCardsCheck=$("#allOpenCheck");AllOpen._continue=$("#allOpenContinue")}if(e.attr("id")=="allOpenCheck"){AllOpen._cards.each(function(m){if($(this).is(":disabled")){$(this).prop("checked",false)
}else{$(this).prop("checked",e.is(":checked"));AllOpen.validate=true}})}else{var l=AllOpen._cards;var c=l.length;var f=0;for(var d=0;d<c;d++){if(l[d].checked){f++}}AllOpen._allCardsCheck.prop("checked",(f==c));if(f>1){AllOpen.validate=true}else{AllOpen.validate=false}}},_enableContinue:function(){this._window._setFocusCycle(this._continue)}};var AutoTagCalendar={element:"AutoTagCalendar",between:"autoTagBetween",autoTagFromTo:"autoTagFromTo",before:"autoTagBefore",after:"autoTagAfter",fromField:"autoTagFromField",fromLink:"autoStartDateTxtLink",toField:"autoTagToField",toLink:"autoEndDateTxtLink",beforeField:"autoTagBeforeField",afterField:"autoTagAfterField",beforeLink:"autoBeforeDateTxtLink",afterLink:"autoAfterDateTxtLink",type:"AutoTagCalendar",autoTagBeforeDt:"autoTagBeforeDt",autoTagAfterDt:"autoTagAfterDt",maxDate:null,minDate:null,validated:true,firstClick:false};
AutoTagCalendar.init=function(){AutoTagCalendar.maxDate=new Date();AutoTagCalendar.maxDate.setTime($("#_maxDate").val());AutoTagCalendar.maxDate.clearTime();AutoTagCalendar.minDate=new Date();AutoTagCalendar.minDate.setTime($("#_minDate").val());AutoTagCalendar.minDate.clearTime();AutoTagCalendar.firstClick=true;$("#"+AutoTagCalendar.between).click(function(c){c.preventDefault();c.stopPropagation();$("#"+AutoTagCalendar.between).hide();$("#"+AutoTagCalendar.autoTagFromTo).show();$("#"+AutoTagCalendar.fromField).select();
$("#"+AutoTagCalendar.before).show();$("#"+AutoTagCalendar.autoTagBeforeDt).hide();$("#"+AutoTagCalendar.after).show();$("#"+AutoTagCalendar.autoTagAfterDt).hide();var e=new Date();if(AutoTagCalendar.firstClick&&parseInt($("#tagOperation").val())==TagAction.action.INVOKE_RULE){$("#"+AutoTagCalendar.fromField).val(e.format("MM/dd/yyyy"));$("#"+AutoTagCalendar.toField).val((e.add("M",1)).format("MM/dd/yyyy"))}});$("#"+AutoTagCalendar.before).click(function(c){c.preventDefault();c.stopPropagation();
$("#"+AutoTagCalendar.before).hide();$("#"+AutoTagCalendar.autoTagBeforeDt).show();$("#"+AutoTagCalendar.beforeField).select();$("#"+AutoTagCalendar.after).show();$("#"+AutoTagCalendar.autoTagAfterDt).hide();$("#"+AutoTagCalendar.between).show();$("#"+AutoTagCalendar.autoTagFromTo).hide()});$("#"+AutoTagCalendar.after).click(function(c){c.preventDefault();c.stopPropagation();$("#"+AutoTagCalendar.after).hide();$("#"+AutoTagCalendar.autoTagAfterDt).show();$("#"+AutoTagCalendar.afterField).select();
$("#"+AutoTagCalendar.before).show();$("#"+AutoTagCalendar.autoTagBeforeDt).hide();$("#"+AutoTagCalendar.between).show();$("#"+AutoTagCalendar.autoTagFromTo).hide()});$("#"+AutoTagCalendar.fromField).change(function(c){$("#"+AutoTagCalendar.beforeField).val("MM/DD/YYYY");$("#"+AutoTagCalendar.afterField).val("MM/DD/YYYY")});$("#"+AutoTagCalendar.toField).change(function(c){$("#"+AutoTagCalendar.beforeField).val("MM/DD/YYYY");$("#"+AutoTagCalendar.afterField).val("MM/DD/YYYY")});$("#"+AutoTagCalendar.beforeField).change(function(c){$("#"+AutoTagCalendar.fromField).val("MM/DD/YYYY");
$("#"+AutoTagCalendar.toField).val("MM/DD/YYYY");$("#"+AutoTagCalendar.afterField).val("MM/DD/YYYY")});$("#"+AutoTagCalendar.afterField).change(function(c){$("#"+AutoTagCalendar.fromField).val("MM/DD/YYYY");$("#"+AutoTagCalendar.toField).val("MM/DD/YYYY");$("#"+AutoTagCalendar.beforeField).val("MM/DD/YYYY")});$("#"+AutoTagCalendar.fromField).datepicker({showOn:"button",buttonImage:$("#locImages").val()+"/icon_calendar.png",buttonImageOnly:true,buttonText:"Open calendar for Start Date",showButtonPanel:true,showOtherMonths:true,selectOtherMonths:true,minDate:AutoTagCalendar.minDate,beforeShow:function(){AutoTagCalendar.firstClick=false;
$("#"+AutoTagCalendar.beforeField).val("MM/DD/YYYY");$("#"+AutoTagCalendar.afterField).val("MM/DD/YYYY");var c=Date.parseString($("#"+AutoTagCalendar.fromField).val(),"M/d/y");if(c){$("#"+AutoTagCalendar.fromField).val(c.format("MM/dd/yyyy"))}else{$("#"+AutoTagCalendar.fromField).val((new Date()).format("MM/dd/yyyy"))}}});$("#"+AutoTagCalendar.fromField).datepicker("widget").click(function(c){c.stopPropagation()});$("#"+AutoTagCalendar.toField).datepicker({showOn:"button",buttonImage:$("#locImages").val()+"/icon_calendar.png",buttonImageOnly:true,buttonText:"Open calendar for End Date",showButtonPanel:true,showOtherMonths:true,selectOtherMonths:true,minDate:AutoTagCalendar.minDate,beforeShow:function(){AutoTagCalendar.firstClick=false;
$("#"+AutoTagCalendar.beforeField).val("MM/DD/YYYY");$("#"+AutoTagCalendar.afterField).val("MM/DD/YYYY");var c=Date.parseString($("#"+AutoTagCalendar.toField).val(),"M/d/y");if(c){$("#"+AutoTagCalendar.toField).val(c.format("MM/dd/yyyy"))}else{$("#"+AutoTagCalendar.toField).val((new Date()).format("MM/dd/yyyy"))}}});$("#"+AutoTagCalendar.toField).datepicker("widget").click(function(c){c.stopPropagation()});$("#"+AutoTagCalendar.beforeField).datepicker({showOn:"button",buttonImage:$("#locImages").val()+"/icon_calendar.png",buttonImageOnly:true,buttonText:"Open calendar for Before Date",showButtonPanel:true,showOtherMonths:true,selectOtherMonths:true,minDate:AutoTagCalendar.minDate,beforeShow:function(){AutoTagCalendar.firstClick=false;
$("#"+AutoTagCalendar.fromField).val("MM/DD/YYYY");$("#"+AutoTagCalendar.toField).val("MM/DD/YYYY");$("#"+AutoTagCalendar.afterField).val("MM/DD/YYYY");var c=Date.parseString($("#"+AutoTagCalendar.beforeField).val(),"M/d/y");if(c){$("#"+AutoTagCalendar.beforeField).val(c.format("MM/dd/yyyy"))}else{$("#"+AutoTagCalendar.beforeField).val((new Date()).format("MM/dd/yyyy"))}}});$("#"+AutoTagCalendar.beforeField).datepicker("widget").click(function(c){c.stopPropagation()});$("#"+AutoTagCalendar.afterField).datepicker({showOn:"button",buttonImage:$("#locImages").val()+"/icon_calendar.png",buttonImageOnly:true,buttonText:"Open calendar for After Date",showButtonPanel:true,showOtherMonths:true,selectOtherMonths:true,minDate:AutoTagCalendar.minDate,beforeShow:function(){AutoTagCalendar.firstClick=false;
$("#"+AutoTagCalendar.fromField).val("MM/DD/YYYY");$("#"+AutoTagCalendar.toField).val("MM/DD/YYYY");$("#"+AutoTagCalendar.beforeField).val("MM/DD/YYYY");var c=Date.parseString($("#"+AutoTagCalendar.afterField).val(),"M/d/y");if(c){$("#"+AutoTagCalendar.afterField).val(c.format("MM/dd/yyyy"))}else{$("#"+AutoTagCalendar.afterField).val((new Date()).format("MM/dd/yyyy"))}}});$("#"+AutoTagCalendar.afterField).datepicker("widget").click(function(c){c.stopPropagation()})};var Tag={tmpId:0,validateMsg:'Tag(s) cannot contain the following special characters: , \\ ~ " &lt;',delMsg:"Deleting this Tag will permanently remove it from all associated Transactions and any applicable Rules or Settings. Click on CANCEL to retain the Tag.",ruleDelMsg:"Deleting this Rule will permanently remove it. Any Tags applied by this Rule will no longer appear. Click on CANCEL to retain the Rule.",renamedTagName:"",userType:"",renamedTagId:"",defaultText:"Enter Tag name"};
Tag.init=function(){Tag.loadTaglist();$("body").on("click","#tagRule",Tag.openManageRulesLayer);if(typeof($("#_tagPageWrapper").val())!="undefined"){$("#_tagPageWrapper").on("click","a",Tag.fireManageTagClick);TagUI.refreshManageTags()}$("#_createTagName").focus(TagUI.onTextFocus).blur(TagUI.onTextBlur).keydown(Tag.showPrivateSharedLayer).keyup(TagList.lookahead).attr({autocomplete:"off"});$("#crtag").click(Tag.create);$("#tagLearn").click(TagUI.showLearn);return false};Tag.showPrivateSharedLayer=function(c){TagUI.onTextboxKeyDown(c)
};Tag.showPrivateSharedLayerDrillDown=function(c){TagUI.onTextboxKeyDown(c)};Tag.showPrivateSharedLayerInline=function(c){TagUI.onKeyDownCreateApply(c)};Tag.fireManageTagClick=function(l){l.stopPropagation();l.preventDefault();App.lastClick=new Date();var d=$(this).attr("id");var f=Tag.unescape($(this).closest("li").find("div.tagDispName span").html());var e=f;if(d&&d.startsWith("tag_")){var m=d.split("_");var c=m[1];var h=m[2];if(TagLock.check(h)>0){return false}switch(c){case"rename":Tag.report("tag_manage_rename");
Tag.renameTag(h,f,e);break;case"delete":Tag.report("tag_manage_delete");Tag.deleteTag(h,f);break;case"share":Tag.report("tag_manage_share");Tag.shareTag(h,f);break;case"filter":Tag.report("tag_manage_filter");Tag.filterTag(h,f);break;default:break}}return false};Tag.filterTag=function(d,c){TagList.populateFiltered();$("#listTag").html($.jcp("run","@tags/filtertaglist14",{tagArr:TagList.tagArr}));TagUI.closeManageTagView();Filter.clear("Tag");$("#_tag-"+d).prop("checked",true);if($("#reportType").val()==6){$("#summaryYAxis").val(d)
}Tag.runFilter()};Tag.runFilter=function(){Tag.close();$("#pageNumber").val(1);var d="";var c=[];switch($("#"+Page.form.viewType).val()){case"L":Status.startLoad("search");List.load("filterlist.do");break;case"S":$("#splitPaneState").val("N");Tag.loadSummaryView();break;default:if(Tag.renamedTagName!=null&&Tag.renamedTagName!=""){c=[Tag.renamedTagId,"-1","-1","1",Tag.renamedTagName];d=c.join("~~")}Tag.loadGraphView(d);break}};Tag.loadSummaryView=function(){T2.updateForm();Amex.OverlayManager.block("app");
Status.startLoad("summaryView");TagAction.summaryLoad();$("#defaultSort").val("")};Tag.loadGraphView=function(c){var e=$("#reportType").val();var d=$("#chartType").val();if(d=="default"){if(e==2||e==4||e==7){d="piechart"}else{d="barchart"}}if(d=="piechart"){TagUI.closeManageTagView();Graph.loadDrillDown(Graph.lastFnArgs)}else{T2.updateForm();Amex.OverlayManager.block("app");$("#viewType").val("G");Status.startLoad("graphView");TagAction.graphLoad(c)}};Tag.toggleInlineView=function(c){if(List.multiTagViewEnabled==false){var d=$(this);
var e=d.closest("tbody").attr("id").split("_")[1];if(d.hasClass("goldTag")){Tag.report("tag_inline_close",null,"icon");TagUI.hideInlineView(e,true)}else{Tag.report("tag_inline_invoke");TagUI.showInlineView(e,true)}}return false};Tag.showMultiTagView=function(c){c.preventDefault();var d="itag_"+TagUI.ID;Tag.report("tag_multi_invoke");TagUI.showInstruction(TagUI.level.INFO,TagList.selectedTagsString());List.enableTagMode();TagUI.showMultiTagView(d);return false};Tag.showInlineTagRuleView=function(d){var c="autoTagid";
TagUI.showInlineTagRuleView(c);window.setTimeout(function(){TagUI.showInstruction(TagUI.level.INFO,"AutoTagging Rule")},500);return false};Tag.showManageTagLayer=function(c){Tag.report("tag_manage_invoke");TagUI.showManageTagLayer($(this));return false};Tag.uncheckAll=function(c){c.preventDefault();c.stopPropagation();Tag.report("tag_multi_uncheck");List.table.uncheckAll();$("#tagListBlock input:checked").attr("checked",false);TagList.selectedTags=[];TagUI.clearInstruction()};Tag.close=function(c){TagUI.closeTagView();
if(TagUI.isManageTag!=null&&TagUI.isManageTag==true){TagUI.closeManageTagView()}};Tag.closeManageTagView=function(c){if(c){c.stopPropagation()}Tag.report("tag_manage_close");TagUI.closeManageTagView();return false};Tag.loadTaglist=function(){TagList.loadTagList();return false};Tag.applyTag=function(e,d,h){if(List.multiTagViewEnabled){var c=$.isArray(e)?e:[e];var f=$.isArray(d)?d:[d];if(c.length>0&&f.length>0){$.each(c,function(m,l){$.each(f,function(o,n){TagUI.applyTag(l,n)})})}}else{TagUI.applyTag(e,d)
}TagAction.applyTag(e,d,h)};Tag.removeTag=function(d,c,e){if(List.multiTagViewEnabled){rocIdList=$.isArray(d)?d:[d];tagObjectList=$.isArray(c)?c:[c];if(rocIdList.length>0&&tagObjectList.length>0){$.each(rocIdList,function(f){$.each(tagObjectList,function(h){TagUI.removeTag(rocIdList[f],tagObjectList[h])})})}}else{TagUI.removeTag(d,c)}TagAction.removeTag(d,c,e)};Tag.showHideProgress=function(e,d){if(d){if(e.is("a.greyTag, a.goldTag")){e.attr("class","tagload")}else{if(e.is("li.tagItem, .spanCheckAll")){e.addClass("tagload")
}else{if(e.is(".manageImgIcons")){e.closest("a").addClass("tagload")}}}}else{if(e.is("a.tagload")){var c=e.attr("id").split("_")[1];if(List.multiTagViewEnabled){e.attr("class",$("#croc_"+c).is(":checked")?"goldTag":"greyTag")}else{e.attr("class",(TagUI.ID==c)?"goldTag":"greyTag")}}else{if(e.is("li, .spanCheckAll")){e.removeClass("tagload")}else{if(e.is(".manageImgIcons")){e.closest("a").removeClass("tagload")}}}}};Tag.check=function(h){h.stopImmediatePropagation();TagUI.clearInstruction();var n=$(h.target).attr("id").match(/tchk_(.*)/)[1];
var d=TagList.getTagObjForId(TagList.tagArr,n);if(TagLock.check(d.id)>0){return false}h.stopPropagation();var m=$(h.target);var f=m.is(":checked");if(f){TagList.insertSelected(d)}else{TagList.removeSelected(d)}var l=m.closest("li");if(!List.multiTagViewEnabled){var c=m.closest("tbody").attr("id").split("_")[1];if(f){Tag.report("tag_inline_apply",d);Tag.applyTag(c,d,l)}else{Tag.report("tag_inline_remove",d);Tag.removeTag(c,d,l)}}else{TagUI.showInstruction(TagUI.level.INFO,TagList.selectedTagsString());
if(List.table.hasSelected()){var e=List.table.getSelectedIds();if(f){Tag.report("tag_multi_apply_tag",d);Tag.applyTag(e,d,l)}else{Tag.report("tag_multi_remove_tag",d);Tag.removeTag(e,d,l)}}}};Tag.undoApplyTag=function(e,d,c){TagUI.showInstruction(TagUI.level.ERROR,c);TagList.removeSelected(d[0]);TagUI.removeSelected(e,d)};Tag.undoCreateApplyTag=function(e,d,c){TagUI.showInstruction(TagUI.level.ERROR,c);TagUI.removeSelected(e,d);TagList.deleteTag(d[0]);TagList.removeSelected(d[0]);TagUI.refreshTagList(TagList.getTagList());
TagUI.refreshManageTags()};Tag.undoRemoveTag=function(d,c){if(TagUI.isExpanded){TagList.insertSelected(c[0])}TagUI.applySelected(d,c);if(TagUI.ID==null||TagUI.ID!=d[0]){var e=$("#cb_"+d[0]+"_"+c[0].id).closest("a");Amex.Msg.alert(Amex.Msg.information,"Sorry, we were not able to remove any Tags",true);Amex.Msg.setTriggerNode(e)}else{TagUI.showInstruction(TagUI.level.ERROR,"Sorry, we were not able to remove any Tags")}};Tag.undoDeleteTag=function(d,c){TagUI.applySelected(d,[c]);TagList.insert(c);if(TagList.getTagList()&&TagList.getTagList().length>0){$("#nav_6").closest("div").show()
}TagUI.refreshManageTags();TagList.insertSelected(c);TagUI.refreshTagList(TagList.getTagList())};Tag.undoShareTag=function(c){c.shared=false;TagList.shareTag(c);TagUI.refreshManageTags();TagUI.refreshTagList(TagList.getTagList())};Tag.quickRemove=function(l){var m=$(this);var e=m.attr("id").split("_");if(e&&TagLock.check(e[2])==0){var d=e[1];var h=e[2];TagUI.clearInstruction();var f=m.closest("span").find("span.tagText").html();var c=TagList.getObjectForNameId(f,h);if(c==null){c=TagList.getObjectForNameId(Tag.unescape(f),h)
}Tag.report("tag_inline_quickremove",c);if(TagUI.isExpanded){TagList.removeSelected(c)}TagUI.removeTag(d,c);TagAction.removeTag(d,c,$("#itag_"+d))}return false};Tag.createApplyTag=function(h){var f=$("#textBox_inline").val().trim().replace(/\s+/g," ");if(!Tag.validate(f,$("#textBox_inline"))){return false}var e=Tag.tmpId++;var d={id:"T"+(e),name:f,shared:$("#createInlineShared").is(":checked")};if(f==Tag.defaultText||f.trim()==""){TagUI.showInstruction(TagUI.level.INFORMATION,"Please enter a Tag name to create");
return false}if(TagList.isLocalTag(f)){if(List.multiTagViewEnabled||!$("#troc_"+TagUI.ID).tagbar("hastagname",f)){TagUI.showInstruction(TagUI.level.INFORMATION,"Sorry, Tag '"+f+"' already exists")}return false}TagUI.clearInstruction();TagList.insert(d);TagList.insertSelected(d);if(List.multiTagViewEnabled==true){Tag.report("tag_multi_create");c=List.table.getSelectedIds();TagUI.createApplyTag(c,d);if(c.length>0){TagAction.createApplyTag(c,[d])}else{TagAction.createTag(d)}}else{Tag.report("tag_inline_create");
var c=$(h.target).closest("tbody").attr("id").split("_")[1];TagUI.createApplyTag([c],d);TagAction.createApplyTag(c,d)}TagUI.refreshManageTags();TagList.skipLookahead=true;$("#textBox_inline").val("");$("#textBox_inline").focus();TagUI.showInstruction(TagUI.level.INFO,"Tag '"+f+"' has been created");return false};Tag.create=function(n){n.stopPropagation();n.preventDefault();if(TagList.userType&&TagList.userType=="AA"){return false}var l=$("#_createTagName").val().trim().replace(/\s+/g," ");if(!Tag.validate(l,$("#_createTagName"))){return false
}if(l==Tag.defaultText||l.trim()==""){return false}var d=Tag.findObject(l,TagList.getTagList(),TagList.tagListComparator);if(d[0]){if(TagList.userType=="Supp"){var m=Tag.findOccurences(l);var f=TagList.getObjectForName(l);if(f.shared==false||m>1){Amex.Msg.alert(Amex.Msg.information,"Sorry, Tag '"+l+"' already exists",true);Amex.Msg.setTriggerNode($("#_createTagName"));return false}}else{Amex.Msg.alert(Amex.Msg.information,"Sorry, Tag '"+l+"' already exists",true);Amex.Msg.setTriggerNode($("#_createTagName"));
return false}}var h=Tag.tmpId++;var c={id:"T"+(h),name:l,shared:$("#createPanelShared").is(":checked")};if(l!=Tag.defaultText){TagList.insert(c);TagUI.refreshManageTags();TagUI.refreshTagList(TagList.getTagList());Tag.report("tag_manage_create");TagAction.createTag(c);$("#_createTagName").val("");$("#_createTagName").focus()}};Tag.findOccurences=function(c){var e=TagList.getTagList();var d=0;$.each(e,function(f,h){if(h.name==c){d++}});return d};Tag.finishCreateApplyTag=function(c,f,h){$("#tag_"+c.id).attr("id","tag_"+h);
var e=$("#tchk_"+c.id);e.attr("id","tchk_"+h);e.siblings("label").attr("for","tchk_"+h);$("#tag_filter_"+c.id).attr("id","tag_filter_"+h);$("#tag_rename_"+c.id).attr("id","tag_rename_"+h);$("#tag_delete_"+c.id).attr("id","tag_delete_"+h);$("#tag_share_"+c.id).attr("id","tag_share_"+h);$("#tag_shared_"+c.id).attr("id","tag_shared_"+h);$.each(f,function(m,l){$("#tb_"+l+"_"+c.id).attr("id","tb_"+l+"_"+h);$("#cb_"+l+"_"+c.id).attr("id","cb_"+l+"_"+h)});var d=Tag.getIndexForId(c.id);TagList.tagArr[d].id=h;
$("#nav_6").closest("div").show()};Tag.findObject=function(l,c,d){var h=0,f=c.length-1;if(f==-1){return[false,0]}while(1){var e=h+Math.round((f-h)/2);switch(d(l,c[e])){case 0:return[true,e];case 1:h=e+1;if(h>f){return[false,e+1]}break;case 2:if(h==f){return[false,e]}f=e-1;break;default:if(h>f){return[false,e]}f=e-1;break}}};Tag.stringComparator=function(d,c){if(d<c){return -1}if(d>c){return 1}return 0};Tag.stringNoCaseComparator=function(d,c){var f=d.toLowerCase();var e=c.toLowerCase();if(f<e){return -1
}if(f>e){return 1}return 0};Tag.getIndexForId=function(d){var e=TagList.getTagList();var c;$.each(e,function(f,h){if(h.id==d){c=f;return false}});return c};Tag.deleteTag=function(d,c){Amex.Msg.confirmContinue(Amex.Msg.msgConfirm,Tag.delMsg,true,"","",function(l){if("CONTINUE"==l){var m=[];var o=$("#listData tbody").length;for(var h=0;h<o;h++){m[h]=h}var e={id:d,name:c,shared:false};var m=TagUI.removeSelected(m,[e]);var f=TagList.deleteTag(e);var n=TagList.getObjectAtIndex(f);TagList.removeSelected(e);
TagUI.refreshManageTags();TagUI.refreshTagList(TagList.getTagList());if(List.multiTagViewEnabled){TagUI.showInstruction(TagUI.level.INFO,TagList.selectedTagsString())}TagAction.deleteTag(m,e);if(f==TagList.getTagList().length){n=TagList.getObjectAtIndex(--f)}if(TagList.getTagList().length>0){$("#tag_filter_"+n.id).focus()}else{$("#crtag").focus();$("#nav_6").closest("div").hide()}}})};Tag.shareTag=function(e,d){var c={id:e,name:d,shared:true};TagList.shareTag(c);TagUI.refreshManageTags();TagUI.refreshTagList(TagList.getTagList());
var f=$("#tag_shared_"+e).find("img");TagAction.shareTag(c,f)};Tag.undoRenameTag=function(c,e,d){TagList.rename(d,e);TagUI.removeSelected(c,[d]);TagUI.applySelected(c,[e]);TagUI.refreshTagList(TagList.getTagList());TagUI.refreshManageTags();$("#tag_filter_"+e.id).focus()};Tag.renameTag=function(f,d,e){var c=TagList.getObjectForNameId(d,f);if(c==null){c=TagList.getObjectForNameId(e,f)}TagUI.showRenameTextbox(c,e);$("#_editTagName").keydown($.proxy(Tag.renameKeyHandler,c)).blur($.proxy(Tag.renameBlurHandler,c));
$("#_editTagName").focus()};Tag.renameKeyHandler=function(c){if(c.which==13){c.preventDefault();Tag.validateRename(this)}else{if(c.which==27){TagUI.hideRenameTextbox(this)}}};Tag.renameBlurHandler=function(c){Tag.validateRename(this)};Tag.validateRename=function(c){var f=$("#_editTagName").val().trim().replace(/\s+/g," ");if((f==c.name)||(null!=f&&f.trim()=="")){TagUI.hideRenameTextbox(c);return}var e=false;var d=TagList.getObjectForName(f);if(typeof d=="undefined"){e=true}else{if(d.name==f){if(TagList.userType=="Supp"){e=d.shared
}}else{e=true}}if(!e){Amex.Msg.alert(Amex.Msg.information,"Sorry, Tag '"+f+"' already exists",true);Amex.PageOverlay.hide();Amex.Msg.setTriggerNode($("#_editTagName"));return 0}TagUI.hideRenameTextbox(c);Tag.performRename(f,c,f)};Tag.performRename=function(f,d,q){var e=d.id;if(!Tag.validate(f,$("#tag_filter_"+e))){return false}var c={id:e,name:f,shared:d.shared};var o={id:e,name:q,shared:d.shared};TagList.rename(d,o);var n=[];var l=$("#listData tbody").length;for(var h=0;h<l;h++){n[h]=h}var p=TagUI.removeSelected(n,[d]);
TagUI.applySelected(p,[c]);if(TagUI.isExpanded||TagUI.isMultiTagView){TagList.renameSelected(d,c)}TagUI.refreshTagList(TagList.getTagList());TagUI.refreshManageTags();if(TagUI.isMultiTagView){TagUI.showInstruction(TagUI.level.INFO,TagList.selectedTagsString())}$("#tag_filter_"+e).focus();var m=$("#tag_rename_"+e).find("img");TagAction.renameTag(p,d,c,m)};Tag.undoCreateTag=function(d,c){Amex.Msg.alert(Amex.Msg.information,c,true);Amex.Msg.setTriggerNode($("#_createTagName"));TagList.deleteTag(d[0]);
TagUI.refreshTagList(TagList.getTagList());TagUI.refreshManageTags()};Tag.undoCreateMultiTag=function(d,c){TagUI.clearInstruction();Amex.Msg.alert(Amex.Msg.information,c,true);Amex.Msg.setTriggerNode($("#textBox_inline"));TagList.deleteTag(d[0]);TagList.removeSelected(d[0]);TagUI.refreshTagList(TagList.getTagList());TagUI.refreshManageTags()};Tag.finishCreateTag=function(d,f){$("#tag_"+d.id).attr("id","tag_"+f);var e=$("#tchk_"+d.id);e.attr("id","tchk_"+f);e.siblings("label").attr("for","tchk_"+f);
$("#tag_filter_"+d.id).attr("id","tag_filter_"+f);$("#tag_rename_"+d.id).attr("id","tag_rename_"+f);$("#tag_delete_"+d.id).attr("id","tag_delete_"+f);$("#tag_share_"+d.id).attr("id","tag_share_"+f);$("#tag_shared_"+d.id).attr("id","tag_shared_"+f);var c=TagList.getObjectForName(d.name);c.id=f;$("#nav_6").closest("div").show()};Tag.createShareApply=function(d,c){if(c.shared){TagAction.shareTag(c,null)}};Tag.report=function(e,c,d){e+="_"+$("#viewType").val();if(d){Omniture.report(e,d)}else{if(c){Omniture.report(e,c.shared?"shared":"local")
}else{Omniture.report(e)}}};Tag.openManageRulesLayer=function(d){d.preventDefault();var e=$("#tagRulesInline, #openBlindContainer");var c=!TagUI.isMultiTagView&&e.length&&e.parent()!=null&&e.parent().length&&e.parent().val()!="";if(c){var f=e.parent().attr("id").split("_")[1];TagUI.hideInlineView(f,true)}else{if(TagUI.isMultiTagView){Tag.close()}}TagUI.renderTagRulesLayer();TagUI.updateDefaultMsg();if(TagUI.defaultMessage==null){TagUI.defaultMessage=$("#loadingTagRules").html()}$("#tagOperation").val(TagAction.action.GET_RULES);
TagAction.getRules();return false};Tag.unHighLightTagIcon=function(){$("a.goldTag").attr({"class":"greyTag",title:"Show Tag Inline View"})};Tag.editManageTagRules=function(){TagUI.tagRulesLayer.close();TagUI.renderEditManageTagRulesLayer()};Tag.validate=function(e,c){var d=/[,~"<]/;if(d.test(e)||e.indexOf("\\")!=-1){Amex.Msg.alert(Amex.Msg.information,Tag.validateMsg,true,null);Amex.Msg.setTriggerNode(c);return false}return true};Tag.escape=function(c){return c.replace(/&/g,"&amp;").replace(/>/g,"&gt;")
};Tag.unescape=function(c){return c.replace(/&amp;/g,"&").replace(/&gt;/g,">")};Tag.toggleInlineRulesView=function(c){c.preventDefault();var d=$(this);var e=d.closest("tbody").attr("id").split("_")[1];if(!$.isEmptyObject(TagLock.locks)){return}TagUI.ID=e;if(TagUI.defaultMerRuleMessage==null){TagUI.defaultMerRuleMessage=$("#inlineTag").html();$("#inlineTag").remove()}TagUI.updateMerRuleMsg();$("#tagOperation").val("");$("#refSeNumber").val($("#croc_"+e).val());$("#isPrintReq").val("");Tag.report("autoTagRuleId");
TagAction.showInlineRulesView(e);return false};Tag.createManageTagRules=function(){TagUI.tagRulesContent=$("#loadingTagRules").html();TagUI.updateDefaultMsg();if(TagUI.defaultMessage==null){TagUI.defaultMessage=$("#loadingTagRules").html()}Tag.openCatSubCatRuleLayer()};Tag.createRule=function(e){$("#tagOperation").val(TagAction.action.CREATE_RULE);var c="";var d="";if(($("#"+AutoTagCalendar.fromField).val()!=""&&$("#"+AutoTagCalendar.fromField).val()!="MM/DD/YYYY")&&($("#"+AutoTagCalendar.toField).val()!=""&&$("#"+AutoTagCalendar.toField).val()!="MM/DD/YYYY")){c=Date.parseString($("#"+AutoTagCalendar.fromField).val(),"M/d/y");
d=Date.parseString($("#"+AutoTagCalendar.toField).val(),"M/d/y")}else{if($("#"+AutoTagCalendar.beforeField).val()==""||$("#"+AutoTagCalendar.beforeField).val()!="MM/DD/YYYY"){c="";d=Date.parseString($("#"+AutoTagCalendar.beforeField).val(),"M/d/y")}else{if($("#"+AutoTagCalendar.afterField).val()==""||$("#"+AutoTagCalendar.afterField).val()!="MM/DD/YYYY"){c=Date.parseString($("#"+AutoTagCalendar.afterField).val(),"M/d/y");d=""}}}if(c!=""&&c!=null){$("#ruleStartDate").val(c.format("MM/dd/yyyy"))}else{$("#ruleStartDate").val("")
}if(d!=""&&d!=null){$("#ruleEndDate").val(d.format("MM/dd/yyyy"))}else{$("#ruleEndDate").val("")}$("#ruleType").val(e);if(e=="M"){if($("#createruleValue").length){$("#ruleValue").val($("#createruleValue").val())}if($("#ruleDesc").length){$("#ruleDescription").val($("#ruleDesc").val())}}TagUI.validateInputs();if(TagUI.validInputs){TagUI.errorMsg=null;$("#instructionDiv").empty();Amex.OverlayManager.block();TagAction.getRules()}else{$("#instructionDiv").html(TagUI.errorMsg)}};Tag.openCatSubCatRuleLayer=function(){$("#tagOperation").val(TagAction.action.INVOKE_RULE);
TagAction.getRules()};Tag.handleRules=function(d){d.stopPropagation();d.preventDefault();var e=$(this).attr("id");var c=e.split("_");if(c[0]=="delRule"){Amex.Msg.confirmDelete(Amex.Msg.msgConfirm,Tag.ruleDelMsg,true,"","",function(f){if("CONFIRM"==f){$("#ruleID").val(c[1]);$("#tagOperation").val(TagAction.action.DELETE_RULE);Omniture.reportClick("deleteTagRule");Amex.OverlayManager.block();if(TagUI.defaultMessage==null){TagUI.defaultMessage=$("#loadingTagRules").html()}TagAction.getRules()}else{if("CANCEL"==f){$("#"+ruleId).focus();
return}}})}else{if(c[0]=="editRule"){TagUI.tagRulesContent=$("#loadingTagRules").html();$("#ruleID").val(c[1]);$("#tagOperation").val(TagAction.action.VIEW_EDIT_RULE);if($("#aTRStDt_"+c[1]).length){$("#ruleStartDate").val($("#aTRStDt_"+c[1]).html())}else{$("#ruleStartDate").val("")}if($("#aTREndDt_"+c[1]).length){$("#ruleEndDate").val($("#aTREndDt_"+c[1]).html())}else{$("#ruleEndDate").val("")}$("#ruleType").val($("#ruleType_"+c[1]).val());if($("#ruleType_"+c[1]).val()=="M"||$("#ruleType_"+c[1]).val()=="T"){$("#ruleDescription").val(Tag.unescape($("#aTRDesc_"+c[1]).html()));
$("#ruleValue").val($("#ruleMerchantValue_"+c[1]).val())}else{if($("#ruleType_"+c[1]).val()=="C"){$("#ruleValue").val($("#aTRCatID_"+c[1]).val())}else{if($("#ruleType_"+c[1]).val()=="S"){$("#ruleValue").val($("#aTRCatID_"+c[1]).val()+"~"+$("#aTRSubCatID_"+c[1]).val())}}}$("#autoTagId").val($("#aTRTagID_"+c[1]).val());TagUI.updateDefaultMsg();if(TagUI.defaultMessage==null){TagUI.defaultMessage=$("#loadingTagRules").html()}Omniture.reportClick("editTagRule");TagAction.getRules()}}};Tag.updateRules=function(){var f=$("#ruleType").val();
var l=$("#ruleValue").val();var c="";var d="";if(($("#"+AutoTagCalendar.fromField).val()!=""&&$("#"+AutoTagCalendar.fromField).val()!="MM/DD/YYYY")&&($("#"+AutoTagCalendar.toField).val()!=""&&$("#"+AutoTagCalendar.toField).val()!="MM/DD/YYYY")){c=Date.parseString($("#"+AutoTagCalendar.fromField).val(),"M/d/y");d=Date.parseString($("#"+AutoTagCalendar.toField).val(),"M/d/y")}else{if($("#"+AutoTagCalendar.beforeField).val()==""||$("#"+AutoTagCalendar.beforeField).val()!="MM/DD/YYYY"){st="";d=Date.parseString($("#"+AutoTagCalendar.beforeField).val(),"M/d/y")
}else{if($("#"+AutoTagCalendar.afterField).val()==""||$("#"+AutoTagCalendar.afterField).val()!="MM/DD/YYYY"){c=Date.parseString($("#"+AutoTagCalendar.afterField).val(),"M/d/y");d=""}}}$("#tagOperation").val(TagAction.action.EDIT_RULE);if(c!=""&&c!=null){$("#ruleStartDate").val(c.format("MM/dd/yyyy"))}else{$("#ruleStartDate").val("")}if(d!=""&&d!=null){$("#ruleEndDate").val(d.format("MM/dd/yyyy"))}else{$("#ruleEndDate").val("")}if(f=="M"||f=="T"){l=$("#ruleValue").val()}else{var h=$("#ruleCateTag").val();
var e=$("#ruleSubCatTag").val();if(h=="default"&&e=="default"){f="D"}else{if(h!="default"&&e=="default"){f="C";l=h}else{if((h=="default"&&e!="default")||(h!="default"&&e!="default")){f="S";l=h+"~"+e}}}}$("#ruleType").val(f);$("#ruleValue").val(l);$("#autoTagId").val($("#ruleTagID").val());TagUI.validateInputs();if(TagUI.validInputs){TagUI.errorMsg=null;$("#instructionDiv").empty();Amex.OverlayManager.block();TagAction.getRules()}else{$("#instructionDiv").html(TagUI.errorMsg)}};Tag.createMerchantRule=function(c){var d=$(this).closest("tbody").attr("id").split("_")[1];
Omniture.reportClick("createMerRule");Tag.createRule("M");return false};Tag.closeMerchantRule=function(c){var d=$(this).closest("tbody").attr("id").split("_")[1];TagUI.showInlineView(d,false);return false};Tag.getTagBarForRefNo=function(d){var c=-1;var f=[];c=Tag.getRocId(d);if(c!=-1){var e=$("#troc_"+c).tagbar("getfulltagbar");$.each(e,function(l,h){f.push(h.id)})}return f};Tag.getUncommonTagList=function(d,c){var e=[];if(d.length>c.length){a=d;b=c}else{a=c;b=d}$.grep(a,function(f){if($.inArray(f,b)==-1){e.push(f)
}});return e};Tag.validateKeyCode=function(c){return(c.keyCode==16||c.keyCode==9||c.keyCode==13||c.keyCode==20||c.keyCode==17||c.keyCode==91||c.keyCode==18||c.keyCode==8||c.keyCode==45||c.keyCode==36||c.keyCode==33||c.keyCode==35||c.keyCode==34||c.keyCode==38||c.keyCode==40||c.keyCode==37||c.keyCode==39)};Tag.getRocId=function(d){var c=-1;if($("input.multiCheck[value*="+d+"]").length){return $("input.multiCheck[value*="+d+"]").attr("id").split("_")[1]}return c};var TagList={tagArr:null,tagListHTML:"",timer:null,selectedTags:[],viewType:null,skipLookahead:false,selectedFilters:[],inlineNormalWidthForTagView:"741px",inlineNormalWidthForTagBody:"96%",inlineNormalWidthForTagList:"100%",inlineEnlargeWidthForTagView:"956px",inlineEnlargeWidthForTagBody:"93%",inlineEnlargeWidthForTagList:"100%",multiNormalWidthForTagView:"770px",multiNormalWidthForTagBody:"709px",multiNormalWidthForTagList:"704px",multiEnlargeWidthForTagView:"985px",multiEnlargeWidthForTagBody:"895px",multiEnlargeWidthForTagList:"890px"};
TagList.loadTagList=function(){if(_tagArray){TagList.tagArr=_tagArray;TagList.userType=userType;TagList.isBasicWithSupp=TagList.selectedCardHasSupps()}return false};TagList.getTagList=function(){return TagList.tagArr};TagList.getBlindContainerWidth=function(){if(TagUI.displayedView==TagUI.INLINE_VIEW){return(TagList.viewType=="L")?TagList.inlineNormalWidthForTagView:TagList.inlineEnlargeWidthForTagView}else{if(TagUI.displayedView==TagUI.MULTI_VIEW){return(TagList.viewType=="L")?TagList.multiNormalWidthForTagView:TagList.multiEnlargeWidthForTagView
}}};TagList.getTagBodyWidth=function(){if(TagUI.displayedView==TagUI.INLINE_VIEW){return(TagList.viewType=="L")?TagList.inlineNormalWidthForTagBody:TagList.inlineEnlargeWidthForTagBody}else{if(TagUI.displayedView==TagUI.MULTI_VIEW){return(TagList.viewType=="L")?TagList.multiNormalWidthForTagBody:TagList.multiEnlargeWidthForTagBody}}};TagList.getTagListContainerWidth=function(){if(TagUI.displayedView==TagUI.INLINE_VIEW){return(TagList.viewType=="L")?TagList.inlineNormalWidthForTagList:TagList.inlineEnlargeWidthForTagList
}else{if(TagUI.displayedView==TagUI.MULTI_VIEW){return(TagList.viewType=="L")?TagList.multiNormalWidthForTagList:TagList.multiEnlargeWidthForTagList}}};TagList.renderInlineTagRuleContainer=function(){TagList.viewType=$("#viewType").val();var c=$("<div/>");c.attr("id","openBlindRulesContainer");c.addClass("tagView");c.append($.jcp("run","@tags/instructionLayer"));c.append(TagList.renderInlineTagListRuleContainer());c.css({width:TagList.getBlindContainerWidth(),height:"240px"});return c};TagList.renderInlineTagListRuleContainer=function(){var c=$("<div/>");
c.attr("id","tagListRulesContainer");c.addClass("tagContainer");c.attr({title:""});c.css({width:TagList.getTagListContainerWidth(),height:"150px"});return c};TagList.filterItem=function(l,d){var c=$("<li/>");c.addClass("filterCheckbox");c.attr("id","trnsTagRow"+l);var f=$("<input/>");f.attr({id:"_tag-"+d.id,type:"checkbox",title:"",value:d.id,name:"searchTagIds"});var h=$("<label/>");h.attr({"for":"_tag-"+d.id});h.html(Tag.escape(d.name));c.append(f);c.append(h);if(d.shared){var m=$("<span/>");m.addClass("filterShare");
var e=$("<img/>");e.attr("src",$("#locImages").val()+"/clear.gif");m.append(e);c.append(m)}return c};TagList.populateFiltered=function(){TagList.selectedFilters=[];var c=$("#listTag input:checked").each(function(){TagList.selectedFilters.push(this.id)})};TagList.renderFilterTagList=function(){var d=TagList.tagArr;TagList.populateFiltered();var c=$("<fieldset/>");if(d&&d.length>0){var e=$("<ul/>");for(var l=0;l<d.length;l++){e.append(TagList.filterItem(l,d[l]))}e.append(TagList.filterItem(d.length,{name:"Untagged",id:"-2",shared:false}));
var h=$("<legend/>");var f=$("<span/>");f.addClass("accessText");f.html("FILTER BY TAG");h.append(f);c.append(h);c.append(e)}return c};TagList.renderInlineTagRule=function(d){var h="";h=$("<div/>");h.attr("id","tagListRuleBlock");h.addClass("tagBody");h.css({height:"120px"});var c=$("<fieldset/>");var f=$("<legend/>");var e=$("<span/>");e.addClass("accessText");e.html("TAG LIST");f.append(e);c.append(f);h.append(c);return h};TagList.renderTagRuleBlankCreateLayer=function(){var c=$("<div/>");c.attr("id","inline_TextBox");
c.addClass("tagSearch");return c};TagList.renderTagRuleButtonsLayer=function(){var d=$("<button/>");d.attr({type:"button",title:"Create a New Rule",alt:"Create a New Rule",id:"create"});d.addClass("blueButton");d.on("click",Tag.createRule);d.css({margin:"0 5px 0 0"});var f=$("<span/>");f.attr("id","uncheckAll");f.html("CREATE");d.append(f);var h=$("<div/>");h.attr("id","inline_TextBox");h.addClass("tagButtons");h.append(d);var e=$("<button/>");e.attr({type:"button",title:"Close"});e.addClass("blueButton");
e.attr("id","close");e.on("click",Tag.close);var c=$("<span/>");c.attr("id","close");c.html("close");e.append(c);h.append(e);return h};TagList.lookahead=function(){if(TagList.timer!=0){clearInterval(TagList.timer)}if(TagList.skipLookahead){TagList.skipLookahead=false;return}var c=$(this);if(c.val()==""){TagList.search(c,false)}else{TagList.timer=window.setInterval(function(){if(c.val().length>0&&c.val()!=Tag.defaultText){TagList.search(c,false)}},200)}};TagList.search=function(f,h){window.clearInterval(TagList.timer);
TagList.timer=0;var d=f.val().toLowerCase();var e=d.toLowerCase();if(d.length==0){var c=TagList.tagArr}else{var c=[];$.each(TagList.tagArr,function(m){var l=TagList.tagArr[m].name.toLowerCase();if(l.indexOf(e,0)!=-1){c.push(TagList.tagArr[m])}})}if(f.attr("id")=="textBox_inline"){TagUI.refreshTagList(c);if(f.val()!=""){if(c.length>0){TagUI.showInstruction(TagUI.level.INFO,"Found "+c.length+" matching tag"+((c.length>1)?"s":""))}else{TagUI.showInstruction(TagUI.level.INFO,"No matching tags found")
}}else{TagUI.clearInstruction()}}else{if(f.attr("id")=="_createTagName"){TagUI.reDisplayManageTags(c)}}c=[]};TagList.insert=function(d){var c=Tag.findObject(d.name,TagList.tagArr,TagList.tagListComparator);if(!c[0]){var f=c[1];if(f==TagList.tagArr.length){TagList.tagArr.push(d)}else{TagList.tagArr.splice(f,0,d)}}else{if(TagList.userType=="Supp"){var e=TagList.getObjectForName(d.name);if(e.shared==true){var f=c[1];if(f==TagList.tagArr.length){TagList.tagArr.push(d)}else{TagList.tagArr.splice(f,0,d)
}return}}}};TagList.deleteTag=function(c){var d=TagList.getIndexForNameId(c.name,c.id);TagList.tagArr.splice(d,1);return d};TagList.shareTag=function(c){var d=TagList.getIndexForName(c.name);var f=TagList.getTagList();var e=f[d];e.shared=c.shared};TagList.getObjectAtIndex=function(c){return TagList.tagArr[c]};TagList.isLocalTag=function(e){var d=Tag.findObject(e,TagList.getTagList(),TagList.tagListComparator);if(d[0]==false){return false}if(TagList.userType=="Basic"){return true}var c=TagList.getObjectForName(e);
return !c.shared};TagList.getIndexForName=function(c){var d=Tag.findObject(c,TagList.getTagList(),TagList.tagListComparator)[1];if(d>0&&TagList.getTagList()[d-1].name.toLowerCase()==c.toLowerCase()){return d-1}return d};TagList.getTagObjForId=function(f,d){if(TagList.tagArr!=null){for(var e=0;e<TagList.tagArr.length;e++){if(TagList.tagArr[e].id==d){return TagList.tagArr[e]}}}if(f!=null){for(var c=0;c<f.length;c++){var h=f[c];if(h.id==d){return h}}}return};TagList.getObjectForName=function(c){var d=TagList.getIndexForName(c);
return TagList.getTagList()[d]};TagList.getObjectForNameId=function(d,f){d=d.toLowerCase();var c;var e=TagList.getIndexForName(d);c=TagList.getObjectAtIndex(e);while(c.name.toLowerCase()==d&&c.id!=f){c=TagList.getObjectAtIndex(++e)}if(c.name.toLowerCase()!=d){return null}return c};TagList.getIndexForNameId=function(d,f){var c;var e=TagList.getIndexForName(d);c=TagList.getObjectAtIndex(e);while(c.name.toLowerCase()==d.toLowerCase()&&c.id!=f){c=TagList.getObjectAtIndex(++e)}if(c.name.toLowerCase()!=d.toLowerCase()){return null
}return e};TagList.getObjectsForName=function(e){var d=[];var f=TagList.getIndexForName(e);do{var c=TagList.getObjectAtIndex(f);if(c.name.toLowerCase()==e.toLowerCase()){d.push(c)}}while(++f<TagList.getTagList().length);return d};TagList.tagListComparator=function(d,c){var f=d.toLowerCase();var e=c.name.toLowerCase();if(f<e){return -1}if(f>e){return 1}if(f==e){if((c.shared==true)&&(TagList.userType=="Supp")){return 2}}return 0};TagList.rename=function(e,d){var c=TagList.deleteTag(e);TagList.insert(d)
};TagList.insertSelected=function(d){var c=Tag.findObject(d.name,TagList.selectedTags,TagList.tagListComparator);if(!c[0]){TagList.selectedTags.splice(c[1],0,d)}else{if(TagList.userType=="Supp"){var e=TagList.getObjectForName(d.name);if(e.shared==true){TagList.selectedTags.splice(c[1],0,d)}}}};TagList.removeSelected=function(d){var c=Tag.findObject(d.name,TagList.selectedTags,TagList.tagListComparator);if(c[0]||(!c[0]&&d.shared)){TagList.selectedTags.splice(c[1],1)}return c[0]};TagList.renameSelected=function(d,c){if(TagList.removeSelected(d)){TagList.insertSelected(c)
}};TagList.populateSelected=function(c){TagList.selectedTags=$("#troc_"+c).tagbar("getfulltagbar")};TagList.selectedTagsString=function(){if(TagList.selectedTags.length==0){return"No Tags selected"}else{if(TagList.selectedTags.length<=5){var c="";$.each(TagList.selectedTags,function(d){if(c!==""){c+=", "}c+=TagList.selectedTags[d].name});return"Selected Tags: "+c}else{return TagList.selectedTags.length+" Tags are selected"}}};TagList.applySelected=function(){$.each(TagList.selectedTags,function(d){var c=$("#tchk_"+TagList.selectedTags[d].id);
if(c){c.attr({checked:true})}})};TagList.selectedCardHasSupps=function(){if(!$("#sorted_index")){return false}var e=parseInt($("#sorted_index").val());var d=false;for(var c=0;c<_cardsList.length;c++){if(_cardsList[c].index==e){if(c<(_cardsList.length-1)){d=(_cardsList[c+1].index==e)}break}}return d};var TagUI={table:null,multiTagView:null,ID:null,displayedView:null,isExpanded:false,isMultiTagView:false,isInlineTagRuleView:false,isToggleSharePrivate:false,manageTagView:null,inlineTagRuleView:null,rmViewMode:"",isManageTag:false,tagRulesLayer:null,editTagRulesLayer:null,drilldownTag:false,sharedInline:false,createTagRulesLayer:null,INLINE_VIEW:"inline",MULTI_VIEW:"multi",RULE_VIEW:"rule",ICONSHOW:"Tag this Transaction",ICONHIDE:"Close",isTagRulesOpen:false,defaultMessage:null,defaultMerRuleMessage:null,validInputs:true,errorMsg:null,catSubCatJSON:null,subCatJSON:null,ruleSize:0,tagRulesContent:null,level:{INFO:0,WARNING:1,ERROR:2}};
TagUI.showInlineView=function(l,c){if(TagUI.ID&&TagUI.ID!==l){TagUI.hideInlineView(TagUI.ID,false)}TagUI.isExpanded=true;TagUI.ID=l;TagUI.displayedView=TagUI.INLINE_VIEW;TagList.populateSelected(TagUI.ID);$("#itag_"+l).attr({"class":"goldTag",title:TagUI.ICONHIDE});$("#xtaglist_"+l).html($.jcp("register","@tags/tagcontainer14",{tagArr:TagList.tagArr}));TagList.applySelected();var h=$("#xtag_"+l);var f=h.find("#openBlindContainer");f.hide();h.show();var d=$("#listHead").find("th:visible").length;h.find("td").attr("colspan",d);
f.slideDown(c?300:0,"swing");var e=$("#openBlindContainer").find("input:first");if(e.length===0){e=$("#textBox_inline")}setTimeout(function(){e.focus()},100)};TagUI.hideInlineView=function(e,c){TagUI.isExpanded=false;if(TagUI.ID!==null){$("#itag_"+e).attr({"class":"greyTag",title:TagUI.ICONSHOW});if(c){var d=$("#xtag_"+e).find("div");d.slideUp(300,"swing",function(){TagUI.eradicate(e)})}else{TagUI.eradicate(e)}TagUI.ID=null}};TagUI.eradicate=function(c){$("#xtaglist_"+c).children().detach();$("#xtag_"+c).hide()
};TagUI.showMultiTagView=function(f){TagUI.isMultiTagView=true;var e=$("#openBlindContainer");TagUI.hideInlineView(TagUI.ID);TagUI.displayedView=TagUI.MULTI_VIEW;if(TagUI.multiTagView===null){TagUI.multiTagView=TagUI.renderMultiTagView();TagUI.displayedView=TagUI.MULTI_VIEW}TagUI.multiTagView.setTriggerNode(f);var c=TagUI.getPosition()[1]+"px";TagUI.multiTagView.css({position:"fixed",left:c});TagUI.multiTagView.update(e);var d=(TagList.viewType=="L")?TagList.multiNormalWidthForTagView:TagList.multiEnlargeWidthForTagView;
$("#openBlindContainer").css({width:d});$("#tagButtonsLayer").remove();$("#tagOperations").append($.jcp("register","@tags/buttonlayer14"));TagUI.multiTagView.open();var h=$("#openBlindContainer").find("input:first");if(h.length===0){h=$("#textBox_inline")}setTimeout(function(){h.focus()},1000);if(TagUI.isMultiTagView){h.keydown(function(l){if(l.shiftKey&&Amex.KEY_TAB==l.which){$("#tagBlindClose").focus()}})}};TagUI.getPosition=function(){var c=[];var d=$(document).height();if(d<$(document).prop("scrollHeight")){d=$(document).prop("scrollHeight")
}var e=$("#listData").offset();var l=e.left;l=Math.max(1,(l>0)?l-10:1);var f=d.height-250;TagUI.left=l;f=(f>0)?f:1;c[0]=f;c[1]=l;return c};TagUI.renderMultiTagView=function(){var c=new Amex.Window({modal:false,left:0,bottom:10,theme:"openBlindMultiTag",buttons:null,shadow:{size:6,color:"#666666"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){TagUI.closeTagView();return true}});return c};TagUI.updateFilter=function(){var d=$("#listTag.boxDiv");var c=$("#filter");
if(TagList.getTagList()&&TagList.getTagList().length>0){TagList.populateFiltered();d.html($.jcp("run","@tags/filtertaglist14",{tagArr:TagList.tagArr}));$.each(TagList.selectedFilters,function(){var f=$("#"+this);if(f){f.prop({checked:true})}});if(c){c.css({width:"820px"});d.closest("div.filterTagList").show()}}else{d.empty();if($("#filter").length){c.css({width:"615px"});d.closest("div.filterTagList").hide()}}};TagUI.closeTagView=function(){if(TagUI.isExpanded){Tag.report("tag_inline_close",null,"button");
TagUI.hideInlineView(TagUI.ID,true)}else{if(TagUI.isMultiTagView){Tag.report("tag_multi_close",null,"button");TagUI.multiTagView.close();TagUI.isMultiTagView=false;List.disableTagMode()}}return true};TagUI.createApplyTag=function(d,c){$.each(d,function(e,f){$("#troc_"+f).tagbar("insert",c)});$("#textBox_inline").val($("#textBox_inline").prop("defaultValue"));TagUI.refreshTagList(TagList.getTagList())};TagUI.refreshManageTags=function(){TagUI.reDisplayManageTags(TagList.getTagList());var c=$("#_createTagName");
c.val(c.prop("defaultValue"))};TagUI.reDisplayManageTags=function(h){var d;var f=null;var c=$("#_createTagName");d=$("#_tagPageWrapper");if(d.length){if($("#viewType").val()==="L"){f=d.eq(0)}else{f=d.eq(d.length-1)}}if(f!==null&&f.length){if(d.length){f.empty();if(h.length===0){if(c.val()==c.prop("defaultValue")||c.val()==""){f.css({display:"none"})}else{if(TagList.getTagList().length){f.css({display:"block"});var e=$("<p/>");e.html("No matching tags found");f.html(e)}}}else{f.css({display:"block"});
f.html(TagUI.getManageTagList(h))}}}};TagUI.removeSelected=function(e,d){var c=[];$.each(e,function(h,f){var l=$("#troc_"+f);$.each(d,function(n,m){if(l.tagbar("hastagname",m.name)){c.push(f);l.tagbar("remove",m)}})});if(e.length==1&&c.length>0){c=[c[0]]}return c};TagUI.applySelected=function(d,c){$.each(d,function(f,e){var h=$("#troc_"+e);$.each(c,function(m,l){h.tagbar("insert",l)})})};TagUI.applyTag=function(d,c){$("#troc_"+d).tagbar("applytag",c)};TagUI.removeTag=function(d,c){$("#troc_"+d).tagbar("remove",c)
};TagUI.onTextFocus=function(d){var c=$(this);if(c.val()==Tag.defaultText){c.val("")}};TagUI.onTextBlur=function(d){var c=$(this);if(c.val()===""){c.val(Tag.defaultText)}};TagUI.focusCycle=function(c){if(TagUI.isMultiTagView){var d=$("#openBlindContainer").find("input:first");if(d.length==0){d=$("#textBox_inline")}if(Amex.KEY_TAB==c.which&&!c.shiftKey){d.focus()}}};TagUI.refreshTagList=function(c){if(!TagUI.isExpanded&&!TagUI.isMultiTagView){return}$("#tagListBlock").remove();if(TagList.tagArr.length===0){$("#instructionDiv").remove();
$("#tagListContainer").prepend($.jcp("register","@tags/tutorial"));$("#openBlindContainer").css({height:"310px"})}else{if($("#instructionDiv").length===0){$("#openBlindContainer").prepend($.jcp("register","@tags/instructionlayer"))}var d=Math.min(120,30*(1+Math.floor((TagList.tagArr.length-1)/3)));$("#tagListContainer").prepend($.jcp("register","@tags/taglist",{tagArr:c}));$("#tagListContainer").css({height:(30+d)+"px"});$("#openBlindContainer").css({height:(195+d)+"px"});TagList.applySelected()}};
TagUI.showInstruction=function(d,c){if($("#instructionDiv").length){$("#instructionDiv").html(Tag.escape(c));if(d==TagUI.level.WARNING){$("#instructionDiv").addClass("warn")}if(d==TagUI.level.ERROR){$("#instructionDiv").addClass("error")}}};TagUI.clearInstruction=function(){$("#instructionDiv").empty();$("#instructionDiv").removeClass("warn error")};TagUI.hideRenameTextbox=function(d){var e=$("#tag_rename_"+d.id);var h=e.closest("li");$("#editRename").remove();var c=h.find(".tagDispName:first");c.show();
var f=h.find(".imgDisp:first");f.show();e.focus()};TagUI.showRenameTextbox=function(d,h){var l=d.id;Tag.editTagId=l;var n=$("#tag_rename_"+l).closest("li");var c=n.find(".tagDispName:first");c.hide();var m=n.find(".imgDisp:first");m.hide();var f=$("<div/>");f.attr("id","editRename");f.css({paddingTop:"5px"});var e=$("<input/>");e.attr("id","_editTagName");e.attr({type:"text",maxlength:25,value:(h.trim()),autocomplete:"off"});e.css({width:"140px"});f.append(e);n.append(f)};TagUI.onTextboxKeyDown=function(c){if(c.which==Amex.KEY_RETURN){Tag.create(c)
}};TagUI.basic_ManageTags=function(e,m){var q=e.shared?"Shared Tag":"Share this Tag";var c=e.shared?"tag_shared":"tag_share";var p=e.shared?"Shared Tag":"Share Tag with Additional Cardmembers";m.addClass("imgDisp");var o=$("<a/>");o.attr({id:"tag_rename_"+e.id,href:"#",title:"Rename tag"});o.addClass("outlineBox renameIcon");var h=$("<img/>");h.attr({src:$("#locImages").val()+"/clear.gif",alt:"Rename tag",title:"Rename tag"});h.addClass("manageImgIcons");o.append(h);var n=$("<a/>");n.attr({id:"tag_delete_"+e.id,href:"#",title:"Delete tag "});
n.addClass("outlineBox trashIcon");var f=$("<img/>");f.attr({alt:"Delete tag",title:"Delete tag"});f.addClass("manageImgIcons");f.attr("src",$("#locImages").val()+"/clear.gif");n.append(f);m.append(o);m.append(n);if(TagList.isBasicWithSupp){var l=$("<a/>");l.attr({id:c+"_"+e.id,href:"#",title:p});l.addClass("outlineBox "+(e.shared?"shareIcon":"shareAddIcon"));var d=$("<img/>");d.attr({src:$("#locImages").val()+"/clear.gif",alt:q,title:p});d.addClass("manageImgIcons");l.append(d);m.append(l)}return m
};TagUI.supp_ManageTags=function(e,m){var q=e.shared?"Shared Tag":"Share this Tag";var c=e.shared?"tag_shared":"tag_share";var p=e.shared?"Shared Tag":"Share Tag with Additional Cardmembers";m.addClass("imgDisp");if(c=="tag_share"){var o=$("<a/>");o.attr({id:"tag_rename_"+e.id,href:"#",title:"Rename tag "});o.addClass("outlineBox renameIcon");var h=$("<img/>");h.attr({src:$("#locImages").val()+"/clear.gif",alt:"Rename tag",title:"Rename tag"});h.addClass("manageImgIcons");o.append(h);var n=$("<a/>");
n.attr({id:"tag_delete_"+e.id,href:"#",title:"Delete tag "});n.addClass("outlineBox trashIcon");var f=$("<img/>");f.attr({src:$("#locImages").val()+"/clear.gif",alt:"Delete tag",title:"Delete tag"});f.addClass("manageImgIcons");n.append(f);m.append(o);m.append(n)}else{var l=$("<a/>");l.attr({id:"share_"+e.id,href:"#",title:p});l.addClass("outlineBox "+(e.shared?"shareIcon":"shareAddIcon"));var d=$("<img/>");d.attr({src:$("#locImages").val()+"/clear.gif",alt:q,title:p});d.addClass("manageImgIcons");
l.append(d);m.append(l)}return m};TagUI.AA_ManageTags=function(l,e){var m=l.shared?"Shared Tag":"Share this Tag";var d=l.shared?"tag_shared":"tag_share";var h=l.shared?"Shared Tag":"Share Tag with Additional Cardmembers";if(d=="tag_shared"){if($.browser.msie){e.css({"float":"right",overflow:"hidden",width:"40px"})}else{e.css({"float":"right",overflow:"hidden"})}var c=$("<a/>");c.attr({id:"share_"+l.id,href:"#",title:h});c.addClass("outlineBox "+(l.shared?"shareIcon":"shareAddIcon"));var f=$("<img/>");
f.attr({src:$("#locImages").val()+"/clear.gif",alt:m,title:h});f.addClass("manageImgIcons");f.css({"padding-right":"5px","float":"right"});c.append(f);e.append(c)}return e};TagUI.getManageTagList=function(h){var f=$("<ul/>");f.addClass("ulTagDisp");var l=h.length;for(var n=0;n<l;n++){var c=h[n];var m=$("<li/>");m.addClass("manageTagDisp"+(((n%2)==1)?"WhiteBg":""));var e=$("<div/>");e.addClass("tagDispName");var o=$("<a/>");o.attr({href:"#",id:"tag_filter_"+c.id,title:"Filter by "+c.name});o.addClass("blue1");
var p=$("<span/>");p.html(Tag.escape(c.name));o.append(p);e.append(o);var d=$("<div/>");if(TagList.userType=="Basic"){d=TagUI.basic_ManageTags(c,d)}if(TagList.userType=="Supp"){d=TagUI.supp_ManageTags(c,d)}if(TagList.userType=="AA"){d=TagUI.AA_ManageTags(c,d)}m.append(e);m.append(d);f.append(m)}return f};TagUI.showManageTagLayer=function(f){if(TagUI.manageTagView===null){TagUI.renderManageTagView()}else{if(TagUI.manageTagView!==null){TagUI.manageTagView.update(TagUI.createManageTagContainer())}}TagUI.isManageTag=true;
var d=f.offset();var c=parseInt(d.left-(f.width())/2);var h=parseInt(d.top+f.height()+2);TagUI.manageTagView.setPosition(h,c);TagUI.manageTagView.open();var e=null;if($("#closeTagButton").length){e="closeTagButton"}if(e!=null){TagUI.manageTagView._setFocusCycle(e)}};TagUI.closeManageTagView=function(){if(TagUI.manageTagView!==null){TagUI.isManageTag=false;TagUI.manageTagView.close()}};TagUI.renderManageTagView=function(){TagUI.manageTagView=new Amex.Window({modal:false,theme:"amexWindow tagManager",buttons:["close"],title:"manage your tags",left:50,top:100,openEffect:{name:"slideDown",options:{duration:100}},closeEffect:{name:"slideUp",options:{duration:300}},onClose:function(){TagUI.closeManageTagView();
return true}});TagUI.manageTagView.update(TagUI.createManageTagContainer());TagUI.manageTagView.open()};TagUI.createManageTagContainer=function(){var d=$("<div/>");var e=$("<div/>");e.attr("id","yourTags");e.addClass("manageTagContainerLayer");var B=$("<div/>");var K=$("<a/>");K.attr({id:"tagLearn",href:"#","class":"blue popup floatRight",style:"margin-right: 86px;"});K.html("learn more");B.append(K);K.click(TagUI.showLearn);var D=$("<div/>");D.addClass("createTagBlock");D.attr("id","createTagBlock");
var z=$("<fieldset/>");var c=$("<legend/>");var I=$("<span/>");var s=$("<h2/>");I.addClass("accessText");I.html("MANAGE TAGS");c.append(I);z.append(c);s.addClass("creatTagHeading");var F=$("<span/>");F.addClass("boldBlack");var L=$("<label/>");var r=$("<strong/>");if(TagList.userType!="AA"){s.attr({alt:"Enter name of Tag up to 25 characters to Search or Create a Tag",title:"Create a new Tag"});r.html("Create a new Tag")}else{if(TagList.userType=="AA"){s.attr({alt:"Find a Tag",title:"Find a Tag"});
r.html("Find a Tag")}}L.append(r);F.append(L);s.append(F);z.append(s);var E=$("<span/>");E.addClass("tagBottomCenter");var t=$("<input/>");t.attr({type:"text",id:"_createTagName",value:Tag.defaultText,maxlength:"25",size:"20",autocomplete:"off",title:(TagList.userType=="AA")?"Find a Tag":"Enter name of Tag up to 25 characters to Search or Create a Tag "});t.addClass("creatInputLayer");t.focus(TagUI.onTextFocus).blur(TagUI.onTextBlur).keydown(Tag.showPrivateSharedLayerDrillDown).keyup(TagList.lookahead);
E.append(t);z.append(E);if(TagList.userType!="AA"){var C=$("<span/>");C.addClass("tagBottomRightLayer");var u=$("<button/>");u.attr({type:"button",id:"crtag",title:"Create a new Tag"});u.addClass("blueButton");u.click(Tag.create);var m=$("<span/>");m.attr({id:"crtagSpan"});m.html("Create Tag");u.append(m);var v=$("<label/>");v.attr({"for":"createShared"});v.addClass("createSharePanel");var o=$("<div/>");o.addClass("panelSharedRadio");var H=$("<input/>");H.attr({type:"radio",id:"createPanelShared",name:"rmDrillType",checked:"checked"});
o.append(H);v.append(o);var J=$("<span/>");J.html("<b>Shared</b>");if($("#cardTypePref").val()=="basicwithsupp"){J.css({"margin-left":"-1px"})}var l=$("<span/>");l.html("<img src='"+$("#locImages").val()+"/clear.gif' class = 'sharedImage' title='shared' alt='(shared)'/>");l.addClass("inlineShare");J.append(l);v.append(J);var A=$("<p/>");A.html("This tag is shared and can also be used by Additional Cardmembers");A.addClass("panelTextStyle");v.append(A);var y=$("<label/>");y.attr({"for":"createPrivate"});
var f=$("<div/>");f.addClass("panelPivateRadio");var n=$("<input/>");n.attr({type:"radio",id:"createPanelPrivate",name:"rmDrillType"});var M=$("<span/>");if($("#cardTypePref").val()=="basicwithsupp"){M.css({"margin-left":"1px"});y.addClass("createPrivatePanel");f.append(n);C.append(v)}else{y.addClass("createPrivatePanelBasicSupp")}y.append(f);M.html("<b>Private</b>");y.append(M);var A=$("<p/>");A.html("This tag is private and can only be used by you");A.addClass("panelTextStyle");y.append(A);C.append(y);
var N=$("<div/>");N.append(u);C.append(N);z.append(C)}D.append(z);B.append(D);var h=$("<div/>");h.addClass("listTagContainter");h.attr("id","_tagPageWrapper");h.css({"max-height":"212px","overflow-x":"hidden"});h.append(TagUI.getManageTagList(TagList.getTagList()));h.on("click","a",Tag.fireManageTagClick);B.append(h);var w=$("<div/>");w.attr("id","closeButtonCont");w.addClass("TagRulesCont");if(null!=TagList.userType&&TagList.userType!="AA"){w.html('<a id="tagRule" class="blue tagSecondary popup" style="margin-right:8px;" alt="Manage or Create Rules" title="Manage or Create Rules to Tag your Transactions">tag rules</a>')
}var G=$("<button/>");G.addClass("lastFocus cancelButton");G.attr({id:"closeTagButton",type:"button",title:"Close"});G.click(Tag.closeManageTagView);var q=$("<span/>");q.html("Close");G.append(q);w.append(G);var x=$("<div/>");x.addClass("BottomPadding");B.append(x);B.append(w);e.append(B);d.append(e);return d};TagUI.closeManageTagView=function(){if(TagUI.manageTagView!=null){TagUI.manageTagView.close()}return false};TagUI.onKeyDownCreateApply=function(c){if(c.which==Amex.KEY_RETURN){TagList.skipLookahead=true;
Tag.createApplyTag(c)}};TagUI.setPrefPosition=function(){if($("#cardSortSpan").length&&$("#cardSortSpan").css("display")!="none"){Preferences.setPosition("cardSortSpan")}if($("#cardSortSpan1").length&&$("#cardSortSpan1").css("display")!="none"){Preferences.setPosition("cardSortSpan1")}};TagUI.renderTagRulesLayer=function(){if(TagUI.tagRulesLayer==null){var c=$("#tagRules");TagUI.tagRulesLayer=new Amex.Window({modal:true,title:"manage and create tag rules**",theme:"amexWindow",buttons:["close"],onClose:function(){$("#loadingTagRules").html("");
TagUI.tagRulesLayer.close();Amex.PageOverlay.hide(true)},shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});TagUI.tagRulesLayer.render(document.body);TagUI.tagRulesLayer.update(c.html());c.remove()}TagUI.tagRulesLayer.centerInViewport();TagUI.openTagRules();Omniture.report("ManageRule_Track")};TagUI.openTagRules=function(){TagUI.tagRulesLayer.setTitle("manage and create tag rules");TagUI.tagRulesLayer.setTriggerNode("tagRule");TagUI.tagRulesLayer.open();
TagUI.tagRulesLayer._focus[0].focus()};TagUI.updateTagRulesLayer=function(e){$("#loadingTagRules").html(e);var d=$("#tagRuleSize");if(d.length){TagUI.ruleSize=parseInt(d.val())}$("#manageRules").on("click","a",Tag.handleRules);var h=null;if($("#createRuleButton").length){h="createRuleButton"}else{if($("#updateCatSubCatRule").length){h="updateCatSubCatRule"}}if(h!=null){TagUI.tagRulesLayer._setFocusCycle(h)}if($("#ruleCateTag").length){var f=$("#catSubCatJsn").val();TagUI.catSubCatJSON=JSON.parse(f);
var c=$("#ruleSubCatTag")[0];$("#ruleCateTag").on("change",function(n){TagUI.resetsubCat(c);var p=$("#ruleCateTag").val();for(var m=0;m<TagUI.catSubCatJSON.length;m++){if(p==TagUI.catSubCatJSON[m].id){TagUI.subCatJSON=TagUI.catSubCatJSON[m].map;for(var o=0;o<TagUI.subCatJSON.length;o++){var l=$("<option/>");c.options.add(l[0]);l.text(TagUI.subCatJSON[o].name).val(TagUI.subCatJSON[o].id)}}}})}if($("#createCatSubCatRule").length){$("#createCatSubCatRule").on("click",function(){var o=$("#ruleCateTag").val();
var l=$("#ruleSubCatTag").val();var m="";var n="";if(o=="default"&&l=="default"){m="D"}else{if(o!="default"&&l=="default"){m="C";n=o}else{if((o=="default"&&l!="default")||(o!="default"&&l!="default")){m="S";n=o+"~"+l}}}$("#ruleType").val(m);$("#ruleValue").val(n);$("#autoTagId").val($("#ruleTagID").val());Tag.createRule(m)})}$("#updateCatSubCatRule").click(function(){Tag.updateRules()});$("#closeCatSubCatRule").click(TagUI.closeManageTagRuleLayer)};TagUI.updateCreateTagRulesLayer=function(c){$("#loadingCreateRules").html(c);
Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode()};TagUI.renderEditManageTagRulesLayer=function(){if(TagUI.editTagRulesLayer==null){TagUI.editTagRulesLayer=new Amex.Window({modal:true,title:"edit tag rule",theme:"amexWindow",trigger:"editRuleButton",buttons:["close"],onClose:function(){TagUI.isTagRulesOpen=false;Amex.PageOverlay.hide();return true},shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});TagUI.editTagRulesLayer.render(document.body)
}TagUI.editTagRulesLayer.html($("#tagEditRulesLayer").html());TagUI.editTagRulesLayer.centerInViewport();TagUI.editTagRulesLayer.open()};TagUI.closeManageTagRuleLayer=function(){if(TagUI.tagRulesLayer!=null){TagUI.tagRulesLayer.setTitle("manage and create tag rules");TagUI.updateTagRulesLayer(TagUI.tagRulesContent);if(parseInt($("#tagOperation").val())==16){$("#editRule_"+$("#ruleID").val()).focus()}else{TagUI.tagRulesLayer._focus.focus()}TagUI.tagRulesContent=null;TagUI.isTagRulesOpen=true}};TagUI.closeCalendarLayer=function(){$("#calendarLayer").hide()
};TagUI.updateDefaultMsg=function(){if(TagUI.defaultMessage!=null){TagUI.updateTagRulesLayer(TagUI.defaultMessage)}};TagUI.updateMerRulesLayer=function(c){$("#xtaglist_"+TagUI.ID).html(c);$("#xtag_"+TagUI.ID).show();$("#autoTagBetween").focus()};TagUI.updateMerRuleMsg=function(){if(TagUI.defaultMerRuleMessage!=null){TagUI.updateMerRulesLayer(TagUI.defaultMerRuleMessage)}};TagUI.validateInputs=function(){TagUI.validateDates();if(TagUI.validInputs==false){return}var c=$("#ruleTagID");if(c.val()=="default"){TagUI.errorMsg="Please select a Tag.";
TagUI.validInputs=false;return}if(TagUI.ruleSize>100){TagUI.errorMsg="Auto Tag rules limit has been exceeded.";TagUI.validInputs=false;return}};TagUI.validateDates=function(){TagUI.validInputs=true;TagUI.errorMsg=null;var f=$("#"+AutoTagCalendar.fromField).val();var o=$("#"+AutoTagCalendar.toField).val();var l=Date.parseString(f,"M/d/y");var e=Date.parseString(o,"M/d/y");var d=$("#"+AutoTagCalendar.beforeField).val();var m=Date.parseString(d,"M/d/y");var n=$("#"+AutoTagCalendar.afterField).val();
var c=Date.parseString(n,"M/d/y");var h=new Date();h.setTime($("#_minDate").val());if((!$("#"+AutoTagCalendar.autoTagFromTo).is(":visible")||f=="MM/DD/YYYY"&&o=="MM/DD/YYYY")&&d=="MM/DD/YYYY"&&n=="MM/DD/YYYY"){TagUI.errorMsg="Please select a date(s)";TagUI.validInputs=false}if(f!="MM/DD/YYYY"||o!="MM/DD/YYYY"){if(f==""){TagUI.errorMsg='Please select a "from" date';TagUI.validInputs=false}else{if(o==""){TagUI.errorMsg='Please select a "to" date.';TagUI.validInputs=false}else{if(l==null||e==null){TagUI.errorMsg="Please enter the date in the following format: MM/DD/YYYY";
TagUI.validInputs=false}else{if(f.toUpperCase()==="MM/DD/YYYY"){TagUI.errorMsg='Please select a "from" date.';TagUI.validInputs=false}else{if(o.toUpperCase()==="MM/DD/YYYY"){TagUI.errorMsg='Please select a "to" date.';TagUI.validInputs=false}else{if(e.isBefore(l)){TagUI.errorMsg='"To" date cannot be before "From" Date';TagUI.validInputs=false}else{if(l.isBefore(AutoTagCalendar.minDate)||e.isBefore(AutoTagCalendar.minDate)){TagUI.errorMsg='Your "from" or "to" date should not be prior to '+h.format("NNN dd,yyyy");
TagUI.validInputs=false}}}}}}}}if(d!="MM/DD/YYYY"){if(d==""){TagUI.errorMsg="Please select a date(s)";TagUI.validInputs=false}else{if(m==null){TagUI.errorMsg="Please enter the date in the following format: MM/DD/YYYY";TagUI.validInputs=false}else{if(m.isBefore(AutoTagCalendar.minDate)){TagUI.errorMsg="Your date should not be prior to "+h.format("NNN dd,yyyy");TagUI.validInputs=false}}}}if(n!="MM/DD/YYYY"){if(n==""){TagUI.errorMsg="Please select a date(s)";TagUI.validInputs=false}else{if(c==null){TagUI.errorMsg="Please enter the date in the following format: MM/DD/YYYY";
TagUI.validInputs=false}else{if(c.isBefore(AutoTagCalendar.minDate)){TagUI.errorMsg="Your date should not be prior to "+h.format("NNN dd,yyyy");TagUI.validInputs=false}}}}};TagUI.resetsubCat=function(c){var d=c;for(var e=d.options.length-1;e>0;e--){d.remove(e)}};TagUI.prepopulateRuleInfo=function(){var e=$("#ruleStartDate");var c=$("#ruleEndDate");if((e.val()!=""&&e.val()!=null)&&(c.val()!=""&&c.val()!=null)){$("#"+AutoTagCalendar.fromField).val(e.val());$("#"+AutoTagCalendar.toField).val(c.val());
$("#"+AutoTagCalendar.between).hide();$("#"+AutoTagCalendar.autoTagFromTo).show()}else{if((e.val()==""||e.val()==null)&&(c.val()!=""||c.val()!=null)){$("#"+AutoTagCalendar.beforeField).val(c.val());$("#"+AutoTagCalendar.before).hide();$("#"+AutoTagCalendar.autoTagBeforeDt).show()}else{if((e.val()!=""||e.val()!=null)&&(c.val()==""||c.val()==null)){$("#"+AutoTagCalendar.afterField).val(e.val());$("#"+AutoTagCalendar.after).hide();$("#"+AutoTagCalendar.autoTagAfterDt).show()}}}if($("#ruleType").val()=="C"){$("#ruleCateTag").val($("#ruleValue").val())
}else{if($("#ruleType").val()=="S"){var d=$("#ruleValue").val();d=d.split("~");$("#ruleCateTag").val(d[0]);$("#ruleSubCatTag").val(d[1])}}$("#ruleTagID").val($("#autoTagId").val())};TagUI.closeGetRules=function(){var c=$("#ruleType");if(c.length){Amex.PageOverlay.hide()}TagUI.tagRulesLayer.close()};TagUI.learnInit=function(){if(TagUI.learnWindow!=null){return}var d=$("<div/>");var c=$("<img/>");c.attr({src:$("#locImages").val()+"/tag-learn-1.png"});c.css({width:"800px",height:"600px"});d.html(c);
TagUI.learnWindow=new Amex.Window({modal:true,left:150,top:180,theme:"amexWindow",buttons:["close"],title:"using tags",trigger:"tagLearn",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect});TagUI.learnWindow.update(d);TagUI.learnWindow.render(Page.form.id)};TagUI.showLearn=function(c){c.preventDefault();TagUI.learnInit();TagUI.learnWindow.centerInViewport();TagUI.learnWindow.open()
};var TagAction={action:{CREATE_TAG:1,DELETE_TAG:2,RENAME_TAG:3,REMOVE_TAG:4,APPLY_EXISTING_TAG:5,APPLY_NEW_TAG:6,SEARCH_TAG:7,SHARE_TAG:8,FETCH_TAG:9,CREATE_RULE:10,EDIT_RULE:11,DELETE_RULE:12,GET_RULES:13,INVOKE_RULE:15,VIEW_EDIT_RULE:16,FETCH_RC_TAGS:17},tagLimitROCMsg:"There is a limit of 20 Tags per transaction. Please remove a Tag if you would like to add a new one",tagLimitAccountMsg:"This Tag was not created as it would exceed the Tag limit of 1000 Tags",multiViewTagLimitMsg:"No Tags were added as this would exceed the limit of 20 Tags on one or more Transactions",manageLayerTagLimitMsg:"This Tag was not created as it would exceed the Tag limit of 1000 Tags",applyTagMsg:"Sorry, we were not able to apply any Tags",createTagMsg:"Sorry, we were not able to create a Tag",ruleLimitMsg:"This Rule was not created as it would exceed the Rule limit of 100 Rules.",ruleTagUnshareMsg:"Tags used in Rules are unable to be shared. Please edit your Rule or create a new Tag to share.",failMode:false,failTag:null,getRulesFail:"We are experiencing intermittent delays. Please try again later.",deferred:null};
TagAction.applyTag=function(h,f,m){var e=TagAction.action.APPLY_EXISTING_TAG;var c=$.isArray(h)?h:[h];var d=$.isArray(f)?f:[f];var l=TagAction.idToRefNo(c);if($("#multiCardView").length&&"true"==$("#multiCardView").val()){TagAction.sendRequestforAllopen(d,c,l,e,m)}else{Tag.showHideProgress(m,true);TagAction.sendRequest(d,c,l,e,m)}};TagAction.removeTag=function(h,f,m){var e=TagAction.action.REMOVE_TAG;var c=$.isArray(h)?h:[h];var d=$.isArray(f)?f:[f];var l=TagAction.idToRefNo(c);if($("#multiCardView").length&&"true"==$("#multiCardView").val()){TagAction.sendRequestforAllopen(d,c,l,e,m)
}else{Tag.showHideProgress(m,true);TagAction.sendRequest(d,c,l,e,m)}};TagAction.createApplyTag=function(h,f){var e=TagAction.action.APPLY_NEW_TAG;var c=$.isArray(h)?h:[h];var d=$.isArray(f)?f:[f];var l=TagAction.idToRefNo(c);TagAction.sendRequest(d,c,l,e)};TagAction.sendRequestforAllopen=function(e,c,h,d,f){var l=[];var l=$("#"+Page.form.id).serializeArray();l.push({name:"tagAction",value:JSON.stringify(d)});l.push({name:"tagObjects",value:JSON.stringify(e)});l.push({name:"refNos",value:JSON.stringify(h)});
l.push({name:"rocIds",value:JSON.stringify(c)});$.ajax("tagControls.do",{type:"POST",data:l})};TagAction.sendRequest=function(e,c,h,d,f){if(TagAction.failMode){TagAction.failTag=e[0];e[0]={id:"",name:"",shared:e[0].shared}}TagLock.setLocks(h,e);var l=[];if($("#multiCardView").length&&"true"==$("#multiCardView").val()){l=$("#"+Page.form.id).serializeArray()}else{l=formParameters.getParams("tagControls.do")}l.push({name:"tagAction",value:JSON.stringify(d)});l.push({name:"tagObjects",value:JSON.stringify(e)});
l.push({name:"refNos",value:JSON.stringify(h)});l.push({name:"rocIds",value:JSON.stringify(c)});if($("#textBox_inline").val()!=""&&$("#textBox_inline").val()!="Enter Tag name"&&d==TagAction.action.APPLY_EXISTING_TAG){l.push({name:"tagSearchApply",value:true})}$.ajax("tagControls.do",{type:"POST",data:l,context:{tagAction:d,tagObjects:e,refNos:h,rocIds:c,selectedElem:f?f:null},success:function(v,p,r){$("#tagOperation").val("");var n=this.tagAction;var w=this.tagObjects;var x=this.refNos;var s=false;
var u=this.rocIds;var t=this.selectedElem;if(n==TagAction.action.APPLY_EXISTING_TAG||n==TagAction.action.APPLY_NEW_TAG||n==TagAction.action.CREATE_TAG){s=true}if(TagAction.failMode){w[0]=TagAction.failTag}if(t!=null){Tag.showHideProgress(t,false)}if(r.getResponseHeader("TagLimit_At_ROC_Error")!=null){if(n==TagAction.action.APPLY_EXISTING_TAG){if(List.multiTagViewEnabled){Amex.MessageBox.error("Error",TagAction.multiViewTagLimitMsg,true,function(){TagUI.closeTagView();TagAction.refreshView()})}else{Tag.undoApplyTag(u,w,TagAction.tagLimitROCMsg)
}}else{if(n==TagAction.action.APPLY_NEW_TAG){if(List.multiTagViewEnabled){Amex.MessageBox.error("Error",TagAction.multiViewTagLimitMsg,true,function(){TagList.deleteTag(w[0]);TagUI.refreshTagList(TagList.getTagList());TagUI.refreshManageTags();TagUI.closeTagView();TagAction.refreshView()})}else{Tag.undoCreateApplyTag(u,w,TagAction.tagLimitROCMsg)}}}}else{if(r.getResponseHeader("TagLimit_At_Account_Error")!=null){if(n==TagAction.action.CREATE_TAG){if(List.multiTagViewEnabled){Tag.undoCreateMultiTag(w,TagAction.tagLimitAccountMsg)
}else{Tag.undoCreateTag(w,TagAction.manageLayerTagLimitMsg)}}else{if(n==TagAction.action.APPLY_NEW_TAG){if(List.multiTagViewEnabled){Amex.MessageBox.error("Error",TagAction.tagLimitAccountMsg,true,function(){TagList.deleteTag(w[0]);TagUI.refreshTagList(TagList.getTagList());TagUI.refreshManageTags();TagUI.closeTagView();TagAction.refreshView()})}else{Tag.undoCreateApplyTag(u,w,TagAction.tagLimitAccountMsg)}}}}else{if(r.getResponseHeader("MYCAError")!=null){if(List.multiTagViewEnabled){Amex.MessageBox.error("Error","An error has occurred. Some operations may not have been successful",true,function(){TagUI.closeTagView();
TagAction.refreshView()})}else{if(n==TagAction.action.APPLY_EXISTING_TAG){Tag.undoApplyTag(u,w,TagAction.applyTagMsg)}else{if(n==TagAction.action.APPLY_NEW_TAG){Tag.undoCreateApplyTag(u,w,TagAction.createTagMsg)}else{if(n==TagAction.action.REMOVE_TAG){Tag.undoRemoveTag(u,w)}else{if(n==TagAction.action.SHARE_TAG){Amex.MessageBox.error("Error","An error has occurred. Some operations may not have been successful",true,null);Tag.undoShareTag(w[0])}else{if(n==TagAction.action.DELETE_TAG){Amex.MessageBox.error("Error","An error has occurred. Some operations may not have been successful",true,null);
Tag.undoDeleteTag(u,w[0])}else{if(n==TagAction.action.RENAME_TAG){Amex.MessageBox.error("Error","An error has occurred. Some operations may not have been successful",true,null);Tag.undoRenameTag(u,x[0],w[0])}else{if(n==TagAction.action.CREATE_TAG){Tag.undoCreateTag(w,"An error has occurred. Some operations may not have been successful")}}}}}}}}}else{if(r.getResponseHeader("MYCAError")==null){if(n==TagAction.action.APPLY_NEW_TAG){var o=v.substring(v.indexOf(":")+1).replace(/^\s+|\s+$/g,"");var m=w[0];
Tag.finishCreateApplyTag(m,u,o);Tag.createShareApply(o,m)}else{if(n==TagAction.action.CREATE_TAG){var o=v.substring(v.indexOf(":")+1).replace(/^\s+|\s+$/g,"");var m=w[0];Tag.finishCreateTag(m,o);Tag.createShareApply(o,m)}else{if(n==TagAction.action.DELETE_TAG){var q=w[0].id;if(Filter.applied){TagUI.updateFilter();Tag.runFilter()}}else{if(n==TagAction.action.RENAME_TAG){if(Graph.lastFnArgs!=null&&Graph.lastFnArgs!=""){var q=(Graph.lastFnArgs).split("~~");if(q[0]==w[0].id){Tag.renamedTagName=w[0].name;
Tag.renamedTagId=w[0].id}}if(Filter.applied){TagUI.updateFilter();Tag.runFilter()}}else{if(n==TagAction.action.FETCH_RC_TAGS){if(v.rcEligibleCardTags!=null){Receipt.tagObjJSON=v.rcEligibleCardTags}TagAction.deferred.resolve(true)}}}}}}}}}TagLock.releaseLocks(x,w)},error:function(p){var n=this.tagObjects;var m=this.refNos;var o=this.selectedElem;TagLock.releaseLocks(m,n);if(o!=null){Tag.showHideProgress(o,false)}if(d==TagAction.action.FETCH_RC_TAGS){TagAction.deferred.resolve(true);return}Amex.MessageBox.error("Error","An error has occurred. Some operations may not have been successful",true,function(){TagUI.closeTagView();
TagAction.refreshView()})}})};TagAction.idToRefNo=function(c){var d=[];$.each(c,function(e,f){d.push($("#croc_"+f).val())});return d};TagAction.deleteTag=function(h,d){var f=TagAction.action.DELETE_TAG;var c=$.isArray(h)?h:[h];var e=$.isArray(d)?d:[d];var l=[];TagAction.sendRequest(e,c,l,f)};TagAction.shareTag=function(f,l){var e=TagAction.action.SHARE_TAG;var c=[];var d=$.isArray(f)?f:[f];var h=[];if(l){Tag.showHideProgress(l,true)}TagAction.sendRequest(d,c,h,e,l)};TagAction.renameTag=function(e,l,f,h){var c=$.isArray(e)?e:[e];
var d=$.isArray(f)?f:[f];Tag.showHideProgress(h,true);TagAction.sendRequest(d,c,[l],TagAction.action.RENAME_TAG,h)};TagAction.createTag=function(f){var e=TagAction.action.CREATE_TAG;var c=[];var d=$.isArray(f)?f:[f];var h=[];TagAction.sendRequest(d,c,h,e)};TagAction.refreshView=function(){Status.startLoad("listOnly");List.load("listControls.do","refreshView")};TagAction.summaryLoad=function(){var c=[];c=formParameters.getParams("summary.do");$.ajax("summary.do",{type:"POST",data:c,success:function(d,f,e){if(d.indexOf("noResultsDisplay")<0){Summary.drillDown($("#summaryYAxis").val(),$("#summarySubYAxis").val(),$("#summaryXAxis").val(),"1")
}if(e.getResponseHeader("MYCAError")==null){Status.fireSuccess("summary",e)}else{Status.fireMycaError("summary",e)}},error:function(d){Status.fireHttpError("summary",d)}});Status.fireStart("summary",null)};TagAction.graphLoad=function(c){$("#summaryXAxis").val("");$("#summaryYAxis").val("");$("#summarySubYAxis").val("");$("#splitPaneState").val("N");var l=$("#multiCardView").val();var d=$("#reportType").val();var e="";var f=[];f=formParameters.getParams("graph.do");var h=$.ajax("graph.do",{type:"POST",data:f,success:function(m,o,n){if(n.getResponseHeader("MYCAError")==null){displayBreadCrumbMessage=breadCrumbValues[d];
if(l!=null&&l=="true"){if(d==4){displayBreadCrumbMessage="Card"}else{if(d==5){displayBreadCrumbMessage="Category by Card"}}}cmId=-1;Status.fireSuccess("graph",n)}else{Status.fireMycaError("graph",n)}if(m.indexOf("summaryNoResults")==-1){if(Tag.renamedTagName!=null&&Tag.renamedTagName!=""){Graph.loadDrillDown(c);Tag.renamedTagName=null}else{Graph.loadDrillDown(Graph.lastFnArgs)}}},error:function(m){Status.fireHttpError("graph",m)}});Status.fireStart("graph",h)};TagAction.getRules=function(){$("#fetchPreferences").val(false);
var c=[];c=formParameters.getParams("tagControls.do");$.ajax("tagControls.do",{type:"POST",data:c,success:function(d,f,e){if(e.getResponseHeader("Rules_Error")!=null){TagAction.fireError(TagAction.ruleLimitMsg)}else{if(e.getResponseHeader("MYCAError")!=null){TagAction.fireError(d)}else{if(e.getResponseHeader("MYCAError")==null){TagAction.fireSuccess(d)}}}},error:function(d){TagAction.fireError(d.responseText)}});$("#fetchPreferences").val(true)};TagAction.showInlineRulesView=function(e){$("#exRocType").val("tagAction");
$("#fetchPreferences").val(false);var d=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){d=formParameters.getParams("exroc.do")}else{d=$("#"+Page.form.id).serialize()}$.ajax("exroc.do",{type:"POST",data:d,success:function(f,l,h){if(h.getResponseHeader("MYCAError")==null){$("#exRocType").val("");TagUI.updateMerRulesLayer(f);AutoTagCalendar.init()}else{$("#exRocType").val("");Amex.Msg.error("error processing request",f,true,function(){TagUI.showInlineView(e,false)});Amex.Msg.setTriggerNode("autoTagRuleId")
}},error:function(f){$("#exRocType").val("");Amex.Msg.error("error processing request",f.responseText,true,function(){TagUI.showInlineView(e,false)});Amex.Msg.setTriggerNode("autoTagRuleId")}});$("#fetchPreferences").val(true)};TagAction.fireSuccess=function(c){switch(Number($("#tagOperation").val())){case TagAction.action.INVOKE_RULE:TagUI.updateTagRulesLayer(c);TagUI.tagRulesLayer.setTitle("new tag rule");TagUI.isTagRulesOpen=true;AutoTagCalendar.init();Amex.OverlayManager.pWin.hide();break;case TagAction.action.CREATE_RULE:TagUI.tagRulesContent=null;
if(null!=TagUI.tagRulesLayer&&TagUI.tagRulesLayer.visible()){TagUI.closeManageTagRuleLayer()}TagAction.refreshView();break;case TagAction.action.DELETE_RULE:TagAction.refreshView();break;case TagAction.action.VIEW_EDIT_RULE:TagUI.updateTagRulesLayer(c);TagUI.tagRulesLayer.setTitle("edit tag rule");TagUI.tagRulesLayer._focus.focus();TagUI.isTagRulesOpen=true;AutoTagCalendar.init();TagUI.prepopulateRuleInfo();Amex.OverlayManager.pWin.hide();break;case TagAction.action.EDIT_RULE:TagUI.tagRulesContent=null;
TagAction.refreshView();break;default:TagUI.updateTagRulesLayer(c);TagUI.tagRulesLayer.setTitle("manage and create tag rules");TagUI.isTagRulesOpen=true;break}};TagAction.fireError=function(c){Amex.OverlayManager.pWin.hide();switch(Number($("#tagOperation").val())){case TagAction.action.INVOKE_RULE:Amex.Msg.error("error processing request",c,true,null);break;case TagAction.action.CREATE_RULE:if($("#ruleType").val()=="M"){Amex.PageOverlay.hide()}Amex.Msg.error("error processing request",c,true,null);
if($("#ruleType").val()=="M"){TagUI.inlineSlide=false;TagUI.table.showInlineView(TagUI.ID)}else{Tag.openManageRulesLayer();TagUI.isTagRulesOpen=true}break;case TagAction.action.DELETE_RULE:Amex.Msg.error("error processing request",c,true,null);break;default:if(TagUI.isTagRulesOpen){Amex.Msg.error("error processing request",c,true,null);Amex.Msg.setTriggerNode("tagRule")}else{TagUI.updateTagRulesLayer(c)}break}};TagAction.fetchRCTags=function(){var e=TagAction.action.FETCH_RC_TAGS;var c=[];var d=[];
var f=[];$("#tagOperation").val(TagAction.action.FETCH_RC_TAGS);TagAction.deferred=$.Deferred();Amex.OverlayManager.block("app");TagAction.sendRequest(d,c,f,e);return TagAction.deferred};var TagLock={locks:{}};TagLock.releaseLocks=function(d,c){TagLock.releaseTags(c);TagLock.releaseRocs(d)};TagLock.setLocks=function(d,c){TagLock.setTags(c);TagLock.setRocs(d)};TagLock.setTags=function(d){var c=$.isArray(d)?d:[d];$.each(c,function(e){TagLock.set(c[e].id)})};TagLock.setRocs=function(d){var c=$.isArray(d)?d:[d];
$.each(c,function(e){TagLock.set(c[e])})};TagLock.releaseTags=function(d){var c=$.isArray(d)?d:[d];$.each(c,function(e){TagLock.release(c[e].id)})};TagLock.releaseRocs=function(d){var c=$.isArray(d)?d:[d];$.each(c,function(e){TagLock.release(c[e])})};TagLock.set=function(d){var c=TagLock.locks[d];if(c==undefined){c=1}else{c++}TagLock.locks[d]=c;return c};TagLock.release=function(d){var c=TagLock.locks[d];if(c==undefined){c=0}else{c--}if(c==0){TagLock.locks={}}else{TagLock.locks[d]=c}return c};TagLock.check=function(d){var c=TagLock.locks[d];
if(c==undefined){c=0}return c};var Download={downloadApp:null,downloadOFX:null,formatPDF:null,formatXLS:null,formatCSV:null,includeDetails:null,downloadYESPDF:null,refineMsg:"Refine your request by choosing a shorter Time Period.",window:null,refineLimit:100000,refineLimitETD:5000,refineLimitXLS:65000,init:function(){if(Download.window==null){var h=$("#downloadDialogData");if(h.length==0){Amex.Msg.alert("ALERT","Download information is not available.",true);return}Download.window=new Amex.Window({modal:true,left:150,top:180,theme:"amexWindow",buttons:["close"],title:"download transaction activity",trigger:"topLinkDownload",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){Amex.PageOverlay.hide();
return true}});Download.window.update(h.html());Download.window.render(Page.form.id);h.remove();Download.downloadApp=$("#dwnloadtrna");Download.downloadOFX=$("#dwnloadofx");Download.formatPDF=$("#downloadTypeAdobe");Download.formatXLS=$("#downloadTypeExcel");Download.formatCSV=$("#downloadTypeCSV");Download.includeDetails=$("#downloadWithETD");Download.downloadYESPDF=$("#dwnloadpdf");var d=$("#disableALLDwnld");Download.disableApp=(d.val().toUpperCase()=="Y")?true:false;var e=$("#disablePDFDwnld");
Download.disablePDF=(e.val().toUpperCase()=="Y")?true:false;var l=$("#disableXLSDwnld");Download.disableXLS=(l.val().toUpperCase()=="Y")?true:false;var f=$("#disableETDDwnld");Download.disableETD=(f.val().toUpperCase()=="Y")?true:false;var m=$("#downloadCancelButton");var c=$("#downloadContinueButton")}return Download},open:function(){Download.init();if($("#bPIndex").val()=="0"||$("#bPIndex").val()=="-97"){if(!$("#downloadPendId").length){var c=$("<div/>").attr("id","downloadPendId");var d=document.createTextNode("Pending charges will not be included under Download Current View");
c.append(d);$("#downloadMsgId").append(c)}}else{if($("#downloadPendId").length){$("#downloadPendId").remove()}}if(Download.window!=null){Download.window.centerInViewport();Download.window.open();Download._updateOptions()}Omniture.report("Download_Track");return Download},_updateOptions:function(){if(Download.disableApp){Download._defaultOFX()}else{var c=$("#viewType").val().toUpperCase();var d=$("#"+Page.list.table).length?true:false;Download._resetOptions();var e=true;if(c=="L"){if(d){Download._updateAppOptions()
}else{Download._defaultOFX()}}else{if(c=="S"){var f=($("#summaryNoResults").length==0)?true:false;if(f){Download._updateAppOptions();if(!d){Download.includeDetails.prop("checked",false);Download.includeDetails.prop("disabled",true);Download.formatCSV.prop("checked",false);Download.formatCSV.prop("disabled",true)}}else{Download._defaultOFX()}}else{if(c=="G"){var f=$("#summaryNoResults").length?true:false;if(d){Download._updateAppOptions()}else{if(!e&&($("#prefDownloadType").val()=="2"&&($("#yesYear").val()!=""))){Download.formatPDF.prop("disabled",true);
Download.formatXLS.prop("disabled",true);Download.formatCSV.prop("disabled",true);Download.includeDetails.prop("disabled",true);$("#dwnloadtrna").prop("disabled",true);$("#dwnloadpdf").prop("checked",true)}else{Download._defaultOFX()}}}}}}},_defaultOFX:function(){Download.downloadApp.prop("disabled",true);Download.formatPDF.prop("disabled",true);Download.formatXLS.prop("disabled",true);Download.formatCSV.prop("disabled",true);Download.includeDetails.prop("disabled",true);Download.downloadOFX.prop("disabled",true);
Download.downloadOFX.prop("checked",true)},_updateAppOptions:function(){if(Download.disablePDF){Download.formatPDF.prop("disabled",true);Download.formatXLS.prop("checked",true)}else{if(Download.disableXLS){Download.formatXLS.prop("disabled",true);Download.formatPDF.prop("checked",true)}}if(Download.disableETD){Download.includeDetails.prop("disabled",true)}},_resetOptions:function(){Download.downloadApp.prop("disabled",false);Download.downloadApp.prop("checked",true);Download.formatPDF.prop("disabled",false);
Download.formatPDF.prop("checked",true);Download.formatXLS.prop("disabled",false);Download.formatXLS.prop("checked",false);Download.formatCSV.prop("disabled",false);Download.formatCSV.prop("checked",false);Download.includeDetails.prop("disabled",false);Download.includeDetails.prop("checked",false);Download.downloadOFX.prop("disabled",false);Download.downloadOFX.prop("checked",false)},selectFormat:function(){if(Download.downloadApp.is(":checked")){Download.formatPDF.prop("disabled",false);Download.formatXLS.prop("disabled",false);
var c=$("#viewType").val().toUpperCase();var d=$("#"+Page.list.table).length?true:false;if(c=="S"&&!d){Download.includeDetails.prop("checked",false);Download.includeDetails.prop("disabled",true);Download.formatCSV.prop("checked",false);Download.formatCSV.prop("disabled",true)}else{Download.formatCSV.prop("disabled",false);Download.includeDetails.prop("disabled",false)}}else{Download.formatPDF.prop("disabled",true);Download.formatXLS.prop("disabled",true);Download.formatCSV.prop("disabled",true);Download.includeDetails.prop("disabled",true)
}return Download},start:function(d){var e=Download.includeDetails.is(":checked");var c=Download.formatXLS.is(":checked");if(Download.downloadYESPDF.is(":checked")){Omniture.report("download_yespdf");TopLinks.downloadMktPDF();return false}else{if(Download.downloadOFX.is(":checked")){Omniture.report("download_ofx");location.href=$("#OFXLink").val()}else{if(Download.includeDetails.is(":checked")){if($("#totalTrans").length&&$("#totalTrans").val()>Download.refineLimitETD){Amex.Msg.alert(Amex.Msg.information,Download.refineMsg,true,null);
if(Download.formatPDF.is(":checked")){Omniture.report("download_pdf")}else{if(Download.formatXLS.is(":checked")){Omniture.report("download_xls")}else{if(Download.formatCSV.is(":checked")){Omniture.report("download_csv")}}}return false}else{if(Download.formatPDF.is(":checked")){Omniture.report("download_pdf")}else{if(Download.formatXLS.is(":checked")){Omniture.report("download_xls")}else{if(Download.formatCSV.is(":checked")){Omniture.report("download_csv")}}}Download.submit()}}else{if(!Download.includeDetails.is(":checked")&&!Download.formatXLS.is(":checked")){if($("#totalTrans").val()>Download.refineLimit){Amex.Msg.alert(Amex.Msg.information,Download.refineMsg,true,null);
if(Download.formatPDF.is(":checked")){Omniture.report("download_pdf")}else{if(Download.formatCSV.is(":checked")){Omniture.report("download_csv")}}return false}else{if(Download.formatPDF.is(":checked")){Omniture.report("download_pdf")}else{if(Download.formatCSV.is(":checked")){Omniture.report("download_csv")}}Download.submit()}}else{if(!Download.includeDetails.is(":checked")&&Download.formatXLS.is(":checked")){if($("#totalTrans").length&&$("#totalTrans").val()>Download.refineLimitXLS){Amex.Msg.alert(Amex.Msg.information,Download.refineMsg,true,null);
Omniture.report("download_xls");return false}else{Omniture.report("download_xls");Download.submit()}}}}}}},submit:function(){var d="";if($("#viewType").val()!="G"){if($("#reportType").val()!="1"){d="downloadsummary.do"}else{d="downloadTxn.do"}}else{d="downloadTxn.do"}var c="";var f="";for(var e=0;e<Summary.rowState.length;e++){c=c+Summary.rowState[e]}for(var e=0;e<Summary.colState.length;e++){f=f+Summary.colState[e]}$("#isPrefView").val("false");$("#rowState").val(c);$("#colState").val(f);Page.form.submit(d)
}};var Print={printReq:"isPrintReq",preview:null,allWindow:null,doc:null,inPrintMode:false,individualPrintMode:false,prevPendingZIndex:null,printTrigger:null,showBlackStar:false,showGoldStar:false,showcurrSortSaveCol:false,isHelpOpen:null,shoeBoxPreviewHTML:null,messages:{previewLoad:"Please wait. Loading preview data ...",previewFail:"Sorry, our system is not currently responding. Please try again later. We apologize for any inconvenience."}};Print.extendedROC=function(d,f,e,l){Print.createFrames();
if(Print.inExtendeEvent){return}Print.inExtendeEvent=true;if(Pending.isOpen){Omniture.report("print_pending")}else{Omniture.report("list_print")}Print.updatePreview(Print.messages.previewLoad,false);Print.openPreview(d);if(f){$("#"+Print.printReq).val("Y");$("#refSeNumber").val(f)}$("#exRocType").val("");if(e){$("#"+Print.printReq).val("P");var h=[];h=formParameters.getParams("pendingExroc.do");$.ajax("exroc.do",{type:"POST",data:h,success:function(n,m,o){if(o.getResponseHeader("MYCAError")==null){Print.updatePendingPreview(o.responseText,l)
}else{Print.updatePendingPreview(Print.messages.previewFail,l)}},error:function(m){Print.updatePendingPreview(Print.messages.previewFail,l)}})}if(l){$("#"+Print.printReq).val("A");var h=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){h=formParameters.getParams("exroc.do")}else{h=$("#"+Page.form.id).serialize()}$.ajax("exroc.do",{type:"POST",data:h,success:function(n,m,o){if(o.getResponseHeader("MYCAError")==null){Print.updatePreview(o.responseText,true,e)}else{Print.updatePreview(Print.messages.previewFail,true,e)
}},error:function(m){Print.updatePreview(Print.messages.previewFail,true,e)}})}$("#"+Print.printReq).val("N");Print.inExtendeEvent=false};Print.rocDetails=function(d){Print.createFrames();Print.printTrigger="printrocLink"+d;if(Print.inExtendeEvent){return}Print.inExtendeEvent=true;if(Pending.isOpen&&d.indexOf("~")===-1){$("#pendingRequest").val("Y");Omniture.report("print_pending_list")}else{Omniture.report("list_print")}if(d){$("#"+Print.printReq).val("Y");$("#refSeNumber").val(d)}$("#exRocType").val("");
$("#jsonEtd").val(true);var e=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){e=formParameters.getParams("exroc.do")}else{e=$("#"+Page.form.id).serialize()}$.ajax("exroc.do",{type:"POST",data:e,success:function(h,f,l){if(l.getResponseHeader("MYCAError")==null){Print.print($.jcp("run","@list/etd-print.jcp.txt",h))}}});$("#"+Print.printReq).val("N");Print.inExtendeEvent=false;$("#jsonEtd").val(false);if(Pending.isOpen&&d.indexOf("~")===-1){$("#pendingRequest").val("N")}};Print.updatePreview=function(f,d,e){Print.createFrames();
var l=document.getElementById("printPreviewFrame");if(d){var c="<div id='postedPrntHdr'>POSTED CHARGES </div>";f=c+f}if(l){var h=l.contentWindow||l.contentDocument;if(h.document){h=h.document}h=h.body;if($(h).html().indexOf(Print.messages.previewLoad)!=-1||!e){$(h).html(f)}else{if(e){$(h).append(f)}}}};Print.updatePendingPreview=function(d,h){Print.createFrames();var f=document.getElementById("printPreviewFrame");var c="<div id='pendingPrntHdr'>Pending Charges</div>";d=c+d;if(f){var e=f.contentWindow||f.contentDocument;
if(e.document){e=e.document}e=e.body;if($(e).html().indexOf(Print.messages.previewLoad)!=-1||!h){$(e).html(d)}else{if(h){d=d+$(e).html();$(e).html(d)}}}};Print.printPreview=function(){Print.createFrames();Print.printTrigger="printInd";var d=document.getElementById("printPreviewFrame");if(d){var c=d.contentWindow||d.contentDocument;if(c.document){c=c.document}c=c.body;Print.print(c.innerHTML)}Print.closePreview(true)};Print.closePreview=function(c){if(c){Print.preview.close()}$(Print.printReq).value=""
};Print.openPreview=function(d){Print.createFrames();var f="selectToPrint";if(d.id!=null){f=d.id}if(Print.preview==null){Print.preview=new Amex.Window({modal:true,left:150,top:200,theme:"amexWindow",buttons:["close"],title:"print preview",trigger:"selectToPrint",onClose:function(){Print.closePreview(false);return true},shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});Print.preview.update($("#printPreviewDialog"));Print.preview.render("EstatementFormBean");
var c=$("#prPreviewCloseButton");if(c.length){c.on("click",function(){Print.closePreview(true)})}}Print.preview.setTriggerNode(f);var e=$("#"+Page.form.viewType).val();if(Pending.isOpen){Print.preview.setTriggerNode($("#selectToPrintPending"))}else{Print.preview.setTriggerNode($("#selectToPrint"))}Print.preview.centerInViewport();Print.preview.open()};Print.init=function(c,d){Print.createFrames();var e=d.object.id;var f=$('[id^="addReceiptLink_"],[id^="editRcptLink_"]');f.addClass("disableReceiptIcon");
if(e=="printIndividual"){Tag.close();Print.initIndividual()}else{if(e=="printCrtPage"){Tag.close();Print.initThisPage()}else{if(e=="printAllTrans"){Print.initAllTrans()}}}if($("#preferenceDisabled").val()=="false"){Print.showBlackStar=false;Print.showGoldStar=false;Print.showcurrSortSaveCol=false;if($("#listData").length){if($("#blackStar").length&&$("#blackStar").is(":visible")){$("#blackStar").hide();Print.showBlackStar=true}if($("#goldStar").length&&$("#goldStar").is(":visible")){$("#goldStar").hide();
Print.showGoldStar=true}if($("#currSortSaveCol").length&&$("#currSortSaveCol").is(":visible")){$("#currSortSaveCol").hide();Print.showcurrSortSaveCol=true}}}};Print.initIndividual=function(){Print.createFrames();Amex.PageOverlay.setIgnoreHide(true);Amex.PageOverlay.show();Print.openPrintMode();Print.individualPrintMode=true;Amex.Util.hideElements("summaryTable","closingDate","tbldis","cmSnapshot","footNotes");Amex.Util.showElements("prntHead","prntInd");List.enablePrintMode();$("#"+Print.printReq).val("A");
Omniture.report("print_individual");var c=$("#prtIndvTopCloseID");if(c.length){c.focus()}$("#selectToPrintBottom").on("keydown",function(d){if(Amex.KEY_TAB==d.which&&!d.shiftKey){d.stopPropagation();c.focus()}});c.on("keydown",function(d){if(Amex.KEY_TAB==d.which&&d.shiftKey){d.stopPropagation();$("#selectToPrintBottom").focus()}})};Print.initThisPage=function(){Print.createFrames();Amex.PageOverlay.setIgnoreHide(true);Amex.PageOverlay.show();Print.openPrintMode();Amex.Util.hideElements("listNavButtonsTop","listNavButtonsBottom");
Amex.Util.showElements("prtThisPage");Omniture.report("print_page");var d=$("#printCloseButton");if(d.length){d.focus()}var c=$("#iroc_"+(($("#pgEndRow").val())));c.on("keydown",Print.focusLast);$("#printCloseButton").on("keydown",function(e){if(Amex.KEY_TAB==e.which&&e.shiftKey){e.stopPropagation();c.focus()}})};Print.printThisPage=function(){Print.createFrames();Print.printTrigger="topLinkPrint";Print.print($("#dataWrapper").html());Print.closePrintMode()};Print.initAllTrans=function(){Print.createFrames();
if(Print.allWindow==null){Print.allWindow=new Amex.Window({modal:true,left:150,top:200,theme:"amexWindow",buttons:["close"],onClose:function(){$(Print.printReq).value="";if($("#preferenceDisabled").val()=="false"){Print.manageIcons()}return true},title:"print all transactions",trigger:"topLinkPrint",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});Print.allWindow.update($("#printlayer").html());Print.allWindow.render("EstatementFormBean")
}if($("#bPIndex").val()=="0"||$("#bPIndex").val()=="-97"){if(!$("#printPendId").length){var c=$("<div/>").attr("id","printPendId");var e=document.createTextNode("Pending charges will not be included in the PDF");c.append(e);$("#printAlltransP").append(c)}}else{if($("#printPendId").length){$("#printPendId").remove()}}$("#printType").val("A");var d=$("#disableETDDwnld");if(d.val()=="Y"){$("#sel").attr("disabled",true)}else{$("#sel").attr("checked",false)}Print.allWindow.centerInViewport();Print.allWindow.open()
};Print.printAllTran=function(){Print.createFrames();Download.init();$("#dwnloadtrna").prop("checked",true);if($("#downloadTypeAdobe").is(":disabled")==true){$("#downloadTypeAdobe").removeAttr("disabled")}$("#downloadTypeAdobe").prop("checked",true);var c=$('[id^="addReceiptLink_"],[id^="editRcptLink_"]');c.removeClass("disableReceiptIcon");if($("#sel").is(":checked")){if($("#totalTrans").val()>5000){Amex.Msg.alert(Amex.Msg.information,Download.refineMsg,true,null);Omniture.report("print_all","Refine");
return false}else{$("#downloadWithETD").prop("checked",true);Omniture.report("print_all","AllDetails");Print.allWindow.close();if($("#preferenceDisabled").val()=="false"){Print.manageIcons()}Download.submit()}}else{if($("#sel").is(":checked")==false){if($("#totalTrans").val()>100000){Amex.Msg.alert(Amex.Msg.information,Download.refineMsg,true,null);Omniture.report("print_all","AllDetails>Refine");return false}else{$("#downloadWithETD").prop("checked",false);Print.allWindow.close();if($("#preferenceDisabled").val()=="false"){Print.manageIcons()
}Omniture.report("print_all");Download.submit()}}}};Print.openPrintMode=function(){Print.createFrames();var l=$("#"+Page.form.viewType).val();Print.inPrintMode=true;$("#listDataWrapper").addClass("printThisPageMode");if(l=="L"){var h=$("#_dataWrapper");h.css({width:h.width()+"px",height:h.height()+"px"});h=$("#dataWrapper");h.css({position:"absolute",width:h.width()+"px",height:h.height()+"px",zIndex:6003});var e=(($("#bPIndex").val()=="0")||($("#bPIndex").val()=="-97"));if(e){Amex.Util.hideElements("listNavRPTop","listNavRPBottom","listMsg")
}else{Amex.Util.hideElements("listNavRPTop","listNavRPBottom","recentTransaction")}}else{if(l=="S"){var h=$("#_mainContentDataSummary");h.css({width:h.width()+"px",height:h.height()+"px"});h=$("#mainContentDataSummary");h.css({position:"absolute",width:h.width()+"px",zIndex:6003});Amex.Util.hideElements("summaryTableOuter","tbldis","listNavRPTop","listNavRPBottom","listMsg")}else{if(l=="G"){var h=$("#_mainContentDataSummary");h.css({width:h.width()+"px",height:h.height()+"px"});h=$("#mainContentDataSummary");
h.css({position:"absolute",width:h.width()+"px",zIndex:6003});Amex.Util.hideElements("graphTop","tbldis","listNavRPTop","listNavRPBottom","cmPrev_img","cmNext_img")}}}Amex.Util.hideElements("tbllinks","disputelnk","listNavRP","aprlnk","vwbill","odsLink","intChargelink","cmPrev_img","cmNext_img");var f=$("#numberOfPages");var c=$("#pageNumTop");if(f.length>0&&c.length>0&&f.val()!=c.val()){Amex.Util.hideElements("summaryTable","closingDate","cmSnapshot")}};Print.closePrintMode=function(){Print.inPrintMode=false;
Print.individualPrintMode=false;var f=$('[id^="addReceiptLink_"],[id^="editRcptLink_"]');f.removeClass("disableReceiptIcon");var d=$("#_mainContentDataSummary");if(d.length){d.css({position:"",width:"auto",height:"auto",zIndex:-1})}d=$("#mainContentDataSummary");if(d.length){d.css({position:"",width:"auto",height:"auto",zIndex:-1})}$("#listData").removeClass("printMode");d=$("#_dataWrapper");if(d.length){d.css({width:"auto",height:"auto"});if($("#dataWrapper").length){$("#dataWrapper").css({position:"",width:"auto",height:"auto",zIndex:-1})
}}Amex.Util.showElements("summaryTable","closingDate","graphTop","tbllinks","tbldis","summaryTableOuter","cmSnapshot","disputelnk","listNavButtonsTop","listNavButtonsBottom","listNavRPTop","listNavRPBottom","aprlnk","vwbill","footNotes","odsLink","intChargelink","recentTransaction","recentTrans","cmPrev","cmNext","cmPrev_img","cmNext_img","listMsg");if($("#preferenceDisabled").val()=="false"){if($("#listData").length){if($("#blackStar").length&&Print.showBlackStar){$("#blackStar").show()}if($("#goldStar").length&&Print.showGoldStar){$("#goldStar").show()
}if($("#currSortSaveCol").length&&Print.showcurrSortSaveCol){$("#currSortSaveCol").show()}}}Amex.Util.hideElements("prntHead","prtThisPage","tagSection","prntInd");List.table.uncheckAll();List.disablePrintMode();$("#listDataWrapper").removeClass("printThisPageMode");Amex.PageOverlay.setIgnoreHide(false);Amex.PageOverlay.hide();$("#topLinkPrint").focus();var c=$("#iroc_"+(($("#pgEndRow").val())));if(c.length){c.unbind("keydown",Print.focusLast)}};Print.printSelected=function(c){Print.createFrames();
var d=false;var f=false;var e=true;if(List.table.hasSelected()){$.each(List.table.selected,function(l,m){var h=m.id.split("_")[0];if(h=="proc"&&$("#recentTrans").hasClass("expanded")){d=true;e=false}if(h=="roc"){f=true;e=false}});if(e){Amex.Msg.alert(Amex.Msg.information,"You must select at least one transaction to print.",true,null,350);Amex.Msg.setTriggerNode(c.id)}else{$("#"+Print.printReq).val("A");Print.extendedROC(c,false,d,f)}}else{Amex.Msg.alert(Amex.Msg.information,"You must select at least one transaction to print.",true,null,350);
Amex.Msg.setTriggerNode(c.id)}};Print.print=function(c){Print.createFrames();var e=document.getElementById("printFrame");if(e){var d=e.contentWindow||e.contentDocument;if(d.document){d=d.document}d=d.body;$(d).html(c)}frames.printFrame.focus();frames.printFrame.print();if(Print.printTrigger){$("#"+Print.printTrigger).focus()}Print.printTrigger=null};Print.focusLast=function(c){if(Amex.KEY_TAB==c.which&&!c.shiftKey){c.stopPropagation();$("#printCloseButton").focus()}};Print.createFrames=function(){var d=$("#printPreviewFrame");
if(d.length==0){$("#printPreviewDiv").html("<iframe src='"+$("#locStaticRoot").val()+"/print_doc.html' id='printPreviewFrame' name='printPreviewFrame' class='previewFrame' frameborder='0' marginwidth='0' marginheight='0' scrolling='yes'></iframe>")}var c=$("#printFrame");if(c.length==0){$("#printFrameDiv").html("<iframe id='printFrame' name='printFrame' disabled='true' src='"+$("#locStaticRoot").val()+"/print_doc.html' height='0' width='0' style='opacity:0.0;filter:alpha(opacity=0)'></iframe>")}};
Print.manageIcons=function(){if($("#listData").length){if($("#blackStar").length&&Print.showBlackStar){$("#blackStar").show();Print.showBlackStar=false}if($("#goldStar").length&&Print.showGoldStar){$("#goldStar").show();Print.showGoldStar=false}if($("#currSortSaveCol").length&&Print.showcurrSortSaveCol){$("#currSortSaveCol").show();Print.showcurrSortSaveCol=false}}};Print.closeShoeBoxPreview=function(c){if(c){Print.shoeBoxPreview.close()}if(ReceiptUI.isMatchShoeboxView){ReceiptUI.matchReceiptWindow.open();
ReceiptUI.matchReceiptWindow._focus.focus()}else{if(!ReceiptUI.isMatchShoeboxView){ReceiptUI.unmatchReceiptWindow.open();ReceiptUI.unmatchReceiptWindow._focus.focus()}}$(Print.printReq).value=""};Print.openShoeBoxPreview=function(){Print.createFrames();if(Print.shoeBoxPreviewHTML==null){Print.shoeBoxPreviewHTML=$("#shoeBoxPrint").html();$("#shoeBoxPrint").remove()}if(ReceiptUI.matchReceiptWindow!=null){ReceiptUI.matchReceiptWindow.close()}if(ReceiptUI.unmatchReceiptWindow!=null){ReceiptUI.unmatchReceiptWindow.close()
}if(Print.shoeBoxPreview==null){Print.shoeBoxPreview=new Amex.Window({modal:true,left:150,top:200,theme:"amexWindow",buttons:["close"],title:"print preview",onClose:function(){if(ReceiptUI.isMatchShoeboxView){ReceiptUI.matchReceiptWindow.open();ReceiptUI.matchReceiptWindow._focus.focus()}else{if(!ReceiptUI.isMatchShoeboxView){ReceiptUI.unmatchReceiptWindow.open();ReceiptUI.unmatchReceiptWindow._focus.focus()}}Print.closePreview(false);return true},shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});
Print.shoeBoxPreview.render("EstatementFormBean")}Print.shoeBoxPreview.update(Print.shoeBoxPreviewHTML);Print.shoeBoxPreview.centerInViewport();Print.shoeBoxPreview.open();Print.shoeBoxPreview._focus.focus();Receipt.initPrintEvents()};Print.printShoeBoxPage=function(){Print.createFrames();Print.printTrigger="printSbInd";Print.print($("#shoeBoxPreviewDiv").html())};Print.printZoomImg=function(c){Print.createFrames();c.preventDefault();Print.printTrigger="rcPrintZoom";Omniture.report("RC_zoom_print");
Print.print($("#zoomedImg").html())};var Pending={isOpen:false,isHelpOpen:false,lastSelectedDesc:null,messages:{previewLoad:"Please wait. Loading preview data ...",pendingMsgLoadFail:"We are currently experiencing difficulties retrieving your transactions. Please try again shortly.",previewFail:"We are experiencing intermittent delays. Please try again later.",foreignTransMsg:"The Pending Charges view shows charges, including pre-authorizations, made in US Dollars that haven't been posted to your account yet. Once a charge is posted to your account as a purchase, it's removed from this view and you can see it in the Recent Activity view.",preauthorizationsMsg:"A pre-authorization is a type of pending charge: a merchant may pre-authorize an amount before you make a purchase (such as a hotel at check-in), then submit a final charge later (like at hotel check-out). That final charge amount is often different from the merchant's pre-authorized amount. Another type of pending charge is a purchase that was approved, but won't be posted to your account until later. Keep in mind, a charge may be pending for a few days, but these charges do not incur any interest until they are posted to your account.",outsBalanceMsg:"Pending charges don't accrue interest or increase your outstanding balance. We increase your outstanding balance, and may begin assessing interest, once the pending charge is removed and a purchase is posted to your account.",creditsMsg:"We don't issue credits for pending charges because they don't increase your outstanding balance. Most pending charges are removed at the end of the day by posting a purchase to your account. This is what happens, for example, when a merchant that has submitted a pre-authorization submits the final charge amount. If a merchant submits a pre-authorization but doesn't submit a final charge amount within 4 days, we remove the pending charge without posting a purchase to your account.",helpMessage:"<h2>Pending Charges</h2><p>Pending Charges are purchases or pre-authorizations that haven't been posted to your account yet. For example, a hotel may pre-authorize an amount at check in, then submit the final charge at check out. Only the final charge will increase your Outstanding Balance or accrue interest.</p>",blank:""},init:function(){Pending.createPendingSpinLoad()
},open:function(){Pending.init();Pending.pendingCharges();Pending.isHelpOpen=false;return Pending}};Pending.createPendingSpinLoad=function(){$('tbody[id*="proc"]').remove();var l=0;if(channelType==="M"){l=$("#tableHeaderBox").find("td:visible").length}else{l=$("#listHead").find("th:visible").length}var d=$("<tbody/>").attr("id","PendingWinLoad").addClass("pendingWindowLoad");var n=$("<tr/>");var m=$("<td/>").attr({colSpan:l,align:"middle",style:{padding:"6px 5px 0px"}});var c=$("<div/>").attr("id","pendLoadMsg");
var h=$("<img src='"+$("#locImages").val()+"/loading.gif' alt='loading...' title='loading'>");var f=$("<br/>");var e=document.createTextNode("loading...Please wait");c.append(h);c.append(f);m.append(c);n.append(m);d.append(n);$("#pendingHdr").after(d)};Pending.RemoveRows=function(){$("#pendinghelp-tbody").remove();$('#listData>tbody[id^="proc_"]').remove();if($("#PendingWinLoad").length!=0){$("#PendingWinLoad").remove()}if($(".noPendingMatch").length!=0){$(".noPendingMatch").remove()}};Pending.pendingCharges=function(){$("#pendingRequest").val("Y");
if($("#pendingTransCount").length&&$("#pendingTransCount").val()!=""){$("#pendingItems").html("");$("#pendingTransCount").val("")}if(!$("#recentTrans").hasClass("expanded")){$("#recentTrans").addClass("expanded")}var d=0;if(channelType==="M"){d=$("#tableHeaderBox").find("td:visible").length}else{d=$("#listHead").find("th:visible").length}var e=[];e=formParameters.getParams("pendingCharges.do");if(channelType==="M"){for(var c=0;c<e.length;c++){if(e[c].name==="keyWord"){e[c].value="";break}}}new $.ajax("pendingCharges.do",{asynchronous:true,evalJS:false,evalJSON:false,type:"POST",data:e,success:function(t,p,o){if(o.getResponseHeader("MYCAError")==null){Pending.RemoveRows();
if(channelType!=="M"){var s=o.responseText;if(/msie[9]./.test(navigator.userAgent.toLowerCase())){var u=new RegExp(">[ \t\r\n\v\f]*<","g");s=s.replace(u,"><")}$("#pendingHdr").after(s);var n=$("#pendingListResponse").val();n=n.replace(/&#39;/g,"'").replace(/&apos;/g,"'");var q=JSON.parse(n);q.channelType=channelType;var h=$.jcp("run","@list/pending",q);$("#proc_hiddenVar").after(h)}var m=$("#startDate").val();var r=$("#endDate").val();if(m!=null&&r!=null){m=m.slice(-4);r=r.slice(-4);if(m==r){$(".estmt-year").hide()
}}if(channelType==="M"){var h=$.jcp("run","@list/pending",t);$("#pendingHdr").after(h);if($("#searchText").val()!=null&&$("#searchText").val().length>0){if($("#listData").find(".pendingErrorDisplay").length>0){$(".pendingErrorDisplay").hide();$(".pendingerrors").remove();if($(".pendingerrors").length<1){var l=$(List_mb.pendingError);$("#pendingHdr").after(l).trigger("create").show()}}else{var f=List_mb.addMark($("#searchText").val(),"pendingSearch",null);List_mb.pendingMatchedElement(f)}}else{List_mb.showingText("pending",t.paginationData.totalTrans,t.paginationData.endRow)
}}$("#proc_items").find("td").attr("colspan",d);$("#proc_total").find("td").attr("colspan",d);$("#proc_error").find("td").attr("colspan",d);if($("#pendingItems").length&&$("#pendingTransCnt").length){if($("#pendingTransCnt").val()!="0 Items"){$("#pendingItems").html($("#pendingTransCnt").val());$("#pendingTransCount").val($("#pendingTransCnt").val());if($("#pendingTransCnt").val()==""){UIController.updatePrint()}}else{$("#pendingItems").html("");$("#pendingTransCount").val("")}}if($("#pendingTransCnt").length&&$("#pendingTransCnt").val()!=""){if($("#refreshCache").length){$("#refreshCache").val(false)
}}Omniture.report("list_pending_success")}else{$("#pendingItems").html("");$("#pendingTransCount").val("");if($("#pendingOpen").val()=="true"){$("#pendLoadMsg").addClass("pendingErrorResultsDisplay");$("#pendLoadMsg").html(Pending.messages.pendingMsgLoadFail);UIController.updatePrint()}else{UIController.updatePrint();Amex.Msg.error("error processing request",o.responseText,true,null)}Omniture.report("list_pending_failure")}},error:function(f){$("#pendingItems").html("");$("#pendingTransCount").val("");
if($("#pendingOpen").val()=="true"){$("#pendLoadMsg").addClass("pendingErrorResultsDisplay");$("#pendLoadMsg").html(Pending.messages.pendingMsgLoadFail);UIController.updatePrint()}else{UIController.updatePrint();Amex.Msg.error("error processing request",f.responseText,true,null)}Omniture.report("list_pending_failure")}});$("#listJson").val("false");$("#pendingRequest").val("N");$("#sortClicked").val(false)};Pending.initDisclosure=function(c){if($("#foreigntrans").length){$("#foreigntrans").on("click",function(d){d.preventDefault();
Pending.updateDisclosure(Pending.messages.foreignTransMsg);Pending.lastSelectedDesc=$("#foreigntrans");$("#foreigntrans").addClass("displayArrow")})}if($("#preauth").length){$("#preauth").on("click",function(d){d.preventDefault();Pending.updateDisclosure(Pending.messages.preauthorizationsMsg);$("#preauth").addClass("displayArrow");Pending.lastSelectedDesc=$("#preauth")})}if($("#credits").length){$("#credits").on("click",function(d){d.preventDefault();Pending.updateDisclosure(Pending.messages.creditsMsg);
$("#credits").addClass("displayArrow");Pending.lastSelectedDesc=$("#credits")})}if($("#outsbalance").length){$("#outsbalance").on("click",function(d){d.preventDefault();Pending.updateDisclosure(Pending.messages.outsBalanceMsg);$("#outsbalance").addClass("displayArrow");Pending.lastSelectedDesc=$("#outsbalance")})}};Pending.updateDisclosure=function(c){$("#disclosureText").html(c);$("#statementdetails").addClass("disclosureDescBg");$("#foreigntrans").removeClass("displayArrow");if(Pending.lastSelectedDesc!=null){Pending.lastSelectedDesc.removeClass("displayArrow")
}};Pending.RemovePendingCountItems=function(){if($("#pendingItems").length){$("#pendingItems").html("");$("#pendingTransCount").val("")}}
/*
* jQuery Form Plugin
* version: 3.14 (30-JUL-2012)
* @requires jQuery v1.3.2 or later
*
* Examples and documentation at: http://malsup.com/jquery/form/
* Project repository: https://github.com/malsup/form
* Dual licensed under the MIT and GPL licenses:
* http://malsup.github.com/mit-license.txt
* http://malsup.github.com/gpl-license-v2.txt
*/
;(function(h){var e={};
e.fileapi=h("<input type='file'/>").get(0).files!==undefined;e.formdata=window.FormData!==undefined;h.fn.ajaxSubmit=function(m){Receipt.rcUploadStartTime=(new Date()).getTime();if(ReceiptUI.isInlineAdd){Omniture.report("RC_Continue_ETD")}else{Omniture.report("RC_add_continue_unmatched")}if(!this.length){f("ajaxSubmit: skipping submit process - no element selected");return this}var l,E,p,t=this;if(typeof m=="function"){m={success:m}}l=this.attr("method");E=this.attr("action");p=(typeof E==="string")?h.trim(E):"";
p=p||window.location.href||"";if(p){p=(p.match(/^([^#]+)/)||[])[1]}m=h.extend(true,{url:p,success:h.ajaxSettings.success,type:l||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",uploadProgress:true},m);var z={};this.trigger("form-pre-serialize",[this,m,z]);if(z.veto){f("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(m.beforeSerialize&&m.beforeSerialize(this,m)===false){f("ajaxSubmit: submit aborted via beforeSerialize callback");
return this}var r=m.traditional;if(r===undefined){r=h.ajaxSettings.traditional}var x=[];var H,I=this.formToArray(m.semantic,x);if(m.data){m.extraData=m.data;H=h.param(m.data,r)}if(m.beforeSubmit&&m.beforeSubmit(I,this,m)===false){f("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[I,this,m,z]);if(z.veto){f("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var C=h.param(I,r);if(H){C=(C?(C+"&"+H):H)}if(m.type.toUpperCase()=="GET"){m.url+=(m.url.indexOf("?")>=0?"&":"?")+C;
m.data=null}else{m.data=C}var K=[];if(m.resetForm){K.push(function(){t.resetForm()})}if(m.clearForm){K.push(function(){t.clearForm(m.includeHidden)})}if(!m.dataType&&m.target){var n=m.success||function(){};K.push(function(L){var q=m.replaceTarget?"replaceWith":"html";h(m.target)[q](L).each(n,arguments)})}else{if(m.success){K.push(m.success)}}m.success=function(O,L,P){var N=m.context||this;for(var M=0,q=K.length;M<q;M++){K[M].apply(N,[O,L,P||t,t])}};var G=h("input:file:enabled",this);var u=G.length>0;
var F="multipart/form-data";var B=(t.attr("enctype")==F||t.attr("encoding")==F);var A=e.fileapi&&e.formdata;f("fileAPI :"+A);var w=(u||B)&&!A;var s=G.val().trim();if(m.iframe!==false&&(m.iframe||w)){if(m.closeKeepAlive){h.get(m.closeKeepAlive,function(){J(I)})}else{var o=v(s);if(o){h("#addMessage").html("");h("#addError").hide();J(I)}}}else{if((u||B)&&A){var o=v(s);if(o){y(I)}}else{h.ajax(m)}}for(var D=0;D<x.length;D++){x[D]=null}this.trigger("form-submit-notify",[this,m]);return this;function y(L){var q=new FormData();
for(var M=0;M<L.length;M++){q.append(L[M].name,L[M].value)}if(m.extraData){for(var P in m.extraData){if(m.extraData.hasOwnProperty(P)){q.append(P,m.extraData[P])}}}m.data=null;var O=h.extend(true,{},h.ajaxSettings,m,{contentType:false,processData:false,cache:false,timeout:300000,type:"POST"});if(m.uploadProgress){O.xhr=function(){var Q=jQuery.ajaxSettings.xhr();if(Q.upload){Q.upload.onprogress=function(U){var T=0;var R=U.loaded||U.position;var S=U.total;var V=false;if(U.lengthComputable){T=Math.ceil(R/S*100);
if(navigator.userAgent.toLowerCase().indexOf("safari")==-1||navigator.userAgent.toLowerCase().indexOf("chrome")!=-1){if(!V){h("#selector").progressbar({value:T});h("#progressVal").html(T+"% completed.")}else{if(T==100){h("#selector").progressbar({value:100});h("#progressVal").html("100% completed.");V=true}}}}m.uploadProgress(U,R,S,T)}}return Q}}O.data=null;var N=O.beforeSend;O.beforeSend=function(R,Q){Q.data=q;if(N){N.call(this,R,Q)}};h.ajax(O).done(function(Q){var R=Q;if(Q.constructor===String){Q=decodeURIComponent(Q);
R=h.parseJSON(Q)}Receipt.rcUploadEndTime=(new Date()).getTime();if(R.responseCode==200){if(navigator.userAgent.toLowerCase().indexOf("safari")==-1||navigator.userAgent.toLowerCase().indexOf("chrome")!=-1){h("#selector").progressbar({value:100});h("#progressVal").html("Updating..")}if(ReceiptUI.isInlineAdd){if(R.receipt.fitID!=null&&R.receipt.fitID!=""&&R.receipt.receiptID!=null){Receipt.updateEMS(R)}else{if(ReceiptUI.renderAddReceiptWindow!=null){ReceiptUI.renderAddReceiptWindow.close()}Receipt.logRCUploadTime(R.responseCode,null,R.receipt.receiptID);
Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}else{Receipt.updateShoebox(R)}}else{if(ReceiptUI.renderAddReceiptWindow!=null){ReceiptUI.renderAddReceiptWindow.close()}Receipt.logRCUploadTime(R.responseCode,null,null);Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}).fail(function(Q){Receipt.rcUploadEndTime=(new Date()).getTime();if(ReceiptUI.renderAddReceiptWindow!=null){ReceiptUI.renderAddReceiptWindow.close()}Receipt.logRCUploadTime(null,Q.statusText,null);
if(Q.statusText=="timeout"){Amex.Msg.error("error processing request","Request timed out",true,null)}else{Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})}function v(R){var Q=document.getElementById("file");var L=Q.files;var q=false;var O="";var U="";var M="";var N=["pdf","gif","jpeg","jpg","png","doc","docx","html","txt","rtf"];if(R){var T=R.lastIndexOf("\\");if(T!=-1){R=R.substr(T+1).toLowerCase()}U=R.lastIndexOf(".");if(U!=-1){M=R.substr(U+1).toLowerCase();for(var P=0;
P<N.length;P++){if(N[P]==M){q=false;break}else{q=true}}}}if(!h.browser.msie){var S=L.length;for(var P=0;P<S;P++){if(L[P].size>"5242880"){q=true}else{O=((L[P].size)/(1024*1024)).toFixed(2);O=O+"MB"}}}if(R==""){h("#addMessage").html(ReceiptUI.fileExistError);h("#addError").show();return false}else{if(q){h("#addMessage").html(ReceiptUI.fileSizeError);h("#addError").show();return false}else{h("#addMessage").html("");h("#addError").hide();h("#uploadform").hide();h("#uploading").show();if(h.browser.msie||(h.browser.webkit&&navigator.userAgent.toLowerCase().indexOf("chrome")==-1)){h("#receiptUploadDivField1").show()
}else{h("#progress").show();h("#selector").progressbar({disabled:false})}h("#fileName").html(R);h("#size").html(O);h("#selectReceiptLink").hide();h("#selectReceiptLinkDis").show();h("#addReceiptButtons").addClass("overlayOpacity");h("#cancelbutton").addClass("overlayButton");h("#uploadbutton").addClass("overlayButton");h("#cancelbutton").attr("disabled",true);h("#uploadbutton").attr("disabled",true);h("#existingReceipt").addClass("overlayOpacity");return true}}}function J(an){var P=t[0],O,ah,ab,ak,ae,R,W,T,U,af,ai,aa;
var S=!!h.fn.prop;if(h(":input[name=submit],:input[id=submit]",P).length){alert('Error: Form elements must not have name or id of "submit".');return}if(an){for(ah=0;ah<x.length;ah++){O=h(x[ah]);if(S){O.prop("disabled",false)}else{O.removeAttr("disabled")}}}var ab=h.extend(true,{},h.ajaxSettings,m,{timeout:300000});ab.context=ab.context||ab;ae="jqFormIO"+(new Date().getTime());if(ab.iframeTarget){R=h(ab.iframeTarget);af=R.attr("name");if(!af){R.attr("name",ae)}else{ae=af}}else{R=h('<iframe name="'+ae+'" src="'+ab.iframeSrc+'" />');
R.css({position:"absolute",top:"-1000px",left:"-1000px"})}W=R[0];var am=document.location.pathname;var aj=am.substring(0,am.lastIndexOf("/"));var V="https://"+document.URL.split("/")[2]+h("#locStaticRoot").val()+"/redirect.html";T={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(aq){var ar=(aq==="timeout"?"timeout":"aborted");f("aborting upload... "+ar);this.aborted=1;
if(h.browser.msie){try{R.attr("src","");if(parent.ReceiptUI.renderAddReceiptWindow!=null){parent.ReceiptUI.renderAddReceiptWindow.close();Receipt.resetAddReceiptLayer()}parent.Amex.Msg.error("error processing request",parent.ReceiptUI.genericError,true,null);return}catch(at){console.info("Failed aborting upload")}}R.attr("src",ab.iframeSrc);T.error=ar;if(ab.error){ab.error.call(ab.context,T,ar,aq)}if(ak){h.event.trigger("ajaxError",[T,ab,ar])}if(ab.complete){ab.complete.call(ab.context,T,ar)}}};ak=ab.global;
if(ak&&0===h.active++){h.event.trigger("ajaxStart")}if(ak){h.event.trigger("ajaxSend",[T,ab])}if(ab.beforeSend&&ab.beforeSend.call(ab.context,T,ab)===false){if(ab.global){h.active--}return}if(T.aborted){return}U=P.clk;if(U){af=U.name;if(af&&!U.disabled){ab.extraData=ab.extraData||{};ab.extraData[af]=U.value;if(U.type=="image"){ab.extraData[af+".x"]=P.clk_x;ab.extraData[af+".y"]=P.clk_y}}}var Z=1;var X=2;function Y(ar){var aq=W.contentWindow||W.contentDocument;return aq}var N=h("meta[name=csrf-token]").attr("content");
var M=h("meta[name=csrf-param]").attr("content");if(M&&N){ab.extraData=ab.extraData||{};ab.extraData[M]=N}function ag(){var at=t.attr("target"),aq=t.attr("action");P.setAttribute("target",ae);if(!l){P.setAttribute("method","POST")}if(aq!=ab.url){P.setAttribute("action",ab.url)}var av=t.attr("action");P.setAttribute("action",av.concat("&redirectURL="+V));if(!ab.skipEncodingOverride&&(!l||/post/i.test(l))){t.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(ab.timeout){aa=setTimeout(function(){ai=true;
ad(Z)},ab.timeout)}function au(){try{var az=W.document;var ax=az.readyState;f("state = "+ax);if(ax&&ax.toLowerCase()=="uninitialized"){setTimeout(au,50)}}catch(ay){f("Server abort: ",ay," (",ay.name,")");ad(X);if(aa){clearTimeout(aa)}aa=undefined}}var ar=[];try{if(ab.extraData){for(var aw in ab.extraData){if(ab.extraData.hasOwnProperty(aw)){if(h.isPlainObject(ab.extraData[aw])&&ab.extraData[aw].hasOwnProperty("name")&&ab.extraData[aw].hasOwnProperty("value")){ar.push(h('<input type="hidden" name="'+ab.extraData[aw].name+'">').attr("value",ab.extraData[aw].value).appendTo(P)[0])
}else{ar.push(h('<input type="hidden" name="'+aw+'">').attr("value",ab.extraData[aw]).appendTo(P)[0])}}}}if(!ab.iframeTarget){R.appendTo("body");if(W.attachEvent){W.attachEvent("onload",function(){ad(0)})}else{W.addEventListener("load",function(){ad(0)},false)}}setTimeout(au,15);P.submit()}finally{P.setAttribute("action",aq);if(at){P.setAttribute("target",at)}else{t.removeAttr("target")}h(ar).remove()}}if(ab.forceSync){ag()}else{setTimeout(ag,10)}var ao,ap,al=50,Q;function ad(aw){if(T.aborted||Q){return
}try{ap=W.document}catch(az){f("cannot access response document: ",az);aw=X}if(aw===Z&&T&&ai){T.abort("timeout");return}else{if(aw==X&&T){T.abort("server abort");return}}if(!ap||ap.location.href==ab.iframeSrc){if(!ai){return}}if(W.detachEvent){W.detachEvent("onload",ad)}else{W.removeEventListener("load",ad,false)}var au="success",ay;try{if(ai){throw"timeout"}var at=ab.dataType=="xml"||ap.XMLDocument||h.isXMLDoc(ap);f("isXml="+at);if(!at&&window.opera&&(ap.body===null||!ap.body.innerHTML)){if(--al){f("requeing onLoad callback, DOM not available");
setTimeout(ad,250);return}}var aA=ap.body?ap.body:ap.documentElement;T.responseText=aA?aA.innerHTML:null;T.responseXML=ap.XMLDocument?ap.XMLDocument:ap;if(at){ab.dataType="xml"}T.getResponseHeader=function(aD){var aC={"content-type":ab.dataType};return aC[aD]};if(aA){T.status=Number(aA.getAttribute("status"))||T.status;T.statusText=aA.getAttribute("statusText")||T.statusText}var aq=(ab.dataType||"").toLowerCase();var ax=/(json|script|text)/.test(aq);if(ax||ab.textarea){var av=ap.getElementsByTagName("textarea")[0];
if(av){T.responseText=av.value;T.status=Number(av.getAttribute("status"))||T.status;T.statusText=av.getAttribute("statusText")||T.statusText}else{if(ax){var ar=ap.getElementsByTagName("pre")[0];var aB=ap.getElementsByTagName("body")[0];if(ar){T.responseText=ar.textContent?ar.textContent:ar.innerText}else{if(aB){T.responseText=aB.textContent?aB.textContent:aB.innerText}}}}}else{if(aq=="xml"&&!T.responseXML&&T.responseText){T.responseXML=ac(T.responseText)}}try{ao=q(T,aq,ab)}catch(aw){au="parsererror";
T.error=ay=(aw||au)}}catch(aw){f("error caught: ",aw);au="error";T.error=ay=(aw||au)}if(T.aborted){f("upload aborted");au=null}if(T.status){au=(T.status>=200&&T.status<300||T.status===304)?"success":"error"}if(au==="success"){if(ab.success){ab.success.call(ab.context,ao,"success",T)}if(ak){h.event.trigger("ajaxSuccess",[T,ab])}}else{if(au){if(ay===undefined){ay=T.statusText}if(ab.error){ab.error.call(ab.context,T,au,ay)}if(ak){h.event.trigger("ajaxError",[T,ab,ay])}}}if(ak){h.event.trigger("ajaxComplete",[T,ab])
}if(ak&&!--h.active){h.event.trigger("ajaxStop")}if(ab.complete){ab.complete.call(ab.context,T,au)}Q=true;if(ab.timeout){clearTimeout(aa)}setTimeout(function(){if(!ab.iframeTarget){R.remove()}T.responseXML=null},100)}var ac=h.parseXML||function(aq,ar){if(window.ActiveXObject){ar=new ActiveXObject("Microsoft.XMLDOM");ar.async="false";ar.loadXML(aq)}else{ar=(new DOMParser()).parseFromString(aq,"text/xml")}return(ar&&ar.documentElement&&ar.documentElement.nodeName!="parsererror")?ar:null};var L=h.parseJSON||function(aq){return window["eval"]("("+aq+")")
};var q=function(aw,au,at){var ar=aw.getResponseHeader("content-type")||"",aq=au==="xml"||!au&&ar.indexOf("xml")>=0,av=aq?aw.responseXML:aw.responseText;if(aq&&av.documentElement.nodeName==="parsererror"){if(h.error){h.error("parsererror")}}if(at&&at.dataFilter){av=at.dataFilter(av,au)}if(typeof av==="string"){if(au==="json"||!au&&ar.indexOf("json")>=0){av=L(av)}else{if(au==="script"||!au&&ar.indexOf("javascript")>=0){h.globalEval(av)}}}return av}}};h.fn.ajaxForm=function(l){l=l||{};l.delegation=l.delegation&&h.isFunction(h.fn.on);
if(!l.delegation&&this.length===0){var m={s:this.selector,c:this.context};if(!h.isReady&&m.s){f("DOM not ready, queuing ajaxForm");h(function(){h(m.s,m.c).ajaxForm(l)});return this}f("terminating; zero elements found by selector"+(h.isReady?"":" (DOM not ready)"));return this}if(l.delegation){h(document).off("submit.form-plugin",this.selector,d).off("click.form-plugin",this.selector,c).on("submit.form-plugin",this.selector,l,d).on("click.form-plugin",this.selector,l,c);return this}return this.ajaxFormUnbind().bind("submit.form-plugin",l,d).bind("click.form-plugin",l,c)
};function d(m){var l=m.data;if(!m.isDefaultPrevented()){m.preventDefault();h(this).ajaxSubmit(l)}}function c(p){var o=p.target;var m=h(o);if(!(m.is(":submit,input:image"))){var l=m.closest(":submit");if(l.length===0){return}o=l[0]}var n=this;n.clk=o;if(o.type=="image"){if(p.offsetX!==undefined){n.clk_x=p.offsetX;n.clk_y=p.offsetY}else{if(typeof h.fn.offset=="function"){var q=m.offset();n.clk_x=p.pageX-q.left;n.clk_y=p.pageY-q.top}else{n.clk_x=p.pageX-o.offsetLeft;n.clk_y=p.pageY-o.offsetTop}}}setTimeout(function(){n.clk=n.clk_x=n.clk_y=null
},100)}h.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};h.fn.formToArray=function(A,l){var z=[];if(this.length===0){return z}var p=this[0];var s=A?p.getElementsByTagName("*"):p.elements;if(!s){return z}var u,t,r,B,q,x,o;for(u=0,x=s.length;u<x;u++){q=s[u];r=q.name;if(!r){continue}if(A&&p.clk&&q.type=="image"){if(!q.disabled&&p.clk==q){z.push({name:r,value:h(q).val(),type:q.type});z.push({name:r+".x",value:p.clk_x},{name:r+".y",value:p.clk_y})}continue}B=h.fieldValue(q,true);
if(B&&B.constructor==Array){if(l){l.push(q)}for(t=0,o=B.length;t<o;t++){z.push({name:r,value:B[t]})}}else{if(e.fileapi&&q.type=="file"&&!q.disabled){if(l){l.push(q)}var m=q.files;if(m.length){for(t=0;t<m.length;t++){z.push({name:r,value:m[t],type:q.type})}}else{z.push({name:r,value:"",type:q.type})}}else{if(B!==null&&typeof B!="undefined"){if(l){l.push(q)}z.push({name:r,value:B,type:q.type,required:q.required})}}}}if(!A&&p.clk){var w=h(p.clk),y=w[0];r=y.name;if(r&&!y.disabled&&y.type=="image"){z.push({name:r,value:w.val()});
z.push({name:r+".x",value:p.clk_x},{name:r+".y",value:p.clk_y})}}return z};h.fn.formSerialize=function(l){return h.param(this.formToArray(l))};h.fn.fieldSerialize=function(m){var l=[];this.each(function(){var r=this.name;if(!r){return}var p=h.fieldValue(this,m);if(p&&p.constructor==Array){for(var q=0,o=p.length;q<o;q++){l.push({name:r,value:p[q]})}}else{if(p!==null&&typeof p!="undefined"){l.push({name:this.name,value:p})}}});return h.param(l)};h.fn.fieldValue=function(q){for(var p=[],n=0,l=this.length;
n<l;n++){var o=this[n];var m=h.fieldValue(o,q);if(m===null||typeof m=="undefined"||(m.constructor==Array&&!m.length)){continue}if(m.constructor==Array){h.merge(p,m)}else{p.push(m)}}return p};h.fieldValue=function(l,s){var o=l.name,z=l.type,A=l.tagName.toLowerCase();if(s===undefined){s=true}if(s&&(!o||l.disabled||z=="reset"||z=="button"||(z=="checkbox"||z=="radio")&&!l.checked||(z=="submit"||z=="image")&&l.form&&l.form.clk!=l||A=="select"&&l.selectedIndex==-1)){return null}if(A=="select"){var u=l.selectedIndex;
if(u<0){return null}var x=[],m=l.options;var q=(z=="select-one");var w=(q?u+1:m.length);for(var p=(q?u:0);p<w;p++){var r=m[p];if(r.selected){var y=r.value;if(!y){y=(r.attributes&&r.attributes.value&&!(r.attributes.value.specified))?r.text:r.value}if(q){return y}x.push(y)}}return x}return h(l).val()};h.fn.clearForm=function(l){return this.each(function(){h("input,select,textarea",this).clearFields(l)})};h.fn.clearFields=h.fn.clearInputs=function(l){var m=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;
return this.each(function(){var o=this.type,n=this.tagName.toLowerCase();if(m.test(o)||n=="textarea"){this.value=""}else{if(o=="checkbox"||o=="radio"){this.checked=false}else{if(n=="select"){this.selectedIndex=-1}else{if(l){if((l===true&&/hidden/.test(o))||(typeof l=="string"&&h(this).is(l))){this.value=""}}}}}})};h.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};h.fn.enable=function(l){if(l===undefined){l=true
}return this.each(function(){this.disabled=!l})};h.fn.selected=function(l){if(l===undefined){l=true}return this.each(function(){var m=this.type;if(m=="checkbox"||m=="radio"){this.checked=l}else{if(this.tagName.toLowerCase()=="option"){var n=h(this).parent("select");if(l&&n[0]&&n[0].type=="select-one"){n.find("option").selected(false)}this.selected=l}}})};h.fn.ajaxSubmit.debug=false;function f(){if(!h.fn.ajaxSubmit.debug){return}var l="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(l)
}else{if(window.opera&&window.opera.postError){window.opera.postError(l)}}}})(jQuery);var Receipt={selImg:null,enlargehtml:null,emailTitle:"Email Address",confirmEmailTitle:"Confirm Email Address",emailSkip:false,enrollmentStatus:null,emailUpdateError:false,emailExistingError:false,validEmail:false,cardList:null,periodList:null,emailEnrollType:"save",emailView:null,comment:null,uploadZoomUrl:null,duplicateEmail:false,uploadedReceipt:false,noteSaveStatus:false,receiptIdArray:[],rcUploadStartTime:null,rcUploadEndTime:null,rcValidAuthTokenStartTime:null,rcValidAuthTokenEndTime:3600,cardHash:"",tagObjJSON:null,serviceEmailID:null};
Receipt.init=function(){if(Receipt.rcValidAuthTokenStartTime==null||(((new Date()).getTime()-Receipt.rcValidAuthTokenStartTime)/1000>Receipt.rcValidAuthTokenEndTime)){Receipt.checkEnrollStatus()}else{Receipt.addViewReceipts()}return false};Receipt.isValidEmailAddress=function(c){var e;var d=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;if(d.test(c)){e=true}else{e=false}return e};Receipt.validateShoeboxEmail=function(){var f=$("#saveEmailId").val();var e=$("#saveConfirmEmailId").val();
var c=Receipt.isValidEmailAddress(f);var d=Receipt.isValidEmailAddress(e);if(Receipt.isDefaultEmailId(f)){Receipt.resetMatchedErrors();$("#sbEmailErrMsg").html(ReceiptUI.requiredEmailErrMsg);$("#shoeboxEmailErr").show();$("#saveEmailId").addClass("inputFieldError");return false}else{if(!Receipt.isDefaultEmailId(f)&&!Receipt.isValidEmailAddress(f)){Receipt.resetMatchedErrors();$("#sbEmailErrMsg").html(ReceiptUI.invalidEmailMsg);$("#shoeboxEmailErr").show();$("#saveEmailId").addClass("inputFieldError");
return false}else{if(Receipt.isDefaultConfirmEmailId(e)){Receipt.resetMatchedErrors();$("#sbEmailErrMsg").html(ReceiptUI.requiredEmailErrMsg);$("#shoeboxEmailErr").show();$("#saveConfirmEmailId").addClass("inputFieldError");return false}else{if(!Receipt.isDefaultConfirmEmailId(e)&&!Receipt.isValidEmailAddress(e)){Receipt.resetMatchedErrors();$("#sbEmailErrMsg").html(ReceiptUI.invalidEmailMsg);$("#shoeboxEmailErr").show();$("#saveConfirmEmailId").addClass("inputFieldError");return false}else{if((!Receipt.isDefaultEmailId(f)&&f!="")||(!Receipt.isDefaultEmailId(e)&&e!="")){if(f!=e){Receipt.resetMatchedErrors();
$("#sbEmailErrMsg").html(ReceiptUI.emailAddressNotMatchErrMsg);$("#shoeboxEmailErr").show();$("#saveEmailId").addClass("inputFieldError");$("#saveConfirmEmailId").addClass("inputFieldError");return false}}}}}}return true};Receipt.validateEnrollEmail=function(){var f=$("#emailId").val();var e=$("#confirmEmailId").val();var c=Receipt.isValidEmailAddress(f);var d=Receipt.isValidEmailAddress(e);if(Receipt.isDefaultEmailId(f)){Receipt.resetEnrollmentErrors();$("#enrollmentErrMsg").html(ReceiptUI.requiredEmailErrMsg);
$("#enrollmentErr").show();$("#emailId").addClass("inputFieldError");return false}else{if(!Receipt.isDefaultEmailId(f)&&!Receipt.isValidEmailAddress(f)){Receipt.resetEnrollmentErrors();$("#enrollmentErrMsg").html(ReceiptUI.invalidEmailMsg);$("#enrollmentErr").show();$("#emailId").addClass("inputFieldError");return false}else{if(Receipt.isDefaultConfirmEmailId(e)){Receipt.resetEnrollmentErrors();$("#enrollmentErrMsg").html(ReceiptUI.requiredEmailErrMsg);$("#enrollmentErr").show();$("#confirmEmailId").addClass("inputFieldError");
return false}else{if(!Receipt.isDefaultConfirmEmailId(e)&&!Receipt.isValidEmailAddress(e)){Receipt.resetEnrollmentErrors();$("#enrollmentErrMsg").html(ReceiptUI.invalidEmailMsg);$("#enrollmentErr").show();$("#confirmEmailId").addClass("inputFieldError");return false}else{if((!Receipt.isDefaultEmailId(f)&&f!="")||(!Receipt.isDefaultEmailId(e)&&e!="")){if(f!=e){Receipt.resetEnrollmentErrors();$("#enrollmentErrMsg").html(ReceiptUI.emailAddressNotMatchErrMsg);$("#enrollmentErr").show();$("#emailId").addClass("inputFieldError");
$("#confirmEmailId").addClass("inputFieldError");return false}}}}}}if(!($("#tcChkBox").is(":checked"))){Receipt.resetEnrollmentErrors();$("#enrollmentErrMsg").html(ReceiptUI.termsAndCondErrMsg);$("#enrollmentErr").show();return false}return true};Receipt.resetEnrollmentLayer=function(){$("#enrollmentErr").hide();if($("#emailId").hasClass("inputFieldError")){$("#emailId").removeClass("inputFieldError")}if($("#confirmEmailId").hasClass("inputFieldError")){$("#confirmEmailId").removeClass("inputFieldError")
}$("#tcChkBox").removeAttr("checked")};Receipt.resetEnrollmentErrors=function(){$("#enrollmentErr").hide();if($("#emailId").hasClass("inputFieldError")){$("#emailId").removeClass("inputFieldError")}if($("#confirmEmailId").hasClass("inputFieldError")){$("#confirmEmailId").removeClass("inputFieldError")}};Receipt.resetMatchedLayer=function(){if(ReceiptDropDown.card!=null){ReceiptDropDown.card.options.menu.close();ReceiptDropDown.card.destroy()}if(ReceiptDropDown.period!=null){ReceiptDropDown.period.options.menu.close();
ReceiptDropDown.period.destroy()}$("#showTerms").hide();$("#toggleTerms_col").hide();$("#toggleTerms_exp").show();$("#iFeedback").show();$("#closeMatchedButton_top").show();$("#shoeboxAddReceiptLink").hide();Receipt.resetMatchedFields()};Receipt.resetMatchedFields=function(){$("#shoeboxEmailErr").hide();$("#shoeboxErr").hide();if($("#saveEmailId").hasClass("inputFieldError")){$("#saveEmailId").removeClass("inputFieldError")}if($("#saveConfirmEmailId").hasClass("inputFieldError")){$("#saveConfirmEmailId").removeClass("inputFieldError")
}$("#displayEmailBlock").show();$("#emailEditBlock").hide();if($("#emailAddress").val()!=""){$("#hasEmailBlock").show();$("#noEmailBlock").hide();Receipt.emailEnrollType="update"}else{$("#noEmailBlock").show();$("#hasEmailBlock").hide();Receipt.emailEnrollType="save"}};Receipt.resetUnmatchedLayer=function(){$("#showTerms_unmatch").hide();$("#unMatchTerms_col").hide();$("#unMatchTerms_exp").show();$("#closeUnmatchedButton_bottom").hide();$("#closeUnmatchedButton_top").show();$("#unmatchedFeedback_bottom").hide();
$("#unmatchedFeedback").show();$("#unMatchButtons").show();$("#unmatchedAddReceiptLink").hide()};Receipt.resetMatchedErrors=function(){$("#shoeboxEmailErr").hide();$("#shoeboxErr").hide();if($("#saveEmailId").hasClass("inputFieldError")){$("#saveEmailId").removeClass("inputFieldError")}if($("#saveConfirmEmailId").hasClass("inputFieldError")){$("#saveConfirmEmailId").removeClass("inputFieldError")}};Receipt.resetDetailLayer=function(){if($("#rcptTitle").hasClass("unmatchTitle")){$("#rcptTitle").removeClass("unmatchTitle")
}if($("#hrDivider").hasClass("unmatchTitle")){$("#hrDivider").removeClass("unmatchTitle")}$("#receiptTrnDtlLayer1").show();$("#receipt_amt").show();$("#receipt_desc").show();$("#receiptTrnDtlLayer2").show();$("#receiptCommentsTxt").html("");$("#receiptCommentsTxt").val("");ReceiptUI.currentReceiptDtls=null};Receipt.resetAddReceiptLayer=function(){if((!$.browser.msie&&navigator.userAgent.toLowerCase().indexOf("safari")==-1)||(navigator.userAgent.toLowerCase().indexOf("chrome")!=-1)){$("#selector").progressbar({value:0});
$("#progressVal").html("0% completed.");$("#progress").hide()}else{$("#receiptUploadDivField1").hide()}$("#uploading").hide();$("#uploadform").show();$("#addReceiptButtons").removeClass("overlayOpacity");$("#existingReceipt").removeClass("overlayOpacity");$("#cancelbutton").attr("disabled",false);$("#uploadbutton").attr("disabled",false);$("#cancelbutton").removeClass("overlayButton");$("#uploadbutton").removeClass("overlayButton");$("#existingReceipt").show();$("#addError").hide();if($.browser.msie){$("input[type='file']").replaceWith($("input[type='file']").clone(true))
}else{$("#file").val("")}$("#uploadFields").html("")};Receipt.resetAttachLayer=function(){ReceiptUI.currentReceiptDtls=null;$("#attachError").hide();$("#attachbutton").removeAttr("disabled")};Receipt.clearEmail=function(d){var c=$(d.target);if(Receipt.isDefaultEmailId(c.val())){c.val("");c.select();if($("#emailId").hasClass("inputFieldError")){$("#emailId").removeClass("inputFieldError")}}else{if($("#emailId").hasClass("inputFieldError")){$("#emailId").removeClass("inputFieldError")}}};Receipt.clearConfirmEmail=function(d){var c=$(d.target);
if(Receipt.isDefaultConfirmEmailId(c.val())){c.val("");c.select();if($("#confirmEmailId").hasClass("inputFieldError")){$("#confirmEmailId").removeClass("inputFieldError")}}else{if($("#confirmEmailId").hasClass("inputFieldError")){$("#confirmEmailId").removeClass("inputFieldError")}}};Receipt.isDefaultEmailId=function(c){return("emailaddress"==(c.replace(/\W/,"")).toLowerCase())};Receipt.isDefaultConfirmEmailId=function(c){return("confirmemail address"==(c.replace(/\W/,"")).toLowerCase())};Receipt.resetEmail=function(e){var d=$(e.target);
if(d.val()==""){d.val(Receipt.emailTitle);if($("#emailId").hasClass("inputFieldError")){$("#emailId").removeClass("inputFieldError")}}else{var c=(d.val()).replace(/~_/,"_");c=(c).replace(/~%/,"%");d.val(c)}};Receipt.resetConfirmEmail=function(e){var d=$(e.target);if(d.val()==""){d.val(Receipt.confirmEmailTitle);if($("#confirmEmailId").hasClass("inputFieldError")){$("#confirmEmailId").removeClass("inputFieldError")}}else{var c=(d.val()).replace(/~_/,"_");c=(c).replace(/~%/,"%");d.val(c)}};Receipt.clearAlternateEmail=function(d){var c=$(d.target);
if(Receipt.isDefaultEmailId(c.val())){c.val("");c.select();if($("#alternateEmailId").hasClass("inputFieldError")){$("#alternateEmailId").removeClass("inputFieldError")}}else{if($("#alternateEmailId").hasClass("inputFieldError")){$("#alternateEmailId").removeClass("inputFieldError")}}};Receipt.clearAlternateConfirmEmail=function(d){var c=$(d.target);if(Receipt.isDefaultConfirmEmailId(c.val())){c.val("");c.select();if($("#alternateConfirmEmailId").hasClass("inputFieldError")){$("#alternateConfirmEmailId").removeClass("inputFieldError")
}}else{if($("#alternateConfirmEmailId").hasClass("inputFieldError")){$("#alternateConfirmEmailId").removeClass("inputFieldError")}}};Receipt.resetAlternateEmail=function(e){var d=$(e.target);if(d.val()==""){d.val(Receipt.emailTitle);if($("#alternateEmailId").hasClass("inputFieldError")){$("#alternateEmailId").removeClass("inputFieldError")}}else{var c=(d.val()).replace(/~_/,"_");c=(c).replace(/~%/,"%");d.val(c)}};Receipt.resetAlternateConfirmEmail=function(e){var d=$(e.target);if(d.val()==""){d.val(Receipt.confirmEmailTitle);
if($("#alternateConfirmEmailId").hasClass("inputFieldError")){$("#alternateConfirmEmailId").removeClass("inputFieldError")}}else{var c=(d.val()).replace(/~_/,"_");c=(c).replace(/~%/,"%");d.val(c)}};Receipt.validateAlternateEmail=function(){var f=$("#alternateEmailId").val();var e=$("#alternateConfirmEmailId").val();var c=Receipt.isValidEmailAddress(f);var d=Receipt.isValidEmailAddress(e);if(Receipt.isDefaultEmailId(f)){Receipt.resetAlternateEmailErrors();$("#interimLyrErrMsg").html(ReceiptUI.requiredEmailErrMsg);
$("#interimLyrError").show();$("#alternateEmailId").addClass("inputFieldError");return false}else{if(!Receipt.isDefaultEmailId(f)&&!Receipt.isValidEmailAddress(f)){Receipt.resetAlternateEmailErrors();$("#interimLyrErrMsg").html(ReceiptUI.invalidEmailMsg);$("#interimLyrError").show();$("#alternateEmailId").addClass("inputFieldError");return false}else{if(Receipt.isDefaultConfirmEmailId(e)){Receipt.resetAlternateEmailErrors();$("#interimLyrErrMsg").html(ReceiptUI.requiredEmailErrMsg);$("#interimLyrError").show();
$("#alternateConfirmEmailId").addClass("inputFieldError");return false}else{if(!Receipt.isDefaultConfirmEmailId(e)&&!Receipt.isValidEmailAddress(e)){Receipt.resetAlternateEmailErrors();$("#interimLyrErrMsg").html(ReceiptUI.invalidEmailMsg);$("#interimLyrError").show();$("#alternateConfirmEmailId").addClass("inputFieldError");return false}else{if((!Receipt.isDefaultEmailId(f)&&f!="")||(!Receipt.isDefaultEmailId(e)&&e!="")){if(f!=e){Receipt.resetAlternateEmailErrors();$("#interimLyrErrMsg").html(ReceiptUI.emailAddressNotMatchErrMsg);
$("#interimLyrError").show();$("#alternateEmailId").addClass("inputFieldError");$("#alternateConfirmEmailId").addClass("inputFieldError");return false}}}}}}return true};Receipt.resetAlternateEmailLayer=function(){$("#interimLyrError").hide();if($("#alternateEmailId").hasClass("inputFieldError")){$("#alternateEmailId").removeClass("inputFieldError")}if($("#alternateConfirmEmailId").hasClass("inputFieldError")){$("#alternateConfirmEmailId").removeClass("inputFieldError")}};Receipt.resetAlternateEmailErrors=function(){$("#interimLyrError").hide();
if($("#alternateEmailId").hasClass("inputFieldError")){$("#alternateEmailId").removeClass("inputFieldError")}if($("#alternateConfirmEmailId").hasClass("inputFieldError")){$("#alternateConfirmEmailId").removeClass("inputFieldError")}};Receipt.updateEmail=function(){if(Receipt.validateShoeboxEmail()){Receipt.resetMatchedErrors();$("#rcRequestType").val("UpdateEmail");if(!Receipt.isDefaultEmailId($("#saveEmailId").val())){$("#newEmailAddress").val($("#saveEmailId").val())}Amex.OverlayManager.block("app");
var d=false;var e=false;var h=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){h=formParameters.getParams("receiptEnroll.do")}else{h=$("#"+Page.form.id).serialize()}var f=$.ajax("receiptEnroll.do",{type:"POST",data:h,success:function(m,l,n){if(n.getResponseHeader("RCError")==null){if(m!=null&&m.status==true){if(m.responseCode!=null){Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();$("#rcAuthToken").val(m.authtoken);if(m.responseCode=="EXPO0000"){$("#emailAddress").val(m.encryptEmailId);
$("#newEmailAddress").val("");$("#enrolleEmailAddress").html(m.EmailAddress);$("#displayEmailBlock").show();$("#hasEmailBlock").show();$("#emailEditBlock").hide()}else{if(m.responseCode=="EXPO0040"){Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();Receipt.resetMatchedErrors();$("#sbEmailErrMsg").html(ReceiptUI.duplicateEmailErr);$("#shoeboxEmailErr").show()}else{if(m.responseCode=="EXPO0041"){Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();Receipt.resetMatchedErrors();
$("#sbEmailErrMsg").html(ReceiptUI.emailUpdateError);$("#shoeboxEmailErr").show()}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}}}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}},error:function(l){Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)
}})}};Receipt.saveEmail=function(l,m){var h=false;if(Receipt.emailView=="interimView"){if(Receipt.validateAlternateEmail()){h=true;Receipt.resetAlternateEmailErrors();if(!Receipt.isDefaultEmailId($("#alternateEmailId").val())){$("#emailAddress").val($("#alternateEmailId").val())}}}else{if(Receipt.emailView=="shoeBoxView"){if(Receipt.validateShoeboxEmail()){h=true;Receipt.resetMatchedErrors();if(!Receipt.isDefaultEmailId($("#saveEmailId").val())){$("#emailAddress").val($("#saveEmailId").val())}}}}if(h){$("#rcRequestType").val("UpdateEmail");
Amex.OverlayManager.block("app");var d=false;var e=false;var n=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){n=formParameters.getParams("receiptEnroll.do")}else{n=$("#"+Page.form.id).serialize()}var f=$.ajax("receiptEnroll.do",{type:"POST",data:n,success:function(p,o,q){if(q.getResponseHeader("RCError")==null){if(p!=null&&p.status==true){if(p.responseCode!=null){$("#rcAuthToken").val(p.authtoken);if(p.responseCode=="EXPO0000"){if(ReceiptUI.showView=="addReceipt"){ReceiptUI.alternateEmailWindow.close();
Receipt.resetAddReceiptLayer();Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();setTimeout(function(){ReceiptUI.renderAddReceiptLayer()},200)}else{if(ReceiptUI.showView=="shoebox"){Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();if(Receipt.emailView=="shoeBoxView"){$("#emailAddress").val(p.encryptEmailId);$("#enrolleEmailAddress").html(p.EmailAddress);$("#displayEmailBlock").show();$("#hasEmailBlock").show();$("#emailEditBlock").hide()}else{ReceiptUI.alternateEmailWindow.close();
Receipt.resetMatchedLayer();ReceiptUI.openMatchShoebox(null,null)}}else{if(ReceiptUI.showView=="receiptDtls"){ReceiptUI.alternateEmailWindow.close();Receipt.viewReceiptsLayer()}}}}else{if(p.responseCode=="EXPO0040"){Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();$("#emailAddress").val("");if(Receipt.emailView=="shoeBoxView"){Receipt.resetMatchedErrors();$("#sbEmailErrMsg").html(ReceiptUI.duplicateEmailErr);$("#shoeboxEmailErr").show()}else{if(Receipt.emailView=="interimView"){Receipt.resetAlternateEmailErrors();
$("#updateEmailDiv").hide();$("#emailUpdateIssue").show();$("#interimLyrErrMsg").html(ReceiptUI.duplicateEmailErr);$("#interimLyrError").show()}}}else{if(p.responseCode=="EXPO0041"){Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();$("#emailAddress").val("");if(Receipt.emailView=="shoeBoxView"){Receipt.resetMatchedErrors();$("#sbEmailErrMsg").html(ReceiptUI.emailUpdateError);$("#shoeboxEmailErr").show()}else{if(Receipt.emailView=="interimView"){Receipt.resetAlternateEmailErrors();
$("#updateEmailDiv").hide();$("#emailUpdateIssue").show();$("#interimLyrErrMsg").html(ReceiptUI.emailUpdateError);$("#interimLyrError").show()}}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}}}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}},error:function(o){Amex.OverlayManager.pWin.close();
Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})}};Receipt.enrollReceipts=function(){if(Receipt.validateEnrollEmail()){Receipt.resetEnrollmentErrors();$("#rcRequestType").val("EnrollUser");if(!Receipt.isDefaultEmailId($("#emailId").val())){$("#emailAddress").val($("#emailId").val())}Amex.OverlayManager.block("app");var d=false;var f=false;var e=false;var l=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){l=formParameters.getParams("receiptEnroll.do")}else{l=$("#"+Page.form.id).serialize()
}var h=$.ajax("receiptEnroll.do",{type:"POST",data:l,success:function(p,n,q){if(q.getResponseHeader("RCError")==null){if(p!=null&&p.responseCode!=null){var o=p.responseCode;$("#rcAuthToken").val(p.authtoken);$("#authToken").val(p.authtoken);if(o=="EXPO0040"){d=true}else{if(o=="EXPO0041"){f=true}else{if(o=="EXPO0000"){e=true}}}}if(d){Receipt.emailExistingError=true;Amex.OverlayManager.unblock(false,"app");Receipt.enrollmentStatus=true;ReceiptUI.manageReceiptWindow.close();Receipt.emailView="interimView";
ReceiptUI.renderAlternateEmail();var m="RC_InterimView";Omniture.report(m);$("#updateEmailDiv").hide();$("#emailUpdateIssue").show();$("#interimLyrErrMsg").html(ReceiptUI.duplicateEmailErr);$("#interimLyrError").show();Receipt.updateReceiptWidget()}else{if(f){Receipt.emailUpdateError=true;Amex.OverlayManager.unblock(false,"app");ReceiptUI.manageReceiptWindow.close();if(ReceiptUI.showView=="addReceipt"){Receipt.enrollmentStatus=true;Receipt.resetAddReceiptLayer();$("#addMessage").html(ReceiptUI.emailUpdateError);
$("#addError").show();ReceiptUI.renderAddReceipt()}else{if(ReceiptUI.showView=="shoebox"){Receipt.enrollmentStatus=true;Receipt.resetMatchedLayer();$("#sbErrMsg").html(ReceiptUI.emailUpdateError);$("#shoeboxErr").show();ReceiptUI.openMatchShoebox(null,null)}}Receipt.updateReceiptWidget()}else{if(e){Receipt.validEmail=true;Amex.OverlayManager.unblock(false,"app");$("#rcAuthToken").val(p.authtoken);ReceiptUI.manageReceiptWindow.close();if(ReceiptUI.showView=="addReceipt"){Receipt.enrollmentStatus=true;
Receipt.resetAddReceiptLayer();ReceiptUI.renderAddReceiptLayer()}else{if(ReceiptUI.showView=="shoebox"){Receipt.enrollmentStatus=true;ReceiptUI.openMatchShoebox(null,null)}else{if(ReceiptUI.showView=="receiptDtls"){Receipt.enrollmentStatus=true;Receipt.viewReceiptsLayer()}}}Receipt.updateReceiptWidget()}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)
}},error:function(m){Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})}Receipt.callPznUrl()};Receipt.viewReceipts=function(c){Amex.OverlayManager.block("app");Receipt.enrollmentStatus=null;ReceiptUI.showView="receiptDtls";ReceiptUI.isInlineView=true;ReceiptUI.setShoeBoxInitialValues();ReceiptUI.index=$(this).closest("tbody").attr("id").split("_")[1];Receipt.init();if($("#isTPUser").val()=="false"){Omniture.report("RC_View_Edit_ETD")}else{Omniture.report("RC_View_ETD")
}};Receipt.viewReceiptDtls=function(c){Receipt.enrollmentStatus=null;ReceiptUI.showView="receiptDtls";ReceiptUI.isInlineView=true;ReceiptUI.setShoeBoxInitialValues();if(!$.isUndefined(c)){ReceiptUI.index=c}Receipt.init();if($("#isTPUser").val()=="false"){Omniture.report("RC_View_Edit_ETD")}else{Omniture.report("RC_View_ETD")}};Receipt.viewReceiptsLayer=function(){Omniture.report("RC_VIEW_Overlay");Amex.OverlayManager.block("app");var c=$("#rcptIdInline_"+ReceiptUI.index).val();var d=$("#rcCardHashInline_"+ReceiptUI.index).val();
var e=$("#authToken").val();$("#rcAuthToken").val(e);$("#rcRequestType").val("ViewReceipt");$("#matchedReceipt").val(true);$("#transReceiptId").val(c);$("#rcCardHash").val(d);var m="";var f="";var n="";var o="";var p="";if(QB.isQBTransOpen){m=$("#qb-trans-"+ReceiptUI.index+" td.col-desc").text().trim();p=m.replace(/\\/g,"\\").replace(/\"/g,'"');f=$("td.col-date-hidden","#qb-trans-"+ReceiptUI.index).text().trim();n=$("td.col-amount","#qb-trans-"+ReceiptUI.index).text().trim();o=$("#qb-trans-"+ReceiptUI.index+"").find("input.row-select-input").val().split("~")[1]
}else{m=$("#roc_"+ReceiptUI.index+" .desc-trans");p=m.text().trim();f=$("#postroc_"+ReceiptUI.index+" #date_roc_"+ReceiptUI.index).attr("data-date").trim();n=$("#roc_"+ReceiptUI.index+" td.colAmmount").text().trim().replace("$","");o=$("#croc_"+ReceiptUI.index).val().split("~")[1]}var r=Date.parseString(f.substring(0,10));rcDtStr=r.format("yyyy-MM-dd");$("#transactionDate").val(rcDtStr);$("#rcCurrency").val("USD");$("#rcAmount").val(n);$("#rcTransRefNum").val(o);$("#rcMerchant").val(p);var h=[];var q=$("#multiCardView").val()=="true"?true:false;
if(!q){h=formParameters.getParams("receiptDetails.do")}else{h=$("#"+Page.form.id).serialize()}var l=$.ajax("receiptDetails.do",{type:"POST",data:h,success:function(t,s,u){if((u.getResponseHeader("RCError")==null)&&(u.getResponseHeader("MYCAError")==null)){Amex.OverlayManager.unblock(false,"app");ReceiptUI.isEtdReceiptDtlView=true;Receipt.uploadedReceipt=false;ReceiptUI.isMatchShoeboxView=true;ReceiptUI.OpenReceiptsDetails(t,ReceiptUI.index)}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",u.responseText,true,null)
}},error:function(s){Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}});itag_isNewEnrollee="false"};Receipt.deleteReceipts=function(e){Amex.OverlayManager.block("app");var o=ReceiptUI.currentReceiptDtls;var p;if(null!=o){p=o.tagDetails}else{if(receiptTagDetails!=null){p=receiptTagDetails}}var c=[];var l=TagList.getTagList();if($("#multiCardView").length&&"true"==$("#multiCardView").val()&&Receipt.tagObjJSON!=null){l=Receipt.tagObjJSON}if(null!=p&&null!=p.tagList&&null!=l){$.each(p.tagList,function(r,s){$.each(l,function(u,t){if(t.id==s){c.push(t)
}})})}$("#rcRequestType").val("DeleteReceipt");if(null!=ReceiptUI.openDeleteWindow&&ReceiptUI.openDeleteWindow.visible()){ReceiptUI.openDeleteWindow.close()}if(!ReceiptUI.isInlineView&&$("#openLayer").val()!="Q"){$("#rcTransRefNum").val(ReceiptUI.currentReceiptDtls.transactionRefNo);var d=null;if(null!=ReceiptUI.currentReceiptDtls.imageId){d=ReceiptUI.currentReceiptDtls.imageId}else{d=ReceiptUI.currentReceiptDtls.receiptID}$("#transReceiptId").val(d);$("#matchedReceipt").val(ReceiptUI.isMatchShoeboxView);
$("#rcCardHash").val(ReceiptUI.currentReceiptDtls.rcCardHash)}else{if($("#openLayer").val()!="Q"){if(QB.isQBTransOpen){$("#rcTransRefNum").val($("#qb-trans-"+ReceiptUI.index+"").find("input.row-select-input").val().split("~")[1])}else{$("#rcTransRefNum").val($("#croc_"+ReceiptUI.index).val().split("~")[1])}$("#transReceiptId").val($("#rcptIdInline_"+ReceiptUI.index).val());$("#matchedReceipt").val(ReceiptUI.isMatchShoeboxView);$("#rcCardHash").val($("#rcCardHashInline_"+ReceiptUI.index).val())}}Omniture.report("RC_delete_confirm");
if($("#openLayer").val()=="Q"){var q=$("#refSeNumber").val();var m=$("input.multiCheck[value*="+q+"]").closest("tbody").attr("id").split("_")[1];ReceiptUI.index=m}var f=[];var n=$("#multiCardView").val()=="true"?true:false;if(!n){f=formParameters.getParams("manageReceipt.do")}else{f=$("#"+Page.form.id).serialize()}var h=$.ajax("manageReceipt.do",{type:"POST",data:f,success:function(y,w,v){if(v.getResponseHeader("RCError")==null){if($("#receiptDtlImg").is(":ui-zoomer")){$("#receiptDtlImg").zoomer("destroy")
}if(y.status==true){$("#rcAuthToken").val(y.authtoken);if(ReceiptUI.openReceiptDtlWindow!=null&&ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow.close()}if(!ReceiptUI.isEtdReceiptDtlView){if(ReceiptUI.isMatchShoeboxView&&!Receipt.uploadedReceipt){if($("#matched").is(":ui-shoebox")){$("#matched").shoebox("option","deleteImg",ReceiptUI.currentReceiptDtls)}}else{if($("#unmatched").is(":ui-shoebox")){$("#unmatched").shoebox("option","deleteImg",ReceiptUI.currentReceiptDtls)}}}if(ReceiptUI.isInlineView||$("#openLayer").val()=="Q"){var C="rcptIdInline_"+ReceiptUI.index;
var s="viewEditRcpt_"+ReceiptUI.index;var B="addRcpt_"+ReceiptUI.index;var r=$("#transReceiptId").val();var z="rcCardHashInline_"+ReceiptUI.index;var u=$("#rcCardHashInline_"+ReceiptUI.index).val();$("#"+z).val(u);Receipt.toggleReceiptIcon(false)}if(ReceiptUI.showView=="shoebox"){if(ReceiptUI.isMatchShoeboxView){if(ReceiptUI.matchReceiptWindow!=null){ReceiptUI.matchReceiptWindow.open();ReceiptUI.matchReceiptWindow._focus.focus();var x=ReceiptUI.currentReceiptDtls.imageId;var t=$("td[id*=xlistDatarow_]");
var A=t.find('input[value="'+x+'"]');if(A.length){ReceiptUI.index=A.attr("id").split("_")[1];var z="rcCardHashInline_"+ReceiptUI.index;var u=$("#rcCardHashInline_"+ReceiptUI.index).val();$("#"+z).val(u);Receipt.toggleReceiptIcon(false)}}}else{if(ReceiptUI.unmatchReceiptWindow!=null){ReceiptUI.unmatchReceiptWindow.open();ReceiptUI.unmatchReceiptWindow._focus.focus()}}}Receipt.resetDetailLayer();Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode()}else{Amex.OverlayManager.pWin.close();
Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}$("#rcTagDetails").val("")},error:function(r){Amex.OverlayManager.pWin.close();$("#rcTagDetails").val("");Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})};Receipt.detachReceipts=function(c){Amex.OverlayManager.block("app");var m=ReceiptUI.currentReceiptDtls;var o=null;if(null!=m){o=m.tagDetails
}else{if(receiptTagDetails!=null){o=receiptTagDetails}}$("#rcRequestType").val("DetachReceipt");if(null!=ReceiptUI.openDetachWindow){ReceiptUI.openDetachWindow.close()}if(!ReceiptUI.isInlineView&&$("#openLayer").val()!="Q"){$("#rcTransRefNum").val(ReceiptUI.currentReceiptDtls.transactionRefNo);$("#transReceiptId").val(ReceiptUI.currentReceiptDtls.imageId);$("#matchedReceipt").val(ReceiptUI.isMatchShoeboxView);$("#rcCardHash").val(ReceiptUI.currentReceiptDtls.rcCardHash)}else{if($("#openLayer").val()!="Q"){if(QB.isQBTransOpen){$("#rcTransRefNum").val($("#qb-trans-"+ReceiptUI.index+"").find("input.row-select-input").val().split("~")[1])
}else{$("#rcTransRefNum").val($("#croc_"+ReceiptUI.index).val().split("~")[1])}$("#transReceiptId").val($("#rcptIdInline_"+ReceiptUI.index).val());$("#matchedReceipt").val(ReceiptUI.isMatchShoeboxView);$("#rcCardHash").val($("#rcCardHashInline_"+ReceiptUI.index).val())}}var n=Tag.getTagBarForRefNo($("#rcTransRefNum").val());var d=[];Omniture.report("RC_detach");var e=[];var l=$("#multiCardView").val()=="true"?true:false;if(!l){e=formParameters.getParams("manageReceipt.do")}else{e=$("#"+Page.form.id).serialize()
}if($("#openLayer").val()=="Q"){var p=$("#refSeNumber").val();var h=$("input.multiCheck[value*="+p+"]").closest("tbody").attr("id").split("_")[1];ReceiptUI.index=h}var f=$.ajax("manageReceipt.do",{type:"POST",data:e,success:function(w,u,t){if(t.getResponseHeader("RCError")==null){if($("#receiptDtlImg").is(":ui-zoomer")){$("#receiptDtlImg").zoomer("destroy")}if(w.status==true){$("#rcAuthToken").val(w.authtoken);if(ReceiptUI.openReceiptDtlWindow!=null&&ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow.close()
}if(!ReceiptUI.isEtdReceiptDtlView){if(ReceiptUI.isMatchShoeboxView){if($("#matched").is(":ui-shoebox")){$("#matched").shoebox("option","deleteImg",ReceiptUI.currentReceiptDtls)}}else{if($("#unmatched").is(":ui-shoebox")){$("#unmatched").shoebox("option","deleteImg",ReceiptUI.currentReceiptDtls)}}}if(ReceiptUI.isInlineView||$("#openLayer").val()=="Q"){var z="rcptIdInline_"+ReceiptUI.index;var q=$("#transReceiptId").val();var x="rcCardHashInline_"+ReceiptUI.index;var s=$("#rcCardHashInline_"+ReceiptUI.index).val();
$("#"+x).val(s);Receipt.toggleReceiptIcon(false)}if(ReceiptUI.showView=="shoebox"){if(ReceiptUI.isMatchShoeboxView){if(ReceiptUI.matchReceiptWindow!=null){ReceiptUI.matchReceiptWindow.open();ReceiptUI.matchReceiptWindow._focus.focus();var v=ReceiptUI.currentReceiptDtls.imageId;var r=$("td[id*=xlistDatarow_]");var y=r.find('input[value="'+v+'"]');if(y.length){ReceiptUI.index=y.attr("id").split("_")[1];var x="rcCardHashInline_"+ReceiptUI.index;var s=$("#rcCardHashInline_"+ReceiptUI.index).val();$("#"+x).val(s);
Receipt.toggleReceiptIcon(false)}}}else{if(ReceiptUI.unmatchReceiptWindow!=null){ReceiptUI.unmatchReceiptWindow.open();ReceiptUI.unmatchReceiptWindow._focus.focus()}}}Receipt.resetDetailLayer();Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode()}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}$("#rcTagDetails").val("")
},error:function(q){Amex.OverlayManager.pWin.close();$("#rcTagDetails").val("");Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})};Receipt.recordEmailChoice=function(c){if(c!=null){c.preventDefault()}Receipt.emailSkip=true;if(ReceiptUI.showView=="addReceipt"){ReceiptUI.alternateEmailWindow.close();Receipt.resetAddReceiptLayer();ReceiptUI.renderAddReceiptLayer()}else{if(ReceiptUI.showView=="shoebox"){Receipt.resetMatchedLayer();setTimeout(ReceiptUI.openMatchShoebox(null,null),200)
}else{if(ReceiptUI.showView=="receiptDtls"){ReceiptUI.alternateEmailWindow.close();Receipt.viewReceiptsLayer()}}}};Receipt.bindReceiptDetailsEvents=function(){$("#zoomLink").off().on("click.zoom",function(d){d.stopPropagation();d.preventDefault();Omniture.report("RC_zoom_details");var c=null;if($("#zoomImgId").val()!=null&&$("#zoomImgId").val()!=""){c=$("#zoomImgId").val()}ReceiptUI.zoomReceiptLayer($("#zoomImgId").val())});$("#magnifierLink").off().on("click.zoom",function(d){d.stopPropagation();
d.preventDefault();Omniture.report("RC_zoom_details");var c=null;if($("#zoomImgId").val()!=null&&$("#zoomImgId").val()!=""){c=$("#zoomImgId").val()}ReceiptUI.zoomReceiptLayer($("#zoomImgId").val())});$("#rcExportToPDF").off().on("click",Receipt.exportToPdf);$("#detailClose").off().on("click",Receipt.closeReceiptDetail);$("#detailFinish").off().on("click",Receipt.finishReceiptDetail);$("#viewMatchReceipts").off().on("click",function(c){if(c!=null){c.preventDefault()}if(Receipt.noteSaveStatus){Amex.OverlayManager.block("app");
Receipt.updateComments($("#receiptCommentsTxt").val(),"viewAll")}else{Receipt.viewAllOnSuccess()}Omniture.report("RC_Shoebox_viewall")});$("#detachImgLink").off().on("click",function(d){if(d!=null){d.preventDefault()}var c=(Receipt.uploadedReceipt&&!ReceiptUI.isInlineAdd);var e=(Receipt.uploadedReceipt&&$("#rcRequestType").val()=="ExportPDF");if($("#rcRequestType").val()=="InlineAdd"||$("#rcRequestType").val()=="ViewReceipt"||$("#rcRequestType").val()=="AttachReceipt"||(e&&!c)||($("#rcRequestType").val()!="Geturl"&&ReceiptUI.isMatchShoeboxView&&!c)){if(Receipt.noteSaveStatus){Amex.OverlayManager.block("app");
Receipt.updateComments($("#receiptCommentsTxt").val(),"detach")}else{ReceiptUI.detachReceipt()}}else{ReceiptUI.deleteReceipt()}});if($("#receiptCommentsTxt").attr("disabled")!="disabled"){$("#receiptCommentsTxt").off().on("keyup keydown mouseup mousedown",function(c){var d=Receipt.escapeHTML($("#receiptCommentsTxt").val());Receipt.noteSaveStatus=true;Receipt.validateComments(d,c)})}};Receipt.viewAllOnSuccess=function(){if($("#receiptDtlImg").is(":ui-zoomer")){$("#receiptDtlImg").zoomer("destroy")
}var c=(Receipt.uploadedReceipt&&!ReceiptUI.isInlineAdd);var d=(ReceiptUI.isAttachView||ReceiptUI.isInlineView||ReceiptUI.isInlineAdd||$("#qbReceiptDeepLink").val()=="true");if(c){if(!ReceiptUI.isMatchShoeboxView){ReceiptUI.rctDtlClose=true}ReceiptUI.openUnMatchShoebox();Receipt.uploadedReceipt=false}else{if(d){if(ReceiptUI.isInlineView){ReceiptUI.isInlineView=false}ReceiptUI.setOpenMatchShoeBox()}else{if(!Receipt.uploadedReceipt){Receipt.closeReceiptDetail()}}}};Receipt.bindZoomEvents=function(){if($("#download").length){$("#download").on("click",Receipt.downloadImg)
}if($("#rcPrintZoom").length){$("#rcPrintZoom").on("click",Print.printZoomImg)}};Receipt.downloadImg=function(d){d.preventDefault();Omniture.report("RC_download");if(!ReceiptUI.isAttachView){var c=$("#downloadImgId").val()}if((c==null||c=="")&&null!=ReceiptUI.currentReceiptDtls&&null!=ReceiptUI.currentReceiptDtls.downloadImgURL){window.open(ReceiptUI.currentReceiptDtls.downloadImgURL)}else{window.open(c)}};Receipt.closeReceiptDetail=function(){if($("#receiptDtlImg").is(":ui-zoomer")){$("#receiptDtlImg").zoomer("destroy")
}if(Receipt.noteSaveStatus){Amex.OverlayManager.block("app");Receipt.updateComments($("#receiptCommentsTxt").val(),"close")}else{Receipt.closeOnSuccess()}Omniture.report("RC_finish")};Receipt.closeOnSuccess=function(){Receipt.resetDetailLayer();if(ReceiptUI.openReceiptDtlWindow!=null&&ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow.close();if($("#qbReceiptDeepLink").val()=="true"){$("#qbReceiptDeepLink").val(false);ReceiptUI.index="";Receipt.noteSaveStatus=false}}if(ReceiptUI.showView=="shoebox"){if(ReceiptUI.isMatchShoeboxView&&ReceiptUI.matchReceiptWindow!=null&&!ReceiptUI.matchReceiptWindow.visible()){ReceiptUI.matchReceiptWindow.open();
ReceiptUI.matchReceiptWindow._focus.focus()}else{if(ReceiptUI.unmatchReceiptWindow!=null&&!ReceiptUI.unmatchReceiptWindow.visible()){ReceiptUI.unmatchReceiptWindow.open();ReceiptUI.unmatchReceiptWindow._focus.focus()}}}};Receipt.finishReceiptDetail=function(){if($("#receiptDtlImg").is(":ui-zoomer")){$("#receiptDtlImg").zoomer("destroy")}if(Receipt.noteSaveStatus){Amex.OverlayManager.block("app");Receipt.updateComments($("#receiptCommentsTxt").val(),"finish")}else{Receipt.finishOnSuccess()}Receipt.uploadedReceipt=false;
Omniture.report("RC_finish")};Receipt.finishOnSuccess=function(){Receipt.resetDetailLayer();if(!ReceiptUI.isInlineAdd){if(ReceiptUI.isMatchShoeboxView){ReceiptUI.matchReceiptWindow.close();ReceiptUI.rctDtlClose=true;ReceiptUI.openUnMatchShoebox(null)}else{if(ReceiptUI.openReceiptDtlWindow!=null&&ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow.close()}if(ReceiptUI.unmatchReceiptWindow!=null&&!ReceiptUI.unmatchReceiptWindow.visible()){if(Receipt.noteSaveStatus){ReceiptUI.openUnMatchShoebox(null)
}else{if(ReceiptUI.unmatchReceiptWindow!=null){ReceiptUI.unmatchReceiptWindow.open();ReceiptUI.unmatchReceiptWindow._focus.focus()}}}}}else{if(ReceiptUI.openReceiptDtlWindow!=null&&ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow.close()}}};Receipt.initDetachEvents=function(){if($("#deletelnk").length){$("#deletelnk").on("click",ReceiptUI.deleteReceipt)}if($("#detachbutton").length){$("#detachbutton").on("click",function(d){if($("#multiCardView").length&&"true"==$("#multiCardView").val()&&Receipt.tagObjJSON==null){var c=TagAction.fetchRCTags(null,null);
c.done(function(){Receipt.detachReceipts(d)})}else{Receipt.detachReceipts(d)}})}if($("#cancelDetach").length){$("#cancelDetach").on("click",function(){if(null!=ReceiptUI.openDetachWindow&&ReceiptUI.openDetachWindow.visible()){ReceiptUI.openDetachWindow.close();Amex.PageOverlay.disableAlertMode()}})}};Receipt.initDeleteEvents=function(){if($("#deletebutton").length){$("#deletebutton").on("click",function(d){if($("#multiCardView").length&&"true"==$("#multiCardView").val()&&Receipt.tagObjJSON==null){var c=TagAction.fetchRCTags(null,null);
c.done(function(){Receipt.deleteReceipts(d)})}else{Receipt.deleteReceipts(d)}})}if($("#canceldelete").length){$("#canceldelete").on("click",function(){if(null!=ReceiptUI.openDeleteWindow&&ReceiptUI.openDeleteWindow.visible()){ReceiptUI.openDeleteWindow.close();Amex.PageOverlay.disableAlertMode()}})}};Receipt.viewShoeBoxPreview=function(){$("#rcRequestType").val("Print");$("#matchedReceipt").val(true);$("#offset").val(0);$("#receiptIds").val(Receipt.receiptIdArray);$("#etdRequired").val(true);if($("#matched_pageno").length){var f=$("#matched_pageno").html().substring(5,6);
$("#rcPrintPage").val(f)}var e=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){e=formParameters.getParams("receiptDetails.do")}else{e=$("#"+Page.form.id).serialize()}var d=$.ajax("receiptDetails.do",{type:"POST",data:e,success:function(l,h,m){if(m.getResponseHeader("RCError")==null){$("#updateShoebox").html(l);$("#shoeBoxPreviewDiv").find("img").loadimg()}else{Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}},error:function(h){Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)
}})};Receipt.viewUnmatchPreview=function(){$("#rcRequestType").val("Print");$("#matchedReceipt").val(false);$("#offset").val(0);$("#receiptIds").val(Receipt.receiptIdArray);$("#etdRequired").val(false);if($("#unmatched_pageno").length){var f=$("#unmatched_pageno").html().substring(5,6);$("#rcPrintPage").val(f)}var e=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){e=formParameters.getParams("receiptDetails.do")}else{e=$("#"+Page.form.id).serialize()}var d=$.ajax("receiptDetails.do",{type:"POST",data:e,success:function(l,h,m){if(m.getResponseHeader("RCError")==null){$("#updateShoebox").html(l);
$("#shoeBoxPreviewDiv").find("img").loadimg()}else{Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}},error:function(h){Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})};Receipt.fetchReceiptsInfo=function(d,m,c,h){var o=false;var l=[];$("#rcRequestType").val("ShoeBox");$("#matchedReceipt").val(m);$("#etdRequired").val(false);$("#connectionId").val(QB.connectionId);var e=[];var n=$("#multiCardView").val()=="true"?true:false;if(!n){e=formParameters.getParams("receiptDetails.do")
}else{e=$("#"+Page.form.id).serialize()}var f=$.ajax("receiptDetails.do",{type:"POST",data:e,success:function(A,w,u){if(u.getResponseHeader("RCERROR")==null){if(A.status==true){Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();if(A.authtoken!=null&&A.authtoken!=""){Receipt.enrollmentStatus="true";$("#rcAuthToken").val(A.authtoken);if(A.showEmailInterstitial==true&&!Receipt.emailSkip){Receipt.emailSkip=true;ReceiptUI.isEnrollmentFlow=false;$("#emailUpdateIssue").hide();$("#updateEmailDiv").show();
Receipt.emailView="interimView";if(ReceiptUI.matchReceiptWindow!=null&&ReceiptUI.matchReceiptWindow.visible()){ReceiptUI.matchReceiptWindow.close()}if(ReceiptUI.manageReceiptWindow!=null&&ReceiptUI.manageReceiptWindow.visible()){ReceiptUI.manageReceiptWindow.close()}ReceiptUI.renderAlternateEmail()}else{var z=null;var p=true;if(A.EmailAddress!=null){$("#emailAddress").val(A.encryptEmailId);$("#enrolleEmailAddress").html(A.EmailAddress);$("#noEmailBlock").hide();$("#hasEmailBlock").show();Receipt.emailEnrollType="update"
}else{$("#emailAddress").val("");$("#hasEmailBlock").hide();$("#noEmailBlock").show();Receipt.emailEnrollType="save";Omniture.report("RC_add_email")}if(A.receiptDetails!=null){z=A.receiptDetails.receiptDetails;Receipt.receiptIdArray=[];for(var s=0;s<z.length;s++){l.push(z[s]);if((c=="matched")||(c=="unmatched")){Receipt.receiptIdArray.push(z[s].receiptID)}}}else{Receipt.receiptIdArray=[];if(ReceiptUI.isAttachView){$("#attachbutton").attr({disabled:true})}}if(A.receiptDetails==null||z.length<25){o=true
}var y=new Shoebox.Controller();var r=false;var D="matched";var q="There are no receipts available in this view.";var E="shoeboxAddReceiptLink";var B="shoeboxPrintLink";var C="Click image to view details";if(m){if($("#matched").is(":ui-shoebox")){$("#matched").shoebox("destroy")}}else{D="unmatched";if(ReceiptUI.isAttachView){if($("#attached").is(":ui-shoebox")){$("#attached").shoebox("destroy")}}else{if($("#unmatched").is(":ui-shoebox")){$("#unmatched").shoebox("destroy")}}E="unmatchedAddReceiptLink";
B="unMatchPrintLink"}var v=Receipt.getImageCollection(l);if(ReceiptUI.isAttachView){y.imgSelect1=true;y.imgDetails=false;p=false;r=true;C="Select image to continue"}else{y.imgSelect1=false;y.imgDetails=true;p=true}$("#"+c).shoebox({imageCollection:v,noOfRowsPerPage:2,noOfColsPerPage:4,add:p,imageController:y,zoom:r,noReceiptsMsg:q,lastReceipt:o,shoeboxType:D,addReceiptLinkId:E,printReceiptLinkId:B,receiptTitleTxt:C});if(D=="matched"){Receipt.resetMatchedLayer();$("#enrollStatus").val(A.enrollStatus);
ReceiptUI.isMatchShoeboxView=true;var F=A.displayRcCardList;var t=A.displayRcCardData;$("#description").html(t.description);$("#account").html(t.displayAccount);$("#timePeriodDesc").html(A.displayRcSelCycleDesc);$("#timePeriodSelectedCycle").html(A.displayRcSelectedCycle);Receipt.processCardList(A.displayRcCardList);Receipt.periodList=A.displayRcTimePeriodDataList;ReceiptDropDown.card=null;ReceiptDropDown.period=null;ReceiptDropDown.init();if(ReceiptUI.unmatchReceiptWindow!=null&&ReceiptUI.unmatchReceiptWindow.visible()){ReceiptUI.unmatchReceiptWindow.close()
}ReceiptUI.matchReceiptWindow.centerInViewport();ReceiptUI.matchReceiptWindow.open();ReceiptUI.matchReceiptWindow._focus.focus();if((l==null||l.length==0)){$("#shoeboxPrintLink").addClass("shoeboxPrintDisable");$("#shoeboxPrintLink").removeClass("blue1")}else{if($("#shoeboxPrintLink").hasClass("shoeboxPrintDisable")){$("#shoeboxPrintLink").removeClass("shoeboxPrintDisable");$("#shoeboxPrintLink").addClass("blue1")}}$("#matched_mainDiv").removeClass("ui-showbox-widget");$("#matched_mainDiv").css({height:"600px",width:"810px"});
var x=ReceiptDropDown.period.getSelected();$("#receiptStartDate").val(x.startDate);$("#receiptEndDate").val(x.endDate)}else{if(D=="unmatched"){if(ReceiptUI.matchReceiptWindow!=null&&ReceiptUI.matchReceiptWindow.visible()){ReceiptUI.matchReceiptWindow.close()}if(ReceiptUI.renderAddReceiptWindow!=null&&ReceiptUI.renderAddReceiptWindow.visible()){ReceiptUI.renderAddReceiptWindow.close();Receipt.resetAddReceiptLayer()}if(ReceiptUI.isAttachView){ReceiptUI.renderAttachReceiptWindow.centerInViewport();ReceiptUI.renderAttachReceiptWindow.open();
ReceiptUI.renderAttachReceiptWindow._focus.focus()}else{ReceiptUI.isMatchShoeboxView=false;ReceiptUI.unmatchReceiptWindow.centerInViewport();ReceiptUI.unmatchReceiptWindow.open();ReceiptUI.unmatchReceiptWindow._focus.focus();if((l==null||l.length==0)){$("#unMatchPrintLink").addClass("shoeboxPrintDisable");$("#unMatchPrintLink").removeClass("blue1")}else{if($("#unMatchPrintLink").hasClass("shoeboxPrintDisable")){$("#unMatchPrintLink").removeClass("shoeboxPrintDisable");$("#unMatchPrintLink").addClass("blue1")
}}}$("#unmatched_mainDiv").removeClass("ui-showbox-widget");$("#unmatched_mainDiv").css({height:"500px",width:"810px"})}}}}else{Receipt.enrollmentStatus="false";if(ReceiptUI.matchReceiptWindow!=null&&ReceiptUI.matchReceiptWindow.visible()){ReceiptUI.matchReceiptWindow.close()}ReceiptUI.openEnrollmentLayer();Receipt.callDCP($("#emailId"),$("#confirmEmailId"))}}else{if(h!=undefined){if(h=="unmatched"){ReceiptUI.isMatchShoeboxView=false}else{if(h=="matched"){ReceiptUI.isMatchShoeboxView=true}}}Amex.OverlayManager.pWin.close();
Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}else{if(h!=undefined){if(h=="unmatched"){ReceiptUI.isMatchShoeboxView=false}else{if(h=="matched"){ReceiptUI.isMatchShoeboxView=true}}}Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}},error:function(p){if(h!=undefined){if(h=="unmatched"){ReceiptUI.isMatchShoeboxView=false}else{if(h=="matched"){ReceiptUI.isMatchShoeboxView=true}}}Amex.OverlayManager.pWin.close();
Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})};Receipt.getImageCollection=function(p){var c=[];if(p.length!=0){for(var d=0;d<p.length;d++){var h=p[d];var o=parseFloat(h.amount);var n=h.chargeDate;var m=h.descLine1;var l="<strong>"+h.chargeDate+" | $ "+o.toFixed(2)+"</strong>";var f=h.descLine1;var e=" $ "+o.toFixed(2);var q={imageId:h.receiptID,tagDetails:h.tagDetails,qBTagDetails:h.qbTagName,qBTagGrpDetails:h.qbTagGroupDetails,QbclassTagDetails:h.classTags,QbBillableIndicator:h.billableIndicator,QbexpenseTagDetails:h.COATags,QbcustomerTagDetails:h.customerTags,qbTagCOADetails:h.qbTagCOADetails,qbTagClassDetails:h.qbTagClassDetails,qbTagCustomerDetails:h.qbTagCustomerDetails,qbCustomerPreference:h.customerPreference,qbClassPreference:h.classPreference,qbTagfetchingerror:h.qbTagErrorCode,qbTagsBillableDetails:h.qbTagBillableDetails,thumbnailURL:h.thumbImgURL,downloadImgURL:h.downloadImgURL,mediumImgURL:h.mediumImgURL,zoomURL:h.zoomImgURL,comments:h.comments,descLine1:n,descLine2:m,descLine3:l,descLine4:f,descLine5:e,memberName:h.memberName,imageIndex:d,transactionRefNo:h.transactionRefNo,rcCardHash:h.transCardHash,archiveReq:h.archivedRequest};
c.push(q)}}return c};Receipt.validateComments=function(l,h){var d=Receipt.modifyHTML(l);var e=l;if(/[^a-zA-Z0-9 <>&"!#$%'()*+,-.:;=?@[/\]^_`{}~|/\\\n\t\b\f\r]/.test(e)){e=e.substring(0,(e.length-1))}var f=250-d.length;var c=h.keyCode!=8&&h.keyCode!=46&&h.keyCode!=38&&h.keyCode!=40&&h.keyCode!=39&&h.keyCode!=36&&h.keyCode!=35&&h.keyCode!=37&&!h.ctrlKey;if(f==0&&$.browser.msie&&c){h.preventDefault()}if(f>=0){$("#commtStrtIndex").html(f+" character"+((f==1)?"":"s")+" left");if(!$.browser.msie){$("#receiptCommentsTxt").html(e)
}}else{if($.browser.msie){$("#commtStrtIndex").html(0+" character left");$("#receiptCommentsTxt").html(e.substring(0,250))}}};Receipt.escapeComments=function(){var c=Receipt.escapeHTML($("#receiptCommentsTxt").val());var d=c.replace(/\n/g,"\\n").replace(/\"/g,"&quot;");$("#receiptComments").val(d);return};Receipt.updateComments=function(h,f){$("#rcRequestType").val("UpdateReceipt");$("#matchedReceipt").val(ReceiptUI.isMatchShoeboxView);var l=null;var e=null;var d=null;if(ReceiptUI.isInlineAdd||ReceiptUI.isEtdReceiptDtlView||ReceiptUI.isInlineView){if(receiptTagDetails!=null){d=JSON.stringify(receiptTagDetails)
}if($("#qbReceiptDeepLink").val()=="true"){receiptId=$("#transReceiptId").val();rcCardHash=$("#rcCardHash").val()}else{receiptId=$("#rcptIdInline_"+ReceiptUI.index).val();rcCardHash=$("#rcCardHashInline_"+ReceiptUI.index).val()}}else{if(ReceiptUI.currentReceiptDtls!=null){if(null!=ReceiptUI.currentReceiptDtls.imageId){receiptId=ReceiptUI.currentReceiptDtls.imageId}else{receiptId=ReceiptUI.currentReceiptDtls.receiptID}e=ReceiptUI.currentReceiptDtls.rcCardHash;d=JSON.stringify(ReceiptUI.currentReceiptDtls.tagDetails)
}}$("#transReceiptId").val(receiptId);$("#rcCardHash").val(e);$("#rcTagDetails").val(d);Receipt.escapeComments();var n=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){n=formParameters.getParams("manageReceipt.do")}else{n=$("#"+Page.form.id).serialize()}var m=$.ajax("manageReceipt.do",{type:"POST",data:n,success:function(p,o,q){if(q.getResponseHeader("RCError")==null){if(p!=null&&p.responseCode!=null&&p.responseCode=="EXPO0000"){$("#rcAuthToken").val(p.authtoken);if(ReceiptUI.currentReceiptDtls!=null){ReceiptUI.currentReceiptDtls.comments=p.receiptComments
}if(ReceiptUI.isMatchShoeboxView){if($("#matched").is(":ui-shoebox")){$("#matched").shoebox("option","updateImg",ReceiptUI.currentReceiptDtls)}}else{if($("#unmatched").is(":ui-shoebox")){$("#unmatched").shoebox("option","updateImg",ReceiptUI.currentReceiptDtls)}}if(f=="export"){Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();Receipt.exportOnSuccess()}else{if(f=="viewAll"){Amex.OverlayManager.unblock(false,"app");Receipt.viewAllOnSuccess()}else{if(f=="detach"){Amex.OverlayManager.pWin.close();
Amex.PageOverlay.disableAlertMode();ReceiptUI.detachReceipt()}else{if(f=="close"){Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();Receipt.closeOnSuccess()}else{if(f=="finish"){Amex.OverlayManager.unblock(false,"app");Receipt.finishOnSuccess()}else{if(f=="topClose"){if(ReceiptUI.showView=="shoebox"){Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode()}else{Amex.OverlayManager.unblock(false,"app")}Receipt.resetDetailLayer()}}}}}}Receipt.noteSaveStatus=false}else{Amex.OverlayManager.pWin.close();
Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}$("#rcTagDetails").val("")},error:function(o){Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null);$("#rcTagDetails").val("")}})};Receipt.exportToPdf=function(c){if(c!=null){c.preventDefault()}if(Receipt.noteSaveStatus){Amex.OverlayManager.block("app");Receipt.updateComments($("#receiptCommentsTxt").val(),"export")
}else{Receipt.exportOnSuccess()}};Receipt.exportOnSuccess=function(){var c=null;var d=null;if(ReceiptUI.isEtdReceiptDtlView||ReceiptUI.isInlineView||ReceiptUI.isInlineAdd){if($("#qbReceiptDeepLink").val()=="true"){c=$("#transReceiptId").val();d=$("#rcCardHash").val()}else{c=$("#rcptIdInline_"+ReceiptUI.index).val();d=$("#rcCardHashInline_"+ReceiptUI.index).val()}}else{if(null!=ReceiptUI.currentReceiptDtls){if(null!=ReceiptUI.currentReceiptDtls.imageId){c=ReceiptUI.currentReceiptDtls.imageId}else{c=ReceiptUI.currentReceiptDtls.receiptID
}d=ReceiptUI.currentReceiptDtls.rcCardHash}else{if($("#qbReceiptDeepLink").val()=="true"){c=$("#transReceiptId").val();d=$("#rcCardHash").val()}}}if((ReceiptUI.isMatchShoeboxView&&!Receipt.uploadedReceipt)||ReceiptUI.isEtdReceiptDtlView||ReceiptUI.isInlineView||ReceiptUI.isInlineAdd||$("#qbReceiptDeepLink").val()=="true"){$("#matchedReceipt").val(true);$("#etdRequired").val(true);$("#rcCardHash").val(d)}else{$("#matchedReceipt").val(false);$("#rcCardHash").val("")}$("#rcRequestType").val("ExportPDF");
$("#transReceiptId").val(c);Omniture.report("RC_export");Page.form.submit("receiptDetails.do")};Receipt.invokeDetails=function(c){Amex.OverlayManager.block("app");$("#refSeNumber").val(c.transactionRefNo);$("#fetchPreferences").val(false);$("#isPrintReq").val("");$("#exRocType").val("rv");$("#rcExroc").val(true);var e=[];var d=$("#multiCardView").val()=="true"?true:false;if(!d){e=formParameters.getParams("exroc.do")}else{e=$("#"+Page.form.id).serialize()}$.ajax("exroc.do",{type:"POST",data:e,success:function(f,l,h){if(h.getResponseHeader("MYCAError")==null){Receipt.uploadedReceipt=false;
if(ReceiptUI.matchReceiptWindow!=null&&ReceiptUI.matchReceiptWindow.visible()){ReceiptUI.matchReceiptWindow.close()}ReceiptUI.OpenReceiptsDetails(c,f)}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}$("#rcExroc").val(false)},error:function(f){$("#rcExroc").val(false);Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})};Receipt.checkEnrollStatus=function(){$("#rcRequestType").val("EnrollInfo");
var e=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){e=formParameters.getParams("receiptEnroll.do")}else{e=$("#"+Page.form.id).serialize()}var d=$.ajax("receiptEnroll.do",{data:e,type:"POST",success:function(l,f,h){if(h.getResponseHeader("RCError")==null){if(l.status==true){$("#rcAuthToken").val(l.authtoken);if(l.enrollStatus=="true"){$("#enrollStatus").val(l.enrollStatus);if(l.authtoken!=null&&l.authtoken!=""){Receipt.enrollmentStatus="true";itag_isNewEnrollee="false";$("#authToken").val(l.authtoken);
Receipt.rcValidAuthTokenStartTime=new Date().getTime();if(l.showEmailInterstitial==true&&!Receipt.emailSkip){Receipt.emailSkip=true;ReceiptUI.isEnrollmentFlow=false;$("#emailUpdateIssue").hide();$("#updateEmailDiv").show();Receipt.emailView="interimView";Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();ReceiptUI.renderAlternateEmail()}else{Receipt.addViewReceipts()}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)
}}else{Receipt.enrollmentStatus="false";itag_isNewEnrollee="true";Amex.OverlayManager.unblock(false,"app");ReceiptUI.openEnrollmentLayer()}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}},error:function(f){Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})};
Receipt.addViewReceipts=function(){if(ReceiptUI.showView=="addReceipt"){Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();Receipt.resetAddReceiptLayer();ReceiptUI.renderAddReceiptLayer()}else{if(ReceiptUI.showView=="receiptDtls"){Receipt.viewReceiptsLayer()}else{if(ReceiptUI.showView=="shoebox"){Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode();if(ReceiptUI.isMatchShoeboxView){if(ReceiptUI.matchReceiptWindow!=null&&ReceiptUI.matchReceiptWindow.visible()){ReceiptUI.matchReceiptWindow.close()
}}if(!ReceiptUI.isMatchShoeboxView){if(ReceiptUI.unmatchReceiptWindow!=null&&ReceiptUI.unmatchReceiptWindow.visible()){ReceiptUI.unmatchReceiptWindow.close()}}Receipt.resetAddReceiptLayer();ReceiptUI.renderAddReceiptLayer()}}}};Receipt.bindAlternateEmailEvents=function(){var c=$("#alternateEmailId").val();$("#alternateEmailId").focusout(Receipt.resetAlternateEmail).focusin(Receipt.clearAlternateEmail);$("#alternateConfirmEmailId").focusout(Receipt.resetAlternateConfirmEmail).focusin(Receipt.clearAlternateConfirmEmail);
$("#interimContinueBtn").on("click",{email:c},Receipt.saveEmail);$("#skipEmail").on("click",Receipt.recordEmailChoice);$("#interimPrivacyUrl").on("click",function(){window.open($("#privacyLink").val())});$("#altqmark1").on("click",ReceiptUI.showEnrollmentCallout);$("#altqmark1").on("mouseout",ReceiptUI.closeCallout);$("#altqmark2").on("click",ReceiptUI.showEnrollmentCallout);$("#altqmark2").on("mouseout",ReceiptUI.closeCallout)};Receipt.bindEnrollmentEvents=function(c){$("#emailId").focusout(Receipt.resetEmail).focusin(Receipt.clearEmail);
$("#confirmEmailId").focusout(Receipt.resetConfirmEmail).focusin(Receipt.clearConfirmEmail);$("#enrollContinueBtn").on("click",function(){Receipt.enrollReceipts()});$("#enrollCancelButton").on("click",function(){if(ReceiptUI.manageReceiptWindow!=null&&ReceiptUI.manageReceiptWindow.visible()){ReceiptUI.manageReceiptWindow.close();Amex.OverlayManager.unblock(false,"app")}});$("#enrollmentPrivacyUrl").on("click",function(){window.open($("#privacyLink").val())});$("#printTerms").on("click",Receipt.printTerms);
$("#enrollqmark").on("click",ReceiptUI.showEnrollmentCallout);$("#enrollqmark").on("mouseout",ReceiptUI.closeCallout)};Receipt.printTerms=function(c){if(c!=null){c.stopPropagation();c.preventDefault()}window.open($("#locImages").val()+"/ReceiptMatch_Terms_of_Use_online_public_T.pdf","Download")};Receipt.updateEMS=function(l){var c=l;var o=c.receipt;var d=$("#authToken").val();var e="";var q="";if(QB.isQBTransOpen){$("#rcTransRefNum").val($("#qb-trans-"+ReceiptUI.index+"").find("input.row-select-input").val().split("~")[1]);
e=$("td.col-date-hidden","#qb-trans-"+ReceiptUI.index).text().trim();q=Date.parseString(e.substring(0,10))}else{$("#rcTransRefNum").val($("#croc_"+ReceiptUI.index).val().split("~")[1]);e=$("#date_roc_"+ReceiptUI.index).attr("data-date").trim();q=Date.parseString(e.substring(0,10))}$("#transactionDate").val(q.format("yyyy-MM-dd"));$("#rcRequestType").val("InlineAdd");$("#transReceiptId").val(o.receiptID);$("#matchedReceipt").val(true);$("#imageUrl").val(o.filename);$("#rcAuthToken").val(d);var p=Receipt.rcUploadEndTime-Receipt.rcUploadStartTime;
$("#rcUploadTime").val(p);$("#rcUploadResCode").val(l.responseCode);$("#rcUploadedBrowser").val(Receipt.getBrowser());var m=[];var f=[];var n=$("#multiCardView").val()=="true"?true:false;if(!n){f=formParameters.getParams("manageReceipt.do")}else{f=$("#"+Page.form.id).serialize()}var h=$.ajax("manageReceipt.do",{type:"POST",data:f,success:function(z,v,u){if(u.getResponseHeader("RCError")==null){if(z.status==true){$("#rcAuthToken").val(z.authtoken);var x=null;var w=null;if(z.receiptDetails!=null){var s=z.receiptDetails.receiptDetails[0];
x=z.receiptDetails.receiptDetails}if(ReceiptUI.isInlineAdd){var A="rcptIdInline_"+ReceiptUI.index;var r=$("#transReceiptId").val();var y="rcCardHashInline_"+ReceiptUI.index;var t=$("#rcCardHashInline_"+ReceiptUI.index).val();$("#"+A).val(r);$("#"+y).val(t);Receipt.toggleReceiptIcon(true)}Receipt.uploadedReceipt=true;if(ReceiptUI.renderAddReceiptWindow!=null&&ReceiptUI.renderAddReceiptWindow.visible()){ReceiptUI.renderAddReceiptWindow.close()}if(!ReceiptUI.isTopClosed){ReceiptUI.OpenReceiptsDetails(s,ReceiptUI.index)
}else{ReceiptUI.isTopClosed=false}}else{if(ReceiptUI.renderAddReceiptWindow!=null&&ReceiptUI.renderAddReceiptWindow.visible()){ReceiptUI.renderAddReceiptWindow.close()}Receipt.toggleForAddInline()}}else{if(ReceiptUI.renderAddReceiptWindow!=null&&ReceiptUI.renderAddReceiptWindow.visible()){ReceiptUI.renderAddReceiptWindow.close()}Receipt.toggleForAddInline()}},error:function(r){if(ReceiptUI.renderAddReceiptWindow!=null&&ReceiptUI.renderAddReceiptWindow.visible()){ReceiptUI.renderAddReceiptWindow.close()
}Receipt.toggleForAddInline()}})};Receipt.toggleForAddInline=function(){if(ReceiptUI.isInlineAdd){var f="rcptIdInline_"+ReceiptUI.index;var e=$("#transReceiptId").val();var d="rcCardHashInline_"+ReceiptUI.index;var c=$("#rcCardHashInline_"+ReceiptUI.index).val();$("#"+f).val(e);$("#"+d).val(c);Receipt.toggleReceiptIcon(true)}};Receipt.processCardList=function(h){var f=h.listOfEnrolledCards.length;var d=[];for(var e=0;e<f;e++){d.push(h.listOfEnrolledCards[e].listJson);if(h.listOfEnrolledCards[e].listOfSuppCards!=null&&h.listOfEnrolledCards[e].listOfSuppCards.length>0){for(var c=0;
c<h.listOfEnrolledCards[e].listOfSuppCards.length;c++){d.push(h.listOfEnrolledCards[e].listOfSuppCards[c])}}}Receipt.cardList=d};Receipt.initAttachEvents=function(){if($("#attachbutton").length){$("#attachbutton").on("click",function(d){if($("#multiCardView").length&&"true"==$("#multiCardView").val()&&Receipt.tagObjJSON==null){var c=TagAction.fetchRCTags(null,null);c.done(function(){Receipt.attachReceipt(d)})}else{Receipt.attachReceipt(d)}});Omniture.report("RC_Shoebox_Continue")}if($("#attachcancel").length){$("#attachcancel").on("click",function(){ReceiptUI.isAttachView=false;
ReceiptUI.currentReceiptDtls=null;if(ReceiptUI.renderAttachReceiptWindow!=null&&ReceiptUI.renderAttachReceiptWindow.visible()){ReceiptUI.renderAttachReceiptWindow.close()}if(ReceiptUI.renderAddReceiptWindow!=null&&!ReceiptUI.renderAddReceiptWindow.visible()){ReceiptUI.renderAddReceiptWindow.open();ReceiptUI.renderAddReceiptWindow._focus.focus()}})}};Receipt.initAddEvents=function(){if($("#buttonLink").length){$("#buttonLink").on("click",ReceiptUI.renderAttachReceiptLayer)}if($("#cancelbutton").length){$("#cancelbutton").on("click",function(){if(ReceiptUI.renderAddReceiptWindow!=null&&ReceiptUI.renderAddReceiptWindow.visible()){ReceiptUI.renderAddReceiptWindow.close();
Receipt.resetAddReceiptLayer();if(!ReceiptUI.isInlineAdd){$("#existingReceipt").hide()}}if(!ReceiptUI.isInlineAdd){if(ReceiptUI.isMatchShoeboxView){if(ReceiptUI.matchReceiptWindow!=null&&!ReceiptUI.matchReceiptWindow.visible()){ReceiptUI.matchReceiptWindow.open();ReceiptUI.matchReceiptWindow._focus.focus()}}else{if(!ReceiptUI.isMatchShoeboxView){if(ReceiptUI.unmatchReceiptWindow!=null&&!ReceiptUI.unmatchReceiptWindow.visible()){ReceiptUI.unmatchReceiptWindow.open();ReceiptUI.unmatchReceiptWindow._focus.focus()
}}}}else{}})}};Receipt.initPrintEvents=function(){if($("#sbPreviewCancelButton").length){$("#sbPreviewCancelButton").on("click",function(){Print.closeShoeBoxPreview(true)})}if($("#printSbInd").length){$("#printSbInd").on("click",function(){Print.printShoeBoxPage()})}if($("#prSbPreviewCloseButton").length){$("#prSbPreviewCloseButton").on("click",function(){Print.closeShoeBoxPreview(true)})}};Receipt.initShoeboxEvents=function(){$("#toggleTerms_exp").on("click",Receipt.termsOpen);$("#toggleTerms_col").on("click",Receipt.termsClose);
$("#iFeedback").on("click",Receipt.expandImage);$("#iFeedback_bottom").on("click",Receipt.expandImage);$("#emailLink_edit").on("click",Receipt.emailEditLink);$("#unMatchLink").on("click",Receipt.viewUnmatchedSB);$("#shoeboxPrintLink").on("click",function(c){Omniture.report("RC_printreceipts");c.preventDefault();Receipt.shoeboxPrint()});$("#addEmailLink").on("click",Receipt.addEmail);$("#emailLink_save").on("click",Receipt.emailSave);$("#emailLink_cancel").on("click",Receipt.emailCancel);$("#closeMatchedButton_top").on("click",Receipt.closeMatchedLayer);
$("#closeMatchedButton_bottom").on("click",Receipt.closeMatchedLayer);$("#saveEmailId").focusout(Receipt.resetShoeboxEmail).focusin(Receipt.clearShoeboxEmail);$("#saveConfirmEmailId").focusout(Receipt.resetShoeboxConfirmEmail).focusin(Receipt.clearShoeboxConfirmEmail);$("#shoeboxPrivacyUrl").on("click",function(){window.open($("#privacyLink").val())});$("#shoeboxAddReceiptLink").on("click",function(c){c.preventDefault();Amex.OverlayManager.block("app");Receipt.enrollmentStatus=null;ReceiptUI.isInlineAdd=false;
if(ReceiptUI.renderAddReceiptWindow!=null){Receipt.resetAddReceiptLayer()}Receipt.init()});$("#sbqmark").on("click",ReceiptUI.showEnrollmentCallout);$("#sbqmark").on("mouseout",ReceiptUI.closeCallout);$("#sbaddqmark").on("click",ReceiptUI.showEnrollmentCallout);$("#sbaddqmark").on("mouseout",ReceiptUI.closeCallout);$("#qmarkimg5").on("click",ReceiptUI.showEnrollmentCallout);$("#qmarkimg5").on("mouseout",ReceiptUI.closeCallout)};Receipt.initUnmatchedEvents=function(){$("#unMatchTerms_exp").on("click",Receipt.termsUnmatchOpen);
$("#unMatchTerms_col").on("click",Receipt.termsUnmatchClose);$("#matchLink").on("click",Receipt.viewMatchedSB);$("#closeUnmatchedButton_top").on("click",Receipt.closeUnmatchedLayer);$("#closeUnmatchedButton_bottom").on("click",Receipt.closeUnmatchedLayer);$("#unmatchedAddReceiptLink").on("click",function(c){c.preventDefault();Amex.OverlayManager.block("app");Receipt.enrollmentStatus=null;ReceiptUI.isInlineAdd=false;if(ReceiptUI.renderAddReceiptWindow!=null){Receipt.resetAddReceiptLayer()}Receipt.init()
});$("#unMatchPrintLink").on("click",function(c){c.preventDefault();Omniture.report("RC_print_unmatched");Receipt.unmatchPrint()});$("#unmatchedFeedback").on("click",Receipt.expandImage);$("#unmatchedFeedback_bottom").on("click",Receipt.expandImage);$("#qmarkimg6").on("click",ReceiptUI.showEnrollmentCallout);$("#qmarkimg6").on("mouseout",ReceiptUI.closeCallout)};Receipt.closeMatchedLayer=function(c){ReceiptUI.isMatchShoeboxView=false;if($("#matched").length&&$("#matched").is(":ui-shoebox")){$("#matched").shoebox("destroy")
}if(null!=ReceiptDropDown.card){ReceiptDropDown.card.options.menu.close()}if(null!=ReceiptDropDown.period){ReceiptDropDown.period.options.menu.close()}if(ReceiptUI.matchReceiptWindow!=null&&ReceiptUI.matchReceiptWindow.visible()){ReceiptUI.matchReceiptWindow.close()}if($("#shoeboxAddReceiptLink").is(":visible")){$("#shoeboxAddReceiptLink").hide()}Amex.OverlayManager.unblock(false,"app")};Receipt.closeUnmatchedLayer=function(c){ReceiptUI.isMatchShoeboxView=false;if($("#unmatched").length&&$("#unmatched").is(":ui-shoebox")){$("#unmatched").shoebox("destroy")
}if(ReceiptUI.unmatchReceiptWindow!=null&&ReceiptUI.unmatchReceiptWindow.visible()){ReceiptUI.unmatchReceiptWindow.close()}if($("#unmatchedAddReceiptLink").is(":visible")){$("#unmatchedAddReceiptLink").hide()}Amex.OverlayManager.unblock(false,"app")};Receipt.termsUnmatchOpen=function(c){$("#unmatchedFeedback_bottom").css({"margin-left":"340px"});$("#unmatchedFeedback").hide();$("#unmatchedFeedback_bottom").show();$("#closeUnmatchedButton_top").hide();$("#closeUnmatchedButton_bottom").show();$("#unMatchTerms_exp").hide();
$("#unMatchTerms_col").show();$("#unmatchReceiptButton_bottom").show();$("#showTerms_unmatch").css({display:"block","margin-top":"10px"});$("#unMatchTerms_col").focus();c.preventDefault()};Receipt.termsUnmatchClose=function(){$("#closeUnmatchedButton_bottom").hide();$("#closeUnmatchedButton_top").show();$("#unMatchTerms_col").hide();$("#unMatchTerms_exp").show();$("#unmatchReceiptButton_bottom").hide();$("#unmatchedFeedback_bottom").hide();$("#unmatchedFeedback").show();$("#showTerms_unmatch").css({display:"none"});
$("#unMatchTerms_exp").focus();event.preventDefault()};Receipt.termsOpen=function(c){$("#closeMatchedButton_top").hide();$("#toggleTerms_exp").hide();$("#toggleTerms_col").show();$("#iFeedback").hide();$("#showTerms").css({display:"block","margin-top":"10px"});$("#toggleTerms_col").focus();c.preventDefault()};Receipt.termsClose=function(c){if(null!=c){c.preventDefault()}$("#closeMatchedButton_top").show();$("#toggleTerms_col").hide();$("#toggleTerms_exp").show();$("#iFeedback").show();$("#showTerms").css({display:"none"});
$("#toggleTerms_exp").focus()};Receipt.expandImage=function(c){if(null!=c){c.preventDefault()}if(typeof(OOo)!="undefined"){var d=new OOo.Ocode({referrerRewrite:{searchPattern:/:\/\/[^\/]*/,replacePattern:"://receiptcapture.americanexpress.com"},tealeafCookieName:TLTSID});d.show()}};Receipt.emailSave=function(c){if(null!=c){c.preventDefault()}if(Receipt.emailEnrollType=="save"){Receipt.emailView="shoeBoxView";Receipt.saveEmail()}else{if(Receipt.emailEnrollType=="update"){Receipt.updateEmail()}}};Receipt.emailCancel=function(d){if(null!=d){d.preventDefault()
}var c=$(d.target);c.parent().hide();var e=c.parent().parent().find("[id=displayEmailBlock]");e.show();if($("#emailAddress").val()!=""){e.children("[id=hasEmailBlock]").show()}else{e.children("[id=noEmailBlock]").show()}Receipt.resetMatchedFields()};Receipt.emailEditLink=function(f){if(null!=f){f.preventDefault()}$("#displayEmailBlock").css({display:"none"});$("#emailEditBlock").css({display:"block"});var d=$("#emailEditBlockCont");d.show();var c=$('<div class="emailEditBlockLoader"></div>').appendTo(d);
var e=d.find("#emailEditBlockTxtCont");e.hide();Receipt.callDCP($("#saveEmailId"),$("#saveConfirmEmailId"),c,e);Receipt.emailEnrollType="update";$("#saveEmailId").focus();Omniture.report("RC_email_edit")};Receipt.viewUnmatchedSB=function(c){if(null!=c){c.preventDefault()}$("#matched_addNewReceiptImg").off("click");$("#unmatchedAddReceiptLink").hide();ReceiptUI.isMatchShoeboxView=false;ReceiptUI.rctDtlClose=true;Omniture.report("RC_view_unmatched");ReceiptUI.openUnMatchShoebox("matched")};Receipt.viewMatchedSB=function(c){if(null!=c){c.preventDefault()
}Omniture.report("RC_view_matched_myreceipts");$("#unmatched_addNewReceiptImg").off("click");$("#shoeboxAddReceiptLink").hide();ReceiptUI.isMatchShoeboxView=true;ReceiptUI.openMatchShoebox(null,"unmatched")};Receipt.shoeboxPrint=function(){if($("#shoeboxPrintLink").hasClass("shoeboxPrintDisable")){return false}Print.openShoeBoxPreview();Receipt.viewShoeBoxPreview()};Receipt.unmatchPrint=function(c){if(c!=null){c.preventDefault()}if($("#unMatchPrintLink").hasClass("shoeboxPrintDisable")){return false
}Print.openShoeBoxPreview();Receipt.viewUnmatchPreview()};Receipt.addEmail=function(h){var e=$(h.target);e.parent().hide();e.parent().parent().parent().find(".emailEditFields").show();var d=$("#emailEditBlockCont");d.show();var c=$('<div class="emailEditBlockLoader"></div>').appendTo(d);var f=d.find("#emailEditBlockTxtCont");f.hide();Receipt.callDCP($("#saveEmailId"),$("#saveConfirmEmailId"),c,f);Omniture.report("RC_email_add")};Receipt.clearShoeboxEmail=function(d){var c=$(d.target);if(Receipt.isDefaultEmailId(c.val())){c.val("");
c.select();if($("#saveEmailId").hasClass("inputFieldError")){$("#saveEmailId").removeClass("inputFieldError")}}else{if($("#saveEmailId").hasClass("inputFieldError")){$("#saveEmailId").removeClass("inputFieldError")}}};Receipt.clearShoeboxConfirmEmail=function(d){var c=$(d.target);if(Receipt.isDefaultConfirmEmailId(c.val())){c.val("");c.select();if($("#saveConfirmEmailId").hasClass("inputFieldError")){$("#saveConfirmEmailId").removeClass("inputFieldError")}}else{if($("#saveConfirmEmailId").hasClass("inputFieldError")){$("#saveConfirmEmailId").removeClass("inputFieldError")
}}};Receipt.resetShoeboxEmail=function(e){var d=$(e.target);if(d.val()==""){d.val(Receipt.emailTitle);if($("#saveEmailId").hasClass("inputFieldError")){$("#saveEmailId").removeClass("inputFieldError")}}else{var c=(d.val()).replace(/~_/,"_");c=(c).replace(/~%/,"%");d.val(c)}};Receipt.resetShoeboxConfirmEmail=function(e){var d=$(e.target);if(d.val()==""){d.val(Receipt.confirmEmailTitle);if($("#saveConfirmEmailId").hasClass("inputFieldError")){$("#saveConfirmEmailId").removeClass("inputFieldError")}}else{var c=(d.val()).replace(/~_/,"_");
c=(c).replace(/~%/,"%");d.val(c)}};Receipt.getImageObject=function(d){var c={imageId:d.receiptID,thumbnailURL:d.thumbImgURL,downloadImgURL:d.downloadImgURL,mediumImgURL:d.mediumImgURL,zoomURL:d.zoomImgURL};return c};Receipt.attachReceipt=function(q){if(ReceiptUI.currentReceiptDtls!=null){Amex.OverlayManager.block("app")}else{$("#attachMessage").html(ReceiptUI.fileAttachError);$("#attachError").show();return}var t=ReceiptUI.currentReceiptDtls;var v=t.tagDetails;var l=t.qBTagGrpDetails;var s=t.qbTagCOADetails;
var u=t.qbTagCustomerDetails;var n=t.qbTagClassDetails;var m=t.QbBillableIndicator;var r=t.qbTagsBillableDetails;var c=[];var p=[];if(s!==undefined){p.push(s)}if(u!==undefined){p.push(u)}if(n!==undefined){p.push(n)}if(r!==undefined){p.push(r)}var h=TagList.getTagList();if($("#multiCardView").length&&"true"==$("#multiCardView").val()&&Receipt.tagObjJSON!=null){h=Receipt.tagObjJSON}if(null!=v&&null!=v.tagList&&null!=h){$.each(v.tagList,function(e,w){$.each(h,function(y,x){if(x.id==w){c.push(x)}})})
}$("#rcRequestType").val("AttachReceipt");$("#transReceiptId").val(t.imageId);$("#matchedReceipt").val(true);$("#imageUrl").val(t.mediumImgURL);var d=[];var o=$("#multiCardView").val()=="true"?true:false;if(!o){d=formParameters.getParams("manageReceipt.do")}else{d=$("#"+Page.form.id).serialize()}var f=$.ajax("manageReceipt.do",{type:"POST",data:d,success:function(B,J,w){if(w.getResponseHeader("RCError")==null){if(B.status==true){$("#rcAuthToken").val(B.authtoken);var z=null;if(B.receiptDetails!=null){var L=B.receiptDetails.receiptDetails[0];
z=B.receiptDetails.receiptDetails}if(ReceiptUI.renderAttachReceiptWindow!=null&&ReceiptUI.renderAttachReceiptWindow.visible()){ReceiptUI.renderAttachReceiptWindow.close()}Amex.OverlayManager.unblock(false,"app");if(ReceiptUI.isInlineAdd){var A="rcptIdInline_"+ReceiptUI.index;var F=$("#transReceiptId").val();var D="rcCardHashInline_"+ReceiptUI.index;var C=$("#rcCardHashInline_"+ReceiptUI.index).val();$("#"+A).val(F);$("#"+D).val(C);Receipt.toggleReceiptIcon(true);if(c.length>0){try{if($("#multiCardView").length&&"true"!=$("#multiCardView").val()){TagUI.applySelected([ReceiptUI.index],c)
}TagAction.applyTag([ReceiptUI.index],c,$("#itag_"+ReceiptUI.index))}catch(M){}}if(!QB.isQBTransOpen&&p.length>0){try{TagAction.applyTag([ReceiptUI.index],p,$("#itag_"+ReceiptUI.index))}catch(M){}}if(QB.isQBTransOpen&&p.length>0){try{var P="";var I="";var y="";var K="";var E="";var x="";if($("#qb-trans-"+ReceiptUI.index+"").find(".col-status").find(".not-synced").length){if(s!=null&&s.category==="ACCOUNT"){K=s;P=$("#qb-trans-"+ReceiptUI.index+"").find("td.col-coa")}if(u!=null&&u.category==="CUSTOMER"){E=u;
I=$("#qb-trans-"+ReceiptUI.index+"").find("td.col-cust-job")}if(n!=null&&n.category==="CLASS"){x=n;y=$("#qb-trans-"+ReceiptUI.index+"").find("td.col-class")}if(P!==""){var N=P.find(".col-inner-content");var H=N.attr("data-tagid");var O=N.attr("data-tagname");if("_none"!==K.id){if("_none"===H){QBTags.manageReceiptQBTag(K,TagAction.action.APPLY_EXISTING_TAG,P,"",false)}}}if(I!==""){var N=I.find(".col-inner-content");var H=N.attr("data-tagid");var O=N.attr("data-tagname");if("_none"!==E.id){if("_none"===H){QBTags.manageReceiptQBTag(E,TagAction.action.APPLY_EXISTING_TAG,I,"",false)
}}}if(y!==""){var N=y.find(".col-inner-content");var H=N.attr("data-tagid");var O=N.attr("data-tagname");if("_none"!==x.id){if("_none"===H){QBTags.manageReceiptQBTag(x,TagAction.action.APPLY_EXISTING_TAG,y,"",false)}}}if(m!==undefined&&qbList.billableData!==null){var G={id:qbList.billableData[0].id,name:qbList.billableData[0].name,category:qbList.billableData[0].category};if(I!==""){QBTags.manageReceiptQBTag(G,TagAction.action.APPLY_EXISTING_TAG,I)}}}}catch(M){}}}ReceiptUI.OpenReceiptsDetails(t,ReceiptUI.index)
}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}},error:function(e){Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})};Receipt.updateShoebox=function(h){var d=h;var e=d.receipt;$("#rcRequestType").val("Geturl");$("#transReceiptId").val(e.receiptID);$("#matchedReceipt").val(ReceiptUI.isMatchShoeboxView);
$("#imageUrl").val(e.filename);$("#rcAuthToken").val($("#authToken").val());var m=Receipt.rcUploadEndTime-Receipt.rcUploadStartTime;$("#rcUploadTime").val(m);$("#rcUploadResCode").val(h.responseCode);$("#rcUploadedBrowser").val(Receipt.getBrowser());var l=[];var c=$("#multiCardView").val()=="true"?true:false;if(!c){l=formParameters.getParams("uploadReceiptLogAction.do")}else{l=$("#"+Page.form.id).serialize()}var f=$.ajax("uploadReceiptLogAction.do",{type:"POST",data:l,success:function(r,n,o){if(o.getResponseHeader("RCError")==null){if(r.status==true){$("#rcAuthToken").val(r.authtoken);
var q=null;if(r.receiptDetails!=null){q=r.receiptDetails.receiptDetails[0]}var p=Receipt.getImageObject(q);ReceiptUI.currentReceiptDtls=p;if(!ReceiptUI.isMatchShoeboxView&&$("#unmatched").is(":ui-shoebox")){$("#unmatched").shoebox("option","addImg",p)}Receipt.uploadedReceipt=true;if(ReceiptUI.renderAddReceiptWindow!=null&&ReceiptUI.renderAddReceiptWindow.visible()){ReceiptUI.renderAddReceiptWindow.close()}if(!ReceiptUI.isTopClosed){ReceiptUI.OpenReceiptsDetails(q,ReceiptUI.unmatchReceiptDetail)}else{ReceiptUI.isTopClosed=false
}}else{if(ReceiptUI.renderAddReceiptWindow!=null&&ReceiptUI.renderAddReceiptWindow.visible()){ReceiptUI.renderAddReceiptWindow.close()}}}else{if(ReceiptUI.renderAddReceiptWindow!=null&&ReceiptUI.renderAddReceiptWindow.visible()){ReceiptUI.renderAddReceiptWindow.close()}}},error:function(n){if(ReceiptUI.renderAddReceiptWindow!=null&&ReceiptUI.renderAddReceiptWindow.visible()){ReceiptUI.renderAddReceiptWindow.close()}}})};Receipt.escapeHTML=function(e){var c="";for(var d=0;d<e.length;d++){if(e.charAt(d)=="<"){c+="&lt;"
}else{if(e.charAt(d)==">"){c+="&gt;"}else{if(e.charAt(d)=="'"){c+="&#39;"}else{if(e.charAt(d)=='"'){c+="&quot;"}else{if(e.charAt(d)=="("){c+="&#040;"}else{if(e.charAt(d)==")"){c+="&#041;"}else{if(e.charAt(d)=="/"){c+="&#047;"}else{if(e.charAt(d)=="\\"){c+="&#092;"}else{c+=e.charAt(d)}}}}}}}}}return c};Receipt.unescapeHTML=function(d){var c="";c=d.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#39;/g,"'").replace(/&quot;/g,'"').replace(/&#040;/g,"(").replace(/&#041;/g,")").replace(/&#047;/g,"/").replace(/&#092;n/g,"\n").replace(/&#092;/g,"\\");
return c};Receipt.modifyHTML=function(d){var c="";c=d.replace("<",">").replace("(",")");return c};Receipt.logRCUploadTime=function(o,d,l){var p=Receipt.rcUploadEndTime-Receipt.rcUploadStartTime;$("#rcUploadTime").val(p);$("#rcUploadResCode").val(o);$("#rcUploadStatusTxt").val(d);$("#rcUploadedBrowser").val(Receipt.getBrowser());if(l!=null){var h=$("#roc_"+ReceiptUI.index+" .desc-trans");var c=h.text().trim();var m=c.replace(/\\/g,"\\").replace(/\"/g,'"');$("#rcMerchant").val(m)}$("#transReceiptId").val(l);
var e=[];var n=$("#multiCardView").val()=="true"?true:false;if(!n){e=formParameters.getParams("uploadReceiptLogAction.do")}else{e=$("#"+Page.form.id).serialize()}var f=$.ajax("uploadReceiptLogAction.do",{type:"POST",data:e,success:function(r,q,s){if(s.getResponseHeader("RCError")==null){}}});$("#transReceiptId").val("");$("#rcMerchant").val("")};Receipt.getBrowser=function(){if($.browser.msie){return"IE"}if($.browser.mozilla){return"Mozilla"}if($.browser.opera){return"Opera"}if($.browser.safari){return"Safari"
}if($.browser.webkit){return"Chrome"}else{return"Unknown"}};Receipt.toggleReceiptIcon=function(c){if(c){$("#addReceiptLink_"+ReceiptUI.index).removeClass("addReceiptLink");$("#addReceiptLink_"+ReceiptUI.index).addClass("editRcptLink");$("#addReceiptLink_"+ReceiptUI.index).find("img").attr({src:$("#locImages").val()+"/receipt-small.png",title:"View/Edit Receipt",alt:"View/Edit Receipt"});$("#addReceiptLink_"+ReceiptUI.index).attr({title:"View/Edit Receipt",alt:"View/Edit Receipt",id:"editRcptLink_"+ReceiptUI.index});
if(QB.isQBTransOpen){$("#qb-trans-"+ReceiptUI.index+"").find(".col-status").find(".icon-receipt").removeClass("add-receipt");$("#qb-trans-"+ReceiptUI.index+"").find(".col-status").find(".icon-receipt").addClass("view-receipt")}}else{$("#editRcptLink_"+ReceiptUI.index).removeClass("editRcptLink");$("#editRcptLink_"+ReceiptUI.index).addClass("addReceiptLink");$("#editRcptLink_"+ReceiptUI.index).find("img").attr({src:$("#locImages").val()+"/add-receipt-small.png",title:"Add Receipt",alt:"Add Receipt"});
$("#editRcptLink_"+ReceiptUI.index).attr({title:"Add Receipt",alt:"Add Receipt",id:"addReceiptLink_"+ReceiptUI.index});if(QB.isQBTransOpen){$("#qb-trans-"+ReceiptUI.index+"").find(".col-status").find(".icon-receipt").removeClass("view-receipt");$("#qb-trans-"+ReceiptUI.index+"").find(".col-status").find(".icon-receipt").addClass("add-receipt")}}};Receipt.callPznUrl=function(){if($("#PZNRMCTrackLink").val()!="#"){var c=document.createElement("img");c.src=$("#PZNRMCTrackLink").val();c.width=0;c.height=0;
document.body.appendChild(c)}};Receipt.callDCP=function(d,f,c,e){$("#unMaskeEmail").val(true);new $.ajax("dcp.do",{type:"POST",data:$("#"+Page.form.id).serialize(),async:false,timeout:2000,success:function(l,h,m){if(c!=undefined&&e!=undefined){c.fadeTo(300,0,function(){$(this).hide()});e.slideDown()}if(m.getResponseHeader("MYCAError")==null&&l.EmailAddress!=undefined){Receipt.serviceEmailID=l.EmailAddress}else{Receipt.serviceEmailID=null}},error:function(m,h,l){if(c!=undefined&&e!=undefined){c.fadeTo(300,0,function(){$(this).hide()
});e.slideDown()}d.val(Receipt.emailTitle);f.val(Receipt.confirmEmailTitle);Receipt.serviceEmailID=null}});$("#unMaskeEmail").val(false);if(Receipt.serviceEmailID!=null){d.val(Receipt.serviceEmailID);f.hide();f.val(Receipt.serviceEmailID);d.on("change input keyup",function(){f.show();f.val(Receipt.confirmEmailTitle)})}else{d.val(Receipt.emailTitle);f.val(Receipt.confirmEmailTitle)}d.bind("cut copy paste",function(h){h.preventDefault()});f.bind("cut copy paste",function(h){h.preventDefault()})};Receipt.checkReceiptEnrollStatus=function(){var c=true;
$("#rcRequestType").val("EnrollInfo");var d=$.ajax("receiptEnroll.do",{data:$("#"+Page.form.id).serialize(),type:"POST",success:function(h,e,f){if(f.getResponseHeader("RCError")==null){if(h.status==true){if(h.enrollStatus=="FALSE"){c=false;$(".receipt-match-widget").find(".widget-title").addClass("notenrolled");$(".receipt-enoll-status").html("Not Enrolled")}else{$(".receipt-match-widget").find(".widget-title").addClass("enrolled");$(".receipt-enoll-status").html("Enrolled");$("#manageReceipts span").html("Manage Receipts");
$("#manageReceipts").attr("title","Manage Your Receipt")}}else{$(".receipt-match-widget").find(".widget-title").addClass("notenrolled");$(".receipt-enoll-status").html("Not Enrolled")}}else{$(".receipt-match-widget").find(".widget-title").addClass("notenrolled");$(".receipt-enoll-status").html("Not Enrolled")}$("#manageReceipts").fadeIn()}});return c};Receipt.updateReceiptWidget=function(){if($(".receipt-match-widget").find(".widget-title").hasClass("notenrolled")){$(".receipt-match-widget").find(".widget-title").removeClass("notenrolled")
}$(".receipt-match-widget").find(".widget-title").addClass("enrolled");$("#manageReceipts .blueWrapper").html("Manage Your Receipts");$("#manageReceipts").attr("title","Manage Receipts");$(".receipt-enoll-status").html("Enrolled")};var ReceiptDropDown={card:null,period:null,ace:null,cardChnMsg:'Your Tag selection will not be maintained. All other choices will persist. Click "OK" to continue with your Card selection.',buttonNotSelected:'You must select a "View By" view to continue.',cardChnMsg2:'Your Tag selection will not be maintained. Click "OK" to continue with your Card selection.',eSDRLite:null,fromField:"startDateTxtRC",toField:"endDateTxtRC",go:"periodGoRC",validated:true};
ReceiptDropDown.init=function(){if(ReceiptDropDown.card==null){ReceiptDropDown.card=new Des.CardSelectButton("rcptCardSelect",{menuPosition:"bl",nextFocus:"rcptExpandTP",menu:{theme:"cardSelectMenu",left:0,top:0,width:320,position:"bl",shadow:{size:4,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}},items:Receipt.cardList,templates:{basic:$.template("<a href='#' title='' hidefocus='hidefocus' onclick='{return false;}'><span style='font-weight: bold;'>#{description}</span> - <span>#{account}</span></a>"),supp:$.template("<a href='#' title='' hidefocus='hidefocus' onclick='{return false;}'><span>#{name}</span> - <span>#{account}</span></a>")}});
ReceiptDropDown.card.options.menu.render("rcptCardSelect");var e=$("#aaRCLink");if(e.length){var c=new Amex.MenuItem("aaCard",e.show());ReceiptDropDown.card.options.menu.addItem(c)}ReceiptDropDown.card.off("change",ReceiptDropDown.changeCard);ReceiptDropDown.card.on("change",ReceiptDropDown.changeCard)}if(ReceiptDropDown.period==null){ReceiptDropDown.period=new Des.PeriodSelectButton("rcptPeriodSelect",{menuPosition:"bl",prevFocus:"rcptCardExpand",menu:{theme:"periodSelectMenu",left:0,top:0,width:287,position:"bl",shadow:{size:4,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}},items:Receipt.periodList,templates:{main:$.template("<a title='' href='#' hidefocus='hidefocus' onclick='{return false;}'><span style='float:left;width:130px;text-align:left;font-weight: bold;'>#{name}</span><span style='width:150px;margin-left:10px;text-align:left;'>#{description}&nbsp;</span><span class='tpClear'></span></a>"),sub:$.template("<a title='' hidefocus='hidefocus' href='#' onclick='{return false;}'><span style='width:130px;float:left;'>&nbsp;</span><span style='width:150px;margin-left:10px;text-align:left;white-space:nowrap;'>#{description}&nbsp;</span><span class='tpClear'></span></a>"),subMenu:$.template("<a title='' hidefocus='hidefocus' href='#' onclick='{return false;}'><span class='floatSubMenu'>#{description}</span><span class='tpClear'></span></a>")}});
ReceiptDropDown.period.options.menu.render("rcptPeriodSelect");ReceiptDropDown.period.off("change",ReceiptDropDown.changePeriod);ReceiptDropDown.period.off("open",ReceiptDropDown.revert);ReceiptDropDown.period.on("change",ReceiptDropDown.changePeriod);ReceiptDropDown.period.on("open",ReceiptDropDown.revert);var f=ReceiptDropDown.period.getSelected();if(f&&f.zeroBiller){$("#zeroBiller").val(f.zeroBiller)}else{$("#zeroBiller").val("false")}}var d=new Amex.MenuItem("");d.update($("#rcCustomPeriod").show());
d.css({padding:"0px"});d._selectable=true;ReceiptDropDown.period.getMenu().addItem(d);$("#rcCustomPeriod").click(function(h){h.stopPropagation()});d._focus=$("#"+ReceiptDropDown.fromField);d._hover=false;$("#"+ReceiptDropDown.fromField).focus(CustomPeriod.focus);$("#"+ReceiptDropDown.toField).focus(CustomPeriod.focus);$("#"+ReceiptDropDown.fromField).blur(ReceiptDropDown.blur);$("#"+ReceiptDropDown.toField).blur(ReceiptDropDown.blur);$("#"+ReceiptDropDown.fromField).keydown(function(h){if(h.which===Amex.KEY_TAB){if(h.shiftKey){$("#"+ReceiptDropDown.go).focus()
}else{$("#"+ReceiptDropDown.toField).focus()}}else{h.stopPropagation()}});$("#"+ReceiptDropDown.toField).keydown(function(h){if(h.keyCode===Amex.KEY_TAB){if(h.shiftKey){$("#"+ReceiptDropDown.fromField).focus()}else{$("#"+ReceiptDropDown.go).focus()}}else{h.stopPropagation()}});$("#"+ReceiptDropDown.go).keydown(function(h){if(h.keyCode===Amex.KEY_TAB){if(h.shiftKey){$("#"+ReceiptDropDown.toField).focus()}else{$("#"+ReceiptDropDown.fromField).focus()}}else{h.stopPropagation()}});$("#"+ReceiptDropDown.fromField).datepicker({showOn:"button",buttonImage:$("#locImages").val()+"/icon_dropcalendar.png",buttonImageOnly:true,buttonText:"Open calendar for Start Date",showButtonPanel:true,showOtherMonths:true,selectOtherMonths:true,minDate:CustomPeriod.rcMinDate,maxDate:CustomPeriod.maxDate,defaultDate:null,changeMonth:true,changeYear:true,beforeShow:function(){ReceiptDropDown.period.options.menu.closeSubmenus();
var h=Date.parseString($("#"+ReceiptDropDown.fromField).val(),"M/d/y");if(h){$("#"+ReceiptDropDown.fromField).val(h.format("MM/dd/yyyy"))}else{$("#"+ReceiptDropDown.fromField).val((new Date()).format("MM/dd/yyyy"))}}});$("#"+ReceiptDropDown.fromField).datepicker("widget").click(function(h){h.stopPropagation()});$("#"+ReceiptDropDown.toField).datepicker({showOn:"button",buttonImage:$("#locImages").val()+"/icon_dropcalendar.png",buttonImageOnly:true,buttonText:"Open calendar for Start Date",showButtonPanel:true,showOtherMonths:true,selectOtherMonths:true,minDate:CustomPeriod.rcMinDate,maxDate:CustomPeriod.maxDate,defaultDate:null,changeMonth:true,changeYear:true,beforeShow:function(){ReceiptDropDown.period.options.menu.closeSubmenus();
var h=Date.parseString($("#"+ReceiptDropDown.toField).val(),"M/d/y");var l=Date.parseString($("#"+ReceiptDropDown.fromField).val(),"M/d/y");if(h){if(l&&l.isBefore(h)){CustomPeriod.setTo(h)}else{CustomPeriod.setTo(l)}}else{if(l&&l.isBefore(CustomPeriod.maxDate)){CustomPeriod.setTo(l)}else{CustomPeriod.setTo(new Date())}}}});$("#"+ReceiptDropDown.toField).datepicker("widget").click(function(h){h.stopPropagation()});$("#"+ReceiptDropDown.toField).datepicker("widget").addClass("amexCalendar");$(".ui-datepicker").off("change",ReceiptDropDown.onDatePickerChange);
$(".ui-datepicker").on("change",ReceiptDropDown.onDatePickerChange);$(".ui-datepicker-trigger").bind("click",function(){$("#ui-datepicker-div").css("z-index","7100")});$("#"+ReceiptDropDown.go).unbind("click");$("#"+ReceiptDropDown.go).bind("click",function(){ReceiptDropDown.goClick()});$("#rcptCardExpand").on("click",function(h){h.preventDefault()});$("#rcptExpandTP").on("click",function(h){h.preventDefault()})};ReceiptDropDown.onDatePickerChange=function(e){var f=e.target;if($(f).hasClass("ui-datepicker-year")||$(f).hasClass("ui-datepicker-month")){var d=$("#shoeboxWindow .periodSelectMenu");
var c=d.length-1;Amex._internal.ignoreAutoClose=$(d[c]).closest("div").attr("id")}};ReceiptDropDown.checkSuppelg=function(d){var c=$(Page.form.reportType).val();return((c=="4"||c=="5")&&(ReceiptDropDown.card.getSelected().template=="supp"))};ReceiptDropDown.changeCard=function(e,c){if(e!=null){e.preventDefault()}var f=c.object;$("#rcSortedIndex").val(f.index);$("#rcSuppIndex").val(f.supp);$("#receiptIds").val("");$("#rcCardChange").val("true");if(ReceiptDropDown.period.getSelected()!=null){var d=ReceiptDropDown.period.getSelected();
$("#rcBPIndex").val(d.BPIndex);$("#receiptStartDate").val("");$("#receiptEndDate").val("")}ReceiptDropDown.changeCardList();ReceiptDropDown.resetValues();Omniture.report("RC_cardchange")};ReceiptDropDown.isLiteCard=function(d){var c=$("#cardsInLite").val();if(c.indexOf(d+",")!=-1){return true}else{return false}};ReceiptDropDown.changePeriod=function(c,e){if(c!=null){c.preventDefault()}var d=e.object.getSelected();$("#rcSortedIndex").val(ReceiptDropDown.card.getSelected().index);$("#rcSuppIndex").val(ReceiptDropDown.card.getSelected().supp);
$("#rcBPIndex").val(d.BPIndex);$("#receiptStartDate").val(d.startDate);$("#receiptEndDate").val(d.endDate);$("#receiptIds").val("");ReceiptDropDown.changeTimePeriod();ReceiptDropDown.resetValues();Omniture.report("RC_periodchange")};ReceiptDropDown.changeTimePeriod=function(d,c){Receipt.resetMatchedFields();ReceiptUI.openMatchShoebox(null,null)};ReceiptDropDown.changeCardList=function(d,c){Receipt.resetMatchedFields();ReceiptUI.openMatchShoebox(null,null)};ReceiptDropDown.goClick=function(e){if(e!=null){e.preventDefault()
}ReceiptDropDown.validated=true;CustomPeriod.validate(ReceiptDropDown,true);if(ReceiptDropDown.validated){$("#rcSortedIndex").val(ReceiptDropDown.card.getSelected().index);$("#rcSuppIndex").val(ReceiptDropDown.card.getSelected().supp);var d=Date.parseString($("#"+ReceiptDropDown.fromField).val(),"M/d/y");var c=Date.parseString($("#"+ReceiptDropDown.toField).val(),"M/d/y");$("#rcBPIndex").val(-99);$("#receiptStartDate").val(d.format("MMddyyyy"));$("#receiptEndDate").val(c.format("MMddyyyy"));$("#receiptIds").val("");
ReceiptDropDown.changeTimePeriod();Omniture.report("period_change","TimePeriod:Date Range");ReceiptDropDown.resetValues()}};ReceiptDropDown.resetValues=function(){$("#rcCardChange").val("")};ReceiptDropDown.revert=function(c){if($("#rcBPIndex").val()!=-99){$("#"+ReceiptDropDown.fromField).val("MM/DD/YYYY");$("#"+ReceiptDropDown.toField).val("MM/DD/YYYY");$("#"+ReceiptDropDown.fromFieldRC).val("MM/DD/YYYY");$("#"+ReceiptDropDown.toFieldRC).val("MM/DD/YYYY")}else{$("#"+ReceiptDropDown.fromField).val(Date.parseString($("#receiptStartDate").val(),"MMddyyyy").format("MM/dd/yyyy"));
$("#"+ReceiptDropDown.toField).val(Date.parseString($("#receiptEndDate").val(),"MMddyyyy").format("MM/dd/yyyy"))}};ReceiptDropDown.blur=function(e){var d=$(e.target);if(d.val().isBlank()){d.val("MM/DD/YYYY")}else{if(d.val().replace(/\s/g,"").toUpperCase()!="MM/DD/YYYY"){var c=Date.parseString(d.val(),"M/d/y");if(c){d.val(c.format("MM/dd/yyyy"));if(c.isBefore(CustomPeriod.rcMinDate)||c.isAfter(CustomPeriod.maxDate)){d.css({backgroundColor:"#FAFA9E"})}}else{d.css({backgroundColor:"#FAFA9E"})}}}};var ReceiptUI={isMatchShoeboxView:false,isAttachView:false,receiptDtls:null,currentReceiptDtls:null,showView:null,isEtdReceiptDtlView:false,enrollmentCalloutMsg:"Entering your email address here will not change any email addresses you have on file for your Card account(s). Please visit Profiles & Preferences to adjust your existing email settings.",index:"",fileSizeError:"Receipt file must be under 5MB and in a format listed below. Please try again.",fitidEmptyError:"System Error. Please try again.",emailUpdateError:"There was an error updating your email address. Please try again later.",fileExistError:"Upload a receipt or select a receipt on file to continue.",fileAttachError:"Please select a receipt to continue.",emailAddressNotMatchErrMsg:"Entered email addresses do not match.",invalidEmailMsg:"Please enter a valid email address.",termsAndCondErrMsg:"Please accept Terms of Use to proceed.",requiredEmailErrMsg:"Please enter a valid email address to continue.",duplicateEmailErr:"The email address you provided is already in use.",genericError:"We are experiencing intermittent delays. Please try again later.",unmatchReceiptDetail:"<div id='printnone'><div class='messageID'>This receipt is not matched to a transaction.<br><br><strong>A receipt may be unmatched for the following reasons:</strong></div><ul class='receiptList'><li class='messageID'>The receipt was recently uploaded, and is queued for scanning.</li><li class='messageID'>The receipt has been scanned, but the matching transaction is in pending status.</li><li class='messageID'>The receipt has been scanned, but the receipt image cannot be read in enough details to enable a match.</li><li class='messageID'>The receipt is for a transaction that is more than 10 months old, and cannot be automatically matched to a transaction at this time.</li></ul></div>",isInlineAdd:false,isInlineView:false,addReceiptHTML:null,detachReceiptHTML:null,deleteReceiptHTML:null,attachReceiptHTML:null,matchHTML:null,unmatchHTML:null,isEnrollmentFlow:false,isTopClosed:false,viewReceiptDetails:null,matchedPrintCalloutMsg:"Clicking Print will print receipt details for all receipts in the selection criteria, up to a maximum of 50. If more than 50 receipts are displayed, receipt details will print for all receipts on the page currently being viewed.",unmatchedPrintCalloutMsg:"Receipt details will print for all receipts on the page currently being viewed.",rctDtlClose:true,exRocDetails:null};
ReceiptUI.showEnrollmentCallout=function(e){var c="left";var d=ReceiptUI.enrollmentCalloutMsg;if($(this).attr("id")=="sbqmark"||$(this).attr("id")=="sbaddqmark"){c="right"}else{if($(this).attr("id")=="qmarkimg5"){d="<span style='font-weight:normal;'>"+ReceiptUI.matchedPrintCalloutMsg+"</span>"}else{if($(this).attr("id")=="qmarkimg6"){d="<span style='font-weight:normal;'>"+ReceiptUI.unmatchedPrintCalloutMsg+"</span>"}}}if($(this).is(":ui-callout")){$(this).callout("toggle")}else{$(this).callout({direction:c,width:300,closeButton:true,content:$('<p style="background-color:white;color: #4D4F53;font-size: 12px;line-height: 14px;">'+d+"</p>")})
}return false};ReceiptUI.closeCallout=function(c){if($(this).is(":ui-callout")){$(this).callout("destroy")}};ReceiptUI.openEnrollmentLayer=function(){ReceiptUI.isEnrollmentFlow=true;Receipt.resetEnrollmentLayer();if(ReceiptUI.manageReceiptWindow==null){ReceiptUI.manageReceiptWindow=new Amex.Window({modal:true,draggable:false,theme:"amexWindow",buttons:["close"],title:"ReceiptMatch Enrollment",shadow:{size:6,color:"#666666"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){return true
}});ReceiptUI.manageReceiptWindow.update($("#manageYourReceipts").html());$("#manageYourReceipts").remove();ReceiptUI.manageReceiptWindow.render(Page.form.id);Receipt.bindEnrollmentEvents()}Amex.OverlayManager.unblock(false,"app");ReceiptUI.manageReceiptWindow.centerInViewport();ReceiptUI.manageReceiptWindow.title.hide();ReceiptUI.manageReceiptWindow.open();ReceiptUI.manageReceiptWindow._focus.focus();Omniture.report("RC_Enroll_Load")};ReceiptUI.OpenReceiptsDetails=function(y,f){ReceiptUI.isAttachView=false;
if(ReceiptUI.viewReceiptDetails==null){ReceiptUI.viewReceiptDetails=$("#receiptDetails").html();$("#receiptDetails").remove()}if(($("#rcRequestType").val()=="InlineAdd")||($("#rcRequestType").val()=="AttachReceipt")){ReceiptUI.isInlineAdd=true;Receipt.uploadedReceipt=true}if(ReceiptUI.openReceiptDtlWindow==null){ReceiptUI.openReceiptDtlWindow=new Amex.Window({modal:true,theme:"amexWindow",buttons:["close"],title:"Receipt Details",shadow:{size:6,color:"#666666"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){if($("#receiptDtlImg").is(":ui-zoomer")){$("#receiptDtlImg").zoomer("destroy")
}setTimeout(function(){ReceiptUI.closeDetailsWindow()},200);return true}});if(ReceiptUI.showView=="receiptDtls"){ReceiptUI.openViewEditDetailsWindow(y)}else{ReceiptUI.openReceiptDtlWindow.update(ReceiptUI.viewReceiptDetails)}}else{if(ReceiptUI.showView=="receiptDtls"){ReceiptUI.openViewEditDetailsWindow(y)}}if($("#rcRequestType").val()=="InlineAdd"||$("#rcRequestType").val()=="ViewReceipt"||$("#rcRequestType").val()=="AttachReceipt"){$("#archiveReceiptDelMsg").hide();$("#receiptDelMsg").show();if($("#qbReceiptDeepLink").val()=="true"){try{var D=ReceiptUI.index;
var B=ReceiptUI.exRocDetails.exROCData[0].txnDescription;var F=$("#transactionDate").val();if(null!=ReceiptUI.exRocDetails.exROCData[0].memberName){cmName=ReceiptUI.exRocDetails.exROCData[0].memberName;if(cmName!=null&&cmName!=""){$("#receipt_name").show();$("#receipt_name").html("<strong>Cardmember Name: </strong>"+cmName)}}if(null!=ReceiptUI.exRocDetails.exROCData[0].amount){amount=ReceiptUI.exRocDetails.exROCData[0].amount}$("#receiptTrnDtlLayer1").html("<strong>Date: </strong>"+F);$("#receiptTrnDtlLayer2").html(B);
$("#receiptTrnDtlLayer_amt").html("$ "+amount);$("#receiptTrnDtlLayer3").html(D)}catch(C){}}else{var D=$("#droc_"+f).html();var c="";var B="";var F="";if(QB.isQBTransOpen){c=$("#qb-trans-"+f+" td.col-desc").text().trim();B=c.replace(/\\/g,"\\").replace(/\"/g,'"');F=$("td.col-date-hidden","#qb-trans-"+f).text().trim();if(null!=$("#qb-trans-"+f+" td.col-cm")){cmName=$("#qb-trans-"+f+" td.col-cm").text()}if(null!=$("#qb-trans-"+f+" td.colAmmount")){amount=$("td.col-amount","#qb-trans-"+f).text().trim()
}}else{c=$("#roc_"+f+" .desc-trans");B=c.text().trim();F=$("#date_roc_"+f).attr("data-date").trim();if(null!=$("#roc_"+f+" td.colName")){cmName=$("#roc_"+f+" td.colName").text()}if(null!=$("#roc_"+f+" td.colAmmount")){amount=$("#roc_"+f+" td.colAmmount").text()}}$("#receiptTrnDtlLayer1").html("<strong>Date: </strong>"+F);$("#receiptTrnDtlLayer2").html(B);if(cmName!=null&&cmName!=""){$("#receipt_name").show();$("#receipt_name").html("<strong>Cardmember Name: </strong>"+cmName)}$("#receiptTrnDtlLayer_amt").html(amount);
if(QB.isQBTransOpen){$("#receiptTrnDtlLayer3").html($("#qb-trans-"+ReceiptUI.index).data("qb-trans-"+ReceiptUI.index))}else{$("#receiptTrnDtlLayer3").html($("#roc_"+ReceiptUI.index).data("roc_"+ReceiptUI.index))}}}else{ReceiptUI.currentReceiptDtls=y;var u="We are experiencing intermittent delays. Please try again later.";var r="";if($("#rcRequestType").val()=="Geturl"||!ReceiptUI.isMatchShoeboxView){Amex.Util.hideElements("receiptTrnDtlLayer2","receipt_desc","receipt_name","receipt_amt","receiptTrnDtlLayer1");
$("#rcptTitle").addClass("unmatchTitle");$("#hrDivider").addClass("unmatchTitle");if($("#multiCardView").length&&"true"!=$("#multiCardView").val()){if(y.tagDetails!=null&&y.tagDetails.tagList!=null&&y.tagDetails.tagList.length>0){var p=y.tagDetails.tagList.length;var E="";var o;for(i=0;i<y.tagDetails.tagList.length;i++){if(i===0){o=TagList.getTagObjForId(Receipt.tagObjJSON,y.tagDetails.tagList[i]);if(o!=null){E="<span>"+o.name+"</span>"}}else{o=TagList.getTagObjForId(Receipt.tagObjJSON,y.tagDetails.tagList[i]);
if(o!=null){if(E!=null&&E!=""){E=E+", "}E=E+"<span class='tagElementStyle'>"+o.name+"</span>"}}}if(E!=null&&E!=""){var h="<div class='rmTagSection'><div style='margin-bottom : 5px'><strong>TAGS</strong></div><hr class='trnsDtlDivider' id='userTagDivider'><div class='tagSpanList'>"+E+"</div></div>";f=f+h}var n=y.qbTagfetchingerror;if(n!=undefined&&n!=null&&n!=""){r="<div style='margin-top : 5px; color: red;'><strong>"+u+"</strong></div>"}var x=y.QbclassTagDetails;var s=y.QbexpenseTagDetails;var z=y.QbBillableIndicator;
var d=y.QbcustomerTagDetails;var A=y.qbClassPreference;var w=y.qbCustomerPreference;if(x!==undefined&&x!=null&&x!=""){x=ReceiptUI.splitQbColon(x)}if(s!==undefined&&s!=null&&s!=""){s=ReceiptUI.splitQbColon(s)}if(d!==undefined&&d!=null&&d!=""){d=ReceiptUI.splitQbColon(d)}var H="";var t="";var l="";var G="";var v="";if(E==null||E==""){if((s!=null&&s!="")||(d!=null&&d!="")||(x!=null&&x!="")){v="<div style='margin-top : 160px'><div style='margin-bottom : 5px'><strong>QUICKBOOKS INFORMATION</strong></div><hr class='trnsDtlDivider' id='qbTagDivider'></div>"
}if(s!=null&&s!=""){t="<div class='tagElementStyle'><strong><span style='margin-top:10px'>Expense Category: </span></strong><div style='margin-left: 108px; margin-top: -12px;'>"+s+"</div></div>"}if(d!=null&&d!=""&&w!=null&&w){l="<div class='tagElementStyle'><strong><span style='margin-top:10px'>Customer:Job: </span></strong><div style='margin-left: 90px; margin-top: -12px;'>"+d;if(z!=null&&z!=""){l=l+"&nbsp;<span>(<i>"+z+"</i>)</span>"}l=l+"</div></div>"}if(x!=null&&x!=""&&A!=null&&A){G="<div class='tagElementStyle'><strong><span style='margin-top:10px'>Class: </span></strong><div style='margin-left: 40px; margin-top: -12px;'>"+x+"</div></div></div>"
}if(r!=""){v="<div style='margin-top : 160px'><div style='margin-bottom : 5px'><strong>QUICKBOOKS INFORMATION</strong></div><hr class='trnsDtlDivider' id='qbTagDivider'></div>";f=f+v+r}else{f=f+v+t+l+G}}else{if((s!=null&&s!="")||(d!=null&&d!="")||(x!=null&&x!="")){v="<div style='margin-top : 25px'><div style='margin-bottom : 5px'><strong>QUICKBOOKS INFORMATION</strong></div><hr class='trnsDtlDivider' id='qbTagDivider'></div>"}if(s!=null&&s!=""){t="<div class='tagElementStyle'><strong><span style='margin-top:10px'>Expense Category: </span></strong><div style='margin-left: 108px; margin-top: -12px;'>"+s+"</div></div>"
}if(d!=null&&d!=""&&w!=null&&w){l="<div class='tagElementStyle'><strong><span style='margin-top:10px'>Customer:Job: </span></strong><div style='margin-left: 90px; margin-top: -12px;'>"+d;if(z!=null&&z!=""){l=l+"&nbsp;<span>(<i>"+z+"</i>)</span>"}l=l+"</div></div>"}if(x!=null&&x!=""&&A!=null&&A){G="<div class='tagElementStyle'><strong><span style='margin-top:10px'>Class: </span></strong><div style='margin-left: 40px; margin-top: -12px;'>"+x+"</div></div></div>"}if(r!=""){v="<div style='margin-top : 25px'><div style='margin-bottom : 5px'><strong>QUICKBOOKS INFORMATION</strong></div><hr class='trnsDtlDivider' id='qbTagDivider'></div>";
f=f+v+r}else{f=f+v+t+l+G}}}}}else{$("#receiptTrnDtlLayer1").html("<strong>Date: </strong>"+y.descLine1);$("#receiptTrnDtlLayer2").html(y.descLine2);if(y.memberName!=null&&y.memberName!=""){$("#receipt_name").show();$("#receipt_name").html("<strong>Cardmember Name: </strong>"+y.memberName)}$("#receiptTrnDtlLayer_amt").html(y.descLine5)}$("#receiptTrnDtlLayer3").html(f)}if($("#rcRequestType").val()!="ViewReceipt"){$("#receiptDtlImg").removeAttr("src");$("#downloadImgId").val(y.downloadImgURL);if($("#rcRequestType").val()=="Geturl"||$("#rcRequestType").val()=="InlineAdd"){$("#zoomImgId").val(y.zoomImgURL);
$("#receiptDtlImg").attr("src",y.zoomImgURL)}else{$("#zoomImgId").val(y.zoomURL);$("#receiptDtlImg").attr("src",y.zoomURL)}}if(null!=y.comments&&y.comments.trim().length>0){var q=y.comments;if($.browser.msie){q=Receipt.unescapeHTML(q);$("#receiptCommentsTxt").val(q)}else{$("#receiptCommentsTxt").text(q.replace(/&#092;n/g,"\n"));$("#receiptCommentsTxt").html($("#receiptCommentsTxt").text());$("#receiptCommentsTxt").val($("#receiptCommentsTxt").text())}}ReceiptUI.updateDetailsLayer();Receipt.bindReceiptDetailsEvents();
Amex.OverlayManager.unblock(false,"app");ReceiptUI.openReceiptDtlWindow.centerInViewport();var m=$("#receiptDtlImg");if(!$("#zoomImgId").val().isBlank()){$("#receiptDtlImg").loadimg({complete:function(e){if(e){$("#receiptDtlImg").zoomer({round:true})}}})}ReceiptUI.openReceiptDtlWindow.title.hide();ReceiptUI.openReceiptDtlWindow.open();ReceiptUI.openReceiptDtlWindow._focus.focus()};ReceiptUI.closeDetailsWindow=function(){if(Receipt.noteSaveStatus){Amex.OverlayManager.block("app");Receipt.updateComments($("#receiptCommentsTxt").val(),"topClose")
}if($("#qbReceiptDeepLink").val()=="true"){$("#qbReceiptDeepLink").val(false);ReceiptUI.index="";Receipt.noteSaveStatus=false}ReceiptUI.isInlineView=false;ReceiptUI.openReceiptDtlWindow.update(ReceiptUI.viewReceiptDetails);if(ReceiptUI.showView=="shoebox"){if(($("#rcRequestType").val()=="Geturl"&&$("#rcRequestType").val()!="InlineAdd")||Receipt.uploadedReceipt){ReceiptUI.rctDtlClose=false;if(ReceiptUI.matchReceiptWindow!=null&&ReceiptUI.matchReceiptWindow.visible()){ReceiptUI.matchReceiptWindow.close()
}if(Receipt.noteSaveStatus||ReceiptUI.isMatchShoeboxView){ReceiptUI.openUnMatchShoebox(null)}else{if(ReceiptUI.unmatchReceiptWindow!=null){ReceiptUI.unmatchReceiptWindow.open();ReceiptUI.unmatchReceiptWindow._focus.focus()}}}else{if(ReceiptUI.isMatchShoeboxView&&ReceiptUI.showView=="shoebox"){if(ReceiptUI.matchReceiptWindow!=null){ReceiptUI.matchReceiptWindow.open();ReceiptUI.matchReceiptWindow._focus.focus()}}else{if(!ReceiptUI.isMatchShoeboxView&&ReceiptUI.showView=="shoebox"){if(ReceiptUI.unmatchReceiptWindow!=null){ReceiptUI.unmatchReceiptWindow.open();
ReceiptUI.unmatchReceiptWindow._focus.focus()}}}}}};ReceiptUI.openViewEditDetailsWindow=function(c){ReceiptUI.openReceiptDtlWindow.update(c);if(Receipt.duplicateEmail){$("#rcptDtlsErrMsg").html(ReceiptUI.duplicateEmailErr);$("#rcptDetailErr").show();Receipt.duplicateEmail=false}};ReceiptUI.updateDetailsLayer=function(){if($("#rcRequestType").val()=="InlineAdd"||$("#rcRequestType").val()=="Geturl"||$("#rcRequestType").val()=="AttachReceipt"){$("#noteId").html("<strong>Notes</strong>");$("#detailButton").html("<button type='button' id='detailFinish' title='Finish' class='lastFocus blueButton'><span class='blueWrapper'>Finish</span></button>");
ReceiptUI.openReceiptDtlWindow._setFocusCycle("detailFinish")}else{$("#noteId").html("<strong>Notes</strong>");$("#detailButton").html("<button type='button' id='detailClose' title='Close' class='lastFocus blueButton'><span class='blueWrapper'>Close</span></button>");ReceiptUI.openReceiptDtlWindow._setFocusCycle("detailClose")}if($("#receiptCommentsTxt").length){var c=250-$("#receiptCommentsTxt").val().length;$("#commtStrtIndex").html(c+" character"+((c==1)?"":"s")+" left")}};ReceiptUI.openMatchShoebox=function(d,c){if(d!=null){d.preventDefault()
}if(ReceiptUI.matchHTML==null){ReceiptUI.matchHTML=$("#matchedReceipts").html();$("#matchedReceipts").remove()}if(Receipt.enrollmentStatus!=null&&Receipt.enrollmentStatus=="false"){ReceiptUI.showView="shoebox";ReceiptUI.openEnrollmentLayer()}else{Receipt.resetMatchedFields();if(ReceiptUI.openReceiptDtlWindow!=null&&ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow.close();Receipt.resetDetailLayer()}if(ReceiptUI.alternateEmailWindow!=null&&ReceiptUI.alternateEmailWindow.visible()){ReceiptUI.alternateEmailWindow.close()
}ReceiptUI.isMatchShoeboxView=true;ReceiptUI.showView="shoebox";ReceiptUI.isEtdReceiptDtlView=false;ReceiptUI.isInlineAdd=false;if(ReceiptUI.matchReceiptWindow==null){ReceiptUI.matchReceiptWindow=new Amex.ReceiptWindow({modal:true,theme:"receiptWindow",buttons:["close"],title:"my receipts",shadow:{size:6,color:"#666666"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){ReceiptUI.isMatchShoeboxView=false;if($("#shoeboxAddReceiptLink").is(":visible")){$("#shoeboxAddReceiptLink").hide()
}if($("#matched").is(":ui-shoebox")){$("#matched").shoebox("destroy")}if(null!=ReceiptDropDown.card){ReceiptDropDown.card.options.menu.close()}if(null!=ReceiptDropDown.period){ReceiptDropDown.period.options.menu.close()}return true}});ReceiptUI.matchReceiptWindow.update(ReceiptUI.matchHTML);ReceiptUI.matchReceiptWindow.render(Page.form.id);Receipt.initShoeboxEvents();ReceiptUI.matchReceiptWindow.element.draggable({handle:".shoeboxContent",cancel:"#rcptCardSelect, #rcptPeriodSelect"})}$("#rcOffset").val(0);
ReceiptUI.isAttachView=false;Amex.OverlayManager.block("app");if(c!=null||c!=undefined){Receipt.fetchReceiptsInfo(0,true,"matched",c)}else{Receipt.fetchReceiptsInfo(0,true,"matched",null)}Omniture.report("RC_ShoeBoxLayer")}};ReceiptUI.openUnMatchShoebox=function(c){if(ReceiptUI.rctDtlClose&&ReceiptUI.openReceiptDtlWindow!=null&&ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow.close();Receipt.resetDetailLayer()}if(ReceiptUI.alternateEmailWindow!=null&&ReceiptUI.alternateEmailWindow.visible()){ReceiptUI.alternateEmailWindow.close()
}if(ReceiptUI.unmatchHTML==null){ReceiptUI.unmatchHTML=$("#unMatchedReceipts").html();$("#unMatchedReceipts").remove()}Receipt.resetUnmatchedLayer();ReceiptUI.isMatchShoeboxView=false;if(ReceiptUI.unmatchReceiptWindow==null){ReceiptUI.unmatchReceiptWindow=new Amex.Window({modal:true,theme:"amexWindow",buttons:["close"],title:"unmatched receipts",shadow:{size:6,color:"#666666"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){if($("#unmatchedAddReceiptLink").is(":visible")){$("#unmatchedAddReceiptLink").hide()
}if($("#unmatched").is(":ui-shoebox")){$("#unmatched").shoebox("destroy")}return true}});ReceiptUI.unmatchReceiptWindow.update(ReceiptUI.unmatchHTML);ReceiptUI.unmatchReceiptWindow.render(Page.form.id);Receipt.initUnmatchedEvents()}$("#rcOffset").val(0);ReceiptUI.isAttachView=false;Amex.OverlayManager.block("app");if(c!=null||c!=undefined){Receipt.fetchReceiptsInfo(0,false,"unmatched",c)}else{Receipt.fetchReceiptsInfo(0,false,"unmatched",null)}};ReceiptUI.renderAddReceipt=function(c){Amex.OverlayManager.block("app");
ReceiptUI.index=$(this).closest("tbody").attr("id").split("_")[1];ReceiptUI.isInlineAdd=true;Receipt.enrollmentStatus=null;ReceiptUI.showView="addReceipt";ReceiptUI.isInlineView=true;ReceiptUI.setShoeBoxInitialValues();Receipt.resetAddReceiptLayer();Receipt.init();Omniture.report("RC_Add_ETD")};ReceiptUI.renderAddRcpt=function(c){if(!$.isUndefined(c)){ReceiptUI.index=c}ReceiptUI.isInlineAdd=true;Receipt.enrollmentStatus=null;ReceiptUI.showView="addReceipt";ReceiptUI.isInlineView=true;ReceiptUI.setShoeBoxInitialValues();
Receipt.resetAddReceiptLayer();Receipt.init();Omniture.report("RC_Add_ETD")};ReceiptUI.renderAddReceiptLayer=function(){if(ReceiptUI.addReceiptHTML==null){ReceiptUI.addReceiptHTML=$("#addReceipt").html();$("#addReceipt").remove()}if(ReceiptUI.alternateEmailWindow!=null&&ReceiptUI.alternateEmailWindow.visible()){ReceiptUI.alternateEmailWindow.close()}if(ReceiptUI.manageReceiptWindow!=null&&ReceiptUI.manageReceiptWindow.visible()){ReceiptUI.manageReceiptWindow.close()}Omniture.report("RC_ADD_Overlay");
if(ReceiptUI.renderAddReceiptWindow==null){ReceiptUI.renderAddReceiptWindow=new Amex.Window({modal:true,theme:"amexWindow",buttons:["close"],title:"Add a Receipt",shadow:{size:6,color:"#666666"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){if($("#uploading:visible").length>0){ReceiptUI.isTopClosed=true}if(!ReceiptUI.isInlineAdd){if(ReceiptUI.isMatchShoeboxView){if(ReceiptUI.matchReceiptWindow!=null){ReceiptUI.matchReceiptWindow.open();ReceiptUI.matchReceiptWindow._focus.focus()
}}else{if(!ReceiptUI.isMatchShoeboxView){if(ReceiptUI.unmatchReceiptWindow!=null){ReceiptUI.unmatchReceiptWindow.open();ReceiptUI.unmatchReceiptWindow._focus.focus()}}}}return true}});ReceiptUI.renderAddReceiptWindow.update(ReceiptUI.addReceiptHTML);Receipt.initAddEvents()}itag_isNewEnrollee="false";ReceiptUI.renderAddReceiptWindow.centerInViewport();ReceiptUI.renderAddReceiptWindow.open();ReceiptUI.renderAddReceiptWindow._focus.focus();if(ReceiptUI.isInlineAdd){var h="";var d="";var e="";var f="";
var n="";if(QB.isQBTransOpen){h=$("#qb-trans-"+ReceiptUI.index+" td.col-desc").text().trim();n=h.replace(/\\/g,"\\").replace(/\"/g,'"');d=$("td.col-date-hidden","#qb-trans-"+ReceiptUI.index).text().trim();e=$("td.col-amount","#qb-trans-"+ReceiptUI.index).text().trim();f=$("#qb-trans-"+ReceiptUI.index+"").find("input.row-select-input").val().split("~")[1]}else{h=$("#roc_"+ReceiptUI.index+" td.colDesc").find(".desc-trans");d=$("#postroc_"+ReceiptUI.index+" #date_roc_"+ReceiptUI.index).attr("data-date").trim();
e=$("#roc_"+ReceiptUI.index+" td.colAmmount").text().trim().replace("$","");f=$("#croc_"+ReceiptUI.index).val().split("~")[1];var m=h.text().trim();n=m.replace(/\\/g,"\\").replace(/\"/g,'"')}var c=$("#rcCardHashInline_"+ReceiptUI.index).val();$("#rcCardHash").val(c);$("#transaction_date").html(d);$("#transaction_desc").html(n);$("#transaction_amount").html("$ "+e);var l=Date.parseString(d.substring(0,10));rcDtStr=l.format("yyyy-MM-dd");$("#uploadFields").html("<input type='hidden' id='cardHash' name='cardHash' value='"+c+"'/><input type='hidden' id='created' name='created' value='"+rcDtStr+"'/><input type='hidden' id='currency' name='currency' value='USD'/><input type='hidden' id='fitid' name='fitid' value='"+f+"'/><input type='hidden' id='merchant' name='merchant' value='"+n+"'/><input type='hidden' id='amountStr' name='amountStr' value='"+e+"'/>");
ReceiptUI.isAttachView=true;$("#selectReceiptLinkDis").hide();$("#selectReceiptLink").show();$("#receiptFromUnmatched").hide();$("#receiptTransactionDiv").show()}else{$("#receiptTransactionDiv").hide();$("#receiptFromUnmatched").show();$("#selectReceiptLink").hide();$("#selectReceiptLinkDis").show();$("#existingReceipt").hide()}$("#fileUploadForm").ajaxForm(function(o){});return false};ReceiptUI.renderAttachReceiptLayer=function(h){if(h!=null){h.preventDefault()}if(ReceiptUI.attachReceiptHTML==null){ReceiptUI.attachReceiptHTML=$("#attachReceipt").html();
$("#attachReceipt").remove()}Receipt.resetAttachLayer();if(ReceiptUI.renderAttachReceiptWindow==null){ReceiptUI.renderAttachReceiptWindow=new Amex.Window({modal:true,theme:"amexWindow",buttons:["close"],title:"Add a Receipt",shadow:{size:6,color:"#666666"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){ReceiptUI.isAttachView=false;ReceiptUI.currentReceiptDtls=null;ReceiptUI.renderAddReceiptWindow.open();ReceiptUI.renderAddReceiptWindow._focus.focus();
return true}});ReceiptUI.renderAttachReceiptWindow.update(ReceiptUI.attachReceiptHTML);Receipt.initAttachEvents();setTimeout(function(){ReceiptUI.renderAttachReceiptWindow.centerInViewport()},200)}else{ReceiptUI.renderAttachReceiptWindow.centerInViewport()}var l="";var d="";var e="";var f="";var n="";if(QB.isQBTransOpen){l=$("#qb-trans-"+ReceiptUI.index+" td.col-desc").text().trim();n=l.replace(/\\/g,"\\").replace(/\"/g,'"');d=$("td.col-date-hidden","#qb-trans-"+ReceiptUI.index).text().trim();e=$("td.col-amount","#qb-trans-"+ReceiptUI.index).text().trim();
f=$("#qb-trans-"+ReceiptUI.index+"").find("input.row-select-input").val().split("~")[1]}else{l=$("#roc_"+ReceiptUI.index+" .desc-trans");n=l.text().trim();d=$("#postroc_"+ReceiptUI.index+" #date_roc_"+ReceiptUI.index).attr("data-date").trim();e=$("#roc_"+ReceiptUI.index+" td.colAmmount").text().trim().replace("$","");f=$("#croc_"+ReceiptUI.index).val().split("~")[1]}var c=$("#rcCardHashInline_"+ReceiptUI.index).val();$("#rcCardHash").val(c);$("#tran_date").html(d);$("#tran_desc").html(n);$("#tran_amount").html("$ "+e);
$("#amountStr").val(e);var m=Date.parseString(d.substring(0,10));rcDtStr=m.format("yyyy-MM-dd");$("#transactionDate").val(rcDtStr);$("#rcCurrency").val("USD");$("#rcAmount").val(e);$("#rcTransRefNum").val(f);$("#rcMerchant").val(n);ReceiptUI.isAttachView=true;Amex.OverlayManager.block("app");Receipt.fetchReceiptsInfo(0,false,"attached",null)};ReceiptUI.detachReceipt=function(){if(ReceiptUI.detachReceiptHTML==null){ReceiptUI.detachReceiptHTML=$("#detachLnk").html();$("#detachLnk").remove()}if(ReceiptUI.openDetachWindow==null){ReceiptUI.openDetachWindow=new Amex.Window({modal:true,theme:"amexWindow",buttons:["close"],title:"Receipt Detach",shadow:{size:6,color:"#666666"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){Amex.PageOverlay.disableAlertMode();
if(ReceiptUI.openReceiptDtlWindow!=null&&!ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow.open();ReceiptUI.openReceiptDtlWindow._focus.focus()}if(ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow._focus.focus()}return true}});ReceiptUI.openDetachWindow.update(ReceiptUI.detachReceiptHTML);Receipt.initDetachEvents()}ReceiptUI.openDetachWindow.css({zIndex:Amex._internal.zindex.messageBox});Amex.PageOverlay.enableAlertMode();ReceiptUI.openDetachWindow.centerInViewport();
ReceiptUI.openDetachWindow.title.hide();ReceiptUI.openDetachWindow.open();ReceiptUI.openDetachWindow._focus.focus()};ReceiptUI.deleteReceipt=function(c){if(c!=null){c.preventDefault()}Omniture.report("RC_delete");if(ReceiptUI.deleteReceiptHTML==null){ReceiptUI.deleteReceiptHTML=$("#deleteLayer").html();$("#deleteLayer").remove()}if(null!=ReceiptUI.openDetachWindow&&ReceiptUI.openDetachWindow.visible()){ReceiptUI.openDetachWindow.close()}if(ReceiptUI.openDeleteWindow==null){ReceiptUI.openDeleteWindow=new Amex.Window({modal:true,theme:"amexWindow",buttons:["close"],title:"Receipt Delete",shadow:{size:6,color:"#666666"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){Amex.PageOverlay.disableAlertMode();
if(ReceiptUI.openReceiptDtlWindow!=null&&!ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow.open();ReceiptUI.openReceiptDtlWindow._focus.focus()}if(ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow._focus.focus()}return true}});ReceiptUI.openDeleteWindow.update(ReceiptUI.deleteReceiptHTML);Receipt.initDeleteEvents()}ReceiptUI.openDeleteWindow.css({zIndex:Amex._internal.zindex.messageBox});Amex.PageOverlay.enableAlertMode();ReceiptUI.openDeleteWindow.centerInViewport();
ReceiptUI.openDeleteWindow.title.hide();ReceiptUI.openDeleteWindow.open();ReceiptUI.openDeleteWindow._focus.focus()};ReceiptUI.renderAlternateEmail=function(){Receipt.resetAlternateEmailLayer();if(ReceiptUI.alternateEmailWindow==null){ReceiptUI.alternateEmailWindow=new Amex.Window({modal:true,theme:"amexWindow",buttons:["close"],title:"ReceiptMatch Email Update",shadow:{size:6,color:"#666666"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){Receipt.recordEmailChoice();
return true}});ReceiptUI.alternateEmailWindow.update($("#alternateEmailEnroll").html());$("#alternateEmailEnroll").remove();ReceiptUI.alternateEmailWindow.render(Page.form.id);Receipt.bindAlternateEmailEvents()}ReceiptUI.alternateEmailWindow.centerInViewport();ReceiptUI.alternateEmailWindow.title.hide();ReceiptUI.alternateEmailWindow.open();ReceiptUI.alternateEmailWindow._focus.focus()};ReceiptUI.zoomReceiptLayer=function(e){if(ReceiptUI.matchReceiptWindow!=null&&ReceiptUI.matchReceiptWindow.visible()){ReceiptUI.matchReceiptWindow.close()
}if(ReceiptUI.openReceiptDtlWindow!=null&&ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow.close()}if(ReceiptUI.unmatchReceiptWindow!=null&&ReceiptUI.unmatchReceiptWindow.visible()){ReceiptUI.unmatchReceiptWindow.close()}if(ReceiptUI.isAttachView&&ReceiptUI.renderAttachReceiptWindow!=null&&ReceiptUI.renderAttachReceiptWindow.visible()){ReceiptUI.renderAttachReceiptWindow.close()}var d=false;if(ReceiptUI.zoomReceiptWindow==null){d=true;ReceiptUI.zoomReceiptWindow=new Amex.Window({modal:true,theme:"amexWindow",buttons:["close"],title:"Receipt Zoom",shadow:{size:6,color:"#666666"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:function(){if($("#receiptZoomImg").is(":ui-zoomer")){$("#receiptZoomImg").zoomer("destroy")
}if(ReceiptUI.isAttachView&&ReceiptUI.renderAttachReceiptWindow!=null&&!ReceiptUI.renderAttachReceiptWindow.visible()){ReceiptUI.renderAttachReceiptWindow.open();ReceiptUI.renderAttachReceiptWindow._focus.focus()}else{if(ReceiptUI.openReceiptDtlWindow!=null&&!ReceiptUI.openReceiptDtlWindow.visible()){ReceiptUI.openReceiptDtlWindow.open();ReceiptUI.openReceiptDtlWindow._focus.focus()}}return true}});ReceiptUI.zoomReceiptWindow.update($("#receiptZoom").html())}ReceiptUI.zoomReceiptWindow.centerInViewport();
ReceiptUI.zoomReceiptWindow.title.hide();ReceiptUI.zoomReceiptWindow.open();ReceiptUI.zoomReceiptWindow._focus.focus();$("#receiptZoom").remove();while($("#receiptZoomImg").length){$("#receiptZoomImg").remove()}var c=$("<img/>").attr("id","receiptZoomImg");$("#zoomImg").prepend(c);if(e){c.attr("src",e).loadimg({loaded:function(f){ReceiptUI.zoomReceiptWindow.centerInViewport()}})}else{c.attr("src",$("#locImages").val()+"/receipts/brokenimage.png")}if(d){Receipt.bindZoomEvents()}};ReceiptUI.setOpenMatchShoeBox=function(){ReceiptUI.setShoeBoxInitialValues();
ReceiptUI.openMatchShoebox(null,null)};ReceiptUI.setShoeBoxInitialValues=function(){$("#rcSortedIndex").val(T1.card.getSelected().index);$("#rcSuppIndex").val(T1.card.getSelected().supp);if(T1.period.getSelected()!=null){var c=T1.period.getSelected();$("#rcBPIndex").val(c.BPIndex);$("#receiptStartDate").val(c.startDate);$("#receiptEndDate").val(c.endDate)}else{$("#rcBPIndex").val($("#bPIndex").val());$("#receiptStartDate").val($("#startDate").val());$("#receiptEndDate").val($("#endDate").val())}};
ReceiptUI.openMatchShoeBoxHandler=function(c){c.preventDefault();Omniture.report("RC_ManageYourReceipts");ReceiptUI.setOpenMatchShoeBox()};ReceiptUI.addReceipt=function(e){var l=$(this).closest("tbody").attr("id").split("_")[1];var d=$("#croc_"+l).val().split("~")[1];if(d==null||d==""||d=="undefined"){Amex.Msg.error("Error processing request",ReceiptUI.genericError,true,null);return false}if($(this).hasClass("disableReceiptIcon")||$(this).hasClass("disableTPReceiptIcon")){return false}if(List.multiTagViewEnabled==false){Amex.OverlayManager.block("app");
var h=$(this).closest("tbody").attr("id");var c=$(this).closest("tbody").attr("id").split("_")[1];if($("#i"+h).hasClass("plus")){var f=List.ETDClick(e,true);f.done(function(m){if(m){ReceiptUI.renderAddRcpt(c)}else{Amex.OverlayManager.unblock("app");Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})}else{ReceiptUI.renderAddRcpt(c)}}return false};ReceiptUI.viewRcptDetails=function(e){var l=$(this).closest("tbody").attr("id").split("_")[1];var d=$("#croc_"+l).val().split("~")[1];
if(d==null||d==""||d=="undefined"){Amex.Msg.error("Error processing request",ReceiptUI.genericError,true,null);return false}if($(this).hasClass("disableReceiptIcon")||$(this).hasClass("disableTPReceiptIcon")){return false}if(List.multiTagViewEnabled==false){Amex.OverlayManager.block("app");var h=$(this).closest("tbody").attr("id");var c=$(this).closest("tbody").attr("id").split("_")[1];if($("#i"+h).hasClass("plus")){var f=List.ETDClick(e,true);f.done(function(m){if(m){Receipt.viewReceiptDtls(c)}else{Amex.OverlayManager.unblock("app");
Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})}else{Receipt.viewReceiptDtls(c)}}return false};ReceiptUI.splitQbColon=function(e){var c=e.split(":");var d="";$.each(c,function(f,h){if(d==""){d=h+" "}else{d=d+": "+h+" "}});return d};var Shoebox={};Shoebox.Controller=function(){};Shoebox.Controller.prototype={receiptJSONArray:[],currentReceiptObj:null,matchedSpanClass:"receiptSpan",unMatchedSpanClass:"unMatchedReceiptSpan",shoeboxType:"matched",selectedImg:null,imgSelect1:false,imgDetails:true,endReceipts:false,getReceiptJSONArray:function(){return receiptJSONArray
},getEndReceipts:function(){return endReceipts},fetchReceiptsInfo:function(d,l,c,e){Amex.OverlayManager.block("app");var o=false;var n=new Array();$("#rcRequestType").val("ShoeBox");$("#matchedReceipt").val(l);$("#rcOffset").val(d);$("#etdRequired").val(false);var f=[];var m=$("#multiCardView").val()=="true"?true:false;if(!m){f=formParameters.getParams("receiptDetails.do")}else{f=$("#"+Page.form.id).serialize()}var h=$.ajax("receiptDetails.do",{type:"POST",data:f,success:function(B,w,u){if(u.getResponseHeader("MYCAError")==null){if(B.status==true){if(B.authtoken!=null&&B.authtoken!=""){Receipt.enrollmentStatus=true;
$("#rcAuthToken").val(B.authtoken);var A=null;if(B.receiptDetails!=null){A=B.receiptDetails.receiptDetails;if(A!=null){for(var q=0;q<A.length;q++){n.push(A[q])}}if(n.length<25){o=true;if($("#"+c).is(":ui-shoebox")){$("#"+c).shoebox("option","hasReceipts",true)}}else{if($("#"+c).is(":ui-shoebox")){$("#"+c).shoebox("option","hasReceipts",false)}}if(e){if($("#"+c).is(":ui-shoebox")){$("#"+c).shoebox("option","updateDeleteStatus","true")}}else{if($("#"+c).is(":ui-shoebox")){$("#"+c).shoebox("option","updateDeleteStatus","false")
}}var p=[];if(n.length!=0){for(var q=0;q<n.length;q++){var t=n[q];var z=parseFloat(t.amount);var y=t.chargeDate;var x=t.descLine1;var v=t.chargeDate+" | $ "+z.toFixed(2);var s=t.descLine1;var r=" $ "+z.toFixed(2);var C={imageId:t.receiptID,tagDetails:t.tagDetails,qBTagDetails:t.qbTagName,qBTagGrpDetails:t.qbTagGroupDetails,thumbnailURL:t.thumbImgURL,downloadImgURL:t.downloadImgURL,mediumImgURL:t.mediumImgURL,zoomURL:t.zoomImgURL,comments:t.comments,descLine1:y,descLine2:x,descLine3:v,descLine4:s,descLine5:r,memberName:t.memberName,imageIndex:q,transactionRefNo:t.transactionRefNo,rcCardHash:t.transCardHash,archiveReq:t.archivedRequest};
p.push(C)}}if(p.length>0){if($("#"+c).is(":ui-shoebox")){$("#"+c).shoebox("option","appendImgs",p)}}}else{var p=[];if($("#"+c).is(":ui-shoebox")){$("#"+c).shoebox("option","hasReceipts",true);$("#"+c).shoebox("option","appendImgs",p)}}Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode()}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}}else{Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)
}},error:function(p){Amex.OverlayManager.pWin.close();Amex.Msg.error("error processing request",ReceiptUI.genericError,true,null)}})},onAddImageFocus:function(c,d){if(c.data.type=="matched"){$(this).children().removeClass("addNewImage");$(this).children().addClass("addNewOverImage")}else{if(c.data.type=="unmatched"){$(this).children().removeClass("addUnMatchedNewImage");$(this).children().addClass("addUnMatchedNewOverImage")}}},onAddImgFocusOut:function(c,d){if(c.data.type=="matched"){$(this).children().addClass("addNewImage");
$(this).children().removeClass("addNewOverImage")}else{if(c.data.type=="unmatched"){$(this).children().addClass("addUnMatchedNewImage");$(this).children().removeClass("addUnMatchedNewOverImage")}}},getAddImage:function(e,c){var f=$("<li/>").addClass("addNewImgSpan");var m=$("<div/>");var h=null;if(!($("#thirdParty").val()=="true")){h=$("<a/>").attr("id",e+"_addNewReceipt").attr("title","Add Receipt").attr("href","#")}else{h=$("<span/>").attr("id",e+"_addNewReceipt")}var l=$("<span/>");l.attr("id",e+"_addNewReceiptImg");
if(c=="matched"){l.addClass("addNewImage")}else{if(c=="unmatched"){l.addClass("addUnMatchedNewImage")}}h.append(l);m.append(h);f.append(m);if(!($("#thirdParty").val()=="true")){var d="#"+e+"_addNewReceiptImg";$(document).off("focusin.addreceipt").off("focusout.addreceipt").off("mouseenter.addreceipt").off("mouseleave.addreceipt").off("click.addreceipt").on("mouseenter.addreceipt",d,{addImgId:e+"_addNewReceiptImg",type:c},this.onAddImageMouseOver).on("mouseleave.addreceipt",d,{addImgId:e+"_addNewReceiptImg",type:c},this.onAddImgMouseOut).on("focusin.addreceipt","#"+e+"_addNewReceipt",{addImgId:e+"_addNewReceiptImg",type:c},this.onAddImageFocus).on("focusout.addreceipt","#"+e+"_addNewReceipt",{addImgId:e+"_addNewReceiptImg",type:c},this.onAddImgFocusOut).on("click.addreceipt","#"+e+"_addNewReceipt",{addImgId:e+"_addNewReceiptImg",type:c},this.onAddImgClick)
}else{l.addClass("addNewImage disabledLabel disabledCursor")}return f},onMouseOverImage:function(c,d){var e=c.data.imageObject;$(this).css({cursor:"pointer"});$(this).closest(".receipt_outer").addClass("highlight");if(e.comments!=""&&e.comments!=undefined){var f=e.comments;f=f.replace(/(\r\n|\r|\n|&#092;n)/g,"<br/>");$(this).parent().callout({direction:"up",width:200,closeButton:false,content:$('<p style="background-color:white;">'+f+"</p>")})}},onMouseOutImage:function(d,e){var c=$(this);var f=d.data.imageObject;
c.closest(".receipt_outer").removeClass("highlight");c.parent().callout("close")},onImageSelect:function(c,d){var e=c.data.imageObject;ReceiptUI.currentReceiptDtls=e;$(this).closest(".ui-shoebox-content").find(".selected").removeClass("selected");$(this).closest(".receipt_outer").addClass("selected");c.preventDefault()},onImageClick:function(d,e){d.preventDefault();var c=d.data.imageObject;ReceiptUI.currentReceiptDtls=c;ReceiptUI.isInlineView=false;if(ReceiptUI.isMatchShoeboxView){if(c.archiveReq==true){var h="";
if(null!=ReceiptUI.matchReceiptWindow&&ReceiptUI.matchReceiptWindow.visible()){ReceiptUI.matchReceiptWindow.close()}$("#archiveReceiptDelMsg").show();$("#receiptDelMsg").hide();ReceiptUI.OpenReceiptsDetails(c,h)}else{$("#archiveReceiptDelMsg").hide();$("#receiptDelMsg").show();Receipt.invokeDetails(c)}Omniture.report("RC_click_matched")}else{var h="<div id='printnone'><div class='messageID'>This receipt is not matched to a transaction.<br><br><strong>A receipt may be unmatched for the following reasons:</strong></div><ul class='receiptList'><li class='messageID'>The receipt was recently uploaded, and is queued for scanning.</li><li class='messageID'>The receipt has been scanned, but the matching transaction is in pending status.</li><li class='messageID'>The receipt has been scanned, but the receipt image cannot be read in enough details to enable a match.</li><li class='messageID'>The receipt is for a transaction that is more than 10 months old, and cannot be automatically matched to a transaction at this time.</li></ul></div>";
if(null!=ReceiptUI.unmatchReceiptWindow&&ReceiptUI.unmatchReceiptWindow.visible()){ReceiptUI.unmatchReceiptWindow.close()}if("true"!=$("#multiCardView").val()&&Receipt.tagObjJSON==null&&parseInt($("#rcEligCardSize").val())>1){var f=TagAction.fetchRCTags();f.done(function(){Amex.OverlayManager.unblock("app");ReceiptUI.OpenReceiptsDetails(c,h)})}else{ReceiptUI.OpenReceiptsDetails(c,h)}Omniture.report("RC_click_unmatched")}},onImageZoomClick:function(d,e){Omniture.report("RC_zoom_inlineattach");var c=d.data.imageObject;
ReceiptUI.zoomReceiptLayer(c.zoomURL)},onAddImageMouseOver:function(c,d){if(c.data.type=="matched"){$(this).removeClass("addNewImage");$(this).addClass("addNewOverImage")}else{if(c.data.type=="unmatched"){$(this).removeClass("addUnMatchedNewImage");$(this).addClass("addUnMatchedNewOverImage")}}},onAddImgMouseOut:function(c,d){if(c.data.type=="matched"){$(this).addClass("addNewImage");$(this).removeClass("addNewOverImage")}else{if(c.data.type=="unmatched"){$(this).addClass("addUnMatchedNewImage");
$(this).removeClass("addUnMatchedNewOverImage")}}},onAddImgClick:function(c,d){Amex.OverlayManager.block("app");Receipt.enrollmentStatus=null;ReceiptUI.isInlineAdd=false;if(ReceiptUI.renderAddReceiptWindow!=null){Receipt.resetAddReceiptLayer()}Receipt.init();if(c.data.type=="matched"){Omniture.report("RC_addfrommatched")}else{if(c.data.type=="unmatched"){Omniture.report("RC_add_from_unattached")}}c.preventDefault()}};var itag_cardtype="";var itag_productName="";var itag_intlinkimp="";var itag_isNewEnrollee="false";
var itag_products="";var itag_events="";var itag_acctstatus="";var Omniture={prefix:"US:Ser:eStatement:",propVarName:"prop25",assets:null,propVar:[],itag_cardtype:"US:",itag_productName:null,view_onload:"US:~{estmtType,reportType,true}:~{viewFormat,viewType,true}:~{estmtSort,sortBy,true}:~{dateType,bPIndex,true}:~{filter,filterApplied,false}:View-Onload",initialized:false,omnSuffix:"None",itag_intlinkimp:null,init:function(c){Omniture.loadReg(c);Omniture.getiTagCardtype();itag_productName=Omniture.itag_productName;
itag_cardtype=itag_productName},createiTagEntry:function(itagValue){var iTagEntityName="";try{if(Omniture.initialized){var arrEntryName=itagValue.split("~");for(i=0;i<arrEntryName.length;i++){if(arrEntryName[i].indexOf("{")!=-1&&arrEntryName[i].indexOf("}")!=-1){var subEntries=arrEntryName[i].split("}");for(j=0;j<subEntries.length;j++){if(subEntries[j].indexOf(",")!=-1){var orginalValues=subEntries[j].substring(1,subEntries[j].length);var arrOrginalValues=orginalValues.split(",");if(arrOrginalValues.length==3){var arrLinkNames=Omniture.assets.iTagEntityNames[arrOrginalValues[0]];
if(!$.isUndefined(arrLinkNames)){if(arrOrginalValues[2]=="true"){value=arrLinkNames[(($("#"+arrOrginalValues[1])!=null)?$("#"+arrOrginalValues[1]).val():"None")]}else{if(arrOrginalValues[2]=="false"){value=arrLinkNames[Omniture.getiTagVarValue(arrOrginalValues[1])]}else{if(arrOrginalValues[2]=="qb"){value=eval(arrOrginalValues[1])}else{if(arrOrginalValues[2]=="error"){value=eval(arrOrginalValues[1])}}}}iTagEntityName+=(!$.isUndefined(value)?value:"None")}else{iTagEntityName+="None"}}else{iTagEntityName+="None"
}}else{iTagEntityName+=subEntries[j]}}}else{iTagEntityName+=arrEntryName[i]}}}else{}}catch(err){iTagEntityName="PARSING_ERROR"}return iTagEntityName},getiTagCardtype:function(){var c=null;if(channelType==="M"){for(card in iNavCardSelectorData.cards){var d=iNavCardSelectorData.cards[card];if(d.sortedIndex===parseInt($("#sorted_index").val())){c=d}}}else{c=T1.card.getSelected()}if(c){Omniture.itag_cardtype=Omniture.itag_cardtype+c.cardProduct;Omniture.itag_productName=Omniture.itag_cardtype+":"+c.description
}else{Omniture.itag_cardtype=Omniture.itag_cardtype+"BU"}},getiTagVarValue:function(h){try{switch(h){case"filterApplied":var d=$("#OMNFilterString");return(!$.isUndefined(d)&&d.length>=1)?"YES":"NO";case"chartType":var f="";if(Omniture.omnSuffix=="None"){f=$("#chartType").val();var e=$("#reportType").val();if(f=="default"){if(e==2||e==4||e==7){f="piechart"}else{f="barchart"}}}else{f=Omniture.omnSuffix}return f;default:return"None"}}catch(c){return"None"}},getPropVar:function(){var c=$("#OMNFilterString");
var d=Omniture.propVar.join(":");if(c.length){d=d+":"+c.val()}return d.substring(0,99)},reportClick:function(f){if(Omniture.initialized){try{var e=Omniture.assets.click[f];if(!$.isUndefined(e)){var d=Omniture.getiTagEntry(e);if(d!="PARSING_ERROR"){if(e.length==2){(typeof($iTagTracker)=="function")?$iTagTracker(d[0],d[1]):null}else{if(e.length==3){(typeof($iTagTracker)=="function")?$iTagTracker(d[0],d[1],d[2],Omniture.itag_cardtype):null}}}else{}}}catch(c){}}},report:function(h,f){if(Omniture.initialized){try{var e=Omniture.assets.report[h];
Omniture.omnSuffix=f;if(!$.isUndefined(e)){var d=Omniture.getiTagEntry(e);if(d!="PARSING_ERROR"){if(e.length==2){(typeof($iTagTracker)=="function")?$iTagTracker(d[0],d[1]):null}else{if(e.length==3){(typeof($iTagTracker)=="function")?$iTagTracker(d[0],d[1],d[2],Omniture.itag_cardtype):null}else{if(e.length==4){(typeof($iTagTracker)=="function")?$iTagTracker(d[0],d[1],Omniture.itag_cardtype,d[2],d[3]):null}}}}else{}}else{}}catch(c){}}else{if(h=="Inters_titial"){(typeof($iTagTracker)=="function")?$iTagTracker("layertrack","PreferencesInterstitial"):null
}}},setPropVar:function(){var h=Omniture.propVar;h.length=0;h.push("HZ");var f=null;if(channelType==="M"){for(card in iNavCardSelectorData.cards){var d=iNavCardSelectorData.cards[card];if(d.sortedIndex===parseInt($("#sorted_index").val())){f=d}}}else{f=T1.card.getSelected()}if(f){h.push(f.cardProduct);h.push(f.description);if(f.isBasic){h.push("Basic")}else{h.push("Supp")}}var l=null;if(channelType==="M"){for(timePeriod in List_mb.displaytimePeriodDataList){var c=List_mb.displaytimePeriodDataList[timePeriod];
if(c.BPIndex===parseInt($("#BPIndex").val())){l=c}}}else{l=T1.period.getSelected()}if(l){if(l.cycleDesc){h.push(l.cycleDesc)}else{h.push(l.multiCardBPIndex)}}else{var e=Date.parseString($("#startDate").val(),"MMddyyyy");h.push("Date"+(new Date()).diff(e,"M"))}h.push(Omniture.getReportType());if($("#viewType").val()=="G"){h.push("Graph")}if($("#cmldPDF")!=null){h.push("CMLD")}if($("#recentTransaction")!=null){h.push("PendingCharges")}},getReportType:function(){switch(parseInt($("#reportType").val())){case 1:return"TranDetails";
case 2:return"CatByTime";case 3:return"Merchant";case 4:return"CM";case 5:return"CatByCM";case 6:return"Tags";case 7:return"DIF"}},loadReg:function(c){Omniture.initialized=false;$.getJSON(c,function(f,d,e){Omniture.assets=f;if(Omniture.assets){$(document).click(function(h){var l=h.target.id;if(l){Omniture.reportClick(l)}});Omniture.initialized=true}})},getiTagEntry:function(f){var e=new Array();try{for(k=0;k<f.length;k++){if(f[k].indexOf("~{")!=-1){var c=Omniture.createiTagEntry(f[k]);if(c=="PARSING_ERROR"){return c
}else{e[k]=c}}else{e[k]=f[k]}}}catch(d){return"PARSING_ERROR"}return e},onLoad:function(){try{setTimeout(function(){itag_eStatement=Omniture.createiTagEntry(Omniture.view_onload);if(itag_eStatement!=""){(typeof($iTagTracker)=="function")?$iTagTracker("customtrack"):null}},2000)}catch(c){}}};var LiteListener={start:function(){$(document).ajaxComplete(LiteListener.responder)},responder:function(e,c,d){if(c.getResponseHeader("MYCAAllLite")!=null){Boot.allCardsInLite=$("#allCardsInLite").val()+$("#sorted_index").val()+",";
$("#mycaLite").val("true");Page.form.submit("list.do")}else{if(c.getResponseHeader("MYCALite")!=null){$("#cardsInLite").val($("#cardsInLite").val()+$("#sorted_index").val()+",");$("#liteEnabled").val("true");Page.form.submit("list.do")}}}};var YESInterstitial={window:null,open:function(){if(YESInterstitial.window==null){YESInterstitial.window=new Amex.Window({modal:true,top:200,theme:"amexWindow",buttons:["close"],shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});
YESInterstitial.window.update("<div id='widgetLayer' style='background-repeat: repeat-x;background-position:0 12px' ><iframe src='/myca/estmt/us/welcome.do?Face=en_US&request_type=authreg_Statement&YESInterstitial=true' scrolling='NO' frameborder='0' style='width: 600px; height: 390px; scroll: hidden;' /></iframe><div style='text-align:center;padding:5px;'><button type='button' title='Close This Window' id='closeYESInterstitial' class='lastFocus cancelButton'><span class='blueWrapper'>close</span></button></div>");
YESInterstitial.window.render(document.body);YESInterstitial.window.centerInViewport();YESInterstitial.window.open();var f=new Date();var e=new Date(new Date().getFullYear()+1,0,1,0,0,0,0);var c=parseInt((e-f)/1000);Amex.Util.setCookie("amx_yes_interstitial","amx_yes_interstitial",c)}var d=$("#closeYESInterstitial");if(d.length){d.click(function(){YESInterstitial.window.close();return true})}$("#yesinterstitialButton").click(function(){window.location=$("#yeslinkURL").val()+T1.card.getSelected().index
})},close:function(){YESInterstitial.window.close()}};var Boot_common={messages:{previewFail:"We are experiencing intermittent delays. Please try again later."}};Boot_common.start=function(){Boot_common.setTimeOutFunction();$.jcp("option","urlPath",$("#locJs").val()+"/lib/templates/");$.jcp("extend","empty",function(m){if(typeof(m)=="undefined"||m==null){return true}if(typeof(m)=="string"){return m==""}if($.isArray(m)){return m.length==0}if($.isFunction(m)){return false}return $.isEmptyObject(m)});
Date.prototype.getMonthName=function(){var n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return n[this.getMonth()]};var f=getUrlVars()["BPIndex"];if((typeof f=="undefined")||f===null||f===""){f=0}var c=getUrlVars()["openPendingWindow"];$("#app").show();$("#suppCardId").amexselect();$("#scroller-content").amexswiper({theme:"default"});var d=$.jcp("run","@mb/timePeriod",_periodList);List_mb.displaytimePeriodDataList=_periodList;$("#scroller-content").amexswiper();$("#scroller-content").amexswiper("update",d).trigger("create");
if($("#scroller-content li").length==1){f=0;$("#scroller-content").amexswiper("swipeTo",parseInt(f),true,false)}else{$("#scroller-content").amexswiper("swipeTo",parseInt(f),true,true)}var l=$("#viewType").val().toUpperCase(),h=null;if(l=="L"){try{listResponse.BPIndex=parseInt(f);if($(document.body).hasClass("ie8")||$(document.body).hasClass("ie7")){h=List.list_template.call(listResponse,jQuery)}else{h=$.jcp("run","@list/list",listResponse)}}catch(e){Boot_common.logErrorJSON("Not able to load the page. Error due to listResponse JSON:"+e.message+":"+(h?h.slice(-200):null))
}$("#listTemplate").html(h);List_mb.resizeFunction();$("#_progressTableWindow").hide();$("#scroller-content").amexswiper("swipeTo",parseInt(f),true,true);$("#listData").removeClass("opacityClass");if(channelType==="M"){List_mb.init();if(c!=null&&c==="Y"){$("#pendingHdr").trigger("click")}$("#pagemobileInitialLoad").hide();$("#search_field").show();Omniture.init($("#locJs").val()+"/app/omniture/assets144.json.txt");$("#startDate").val($.trim($("#scroller-content").find(".visible").attr("data-startDate")));
$("#endDate").val($.trim($("#scroller-content").find(".visible").attr("data-endDate")))}}};Boot_common.logErrorJSON=function(c){if($("#_progressTableWindow").is(":visible")){$("#_progressTableWindow").hide();$("#app").show();$("#listTemplate").html('<div style="height:200px;"><div style="color: #c04000; position: relative; top: 45%; left: 20%; width: 80%; font-size: 15px; line-height: 30px;">We are experiencing intermittent delays. Please try again later.</div></div>');$("#rcUploadResCode").val(-1000);
$("#rcUploadStatusTxt").val(c);var e=formParameters.getParams("uploadReceiptLogAction.do");var d=$.ajax("uploadReceiptLogAction.do",{type:"POST",data:e,success:function(h,f,l){if(l.getResponseHeader("RCError")==null){}}})}};Boot_common.setTimeOutFunction=function(){setTimeout(function(){Boot_common.logErrorJSON("Timeout on page initial load. Kill spinner")},60000)};$("#scroller-content").on("animation-done.amexswiper",function(d,e){if(parseInt(e.element.attr("data-bpindex"))!==parseInt($("#bPIndex").val())){$("select").prop("disabled",false);
$("#startDate").val($.trim(e.element.attr("data-startDate")));$("#endDate").val($.trim(e.element.attr("data-endDate")));var c=$("#transactionTableContainer");$("#bPIndex").val(parseInt(e.element.attr("data-bpindex")));List_mb.removeTable();Omniture.report("period_change",List_mb.getTPType(parseInt(e.element.attr("data-bpindex"))));if($("#searchText").val()!=null&&$("#searchText").val().length>0){List_mb.load("tpChange.do","tpChangeSearch")}else{List_mb.load("tpChange.do","tpChange")}}else{$("#listData").removeClass("opacityClass")
}});$("body").on("change","#suppCardId",function(c){$("#suppIndex").val($("#suppCardId option:selected").attr("data-suppindex"));List_mb.removeTable();Omniture.report("listView_cardDropDown");if($("#searchText").val()!=null&&$("#searchText").val().length>0){List_mb.load("cardChangeList.do","cardChangeListSearch")}else{List_mb.load("cardChangeList.do","cardChangeList")}});$("#searchText").on("focus",function(c){$(this).removeAttr("placeholder");c.preventDefault()});$("#searchText").on("blur",function(c){if($(this).val().length==0){$(this).attr("placeholder","Search Transactions")
}c.preventDefault()});$("#searchText").on("keyup",function(c){$(this).removeAttr("placeholder");List_mb.searchFocus(this)});$("body").on("click","#closeId",function(c){List_mb.closeButton(c,this)});$("#iNCardSelector").on("click","li",function(c){List_mb.cardSelection(c,this)});$.extend($.easing,{def:"easeOutQuad",easeOutCubic:function(f,h,e,m,l){return m*((h=h/l-1)*h*h+1)+e},easeOutBounce:function(f,h,e,m,l){if((h/=l)<(1/2.75)){return m*(7.5625*h*h)+e}else{if(h<(2/2.75)){return m*(7.5625*(h-=(1.5/2.75))*h+0.75)+e
}else{if(h<(2.5/2.75)){return m*(7.5625*(h-=(2.25/2.75))*h+0.9375)+e}else{return m*(7.5625*(h-=(2.625/2.75))*h+0.984375)+e}}}},easeOutExpo:function(f,h,e,m,l){return(h==l)?e+m:m*(-Math.pow(2,-10*h/l)+1)+e}});var Boot={messages:{previewFail:"We are experiencing intermittent delays. Please try again later."},rewardsLoaded:false,interstitialsChecked:false,deeplinkDisplayed:false,skipTimeOut:false,skipMycaTimeOut:false,icCheck:null,deferred:null,startTime:null,allCardsInLite:null};$.ajaxSetup({beforeSend:function(c){if($.cookie("amexsessioncookie")==null){App.timeout();
return false}}});Boot.start=function(){function h(){}window.console=window.console||{};window.console.group=window.console.group||h;window.console.groupEnd=window.console.groupEnd||h;window.console.time=window.console.time||h;window.console.debug=window.console.debug||h;window.console.timeEnd=window.console.timeEnd||h;window.console.log=window.console.log||h;Boot_common.start();Boot.startTime=(new Date()).getTime();if(window.location.host.toLowerCase().indexOf("phxj")>=0){setInterval(App.ping,60000)
}if(!(typeof(mycaAssistJSON)==="undefined")&&!(typeof(mycaAssistJSON.commonAppData)==="undefined")){if(mycaAssistJSON.commonAppData!=null&&mycaAssistJSON.commonAppData!=""){try{var d=d.replace(/&#39;/g,"/'");mycaAssistJSON.commonAppData=d}catch(o){}}}Tag.userType=$("#cardTypePref").val();$(document.body).addClass(Amex.style);$.extend($.ui.scrollbar.prototype.options,{theme:"round",fullTrack:true,fullTrackAdjustTop:-2,fullTrackAdjustBottom:5,fullTrackAdjustLeft:-2,fullTrackAdjustRight:4});$.extend($.ui.loadimg.prototype.options,{placeholder:$("#locImages").val()+"/receipts/loadimage.png",broken:$("#locImages").val()+"/receipts/brokenimage.png"});
$.expr[":"].containsic=function(u,v,e){return $(u).text().toUpperCase().indexOf(e[3].toUpperCase())>=0};Boot.initOverlay();Boot.initDesAlert();if($("#refreshCache").length){$("#refreshCache").val(true)}TopLinks.init();T1.init();var n=T1.card.getSelected().isBasic;var s=$("#cardCancelled").val();if(s=="false"&&$("#employeeControlFlag").length&&$("#employeeControlFlag").val()=="true"&&(($("#EmpControlSupps").length&&$("#EmpControlSupps").val()=="true")||n)){$(document.body).addClass("iNEmpCont")}T2.init();
T2.updateForm(true);var r=$("#viewType").val().toUpperCase();if(r=="L"){Boot.initListView()}else{if(r=="S"){Boot.initSummaryView()}else{if(r=="G"){Boot.initGraphView()}}}$("#_progressTableWindow").hide();CustomPeriod.init();Search.init();Status.init();Boot.initCardChgMessage();UIController.updateStatus();AllOpen.init();fireClick=function(u,w){try{List.table.toggleROC(w)}catch(v){}};document.getElementById(Page.form.id).onsubmit=function(){return false};if(!($("#environment").val()=="E1_QA"||$("#environment").val()=="E2_SL")&&$("#entryPoint").val()!="keynote"){Boot.initPAW()
}$("input.disableAutocomplete").each(function(e){$(this).attr("autocomplete","off")});$('a[rel="external"]').each(function(e){$(this).attr("target","_blank")});if($("#prefDisabled").val()=="false"){Preferences.init()}Omniture.init($("#locJs").val()+"/app/omniture/assets144.json.txt");LiteListener.start();var l=$("#pendingCharges").val();var q=$("#openPendingWindow").val();var t=$("#bPIndex").val()||"-1";var c=$("#cardInAce").val();var m=$("#cardCancelled").val();if(q=="Y"){Boot.deeplinkDisplayed=true;
if(l!=null&&l=="true"){Pending.open()}else{if((t=="0"||t=="-97")){if(m=="false"){Amex.Msg.error("ERROR PROCESSING REQUEST",Boot.messages.previewFail,true,null)}}else{if(c=="true"){if(m=="false"){Amex.Msg.error("ERROR PROCESSING REQUEST",Boot.messages.previewFail,true,null)}}}}$("#openPendingWindow").val("N")}if($("#mycaLite").val()=="true"){Boot.allCardsInLite=$("#allCardsInLite").val()+$("#sorted_index").val()+","}var f=$("#rtemDlinkEligible").val();var p=$("#openLayer").val();if((f!=null&&f=="true")&&(p!=null&&p=="S")){Boot.deeplinkDisplayed=true;
ReceiptUI.setOpenMatchShoeBox()}else{if(($("#openLayer").val()==="T"||$("#openLayer").val()==="C"||$("#intuit_workflow").val()==="QBD")&&$("#eligibleForQB").val()=="true"){Boot.deeplinkDisplayed=true;Amex.OverlayManager.block()}}if(!(($("#openLayer").length&&$("#openLayer").val()!=null&&($("#openLayer").val()=="R"||$("#openLayer").val()=="E"))||Boot.deeplinkDisplayed||$("#openLayer").val()=="T")){$.when(Rewards.rewardsPromise).then(function(){if(Boot.deeplinkDisplayed==true){if(Boot.interstitialsChecked){$.popeye("edr")
}else{Boot.rewardsLoaded=true}}});Boot.initPopeye()}if($("#qbReceiptDeepLink").val()=="true"){QB.showQBDLRctDtlLayer()}if(($("#eligibleForQB").val()==="false"||$("#eligibleForQbSetup").val()==="false")&&(($("#openLayer").val()==="C"||$("#openLayer").val()==="T")||$("#intuit_workflow").val()==="QBD")){Amex.Msg.alert(Amex.Msg.information,"Only Primary Cardholders for American Express Small Business cards can register for the Sync with QuickBooks application. Please log-in with your American Express credentials to proceed.",true,null)
}Rewards.rightColumnLocation()};$(window).resize(function(){setTimeout(function(){Rewards.rightColumnLocation()},500)});Boot.readyPopeye=function(){Boot.deferred=$.Deferred();if(!(typeof(MycaAssist)==="undefined")&&MycaAssist!=null){if(MycaAssist.isWidgetReady()!=undefined&&MycaAssist.isWidgetReady()){Boot.deferred.resolve(true)}else{if(!this.skipTimeOut){this.skipTimeOut=true;setTimeout(function(){Boot.initPopeye()},3000)}else{Boot.deferred.resolve(true)}}}else{if(!this.skipMycaTimeOut){this.skipMycaTimeOut=true;
setTimeout(function(){Boot.initPopeye()},3000)}else{Boot.deferred.resolve(true)}}return Boot.deferred};Boot.initPopeye=function(){var c=Boot.readyPopeye();c.done(function(){$.popeye("option","urlPath",$("#locStatic").val()+"/popeye/");$.popeye("load","interstitial");if(Boot.rewardsLoaded){$.popeye("edr")}Boot.interstitialsChecked=true})};Boot.initListView=function(){List.init();if($("#tagEligible").val()=="true"){Tag.init()}if($("#cardChgMessage").val()=="Y"){$("#bPIndex").val("0")}var c=$("#rcCardEligible").val();
var d=$("#liteEnabled").val();if(c=="true"&&d!="true"){Receipt.checkReceiptEnrollStatus()}QB.checkQBEligiblity();Rewards.init()};Boot.initSummaryView=function(){if($("#tagEligible").val()=="true"){Tag.loadTaglist()}Summary.init()};Boot.initGraphView=function(){$("#summaryYAxis").val("");if($("#tagEligible").val()=="true"){Tag.loadTaglist()}Graph.init()};Boot.initOverlay=function(){Amex.PageOverlay.init({backgroundColor:"#000000",color:"white"},0.2);Amex.OverlayManager.init($("#_progressOverlayWindow"))
};Boot.initPAW=function(){if($("#advSWF").length){setTimeout(Boot.loadPaw,1000)}else{}};Boot.loadPaw=function(){if($("#pawURL").val()!="#"){$.ajaxSetup({cache:true});$.getScript($("#pawURL").val(),function(){try{createSWF()}catch(c){}});$.ajaxSetup({cache:false})}};Boot.initDesAlert=function(){Amex.MessageBox.init($("#desAlertData").html(),{modal:false,theme:"amexWindow",buttons:["close"],title:"MESSAGE",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}})
};Boot.initCardChgMessage=function(){if(!(Boot.deeplinkDisplayed||($("#openLayer").length&&$("#openLayer").val()!=null&&($("#openLayer").val()=="R"||$("#openLayer").val()=="E")))){if($("#cardChgMessage").val()=="Y"){Amex.Msg.alert(Amex.Msg.information,"You do not have a matching Time Period for this Card. You are currently viewing your Recent Activity. ",true,null)}}};Boot.stringifyJSON=function(c){if($.browser.msie&&parseInt($.browser.version)==7){return Boot.ieStringify(c)}else{return JSON.stringify(c)
}};Boot.ieStringify=function(h){var f=typeof(h);if(f!="object"||h===null){if(f=="string"){h='"'+h+'"'}return String(h)}else{var l,d,e=[],c=(h&&h.constructor==Array);for(l in h){d=h[l];f=typeof(d);if(f=="string"){d='"'+d+'"'}else{if(f=="object"&&d!==null){d=Boot.ieStringify(d)}}e.push((c?"":'"'+l+'":')+String(d))}return(c?"[":"{")+String(e)+(c?"]":"}")}};if(typeof(DES_STOP_BOOT)==="undefined"||!DES_STOP_BOOT){if(channelType=="M"){$(document).ready(Boot_common.start)}else{$(document).ready(Boot.start)
}}var EDR={window:null,open:function(c){c=c+"&sorted_index="+T1.card.getSelected().index+"&BPIndex="+T1.period.getSelected().BPIndex;EDR.window=new Amex.Window({modal:true,theme:"amexWindow",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});EDR.window.update("<div><iframe src='"+c+"' scrolling='NO' frameborder='0'style='width: 900px; height: 610px;'></iframe></div>");EDR.window.render(document.body);EDR.window.centerInViewport();EDR.window.open()
},close:function(){Amex.PageOverlay.disableAlertMode();EDR.window.close();EDR.window.destroy();Rewards.load()},block:function(){Amex.PageOverlay.enableAlertMode()},unblock:function(){Amex.PageOverlay.disableAlertMode()}};function closeEDR(){EDR.close()}function blockEDR(){EDR.block()}function unblockEDR(){EDR.unblock()}function clickListener(c){App.lastClick=new Date()}function requestListener(){App.lastRequest=new Date()}var EDRPopUp={window:null,OpenLayer:function(c){EDRPopUp.window=new Amex.Window({modal:true,left:150,top:200,zIndex:9000,theme:"amexWindow",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});
EDRPopUp.window.update("<div>"+c+"</div>");EDRPopUp.window.render(document.body);EDRPopUp.window.centerInViewport();EDRPopUp.window.open()},close:function(){EDRPopUp.window.close();Amex.PageOverlay.disableAlertMode()},block:function(){Amex.PageOverlay.enableAlertMode()},unblock:function(){Amex.PageOverlay.disableAlertMode()},closeEDR:function(){EDRPopUp.window.close();EDR.close()}};var Forfeiture={window:null,open:function(c){c=c+"&sorted_index="+T1.card.getSelected().index+"&BPIndex="+T1.period.getSelected().BPIndex;
Forfeiture.window=new Amex.Window({modal:true,theme:"amexWindow",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});Forfeiture.window.update("<div style='border: 1px solid #bfbfbf;'><iframe src='"+c+"' scrolling='NO' frameborder='0'style='width: 752px; height: 512px;'></iframe></div>");Forfeiture.window.render(document.body);Forfeiture.window.centerInViewport();Forfeiture.window.open()},close:function(){Amex.PageOverlay.disableAlertMode();
Forfeiture.window.close();Forfeiture.window.destroy()},block:function(){Amex.PageOverlay.enableAlertMode()},unblock:function(){Amex.PageOverlay.disableAlertMode()}};function closeForfeiture(){Forfeiture.close()}function blockForfeiture(){Forfeiture.block()}function unblockForfeiture(){Forfeiture.unblock()}function refreshForfeiturePoints(){Forfeiture.close();Rewards.load()}var ForfeiturePopUp={window:null,OpenLayer:function(c){ForfeiturePopUp.window=new Amex.Window({modal:true,left:150,top:200,zIndex:9000,theme:"amexWindow",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});
ForfeiturePopUp.window.update("<div>"+c+"</div>");ForfeiturePopUp.window.render(document.body);ForfeiturePopUp.window.centerInViewport();ForfeiturePopUp.window.open()},close:function(){ForfeiturePopUp.window.close();Amex.PageOverlay.disableAlertMode()},block:function(){Amex.PageOverlay.enableAlertMode()},unblock:function(){Amex.PageOverlay.disableAlertMode()},closeForfeiture:function(){ForfeiturePopUp.window.close();Forfeiture.close()}};var OfferDetail={window:null,window:null,defaultMessage:null,table:undefined,container:null,selectEnabled:false,isOpen:false,print:null,lastSelectedDesc:null,messages:{previewLoad:"Please wait. Loading preview data ...",previewFail:"We are experiencing intermittent delays. Please try again later."},sortEl:null,init:function(){if(OfferDetail.window==null){var c=$("#OfferDetailChargesData");
if(c==null){Amex.Msg.alert("ALERT","OfferDetail information is not available.",true,null,350);Amex.Msg.setTriggerNode("offerId");return}OfferDetail.window=new Amex.Window({modal:true,left:150,top:180,theme:"amexWindow",buttons:["close"],title:"your offer",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:OfferDetail.onClose});OfferDetail.window.update(c.html());
OfferDetail.window.render(Page.form.id);c.remove()}return OfferDetail},open:function(){OfferDetail.init();if(OfferDetail.window!=null){OfferDetail.window.setTriggerNode("offerId");OfferDetail._updateOptions();OfferDetail.window.centerInViewport();OfferDetail.window.open();Amex.Util.showElements("closeOfferDetail");$("#pendingRequest").val("Y");Print.inPrintMode=false;if(OfferDetail.defaultMessage==null){OfferDetail.defaultMessage=$("#offerDetailContent").html()}}return OfferDetail},show:function(f,d,e,c){OfferDetail.open();
OfferDetail.showOfferDetail(f,d,e,c)},close:function(){if(OfferDetail.window!=null){OfferDetail.window.close();OfferDetail.onClose()}},onClose:function(){OfferDetail.isOpen=false;$("#pendingRequest").val("N");Amex.PageOverlay.hide();return true},_updateOptions:function(){if(OfferDetail.defaultMessage!=null){OfferDetail.updatePreview(OfferDetail.defaultMessage)}}};OfferDetail.showOfferDetail=function(l,e,f,d){var c=$("#viewType").val();$("#spendBasedOfferEventType").val("SF");$("#spendBasedOfferId").val(l);
$("#spendBasedOfferSeNum").val(e);$("#spendBasedOfferRefNum").val(d);$("#spendBasedOfferSelectMethod").val(f);$("#fetchPreferences").val(false);var h=[];h=formParameters.getParams("offerDetail.do");$.ajax({url:"offerDetail.do",data:h,success:function(m,o,n){if(n.getResponseHeader("MYCAError")==null){OfferDetail.updatePreview(m);Omniture.report("list_offers_success")}else{OfferDetail.close();Omniture.report("list_offers_failure");Amex.Msg.error("error processing request",m,true,null)}},error:function(o,m,n){if(OfferDetail.isOpen){Amex.OverlayManager.pWin.close();
Amex.PageOverlay.disableAlertMode();Amex.Msg.error("error processing request",o.responseText,true,null);Amex.Msg.setTriggerNode(triggerNode)}else{OfferDetail.updatePreviewFailMessage(OfferDetail.messages.previewFail)}Omniture.report("list_offers_failure")}});$("#fetchPreferences").val(true)};OfferDetail.updatePreview=function(c){$("#offerDetailContent").html(c);if($("#closeOfferDetail").length){OfferDetail.window._setFocusCycle("closeOfferDetail")}Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode()
};OfferDetail.updatePreviewFailMessage=function(c){OfferDetail.window.close();Amex.Msg.error("error processing request",OfferDetail.messages.previewFail,true,null);Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode()};OfferDetail.initSpendBasedOffer=function(){var e=$("#offerLinkEligible").val();var c=$("#viewType").val();if(e!=null&&e=="true"&&c!=null&&c=="L"){$("#spendBasedOfferEventType").val("GF");$("#fetchPreferences").val(false);var d=[];d=formParameters.getParams("offerDetail.do");
$.ajax({url:"offerDetail.do",data:d,success:function(s,l,r){if(s!=null&&s.length>0){for(var n=0;n<1;n++){var p=$.parseJSON(s[n]);var q=new Element("DIV");q.id="offerDisp";q.addClassName("offerDisplay");var h=p.offerId+"','"+p.seNumber+"','"+p.offerSelectMethod+"','"+p.transRefnum;var f=null;var o="Click to View Offers";if(p.merchantName==""||p.merchantName=="undefined"){f=p.description}else{f=p.merchantName+" - "+p.description}if(f.length>66){f=f.substring(0,66);var m=f.lastIndexOf(" ");f=f.substring(0,m);
f=f+"..."}q.update('<a href="#" id="offerId" title=\''+o+"' alt='"+o+"' class='offerDisplayLink blue popup'' onclick=\"{OfferDetail.show('"+h+"');return false;}\">"+f+"</a>");$("#offerD").html(q)}$("#offerBox").css({display:"block"})}else{if($("#offerD").html()!=null){$("#offerBox").hide()}}},error:function(l,f,h){}});$("#fetchPreferences").val(true)}};OfferDetail.getOffer=function(f,e,d,c,l){var h=$("#viewType").val();window.open(f,"offerwindow","location=1,status=1,scrollbars=1, width=900,height=600");
Omniture.report("list_getOffer_click");OfferDetail.getOfferAuditLog("CF",e,d,c,l)};OfferDetail.printOffer=function(f,e,d,c,h){var l=$("#viewType").val();window.open(f,"printWindow","width=600,max-height=350,scrollbars=1,toolbar=no,menubar=no");Omniture.report("list_printOffer_click");OfferDetail.getOfferAuditLog("PF",e,d,c,h)};OfferDetail.getOfferAuditLog=function(e,f,d,c,h){$("#spendBasedOfferId").val(f);$("#spendBasedOfferEventType").val(e);$("#spendBasedOfferSeNum").val(d);$("#spendBasedOfferRefNum").val(c);
$("#spendBasedOfferSelectMethod").val(h);$("#fetchPreferences").val(false);var l=[];l=formParameters.getParams("offerDetail.do");$.ajax({url:"offerDetail.do",data:l,success:function(m,o,n){if(n.getResponseHeader("MYCAError")==null){}else{}},error:function(o,m,n){}});$("#fetchPreferences").val(true)};var EnterpriseOffers={window:null,defaultMessage:null,table:undefined,container:null,isOpen:false,currentDclIndex:0,focusIndex:0,eosOfferCache:null,enrollStatus:null,eosOfferCacheSize:null,showInterstitial:null,lastSelectedDesc:null,buttonText:null,offerId:null,isConfirmationLayerClosed:false,offerType:null,offerUrl:null,messages:{previewLoad:"Please wait. Loading preview data ...",previewFail:"Sorry, the system cannot process your request at this time.",previewLoadingCardFail:"Sorry, we are having trouble loading this offer to your Card right now, please <br> contact Customer Service for assistance."},init:function(){if(EnterpriseOffers.window==null){var c=$("#enterpriseOffersDetailData");
if(c==null){Amex.Msg.alert("ALERT","EnterpriseOfferDetail information is not available.",true,null,350);Amex.Msg.setTriggerNode("EOSofferId");return}EnterpriseOffers.window=new Amex.Window({modal:true,left:150,top:180,theme:"amexWindow",buttons:["close"],title:"",shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"},openEffect:Amex.Window.fadeInEffect,closeEffect:Amex.Window.fadeOutEffect,onClose:EnterpriseOffers.onClose});EnterpriseOffers.window.update(c.html());
EnterpriseOffers.window.render(Page.form.id);c.remove()}return EnterpriseOffers},open:function(){EnterpriseOffers.init();EnterpriseOffers.window.setTriggerNode("EOSofferId");EnterpriseOffers._updateOptions();EnterpriseOffers.window.centerInViewport();EnterpriseOffers.window.open();Amex.Util.showElements("closeenterpriseOffers");if(EnterpriseOffers.window!=null){if(EnterpriseOffers.defaultMessage==null){EnterpriseOffers.defaultMessage=$("#enterpriseOfferDetailContent").html()}}return EnterpriseOffers
},show:function(){if(EnterpriseOffers.offerType=="COUPONLESS"){Omniture.report("dcl_offers_launchAddtoCard")}else{if(EnterpriseOffers.offerType=="COUPONFULL"){Omniture.report("dcl_offers_launchGetDetails")}}EnterpriseOffers.open();EnterpriseOffers.getEnterpriseOfferDetails()},close:function(){if(EnterpriseOffers.window!=null){EnterpriseOffers.window.close();EnterpriseOffers.onClose()}},onClose:function(){EnterpriseOffers.isOpen=false;if(EnterpriseOffers.isConfirmationLayerClosed){EnterpriseOffers.removeEOSOfferAt(EnterpriseOffers.currentDclIndex);
EnterpriseOffers.isConfirmationLayerClosed=false}$("#pendingRequest").val("N");Amex.PageOverlay.hide();return true},_updateOptions:function(){if(EnterpriseOffers.defaultMessage!=null){EnterpriseOffers.updatePreview(EnterpriseOffers.defaultMessage)}}};EnterpriseOffers.initEOSDisplayPanel=function(){var c=null;EnterpriseOffers.currentDclIndex=0;if(EnterpriseOffers.eosOfferCacheSize>1){c=EnterpriseOffers.getcarousalButton();$("#carousalButtonList").html(c);EnterpriseOffers.carouselPointersHover();EnterpriseOffers.carouselPointersFocus();
EnterpriseOffers.bindEOSPanel();EnterpriseOffers.bindRgtArrow();EnterpriseOffers.bindLftArrow()}if(EnterpriseOffers.eosOfferCacheSize>0){$("#EOSOfferBox").show();$("#dclDivider").show()}EnterpriseOffers.loadEOSOffer(EnterpriseOffers.currentDclIndex)};EnterpriseOffers.initEOSffer=function(){$("#doeOfferURLId").on("click",EnterpriseOffers.getDeoOfferUrl);if(EnterpriseOffers.eosOfferCache!=null&&$("#eosOfferLinkEligible").val()=="true"&&$("#viewType").val()=="L"){EnterpriseOffers.initEOSDisplayPanel()
}else{if($("#normalViewCardChanged").val()=="true"){EnterpriseOffers.eosOfferCache=null}if($("#eosOfferLinkEligible").val()=="true"&&$("#viewType").val()=="L"){$("#enterpriseOffersEventType").val("EGF");$("#fetchPreferences").val(false);var c=[];c=formParameters.getParams("enterpriseOfferDetail.do");$.ajax({url:"enterpriseOfferDetail.do",async:true,type:"POST",data:c,success:function(d,f,e){if(e.getResponseHeader("EOSError")!="EOS001"){EnterpriseOffers.eosOfferCache=($.parseJSON(e.responseText)).getOffers;
EnterpriseOffers.eosOfferCacheSize=EnterpriseOffers.eosOfferCache.length;if(EnterpriseOffers.eosOfferCacheSize==0){Omniture.report("dcl_offers_ZeroOffers")}EnterpriseOffers.initEOSDisplayPanel()}else{Omniture.report("dcl_offers_ErrorOffers")}},error:function(f,d,e){Omniture.report("dcl_offers_ErrorOffers")}});$("#fetchPreferences").val(true)}}};EnterpriseOffers.getEnterpriseOfferDetails=function(){if($("#eosOfferLinkEligible").val()=="true"&&$("#viewType").val()=="L"){$("#enterpriseOffersEventType").val("EOD");
$("#enterpriseOfferId").val(EnterpriseOffers.offerId);$("#enterpriseOfferSourceId").val(EnterpriseOffers.eosOfferCache[EnterpriseOffers.currentDclIndex].offerSourceId);$("#buttonText").val(EnterpriseOffers.eosOfferCache[EnterpriseOffers.currentDclIndex].CBAButtonText);var c=$("#sorted_index").val();$("#fetchPreferences").val(false);var d=[];d=formParameters.getParams("enterpriseOfferDetail.do");$.ajax({url:"enterpriseOfferDetail.do",async:true,type:"POST",data:d,success:function(e,h,f){if(f.getResponseHeader("EOSError")!="EOS001"){EnterpriseOffers.updatePreview(e)
}else{EnterpriseOffersPopUp.OpenLayer(EnterpriseOffers.messages.previewFail);Omniture.report("dcl_offers_ErrorOffers")}},error:function(h,e,f){EnterpriseOffersPopUp.OpenLayer(EnterpriseOffers.messages.previewFail)}});$("#fetchPreferences").val(true)}};EnterpriseOffers.getCouponfullURL=function(){$("#enterpriseOfferUrl").val(EnterpriseOffers.offerUrl);$("#enterpriseOfferId").val(EnterpriseOffers.eosOfferCache[EnterpriseOffers.currentDclIndex].offerId);$("#offerUrlType").val(EnterpriseOffers.eosOfferCache[EnterpriseOffers.currentDclIndex].UrlType);
$("#fetchPreferences").val(false);var c=[];c=formParameters.getParams("enterpriseOfferDetail.do");$.ajax({url:"enterpriseOfferDetail.do",async:true,type:"POST",data:c,success:function(d,f,e){Omniture.report("dcl_offers_redeemSuccess")},error:function(f,d,e){Omniture.report("dcl_offers_ErrorOffers")}});$("#fetchPreferences").val(true);window.open(EnterpriseOffers.offerUrl)};EnterpriseOffers.getCouponLessURL=function(){window.open(EnterpriseOffers.offerUrl)};EnterpriseOffers.updatePreview=function(c){$("#enterpriseOfferDetailContent").html(c);
if(EnterpriseOffers.buttonText=="Add to Card"){EnterpriseOffers.window._setFocusCycle("addToCard")}else{EnterpriseOffers.window._setFocusCycle("redeemNow")}Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode()};EnterpriseOffers.updatePreviewFailMessage=function(c){EnterpriseOffers.window.close();Amex.Msg.error("error processing request",EnterpriseOffers.messages.previewFail,true,null);Amex.OverlayManager.pWin.close();Amex.PageOverlay.disableAlertMode()};EnterpriseOffers.enrollOffers=function(){var c=$("#viewType").val();
$("#imageDisplay").html("<span id='plusButtonImage' class='plusButton' style='display:none'></span><span id='imageLoader'><img class='floatRight spacingLoader' src='"+$("#locImages").val()+"/loading.gif' alt='loading' /></span>");$("#addToCard").disabled="true";$("#cancelOfferEnrollment").disabled="true";$("#enterpriseOffersEventType").val("LTC");$("#enterpriseOfferId").val(EnterpriseOffers.offerId);$("#fetchPreferences").val(false);var d=[];d=formParameters.getParams("enterpriseOfferDetail.do");
$.ajax({url:"enterpriseOfferDetail.do",async:true,type:"POST",data:d,success:function(e,h,f){if(f.getResponseHeader("EOSError")!="EOS001"){EnterpriseOffers.enrollStatus=($.parseJSON(f.responseText)).enrollmentStatus;if("S"==EnterpriseOffers.enrollStatus){$("#actionButtons").css({display:"none"});$("#termNConditions").css({marginTop:"-15px"});$("#successPage").css({display:"block"});EnterpriseOffers.isConfirmationLayerClosed=true;Omniture.report("dcl_offers_showOffersAddTocard")}else{$("#plusButtonImage").css({display:"block"});
$("#imageLoader").css({display:"none"});EnterpriseOffersPopUp.OpenLayer(EnterpriseOffers.messages.previewLoadingCardFail);Omniture.report("dcl_offers_ErrorOffers")}}else{$("#plusButtonImage").css({display:"block"});$("#imageLoader").css({display:"none"});EnterpriseOffersPopUp.OpenLayer(EnterpriseOffers.messages.previewLoadingCardFail);Omniture.report("dcl_offers_ErrorOffers")}},error:function(h,e,f){$("#plusButtonImage").css({display:"block"});$("#imageLoader").css({display:"none"});EnterpriseOffersPopUp.OpenLayer(EnterpriseOffers.messages.previewLoadingCardFail);
Omniture.report("dcl_offers_ErrorOffers")}});$("#fetchPreferences").val(true)};EnterpriseOffers.showExitMessageOfAmex=function(c){Omniture.report("dcl_offers_launchGetDetails");EnterpriseOffersLegalPopUp.OpenLayer()};var EnterpriseOffersLegalPopUp={window:null,OpenLayer:function(){if(EnterpriseOffersLegalPopUp.window==null){EnterpriseOffersLegalPopUp.window=new Amex.Window({modal:true,left:150,top:200,buttons:["close"],title:"",zIndex:9000,theme:"amexWindow",onClose:EnterpriseOffersLegalPopUp.close,shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});
var d=null;var c=null;if(EnterpriseOffers.offerType=="COUPONFULL"){c="EnterpriseOffers.getCouponfullURL();"}else{c="EnterpriseOffers.getCouponLessURL();"}var d='<div class="contanierSize"><div style="display:inline-block"><img src=\''+$("#locImages").val()+'/061011_prefedint_CCSG_Logo.jpg\' style="float: left;"></div><p class="exitMessage"><b>You are now leaving this American Express website.</b></p><br><p class="exitMessage">You are about to enter a third-party website where all use is governed by that website\'s terms and conditions and subject to its privacy and security policies and practices. In no event will American Express be liable or responsible for any loss, damage, cost or expense arising from or in connection with your access to and use of the third-party website.</p> <div class=\'textAlign continuePlace\'><button id="continueButtonExitMessage" class="blueButton continuePlacer lastFocus" onclick="{EnterpriseOffersLegalPopUp.close();'+c+'return false;}" title="Continue" type="button"><span class="blueWrapper lastFocus">Continue</span> </button></div></div>';
EnterpriseOffersLegalPopUp.window.update(d);EnterpriseOffersLegalPopUp.window.render(document.body)}if(EnterpriseOffers.showInterstitial==true){EnterpriseOffersLegalPopUp.window.setTriggerNode("redeemNow")}else{EnterpriseOffersLegalPopUp.window.setTriggerNode("EOSofferId")}EnterpriseOffersLegalPopUp.window.centerInViewport();EnterpriseOffersLegalPopUp.window.open();EnterpriseOffersLegalPopUp.window._setFocusCycle("continueButtonExitMessage");Amex.PageOverlay.enableAlertMode()},close:function(){EnterpriseOffersLegalPopUp.window.close();
Amex.PageOverlay.disableAlertMode()}};var EnterpriseOffersPopUp={window:null,OpenLayer:function(c){if(EnterpriseOffersPopUp.window==null){EnterpriseOffersPopUp.window=new Amex.Window({modal:true,left:150,top:200,buttons:["close"],title:"",zIndex:9000,theme:"amexWindow",onClose:EnterpriseOffersPopUp.close,shadow:{size:6,color:"#666666",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}});EnterpriseOffersPopUp.window.update("<div class='errorMsgContainer'><h2 class='titleTextError'>error processing request</h2><span class='msgIcon'>&nbsp;</span><p class='msgText' id='messageText'>"+c+"</p><div id='okAlign' class='textAlign'><button title='Close this window' class='amexMsgButtonOK' type='button' id='oKErrorMessage' onclick='EnterpriseOffersPopUp.close();return false;'><span class='blueWrapper'>ok</span></button></div></div>");
EnterpriseOffersPopUp.window.render(document.body)}EnterpriseOffersPopUp.window.setTriggerNode("EOSofferId");EnterpriseOffersPopUp.window.centerInViewport();EnterpriseOffersPopUp.window.open();EnterpriseOffersPopUp.window._setFocusCycle("oKErrorMessage");Amex.PageOverlay.enableAlertMode()},close:function(){EnterpriseOffersPopUp.window.close();EnterpriseOffers.close();Amex.PageOverlay.disableAlertMode()}};EnterpriseOffers.bindEOSPanel=function(){$("#carouselLftArrow").addClass("carouselLftArrow");
$("#carouselRghtArrow").addClass("carouselRghtArrow");$("#carousalButtonList").show();$("#carouselLftArrow").on("mouseover",function(){$("#carouselLftArrow").removeClass("carouselLftArrow");$("#carouselLftArrow").addClass("carouselLftArrowHover")});$("#carouselLftArrow").on("mouseout",function(){$("#carouselLftArrow").addClass("carouselLftArrow");$("#carouselLftArrow").removeClass("carouselLftArrowHover")});$("#carouselRghtArrow").on("mouseover",function(){$("#carouselRghtArrow").removeClass("carouselRghtArrow");
$("#carouselRghtArrow").addClass("carouselRghtArrowHover")});$("#carouselRghtArrow").on("mouseout",function(){$("#carouselRghtArrow").addClass("carouselRghtArrow");$("#carouselRghtArrow").removeClass("carouselRghtArrowHover")});$(".carousel").off().on("click",function(d){var f=$(this).attr("id");var c=f.substring(f.indexOf("_")+1);EnterpriseOffers.getOfferAtEvent(c);setTimeout(function(){EnterpriseOffers.bindEOSPanel()},600)});$(".carousel").on("keydown",function(f){var d=$(this).attr("id");var c=d.substring(d.indexOf("_")+1);
EnterpriseOffers.carouselKeyBoardAccessibility(f,c)})};EnterpriseOffers.getCouponLessOffer=function(d,e,c,h,f){EnterpriseOffers.offerUrl=c;EnterpriseOffers.offerId=h;EnterpriseOffers.buttonText="Get Details";return"<div id='eosBanner' class='eosBanner' ><div id='merchantName' ><h1>"+d+"</h1></div><div id='merchantDesc' ><br><p>"+e+"</p><br></div><div id='EOSofferList' class='offerBox'><button id='EOSofferId' type='button' title='"+EnterpriseOffers.buttonText+"' class='blueButton spacingOfferButton'><span class='blueWrapper'>"+EnterpriseOffers.buttonText+"</span> </button></div>"
};EnterpriseOffers.getCouponFullOffer=function(f,h,e,c,m,l){EnterpriseOffers.offerUrl=e;EnterpriseOffers.offerId=m;EnterpriseOffers.buttonText="Get Details";var d="EnterpriseOffers.showExitMessageOfAmex();return false;";if(c){d="EnterpriseOffers.show();return false;"}return"<div id='eosBanner' class='eosBanner' ><div id='merchantName' ><h1>"+f+"</h1></div><div id='merchantDesc' ><br><p>"+h+"</p><br></div><div id='EOSofferList' class='offerBox'><button id='EOSofferId' type='button' title='"+EnterpriseOffers.buttonText+"' class='blueButton spacingOfferButton'\"><span class='blueWrapper'>"+EnterpriseOffers.buttonText+"</span> </button></div>"
};EnterpriseOffers.getOfferPrev=function(){$("#carouselLftArrow").off("click");--EnterpriseOffers.currentDclIndex;if(EnterpriseOffers.currentDclIndex<0){EnterpriseOffers.currentDclIndex=EnterpriseOffers.eosOfferCacheSize-1}EnterpriseOffers.slideOfferFromLeft(EnterpriseOffers.currentDclIndex);Omniture.report("dcl_offers_Rotate")};EnterpriseOffers.slideOfferFromLeft=function(c){var d=600;if($.browser.webkit||parseInt($.browser.version)==7||parseInt($.browser.version)==8){d=600}$("#EOSOfferBox").html(EnterpriseOffers.loadEOSOfferSlider(c));
$("#EOSOfferBox").show("slide",{direction:"left"},d);Omniture.report("dcl_offers_Rotate")};EnterpriseOffers.slideOfferFromRight=function(c){$("#EOSOfferBox").html(EnterpriseOffers.loadEOSOfferSlider(c));$("#EOSOfferBox").show("slide",{direction:"right"},600);Omniture.report("dcl_offers_Rotate")};EnterpriseOffers.getOfferNext=function(){$("#carouselRghtArrow").off("click");EnterpriseOffers.currentDclIndex++;if(EnterpriseOffers.currentDclIndex>EnterpriseOffers.eosOfferCacheSize-1){EnterpriseOffers.currentDclIndex=0
}EnterpriseOffers.slideOfferFromRight(EnterpriseOffers.currentDclIndex);Omniture.report("dcl_offers_Rotate")};function removeItemPrev(){$("#EOSOfferBox").remove();$("#EOSOfferBoxTemp").attr("id","EOSOfferBox");$("#EOSOfferBox").removeClass("offerEOSDisplayRt");$("#EOSOfferBox").addClass("divSlide");$("#EOSOfferBox").css({cursor:"pointer"});if(!EnterpriseOffers.showInterstitial){$("#EOSOfferBox").on("click",EnterpriseOffers.showExitMessageOfAmex)}else{$("#EOSOfferBox").on("click",EnterpriseOffers.show)
}$("#carouselLftArrow").on("click",EnterpriseOffers.getOfferPrev)}function removeItemNext(){$("#EOSOfferBox").remove();$("#EOSOfferBoxTemp").attr("id","EOSOfferBox");$("#EOSOfferBox").removeClass("offerEOSDisplayRt");$("#EOSOfferBox").css({"float":"left",left:"auto",top:"auto",position:""});$("#EOSOfferBox").css({cursor:"pointer"});if(!EnterpriseOffers.showInterstitial){$("#EOSOfferBox").on("click",EnterpriseOffers.showExitMessageOfAmex)}else{$("#EOSOfferBox").on("click",EnterpriseOffers.show)}$("#carouselRghtArrow").on("click",EnterpriseOffers.getOfferNext)
}EnterpriseOffers.getOfferAtEvent=function(c){if(c==EnterpriseOffers.currentDclIndex){return}if(c>=EnterpriseOffers.currentDclIndex){EnterpriseOffers.slideOfferFromRight(c)}else{EnterpriseOffers.slideOfferFromLeft(c)}};EnterpriseOffers.loadEOSOfferSlider=function(d){var f=null;if(EnterpriseOffers.eosOfferCache!=null&&EnterpriseOffers.eosOfferCacheSize>0){var e=EnterpriseOffers.eosOfferCache[d];EnterpriseOffers.offerType=e.offerFulfillmentType;var c=e.Url;if(!EnterpriseOffers.isUrl(c)){c="http://"+c
}if(e.offerFulfillmentType=="COUPONFULL"){f=EnterpriseOffers.getCouponFullOffer(e.merchantName,e.OfferDescription,c,e.showInterstitial,e.offerId,e.CBAButtonText);if(!e.showInterstitial){$("#EOSOfferBox").off().on("click",EnterpriseOffers.showExitMessageOfAmex);EnterpriseOffers.showInterstitial=false}else{$("#EOSOfferBox").off().on("click",EnterpriseOffers.show);EnterpriseOffers.showInterstitial=true}}else{if(e.offerFulfillmentType=="COUPONLESS"){f=EnterpriseOffers.getCouponLessOffer(e.merchantName,e.OfferDescription,c,e.offerId,e.CBAButtonText);
if(e.showInterstitial){$("#EOSOfferBox").off().on("click",EnterpriseOffers.openEOSOffer);EnterpriseOffers.showInterstitial=true}}}if(EnterpriseOffers.eosOfferCacheSize>1){EnterpriseOffers.carouselSelectedAt(d)}$("#dclDivider").addClass("divider_dcl")}EnterpriseOffers.currentDclIndex=d;return f};EnterpriseOffers.openEOSOffer=function(c){if(null!=c){c.preventDefault()}if(EnterpriseOffers.offerType=="COUPONLESS"){Omniture.report("dcl_offers_launchAddtoCard")}else{if(EnterpriseOffers.offerType=="COUPONFULL"){Omniture.report("dcl_offers_launchGetDetails")
}}EnterpriseOffers.open();EnterpriseOffers.getEnterpriseOfferDetails()};EnterpriseOffers.loadEOSOffer=function(d){var h=null;if(EnterpriseOffers.eosOfferCache!=null&&EnterpriseOffers.eosOfferCacheSize>0){var e=EnterpriseOffers.eosOfferCache[d];EnterpriseOffers.showInterstitial=e.showInterstitial;var f=e.CBAButtonText;EnterpriseOffers.offerType=e.offerFulfillmentType;var c=e.Url;if(!EnterpriseOffers.isUrl(c)){c="http://"+c}if(e.offerFulfillmentType=="COUPONFULL"){h=EnterpriseOffers.getCouponFullOffer(e.merchantName,e.OfferDescription,c,e.showInterstitial,e.offerId,e.CBAButtonText);
$("#EOSOfferBox").html(h);$("#EOSOfferBox").css({cursor:"pointer"});if(!e.showInterstitial){$("#EOSOfferBox").off().on("click",EnterpriseOffers.showExitMessageOfAmex);EnterpriseOffers.showInterstitial=false}else{$("#EOSOfferBox").off().on("click",EnterpriseOffers.show);EnterpriseOffers.showInterstitial=true}}else{if(e.offerFulfillmentType=="COUPONLESS"){h=EnterpriseOffers.getCouponLessOffer(e.merchantName,e.OfferDescription,c,e.offerId,e.CBAButtonText);if(e.showInterstitial){$("#EOSOfferBox").off().on("click",EnterpriseOffers.openEOSOffer);
EnterpriseOffers.showInterstitial=true}$("#EOSOfferBox").html(h);$("#EOSOfferBox").css({cursor:"pointer"})}}if(EnterpriseOffers.eosOfferCacheSize>1){EnterpriseOffers.carouselSelectedAt(d)}$("#dclDivider").addClass("divider_dcl");$("#dividerDeo").removeClass("deoWrap");$("#dividerDeo").addClass("dividerDeoDispaly");$("#doeOfferURLIdOffer").removeClass("deoWrap");$("#doeOfferURLIdOffer").addClass("deoDisplayIOffer");$("#doeOfferURLId").removeClass("deoWrap");$("#doeOfferURLId").addClass("deoDisplay");
$("#adoeOfferURLId").addClass("blue secondary popup deoFont")}EnterpriseOffers.currentDclIndex=d};EnterpriseOffers.removeEOSOfferAt=function(c){EnterpriseOffers.currentDclIndex=c;EnterpriseOffers.eosOfferCache.splice(EnterpriseOffers.currentDclIndex,1);EnterpriseOffers.eosOfferCacheSize--;if(EnterpriseOffers.eosOfferCacheSize>1){$("#carousalButtonList").html(EnterpriseOffers.getcarousalButton());EnterpriseOffers.carouselPointersHover();EnterpriseOffers.bindEOSPanel();EnterpriseOffers.bindRgtArrow();
EnterpriseOffers.bindLftArrow()}else{$("#carouselLftArrow").removeClass("carouselLftArrow");$("#carouselRghtArrow").removeClass("carouselRghtArrow");$("#carousalButtonList").hide()}$("#EOSOfferBox").off("click");EnterpriseOffers.currentDclIndex=EnterpriseOffers.currentDclIndex++;if(EnterpriseOffers.currentDclIndex>EnterpriseOffers.eosOfferCacheSize-1){EnterpriseOffers.currentDclIndex=0}if(EnterpriseOffers.eosOfferCacheSize<1){$("#EOSOfferBox").on("click",EnterpriseOffers.show);$("#EOSOfferBox").hide();
$("#dclDivider").hide();EnterpriseOffers.eosOfferCache=null;EnterpriseOffers.initEOSffer()}else{EnterpriseOffers.loadEOSOffer(EnterpriseOffers.currentDclIndex)}};EnterpriseOffers.getcarousalButton=function(){var c="";for(count=0;count<EnterpriseOffers.eosOfferCacheSize;count++){c=c+"<td><div style='display: block;' id='carousel_"+count+"' class='carousel carouselOff' tabindex="+count+"></div></td>"}return c};EnterpriseOffers.carouselPointersHover=function(){for(count=0;count<EnterpriseOffers.eosOfferCacheSize;
count++){$("#carousel_"+count).on("mouseover",function(){$(this).addClass("carouselHoverImage")});$("#carousel_"+count).on("mouseout",function(){$(this).removeClass("carouselHoverImage")})}};EnterpriseOffers.carouselPointersFocus=function(){for(count=0;count<EnterpriseOffers.eosOfferCacheSize;count++){$("#carousel_"+count).on("focus",function(){$(this).addClass("carouselHoverImage")});$("#carousel_"+count).on("blur",function(){$(this).removeClass("carouselHoverImage")})}};EnterpriseOffers.carouselSelectedAt=function(c){for(count=0;
count<EnterpriseOffers.eosOfferCacheSize;count++){if(count==c){$("#carousel_"+count).removeClass("carouselOff");$("#carousel_"+count).addClass("carouselOn")}else{$("#carousel_"+count).removeClass("carouselOn");$("#carousel_"+count).addClass("carouselOff")}}};EnterpriseOffers.isUrl=function(c){var d=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return d.test(c)};EnterpriseOffers.carouselKeyBoardAccessibility=function(e,h){if(e.keyCode==9&&e.shiftKey){var d=parseInt(h)-1;
if(d!=-1){e.preventDefault();$("#carousel_"+d).focus()}else{$("#carousel_0").removeClass("carouselHoverImage")}}if(e.keyCode==9&&!e.shiftKey){var f=$(e).attr("id");if(f=="EOSofferId"){e.preventDefault();$("#carousel_0").focus()}else{var d=parseInt(h)+1;var c=EnterpriseOffers.eosOfferCacheSize;if(d!=c){e.preventDefault();$("#carousel_"+d).focus()}else{e.preventDefault();$("#footer_cards_personal").focus();$("#carousel_"+(d-1)).removeClass("carouselHoverImage")}}}if(e.keyCode==13){var f=$(e).attr("id");
var d=parseInt(h);EnterpriseOffers.getOfferAtEvent(d);if(EnterpriseOffers.eosOfferCacheSize>1){EnterpriseOffers.carouselSelectedAt(d)}$("#carousel_"+d).removeClass("carouselHoverImage");e.preventDefault()}};EnterpriseOffers.bindLftArrow=function(){$("#carouselLftArrow").off().on("click",function(d){--EnterpriseOffers.currentDclIndex;if(EnterpriseOffers.currentDclIndex<0){EnterpriseOffers.currentDclIndex=EnterpriseOffers.eosOfferCacheSize-1}EnterpriseOffers.slideOfferFromLeft(EnterpriseOffers.currentDclIndex);
var c=EnterpriseOffers.currentDclIndex;var f=$(".carouselOn").attr("id");$(f).hide();$(f).removeClass("carouselOn");$(f).addClass("carouselOff");$("#carousel_"+c).removeClass("carouselOff");$("#carousel_"+c).addClass("carouselOn");setTimeout(function(){EnterpriseOffers.bindLftArrow()},600)})};EnterpriseOffers.bindRgtArrow=function(){$("#carouselRghtArrow").off().on("click",function(d){EnterpriseOffers.currentDclIndex++;if(EnterpriseOffers.currentDclIndex>EnterpriseOffers.eosOfferCacheSize-1){EnterpriseOffers.currentDclIndex=0
}EnterpriseOffers.slideOfferFromRight(EnterpriseOffers.currentDclIndex);var c=EnterpriseOffers.currentDclIndex;var f=$(".carouselOn").attr("id");$(f).hide();$(f).removeClass("carouselOn");$(f).addClass("carouselOff");$("#carousel_"+c).removeClass("carouselOff");$("#carousel_"+c).addClass("carouselOn");setTimeout(function(){EnterpriseOffers.bindRgtArrow()},600)})};EnterpriseOffers.getDeoOfferUrl=function(){var c="";var d=$("#sorted_index").val();if($("#doeOfferURL").length){c=$("#doeOfferURL").val();
if($("#sorted_index").length){c=c+d}else{c=c+"0"}c=c+"&intlink=us-ser-estatement-postedtransactions-exploremoreoffers";window.location=c}};var QBDropDown={card:null,period:null,ace:null,cardChnMsg:'Your Tag selection will not be maintained. All other choices will persist. Click "OK" to continue with your Card selection.',buttonNotSelected:'You must select a "View By" view to continue.',cardChnMsg2:'Your Tag selection will not be maintained. Click "OK" to continue with your Card selection.',eSDRLite:null,fromField:"startDateTxtQB",toField:"endDateTxtQB",go:"periodGoQB",validated:true,isCardChange:false,isTimePeriodChange:false};
QBDropDown.init=function(){if(QBDropDown.card===null){QBDropDown.card=new Des.CardSelectButton("qbCardSelect",{menuPosition:"bl",nextFocus:"qbExpandTP",menu:{theme:"cardSelectMenu",left:0,top:0,width:320,position:"bl",shadow:{size:4,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}},items:QB.cardList,templates:{basic:$.template("<a href='#' title='' hidefocus='hidefocus' onclick='{return false;}'><span style='font-weight: bold;'>#{description}</span> - <span>#{account}</span></a>"),supp:$.template("<a href='#' title='' hidefocus='hidefocus' onclick='{return false;}'><span>#{name}</span> - <span>#{account}</span></a>")}});
QBDropDown.card.options.menu.render("qbCardSelect");var e=$("#aaRCLink");if(e.length){var c=new Amex.MenuItem("aaCard",e.show());QBDropDown.card.options.menu.addItem(c)}QBDropDown.card.off("change",QBDropDown.changeCard);QBDropDown.card.on("change",QBDropDown.changeCard)}if(QBDropDown.period===null){QBDropDown.period=new Des.PeriodSelectButton("qbPeriodSelect",{menuPosition:"bl",prevFocus:"qbCardExpand",menu:{theme:"periodSelectMenu",left:0,top:0,width:287,position:"bl",shadow:{size:4,color:"#cccccc",background:"url('"+$("#locImages").val()+"/shadow.png') bottom right no-repeat"}},items:QB.periodList,templates:{main:$.template("<a title='' href='#' hidefocus='hidefocus' onclick='{return false;}'><span style='float:left;width:130px;text-align:left;font-weight: bold;'>#{name}</span><span style='width:150px;margin-left:10px;text-align:left;'>#{description}&nbsp;</span><span class='tpClear'></span></a>"),sub:$.template("<a title='' hidefocus='hidefocus' href='#' onclick='{return false;}'><span style='width:130px;float:left;'>&nbsp;</span><span style='width:150px;margin-left:10px;text-align:left;white-space:nowrap;'>#{description}&nbsp;</span><span class='tpClear'></span></a>"),subMenu:$.template("<a title='' hidefocus='hidefocus' href='#' onclick='{return false;}'><span class='floatSubMenu'>#{description}</span><span class='tpClear'></span></a>")}});
QBDropDown.period.options.menu.render("qbPeriodSelect");QBDropDown.period.off("change",QBDropDown.changePeriod);QBDropDown.period.off("open",QBDropDown.revert);QBDropDown.period.on("change",QBDropDown.changePeriod);QBDropDown.period.on("open",QBDropDown.revert);var f=QBDropDown.period.getSelected();if(f&&f.zeroBiller){$("#zeroBiller").val(f.zeroBiller)}else{$("#zeroBiller").val("false")}}var d=new Amex.MenuItem("");d.update($("#qbCustomPeriod").show());d.css({padding:"0px"});d._selectable=true;QBDropDown.period.getMenu().addItem(d);
$("#qbCustomPeriod").click(function(h){h.stopPropagation()});d._focus=$("#"+QBDropDown.fromField);d._hover=false;$("#"+QBDropDown.fromField).focus(CustomPeriod.focus);$("#"+QBDropDown.toField).focus(CustomPeriod.focus);$("#"+QBDropDown.fromField).blur(QBDropDown.blur);$("#"+QBDropDown.toField).blur(QBDropDown.blur);$("#"+QBDropDown.fromField).keydown(function(h){if(h.which===Amex.KEY_TAB){if(h.shiftKey){$("#"+QBDropDown.go).focus()}else{$("#"+QBDropDown.toField).focus()}}else{h.stopPropagation()}});
$("#"+QBDropDown.toField).keydown(function(h){if(h.keyCode===Amex.KEY_TAB){if(h.shiftKey){$("#"+QBDropDown.fromField).focus()}else{$("#"+QBDropDown.go).focus()}}else{h.stopPropagation()}});$("#"+QBDropDown.go).keydown(function(h){if(h.keyCode===Amex.KEY_TAB){if(h.shiftKey){$("#"+QBDropDown.toField).focus()}else{$("#"+QBDropDown.fromField).focus()}}else{h.stopPropagation()}});$("#"+QBDropDown.fromField).datepicker({showOn:"button",buttonImage:"./images/icon_dropcalendar.png",buttonImageOnly:true,buttonText:"Open calendar for Start Date",showButtonPanel:true,showOtherMonths:true,selectOtherMonths:true,minDate:CustomPeriod.minDate,maxDate:CustomPeriod.maxDate,changeMonth:true,changeYear:true,defaultDate:null,beforeShow:function(){QBDropDown.period.options.menu.closeSubmenus();
var h=Date.parseString($("#"+QBDropDown.fromField).val(),"M/d/y");if(h){$("#"+QBDropDown.fromField).val(h.format("MM/dd/yyyy"))}else{$("#"+QBDropDown.fromField).val((new Date()).format("MM/dd/yyyy"))}}});$("#"+QBDropDown.fromField).datepicker("widget").click(function(h){h.stopPropagation()});$("#"+QBDropDow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment