/*
 * widgets.js compiled on 2012-02-21 15:15:16 +0100
 */
$.widget("ui.clickable",{_init:function(){var e=this.element;if(this.options.scope)var clickable=$(this.options.scope,e);else var clickable=e;var url=e.dataset("resource_url")+"/clicks";clickable.click(function(){if($.config.env=="production"&&window._gaq!==undefined)_gaq.push(["_trackEvent","Shortcut","Click"]);$.ajax({url:url,type:"post"});return false})}});$.widget("exvo.keywords",{_init:function(){var e=this.element,self=this;var input=$("ul.input",e);this._add_keywords(input,this.options.input);var output=$("ul.output",e);this._add_keywords(output,this.options.output);$("li",e).live("click",function(){$(this).toggleClass("selected")});$("button.add-selected",e).click(function(){self._add_keywords(output,self._remove_selected_keywords(input))});$("button.add-all",e).click(function(){self._add_keywords(output,self._remove_all_keywords(input))});$("button.remove-selected",
e).click(function(){self._add_keywords(input,self._remove_selected_keywords(output))});$("button.remove-all",e).click(function(){self._add_keywords(input,self._remove_all_keywords(output))});$(".add-custom button",e).click(function(){var input=$(".add-custom input",e),keyword=$.trim(input.val());if(keyword.length>0)self._add_keywords(output,[keyword]);input.val("")});$(".add-custom input",e).keypress(function(event){if(event.keyCode=="13")$(".add-custom button",e).click()});this._odd_keywords_styling()},
keywords:function(){return this._keywords($("ul.output",this.element))},_keywords:function(selectable){return $.map($("li",selectable),function(e){return $(e).text()})},_add_keywords:function(selectable,keywords){var current_keywords=this._keywords(selectable);$.each(keywords,function(i,keyword){if(current_keywords.indexOf(keyword)==-1)selectable.append("<li>"+this+"</li>")});this._odd_keywords_styling()},_remove_selected_keywords:function(selectable){return $.map($("li.selected",selectable),function(e){return $(e).remove().text()})},
_remove_all_keywords:function(selectable){return $.map($("li",selectable),function(e){return $(e).remove().text()})},_odd_keywords_styling:function(){var e=this.element;$("ul",e).each(function(){$(this).find("li").removeClass("odd").filter(":odd").addClass("odd")})}});$.extend($.exvo.keywords,{getter:"keywords",defaults:{input:[],output:[]}});$.widget("ui.layout",{_init:function(){var self=this;var e=this.element;self.refresh();$("<div id='notifier' />").appendTo("body");$.notifier=new $.ui.notifier("#notifier");$.notifier._init();$(window).resize(function(){self.refresh()});e.delegate("table","update",function(){$(this).find("tr:odd").addClass("odd");$(this).find("tr:even").addClass("even")});e.delegate(".pane","update",function(){self.refresh()})},refresh:function(){this._resize();this._equalize_cells()},_equalize_cells:function(){var layout=
this.element;layout.find(".row, .bar").each(function(){var cells=$(this).children(".cell");cells.height(cells.maxOuterHeight())})},_resize:function(){var layout=this.element;var viewport=layout.find(".viewport"),window_height=$(window).height();layout.height(window_height);viewport.height(function(){return window_height-layout.children(".bar:visible, #dock:visible").totalOuterHeight()});var main_panes=viewport.children(".pane");main_panes.height(viewport.height());main_panes.each(function(i,pane){var main_pane=
$(pane);var total_static_panes_height=main_pane.find(".pane.static").totalOuterHeight();var dynamic_panes=main_pane.find(".pane:not(.static)");dynamic_panes.each(function(i,pane){$(pane).height((main_pane.height()-total_static_panes_height)/dynamic_panes.length)})});viewport.find(".content.pane").width(function(){return viewport.width()-viewport.find(".side.pane").totalOuterWidth()})}});(function($){$.fn.update=function(){return this.each(function(){$(this).closest(".pane").trigger("update")})}})(jQuery);$.widget("ui.sticky_notifier",{_init:function(){var self=this;self.show_notification(this.options.text);$(window).bind("slide_sticky_notifiers",function(e,index){self.slide_sticky_notifier(index)});self.element.click(function(){self.remove_notification()})},show_notification:function(text){var final_top_position=$(".tool.bar:visible").offset().top+$(".tool.bar:visible").height()+this.sticky_notification_outher_height()*$(".sticky_notifier:visible").length;this.element.html("<p>"+text+"</p><div class='close'></div>").css({"top":final_top_position}).appendTo("body").slideDown("fast")},
remove_notification:function(){var index=this.element.index();$(window).trigger("slide_sticky_notifiers",index);$.widget.prototype.destroy.apply(this,arguments);var slide_position=this.element.offset().top+this.sticky_notification_outher_height();this.element.remove()},slide_sticky_notifier:function(index){var self=this;if($(self.element).index()>=index){var new_top_position=$(self.element).offset().top-$(self.element).outerHeight();$(self.element).css({"top":new_top_position})}},sticky_notification_outher_height:function(){return 42}});
$.widget("ui.notifier",{defaults:{duration:5E3},notice:function(text){this._notify(text,"notice",this.widget())},error:function(text){this._notify(text,"error",this.widget())},warning:function(text){this._notify(text,"warning",this.widget())},sticky_notice:function(text){$("<div class='sticky_notifier'><div>").sticky_notifier({"text":text})},sticky_error:function(text){$("<div class='sticky_notifier error'><div>").sticky_notifier({"text":text})},sticky_warning:function(text){$("<div class='sticky_notifier warning'><div>").sticky_notifier({"text":text})},
clear:function(){this.widget().hide().empty()},_init:function(){var self=this;var widget=this.widget();$(window).resize(function(){self._resize(widget)});self._resize(widget)},widget:function(){return this.element},_resize:function(widget){widget.css("left",function(){return($(window).width()-widget.width())/2})},_notify:function(text,type,widget){var text="<p>"+text+"</p>";widget.html(text).fadeIn().removeClass().addClass(type);setTimeout(function(){widget.fadeOut()},this.defaults.duration)}});$.widget("ui.slideshow",{_init:function(){var self=this;var widget=this.element;$(window).resize(function(){self.resize()});self.resize();if(self.slides().length>1){self.render_buttons();self.buttons().eq(self.current_slide().index()).trigger("click").addClass("current");self.controls().find("button.move").click(function(){$(this).hasClass("prev")?self.current_button().prev().trigger("click"):self.current_button().next().trigger("click")})}},controls:function(){return this.options.controls(this.element)},
pagination:function(){var output=[];$.each(this.slides(),function(i,item){output.push("<button>"+(i+1)+"</button>")});return"<span class='navigation'><button class='move prev'>"+t("dock.slideshow.previous")+"</button><span class='controls'>"+output.join("")+"</span><button class='move next'>"+t("dock.slideshow.next")+"</button></span>"},render_buttons:function(){var self=this,e=self.element;self.controls().html(self.pagination()).find("span.controls button").click(function(){var button=$(this);if(self.is_current(button))return;
self._trigger("slideout",null,{position:self.current_slide().index()});button.addClass("current").siblings().removeClass("current");e.find(".slide").eq(button.index()).addClass("current").siblings().removeClass("current");self.toggle_buttons();e.find(".slides").animate({marginLeft:0-button.index()*e.width()},self.options.duration,self.options.easing,function(){self._trigger("slidein",null,{position:self.current_slide().index()})})})},resize:function(){var widget=this.element;widget.find(".slide").width(widget.width())},
toggle_buttons:function(){var self=this;$.each(self.controls().find("button.move"),function(i,item){var button=$(item);self.is_disabled(button)?button.disable():button.enable()})},slide_to_last:function(){this.buttons().last().trigger("click")},slide_to:function(page){this.buttons().eq(page-1).trigger("click")},last_slide:function(){return this.element.find(".slide").last()},buttons:function(){return this.controls().find("span.controls button")},slides:function(){return this.element.find(".slide")},
current_slide:function(){var slides=this.element.find(".slide");return slides.filter(".current").length>0?slides.filter(".current"):slides.first()},current_button:function(){return this.controls().find("button.current")},is_current:function(button){return button.index()==this.current_button().index()},is_disabled:function(button){if(button.hasClass("prev"))return this.current_button().index()==0;if(button.hasClass("next"))return this.current_button().index()===this.buttons().last().index()},destroy:function(){this.controls().html("");
$.widget.prototype.destroy.apply(this,arguments)}});$.extend($.ui.slideshow,{defaults:{controls:function(widget){return widget.find("span.navigation")}},getter:"current_slide last_slide size"});$.widget("ui.splitter",{_init:function(){var self=this,widget=this.element,top_pane=widget.find(".top"),bottom_pane=widget.find(".bottom"),handle=widget.find(".resize.bar"),top_height=top_pane.attr("height");if(top_height){if(top_height!="auto")top_pane.height(function(){var height=parseInt(top_height);if(height>=self.options.min_height)return height})}else top_pane.height((self.options.height(widget)-widget.find(".bar").height())/2);top_pane.bind("resize",function(){bottom_pane.height(widget.innerHeight()-
top_pane.outerHeight()-widget.find(".bar").height())});$(window).resize(function(){widget.height(self.options.height(widget));top_pane.trigger("resize")}).trigger("resize");handle.bind("mousedown",function(e){if(!handle.length)return false;e.preventDefault();widget.addClass("resizing");widget.bind("mousemove",function(e){var offset=e.originalEvent.clientY-widget.offset().top;min_height=self.options.min_height;if(offset>widget.height()-min_height)top_pane.height(widget.height()-handle.height()).trigger("resize");
else if(offset>min_height&&offset<widget.height()-min_height)top_pane.height(offset).trigger("resize")}).bind("mouseup",function(){widget.unbind("mousemove").unbind("mouseup").removeClass("resizing")})})}});$.extend($.ui.splitter,{defaults:{min_height:100,height:function(e){return e.parents(".pane").height()}}});$.widget("exvo.overlay",{_init:function(){var self=this,e=this.element;$(document).bind("keyup",function(event){if(event.keyCode==27){$(this).unbind(event);e.trigger("close");e.remove()}})},close:function(){e=$.Event("keyup");e.keyCode=27;$(document).trigger(e)}});$.widget("exvo.rollover",{_init:function(){var interval=this.options.interval;if(typeof interval!=="undefined")setInterval(function(){self._go_to_tab(self._current_tab()+1)},interval);var self=this;self._set_current_tab(1);self._set_clones();self.element.find(".scroll.left").click(function(){self._go_to_tab(self._current_tab()-1)});self.element.find(".scroll.right").click(function(){self._go_to_tab(self._current_tab()+1)});$(".roll_previous").click(function(){self._go_to_tab(self._current_tab()-1)});
$(".roll_next").click(function(){self._go_to_tab(self._current_tab()+1)});$(window).resize(function(){self._set_tab_width();self._wrapper().scrollLeft(self._current_tab()*self._wrapper().width())}).trigger("resize");self._wrapper().scrollLeft(this._tab_width())},_set_clones:function(){this._tab_first().before(this._tab_last().clone().addClass("cloned"));this._tab_last().after(this._tab_first().clone().addClass("cloned"))},_set_current_tab:function(value){this._setData("current_tab",value)},_current_tab:function(){return this._getData("current_tab")},
_all_tabs:function(){return this.element.find(".tab")},_tabs_length:function(){return this._tabs().length},_tabs:function(){return this.element.find(".tab:not('.cloned')")},_tab_first:function(){return this._tabs().first()},_tab_last:function(){return this._tabs().last()},_tab_width:function(){return this._tab_first().outerWidth()},_set_tab_width:function(){this._all_tabs().width(this._wrapper().width())},_wrapper:function(){return this.element.find(".roll")},_go_to_tab:function(tab){var self=this;
var dir=tab<self._current_tab()?-1:1;var left=self._tab_width()*dir;self._wrapper().filter(":not(:animated)").animate({scrollLeft:"+="+left},self.options.speed||500,function(){if(tab==0){self._wrapper().scrollLeft(self._tab_width()*self._tabs_length());tab=self._tabs_length()}else if(tab>self._tabs_length()){self._wrapper().scrollLeft(self._tab_width());tab=1}var next_tab=tab+1;var previous_tab=tab-1;if(tab==1)previous_tab=self._tabs_length();if(tab==self._tabs_length())next_tab=1;var current_tab=
self._current_tab();var next_tab=$(self._tabs()[next_tab-1]).attr("data-name");var previous_tab=$(self._tabs()[previous_tab-1]).attr("data-name");$(".roll_previous").removeClass("music apps teams exvo pics sites").addClass(previous_tab);$(".roll_next").removeClass("music apps teams exvo pics sites").addClass(next_tab);self._set_current_tab(tab)})}});$.widget("ui.switchable",{_init:function(){var self=this,e=this.element,options=this.options;if(e.hasClass(options.active_class))self.set_state("on");e.bind("switchableon",function(){e.addClass(options.active_class)}).bind("switchableoff",function(){e.removeClass(options.active_class)});e.click(function(event){var current_state=self._getData("state")=="off"?"on":"off";self._setData("state",current_state);if(current_state=="on"){var rel=e.attr("rel");if(rel)$("*[rel="+rel+"]").not(e).filter("."+options.active_class).switchable("change",
"off")}self._trigger(current_state);event.stopPropagation();return false})},change:function(state){this._setData("state",state);this._trigger(state)},set_state:function(state){this._setData("state",state)}});$.extend($.ui.switchable,{defaults:{state:"off",active_class:"current"},setter:"change set_state"});$.widget("ui.transit",{_init:function(){var size=this.item_size();this.options.item={width:size[0],height:size[1]}},container:function(){return $(this.options.container)},group_count:function(){return Math.max(2,this.items_in_row())*Math.max(1,this.items_in_column())},push:function(){var self=this,items_per_slide=in_groups_of(this.group_count(),this.items()),container=self.container();container.empty();$(items_per_slide).each(function(){$("<div class='slide' />").append(this).appendTo(container)});
this.element.trigger("change",{width:this.row_width()})},item_size:function(){return this.element.dataset("item-size").split("x")},items:function(){return this.element.find(".item")},items_in_row:function(){return Math.floor($(this.options.size_from).width()/this.options.item.width)},items_in_column:function(){return Math.floor($(this.options.size_from).height()/this.options.item.height)},row_width:function(){return this.options.item.width*this.items_in_row()}});$.widget("exvo.view",{_init:function(){var self=this,e=this.element,overlay=$("<div class='overlay' />"),viewer=$("<div class='viewer'><button class='close'></button></div>"),provider=this.providers[e.dataset("provider")],embed=$(provider.embed_code);embed.attr("src",$.nano(provider.src,{id:e.dataset("id")})).attr("width",provider.width).attr("height",provider.height).appendTo(viewer);viewer.appendTo(overlay).width(provider.width);if(e.dataset("provider")=="iframe")viewer.addClass("with_iframe");
e.click(function(){viewer.find("button.close").click(function(){overlay.overlay("close")});overlay.appendTo("body").overlay();viewer.css("margin-top",($(window).height()-viewer.height())/2)})},providers:{flickr:{embed_code:"<img />",width:480,height:320,src:"{id}"},youtube:{embed_code:"<iframe class='youtube-player' type='text/html' frameborder='0' />",width:480,height:320,src:"http://www.youtube.com/embed/{id}"},iframe:{embed_code:"<iframe/>",width:650,height:620,src:"{id}"}}});$.widget("exvo.toggle_popup",{_init:function(){var self=this;var e=self.element;self.options.overlay=$("<div class='overlay'></div>");if(this.options.multi){var popup=$(this.options.popup).not(".clone").clone(true);popup.addClass("clone")}else var popup=$(this.options.popup);this._setData("popup",popup);popup.appendTo("body");if(self.options.modal&&self.options.clickOverlayToClose)self.options.overlay.click(function(){self.close(e,popup,self)});if(self.options.escapeable)$(document).keydown(function(e){if(e.keyCode==
27)self.close(e,popup,self)});popup.find(".close").click(function(){self.close(e,popup,self)});e.click(function(){if(popup.is(":visible"))self.close(e,popup,self);else self.open(e,popup,self);return false});if(self.options.startOpen)if(popup.not(":visible"))self.open(e,popup,self);$(window).resize(function(){self.position_popup()})},open:function(e,popup,self){if(self.options.modal)self.options.overlay.appendTo("body");self.options.before_show(e,popup,self);self.options.around_show(e,popup,self);
popup.show();self.position_popup();self.options.after_show(e,popup,self)},close:function(e,popup,self){if(self.options.modal)self.options.overlay.detach();popup.hide();self.options.around_show(e,popup,self);self.options.after_hide(e,popup,self)},position_popup:function(){this._set_on(this.options.placement)||this._set_on("left")||this._set_on("top")||this._set_on("right")||this._set_on("bottom")||this._set_stiffly()},_popup_width:function(){return this.options.width!="auto"?this.options.width:$(this._getData("popup")).outerWidth()},
_popup_height:function(){return this.options.height!="auto"?this.options.height:$(this._getData("popup")).outerHeight()},_target_top:function(){return this.element.offset().top},_target_left:function(){return this.element.offset().left},_target_bottom:function(){return this._target_top()+this.element.outerHeight()},_target_right:function(){return this._target_left()+this.element.outerWidth()},_target_horizontal_center:function(){return this.element.outerWidth()/2},_target_vertical_center:function(){return this.element.outerHeight()/
2},_right_max:function(){return $(document).width()-this.options.padding},_bottom_max:function(){return $(document).height()-this.options.padding},_set_on:function(mode){switch(mode){case "left":return this._on_left();break;case "right":return this._on_right();break;case "top":return this._on_top();break;case "bottom":return this._on_bottom();break}},_on_left:function(){var top=this._target_top()+this._target_vertical_center()-this._popup_height()/2;var left=this._target_left()-this._popup_width()-
14;var arrow_x=this._popup_width();if(left<this.options.padding)return false;else{this._tailor_vertically(left,top,arrow_x,"left");return true}},_on_right:function(){var top=this._target_top()+this._target_vertical_center()-this._popup_height()/2;var left=this._target_right()+14;var arrow_x=-15;if(this._target_right()+this._popup_width()>this._right_max())return false;else{this._tailor_vertically(left,top,arrow_x,"right");return true}},_on_top:function(){var left=this._target_left()+this._target_horizontal_center()-
this._popup_width()/2;var top=this._target_top()-this._popup_height()-14;var arrow_y=this._popup_height();if(this.options.padding+this._popup_height()>this._target_top())return false;else{this._tailor_horizontally(left,top,arrow_y,"top");return true}},_on_bottom:function(){var left=this._target_left()+this._target_horizontal_center()-this._popup_width()/2;var top=this._target_bottom()+14;var arrow_y=-14;if(this._bottom_max()<this._target_bottom()+this._popup_height())return false;else{this._tailor_horizontally(left,
top,arrow_y,"bottom");return true}},_tailor_vertically:function(left,top,arrow_x,mode){var bottom=top+this._popup_height();var arrow_y=this._popup_height()/2-13;if(top<this.options.padding){var arrow_y=arrow_y+top-this.options.padding;var top=this.options.padding}else if(bottom>this._bottom_max()){var shift_x=bottom-this._bottom_max();var top=top-shift_x;var arrow_y=arrow_y+shift_x}this._set_arrow(arrow_x,arrow_y,mode);this._move_popup_to(left,top)},_tailor_horizontally:function(left,top,arrow_y,
mode){var right=left+this._popup_width();var arrow_x=this._popup_width()/2-12;if(left<this.options.padding){var arrow_x=arrow_x+left-this.options.padding;var left=this.options.padding}else if(right>this._right_max()){var shift_x=right-this._right_max();var left=left-shift_x;var arrow_x=arrow_x+shift_x}this._set_arrow(arrow_x,arrow_y,mode);this._move_popup_to(left,top)},_set_stiffly:function(){var top=this._target_top()+this._target_vertical_center()-this._popup_height()/2;var left=this._target_left()-
this._popup_width()-14;var arrow_x=this._popup_width();var arrow_y=this._popup_height()/2-13;this._move_popup_to(left,top);this._set_arrow(arrow_x,arrow_y,"left");return true},_set_arrow:function(arrow_x,arrow_y,mode){var arrow=$(this.options.popup).find(".arrow");switch(mode){case "top":var color="#84909C";break;case "bottom":var color="#44505A";break;default:var color="black"}arrow.removeClass().addClass(mode+" arrow").css({"left":arrow_x,"top":arrow_y,"color":color})},_move_popup_to:function(left,
top){var options=this.options;var popup=$(this._getData("popup"));popup.css({"height":options.height,"width":options.width,"top":top,"left":left})}});$.extend($.exvo.toggle_popup,{defaults:{popup:"",height:"auto",width:"auto",padding:20,placement:"right",modal:false,multi:false,escapeable:true,clickOverlayToClose:true,startOpen:false,before_show:function(element,popup,self){},around_show:function(element,popup,self){},after_show:function(element,popup,self){},after_hide:function(element,popup,self){}}});$.templates=$.templates||{};$.templates.cfs_limits_popup={};$.templates.cfs_limits_popup.basic="<div class='popup_container light cfs_limits'>   <div class='arrow'></div>   <div class='top_block'>     <div class='close'></div>     <span class='buttongroup'>       <button class='ice' id='storage'>{dock.cfs_limits.storage}</button>       <button class='ice' id='bandwidth'>{dock.cfs_limits.bandwidth}</button>     </span>   </div>   <div class='tab' data-type='storage_percentage'>     <div class='row'>       <span class='storage_progressbar' id='progressbar'></span>     </div>     <div class='row'>       <div class='cells left'>{dock.cfs_limits.basic}</div>       <div class='cells right'>         <span id='storage_used'></span>         GB         {dock.cfs_limits.of}         <span id='storage_limit'></span>         GB         {dock.cfs_limits.used}       </div>     </div>   <div class='row exceed_message'>     {dock.cfs_limits.exceed_storage_1}     <br>     {dock.cfs_limits.exceed_storage_2}   </div> </div> <div class='tab' data-type='transfer_percentage'>   <div class='row'>     <span class='transfer_progressbar' id='progressbar'></span>   </div>   <div class='row'>     <div class='cells left'>       {dock.cfs_limits.basic}     </div>     <div class='cells right'>       <span id='transfer_used'></span>         GB         {dock.cfs_limits.of}         <span id='transfer_limit'></span>         GB         {dock.cfs_limits.used}       </div>     </div>     <div class='row exceed_message'>       {dock.cfs_limits.exceed_transfer_1}       <br>       {dock.cfs_limits.exceed_transfer_2}     </div>   </div> </div>";
$.templates.cfs_limits_popup.premium="<div class='popup_container light cfs_limits'>   <div class='arrow'></div>   <div class='top_block'>     <div class='close'></div>     <span class='buttongroup'>       <button class='ice' id='storage'>{dock.cfs_limits.storage}</button>       <button class='ice' id='bandwidth'>{dock.cfs_limits.bandwidth}</button>     </span>   </div>   <div class='tab' data-type='storage_percentage'>     <div class='row premium'>       {dock.cfs_limits.premium_account}     </div>     <div class='row unlimited'>       {dock.cfs_limits.unlimited_storage}     </div>   </div>   <div class='tab' data-type='transfer_percentage'>     <div class='row premium'>       {dock.cfs_limits.premium_account}     </div>     <div class='row unlimited'>        {dock.cfs_limits.unlimited_bandwith}     </div>   </div> </div>";
$.widget("exvo.cfs_limits",{_init:function(){var self=this;$(self.element).toggle_popup({"width":300,"height":190,"popup":self.popup_html(),"placement":"top","multi":true,before_show:function(element,popup,widget){$(self.element).addClass("on");self.set_popup($(popup));self.bind_change_tab_click();self.bind_action_on_window_resize();if(self.has_basic_plan())self.initialize_values()},after_show:function(){self.activate_first()},after_hide:function(){$(self.element).removeClass("on")}})},popup_html:function(){var self=
this;if(self.has_premium_plan())return $.compile_i18n_template($.templates.cfs_limits_popup.premium);else return $.compile_i18n_template($.templates.cfs_limits_popup.basic)},bind_action_on_window_resize:function(){var self=this;$(window).resize(function(){self.resize_popup()})},bind_change_tab_click:function(){var self=this;self.buttons().click(function(){var index=self.buttons().index(this);self.show_tab(index);$(this).addClass("current").siblings().removeClass("current")})},has_basic_plan:function(){var plan=
window.user["user"]["plan"];return plan=="basic"?true:false},has_premium_plan:function(){var plan=window.user["user"]["plan"];return plan=="premium"?true:false},set_popup:function(popup){this._setData("popup",popup)},tabs:function(){return this.popup().find(".tab")},activate_first:function(){this.buttons().first().trigger("click")},active_tab:function(){return this.popup().find(".tab.on")},show_tab:function(index){this.tabs().removeClass("on").hide();this.tabs().eq(index).addClass("on").show();this.resize_popup()},
is_limit_exceeded:function(){var type=this.active_tab().dataset("type");if(this.cfs_data()[type]>=100)return true;else return false},resize_popup:function(){var self=this;if(self.has_basic_plan()&&self.is_limit_exceeded()){self.show_exceed_message();self.set_big_size()}else{self.hide_exceed_message();self.set_small_size()}},set_small_size:function(){var current_height=this.popup().height();if(current_height>120){var top=this.popup().offset().top+70;this.set_size(top,120)}},set_big_size:function(){var current_height=
this.popup().height();if(current_height<190){var top=this.popup().offset().top-70;this.set_size(top,190)}},set_size:function(top,height){this.popup().offset({top:top});this.popup().height(height);this.arrow().css({top:height})},hide_exceed_message:function(){this.active_tab().find(".exceed_message").hide()},show_exceed_message:function(){this.active_tab().find(".exceed_message").show()},popup:function(){return this._getData("popup")},arrow:function(){return this.popup().find(".arrow")},buttons:function(){return this.popup().find(".buttongroup button")},
cfs_data:function(){return window.user["user"]["cfs_limits"]},initialize_values:function(popup){this.initialize_storage_progressbar();this.initialize_transfer_progressbar();this.initialize_storage_used();this.initialize_transfer_used();this.initialize_storage_limit();this.initialize_transfer_limit()},initialize_storage_progressbar:function(){this.storage_progressbar().progressbar({value:this.storage_percentage()})},initialize_transfer_progressbar:function(){this.transfer_progressbar().progressbar({value:this.transfer_percentage()})},
initialize_storage_used:function(){var storage_used=this.cfs_data()["storage_used"]/(1024*1024*1024);storage_used=this.round_number(storage_used);if(storage_used>=this.storage_limit())storage_used=this.storage_limit();this.storage_container().html(storage_used)},initialize_transfer_used:function(){var transfer_used=this.cfs_data()["transfer_used"]/(1024*1024*1024);transfer_used=this.round_number(transfer_used);if(transfer_used>=this.transfer_limit())transfer_used=this.transfer_limit();this.transfer_container().html(transfer_used)},
initialize_storage_limit:function(){this.storage_limit_container().html(this.storage_limit())},initialize_transfer_limit:function(){this.transfer_limit_container().html(this.transfer_limit())},round_number:function(number){return Math["round"](number*100)/100},storage_progressbar:function(){return this.popup().find(".storage_progressbar")},transfer_progressbar:function(){return this.popup().find(".transfer_progressbar")},storage_limit:function(){return this.cfs_data()["storage_limit"]/(1024*1024*
1024)},transfer_limit:function(){return this.cfs_data()["transfer_limit"]/(1024*1024*1024)},storage_limit_container:function(){return this.popup().find("#storage_limit")},transfer_limit_container:function(){return this.popup().find("#transfer_limit")},storage_container:function(){return this.popup().find("#storage_used")},transfer_container:function(){return this.popup().find("#transfer_used")},storage_percentage:function(){return this.cfs_data()["storage_percentage"]},transfer_percentage:function(){return this.cfs_data()["transfer_percentage"]}});
