(function(){var a=this,b=a.Backbone,c;c="undefined"!==typeof exports?exports:a.Backbone={};c.VERSION="0.5.3";var d=a._;if(!d&&"undefined"!==typeof require)d=require("underscore")._;var e=a.jQuery||a.Zepto;c.noConflict=function(){a.Backbone=b;return this};c.emulateHTTP=!1;c.emulateJSON=!1;c.Events={bind:function(a,b,c){var d=this._callbacks||(this._callbacks={});(d[a]||(d[a]=[])).push([b,c]);return this},unbind:function(a,b){var c;if(a){if(c=this._callbacks)if(b){c=c[a];if(!c)return this;for(var d=
0,e=c.length;d<e;d++)if(c[d]&&b===c[d][0]){c[d]=null;break}}else c[a]=[]}else this._callbacks={};return this},trigger:function(a){var b,c,d,e,f=2;if(!(c=this._callbacks))return this;for(;f--;)if(b=f?a:"all",b=c[b])for(var g=0,k=b.length;g<k;g++)(d=b[g])?(e=f?Array.prototype.slice.call(arguments,1):arguments,d[0].apply(d[1]||this,e)):(b.splice(g,1),g--,k--);return this}};c.Model=function(a,b){var c;a||(a={});if(c=this.defaults)d.isFunction(c)&&(c=c.call(this)),a=d.extend({},c,a);this.attributes={};
this._escapedAttributes={};this.cid=d.uniqueId("c");this.set(a,{silent:!0});this._changed=!1;this._previousAttributes=d.clone(this.attributes);if(b&&b.collection)this.collection=b.collection;this.initialize(a,b)};d.extend(c.Model.prototype,c.Events,{_previousAttributes:null,_changed:!1,idAttribute:"id",initialize:function(){},toJSON:function(){return d.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.attributes[a];
return this._escapedAttributes[a]=(null==b?"":""+b).replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")},has:function(a){return null!=this.attributes[a]},set:function(a,b){b||(b={});if(!a)return this;if(a.attributes)a=a.attributes;var c=this.attributes,e=this._escapedAttributes;if(!b.silent&&this.validate&&!this._performValidation(a,b))return!1;if(this.idAttribute in a)this.id=a[this.idAttribute];
var f=this._changing;this._changing=!0;for(var g in a){var k=a[g];if(!d.isEqual(c[g],k))c[g]=k,delete e[g],this._changed=!0,b.silent||this.trigger("change:"+g,this,k,b)}!f&&!b.silent&&this._changed&&this.change(b);this._changing=!1;return this},unset:function(a,b){if(!(a in this.attributes))return this;b||(b={});var c={};c[a]=void 0;if(!b.silent&&this.validate&&!this._performValidation(c,b))return!1;delete this.attributes[a];delete this._escapedAttributes[a];a==this.idAttribute&&delete this.id;this._changed=
!0;b.silent||(this.trigger("change:"+a,this,void 0,b),this.change(b));return this},clear:function(a){a||(a={});var b,c=this.attributes,d={};for(b in c)d[b]=void 0;if(!a.silent&&this.validate&&!this._performValidation(d,a))return!1;this.attributes={};this._escapedAttributes={};this._changed=!0;if(!a.silent){for(b in c)this.trigger("change:"+b,this,void 0,a);this.change(a)}return this},fetch:function(a){a||(a={});var b=this,d=a.success;a.success=function(c,e,f){if(!b.set(b.parse(c,f),a))return!1;d&&
d(b,c)};a.error=l(a.error,b,a);return(this.sync||c.sync).call(this,"read",this,a)},save:function(a,b){b||(b={});if(a&&!this.set(a,b))return!1;var d=this,e=b.success;b.success=function(a,m,c){if(!d.set(d.parse(a,c),b))return!1;e&&e(d,a,c)};b.error=l(b.error,d,b);var f=this.isNew()?"create":"update";return(this.sync||c.sync).call(this,f,this,b)},destroy:function(a){a||(a={});if(this.isNew())return this.trigger("destroy",this,this.collection,a);var b=this,d=a.success;a.success=function(c){b.trigger("destroy",
b,b.collection,a);d&&d(b,c)};a.error=l(a.error,b,a);return(this.sync||c.sync).call(this,"delete",this,a)},url:function(){var a=n(this.collection)||this.urlRoot||o();return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this)},isNew:function(){return null==this.id},change:function(a){this.trigger("change",this,a);this._previousAttributes=d.clone(this.attributes);this._changed=!1},hasChanged:function(a){return a?
this._previousAttributes[a]!=this.attributes[a]:this._changed},changedAttributes:function(a){a||(a=this.attributes);var b=this._previousAttributes,c=!1,e;for(e in a)d.isEqual(b[e],a[e])||(c=c||{},c[e]=a[e]);return c},previous:function(a){return!a||!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return d.clone(this._previousAttributes)},_performValidation:function(a,b){var c=this.validate(a);return c?(b.error?b.error(this,c,b):this.trigger("error",this,c,b),
!1):!0}});c.Collection=function(a,b){b||(b={});if(b.comparator)this.comparator=b.comparator;d.bindAll(this,"_onModelEvent","_removeReference");this._reset();a&&this.reset(a,{silent:!0});this.initialize.apply(this,arguments)};d.extend(c.Collection.prototype,c.Events,{model:c.Model,initialize:function(){},toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,b){if(d.isArray(a))for(var c=0,e=a.length;c<e;c++)this._add(a[c],b);else this._add(a,b);return this},remove:function(a,
b){if(d.isArray(a))for(var c=0,e=a.length;c<e;c++)this._remove(a[c],b);else this._remove(a,b);return this},get:function(a){return null==a?null:this._byId[null!=a.id?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");this.models=this.sortBy(this.comparator);a.silent||this.trigger("reset",this,a);return this},pluck:function(a){return d.map(this.models,
function(b){return b.get(a)})},reset:function(a,b){a||(a=[]);b||(b={});this.each(this._removeReference);this._reset();this.add(a,{silent:!0});b.silent||this.trigger("reset",this,b);return this},fetch:function(a){a||(a={});var b=this,d=a.success;a.success=function(c,e,f){b[a.add?"add":"reset"](b.parse(c,f),a);d&&d(b,c)};a.error=l(a.error,b,a);return(this.sync||c.sync).call(this,"read",this,a)},create:function(a,b){var c=this;b||(b={});a=this._prepareModel(a,b);if(!a)return!1;var d=b.success;b.success=
function(a,m,e){c.add(a,b);d&&d(a,m,e)};a.save(null,b);return a},parse:function(a){return a},chain:function(){return d(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId={};this._byCid={}},_prepareModel:function(a,b){if(a instanceof c.Model){if(!a.collection)a.collection=this}else{var d=a,a=new this.model(d,{collection:this});a.validate&&!a._performValidation(d,b)&&(a=!1)}return a},_add:function(a,b){b||(b={});a=this._prepareModel(a,b);if(!a)return!1;var c=this.getByCid(a);
if(c)throw Error(["Can't add the same model to a set twice",c.id]);this._byId[a.id]=a;this._byCid[a.cid]=a;this.models.splice(null!=b.at?b.at:this.comparator?this.sortedIndex(a,this.comparator):this.length,0,a);a.bind("all",this._onModelEvent);this.length++;b.silent||a.trigger("add",a,this,b);return a},_remove:function(a,b){b||(b={});a=this.getByCid(a)||this.get(a);if(!a)return null;delete this._byId[a.id];delete this._byCid[a.cid];this.models.splice(this.indexOf(a),1);this.length--;b.silent||a.trigger("remove",
a,this,b);this._removeReference(a);return a},_removeReference:function(a){this==a.collection&&delete a.collection;a.unbind("all",this._onModelEvent)},_onModelEvent:function(a,b,c,d){("add"==a||"remove"==a)&&c!=this||("destroy"==a&&this._remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,arguments))}});d.each("forEach,each,map,reduce,reduceRight,find,detect,filter,select,reject,every,all,some,any,include,contains,invoke,max,min,sortBy,sortedIndex,toArray,size,first,rest,last,without,indexOf,lastIndexOf,isEmpty,groupBy".split(","),
function(a){c.Collection.prototype[a]=function(){return d[a].apply(d,[this.models].concat(d.toArray(arguments)))}});c.Router=function(a){a||(a={});if(a.routes)this.routes=a.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var f=/:([\w\d]+)/g,g=/\*([\w\d]+)/g,h=/[-[\]{}()+?.,\\^$|#\s]/g;d.extend(c.Router.prototype,c.Events,{initialize:function(){},route:function(a,b,e){c.history||(c.history=new c.History);d.isRegExp(a)||(a=this._routeToRegExp(a));c.history.route(a,d.bind(function(c){c=
this._extractParameters(a,c);e.apply(this,c);this.trigger.apply(this,["route:"+b].concat(c))},this))},navigate:function(a,b){c.history.navigate(a,b)},_bindRoutes:function(){if(this.routes){var a=[],b;for(b in this.routes)a.unshift([b,this.routes[b]]);b=0;for(var c=a.length;b<c;b++)this.route(a[b][0],a[b][1],this[a[b][1]])}},_routeToRegExp:function(a){a=a.replace(h,"\\$&").replace(f,"([^/]*)").replace(g,"(.*?)");return RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});
c.History=function(){this.handlers=[];d.bindAll(this,"checkUrl")};var i=/^#*/,k=/msie [\w.]+/,j=!1;d.extend(c.History.prototype,{interval:50,getFragment:function(a,b){if(null==a)if(this._hasPushState||b){var a=window.location.pathname,c=window.location.search;c&&(a+=c);0==a.indexOf(this.options.root)&&(a=a.substr(this.options.root.length))}else a=window.location.hash;return decodeURIComponent(a.replace(i,""))},start:function(a){if(j)throw Error("Backbone.history has already been started");this.options=
d.extend({},{root:"/"},this.options,a);this._wantsPushState=!!this.options.pushState;this._hasPushState=!(!this.options.pushState||!window.history||!window.history.pushState);var a=this.getFragment(),b=document.documentMode;if(b=k.exec(navigator.userAgent.toLowerCase())&&(!b||7>=b))this.iframe=e('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(a);this._hasPushState?e(window).bind("popstate",this.checkUrl):"onhashchange"in window&&!b?e(window).bind("hashchange",
this.checkUrl):setInterval(this.checkUrl,this.interval);this.fragment=a;j=!0;a=window.location;b=a.pathname==this.options.root;if(this._wantsPushState&&!this._hasPushState&&!b)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;if(this._wantsPushState&&this._hasPushState&&b&&a.hash)this.fragment=a.hash.replace(i,""),window.history.replaceState({},document.title,a.protocol+"//"+a.host+this.options.root+this.fragment);if(!this.options.silent)return this.loadUrl()},
route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.iframe.location.hash));if(a==this.fragment||a==decodeURIComponent(this.fragment))return!1;this.iframe&&this.navigate(a);this.loadUrl()||this.loadUrl(window.location.hash)},loadUrl:function(a){var b=this.fragment=this.getFragment(a);return d.any(this.handlers,function(a){if(a.route.test(b))return a.callback(b),!0})},navigate:function(a,
b){var c=(a||"").replace(i,"");if(!(this.fragment==c||this.fragment==decodeURIComponent(c))){if(this._hasPushState){var d=window.location;0!=c.indexOf(this.options.root)&&(c=this.options.root+c);this.fragment=c;window.history.pushState({},document.title,d.protocol+"//"+d.host+c)}else if(window.location.hash=this.fragment=c,this.iframe&&c!=this.getFragment(this.iframe.location.hash))this.iframe.document.open().close(),this.iframe.location.hash=c;b&&this.loadUrl(a)}}});c.View=function(a){this.cid=d.uniqueId("view");
this._configure(a||{});this._ensureElement();this.delegateEvents();this.initialize.apply(this,arguments)};var r=/^(\S+)\s*(.*)$/,p="model,collection,el,id,attributes,className,tagName".split(",");d.extend(c.View.prototype,c.Events,{tagName:"div",$:function(a){return e(a,this.el)},initialize:function(){},render:function(){return this},remove:function(){e(this.el).remove();return this},make:function(a,b,c){a=document.createElement(a);b&&e(a).attr(b);c&&e(a).html(c);return a},delegateEvents:function(a){if(a||
(a=this.events)){d.isFunction(a)&&(a=a.call(this));e(this.el).unbind(".delegateEvents"+this.cid);for(var b in a){var c=this[a[b]];if(!c)throw Error('Event "'+a[b]+'" does not exist');var f=b.match(r),g=f[1],f=f[2],c=d.bind(c,this),g=g+(".delegateEvents"+this.cid);""===f?e(this.el).bind(g,c):e(this.el).delegate(f,g,c)}}},_configure:function(a){this.options&&(a=d.extend({},this.options,a));for(var b=0,c=p.length;b<c;b++){var e=p[b];a[e]&&(this[e]=a[e])}this.options=a},_ensureElement:function(){if(this.el){if(d.isString(this.el))this.el=
e(this.el).get(0)}else{var a=this.attributes||{};if(this.id)a.id=this.id;if(this.className)a["class"]=this.className;this.el=this.make(this.tagName,a)}}});c.Model.extend=c.Collection.extend=c.Router.extend=c.View.extend=function(a,b){var c=s(this,a,b);c.extend=this.extend;return c};var t={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};c.sync=function(a,b,f){var g=t[a],f=d.extend({type:g,dataType:"json"},f);if(!f.url)f.url=n(b)||o();if(!f.data&&b&&("create"==a||"update"==a))f.contentType=
"application/json",f.data=JSON.stringify(b.toJSON());if(c.emulateJSON)f.contentType="application/x-www-form-urlencoded",f.data=f.data?{model:f.data}:{};if(c.emulateHTTP&&("PUT"===g||"DELETE"===g)){if(c.emulateJSON)f.data._method=g;f.type="POST";f.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",g)}}if("GET"!==f.type&&!c.emulateJSON)f.processData=!1;return e.ajax(f)};var q=function(){},s=function(a,b,c){var e;e=b&&b.hasOwnProperty("constructor")?b.constructor:function(){return a.apply(this,
arguments)};d.extend(e,a);q.prototype=a.prototype;e.prototype=new q;b&&d.extend(e.prototype,b);c&&d.extend(e,c);e.prototype.constructor=e;e.__super__=a.prototype;return e},n=function(a){return!a||!a.url?null:d.isFunction(a.url)?a.url():a.url},o=function(){throw Error('A "url" property or function must be specified');},l=function(a,b,c){return function(d){a?a(b,d,c):b.trigger("error",b,d,c)}}}).call(this);var extend=function(a,b){var c=inherits(this,a,b);c.extend=extend;return c},ctor=function(){},inherits=function(a,b,c){var d;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){return a.apply(this,arguments)};ctor.prototype=a.prototype;d.prototype=new ctor;b&&_.extend(d.prototype,b);c&&_.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d};var VY;VY={Model:{},View:{},Collection:{},Controller:{},Widget:{},Ext:{},Form:{},Tabs:{},ViewMixin:{},JST:{},C:{},MSG:{},init:function(){Backbone.history&&Backbone.history.start({pushState:can_use_pushstate})},make:(new Backbone.View).make};function json_notification(){}
function notification(a,b){if(null===b||void 0===b||"object"!=typeof b)b={};_.defaults(b,{code:"notice",targetId:"site_alerts",inlineElement:!1,view:null,e:null,target:null,fadeIn:"200",closeAfter:null,onClose:null,icon:"exclaim"});if(!b.target)null!==b.view&&null!==b.view.errel?b.target=d.errel:(b.target=$("#"+b.targetId),b.target.show());if(b.inlineElement){var c=b.inlineElement.attr("id")+"_response";0<$("#"+c).length?$("#"+c).html(a).show():$(b.inlineElement).before('<div id="'+c+'" class="inline_notification" >'+
a+"</div>")}else{var d=new Backbone.View,c=d.make("a",{href:""},"X"),e=d.make("div",{id:"message_alerts_message",className:b.code},a),f=d.make("div",{id:b.icon+"_alert_icon"}),d=d.make("div",{id:"message_alerts"},d.make("div",{id:"message_alerts_close_btn"},c)),g=$(d).append(f).append(e).slideDown("3000");b.target.html(g);$(c).click(function(){$("#layout_right_col_content").css("margin-top","0px");$("#layout_left_col").css("margin-top","0px");$("#site_alerts").removeAttr("style").css("height","0px");
$("#mobile_page_total").removeAttr("style");$("#header").css("top","28px");g.remove();b.to&&clearTimeout(b.to);if(null!==b.onClose)b.onClose();return!1});if(_.isNumber(b.closeAfter))b.to=setTimeout(function(){g.fadeOut(b.fadeIn,function(){$(this).remove()})},b.closeAfter);c=$("#"+b.targetId).height();$.scrollTo({top:"0px"},100);$("#layout_left_col").css("margin-top",c+"px")}return e}function notification_close(){$("#message_alerts").fadeOut("50")}
var urlRegex=function(){return function(a){a="^"+(a&&a.length?"(?:"+a.join("|")+")://":"(?:(?:http|https)://|//)")+"(?:(?:[-_.!~*'()a-z\\d;:&=+$,]|%[a-f\\d]{2})*@)?(?:(?:(?:[a-z\\d](?:[-a-z\\d]*[a-z\\d])?)\\.)*(?:[a-z](?:[-a-z\\d]*[a-z\\d])?)\\.?|\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|\\[(?:(?:[a-f\\d]{1,4}:)*(?:[a-f\\d]{1,4}|\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})|(?:(?:[a-f\\d]{1,4}:)*[a-f\\d]{1,4})?::(?:(?:[a-f\\d]{1,4}:)*(?:[a-f\\d]{1,4}|\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}))?)\\])(?:\\:\\d+)?(?:/(?:[-_.!~*'()a-z\\d:@&=+$,]|%[a-f\\d]{2})*(?:;(?:[-_.!~*'()a-z\\d:@&=+$,]|%[a-f\\d]{2})*)*(?:/(?:[-_.!~*'()a-z\\d:@&=+$,]|%[a-f\\d]{2})*(?:;(?:[-_.!~*'()a-z\\d:@&=+$,]|%[a-f\\d]{2})*)*)*)?(?:\\?(?:[-_.!~*'()a-z\\d;/?:@&=+$,\\[\\]]|%[a-f\\d]{2})*)?(?:#(?:[-_.!~*'()a-z\\d;/?:@&=+$,\\[\\]]|%[a-f\\d]{2})*)?$";
return RegExp(a,"i")}}(),slice=function(a){return Array.prototype.slice.call(a)};_.mixin({mkurl:function(a,b,c){"undefined"===typeof c&&(c={});c=_.defaults(c,{func:jQuery.param,nulls:!1});if(!1===c.nulls){var d={};_.each(b,function(a,b){!_.isNull(a)&&!_.isUndefined(a)&&!1!==a&&!(_.isString(a)&&0==a.length)&&(d[b]=a)});b=d}return a+"?"+c.func(b)},isUrl:function(){var a=slice(arguments),b=a.shift();return(a.length?urlRegex(a):defaultUrlRegex).test(b)}});
String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};String.prototype.format=function(){for(var a="",b=0;b<arguments.length;b++)a=this.replace("{"+b+"}",arguments[b]);return a};
function time_since(a,b){var c="",d={};if(!b||"object"!==typeof b)b={};var e="one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fiteen,sixteen,seventeen,eighteen,nineteen,twenty,twenty-one,twenty-two,twenty-three,twenty-four,twenty-five,twenty-six,twenty-seven,twenty-eight,twenty-nine,thirty,thirty-one,thirty-two,thirty-three,thirty-four,thirty-five,thirty-six,thirty-seven,thirty-eight,thirty-nine,forty,forty-one,forty-two,forty-three,forty-four,forty-five,forty-six,forty-seven,forty-eight,forty-nine,fifty,fifty-one,fifty-two,fity-three,fifty-four,fifty-five,fifty-six,fifty-seven,fifty-eight,fifty-nine,sixty".split(","),f=
[[31536E3,"year"],[2592E3,"month"],[604800,"week"],[86400,"day"],[3600,"hour"],[60,"minute"]],g=VY.C.unixtime-a;if(604800<g)return f=date("M jS",a),31536E3<g&&(f+=", "+date("Y",a)),c="",b&&(c=date("g A",a),c=" around "+c),d.ago_number=f,d.extra_info=c,d.ago_spell=f,d;for(var h,i=0,k=f.length;i<k;i++){var j=f[i][1];if(0!=(h=Math.floor(g/f[i][0])))break}b&&"minute"!=j&&"hour"!=j&&(c=date("g A",a),c=" around "+c);g="";1==h?"day"==j?(f="1 day",g="yesterday"):(f="1 "+j,g="one "+j):(f=h+" "+j+"s",g=0==
h?"minute"==j?"less then a minute":"zero":e[h-1]+" "+j+"s");"yesterday"!==g&&(g+=" ago");d.ago_number=f+" ago";d.extra_info=c;d.ago_spell=g;return d}
function date(a,b){var c,d,e=/\\?([a-z])/gi,f,g=function(a,b){return(a+="").length<b?Array(++b-a.length).join("0")+a:a},h="Sun,Mon,Tues,Wednes,Thurs,Fri,Satur,January,February,March,April,May,June,July,August,September,October,November,December".split(","),i={1:"st",2:"nd",3:"rd",21:"st",22:"nd",23:"rd",31:"st"};f=function(a,b){return d[a]?d[a]():b};d={d:function(){return g(d.j(),2)},D:function(){return d.l().slice(0,3)},j:function(){return c.getDate()},l:function(){return h[d.w()]+"day"},N:function(){return d.w()||
7},S:function(){return i[d.j()]||"th"},w:function(){return c.getDay()},z:function(){var a=new Date(d.Y(),d.n()-1,d.j()),b=new Date(d.Y(),0,1);return Math.round((a-b)/864E5)+1},W:function(){var a=new Date(d.Y(),d.n()-1,d.j()-d.N()+3),b=new Date(a.getFullYear(),0,4);return 1+Math.round((a-b)/864E5/7)},F:function(){return h[6+d.n()]},m:function(){return g(d.n(),2)},M:function(){return d.F().slice(0,3)},n:function(){return c.getMonth()+1},t:function(){return(new Date(d.Y(),d.n(),0)).getDate()},L:function(){return 1===
(new Date(d.Y(),1,29)).getMonth()|0},o:function(){var a=d.n(),b=d.W();return d.Y()+(12===a&&9>b?-1:1===a&&9<b)},Y:function(){return c.getFullYear()},y:function(){return(d.Y()+"").slice(-2)},a:function(){return 11<c.getHours()?"pm":"am"},A:function(){return d.a().toUpperCase()},B:function(){var a=3600*c.getUTCHours(),b=60*c.getUTCMinutes(),d=c.getUTCSeconds();return g(Math.floor((a+b+d+3600)/86.4)%1E3,3)},g:function(){return d.G()%12||12},G:function(){return c.getHours()},h:function(){return g(d.g(),
2)},H:function(){return g(d.G(),2)},i:function(){return g(c.getMinutes(),2)},s:function(){return g(c.getSeconds(),2)},u:function(){return g(1E3*c.getMilliseconds(),6)},e:function(){throw"Not supported (see source code of date() for timezone on how to add support)";},I:function(){var a=new Date(d.Y(),0),b=Date.UTC(d.Y(),0),c=new Date(d.Y(),6),e=Date.UTC(d.Y(),6);return 0+(a-b!==c-e)},O:function(){var a=c.getTimezoneOffset();return(0<a?"-":"+")+g(Math.abs(100*(a/60)),4)},P:function(){var a=d.O();return a.substr(0,
3)+":"+a.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-c.getTimezoneOffset()},c:function(){return"Y-m-d\\Th:i:sP".replace(e,f)},r:function(){return"D, d M Y H:i:s O".replace(e,f)},U:function(){return c.getTime()/1E3|0}};this.date=function(a,b){c="undefined"===typeof b?new Date:b instanceof Date?new Date(b):new Date(1E3*b);return a.replace(e,f)};return this.date(a,b)}
function get_avatar(a,b){return 1==b?"/images/graphics/anon_icon.png":_.isNull(a)||"default-avatar.png"==a?"/default-avatar.png":VY.C.s3_url+a}function get_res_thumb(a){return VY.C.s3_res+a}function encode_message(a){if(!a.length)return"Status-Update";a=unescape(a);a=a.replace(/[^\w ]/gi,"");a=a.replace(/[ ]+/gi," ");a=$.trim(a);return a=a.replace(/ /gi,"-")}function isdefined(a){return"undefined"==typeof a?!1:!0}function fdefined(a){return"function"==typeof a?!1:!0}function json_ok(){return!0}
function addCommas(a){x=(a+"").split(".");x1=x[0];x2=1<x.length?"."+x[1]:"";for(a=/(\d+)(\d{3})/;a.test(x1);)x1=x1.replace(a,"$1,$2");return x1+x2};(function(){var a=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,b={nonempty:function(a){return 0<a.length},email:function(b){return a.test(b)},password:function(a){return 6<=a.length}},c={email:"Wrong email format",password:"Password should be at least 6 characters long",nonempty:"This field is required"};VY.Ext.VModel=Backbone.Model.extend({validation:{},validate:function(){var a={},b=this;
_.each(_.keys(this.validation),function(c){var g=b._validate_attr(c);g&&(a[c]=g)});return _.isEmpty(a)?!0:a},_validate_attr:function(a){var e=this.get(a);if(a=_.detect(this.validation[a],function(a){return!b[a](e||"")}))return c[a]}})})();VY.Ext.Form=function(a){this._configure(a||{});this.initialize(a)};
_.extend(VY.Ext.Form.prototype,Backbone.View,{validateFocus:!1,_configure:function(a){if(a.form)this.form=a.form;if(a.model)this.model=a.model;this.elements=a.elements?a.elements:this._get_form_elements();this.submit=a.submit||this._find_submit();var b=this;if(!a.submit)a.submit=function(){var a={};_.each(b.elements,function(b){a[b.name]=$(b).val()});return b.model.set(a)};a.validateFocus&&_.each(b.elements,function(a){var d=a.name,e=$(a);e.blur(function(){b.model.set({name:e.val()},{silent:!0});
var a=b.model._validate_attr(d);if(a){var c={};c[d]=a;b.error(b.model,c)}})});this.form.bind("submit",a.submit);this.model.bind("error",this.error);this.model.form=this;this.options=a},_get_form_elements:function(){var a=[];this.form.find(":input").each(function(){a.push(this)});return a},_find_element:function(a){return _.detect(this.elements,function(b){return b.name==a})},_find_submit:function(){},error:function(a,b){var c=a.form;_.each(b,function(a,b){var f=c._find_element(b);$(f).val(a)})},initialize:function(){}});
VY.Ext.Form.extend=extend;VY.Form.Simple=VY.Ext.Form.extend({validateFocus:!0});VY.Ext.Keys=function(){function a(a,c,d){a.addEventListener?a.addEventListener(d.type,c,!1):a.attachEvent?a.attachEvent("on"+d.type,c):a["on"+d.type]=c}return{bind:function(b,c,d){a(b,function(a){var a=a||b.event,d;if(a.keyCode)d=a.keyCode;else if(a.which)d=a.which;c(d,a);return!0},d)}}}();VY.C={api_url:"",s3_url:"",loading_gif_src:"/images/common/loading-spinner-2.gif",userid:0,search_ip:""};VY.C.loading_img=VY.make("img",{src:VY.C.loading_gif_src,"class":"loading_img"},"");
VY.MSG={grpmsg:{allrec:"Sorry, but all of your followers have already received this message - so it wasn't sent to anyone.",allrec_sel:"Sorry, but all of these followers have already received this message - so it wasn't sent to any of them",onerec:"Sorry, but this follower has already received this message - so it wasn't sent.",notsend:"It wasn't sent to {0} of your Followers, because they've received this message before and might have already responded to it.",send:"Your message was sent to {0} of your Followers!"},
NO_EMAIL_NOTIF:"Please enter your email address",NOT_VALID_EMAIL_NOTIF:"Your email is not a valid format",NO_SUCH_EMAIL_NOTIF:"No such email address exists in our database",BIO_TOO_LONG_NOTIF:"Your bio should be no longer than 140 characters, brevity is the soul of wit...",FB_NO_PERMS_NOTIF:"Please grant us permissions to read and publish on your Facebook wall so that we can link your Facebook account...",FB_BAD_LOGIN_NOTIF:"Sorry, Facebook says your login wasn't successful...",FB_ACCOUNT_LINKED_NOTIF:"Success! Your VYou and Facebook accounts are now linked.",
FB_LINK_ERROR_NOTIF:"Sorry, we couldn't link your VYou and Facebook accounts at this time...",FB_ACCOUNT_UNLINKED_NOTIF:"Success! Your VYou and Facebook accounts are unlinked.",FB_UNLINK_ERROR_NOTIF:"Sorry, we couldn't unlink your VYou and Facebook accounts at this time..."};JST.template=function(a){return JST.preload[a]?JST.preload[a]:_.template($("#"+a))};VY.Widget.Tabs=function(a){this._configure(a);this._initialize()};
_.extend(VY.Widget.Tabs.prototype,{_lnkstr:"link",_configure:function(a){if(a.el)this.el=a.el;if(a.tabs)this.tabs=a.tabs;if(a.deftab)this.deftab=a.deftab;if(a.content)this.content=a.content;if(a.link_postfix)this._lnkstr=a.link_postfix;if(a.cb)this.cb=a.cb;this.options=a},_load_tab:function(a){this.content.hide();this.el.find("li").removeClass("active");this.el.find("#"+a+"_"+this._lnkstr).parent().addClass("active");$("#"+a).fadeIn();this.selected=!0;this.cb&&this.cb(a)},_initialize:function(){var a=
this;this.el.find("[id$="+a._lnkstr+"]").click(function(){var b=$(this).attr("href").substr(1);a._load_tab(b);return!1});!this.selected&&this.deftab&&this._load_tab(this.deftab)}});VY.Widget.Tabs.extend=extend;VY.Tabs.Simple=VY.Widget.Tabs.extend({});VY.Tabs2={};VY.Widget.Tabs2=function(a,b){this._configure(a,b);this._initialize(b)};
_.extend(VY.Widget.Tabs2.prototype,{tabs:null,data:{},events:{},_configure:function(a,b){if(a.disableTab)this.disableTab=a.disableTab;if(a.enableTab)this.enableTab=a.enableTab;this.options=a;this.tabs=b;a.norouter||this._router()},_initialize:function(a){var b=this;_.each(a,function(a,d){$(a[0]).click(function(){$(this).attr("href").substr(1);b.load_tab(d);return!1})});!this.selected&&this.deftab&&this.load_tab(this.deftab)},_router:function(){var a=this,b=Backbone.Router.extend({});a.router=new b({});
_.each(a.tabs,function(b,d){a.router.route(d,d,function(){a.load_tab(d)})})},load_tab:function(a){var b=_.filter(this.tabs,function(a){return $(a[0]).hasClass("selected_link")});b&&!_.isEmpty(b)&&($(b[0][0]).removeClass("selected_link"),$(b[0][1]).removeClass("selected_tab").hide(),this.disableTab&&this.disableTab(a,b[0][0],b[0][1]));var b=this.tabs[a][0],c=this.tabs[a][1];$(c).addClass("selected_tab").fadeIn();$(b).addClass("selected_link");this.selected_tab=a;this.enableTab&&this.enableTab(a,b,
c)},current_tab:function(){return{name:this.selected_tab,link:this.tabs[this.selected_tab][0],content:this.tabs[this.selected_tab][1]}},associate:function(a,b){this.data[a]||(this.data[a]={});this.data[a]=_.extend(this.data[a],b)},run_in_selected:function(a){var b=this.current_tab().name;a.call(this.data[b]||{},b)},is_selected:function(a,b){this.current_tab().name==a&&this.run_in_selected(b)},select:function(a,b,c){b=this.events;(b[a]||(b[a]=[])).push([callback,c]);return this},fire:function(a){var b,
c;if(!(c=this.events))return this;if(b=c[a]){c=0;for(b=b.length;c<b;c++)(void 0)[0].apply((void 0)[1]||this.data[a]||{},void 0)}return this}});VY.Widget.Tabs2.extend=extend;VY.Tabs2.Simple=VY.Widget.Tabs2.extend({});function Search(a){this.initialize(a)}
_.extend(Search.prototype,{server:"",type:"people",jsonp:!1,query:"",page:1,sort:"",limit:20,meta:null,params:{},_req:null,_is_running:!1,cache:!1,cache_resnum:20,_cache:{},_cache_ids:[],initialize:function(a){_.each("server,type,query,page,sort,params,jsonp,cache".split(","),function(b){"undefined"!==typeof a[b]&&(this[b]=a[b])},this);if(!this.server.length){var b=VY.C.search_ip;this.server=b[Math.floor(Math.random()*b.length)]}},search:function(a,b){this.query=a;this._search(b)},is_running:function(){return this._is_running},
abort:function(){if(!_.isNull(this._req))this._req.abort(),this._req=null,this._is_running=!1},next_page:function(a){this.page++;this._search(a)},has_next_page:function(){return"object"===typeof this.meta&&0<this.meta.total_found-this.limit*this.page},add_params:function(a,b){_.isObject(a)?this.params=_.extend(this.params,a):this.params[a]=b},_search:function(a){var b=this,c=_.clone(this.params);_.extend(c,{query:this.query,page:this.page,sort:this.sort});var d="http://"+this.server+"/"+this.type;
this.jsonp&&(d+="?callback=?");if(this.cache){var e=this._cache_lookup();if(e){b.meta=e.meta;this._is_running=!1;a(e);return}}this._is_running=!0;this._req=$.getJSON(d,c,function(c){b.cache&&b._build_cache(c);b.meta=c.meta;this._is_running=!1;a(c)})},_build_cache:function(a){var b=this._cache_str();this._cache[b]=a;this._cache_ids.push(b);this._cache_ids.length>this.cache_resnum&&delete this._cache[this._cache_ids.shift()]},_cache_lookup:function(){return this._cache[this._cache_str()]},_cache_str:function(){return this.query+
":"+this.page+":"+this.sort}});VY.Model.User=Backbone.Model.extend({});VY.Model.Message=Backbone.Model.extend({construct_display_name_html:function(){this.set(this._construct_dn_html(this.get("from_display_name"),this.get("from_username")))},_construct_dn_html:function(a,b){var c="",d=1,e=!1;"Anonymous"==a||"Guest User"==a?c="<b>"+a+"</b>":(c='<a href="/'+b+'">'+a+"</a>",d=0,e=!0);return{display_name_html:c,anon_avatar:d,thumbnail_with_link:e}},has_responses:function(){var a=this.get("responses");return a&&a.length},ignore_message:function(){this.set({responding:!1},
{silent:!0});$.post("/message/ignore",{ping_id:this.get("ping_id"),new_ping_id:this.get("id")},function(){})},responding:function(){this.set({responding:!0},{silent:!0})},not_responding:function(){this.set({responding:!1},{silent:!0})}});VY.Model.Response=VY.Model.Message.extend({undo_delete:function(a){$.post("/server/enablenode",{node_id:this.get("node_id")},a)},delete_response:function(a){var b=this;$.post("/server/disablethreadnode",{node_id:this.get("node_id"),ping_id:this.get("ping_id")},function(){b.destroy({success:a})})},change_publicity:function(a,b){b||(b=function(){});$.post("/message/setresponsestatus",{ping_id:this.get("ping_id"),response_id:this.get("response_id"),should_be_private:a},b)},construct_privacy_info_html:function(a){var b=
"Public";2==this.get("response_status_id")&&(!a||1==a.length&&a[0].user_id==this.get("from_user_id")?b="Private for "+this.get("from_display_name"):(this.set({show_privacy_tooltip:!0}),b="Private for "+a.length+" people"));this.set({privacy_info:b})}});VY.Collection.UsersList=Backbone.Collection.extend({url:"/server/userfollowers",model:VY.Model.User,svec:[],parse:function(a){var b=this,c=[];$.each(a.users,function(a,e){var f=new VY.Model.User(e),g=e.display_name.length;b.svec[g]||(b.svec[g]=[]);b.svec[g].push([e.display_name.toLowerCase(),f]);c.push(f)});return c}});VY.Collection.MontageFollowersList=VY.Collection.UsersList.extend({initialize:function(){this.page=1;this.sort="sort_by_recently_active";this.topic=0},url:function(){return"/montage/followerslist?montage_id="+this.montage_id+"&sort="+this.sort+"&page="+this.page+"&topic="+this.topic},parse:function(a){this.pages_total=a.pages_total;return VY.Collection.UsersList.prototype.parse.call(this,a)},set_montage_id:function(a){if(!_.isUndefined(a))this.montage_id=a}});VY.Collection.MessagesList=Backbone.Collection.extend({order:"desc",page:1,ptotal:1,token:null,preclear:0,instant:!1,q:"",model:VY.Model.Message,url:function(){return this.instant?this.instants():this.normal()},go_instant:function(a){this.instant=!0;this.q=a},instants:function(){return _.mkurl("/instantsearch",{query:this.q,token:this.token,order:this.order})},normal:function(){return _.mkurl("/message/list",{current_page:this.page,order:this.order,json:!0})},set_next_page:function(){this.page+=1},
set_first_page:function(){this.page=1},has_next_page:function(){return this.page<this.ptotal}});VY.Collection.ResponsesList=VY.Collection.MessagesList.extend({page:1,ptotal:1,model:VY.Model.Response,url:function(){return _.mkurl("/message/responses",{current_page:this.page})},parse:function(a){this.process_private_info(a.private_info);this.ptotal=a.pages_total;return a.responses},process_private_info:function(a){var b={};_.each(a,function(a){b[a.response_id]||(b[a.response_id]=[]);b[a.response_id].push({display_name:a.display_name,user_id:a.user_id})});this.private_info=b},get_private_info:function(a){return this.private_info[a]}});VY.View.People=Backbone.View.extend({initialize:function(){var a=this;this.view={};this.users=this.options.users;var b=new VY.View.UsersList({el:this.options.users_el,users:this.users});b.parameters.view=VY.View.FullUser;this.view.list=b;this.pager=this.options.pager;this.pages_el=this.options.pages_el;this.sort_active=$("#sort_by_recently_active");this.users.bind("reset",function(){a.setup_pager(a.users,function(a){return'href="#" onclick="people.next_page('+a+');"'})})},events:{"click #sort_by_recently_active":"sort",
"click #sort_by_most_videos":"sort","click #sort_by_most_recently_joined":"sort"},setup_pager:function(a,b){this.pager.setCurrentPage(a.page);this.pager.setPagesTotal(a.pages_total);this.pages_el.html(this.pager.createSimpleControlsHtml(b))},next_page:function(a){this.users.page=a;this.pager.setCurrentPage(a);this.users.fetch();return!1},sort:function(a){this.gensort(a,this.users);this.users.fetch();return!1},gensort:function(a,b){$el=$(a.target);$el.blur();this.sort_active.removeClass("active");
b.sort={sort_by_recently_active:"sort_by_recently_active",sort_by_most_videos:"sort_by_responses_total",sort_by_most_recently_joined:"sort_by_join_date",sort_by_featured:"sort_by_featured",sort_by_newest:"sort_by_newest",sort_by_music:"sort_by_music"}[a.target.id];this.pager.setCurrentPage(1);this.montage.page=1;$el.addClass("active");this.sort_active=$el},topic:function(){}});(function(){function a(){this.page=1;this.user_id=null;this.sort="sort_by_featured";this.pages_total=1}VY.View.AllMontages=VY.View.People.extend({initialize:function(){var b=this,c=this.options.sort_active_name;this.sort_active=$("#"+c);this.montage=new a({});this.montage.sort=c;this.montages_el=this.options.montages_el;this.pager=this.options.pager;this.pages_el=this.options.pages_el;this.montage.bind("reset",function(){$("#loading_montage_spinner").hide();b.montages_el.html(b.montage.content);$("#items").show();
b.setup_pager(b.montage,function(a){return'href="#" onclick="montages.next_page('+a+');"'});$("#pages").show()})},events:{"click #sort_by_featured":"sort","click #sort_by_recently_active":"sort","click #sort_by_most_videos":"sort","click #sort_by_newest":"sort","click #sort_by_music":"sort"},sort:function(a){$("#loading_montage_spinner").show();$("#items").hide();$("#pages").hide();this.gensort(a,this.montage);this.montage.fetch();return!1},next_page:function(a){this.montage.page=a;this.pager.setCurrentPage(a);
this.montage.fetch();return!1}});_.extend(a.prototype,Backbone.Events,{url:function(){return _.mkurl("/montage/allmontages",{page:this.page,sort:this.sort,user_id:this.user_id})},fetch:function(){var a=this;$.get(this.url(),function(c){a.content=c;a.trigger("reset")},"html")},set_pages_total:function(a){this.pages_total=a}})})();VY.View.MiniUser=Backbone.View.extend({tagName:"li",className:"mini_user",template:$("#mini_user").template(),events:{"click a":"toggle_user"},initialize:function(){_.bindAll(this,"render","select_user","unselect_user","toggle_select");this.model.view=this;this.hidden=!1},toggle_user:function(){this.model.get("selected")?this.unselect_user():this.select_user()},select_user:function(){this.model.set({selected:!0});$(this.el).children("a").addClass("selected");this.subview=new VY.View.MiniUserWithCancel({model:this.model,
parentview:this});$(".selected_followers").append(this.subview.render().el)},unselect_user:function(){this.model.set({selected:!1});this.subview&&this.subview.remove();$(this.el).children("a").removeClass("selected")},toggle_select:function(){this.$(".select").is(":hidden")?(this.$(".select").show(),this.$(".unselect").hide()):(this.$(".select").hide(),this.$(".unselect").show())},hide:function(){$(this.el).hide();this.hidden=!0},show:function(){$(this.el).show();this.hidden=!1},render:function(){$(this.el).html($.tmpl(this.template,
this.model.toJSON()));return this}});VY.View.FullUser=Backbone.View.extend({tagName:"div",className:"members_page_item",template:$("#user").template(),initialize:function(){this.model.view=this},render:function(){$(this.el).html($.tmpl(this.template,this.model.toJSON()));return this}});VY.View.MiniUserWithCancel=Backbone.View.extend({tagName:"li",className:"mini_user_with_cancel",template:$("#user_with_cancel").template(),events:{"click .remove_selected":"remove_user"},render:function(){$(this.el).html($.tmpl(this.template,this.model.toJSON()));return this},remove_user:function(){this.options.parentview.unselect_user();return!1}});VY.View.Response=Backbone.View.extend({tagName:"li",className:"multipul_response_item",template:$("#response").template(),events:{"click .avatar_play_icon":"replay","click .add_link":"add_link","click .edit_link":"edit_link","click .add_link_cancel":"show_add_link","click .add_link_save":"save_link"},initialize:function(){this.model=this.options.model},render:function(){$(this.el).html($.tmpl(this.template,this.model.toJSON()));return this},replay:function(){var a=this.model.get("message");a.view.get_flash_obj().playbackResponse(this.model.get("video_url")+
"",this.model.get("description")+"",a.get("ping_question"));return!1},show_add_link:function(){return this._show_link("Add link","add_link")},show_edit_link:function(){this._show_link("Edit link","edit_link");this.$(".add_link_container").prepend(this.model.get("link"));return!1},show_link:function(){_.isString(this.model.get("link"))?this.show_edit_link():this.show_add_link()},_show_link:function(a,b){this.$(".add_link_container").html(this.make("a",{"class":b,href:""},a));return!1},save_link:function(){var a=
this.$(".add_link_container").find("input").val(),a=$.trim(a);_(a).isUrl("http","https")?($.post("/message/savelink",{url:a,response_id:this.model.get("response_id")},function(){}),this.model.set({link:a}),this.show_link()):alert("error, not valid url");return!1},edit_link:function(){this._show_form(this.model.get("link"));return!1},add_link:function(){this._show_form();return!1},_show_form:function(a){a||(a="");this.$(".add_link_container").html("<input type='text' value='"+a+"' /><a href='#' class='add_link_save'>Save</a> <a href='#' class='add_link_cancel'>Cancel</a>");
return!1}});VY.View.Message=Backbone.View.extend({tagName:"li",template:$("#message").template(),events:{"click .ignore_all":"ignore_all","click .report_user":"report_user","click .submit_report":"submit_report","click .my_messages_list_item_ignore":"ignore_message","click .my_messages_list_item_close":"hide_message","click .my_messages_list_response_btn":"create_response","click .css_radio_01.private":"click_private","click .css_radio_01.public":"click_public","click .cancel_response_btn":"cancel_response",
"click .add_another_response_btn":"add_another_response","click .my_messages_list_item_edit_link":"edit_message","click .my_messages_list_item_save_link":"save_message","click .my_messages_list_item_cancel_link":"cancel_edit_message"},initialize:function(){_.bindAll(this,"unselect");this.list=this.options.list;this.mymessages=this.list.mymessages},render:function(){var a=_.extend(this.model.toJSON(),{can_edit:"undefined"!==typeof this.list.can_edit?this.list.can_edit:0});$(this.el).html($.tmpl(this.template,
a));return this},get_item_content:function(){if(!this.$item_content)this.$item_content=this.$(".item");return this.$item_content},click_private:function(){return this.radio_change("private")},click_public:function(){return this.radio_change("public")},radio_change:function(a){this.$(".css_radio_01").removeClass("selected");this.$("."+a).addClass("selected");this.model.set({privacy:a},{silent:!0});return!1},hide_privacy_controls:function(){this.$(".privacy_controls").hide();return this},show_privacy_controls:function(){this.$(".privacy_controls").show();
return this},show_respond_btn:function(){this.$("a.actbtn").removeClass().addClass("my_messages_list_response_btn actbtn gray_button_02").html("<span class='record_btn_small'> </span> Record");this.$("span.linkbtn").show();return this},show_cancel_btn:function(){this.$("a.actbtn").removeClass().addClass("cancel_response_btn actbtn gray_button").html("Cancel");return this},show_multiple_btn:function(){this.$("span.actbtn").html(this.create_multiple_btn());return this},create_multiple_btn:function(){return this.make("a",
{"class":"add_another_response_btn btn",href:""},"Add another response")},remove_link_btn:function(){this.$("span.linkbtn").hide()},remove_status_line:function(){this.$(".my_messages_list_item_response_bar").hide();$(this.el).css("border-bottom","1px")},show_ignore_link:function(){this.$("span.linkbtn").html(this.make("a",{"class":"my_messages_list_item_ignore",href:""},"Ignore (X)"));return this},show_close_link:function(){this.$("span.linkbtn").html(this.make("a",{"class":"my_messages_list_item_close",
href:""},"Close (X)"));return this},build_close_link:function(){this.get_item_content().prepend("<span class=linkbtn></span>");this.show_close_link()},grey_out:function(){$(this.el).addClass("darkclass")},remove_act_btn:function(){this.$("a.actbtn").html("")},cancel_edit_message:function(){this.$("span.message_text").html(this.make("strong",{},this.model.get("ping_question")));this.$("span.edit_message").html(this.make("a",{href:"#","class":"my_messages_list_item_edit_link"},"edit"));return!1},edit_message:function(){this.$("span.message_text").html(this.make("input",
{type:"text",value:this.model.get("ping_question")},""));this.$("span.edit_message").html("").append(this.make("a",{href:"#","class":"my_messages_list_item_save_link"},"save"),this.make("span",{}," "),this.make("a",{href:"#","class":"my_messages_list_item_cancel_link"},"cancel"));return!1},save_message:function(){var a=this,b=$.trim(this.$("span.message_text > input:first").val());b.length&&$.post("/server/updatemessage",{message_id:this.model.get("ping_id"),new_message:b},function(c){"ERR"==c.status?
"duplicate_message"==c.message?notification("You've already received this message, so it was not saved."):notification("Error updating the message."):"OK"==c.status?(a.model.set({ping_question:b},{silent:!0}),a.cancel_edit_message()):notification("Sorry, something went wrong")});return!1},cancel_response:function(){this.mymessages.get_flash_obj().cancelResponse();this.model.has_responses()?this.show_multiple_btn():(this.show_respond_btn(),this.show_ignore_link());this.show_privacy_controls();this.unselect();
this.list.responding=null;this.list.mr.clear();this.update_status_line();return!1},hide_message:function(){this.list.mr.clear();this.list.responding=null;$(this.el).fadeOut("slow",function(){$(this).remove()});return!1},remove:function(){$(this.el).remove()},show_ignore_dialog:function(){var a=this.get_item_content();a.css("backgroundColor","#fefee6");var b=this.model.get("from_display_name");"Unverified"==b||"Guest User"==b?a.html('<p class="reportingAndBlockingCopy"><a href="" class="report_user">Report this user</a> for abuse. You may also <a href="/mysettings#privacy" target="_blank">change your settings</a> to deny questions from Guest Users.</p>'):
a.html('<p class="reportingAndBlockingCopy">You may also <a href="" class="ignore_all">block this user</a> or <a href="" class="report_user">report this user</a> for abuse.</p>');a.prepend("<span class=linkbtn></span>");this.show_close_link();$(this.el).css("backgroundColor","#fefee6");this.$(".my_messages_list_item_response_bar").html("").css("backgroundColor","#fefee6").css("height",0)},ignore_all:function(){var a=this.get_item_content(),b={};this.model.get("guest_user_id")?b.guest_user_id=this.model.get("guest_user_id"):
b.from_user_id=this.model.get("from_user_id");jQuery.post("/message/ignoreall",b,function(){});a.html(this.make("strong",{},this.model.get("display_name_html")+" blocked"));a.append('<br/><br /><p>You won\'t receive any more messages from this user. You can change these settings <a href="/mysettings#privacy" target="_blank">here</a>.</p>');this.build_close_link();this.list.remove_all_by_user(this.model.get("from_user_id"),this.model.get("ping_id"));return!1},report_user:function(){var a=this.get_item_content();
a.html("<p style='font-size:14px;'>Please select the reason you are reporting this user:</p>");a.append('<br/><select name="reason"><option value="1">Makes me uncomfortable</option><option value="2">Hateful or offensive content</option><option value="3">Harrassment</option><option value="4">Sexual content</option></select>');a.append('<input type="submit" class="submit_report gray_button" value="Submit" />');this.build_close_link();return!1},submit_report:function(){var a=this.$("select option:selected").val();
jQuery.post("/user/report",{reported_user_id:this.model.get("from_user_id"),message_id:this.model.get("ping_id"),reason:a},function(){});a=this.get_item_content();a.html("<p>Thank you for the feedback. We will review the user's account for inappropriate content.</p>");"Unverified"!=this.model.get("from_display_name")&&a.append('<a href="" class="ignore_all">Click here to block this user.</a>');this.build_close_link();return!1},ignore_message:function(){this.model.ignore_message();if(1==this.model.get("starter_message"))return this.hide_message(),
!1;0==this.model.get("anon_avatar")&&this.model.get("from_user_id")!=VY.C.userid?this.show_ignore_dialog():this.hide_message();return!1},unselect:function(){this.model.not_responding();$(this.el).removeClass("selected")},add_another_response:function(){this.model.responding();this.show_cancel_btn();this.hide_privacy_controls();this.update_status_line(!0);this.activate_recorder();return!1},show_responses:function(){var a=this.model.get("responses");a&&0<a.length&&this.list.mr.addall(a)},create_response:function(){if(this.list.responding){var a=
this.list.responding;a.cancel_response();a.model.has_responses()&&(a.remove_act_btn(),a.hide_privacy_controls(),a.show_close_link(),a.grey_out())}this.remove_link_btn();this.list.responding=this;$(this.el).addClass("selected");return this.add_another_response()},activate_recorder:function(){var a=this.model.toJSON(),b="private"==a.privacy?"true":"false",c="1";if(1==a.anonymous)c="3";else if(!a.from_display_name||"Guest User"==a.from_display_name)c="2";var d=this.model.has_responses()?"0":a.id+"",
e=!0==this.model.get("direct_link")?"false":"true",f=this.mymessages.get_flash_obj();$(f).focus();f.recordResponse(a.response_node_id+"",a.ping_id+"",d,a.video_type,b,a.response_number+"",e,a.ping_question,a.from_user_id+"",a.from_display_name,a.from_avatar_name,c,a.prev_message_text||"",a.video_url||"","",a.montage_id+"")},update_status_line:function(a){var b=this.$("span.message_status_line");if(!a)this.model.has_responses()?(a=this.model.get("responses").length,b.html(a+" "+(1<a?"Responses":"Response"))):
b.html("")},done_responding:function(a){this.model.set({response_number:this.model.get("response_number")+1},{silent:!0});this.update_status_line();this.remove_link_btn();this.remove_act_btn();this.list.mr.addone(a);this.unselect();this.grey_out();this.show_close_link();this.hide_message();this.model.trigger("destroy",this.model,this.model.collection,{})}});VY.View.Responded=VY.View.Message.extend({dropdown:!1,template:$("#responded").template(),events:{"click .public":"click_public","click .private":"click_private","click .my_messages_list_record_btn":"rerecord_response","click .my_messages_list_manage_btn":"show_dropdown","click .allow_comments":"allow_comments","click .disallow_comments":"disallow_comments","click .rerecord":"show_rerecord","click .delete":"delete_response","click .cancel_rerecord":"cancel_rerecord","click .cancel_response_btn":"cancel_response",
"mouseover .privacy_info":"show_privacy_info","click .watch_answer":"replay","click .undo_delete":"undo_delete"},undo_delete:function(){this.model.undo_delete(function(){});this.render();return!1},replay:function(){this.get_flash_obj().playbackResponse("http://soon.vyou.com/server/geturl/file_name/"+this.model.get("video_url")+"",this.model.get("description")+"",this.model.get("message"));return!1},allow_comments:function(){this.$(".allow_comments").addClass("disallow_comments").removeClass("allow_comments").html("Disable comments");
return this.set_comments(1)},disallow_comments:function(){this.$(".disallow_comments").addClass("allow_comments").removeClass("disallow_comments").html("Enable comments");return this.set_comments(0)},set_comments:function(a){$.post("/message/setcomments",{allow:a,response_id:this.model.get("response_id")},function(){});return!1},show_asked_info:function(){if(1!=this.model.get("status_update")){var a=this;$(".avatar_asker").tooltip({track:!0,delay:0,showURL:!1,bodyHandler:function(){return"<small>asked "+
time_since(a.model.get("message_created_date")).ago_number+"by: "+a.model.get("from_display_name")+"</small>"},top:20,left:-10,fade:250})}},show_privacy_info:function(){var a=this;this.model.get("show_privacy_tooltip")&&this.$(".privacy_info").tooltip({track:!0,delay:0,showURL:!1,bodyHandler:function(){var b=a.model.get("response_id"),b=a.list.messages.get_private_info(b);return _.map(b,function(a){return a.display_name}).join(", ")},top:20,left:-10,fade:250})},cancel_rerecord:function(){this.list.messages.responding=
null;this.$(".privacy_info").show();this.$(".my_messages_list_manage_btn").show();this.$(".privacy_controls").hide();this.$(".my_messages_list_record_btn").hide();this.$(".cancel_rerecord").hide();this.$(".my_messages_list_manage_btn").show().removeClass("active");$(this.el).removeClass("blueBgr");return!1},done_rerecording:function(){this.cancel_rerecord();return!1},show_dropdown:function(){if(!0==this.dropdown)this.hide_dropdown(),this.$(".my_messages_list_manage_btn").show().removeClass("active");
else{var a=_.find(this.list.messages,function(){});a&&a.view.hide_dropdown();this.dropdown=!0;this.$(".my_messages_manage_dropdown").show().css({display:"block",zIndex:999});this.$(".my_messages_list_manage_btn").addClass("active");$("body").append("<div class='drop_closer' style='width:100%;height:100%;background-color:transparent;left:0;position: absolute;top: 0;z-index:80;'></div>");$(".drop_closer").click(function(){$(".my_messages_manage_dropdown").hide();$(".my_messages_list_manage_btn").removeClass("active");
$(".drop_closer").remove()})}return!1},hide_dropdown:function(){this.dropdown=!1;this.$(".my_messages_manage_dropdown").hide()},show_rerecord:function(){this.$(".privacy_info").hide();this.$(".my_messages_list_manage_btn").hide();this.$(".privacy_controls").show();this.$(".my_messages_list_record_btn").show();this.$(".cancel_rerecord").show();this.hide_dropdown();return!1},cancel_response:function(){this.get_flash_obj().cancelResponse();this.cancel_rerecord()},flash_obj_id:"vyou_recorder",get_flash_obj:function(){var a=
this.flash_obj_id;if(window.document[a])return window.document[a];if(-1==navigator.appName.indexOf("Microsoft Internet")){if(document.embeds&&document.embeds[a])return document.embeds[a]}else return document.getElementById(a)},rerecord_response:function(){this.list.messages.responding=this.model;this.show_cancel_btn();this.hide_privacy_controls();$(this.el).addClass("blueBgr");this.activate_recorder();return!1},activate_recorder:function(){var a=this.model.toJSON(),b="private"==a.privacy?"true":"false",
c="1";1==a.anonymous?c="3":a.display_name||(c="2");var d=this.model.has_responses()?"0":a.id+"",e=!0==this.model.get("direct_link")?"false":"true",f=this.get_flash_obj();$(f).focus();f.rerecordResponse(a.response_node_id+"",a.ping_id+"",d,a.video_type+"",b,a.response_number+"",e,a.message,a.user_id+"",a.display_name,a.avatar_name,c,a.prev_message_text||"",a.video_url||"",a.response_id+"",a.montage_id+"");return!1},delete_response:function(){this.model.delete_response(function(){});$(this.el).html('<div class=\'was_deleted\'> <p>Video has been deleted. <a href="#" class="undo_delete">Undo</a> delete.</p></div>');
return!1},make_public:function(){return this.change_publicity("false")},make_private:function(){return this.change_publicity("true")},change_publicity:function(a){this.model.change_publicity(a);return!1}});VY.View.MessagesList=Backbone.View.extend({responding:null,no_messages_text:"<div class='no_messages'>You have no Questions. </div>",initialize:function(){_.bindAll(this,"addone","addall");this.mr=this.options.mr;this.ptotal=this.options.ptotal;this.messages=this.options.messages;this.mymessages=this.options.mymessages;this.messages.bind("add",this.addone);this.messages.bind("reset",this.addall)},clear_selected:function(){this.messages.each(function(a){a.view.unselect()})},remove_all_by_user:function(a,
b){this.messages.each(function(c){c.get("from_user_id")==a&&c.get("ping_id")!=b&&c.view.remove()})},addone:function(a){a.construct_display_name_html();var b=new VY.View.Message({model:a,list:this});a.view=b;this.el.append(b.render().el)},clear:function(){this.el.html("")},addall:function(){0<this.messages.preclear&&(this.clear(),this.messages.preclear--);0==this.messages.length?this.el.html(this.no_messages_text):this.messages.each(this.addone)}});VY.View.ManageList=VY.View.MessagesList.extend({no_messages_text:"<div class='no_messages'>You have not recorded any responses yet. </div>",addone:function(a){var b=this.messages.get_private_info(a.get("response_id"));a.construct_display_name_html();a.construct_privacy_info_html(b);b=new VY.View.Responded({model:a,list:this});a.view=b;this.el.append(b.render().el)}});VY.View.ResponsesList=Backbone.View.extend({initialize:function(){_.bindAll(this,"addone","addall")},addone:function(a){this.el.append((new VY.View.Response({model:a})).render().el)},addall:function(a){this.clear();_.each(a,this.addone)},clear:function(){this.el.html("")}});VY.View.UsersList=Backbone.View.extend({initialize:function(){_.bindAll(this,"addone","addall");this.users=this.options.users;this.users.bind("add",this.addone);this.users.bind("reset",this.addall);this.users.bind("all",this.render);this.users.fetch({failure:function(a,b){json_notification(b,this.options)}})},hide_one:function(){},hide:function(){this.el.hide();$(".selected_followers").hide()},show:function(){this.el.show();$(".selected_followers").show()},addone:function(a){this.el.append((new VY.View.MiniUser({model:a})).render().el)},
addall:function(){this.el.html("");this.users.each(this.addone)}});VY.View.GroupMessage=Backbone.View.extend({el:$("#grmsg"),events:{"submit form[name=msg]":"text_submit","click .sendspecific":"show_followers","click .sendall":"remove_followers","click .send":"send","click .cancel":"cancel","click #friend_search_submit":"filter_followers","submit form[name=search_followers]":"filter_followers","focus #message_input":"remove_msg","blur #message_input":"add_default_msg"},initialize:function(){_.bindAll(this,"render","text_submit","show_followers","send","cancel");
this.msginput_defval=this.options.msginput_defval;this.srchinput=this.options.srchinput;this.view={};this.render()},render:function(){return this},add_default_msg:function(){var a=this.$("#message_input");a.val().length||a.val(this.options.msginput_defval).addClass("unfocused")},remove_msg:function(){this.$("#message_input").val("").removeClass("unfocused")},text_submit:function(){var a=this.$("input[name=msg]"),b=$.trim(a.val());if(!b.length||b==this.msginput_defval)return a.focus(),!1;this.$(".text").hide();
this.$(".sendto").show();this.$(".sendto > span").html('"'+b+'"');this.msgtext=b;return!1},filter_followers:function(){var a=$.trim(this.options.srchinput.val()).toLowerCase(),b=this.view.followers.users;if(""==a)return b.each(function(a){a.view.hidden&&a.view.show()}),!1;for(var c=a.length,d=b.svec,e=_.keys(d),b=[],f=0;f<e.length;f++){var g=e[f];if(c>g)for(var h=0;h<d[g].length;h++)d[g][h][1].view.hidden||d[g][h][1].view.hide();else b.push(d[g])}for(f=0;f<b.length;f++){c=b[f];for(h=0;h<c.length;h++)d=
b[f][h],-1!=d[0].indexOf(a)?d[1].view.hidden&&d[1].view.show():d[1].view.hidden||d[1].view.hide()}return!1},remove_followers:function(){this.$("#followers_container").hide();this.view.followers&&this.view.followers.hide()},show_followers:function(){var a=this;this.$("#followers_container").show();if(this.view.followers)this.view.followers.show();else{var b=this.$(".followers").html(VY.make("img",{src:VY.C.loading_gif_src})),c=new VY.Collection.UsersList({}),b=new VY.View.UsersList({el:b,errel:this.$(".err"),
users:c});c.bind("reset",function(){var b=0,e=a.$("span.spec_count");c.each(function(a){a.bind("change:selected",function(){!0==a.get("selected")?b++:b--;0>b&&(b=0);e.html("("+b+" People)")})})});b.show();this.view.followers=b}},send:function(){var a=this,b={message:this.msgtext,sendto:this.$("input[name=sendto]:checked").val()};if(this.$("input.sendspecific").is(":checked"))b.followers_ids=[],this.view.followers.users.each(function(a){a.get("selected")&&b.followers_ids.push(a.get("user_id"))});var c=
{targetId:"grmsg_alert",code:"notice_small",onClose:function(){a.$(".text").fadeIn("200")}};$.post("/message/groupmessage",$.param(b),function(a){if("OK"==a.status){var e=VY.MSG.grpmsg.send.format(a.sentnum);a.duplicates?notification(e+VY.MSG.grpmsg.notsend.format(a.duplicates),c):notification(e,c)}else"ALLGOT"==a.reason?(a=notification,0==b.sendto?e=VY.MSG.grpmsg.allrec:1==b.sendto&&(e=1<b.followers_ids.length?VY.MSG.grpmsg.allrec_sel:VY.MSG.grpmsg.onerec),a(e,c)):notification(a.msg,c)});this.cancel();
this.$(".text").hide();this.$("#grmsg_alert").html(VY.make("img",{src:VY.C.loading_gif_src})).append(" <b><span style='padding-top:5px; padding-left:10px; display:block; float:left;'>Sending your message</span></b>");return!1},cancel:function(){this.$(".text").show();this.$(".sendto").hide();this.$("#followers_container").hide();this.$(".sendall").click();this.view.followers&&this.view.followers.users.each(function(a){a.view.unselect_user()});this.remove_msg();this.add_default_msg();return!1}});VY.View.MakeMontage=VY.View.GroupMessage.extend({el:$("#mkmontage"),events:{"click .sendspecific":"show_followers","click input[name=to]:not(.sendspecific)":"remove_followers","submit form":"submit","click #friend_search_submit":"filter_followers","submit form[name=search_followers]":"filter_followers"},submit:function(){var a=this;if(this.$("input.sendspecific").is(":checked")&&this.view.followers){var b=this.view.followers.users.filter(function(a){return!0===a.get("selected")});_.each(b,function(b){b=
$('<input type="hidden" name="selected_followers[]" value="'+b.get("user_id")+'" />');a.$("form").append(b)})}return!0}});VY.View.MyMessages=Backbone.View.extend({flash_obj_id:"vyou_recorder",loading_more:!1,searching:!1,initialize:function(){this.messages=new VY.Collection.MessagesList;this.messages.page=1;this.messages.token=this.options.token;this.messages.ptotal=this.options.total_pages;this.messages.bind("reset",function(a){a.each(function(a){var c=1;null!=a.get("montage_id")&&(c=5);a.set({response_number:1,video_type:c,privacy:"public"})})});this.view=new VY.View.MessagesList({el:this.$("#messages_list"),messages:this.messages,
mr:this.options.mr_widget,mymessages:this});this.search=new Search({type:"record",jsonp:!0,cache:!0,params:{token:this.options.token,order:"message_created_date_desc"}});this.view.can_edit=this.options.can_edit;this.toggle_load_btn()},events:{"keyup input[name=mq]":"messages_search","click #load_more_btn":"load","click #oldest_sort":"osort","click #newest_sort":"nsort","click #refresh":"reset"},get_flash_obj:function(){var a=this.flash_obj_id;if(window.document[a])return window.document[a];if(-1==
navigator.appName.indexOf("Microsoft Internet")){if(document.embeds&&document.embeds[a])return document.embeds[a]}else return document.getElementById(a)},osort:function(){return this.sort("asc")},nsort:function(){return this.sort("desc")},sort:function(a){this.messages.order=a;this.messages.page=1;return this.reset()},select_message:function(a,b){var c=this.messages.filter(function(b){return b.get("ping_id")==a});c&&c[0]&&("private"==b&&c[0].view.click_private(),c[0].set({direct_link:!0},{silent:!0}),
c[0].view.create_response())},reset:function(){this.$("#messages_instantsearch").val("");this.view.clear();this.messages.page=1;this.messages.fetch();return!1},load:function(){var a=this;this.messages.set_next_page();this.show_load_spinner();this.messages.fetch({success:function(){a.toggle_load_btn()},error:function(){a.toggle_load_btn();notification("Error when loading, please try again later")}});return!1},load_more:function(){var a=this;if(!this.loading_more&&!this.searching&&this.messages.has_next_page())$(this.view.el).append(VY.C.loading_img),
this.loading_more=!0,this.messages.set_next_page(),this.messages.fetch({success:function(){$(a.view.el).find(".loading_img").remove();a.loading_more=!1},error:function(){$(a.view.el).find(".loading_img").remove();a.loading_more=!1;notification("Error when loading, please try again later")}})},show_load_spinner:function(){this.$("span#load_more_span").html(this.make("img",{src:VY.C.loading_gif_src},""))},toggle_load_btn:function(){var a=this.$("span#load_more_span");this.messages.page<this.messages.ptotal?
a.html(this.make("a",{href:"#",id:"load_more_btn"},"Load more")):a.html("")},messages_search:function(a){var b=this,a=$.trim($(a.target).val());a.length?(this.searching=!0,this.search.search(a,function(a){"SUCCESS"==a.status&&0<a.data.length?(b.view.clear(),b.messages.reset(a.data)):b.view.el.html('<div class="blank_slate_copy">Your search returned zero results.</div>')})):(this.searching=!1,this.view.clear(),this.messages.page=1,this.messages.fetch())},record_status_update:function(){this.get_flash_obj().recordResponse("",
"","0","4","0","1","true","hello world","","","","","","","","");return!1}});VY.View.Manage=Backbone.View.extend({searching:!1,loading_more:!1,events:{"keyup #manage_msgs_instantsearch":"manage_search"},initialize:function(){this.messages=new VY.Collection.ResponsesList;this.messages.page=1;this.messages.ptotal=this.options.total_pages;this.view=new VY.View.ManageList({el:this.$("#mymsgs_manage_list"),messages:this.messages,mymessages:this});this.search=new Search({server:"184.72.134.167:8092",type:"manage",jsonp:!0,params:{token:this.options.token}})},manage_search:function(a){var b=
this,a=$.trim($(a.target).val());a.length?(b.searching=!0,b.search.search(a,function(a){"SUCCESS"==a.status&&0<a.data.length?(b.view.clear(),b.messages.reset(a.data),b.messages.process_private_info(a.private_info)):b.view.el.html('<div class="blank_slate_copy">Your search returned zero results.</div>')})):(b.searching=!1,b.view.clear(),b.messages.page=1,b.messages.fetch())},load_more:function(){var a=this;if(!this.searching&&!(this.loading_more||this.messages.page>=this.messages.ptotal))$(this.view.el).append(VY.C.loading_img),
this.loading_more=!0,this.messages.set_next_page(),this.messages.fetch({success:function(){$(a.view.el).find(".loading_img").remove();a.loading_more=!1},error:function(){$(a.view.el).find(".loading_img").remove();a.loading_more=!1;notification("Error when loading, please try again later")}})},reset:function(){var a=this;this.view.clear();$(this.view.el).html(VY.C.loading_img);this.messages.set_first_page();this.messages.fetch({success:function(){$(a.view.el).find(".loading_img").remove()}})}});(function(a){function b(b){var e;return b&&b.constructor==Array&&3==b.length?b:(e=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))?[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]:(e=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))?[2.55*parseFloat(e[1]),2.55*parseFloat(e[2]),2.55*parseFloat(e[3])]:(e=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))?[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(b))?[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]:/rgba\(0, 0, 0, 0\)/.exec(b)?c.transparent:c[a.trim(b).toLowerCase()]}a.each("backgroundColor,borderBottomColor,borderLeftColor,borderRightColor,borderTopColor,color,outlineColor".split(","),function(c,e){a.fx.step[e]=function(c){if(!c.colorInit){var d;d=c.elem;var h=e,i;do{i=a.curCSS(d,h);if(""!=i&&"transparent"!=i||a.nodeName(d,"body"))break;h="backgroundColor"}while(d=d.parentNode);
d=b(i);c.start=d;c.end=b(c.end);c.colorInit=!0}c.elem.style[e]="rgb("+[Math.max(Math.min(parseInt(c.pos*(c.end[0]-c.start[0])+c.start[0]),255),0),Math.max(Math.min(parseInt(c.pos*(c.end[1]-c.start[1])+c.start[1]),255),0),Math.max(Math.min(parseInt(c.pos*(c.end[2]-c.start[2])+c.start[2]),255),0)].join()+")"}});var c={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]}})(jQuery);

