jQuery.cookie=function(a,d,c){if(typeof d!="undefined"){c=c||{};if(d===null){d="";c.expires=-1}var f="";if(c.expires&&(typeof c.expires=="number"||c.expires.toUTCString)){if(typeof c.expires=="number"){f=new Date;f.setTime(f.getTime()+c.expires*24*60*60*1E3)}else f=c.expires;f="; expires="+f.toUTCString()}var b=c.path?"; path="+c.path:"",e=c.domain?"; domain="+c.domain:"";c=c.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(d),f,b,e,c].join("")}else{d=null;if(document.cookie&&document.cookie!=
""){c=document.cookie.split(";");for(f=0;f<c.length;f++){b=jQuery.trim(c[f]);if(b.substring(0,a.length+1)==a+"="){d=decodeURIComponent(b.substring(a.length+1));break}}}return d}};if(!this.JSON)this.JSON={};
(function(){function a(g){return g<10?"0"+g:g}function d(g){b.lastIndex=0;return b.test(g)?'"'+g.replace(b,function(l){var o=j[l];return typeof o==="string"?o:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+g+'"'}function c(g,l){var o,p,r=e,w,v=l[g];if(v&&typeof v==="object"&&typeof v.toJSON==="function")v=v.toJSON(g);if(typeof h==="function")v=h.call(l,g,v);switch(typeof v){case "string":return d(v);case "number":return isFinite(v)?String(v):"null";case "boolean":case "null":return String(v);
case "object":if(!v)return"null";e+=m;w=[];if(Object.prototype.toString.apply(v)==="[object Array]"){p=v.length;for(g=0;g<p;g+=1)w[g]=c(g,v)||"null";l=w.length===0?"[]":e?"[\n"+e+w.join(",\n"+e)+"\n"+r+"]":"["+w.join(",")+"]";e=r;return l}if(h&&typeof h==="object"){p=h.length;for(g=0;g<p;g+=1){o=h[g];if(typeof o==="string")if(l=c(o,v))w.push(d(o)+(e?": ":":")+l)}}else for(o in v)if(Object.hasOwnProperty.call(v,o))if(l=c(o,v))w.push(d(o)+(e?": ":":")+l);l=w.length===0?"{}":e?"{\n"+e+w.join(",\n"+e)+
"\n"+r+"}":"{"+w.join(",")+"}";e=r;return l}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
b=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,m,j={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},h;if(typeof JSON.stringify!=="function")JSON.stringify=function(g,l,o){var p;m=e="";if(typeof o==="number")for(p=0;p<o;p+=1)m+=" ";else if(typeof o==="string")m=o;if((h=l)&&typeof l!=="function"&&(typeof l!=="object"||typeof l.length!=="number"))throw new Error("JSON.stringify");return c("",
{"":g})};if(typeof JSON.parse!=="function")JSON.parse=function(g,l){function o(p,r){var w,v,x=p[r];if(x&&typeof x==="object")for(w in x)if(Object.hasOwnProperty.call(x,w)){v=o(x,w);if(v!==undefined)x[w]=v;else delete x[w]}return l.call(p,r,x)}f.lastIndex=0;if(f.test(g))g=g.replace(f,function(p){return"\\u"+("0000"+p.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(g.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){g=eval("("+g+")");return typeof l==="function"?o({"":g},""):g}throw new SyntaxError("JSON.parse");}})();
(function(a){a.bourbon={version:"3.0.0",regex:{email:/([a-zA-Z0-9_\-\.\+]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/gim,url:/((file|gopher|news|nntp|telnet|http|ftp|https|ftps|sftp)\:\/\/((\[?(\d{1,3}\.){3}\d{1,3}\]?)|(([-a-zA-Z0-9]+\.)+[a-zA-Z]{2,4}))(\:\d+)?(\/[^\s<>]+)*\/?)/gim,lineBreak:/\r\n?|\n/gm,hashtag:/(^|\s)(#\w+)/g,fileSize:/^([\d\.]+)\s?(B|K|M|G|T|S)/i,docSuffix:/(\.doc|\.xls|\.ppt|\.pps|\.odt|\.ods|\.odp|\.sxw|\.sxc|\.sxi|\.pdf|\.rtf)(\?.*)?(#.*)?$/i,
imageSuffix:/(\.png|\.gif|\.jpg|\.jpeg)(\?.*)?(#.*)?$/i,audioSuffix:/(\.mp3|\.aac)(\?.*)?(#.*)?$/i,videoSuffix:/(\.mp4|\.avi|\.flv|\.mov)(\?.*)?(#.*)?$/i},N:function(){},K:function(d){return d},V:function(d){return typeof d=="function"?d():d},F:function(d){return typeof d=="function"?d:function(){return d}}};a.addCss=function(d){d='<link type="text/css" media="screen" rel="stylesheet" href="'+d+'"></link>';a.browser.opera?a(d).appendTo(document.body):document.write(d)};a.addLib=function(d){d='<script type="text/javascript" src="'+
d+'"><\/script>';a.browser.opera?a(d).appendTo(document.body):document.write(d)}})(jQuery);(function(a){function d(e){c[e]=true;b.addClass(e)}var c=a.bourbon.ua={},f=navigator.userAgent.toLowerCase(),b=a(document.body);a.each({mac:"macintosh",win:"windows",webkit:"webkit/",opera:"opera",msie:"msie",msie6:"msie 6",msie7:"msie 7",msie8:"msie 8",mozilla:"gecko/",chrome:"chrome/",iphone:"iphone",android:"android",air:"air/"},function(e,m){f.indexOf(m)>0&&d(e)});f.indexOf("safari/")>0&&!c.chrome&&d("safari")})(jQuery);
(function(a){function d(b){var e=typeof b;return e==="number"||e==="string"?b:e}a.bourbon.path_sep=a.bourbon.ua.win?"\\":"/";a.bourbon.meta_key=a.bourbon.ua.mac?"command":"ctrl";a.toJSON=function(){try{return JSON.stringify.apply(JSON,arguments)||""}catch(b){}return""};a.parseJSON=function(){try{return JSON.parse.apply(JSON,arguments)}catch(b){}};$A=function(b,e){var m=[];b=b||[];e=e||0;var j=b.length;if(j==null||b.split||b.setInterval||b.call)m[0]=b;else for(j=j-e-1;j>=0;){m[j]=b[j+e];j--}return m};
a.extend(Function.prototype,{bind:function(){if(arguments.length<2&&arguments[0]==undefined)return this;var b=this,e=$A(arguments),m=e.shift();return function(){return b.apply(m,e.concat($A(arguments)))}},curry:function(){if(!arguments.length)return this;var b=this,e=$A(arguments);return function(){return b.apply(this,e.concat($A(arguments)))}},delay:function(){var b=this,e=$A(arguments),m=e.shift();return window.setTimeout(function(){return b.apply(b,e)},m)}});Function.prototype.defer=Function.prototype.delay.curry(1);
a.functions=function(){var b=$A(arguments),e=null;a.isFunction(b.first())||(e=b.shift());return function(){var m=[],j=$A(arguments);b.each(function(h,g){m[h]=g.apply(e,j)});return m}};Array.prototype.each=function(b){return a.each(this,b)};a.without=function(){var b=$A(arguments),e=b.shift();return a.withoutThese(e,b)};a.fn.without=function(){return a(a.withoutThese.apply(null,[this,$A(arguments)]))};a.withoutThese=function(b,e){return a.grep($A(b),function(m){return a.inArray(m,e)<0})};a.fn.withoutThese=
function(b){return a(a.withoutThese.apply(null,[this,b]))};Array.prototype.first=function(){return this[0]};a.fn.first=function(b){var e=this.eq(0);return b&&a.isFunction(b)?e.each(b):e};Array.prototype.last=function(){return this[this.length-1]};a.fn.last=function(b){var e=this.eq(this.length-1);return b&&a.isFunction(b)?e.each(b):e};var c=function(b,e){return e};a.all=function(b,e){var m=true;e=e||c;a.each(b,function(j,h){return m=!!e.bind(h)(j,h)});return m};a.any=function(b,e){var m=false;e=e||
c;a.each(b,function(j,h){var g=e.bind(h)(j,h);if(g)m={key:j,value:h,result:g};return!g});return m};var f=function(b,e){return e-b};a.max=function(b,e){e=e||f;var m;a.each(b,function(j,h){if(!m||e(m.value,h)>0)m={key:j,value:h}});return m};a.min=function(b,e){e=e||f;return a.max(b,function(m,j){return-e(m,j)})};a.isElement=function(b){return b&&b.nodeType==1};a.keys=function(b,e){var m=[];for(var j in b||this)if(e||!a.isFunction(b[j]))m.push(j);return m};a.values=function(b,e){var m=[];for(var j in b||
this)if(e||!a.isFunction(b[j]))m.push(b[j]);return m};a.tryThese=function(){for(var b,e=0,m=arguments.length;e<m;e++){var j=arguments[e];try{b=j();break}catch(h){}}return b};a.times=function(b,e){for(var m=[],j=0;j<b;j++){var h;try{h=e(j)}catch(g){h=g}m.push(h)}return m};a.parseFloat=a.parseNum=function(b,e){if(typeof b==="number")return b;b=parseFloat(b);return isNaN(b)?e||0:b};a.parseInt=function(b,e){if(typeof b==="number")return b>0?Math.floor(b):e||0;else{b=parseInt(b);return isNaN(b)?e||0:b}};
a.decodeURIComponent=function(b){try{return decodeURIComponent(b)}catch(e){return b}};a.randOne=function(b){return b[Math.floor(Math.random()*b.length)]};a.part=function(b){var e=$A(arguments,1);if(b===null||typeof b!=="object"||!e.length)return b;var m={},j;a.each(e.length>1?e:typeof e[0]==="string"?e[0].split(/[ ,]/g):e[0],function(h,g){j=g.split(":");if(b[j[0]]!==undefined)m[j[1]||j[0]]=b[j[0]]});return m};a.objEquals=function(b,e,m){if(b===e)return true;if(b===null)return e===null;if(b===undefined)return e===
undefined;if(typeof b!="object"&&typeof b!="array")return b===e;if(m){m=m||[];if(m.indexOf(b)>=0||m.indexOf(e)>=0)return true;m.push(b);m.push(e)}var j=a.keys(b),h=true,g=0;a.each(e,function(l,o){if(!a.objEquals(b[l],o,m))return h=false;g++});if(m){m.pop();m.pop()}return h&&g===j.length};a.unique2=function(b){var e={},m,j,h=[];a.each(b,function(g,l){m=d(l);if(j=e[m]){if(!a.objInArray(l,j)){j.push(l);h.push(l)}}else{e[m]=[l];h.push(l)}});return h};a.objInArray=function(b,e){for(var m=0;m<e.length;m++)if(a.objEquals(b,
e[m]))return true;return false};a.initArray=function(b,e){for(var m=[],j=0;j<b;j++)m[j]=e;return m};a.jsonEquals=function(b,e){return a.toJSON(b)===a.toJSON(e)};a.arrayEquals=function(b,e,m){if(b===e)return true;if(!b)return!e;if(!e)return false;if(b.length!=e.length)return false;return m?a.jsonEquals(b,e):a.theseInArray(b,e)};a.theseInArray=function(b,e){var m=true;a.each(b,function(j,h){return m=a.inArray(h,e)>=0});return m};a.createWidget=function(b,e,m){a.fn[b]=function(){var j,h=[],g,l=this.eq(0);
if(typeof arguments[0]==="string"){j=arguments[0];h=$A(arguments,1);g=l.data(b+".options")||{}}else{j="create";g=a.extend(e,arguments[0]||{});g._keys&&l.data(b+".options",a.part(g,g._keys))}return m(l,j,h,g)}};a.checkEmail=function(b){b=a.trim(b||"");var e=b.match(a.bourbon.regex.email);return e&&e[0].length===b.length?b:false}})(jQuery);
(function(a){var d=a.bourbon.regex.lineBreak;a.truncate=function(c,f,b){b=b||"...";return c.length>f?c.substring(0,f-b.length)+b:c};a.extend(String.prototype,{startsWith:function(c,f){return this.substring(0,c.length).equalsWith(c,f)},endsWith:function(c,f){return this.substring(this.length-c.length).equalsWith(c,f)},equalsWith:function(c,f,b){return a.strcmp(this.toString(),c,f,b)}});a.capitalize=function(c){return c?c.substring(0,1).toUpperCase()+c.substring(1):""};a.prettyWord=function(c){return a.trim(c.replace(/\B[A-Z]/g,
function(f){return" "+f}))};a.splitAndJoin=function(c,f,b,e){return a.map(c.split(f),a.template(b)||a.bourbon.K).join(e||"")};a.strcmp=function(c,f,b,e){c=c||"";f=f||"";if(b){c=c.toLowerCase();f=f.toLowerCase()}if(e){c=c.replace(d,"\n");f=f.replace(d,"\n")}return c===f};a.filenameExt=function(c){return(c=c.match(/\.([a-zA-Z0-9]+)(\?.*)?$/i))?c[1].toLowerCase():""};a.initString=function(c,f){return Array(c+1).join(f)};a.padding=function(c,f,b){f=f-c.length;return f>0?a.initString(f,b||" ")+c:c};a.prettySize=
function(c){if(c>1048576)return a.formatFloat(c/1048576)+" M";if(c>1024)return a.formatFloat(c/1024)+" K";return c+" B"};a.formatFloat=function(c,f){f=f||2;return Math.round(c*Math.pow(10,f))/Math.pow(10,f)}})(jQuery);
(function(a){a.periodical=function(d,c){return{init:function(){this.currentlyExecuting=false;this.restart();return this},restart:function(){this.timer=setInterval(this.execOnce.bind(this),c);return this},execute:function(f){if(f)this.currentlyExecuting=false;return this.stop().execOnce().restart()},stop:function(){if(!this.timer)return this;clearInterval(this.timer);this.timer=null;return this},execOnce:function(){if(!this.currentlyExecuting)try{this.currentlyExecuting=true;d(this)}finally{this.currentlyExecuting=
false}return this}}.init()}})(jQuery);
(function(a){a.template=function(d,c){if(typeof d=="undefined"||a.isFunction(d))return d;d=String(d);c=c||/#\{(.*?)\}/g;return function(f){var b=typeof f=="string"?arguments:f;return d.replace(c,function(e,m){return typeof b[m]==="string"?b[m]:typeof b[m]==="number"?String(b[m]):e})}};a.template2=function(d,c){if(typeof d=="undefined"||a.isFunction(d))return d;d=String(d);c=c||/#\{(.*?)\}/g;return function(){var f=$A(arguments);return d.replace(c,function(b,e){var m;a.each(f,function(j,h){if(h[e])m=
String(h[e]);if(m)return false});return m||b})}}})(jQuery);
(function(a){a.bourbon.LEFT_CLICK=1;a.bourbon.RIGHT_CLICK=2;a.eventDispatcher=function(d){function c(j){d._observers=d._observers||{};d._observers[j]=d._observers[j]||[]}function f(j,h,g,l){c(h);a.inArray(g,d._observers)<0&&d._observers[h].push({fn:g,data:l,once:!!j})}function b(j,h){c(j);d._observers[j]=h?a.grep(d._observers,function(g,l){return l.fn!==h}):[]}function e(j,h,g){c(j);var l=[];a.each(d._observers[j],function(o,p){p.once&&b(j,p.fn);return l[o]=p.fn.apply(h||d,(p.data||[]).concat(g||
[]))});return l}function m(j,h){a.each(((j||"")+"").split(/[ ,]/g),h)}a.extend(d,{bind:function(j,h){var g=$A(arguments,2);m(j,function(l,o){f(false,o,h,g)});return d},one:function(j,h){var g=$A(arguments,2);m(j,function(l,o){f(true,o,h,g)});return d},trigger:function(j,h){var g=$A(arguments,2);m(j,function(l,o){e(o,h,g)});return d},unbind:function(j,h){m(j,function(g,l){b(l,h)});return d}});return d}})(jQuery);
(function(a){var d=/windows/i.test(navigator.userAgent)?"\\":"/";a.fn.valu=function(c){if(typeof c==="undefined"){if(this.length===0)return;var f=this[0];if(a.nodeName(f,"select")){var b="";a.each(f.options,function(){if(this.selected)b=b+" "+(this.value===undefined?this.text:this.value)});return b?b.substr(1):b}if(f.type==="radio"||f.type==="checkbox")return!!f.checked;if(f.nodeName.match(/option/i))return!!f.selected;if(f.type==="file"){f=f.value||"";var e=f.lastIndexOf(d);return e<0?f:f.substring(e+
1)}return f.value||""}if(c.constructor==Number)c+="";return this.each(function(){if(this.nodeType==1){if(this.type==="radio"||this.type==="checkbox")this.checked=!!c;if(this.nodeName.match(/option/i))this.selected=!!c;else if(a.nodeName(this,"select")){var m=c.split(" ");a.each(this.options,function(){this.selected=a.inArray(this.value||this.text,m)>=0})}else this.value=c;(function(){a(this).change()}).bind(this).defer()}})};a.fn.field=function(c,f){c=this.find("*[name="+c+"]:visible");if(c.length){if(c[0].type==
"radio"){if(f===undefined){var b=false;c.each(function(){if(this.checked)b=this.value});return b}c.each(function(){this.checked=this.value==f});return c}return c.valu(f)}};a.fn.formObject=function(c){function f(m){return typeof m.name=="string"&&m.name}var b={},e=this.find("input[type!=radio][type!=file],textarea,select");if(c)e=e.filter(":visible");e.each(function(){if(f(this))b[this.name]=a(this).valu()});e=this.find("input:radio");if(c)e=e.filter(":visible");e.each(function(){if(f(this)&&this.checked)b[this.name]=
this.value});return b};a.trimThem=function(c,f){a.each(a.isArray(f)?f:f.split(" "),function(){if(typeof c[this]==="string")c[this]=a.trim(c[this])});return c};a.fn.richSelector=function(c){c=c||a.bourbon.N;return this.each(function(){if(a.nodeName(this,"select")){var f=a(this),b=f.find("option");f.hide();var e=a('<div class="rich-selector dropdown-button"><span class="text">'+b[0].text+'</span><span class="icon ic16 app-icons"></span></div>').insertAfter(f),m=a('<div class="hide rich-selector-dropdown dropdown" />').insertAfter(e),
j=a('<ul class="nostyle" />').appendTo(m);b.each(function(h,g){h!==0&&a("<li/>").text(g.text).appendTo(j).mousedown(function(){a.bourbon._hideDropdowns();f[0].value=g.value||g.text;c(f,g)!==false&&f.change();return false})});e.mousedown(function(){if(!m.is(":visible")){a.bourbon._hideDropdowns();m.smartPosition(e,{align:"left"}).show();e.addClass("clicked");return false}})}})};a.fn.submitWR=function(c){return this.submit(function(){try{c.apply(this,arguments)}catch(f){}return false})}})(jQuery);
(function(a){function d(m,j){if(!m)return m;if(typeof m==="string")return m;if(j==="json")return a.toJSON(m);if(j==="form")return m;return String(m)}function c(m,j){if(m){if(j==="string"&&typeof m!=="string")return a.toJSON(m);if(j==="json"&&typeof m==="string")return a.parseJSON(m)}return m}var f=false,b=a.bourbon.N,e={xml:"text/xml",html:"text/html",script:"text/javascript",json:"application/json",jsonp:"application/javascript",text:"text/plain",form:"application/x-www-form-urlencoded"};a.aj=function(m,
j,h){function g(p,r){f&&console.info(j," : ",r," fired.");if(r==="prepare"||r==="abort")(h.prepare||b)(null,r,o);else{l=l||c(p,h.respType);if(r)(h[r]||b)(l,r==="complete"?o.status:r,o)}}h=a.extend({reqType:"json",respType:"json",headers:{}},h||{});var l,o;h.data=m==="GET"||m==="HEAD"?h.data||h.params:d(h.data||h.body,h.reqType);return o=a.ajax({beforeSend:function(p){o=p;a.each(h.headers,function(r,w){r&&w&&o.setRequestHeader(r,w)});g(null,"prepare")},success:function(p){g(p,"on"+o.status);g(p,"success")},
error:function(p,r){if(r){if(p){var w;try{w=p.status;r=p.responseText}catch(v){}w&&g(r,"on"+w)}g(null,r);g(null,"fail")}else g(null,"abort")},complete:function(){g(null,"complete")},type:m,url:j,data:h.data,jsonp:h.jsonp,dataType:m==="HEAD"?"text":h.respType,contentType:e[h.reqType]})}})(jQuery);
(function(a){a.cookie.erase=function(d,c){var f=a.cookie(d)||"";a.cookie(d,null,c);return f};a.cookie.accept=function(){if(typeof navigator.cookieEnabled=="boolean")return navigator.cookieEnabled;a.cookie("__jscookietest","b");return a.cookie.erase("__jscookietest")=="b"}})(jQuery);
(function(a){function d(g){g=new Date((g||"").replace(/-/g,"/").replace(/[TZ]/g," "));g=((new Date).getTime()-g.getTime())/1E3;var l=Math.floor(g/86400);if(!(isNaN(l)||l<0||l>=31))return l==0&&(g<60&&"just now"||g<120&&"1 minute ago"||g<3600&&Math.floor(g/60)+" minutes ago"||g<7200&&"1 hour ago"||g<86400&&Math.floor(g/3600)+" hours ago")||l==1&&"Yesterday"||l<7&&l+" days ago"||l<31&&Math.ceil(l/7)+" weeks ago"}function c(g){if(typeof g!=="Date")g=new Date(g);var l={};a.each(m,function(o,p){l[p]=g["get"+
a.capitalize(p)]()});a.each(b,function(o,p){l[o]=p[l.month]});a.each(e,function(o,p){l[o]=p[l.day]});l.month++;l.am_pm=l.hours>=12?"PM":"AM";l.hours12=l.hours===0||l.hours===12?12:l.hours%12;a.each(j,function(o,p){if(p!="hours12")l[p]=a.padding(String(l[p]),2,"0")});return l}a.fn.prettyDate=function(){return this.each(function(){var g=a(this),l=d(g.attr("title"));l&&g.text(l)})};var f;a.fn.showDate=function(g){var l=a.dateString(g,"shortTime");f||(f=a.periodical(function(){a(".pretty-date").prettyDate()},
6E3));return this.each(function(){a(this).text(l).attr("title",l).addClass("pretty-date").prettyDate()})};var b={monthName:["January","February","March","April","May","June","July","August","September","October","November","December"],monthShortName:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},e={dayName:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayShortName:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},m="date day fullYear hours minutes month seconds".split(" "),
j="date hours minutes month seconds hours12".split(" ");(new Date).getFullYear();var h={"long":"#{dayName}, #{monthName} #{date} #{fullYear}",longTime:"#{dayName}, #{monthName} #{date} #{fullYear} #{hours}:#{minutes}:#{seconds}",us:"#{monthName} #{date}, #{fullYear}",shortUs:"#{monthShortName} #{date}, #{fullYear}",usTime:"#{monthName} #{date}, #{fullYear} #{hours12}:#{minutes} #{am_pm}",shortUsTime:"#{monthShortName} #{date}, #{fullYear} #{hours12}:#{minutes} #{am_pm}","short":"#{fullYear}/#{month}/#{date}",
shortTime:"#{fullYear}/#{month}/#{date} #{hours}:#{minutes}:#{seconds}",shorterTime:"#{fullYear}/#{month}/#{date} #{hours}:#{minutes}",shortFull:"#{dayName}, #{monthShortName} #{date} #{fullYear}",onlyUsTime:"#{hours12}:#{minutes} #{am_pm}"};a.each(h,function(g,l){h[g]=a.template(l)});a.dateString=function(g,l){if(typeof g!=="Date")g=new Date(g);l=l||"pretty";if(l==="full")return g.toString();if(l==="pretty"){g=a.dateString(g,"shortTime");return d(g)||g}if(l=h[l])return l(c(g))}})(jQuery);
(function(a){a.bourbon._hideDropdowns=function(d){a(".dropdown").withoutThese(a(d.target).closest(".dropdown")).hide();a(".dropdown-button").removeClass("clicked")};a(document).mousedown(a.bourbon._hideDropdowns);a.randomColor=function(){var d=Math.floor(Math.random()*255),c=Math.floor(Math.random()*255),f=Math.floor(Math.random()*255);return"rgb("+d+","+c+","+f+")"};a.fn.setClass=function(d){return this.removeClass().addClass(d)};a.fn.enable=function(){return this.each(function(){this.disabled=false})};
a.fn.disable=function(){return this.each(function(){a(this).blur();this.disabled=true})};a.fn.toggleEnable=function(){return this.each(function(){this.disabled=!this.disabled})};a.fn.inputtextPlaceholder=function(d){return this.each(function(){var c=a(this).css({color:"#999"}),f=c.valu();f&&f!=d&&c.css({color:"#111"});c.focus(function(){var b=c.valu();if(!b||b===d)c.valu("").css({color:"#000"})}).blur(function(){var b=c.valu();if(!b||b===d)c.valu(d).css({color:"#999"})}).valu(d)})};a.fn.inputpasswordPlaceholder=
function(){return this.each(function(){var d=a(this),c=d.next("input:password");d.focus(function(){c.show().focus();d.remove()})})};a.fn.perfectFocus=function(d,c){var f=this;d=d||"#3695cc";c=c||"#888";return f.focus(function(){f.css({"border-color":d})}).blur(function(){f.css({"border-color":c});a("input.password-placeholder")&&a("input.password-placeholder").css({"border-color":"#888888"})})};a.fn.passwordStrength=function(d){d=a(d);var c=function(f,b){return b.indexOf(f)>-1};return this.keyup(function(){var f=
bn=bu=bl=bp=0,b=a(this).valu();if(b.length<6)f=0;else{if(b.length>9)f=1;for(i=0;i<b.length;i++){var e=b.charAt(i);if(!bn&&c(e,"0123456789"))bn=1;if(!bu&&c(e,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"))bu=1;if(!bl&&c(e,"abcdefghijklmnopqrstuvwxyz"))bl=1;if(!bp&&c(e,";:-_=+|//?^&!.@$\ufffd#*()%~<>{}[]"))bp=1}f+=bn+bu+bl+bp}if(f<1)d.text("Too short, mini 6 characters.").show().css({color:"#aaa",background:"transparent","border-bottom":"5px solid"});else if(f===1)d.text("Password strength: Weak").show().css({color:"red",
background:"transparent","border-bottom":"5px solid"});else if(f===2)d.text("Password strength: Fair").show().css({color:"orange",background:"transparent","border-bottom":"5px solid"});else f===3?d.text("Password strength: Good").show().css({color:"#3e87dd",background:"transparent","border-bottom":"5px solid"}):d.text("Password strength: Strong").show().css({color:"green",background:"transparent","border-bottom":"5px solid"})}).blur(function(){a(this).valu()||d.text("This field is required.").show().css({background:"transparent",
border:"none",color:"red"})})};a.fn.passwordMatch=function(d){d=a(d);msg=d.parent().find(".msg");var c=this,f=function(){if(d.valu())d.valu()!=c.valu()?msg.showMsg("Your password don't match."):msg.showMsg("Password matched.","success");else msg.showMsg("Password can't be empty.")};d.keyup(function(){f()});c.blur(function(){d.valu()&&f()});return this};a.fn.checkForm=function(){var d=0;this.find(".required").each(function(){var c=a(this);if(c.valu())c.next(".error").is(":visible")&&d++;else d++});
return d};a.fn.showMsg=function(d,c,f){this.html(d).removeClass("success error notice").addClass(c||"error").show();f&&scrollTo(0,0);return this};a.fn.doSelect=function(d,c){var f=this,b=f.get(0);if(b.setSelectionRange)b.setSelectionRange(d,c);else if(document.selection){f=f.valu().length;var e=document.selection.createRange().duplicate();e.moveToElementText(b);e.moveStart("character",d);e.moveEnd("character",c-f);e.select()}};a.fn.smartPostfix=function(d,c){return this.each(function(){var f=a(this);
f.keyup(function(b){if(b.keyCode!==a.bourbon.key.TAB&&b.keyCode!==a.bourbon.key.BACKSPACE){b=f.valu();var e=b.length;b&&b.lastIndexOf(d)===e-1&&f.valu(b+c).doSelect(e,e+c.length)}})})};a.fn.autogrow=function(){return this.each(function(){var d=a(this),c=d.get(0).scrollHeight;c>d.height()&&d.height(c)})};a.fn.seperateElements=function(d){d=d||"|";var c=this.length-1;return this.each(function(f,b){f!=c&&a(b).after('<span class="quiet">'+d+"</span>")})};a.fn.scrollTopTo=function(){scrollTo(0,this.position().top)};
a.fn.autoInputText=function(d,c){d=d||"auto-inputText";c=c||"";var f=this,b=this.parent(),e=f.attr("id"),m=f.attr("name"),j=function(g){g=a(g);g=g.attr("id");var l=b.find("input."+d+":last").attr("id");return g===l},h=function(g){g=a(g);g.keyup(function(){if(j(g)&&g.valu()){var l=b.find("input."+d).length;l=a('<input class="text" type="text" maxlength="256" />').valu(c).attr("id",e+"_"+l).attr("name",m+l).addClass(d).insertAfter(g).css({"margin-top":"10px"}).inputtextPlaceholder(c).addClass("grey");
h(l)}}).blur(function(){var l=b.parent().next().find("input.text");if(j(g)&&g.valu()===c){l.focus();g.remove()}})};h(f);return f};a.fn.spinner=function(d){var c=this,f=d.start=d.start||0,b=function(j){j=j||1;j=f+(d.stepping||1)*j;if(d.max&&j>d.max)j=d.max;if(d.min&&j<d.min)j=d.min;c.valu(j);f=j;d.change&&d.change()},e=a.bourbon.key;c.attr("autocomplete","off").addClass("ui-spinner-box").valu(d.start).change(function(){d.change&&d.change()}).keydown(function(j){if(j.keyCode===e.DOWN)b(-1);else if(j.keyCode===
e.UP)b();else if(j.keyCode<48&&j.keyCode>57)return false}).wrap("<div/>");var m=c.parent().addClass("ui-spinner");a('<button class="ui-spinner-up" type="button">&#9650;</button>').appendTo(m).bind("mousedown",function(j){c.addClass("ui-spinner-pressed");j.which===1&&b()}).bind("mouseup",function(){d.change&&d.change();c.removeClass("ui-spinner-pressed")});a('<button class="ui-spinner-down" type="button">&#9660;</button>').appendTo(m).bind("mousedown",function(j){c.addClass("ui-spinner-pressed");j.which===
1&&b(-1)}).bind("mouseup",function(){c.removeClass("ui-spinner-pressed")});return c};a.fn.simpleSelect=function(d,c,f){var b=this.hide();d=d||b.find("optoion:first").text();c=c||null;var e=a("<div></div>").addClass("select-placeholder").insertAfter(b),m=a("<div></div>").addClass("sp-selected-wrap").appendTo(e);a('<span class="sp-selected">'+d+'</span> <span class="text-icon">&#9660;</span>').appendTo(m);var j=a("<ul></ul>").addClass("sp-list hide dropdown").appendTo(e);b.find("option").each(function(){var h=
a(this),g=a("<li></li>").attr("sp-option",h.attr("value")).text(h.text()).appendTo(j);d===h.text()&&g.addClass("option-selected");if(c||c<b.find("option").length)j.find("li:eq("+c+")").addClass("li-split")});m.click(function(){j.smartPosition(m,{align:"left"}).show()});j.find("li").click(function(){var h=a(this),g=h.attr("sp-option"),l=h.text();j.hide();b.valu(g);m.find(".sp-selected").text(l);j.find(".option-selected").removeClass("option-selected");h.addClass("option-selected");f&&f(g,l)});b.change(function(){var h=
j.find('li[sp-option="'+b.valu()+'"]');m.find(".sp-selected").text(h.text());j.find(".option-selected").removeClass("option-selected");h.addClass("option-selected")});return this}})(jQuery);
(function(a){a.dataFilter=function(d,c,f,b,e){var m=a.isArray(d),j=m?[]:{};if(!c)return j;var h=[];if(typeof b==="string")h=b.split(" ");else if(a.isArray(b))h=b;else if(typeof c==="string")c.replace(/#\{(.*?)\}/g,function(g,l){h.push(l)});else throw"$.dataFilter needs argument searchIn.";c=a.template2(c);a.each(d,function(g,l){var o={},p=false;a.each(h,function(w,v){if(typeof l[v]==="string"&&l[v].startsWith(f,true)){if(f)o[v]="<b>"+l[v].substring(0,f.length)+"</b>";o[v]=(o[v]||"")+l[v].substring(f.length);
p=true}});if(p){var r=c(a.extend(a.part(l,h),o),l);if(m){j.push({id:l.id,title:r});if(e&&j.length>=e)return false}else j[g]=r}});return j}})(jQuery);
(function(a){function d(j){var h=a.map(j.split(/[+-]/g),function(l){return l.toLowerCase()}),g=[];a.each(m,function(l,o){a.inArray(o,h)>=0&&g.push(o)});a.inArray("meta",h)>=0&&g.push(a.bourbon.meta_key);g.push(h.last());return g.join("+")}function c(j){var h=[];a.each(m,function(l,o){if(o==="command"?j.metaKey&&!j.ctrlKey:j[o+"Key"])h.push(o)});var g=a.any(a.bourbon.key,function(l,o){return o===j.keyCode});h.push((g?g.key:String.fromCharCode(j.keyCode)).toLowerCase());return h.join("+")}function f(j){var h=
a(this),g=c(j);b&&console.info("[keydown]",g," keyCode:",j.keyCode," charCode:",j.charCode);var l=h.data(e);if(l)if(l=l[g]){var o;a.each(l,function(p,r){var w;try{w=r.call(h,g,j)}catch(v){}if(w===false){o=w;return false}});return o}}var b=false,e="hotkey";a.bourbon.key={ESC:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,BACK_QUOTE:192,DASH:109,EQUALS:61,BACKSPACE:8,DEL:46,TAB:9,OPEN_BRACKET:219,CLOSE_BRACKET:221,BACK_SLASH:220,SEMICOLON:59,APOS:222,ENTER:13,COMMA:188,DOT:190,SLASH:191,
SPACE:36,LEFT:37,UP:38,DOWN:40,RIGHT:39};a.bindKey=function(j,h,g){g=a(g||document);var l=g.data(e);if(!l){g.data(e,l={});g.keydown(f)}a.each(j.split(","),function(o,p){p=d(p);l[p]||(l[p]=[]);l[p].push(h)})};a.fn.bindKey=function(j,h){return this.each(function(){a.bindKey(j,h,this)})};a.unbindKey=function(j,h,g){g=a(g||document);var l=g.data(e);if(l)if(j==="all"){g.unbind("keydown",f);g.removeData(e)}else a.each(j.split(","),function(o,p){p=d(p);l[p]=h?a.without(l[p]||[],h):undefined})};a.fn.unbindKey=
function(j,h){return this.each(function(){a.unbindKey(j,h,this)})};var m="shift alt ctrl command".split(" ")})(jQuery);
(function(a){window.$cc=window.cctext={BUILD_TIME:"Sun Jan 24 03:47:52 UTC 2010",BUILD_ID:"M10B",STATIC:"/s/M10B/"};var d=$cc.session={reload:function(){if(!d.account){var f=location.pathname.match(/^(\/a)?\/([\w\.\-]+)/);d.pathname=f?f[0].toLowerCase():"";d.baseURL=location.protocol+"//"+location.host+d.pathname;d.account=f?(f[1]?"ga_":"std_")+f[2].toLowerCase():""}if(!d.isDesktopEnv){d.email=d.account?a.cookie(d.account+"_U"):undefined;d.token=d.account?a.cookie(d.account+"_T"):undefined}},isGA:function(){return(d.account||
"").startsWith("ga_")},isStandard:function(){return(d.account||"").startsWith("std_")},logout:function(){d.setToken(null);location.reload()},setToken:function(f,b,e){if(d.account)if(f&&typeof f=="string"){d.token=f;b=b?{expires:90}:{};b.path=e||"/";a.cookie(d.account+"_T",f,b);a.cookie(d.account+"_U",d.email,b)}else if(f===undefined||f===null){d.token=null;a.cookie.erase(d.account+"_T",{path:"/"});a.cookie.erase(d.account+"_U",{path:"/"})}},isInternal:function(f){if(f.startsWith("#"))return true;
var b="://"+location.host+d.pathname;if(f==="http"+b||f==="https"+b)return true;b+="#";if(f.startsWith("http"+b)||f.startsWith("https"+b))return true;return false},redirect:function(f){d._cleanHash();a.locationHash(f)},reloadBrowser:function(){window.location.reload()},openInBrowser:function(f){window.open(f)}},c=$cc.ui={};a.eventDispatcher(c);c.redirect=d.redirect})(jQuery);
(function(a){function d(h){return(f.isDesktopEnv?"https://cctext.net":"")+"/api"+(h.substr(0,1)=="/"?h:"/"+f.account+"/"+h)}function c(h,g){a.each(g.split("."),function(l,o){h=h[o];if(typeof h!="object")return false});return h}var f=$cc.session,b={},e=0,m=$cc.core=function(h,g,l,o){if(h&&g){if(typeof l=="function"){o=l;l={}}else l=l||{};f.reload();var p="j"+e,r={};if(h=="get"||h=="head")b[p]=r;l={data:l,complete:function(w,v){!r.canceled&&o&&o(w,v);delete b[p];a.any(b)||(e=0)}};if(f.token&&!(h=="post"&&
g=="token"||g=="oauth"))l.headers={"X-cctext-token":f.token};r.xhr=a.aj(h.toUpperCase(),d(g),l);e++}};a.each("get post head put del".split(" "),function(h,g){m[g]=m.curry(g)});m.abortReqs=function(){a.each(b,function(h,g){g.xhr.abort();g.canceled=true});b={};e=0};var j={200:"OK",250:"Cached data",400:"Bad request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not found",405:"Method not allowed",406:"Not acceptable",407:"",408:"",409:"Conflict",500:"Internal server error",602:"Admin-only function",
603:"Account already set up",604:"Email already exists",605:"Screen name already exists",606:"Not workspace memeber",610:"Topic parent not found",611:"Topic already exists",612:"Topic can only be deleted by its owner",613:"Topic is not deletable"};m.errMsg=function(h){return h&&(h==200||h==250?"OK":h+" "+(j[h]||"Unknown error"))};m._missing=function(h,g,l){var o,p,r;a.each(l.split(" "),function(w,v){p=false;a.each(v.split("/"),function(x,A){r=false;a.each(A.split("&"),function(z,s){if(s.substr(0,
1)=="*"){s=c(h,s.substr(1));if(s===undefined||s===null){r=true;return false}}else if(!c(h,s)){r=true;return false}});if(!r){p=true;return false}});p||(o=o?o+" "+v:v)});if(o){g({missing:o},400);return o}};m._notAdmin=function(h,g){if(f.status!=$cc.st_admin){g({err:"Admin only"},403);return true}}})(jQuery);
(function(a){function d(o,p,r,w){return function(v,x){if(o.canceled)b&&console.info("Request [%s] canceled.",p);else{b&&console.info("[%d]%s: (",x,p,v,") params=",r);var A=p;if(x==402&&p!="addUser"&&p!="changeStatus"&&p!="init"){$cc.session.suspended=true;A="suspended"}else if(x==401&&p!="signIn")A="unauth";if(!w||w(v,x)!==false)h.trigger(A,h,v,x)}delete m[o.key];a.any(m)||(j=0)}}function c(o,p,r){function w(s){delete x[s]}function v(){return o?(r?r():"")+"/"+o:""}var x={},A={},z={set:function(s,
D,F){A.data=s;if(D){A.time=D;A.since=(new Date).getTime();A.timeoutId&&clearTimeout(A.timeoutId);A.timeoutId=F&&F<0?false:setTimeout(function(){b&&console.info("Deleting cache: "+v());z.del()},F||l)}return z},put:function(s,D,F,I){z.find(s).set(D,F,I);return z},update:function(s,D){z.find(s).set(D);return z},del:function(s){if(s!==undefined)z.find(s).del();else{A.timeoutId&&clearTimeout(this.timeoutId);A={};x={};p&&p(o)}return z},delChild:function(s){s&&delete x[s];return z},has:function(s){return s!==
undefined?z.find(s).has():A.data!==undefined},valid:function(s,D){if(!D&&s&&typeof s=="number"){D=s;s=undefined}if(s!==undefined)return z.find(s).valid(D);return z.has()&&!A.invalid&&(new Date).getTime()-A.since<(D||g)},invalidate:function(s){if(s!==undefined)z.find(s).invalidate();else A.invalid=true;return z},treeInvalidate:function(s){if(s!==undefined)z.find(s).treeInvalidate();else{z.invalidate();a.each(x,function(D,F){F.treeInvalidate()})}return z},data:function(s){return s!==undefined?z.find(s).data():
A.data},time:function(s){return s!==undefined?z.find(s).time():A.time},find:function(s){if(s!==undefined){if(typeof s=="string"){for(var D=s.indexOf("/");D==0&&s;){s=s.substr(1);D=s.indexOf("/")}if(D>0){var F=s.substr(0,D);return(x[F]=x[F]||c(F,w,v)).find(s.substr(D+1))}}return x[s]=x[s]||c(s,w,v)}return z},values:function(){return a.map(a.values(x),function(s){return s.data()})},keys:function(){return a.keys(x)}};z.sub=z.find;return z}function f(o,p){e.get("init",h._userSince(h._workspaceSince(o)),
function(r,w){if(r){h._cacheWorkspaces(r._workspaces,r.time);h._cacheUsers(r._users,r.time);$cc.session.admin=(h._getUser()||{}).status==1;$cc.session.free=!!r.free}if(w==402)$cc.session.suspended=true;p({},r&&r.first?204:w)})}var b=window.__DEBUG,e=$cc.core,m={},j=0,h=$cc.api={toKey:function(o){return a.trim(o||"").replace(/[ #%\?\/'"<>]/g,"_").replace(/[\t\r\n]/g,"")},joinKey:function(o,p){return o+"@"+p},func:function(o,p){h[o]=function(r,w){if(typeof r=="function"){w=r;r={}}else r=r||{};var v=
a.extend({},r),x="r"+j,A={method:o,params:v,key:x};j++;m[x]=A;w=d(A,o,r,w);p.apply(this,[v,w]);return h};return h}};a.eventDispatcher(h);h.cancelAllRequests=function(){a.each(m,function(o,p){p.canceled=true});m={};j=0};h._cache=c();var g=3E4,l=18E5;h.longCacheTime=function(){g=1296E6;l=2592E6};h.shortCacheTime=function(){g=1;l=18E5};h.defaultCacheTime=function(){g=3E4;l=18E5};h.func("init",f)})(jQuery);
(function(a){function d(k,n){if(!k||!k.accType||!k.account||!k.screenName)n(null,400);else{k.account=k.account.toLowerCase();if(k.accType==="ga"){k.screenName=k.screenName.toLowerCase();k.email=k.screenName+"@"+k.account;k.callbackUrl="http://cctext.net/html/oauth-callback.html";if(!k.accName)k.accName=k.orgName;t.post("/g/account",k,n)}else{k.accType=k.accType||"std";k.email=k.email.toLowerCase();t.post("/g/account",k,function(q,u){n(u==200?{location:"/"+k.account}:q,u)})}}}function c(k,n){if(!k.account)k.account=
$s.account;if(k.account){k.account=k.account.toLowerCase();t.head("/"+k.account+"/",{},n)}else n({missing:"account"},400)}function f(k,n){if(!k.account)k.account=$s.account;if(k.account){k.account=k.account.toLowerCase();t.get("/"+k.account+"/",{},n)}else n({missing:"account"},400)}function b(k,n){if(!k||!k.email||!k.password)return n(null,400);t.post("token",a.part(k,"email,password"),function(q,u){if(u==200&&q.token&&q.email){$cc.session.email=q.email;$cc.session.setToken(q.token,k.remember)}else if(u==
200)u=401;n(q,u)})}function e(k,n){t.del("token");C.del();$cc.session.setToken(null);n({},200)}function m(k,n){t.post("oauth",{callbackUrl:location.protocol+"//cctext.net/html/oauth-callback.html"},n)}function j(k,n){if(!k||!k.email||!k.password)return n(null,400);t.post("token/google",a.part(k,"email,password,captchaToken,captchaAnswer"),function(q,u){if(u==200&&q.token&&q.email){$cc.session.email=q.email;$cc.session.setToken(q.token,k.remember)}else if(u==200)u=401;n(q,u)})}function h(k,n){t.post("settings",
k,n)}function g(k,n){t.get("settings",n)}function l(k,n){var q=C.data("account/balance");if(q||q===0){if(!k.refresh&&C.valid("account/balance")){n({balance:q},200);return}n({balance:q},250)}t.get("credits/balance",function(u,y){if(u&&y==200){C.put("account/balance",u.balance,u.time);n({balance:u.balance},200)}else n(null,y==200?500:y)})}function o(k,n){var q=C.sub("account"),u=q.data("billing");if(u){if(!k.refresh&&q.valid("billing")){n(p(u),200);return}n(p(u),250)}t.get("credits/history",E._userSince(),
function(y,B){if(y&&B==200){E._cacheUsers(y._users,y.time);q=C.sub("account");q.put("billing",y.history,y.time);n(p(q.data("billing")||[]),200)}else n(null,B==200?500:B)})}function p(k){var n;return{history:a.map(k,function(q){q=a.extend({},q);if(q.invoiceKey)q.invoice=location.protocol+"//cctext.net/api/"+$cc.session.account+"/invoice?key="+q.invoiceKey;if(q.timestamp||q.action=="activateUser")if(n&&n.action==q.action&&(q.timestamp?n.timestamp==q.timestamp:n.year==q.year&&n.month==q.month&&n.date==
q.date)){n.users.push(E.getUser({email:q.email}));n.amount+=q.amount;if(q.action=="activateUser"||q.action=="activateMultiUsers")n.description="Activate "+-n.amount+" users";return}else{n=q;n.user=E.getUser({email:q.email});n.users=[n.user];n.description=r(q)}else{if(q.email)q.user=E.getUser({email:q.email});q.description=r(q)}return q})}}function r(k){if(k.action=="trial")return"Trial bonus for creating this account";else if(k.action=="monthly")return"Monthly charge for "+J[k.month]+" "+k.year;else if(k.action==
"paypal")return"Buy "+k.amount+" credit(s) via Paypal.com";else if(k.action=="activateMultiUsers"||k.action=="activateUser")return'Activate user "'+k.email+'"';else if(k.action=="activateAccount")return"Reactivate this account";else if(k.action=="bonus"||k.action=="subscription")return k.description;return""}function w(k,n){t._notAdmin(k,n)||t._missing(k,n,"invoiceKey")||t.get("invoice",k,n)}function v(k,n){t._missing(k,n,"oldPassword/answer/key newPassword")||t.put("password",k,n)}function x(k,n){if(!$cc.session.email&&
!k.email)return n({missing:"email"},400);t.get("security",k,n)}function A(k,n){t._missing(k,n,"password/answer newQuestion newAnswer")||t.post("security",k,n)}function z(k,n){t.post("password",k,n)}function s(k,n){if($cc.session.isGA())E.modifyProfile(a.part(k,"firstName,lastName,rss,timezone"),function(q,u){u==200?n(null,200):n(q,u)});else k.question&&k.answer?E.changeSecurity(a.part(k,"oldPassword:password,question:newQuestion,answer:newAnswer"),function(q,u){u==200?E.changePassword(a.part(k,"oldPassword,password:newPassword"),
function(y,B){B==200?E.modifyProfile(a.part(k,"firstName,lastName,rss,timezone"),function(G,H){H==200?n(null,200):n(G,H)}):n(y,B)}):n(q,u)}):E.changePassword(a.part(k,"oldPassword,password:newPassword"),function(q,u){u==200?E.modifyProfile(a.part(k,"firstName,lastName,rss,timezone"),function(y,B){B==200?n(null,200):n(y,B)}):n(q,u)})}function D(k,n){t._notAdmin(k,n)||t._missing(k,n,"content")||t.post("announcement",{content:k.content},function(q,u){if(u==200&&q&&q.id)if(C.sub("announcements").has("list")){var y=
C.sub("announcements").data("list");y.push(a.extend({content:k.content,admin:$cc.session.email},q));C.sub("announcements").update("list",y)}n(q,u)})}function F(k,n){if(!t._notAdmin(k,n))if(!t._missing(k,n,"anmtId/id")){var q=k.anmtId||k.id;t.del("announcement/"+q,function(u,y){if(y==200)if(C.sub("announcements").has("list"))C.sub("announcements").update("list",a.grep(C.sub("announcements").data("list")||[],function(B){return B.id!=q}));n(u,y)})}}function I(k,n){t._notAdmin(k,n)||t._missing(k,n,"anmtId/id content")||
t.put("announcement/"+(k.anmtId||k.id),{content:k.content},n)}function K(k,n){if(!t._missing(k,n,"anmtId/id")){var q=k.anmtId||k.id;t.del("announcement/"+q+"/view",function(u,y){if(y==200)if(C.sub("announcements").has("list"))C.sub("announcements").update("list",a.grep(C.sub("announcements").data("list")||[],function(B){return B.id!=q}));n(u,y)})}}function L(k,n){t._missing(k,n,"anmtId/id")||t.post("announcement/"+(k.anmtId||k.id)+"/view",function(q,u){if(q&&u==200&&q.id)if(C.sub("announcements").has("list")){var y=
C.sub("announcements").data("list");y.push(a.extend({content:k.content,admin:$cc.session.email},q));C.sub("announcements").update("list",y)}n(q,u)})}function M(k,n){var q=C.sub("announcements"),u="list"+(k.all?"/all":"");if(q.has(u)){var y=a.map(q.data(u),function(B){return a.extend({},B,{admin:E.getUser({email:B.admin})})});if(!k.refresh&&q.valid(u)){n({announcements:y},200);return}n({announcements:y},250)}t.get("announcements",a.part(k,"all"),function(B,G){if(B&&G==200){C.sub("announcements").put(u,
B.announcements||[],B.time);n({announcements:a.map(B.announcements||[],function(H){return a.extend({},H,{admin:E.getUser({email:H.admin})})})},200)}else n(B,G==200?500:G)})}function N(k,n){t._notAdmin(k,n)||t._missing(k,n,"code")||t.post("subscribe",k,function(q,u){u==200&&C.put("account/balance",q.balance,q.time);n(q,u)})}function O(k,n){t._notAdmin(k,n)||t.post("account/export",k,n)}function P(k,n){if(!t._notAdmin(k,n)){if(!$cc.session.free)return n({err:"Not free account."},400);t.post("account/upgrade",
k,function(q,u){if(u==200)$cc.session.free=false;n(q,u)})}}function Q(k,n){if(!t._notAdmin(k,n)){if($cc.session.free)return n({err:"Already free account.",reason:"free"},400);if($cc.session.isGA())return n({err:"Can not downgrade from Google Apps account.",reason:"google"},400);t.post("account/downgrade",k,function(q,u){if(u==200)$cc.session.free=true;n(q,u)})}}function R(k,n){t._notAdmin(k,n)||t.post("delete",k,n)}function S(k,n){t._notAdmin(k,n)||t.del("delete",k,n)}function T(k,n){t._notAdmin(k,
n)||t.get("delete",k,n)}function U(k,n){t._notAdmin(k,n)||t.post("activate",k,n)}function V(k,n){t._notAdmin(k,n)||t.get("settings/admin",k,n)}function W(k,n){t._notAdmin(k,n)||t.post("settings/admin",k,n)}var t=$cc.core,E=$cc.api,C=E._cache,J=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];E.func("createAccount",d).func("checkAccount",c).func("getAccountName",f).func("signIn",b).func("oauth",m).func("signOut",e).func("googleSignIn",j).func("saveSettings",h).func("loadSettings",
g).func("loadBalance",l).func("listBillingHistory",o).func("loadInvoice",w).func("changePassword",v).func("loadSecurity",x).func("changeSecurity",A).func("resetPassword",z).func("initProfile",s).func("addAnnouncement",D).func("removeAnnouncement",F).func("changeAnnouncement",I).func("hideAnnouncement",K).func("showAnnouncement",L).func("loadAnnouncements",M).func("subscribe",N).func("exportData",O).func("upgrade",P).func("downgrade",Q).func("deleteAccount",R).func("cancelDeleteAccount",S).func("activateAccount",
U).func("loadAccountDeleted",T).func("loadAdminSettings",V).func("saveAdminSettings",W)})(jQuery);(function(){function a(c,f){d.get("/g/oauthCallback"+location.search,function(b,e){if(!b||e!=200)return f(null,e);if(b.email)$cc.session.email=b.email;if(b.account)$cc.session.account=b.account;b.token&&$cc.session.setToken(b.token);f(b.account?{location:"/a/"+b.account.substr(3)}:{},e)})}var d=$cc.core;$cc.api.func("oauthCallback",a)})(jQuery);
