text: (function(){var y;var s;var A=false;var u;var D=300;var t=350;$(document).ready(function(){y=$(".calendar-table");y.on("click","a.calendar-cell",function(a){var b=$(this);if(!b.hasClass("squarebox-external-link")){a.preventDefault();if(!s){a.stopPropagation();r(b.attr("href"))}}});$(window).resize(p);$("body").on("click","#squarebox-overlay",function(){v()});$("a.calendar-cell").hover(function(){var b=$(this);var c=b.attr("class");var a=c.match(/cc-group-\d+/);if(a){var d=$("a."+a);d.each(function(){$(this).data("original-style",$(this).attr("style"))});d.css({opacity:0.9,"background-color":b.css("background-color")});b.css("opacity",1)}},function(){var b=$(this);var c=b.attr("class");var a=c.match(/cc-group-\d+/);if(a){var d=$("a."+a);d.each(function(){$(this).attr("style",$(this).data("original-style"))})}});B();$(window).resize(B);$(document).on("updateLayout",B);z();$(window).resize(z);$(document).on("updateLayout",z)});function r(b){var a=$("#calendar-squarebox-template");if(a.length){C(a.html())}else{C('<div class="padded">...</p>')}s.clearQueue().delay(D).queue(function(){$.ajax({cache:false,data:{ajax:true},dataType:"html",error:function(){if(s&&!A){window.location.href=b}},success:function(c){if(s&&!A){C(c);s.find(".no-ajax").remove();s.find(".datepicker").datepicker();s.find(".inline-label-container").each(function(){updateInlineLabel($(this))});p();s.on("click","a.squarebox-internal-link",function(d){d.preventDefault();r($(this).attr("href"))});s.on("click","a.squarebox-close-link",function(d){d.preventDefault();v()})}},url:b});$(this).dequeue()})}function x(){if(!u){u=$('<div id="squarebox-overlay"></div>').css({position:"absolute","z-index":1532,opacity:0,width:$(document).width(),height:$(document).height(),left:0,top:0,background:"#333"});$("body").prepend(u)}if(!s){s=$('<div class="panel"></div>').css({position:"absolute","z-index":1536});$("body").prepend(s)}}function C(a){x();s.clearQueue();s.css("opacity",0.01);s.html(a);p();s.fadeTo(t,1);q()}function p(){if(s){var a;if($("body").height()>$(window).height()){a=window}else{a=y}s.position({my:"center",at:"center",of:a})}}function v(){if(s){A=true;s.clearQueue().fadeOut(t,function(){if(s){s.remove();s=undefined}A=false});w()}}function q(){if(u){u.clearQueue().fadeTo(t,0.75)}}function w(){if(u){u.clearQueue().fadeTo(t,0,function(){if(u){u.remove();u=undefined}})}}function B(){var b=$("#calendar").width();var c=$(".calendar-time-col, .calendar-square-col").width();var a=$(".calendar-date-col:visible");if(b&&c&&a.length){a.width(Math.floor((b-c)/a.length))}}function z(){$(".calendar-date-col").each(function(c){var o=$(this);var a=[];o.find(".cc-event").each(function(){var F=$(this).attr("class");var E=F.match(/cc-group-\d+/);if(E){if($.inArray(E,a)===-1){a.push(E)}}});var k=a.length;for(var m=0;m<=k;m++){var f=a[m]+"";var j=o.find("."+f+":first");var I=o.find("."+f+":last");var e=j.position();var J=I.position();if(e&&J){var g=Math.floor(e.left)-1;var l=Math.floor(e.top)-1;var n=Math.ceil(J.left)+1;var H=Math.ceil(J.top)+1;var b=Math.round((n+I.outerWidth())-g);var d=Math.round((H+I.outerHeight())-l);var h=$("#"+f+"-overlay-"+c);if(!h.length){h=j.clone();h.appendTo(j.closest("td"));h.attr("id",f+"-overlay-"+c);h.removeClass(f)}var i=h.find(".cc-label");h.css({position:"absolute","z-index":128,left:g,top:l,width:b,height:d,padding:0});i.css({height:"auto","font-size":"12px","line-height":1.5});i.css({position:"relative",top:Math.round((d/2)-(i.height()/2))})}}})}})();