$(document).ready(function(){$("img.caption").each(function(i){var imgwidth=$(this).width(),imgheight=$(this).height(),captiontext=$(this).attr('title'),style=$(this).attr('style'),alignment=$(this).attr('align');$(this).attr({align:""});$(this).attr({style:""});$(this).wrap("<span class=\"image-caption-container\" style=\"display:block;"+style+"; float: "+alignment+"\"></span>");$(this).parent().addClass('image-caption-container-'+alignment);if(imgwidth!='undefined'&&imgwidth!=0)$(this).parent().width(imgwidth);$(this).parent().append("<span style=\"display:block;\" class=\"image-caption\">"+captiontext+"</span>")})});
if(Drupal.jsEnabled)$(document).ready(eventAutoAttach)
function eventAutoAttach(){$("#block-event-0 div.content a.updateblock").click(function(){this.blockUpdater=new blockUpdater($(this).parents(".content"),$(this).attr("href").replace("month","block"),eventAutoAttach);return false})}
function blockUpdater(element,url,callback){var blockUpdate=this;element.blockUpdate=this;this.element=element;this.callback=callback;this.oldHTML=this.element.html();this.styleHeight=$(element).height();this.styleWidth=$(element).width();$(element).height(element[0].offsetHeight+"px");$(element).width(element[0].offsetWidth+"px");$(element).html("");this.progress=new Drupal.progressBar('updateprogress');$(this.element).prepend(this.progress.element);var rel=this,cancel=document.createElement("a");$(cancel).html("cancel").attr("alt","cancel").addClass("cancel-update").attr("href","#").bind("click",function(){rel.update("abort",undefined,blockUpdate);return false});this.element.prepend($(cancel));this.dontUpdate=false;$.get(url,function(data){blockUpdate.update(data)})};blockUpdater.prototype.update=function(xmlHttp){var blockUpdate=this;if(!blockUpdate.dontUpdate){if(xmlHttp=='abort'){blockUpdate.element.html(this.oldHTML);blockUpdate.element.append("<p class='calendar-log'>Update aborted.</p>")}else{blockUpdate.element.height(blockUpdate.styleHeight);blockUpdate.element.width(blockUpdate.styleWidth);blockUpdate.element.html(xmlHttp);blockUpdate.dontUpdate=true};blockUpdate.dontUpdate=true;if(blockUpdate.callback!=undefined)blockUpdate.callback()}};

