var D=YAHOO.util.Dom;var E=YAHOO.util.Event;Squarespace.Social={WIDGET_LOAD_COUNTER:0};Squarespace.Social.TwitterWidget=Class.create({initialize:function(B,A){this.moduleId=B;this.twitterers=[];this.tweets=[];this.currentPage=0;this.retryCount=0;this.loading=false;this.loadProperties({preset:"basic-preset",pageSize:2,followMeText:"Follow @username",filter:"",filterType:"any",filterAtReplies:true,filterRetweets:true,maxRetries:8,loadingAnim:"fadeIn",pagingAnim:true},A);Squarespace.Social.WIDGET_LOAD_COUNTER++;},show:function(){var A=this;var B={handleResponse:function(F){var C=YAHOO.lang.JSON.parse(F.getResponse());A.clearError();if(C.statusCode==200){A.tweets=C.data.tweets;A.twitterers=C.data.twitterers;if(A.tweets.length>0){A.loadTwitterers();A.loadTweets(false,false);if(A.loading){A.clearLoading("data");}else{A.showWidget();}}}else{if(C.statusCode==102){if(!A.loading&&A.properties.maxRetries>0){A.showLoading();}if(A.retryCount<A.properties.maxRetries){A.retryCount++;YAHOO.lang.later(3000,A,"show",null,false);}else{A.clearLoading("error");}}else{A.showError();}}}};Squarespace.api.Twitter.getTweets(this.moduleId,this.properties.userIds,{filter:this.properties.filter,filterType:this.properties.filterType,filterAtReplies:this.properties.filterAtReplies,filterRetweets:this.properties.filterRetweets,count:20},B);},showWidget:function(){var B=D.get("twitter-wrapper-"+this.moduleId);D.setStyle(B,"display","block");if(this.properties.loadingAnim=="fadeIn"){if(YAHOO.env.ua.ie){D.setStyle(B,"visibility","visible");}else{D.setStyle(B,"opacity",0);D.setStyle(B,"visibility","visible");var A=new YAHOO.util.Anim(B,{opacity:{from:0,to:1}},0.05,YAHOO.util.Easing.easeNone);A.animate();}}else{D.setStyle(B,"visibility","visible");}Squarespace.Social.WIDGET_LOAD_COUNTER--;if(Squarespace.SectionEditingStripManager&&Squarespace.Social.WIDGET_LOAD_COUNTER==0){Squarespace.SectionEditingStripManager.reposition();}},clearLoading:function(A){this.loading=false;this.retryCount=0;var B=new YAHOO.util.Anim("twitter-loading-wrapper-"+this.moduleId,{opacity:{from:1,to:0}},0.5,YAHOO.util.Easing.easeNone);B.onComplete.subscribe(function(){D.setStyle("twitter-loading-wrapper-"+this.moduleId,"display","none");if(this.animIn){this.animIn.onComplete.unsubscribeAll();this.animOut.onComplete.unsubscribeAll();this.animIn.stop();this.animOut.stop();this.animIn=null;this.animOut=null;}var C=this;if(A==="data"){D.setStyle("twitter-wrapper-"+this.moduleId,"display","block");setTimeout(function(){C.showWidget();},150);}else{if(A==="error"){D.setStyle("twitter-error-wrapper-"+this.moduleId,"display","block");setTimeout(function(){C.showError();},150);}}},this,true);B.animate();},showLoading:function(){this.loading=true;if(!this.animIn){D.setStyle("twitter-wrapper-"+this.moduleId,"display","none");var B=D.get("twitter-loading-wrapper-"+this.moduleId);D.setStyle(B,"display","block");D.setStyle(B,"opacity",1);var A=D.get("twitter-loading-img-"+this.moduleId);this.animIn=new YAHOO.util.Anim(A,{opacity:{from:0.2,to:1}},1,YAHOO.util.Easing.easeNone);this.animIn.onComplete.subscribe(function(){if(!this.animOut){this.animOut=new YAHOO.util.Anim(A,{opacity:{from:1,to:0.2}},1,YAHOO.util.Easing.easeNone);this.animOut.onComplete.subscribe(function(){this.showLoading();},this,true);}this.animOut.animate();},this,true);}this.animIn.animate();},clearError:function(){D.setStyle("twitter-error-wrapper-"+this.moduleId,"opacity",0);D.setStyle("twitter-error-wrapper-"+this.moduleId,"display","none");},showError:function(){this.loading=false;this.retryCount=0;var C=D.get("twitter-error-wrapper-"+this.moduleId);D.setStyle(C,"display","block");D.setStyle(C,"opacity",1);var A=D.get("twitter-error-img-"+this.moduleId);var B=new YAHOO.util.Anim(A,{opacity:{from:0,to:1}},0.05,YAHOO.util.Easing.easeNone);B.animate();},nextPage:function(){this.loadTweets(false,this.properties.pagingAnim);},prevPage:function(){this.loadTweets(true,this.properties.pagingAnim);},loadTweets:function(A,B){this.currentPage=(A?this.currentPage-1:this.currentPage+1);var G=Math.ceil(this.tweets.length/this.properties.pageSize);D.setStyle("twitter-newer-link-"+this.moduleId,"visibility",(this.currentPage==1?"hidden":"visible"));D.setStyle("twitter-older-link-"+this.moduleId,"visibility",(this.currentPage==G?"hidden":"visible"));var H=false;var J=(this.currentPage*this.properties.pageSize)-this.properties.pageSize;for(var F=1;F<=this.properties.pageSize;F++){var I=D.get("tweet-item-"+this.moduleId+"-"+F);if(!H){var K=D.get("tweet-content-"+this.moduleId+"-"+F);if(K){K.innerHTML=this.tweets[J].content;}K=D.get("tweet-avatar-link-"+this.moduleId+"-"+F);if(K){K.href="http://www.twitter.com/"+this.tweets[J].twitterer.username;}K=D.get("tweet-avatar-img-"+this.moduleId+"-"+F);if(K){K.src=this.tweets[J].twitterer.avatar;}K=D.get("tweet-username-link-"+this.moduleId+"-"+F);if(K){K.href="http://www.twitter.com/"+this.tweets[J].twitterer.username;K.innerHTML="@"+this.tweets[J].twitterer.username;}K=D.get("tweet-date-"+this.moduleId+"-"+F);if(K){K.href=this.tweets[J].link;K.innerHTML=Squarespace.Formatting.humanizeDate(this.tweets[J].published.time);}K=D.get("tweet-fullname-link-"+this.moduleId+"-"+F);if(K){K.href="http://www.twitter.com/"+this.tweets[J].twitterer.username;K.innerHTML=this.tweets[J].twitterer.name;}D.batch(this.twitterers,function(L){D.removeClass(I,L.username);});D.addClass(I,this.tweets[J].twitterer.username);D.setStyle(I,"display","block");}else{D.setStyle(I,"display","none");}J++;if(J==this.tweets.length){H=true;}}if(B&&!YAHOO.env.ua.ie){var C=new YAHOO.util.Anim("twitter-page-"+this.moduleId,{opacity:{from:0,to:1}},0.25,YAHOO.util.Easing.easeNone);C.animate();}if(Squarespace.SectionEditingStripManager&&Squarespace.Social.WIDGET_LOAD_COUNTER==0){Squarespace.SectionEditingStripManager.reposition();}},loadTwitterers:function(){for(var A=0;A<this.twitterers.length;A++){var B=D.get("followme-link-"+this.moduleId+"-"+(A+1));if(B){B.href="http://www.twitter.com/"+this.twitterers[A].username;}B=D.get("followme-avatar-img-"+this.moduleId+"-"+(A+1));if(B){B.src=this.twitterers[A].avatar;}B=D.get("followme-text-"+this.moduleId+"-"+(A+1));if(B){B.innerHTML=this.properties.followMeText.replace("@username","@"+this.twitterers[A].username);}B=D.get("twitterer-avatar-link-"+this.moduleId+"-"+(A+1));if(B){B.href="http://www.twitter.com/"+this.twitterers[A].username;}B=D.get("twitterer-avatar-img-"+this.moduleId+"-"+(A+1));if(B){B.src=this.twitterers[A].avatar;}B=D.get("twitterer-fullname-link-"+this.moduleId+"-"+(A+1));if(B){B.href="http://www.twitter.com/"+this.twitterers[A].username;B.innerHTML=this.twitterers[A].name;}B=D.get("twitterer-username-link-"+this.moduleId+"-"+(A+1));if(B){B.href="http://www.twitter.com/"+this.twitterers[A].username;B.innerHTML="@"+this.twitterers[A].username;}}}});var FLICKR_SIZE_THUMBNAIL=75;var FLICKR_SIZE_SQUARE=100;var FLICKR_SIZE_SMALL=240;var FLICKR_SIZE_MEDIUM=500;var FLICKR_URL_THUMBNAIL="thumbnailImageUrl";var FLICKR_URL_SQUARE="squareImageUrl";var FLICKR_URL_SMALL="smallImageUrl";var FLICKR_URL_MEDIUM="mediumImageUrl";Squarespace.Social.FlickrWidget=Class.create({initialize:function(B,A){this.flickrUsers=[];this.moduleId=B;this.retryCount=0;this.loading=false;this.loadProperties({preset:"gridPreset",maxRetries:8},A);Squarespace.Social.WIDGET_LOAD_COUNTER++;},show:function(){var thisWidget=this;var callback={handleResponse:function(obj){var response=YAHOO.lang.JSON.parse(obj.getResponse());if(response.statusCode==200){if(thisWidget.loading){thisWidget.clearLoading();}thisWidget.clearError();if(thisWidget.properties.preset=="grid"){var imageDataArray=new Array();var sidebarWidth=thisWidget.properties.sidebarWidth;var thumbsPerRow=thisWidget.properties.thumbsPerRow;var thumbPadding=thisWidget.properties.thumbPadding;for(var i=0;i<thisWidget.properties.displayCount;i++){var imageData=response.data.images[i];if(YAHOO.lang.isObject(imageData)){var linkElement=D.get("flickr-grid-link-item-"+thisWidget.moduleId+"-"+(i+1));linkElement.href=imageData.imagePageUrl;imageDataArray.push(imageData.smallImageUrl);}}D.setStyle("flickr-wrapper-"+thisWidget.moduleId,"min-height","");D.setStyle("flickr-content-"+thisWidget.moduleId,"min-height","");var preloader=new Squarespace.Social.Preloader();preloader.setModule(thisWidget.moduleId,null,true,sidebarWidth,thisWidget.properties.preset,thumbsPerRow,thumbPadding);preloader.add(imageDataArray);preloader.load();}else{var imageDataArray=new Array();var sidebarWidth=thisWidget.properties.sidebarWidth;var transitionType="";for(var i=0;i<thisWidget.properties.loadCount;i++){var imageData=response.data.images[i];if(YAHOO.lang.isObject(imageData)){var linkElement=D.get("flickr-slide-link-item-"+thisWidget.moduleId+"-"+(i+1));linkElement.href=imageData.imagePageUrl;if(sidebarWidth<=FLICKR_SIZE_THUMBNAIL){imageDataArray.push(eval("imageData."+FLICKR_URL_THUMBNAIL));}else{if(sidebarWidth>FLICKR_SIZE_THUMBNAIL&&sidebarWidth<=FLICKR_SIZE_SQUARE){imageDataArray.push(eval("imageData."+FLICKR_URL_SQUARE));}else{if(sidebarWidth>FLICKR_SIZE_SQUARE&&sidebarWidth<=FLICKR_SIZE_SMALL){imageDataArray.push(eval("imageData."+FLICKR_URL_SMALL));}else{if(sidebarWidth>FLICKR_SIZE_SMALL){imageDataArray.push(eval("imageData."+FLICKR_URL_MEDIUM));}}}}if(thisWidget.properties.showSlideTransition){if(thisWidget.properties.slideTransitionFade){var firstSlideElement=D.get("flickr-container-"+thisWidget.moduleId+"-1");D.addClass(firstSlideElement,"selected-slide");transitionType="fade";}else{if(thisWidget.properties.slideTransitionSwipe){transitionType="swipe";}}}else{var firstSlideElement=D.get("flickr-container-"+thisWidget.moduleId+"-1");D.addClass(firstSlideElement,"selected-slide");transitionType="none";}}}var preloader2=new Squarespace.Social.Preloader();preloader2.setModule(thisWidget.moduleId,transitionType,thisWidget.properties.autoCrop,sidebarWidth,thisWidget.properties.preset,null,null);preloader2.add(imageDataArray);preloader2.load();}Squarespace.Social.WIDGET_LOAD_COUNTER--;if(Squarespace.SectionEditingStripManager&&Squarespace.Social.WIDGET_LOAD_COUNTER==0){Squarespace.SectionEditingStripManager.reposition();}}else{if(response.statusCode==102||response.statusCode==204){if(thisWidget.retryCount==0&&thisWidget.properties.maxRetries>0){thisWidget.showLoading();}if(thisWidget.retryCount<thisWidget.properties.maxRetries){thisWidget.retryCount++;YAHOO.lang.later(3000,thisWidget,"show",null,false);}else{thisWidget.showError();}}else{thisWidget.showError();}}}};Squarespace.api.Flickr.getFeed(this.moduleId,callback);},clearLoading:function(){this.loading=false;this.retryCount=0;var A="flickr-loading-wrapper-"+this.moduleId;var B=new YAHOO.util.Anim(A,{opacity:{from:1,to:0}},0.5);B.onComplete.subscribe(function(){D.setStyle("flickr-loading-wrapper-"+this.moduleId,"display","none");if(this.animIn){this.animIn.onComplete.unsubscribeAll();this.animOut.onComplete.unsubscribeAll();this.animIn.stop();this.animOut.stop();this.animIn=null;this.animOut=null;}},this,true);B.animate();},showLoading:function(){this.loading=true;if(!this.animIn){var A="flickr-loading-wrapper-"+this.moduleId;D.setStyle(A,"display","block");D.setStyle(A,"opacity",0);var C=new YAHOO.util.Anim(A,{opacity:{from:0,to:1}},0.5);C.animate();var B=D.get("flickr-loading-img-"+this.moduleId);this.animIn=new YAHOO.util.Anim(B,{opacity:{from:0.2,to:1}},1,YAHOO.util.Easing.easeNone);this.animIn.onComplete.subscribe(function(){if(!this.animOut){this.animOut=new YAHOO.util.Anim(B,{opacity:{from:1,to:0.2}},1,YAHOO.util.Easing.easeNone);this.animOut.onComplete.subscribe(function(){this.showLoading();},this,true);}this.animOut.animate();},this,true);}this.animIn.animate();},clearError:function(){var A="flickr-error-wrapper-"+this.moduleId;var B=new YAHOO.util.Anim(A,{opacity:{from:1,to:0}},0.5);B.onComplete.subscribe(function(){D.setStyle("flickr-error-wrapper-"+this.moduleId,"display","none");if(this.animIn){this.animIn.onComplete.unsubscribeAll();this.animOut.onComplete.unsubscribeAll();this.animIn.stop();this.animOut.stop();this.animIn=null;this.animOut=null;}},this,true);B.animate();},showError:function(){this.loading=false;this.retryCount=0;this.clearLoading();var A="flickr-error-wrapper-"+this.moduleId;D.setStyle(A,"display","block");D.setStyle(A,"opacity",0);var C=new YAHOO.util.Anim(A,{opacity:{from:0,to:1}},0.5);C.animate();var B=D.get("flickr-error-img-"+this.moduleId);var C=new YAHOO.util.Anim(B,{opacity:{from:0,to:1}},1,YAHOO.util.Easing.easeNone);C.animate();if(this.animIn){this.animIn.onComplete.unsubscribeAll();this.animOut.onComplete.unsubscribeAll();this.animIn.stop();this.animOut.stop();this.animIn=null;this.animOut=null;}}});Squarespace.Social.Preloader=function(){this.unLoadedImages=[];this.loadedImages=[];this.imagesLoaded=0;this.moduleId="";this.transitionType="";this.autoCrop=true;this.sbWidth=0;this.preset="";this.thumbsPerRow=0;this.thumbPadding=0;this.setModule=function(G,I,B,H,F,C,A){this.moduleId=G;this.transitionType=I;this.autoCrop=B;this.sbWidth=H;this.preset=F;this.thumbsPerRow=C;this.thumbPadding=A;},this.add=function(B){if(typeof B=="string"){this.unLoadedImages.push(B);}if(typeof B=="array"||typeof B=="object"){for(var A=0;A<B.length;A++){this.unLoadedImages.push(B[A]);}}},this.load=function(){for(var A=0;A<this.unLoadedImages.length;A++){this.loadedImages[A]=new Image();var B=this;this.loadedImages[A].onload=function(){B.checkLoaded();};this.loadedImages[A].src=B.unLoadedImages[A];}},this.checkLoaded=function(){this.imagesLoaded++;if(this.imagesLoaded==this.unLoadedImages.length){this.onLoaded();}},this.onLoaded=function(){if(this.preset=="grid"){for(var F=0;F<this.loadedImages.length;F++){var K=D.get("flickr-grid-image-item-"+this.moduleId+"-"+(F+1));K.src=this.loadedImages[F].src;var A=this.loadedImages[F].width;var M=this.loadedImages[F].height;var O=150*this.thumbsPerRow;if(this.sbWidth>O){this.sbWidth=O;}var L=Math.floor(this.sbWidth/this.thumbsPerRow);var J;D.setStyle("flickr-grid-wrapper-"+this.moduleId,"width",(L*this.thumbsPerRow)+"px");D.setStyle("flickr-grid-list-item-"+this.moduleId+"-"+(F+1),"width",L+"px");D.setStyle("flickr-grid-list-item-"+this.moduleId+"-"+(F+1),"height",L+"px");D.setStyle("flickr-grid-link-item-"+this.moduleId+"-"+(F+1),"width",(L-(this.thumbPadding*2))+"px");D.setStyle("flickr-grid-link-item-"+this.moduleId+"-"+(F+1),"height",(L-(this.thumbPadding*2))+"px");D.setStyle("thumb-img-wrap-"+this.moduleId+"-"+(F+1),"width",(L-(this.thumbPadding*2))+"px");D.setStyle("thumb-img-wrap-"+this.moduleId+"-"+(F+1),"height",(L-(this.thumbPadding*2))+"px");D.setStyle(K,"position","absolute");if(M<A){J=A/M;D.setStyle(K,"margin-left",(L*J*-0.5)+"px");D.setStyle(K,"margin-top","0px");D.setStyle(K,"height","100%");D.setStyle(K,"width","auto");D.setStyle(K,"left","50%");D.setStyle(K,"top","0");}else{if(A<M){J=M/A;D.setStyle(K,"margin-left","0px");D.setStyle(K,"margin-top",(L*J*-0.5)+"px");D.setStyle(K,"height","auto");D.setStyle(K,"width","100%");D.setStyle(K,"left","0");D.setStyle(K,"top","50%");}else{J=M/A;D.setStyle(K,"margin-left","0px");D.setStyle(K,"margin-top","0px");D.setStyle(K,"height","100%");D.setStyle(K,"width","auto");D.setStyle(K,"left","0");D.setStyle(K,"top","0");}}}}else{for(var F=0;F<this.loadedImages.length;F++){var G=D.get("flickr-slide-"+this.moduleId+"-"+(F+1));G.src=this.loadedImages[F].src;var A=this.loadedImages[F].width;var M=this.loadedImages[F].height;var J;if(this.autoCrop){if(M<A){J=A/M;D.setStyle(G,"margin-left",(this.sbWidth*J*-0.5)+"px");D.setStyle(G,"margin-top","0px");D.setStyle(G,"height",this.sbWidth+"px");D.setStyle(G,"width","auto");D.setStyle(G,"left","50%");D.setStyle(G,"top","0");}else{if(A<M){J=M/A;D.setStyle(G,"margin-left","0px");D.setStyle(G,"margin-top",(this.sbWidth*J*-0.5)+"px");D.setStyle(G,"height","auto");D.setStyle(G,"width",this.sbWidth+"px");D.setStyle(G,"left","0");D.setStyle(G,"top","50%");}else{J=M/A;D.setStyle(G,"margin-left","0px");D.setStyle(G,"margin-top","0px");D.setStyle(G,"height","auto");D.setStyle(G,"width",this.sbWidth+"px");D.setStyle(G,"left","0");D.setStyle(G,"top","0");}}D.setStyle(G,"position","absolute");}else{if(M<A){J=this.sbWidth/A;D.setStyle(G,"margin-left",(this.sbWidth*-0.5)+"px");D.setStyle(G,"margin-top",(M*J*-0.5)+"px");D.setStyle(G,"max-width",this.sbWidth+"px");D.setStyle(G,"max-height",(this.sbWidth*J)+"px");}else{if(A<M){J=this.sbWidth/M;D.setStyle(G,"margin-left",(A*J*-0.5)+"px");D.setStyle(G,"margin-top",(this.sbWidth*-0.5)+"px");D.setStyle(G,"max-width",(this.sbWidth*J)+"px");D.setStyle(G,"max-height",this.sbWidth+"px");}else{J=this.sbWidth/M;D.setStyle(G,"margin-left",(A*J*-0.5)+"px");D.setStyle(G,"margin-top",(this.sbWidth*-0.5)+"px");D.setStyle(G,"max-width",(this.sbWidth*J)+"px");D.setStyle(G,"max-height",this.sbWidth+"px");}}D.setStyle(G,"position","absolute");D.setStyle(G,"left","50%");D.setStyle(G,"top","50%");}if(this.transitionType=="swipe"){var I;var H=false;if(F==this.loadedImages.length-1){I=D.get("flickr-slide-"+this.moduleId+"-pre");H=true;}else{if(F==0){I=D.get("flickr-slide-"+this.moduleId+"-post");H=true;}}if(H){I.src=this.loadedImages[F].src;if(this.autoCrop){if(M<A){J=A/M;D.setStyle(I,"margin-left",(this.sbWidth*J*-0.5)+"px");D.setStyle(I,"margin-top","0px");D.setStyle(I,"height",this.sbWidth+"px");D.setStyle(I,"width","auto");D.setStyle(I,"left","50%");D.setStyle(I,"top","0");}else{if(A<M){J=M/A;D.setStyle(I,"margin-left","0px");D.setStyle(I,"margin-top",(this.sbWidth*J*-0.5)+"px");D.setStyle(I,"height","auto");D.setStyle(I,"width",this.sbWidth+"px");D.setStyle(I,"left","0");D.setStyle(I,"top","50%");}else{J=M/A;D.setStyle(I,"margin-left","0px");D.setStyle(I,"margin-top","0px");D.setStyle(I,"height","auto");D.setStyle(I,"width",this.sbWidth+"px");D.setStyle(I,"left","0");D.setStyle(I,"top","0");}}D.setStyle(I,"position","absolute");}else{if(M<A){J=this.sbWidth/A;D.setStyle(I,"margin-left",(this.sbWidth*-0.5)+"px");D.setStyle(I,"margin-top",(M*J*-0.5)+"px");D.setStyle(I,"max-width",this.sbWidth+"px");D.setStyle(I,"max-height",(this.sbWidth*J)+"px");}else{if(A<M){J=this.sbWidth/M;D.setStyle(I,"margin-left",(A*J*-0.5)+"px");D.setStyle(I,"margin-top",(this.sbWidth*-0.5)+"px");D.setStyle(I,"max-width",(this.sbWidth*J)+"px");D.setStyle(I,"max-height",this.sbWidth+"px");}else{J=this.sbWidth/M;D.setStyle(I,"margin-left",(A*J*-0.5)+"px");D.setStyle(I,"margin-top",(this.sbWidth*-0.5)+"px");D.setStyle(I,"max-width",(this.sbWidth*J)+"px");D.setStyle(I,"max-height",this.sbWidth+"px");}}D.setStyle(I,"position","absolute");D.setStyle(I,"left","50%");D.setStyle(I,"top","50%");}}}}}var C=new YAHOO.util.Anim(D.get("flickr-loading-wrapper-"+this.moduleId),{opacity:{from:1,to:0}},0.5).animate();var N=D.get("flickr-container-"+this.moduleId);var B=new YAHOO.util.Anim(N,{opacity:{from:0,to:1}},0.5);B.animate();D.setStyle("flickr-wrapper-"+this.moduleId,"min-height","");D.setStyle("flickr-content-"+this.moduleId,"min-height","");D.setStyle("flickr-wrapper-"+this.moduleId,"height","");D.setStyle("flickr-content-"+this.moduleId,"height","");Squarespace.Social.Flickr.onImagesPreloaded(this.moduleId);};};Squarespace.Social.RssWidget=Class.create({initialize:function(B,A){this.moduleId=B;this.rssItems=[];this.retryCount=0;this.loading=false;this.loadProperties({pageSize:2,readMoreText:"Read More &rarr;",sourceText:"via",maxRetries:8,loadingAnim:"fadeIn"},A);Squarespace.Social.WIDGET_LOAD_COUNTER++;},show:function(){var A=this;var B={handleResponse:function(F){var C=YAHOO.lang.JSON.parse(F.getResponse());A.clearError();if(C.statusCode==200){A.rssItems=C.data.feedEntries;if(A.rssItems.length>0){A.loadRssItems();if(A.loading){A.clearLoading("data");}else{A.showWidget();}}}else{if(C.statusCode==102){if(!A.loading&&A.properties.maxRetries>0){A.showLoading();}if(A.retryCount<A.properties.maxRetries){A.retryCount++;YAHOO.lang.later(3000,A,"show",null,false);}else{A.clearLoading("error");}}else{A.showError();}}}};Squarespace.api.Rss.getFeed(this.moduleId,this.properties.pageSize,B);},showWidget:function(){var B=D.get("rss-wrapper-"+this.moduleId);D.setStyle(B,"display","block");if(this.properties.loadingAnim=="fadeIn"){if(YAHOO.env.ua.ie){D.setStyle(B,"visibility","visible");}else{D.setStyle(B,"opacity",0);D.setStyle(B,"visibility","visible");var A=new YAHOO.util.Anim(B,{opacity:{from:0,to:1}},0.05,YAHOO.util.Easing.easeNone);A.animate();}}else{D.setStyle(B,"visibility","visible");}Squarespace.Social.WIDGET_LOAD_COUNTER--;if(Squarespace.SectionEditingStripManager&&Squarespace.Social.WIDGET_LOAD_COUNTER==0){Squarespace.SectionEditingStripManager.reposition();}},clearLoading:function(A){this.loading=false;this.retryCount=0;var B=new YAHOO.util.Anim("rss-loading-wrapper-"+this.moduleId,{opacity:{from:1,to:0}},0.5,YAHOO.util.Easing.easeNone);B.onComplete.subscribe(function(){D.setStyle("rss-loading-wrapper-"+this.moduleId,"display","none");if(this.animIn){this.animIn.onComplete.unsubscribeAll();this.animOut.onComplete.unsubscribeAll();this.animIn.stop();this.animOut.stop();this.animIn=null;this.animOut=null;}var C=this;if(A==="data"){D.setStyle("rss-wrapper-"+this.moduleId,"display","block");setTimeout(function(){C.showWidget();},150);}else{if(A==="error"){D.setStyle("rss-error-wrapper-"+this.moduleId,"display","block");setTimeout(function(){C.showError();},150);}}},this,true);B.animate();},showLoading:function(){this.loading=true;if(!this.animIn){D.setStyle("rss-wrapper-"+this.moduleId,"display","none");var B=D.get("rss-loading-wrapper-"+this.moduleId);D.setStyle(B,"display","block");D.setStyle(B,"opacity",1);var A=D.get("rss-loading-img-"+this.moduleId);this.animIn=new YAHOO.util.Anim(A,{opacity:{from:0.2,to:1}},1,YAHOO.util.Easing.easeNone);this.animIn.onComplete.subscribe(function(){if(!this.animOut){this.animOut=new YAHOO.util.Anim(A,{opacity:{from:1,to:0.2}},1,YAHOO.util.Easing.easeNone);this.animOut.onComplete.subscribe(function(){this.showLoading();},this,true);}this.animOut.animate();},this,true);}this.animIn.animate();},clearError:function(){D.setStyle("rss-error-wrapper-"+this.moduleId,"opacity",0);D.setStyle("rss-error-wrapper-"+this.moduleId,"display","none");},showError:function(){this.loading=false;this.retryCount=0;var C=D.get("rss-error-wrapper-"+this.moduleId);D.setStyle(C,"display","block");D.setStyle(C,"opacity",1);var A=D.get("rss-error-img-"+this.moduleId);var B=new YAHOO.util.Anim(A,{opacity:{from:0,to:1}},0.05,YAHOO.util.Easing.easeNone);B.animate();},loadRssItems:function(){for(var A=1;A<=this.properties.pageSize;A++){if(A<=this.rssItems.length){var B=D.get("rss-title-"+this.moduleId+"-"+A);if(B){B.href=this.rssItems[A-1].link;B.innerHTML=this.rssItems[A-1].title;}B=D.get("rss-date-"+this.moduleId+"-"+A);if(B){if(this.rssItems[A-1].publishedOn){B.innerHTML=Squarespace.Formatting.humanizeDate(this.rssItems[A-1].publishedOn.time);}else{B.innerHTML="";}}B=D.get("rss-description-"+this.moduleId+"-"+A);if(B){B.innerHTML=this.rssItems[A-1].description;}B=D.get("rss-read-more-"+this.moduleId+"-"+A);if(B){B.href=this.rssItems[A-1].link;B.innerHTML=this.properties.readMoreText;}B=D.get("rss-author-"+this.moduleId+"-"+A);if(B){B.innerHTML=this.rssItems[A-1].author;}B=D.get("rss-source-text-"+this.moduleId+"-"+A);if(B){B.innerHTML=this.properties.sourceText;}B=D.get("rss-source-"+this.moduleId+"-"+A);if(B){B.href=this.rssItems[A-1].sourceLink;B.innerHTML=this.rssItems[A-1].sourceTitle;}}else{D.setStyle("rss-item-"+this.moduleId+"-"+A,"display","none");}}}});Squarespace.Social.DeliciousWidget=Class.create({initialize:function(B,A){this.moduleId=B;this.deliciousItems=[];this.retryCount=0;this.loading=false;this.loadProperties({delimiter:",",pageSize:2,readMoreText:"Read More &rarr;",maxRetries:8,loadingAnim:"fadeIn",myLinksText:"all of @user's tweets",username:"",feedsource:0,newWindow:false},A);Squarespace.Social.WIDGET_LOAD_COUNTER++;},show:function(){var A=this;var B={handleResponse:function(F){var C=YAHOO.lang.JSON.parse(F.getResponse());A.clearError();if(C.statusCode==200){A.deliciousItems=C.data.links;if(A.deliciousItems.length>0){A.loadDeliciousItems();if(A.loading){A.clearLoading("data");}else{A.showWidget();}}}else{if(C.statusCode==102){if(!A.loading&&A.properties.maxRetries>0){A.showLoading();}if(A.retryCount<A.properties.maxRetries){A.retryCount++;YAHOO.lang.later(3000,A,"show",null,false);}else{A.clearLoading("error");}}else{A.showError();}}}};Squarespace.api.Delicious.getFeed(this.moduleId,this.properties.pageSize,B);},showWidget:function(){var B=D.get("delicious-wrapper-"+this.moduleId);D.setStyle(B,"display","block");if(this.properties.loadingAnim=="fadeIn"){if(YAHOO.env.ua.ie){D.setStyle(B,"visibility","visible");}else{D.setStyle(B,"opacity",0);D.setStyle(B,"visibility","visible");var A=new YAHOO.util.Anim(B,{opacity:{from:0,to:1}},0.05,YAHOO.util.Easing.easeNone);A.animate();}}else{D.setStyle(B,"visibility","visible");}Squarespace.Social.WIDGET_LOAD_COUNTER--;if(Squarespace.SectionEditingStripManager&&Squarespace.Social.WIDGET_LOAD_COUNTER==0){Squarespace.SectionEditingStripManager.reposition();}},clearLoading:function(A){this.loading=false;this.retryCount=0;var B=new YAHOO.util.Anim("delicious-loading-wrapper-"+this.moduleId,{opacity:{from:1,to:0}},0.5,YAHOO.util.Easing.easeNone);B.onComplete.subscribe(function(){D.setStyle("delicious-loading-wrapper-"+this.moduleId,"display","none");if(this.animIn){this.animIn.onComplete.unsubscribeAll();this.animOut.onComplete.unsubscribeAll();this.animIn.stop();this.animOut.stop();this.animIn=null;this.animOut=null;}var C=this;if(A==="data"){D.setStyle("delicious-wrapper-"+this.moduleId,"display","block");setTimeout(function(){C.showWidget();},150);}else{if(A==="error"){D.setStyle("delicious-error-wrapper-"+this.moduleId,"display","block");setTimeout(function(){C.showError();},150);}}},this,true);B.animate();},showLoading:function(){this.loading=true;if(!this.animIn){D.setStyle("delicious-wrapper-"+this.moduleId,"display","none");var B=D.get("delicious-loading-wrapper-"+this.moduleId);D.setStyle(B,"display","block");D.setStyle(B,"opacity",1);var A=D.get("delicious-loading-img-"+this.moduleId);this.animIn=new YAHOO.util.Anim(A,{opacity:{from:0.2,to:1}},1,YAHOO.util.Easing.easeNone);this.animIn.onComplete.subscribe(function(){if(!this.animOut){this.animOut=new YAHOO.util.Anim(A,{opacity:{from:1,to:0.2}},1,YAHOO.util.Easing.easeNone);this.animOut.onComplete.subscribe(function(){this.showLoading();},this,true);}this.animOut.animate();},this,true);}this.animIn.animate();},clearError:function(){D.setStyle("delicious-error-wrapper-"+this.moduleId,"opacity",0);D.setStyle("delicious-error-wrapper-"+this.moduleId,"display","none");},showError:function(){this.loading=false;this.retryCount=0;var C=D.get("delicious-error-wrapper-"+this.moduleId);D.setStyle(C,"display","block");D.setStyle(C,"opacity",1);var A=D.get("delicious-error-img-"+this.moduleId);var B=new YAHOO.util.Anim(A,{opacity:{from:0,to:1}},0.05,YAHOO.util.Easing.easeNone);B.animate();},loadDeliciousItems:function(){for(var C=1;C<=this.properties.pageSize;C++){if(C<=this.deliciousItems.length){var F=D.get("deli-title-"+this.moduleId+"-"+C);if(F){F.href=this.deliciousItems[C-1].sourceUrl;F.innerHTML=this.deliciousItems[C-1].title;}F=D.get("deli-date-"+this.moduleId+"-"+C);if(F){if(this.deliciousItems[C-1].date){d=new Date(this.deliciousItems[C-1].date.time);lastNchars=function(I,J){return I.substring(I.length-J);};var H=lastNchars(("0"+(d.getMonth()+1))+"",2)+"."+lastNchars("0"+(d.getDate()),2)+"."+lastNchars(d.getFullYear()+"",2);F.innerHTML=H;}else{F.innerHTML="";}}F=D.get("deli-desc-"+this.moduleId+"-"+C);if(F){F.innerHTML=this.deliciousItems[C-1].description;F.href=this.deliciousItems[C-1].sourceUrl;if(this.properties.newWindow){F.target="_blank";}}F=D.get("deli-url-"+this.moduleId+"-"+C);if(F){F.innerHTML=this.deliciousItems[C-1].sourceUrl;F.href=this.deliciousItems[C-1].sourceUrl;if(this.properties.newWindow){F.target="_blank";}}F=D.get("deli-mylinks-text-"+this.moduleId);if(F){F.innerHTML=this.properties.myLinksText.replace("@username",this.properties.username);}F=D.get("deli-tags-"+this.moduleId+"-"+C);if(F){result="";if(this.deliciousItems[C-1].tags.length){for(var B=0;B<this.deliciousItems[C-1].tags.length;B++){var A;if(this.feedsource==0&&this.properties.username){A="http://www.delicious.com/"+this.properties.username+"/"+this.deliciousItems[C-1].tags[B];}else{if(this.feedsource==1){A="http://www.delicious.com/popular/"+this.deliciousItems[C-1].tags[B];}else{A="http://www.delicious.com/recent/"+this.deliciousItems[C-1].tags[B];}}var G=this.properties.newWindow?' target="_blank">':">";result+='<a href="'+A+'"'+G+this.deliciousItems[C-1].tags[B]+"</a>";if(B!=this.deliciousItems[C-1].tags.length-1){result+=this.properties.delimiter;}}}F.innerHTML=result;}}else{D.setStyle("deli-item-"+this.moduleId+"-"+C,"display","none");}}}});Squarespace.Social.LocationWidget=Class.create({initialize:function(B,A){this.moduleId=B;this.checkinItems=[];this.retryCount=0;this.loading=false;this.loadProperties({map:null,mapStyle:null,pageSize:2,dateStyle:0,maxRetries:8,newWindow:true,loadingAnim:"fadeIn",username:"",feedsource:0,newWindow:false,showDate:true},A);Squarespace.Social.WIDGET_LOAD_COUNTER++;},show:function(){var A=this;var B={handleResponse:function(G){var C=YAHOO.lang.JSON.parse(G.getResponse());A.clearError();if(C.statusCode==200){A.checkinItems=C.data.checkins;if(A.checkinItems.length>0){if(A.loading){D.setStyle("lw-wrapper-"+A.moduleId,"display","block");D.setStyle("lw-loading-wrapper-"+A.moduleId,"display","none");A.setupMap();A.loadCheckinItems();A.showWidget();}else{A.setupMap();A.loadCheckinItems();A.showWidget();}}}else{if(C.statusCode==102){if(!A.loading&&A.properties.maxRetries>0){A.showLoading();}if(A.retryCount<A.properties.maxRetries){A.retryCount++;YAHOO.lang.later(3000,A,"show",null,false);}else{A.clearLoading("error");}}else{if(C.statusCode==204){if(A.retryCount==0&&A.properties.maxRetries>0){A.showLoading();A.retryCount++;YAHOO.lang.later(3000,A,"show",null,false);}else{if(A.retryCount<A.properties.maxRetries){A.retryCount++;YAHOO.lang.later(3000,A,"show",null,false);}else{A.showWidget();A.clearLoading();for(var F=1;F<=A.properties.pageSize;F++){D.setStyle("lw-item-"+A.moduleId+"-"+F,"display","none");}D.setStyle("lw-nocheckins-"+A.moduleId,"display","block");}}}else{A.showError();}}}}};Squarespace.api.LocationCheckins.getFeed(this.moduleId,this.properties.pageSize,B);},showWidget:function(){var B=D.get("lw-wrapper-"+this.moduleId);D.setStyle(B,"display","block");if(this.properties.loadingAnim=="fadeIn"){if(YAHOO.env.ua.ie){D.setStyle(B,"visibility","visible");}else{D.setStyle(B,"opacity",0);D.setStyle(B,"visibility","visible");var A=new YAHOO.util.Anim(B,{opacity:{from:0,to:1}},0.05,YAHOO.util.Easing.easeNone);A.animate();}}else{D.setStyle(B,"visibility","visible");}Squarespace.Social.WIDGET_LOAD_COUNTER--;if(Squarespace.SectionEditingStripManager&&Squarespace.Social.WIDGET_LOAD_COUNTER==0){Squarespace.SectionEditingStripManager.reposition();}},clearLoading:function(A){this.loading=false;this.retryCount=0;D.setStyle("lw-wrapper-"+this.moduleId,"display","block");D.setStyle("lw-loading-wrapper-"+this.moduleId,"display","none");if(A==="data"){this.showWidget();}else{if(A==="error"){D.setStyle("lw-error-wrapper-"+this.moduleId,"display","block");this.showError();}}var C=new YAHOO.util.Anim("lw-loading-wrapper-"+this.moduleId,{opacity:{from:1,to:0}},0.5,YAHOO.util.Easing.easeNone);var B=this;C.onComplete.subscribe(function(){D.setStyle("lw-loading-wrapper-"+this.moduleId,"display","none");if(this.animIn){this.animIn.onComplete.unsubscribeAll();this.animOut.onComplete.unsubscribeAll();this.animIn.stop();this.animOut.stop();this.animIn=null;this.animOut=null;}var F=this;if(A==="data"){setTimeout(function(){F.showWidget();},150);}else{if(A==="error"){D.setStyle("lw-error-wrapper-"+this.moduleId,"display","block");setTimeout(function(){F.showError();},150);}}},this,true);C.animate();},showLoading:function(){this.loading=true;if(!this.animIn){D.setStyle("lw-wrapper-"+this.moduleId,"display","none");var B=D.get("lw-loading-wrapper-"+this.moduleId);D.setStyle(B,"display","block");D.setStyle(B,"opacity",1);var A=D.get("lw-loading-img-"+this.moduleId);this.animIn=new YAHOO.util.Anim(A,{opacity:{from:0.2,to:1}},1,YAHOO.util.Easing.easeNone);this.animIn.onComplete.subscribe(function(){if(!this.animOut){this.animOut=new YAHOO.util.Anim(A,{opacity:{from:1,to:0.2}},1,YAHOO.util.Easing.easeNone);this.animOut.onComplete.subscribe(function(){this.showLoading();},this,true);}this.animOut.animate();},this,true);}this.animIn.animate();},clearError:function(){D.setStyle("lw-error-wrapper-"+this.moduleId,"opacity",0);D.setStyle("lw-error-wrapper-"+this.moduleId,"display","none");},setupMap:function(){if(!this.properties.mapStyle){return ;}var B={zoom:8,mapTypeControlOptions:{mapTypeIds:[google.maps.MapTypeId.ROADMAP,"custom"]},navigationControl:true,navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL},streetViewControl:false,mapTypeControl:false};var F=new google.maps.Map(document.getElementById("map_canvas-"+this.moduleId),B);var C={name:"Custom"};var A=new google.maps.StyledMapType(this.properties.mapStyle,C);F.mapTypes.set("custom",A);F.setMapTypeId("custom");this.properties.map=F;},showError:function(){this.loading=false;this.retryCount=0;var C=D.get("lw-error-wrapper-"+this.moduleId);D.setStyle(C,"display","block");D.setStyle(C,"opacity",1);var A=D.get("lw-error-img-"+this.moduleId);var B=new YAHOO.util.Anim(A,{opacity:{from:0,to:1}},0.05,YAHOO.util.Easing.easeNone);B.animate();},loadCheckinItems:function(){var I=null;var g=new DateFormat("EEEE, MMMM d, yyyy");this.links=[];this.infowins=[];var N=new google.maps.MarkerImage("/universal/images/config-admin/ico-map-drop-active.png");var V=new google.maps.MarkerImage("/universal/images/config-admin/ico-map-drop-small.png");this.markers=[];var G=new google.maps.LatLngBounds();for(var Y=1;Y<=this.properties.pageSize;Y++){if(Y<=this.checkinItems.length){var C=new Date(this.checkinItems[Y-1].checkinTime.time);if(this.properties.dateStyle==1&&this.properties.showDate){var L=g.format(C);if(I==null||I!=L){var b=D.get("lw-item-"+this.moduleId+"-"+Y);var f=document.createElement("div");D.addClass(f,"lw-day-bar");f.innerHTML=L;D.insertBefore(f,b);D.addClass(b,"highlight");}I=L;}else{if(Y==1){var b=D.get("lw-item-"+this.moduleId+"-"+Y);D.addClass(b,"highlight");}}var U=D.get("lw-date-"+this.moduleId+"-"+Y);var c="";if(U){var a=new DateFormat("hh:mm a").format(C);if(a[0]=="0"){a=a.slice(1);}var M=new DateFormat("MMM dd yyyy").format(C);if(this.properties.dateStyle==2){U.innerHTML=Squarespace.Formatting.humanizeDate(this.checkinItems[Y-1].checkinTime.time);c=Squarespace.Formatting.humanizeDate(this.checkinItems[Y-1].checkinTime.time);}else{if(this.properties.dateStyle==1){U.innerHTML=a;c=M+" "+a;}else{if(this.properties.dateStyle==3){U.innerHTML=M+" "+a;c=M+" "+a;}}}}if(!this.properties.showDate){c="";}var U=D.get("lw-venuename-"+this.moduleId+"-"+Y);var H;var R;var h=this.properties.newWindow?' target="_blank"':"";var X="<a "+h+' href="';if(this.properties.feedsource==0){R="http://www.gowalla.com"+this.checkinItems[Y-1].venueId;H=X+R+'">'+this.checkinItems[Y-1].venueName+"</a>";}else{if(this.properties.feedsource==1){R=" http://www.foursquare.com/venue/"+this.checkinItems[Y-1].venueId;H=X+R+'">'+this.checkinItems[Y-1].venueName+"</a>";}else{if(this.properties.feedsource==2){R="http://www.facebook.com/pages/"+this.checkinItems[Y-1].venueName.replace(/ /gi,"-")+"/"+this.checkinItems[Y-1].venueId;H=X+R+'">'+this.checkinItems[Y-1].venueName+"</a>";}else{R="";H=this.checkinItems[Y-1].venueName;}}}this.links[Y-1]=H;if(U){U.innerHTML=H;}var P;var W=this.checkinItems[Y-1].venueCity;var B=this.checkinItems[Y-1].venueState;if(W.length>0&&B.length>0){P="in "+W+", "+B;}else{if(W.length==0&&B.length==0){P="";}else{P="in "+(W.length>0?W:"")+(B.length>0?B:"");}}var U=D.get("lw-location-"+this.moduleId+"-"+Y);if(U){U.innerHTML=P;}if(this.properties.map){var F=this.checkinItems[Y-1].venueLat;var A=this.checkinItems[Y-1].venueLon;var K=new google.maps.LatLng(F,A);G.extend(K);var S=new google.maps.Marker({position:K,map:this.properties.map,icon:V});var T=new google.maps.InfoWindow({content:'<div class="infoWin"><div class="lw-checkin-infowin highlight" style="background:transparent;"><div class="lw-venue-name-infowin">'+this.links[Y-1]+'</div><div class="infoWinLoc"><span class="lw-date-infowin">'+c+"</span></div></div></div>"});c="";this.infowins[Y-1]=T;this.markers[Y-1]=S;var O=this.properties.map;var J=this;var Q=function(i,e){return function(){for(m in J.infowins){if(J.infowins[m]!=i){J.infowins[m].close();}}for(k in J.markers){if(J.markers[k]!=e){J.markers[k].setIcon(V);J.markers[k].setZIndex(900);}else{J.markers[k].setIcon(N);J.markers[k].setZIndex(1000);}}i.open(O,e);};};google.maps.event.addListener(S,"click",Q(T,S));var Z=D.get("lw-item-"+this.moduleId+"-"+Y);if(Z){Z.lat=F;Z.lon=A;Z.onclick=Q(T,S);}}var U=D.get("lw-venue-icon-img-"+this.moduleId+"-"+Y);if(U){if(this.checkinItems[Y-1].iconUrl.length>0){U.src=this.checkinItems[Y-1].iconUrl;}else{D.setStyle(U,"display","none");}}var U=D.get("lw-venue-icon-"+this.moduleId+"-"+Y);if(U){U.href=R;}var U=D.get("lw-desc-"+this.moduleId+"-"+Y);if(U){U.innerHTML=this.checkinItems[Y-1].checkinMessage;}}else{D.setStyle("lw-item-"+this.moduleId+"-"+Y,"display","none");}}if(this.properties.map){this.properties.map.fitBounds(G);}}});
