TOCYearsManager=Class.create();TOCYearsManager.prototype={initialize:function(myGlobalId,toc,parentId)
{this.id=myGlobalId;this.toc=toc;this.parentId=parentId;this.albumsListingManagerId=null;this.nSlots=toc.useDoubleYears?3:5;this.featuredImagesManager=null;this.imgCache=new ImageCache();this.toc.yearChangedEvent.subscribe(this.onYearChanged,null,this);setTimeout(Common_String_Format("{0}.precacheAll()",this.id),7500);},onYearChanged:function(obj)
{if(this!=obj.source)
this.moveToYear(obj.year);},clear:function()
{Common_RemoveChildrenN(this.parentId);},moveBack:function(fromClick)
{var currentIndex=this.toc.getYearIndex(this.firstYear);var newIndex=Math.max((Math.floor(currentIndex/this.nSlots)*this.nSlots)-this.nSlots,0);this.moveToIndex(newIndex,fromClick);},moveForward:function(fromClick)
{var currentIndex=this.toc.getYearIndex(this.firstYear);var newIndex=Math.min((Math.floor(currentIndex/this.nSlots)*this.nSlots)+this.nSlots,(Math.floor(this.toc.years.length/this.nSlots)*this.nSlots));this.moveToIndex(newIndex,fromClick);},moveToIndex:function(index,fromClick)
{this.toc.setCurrentYearAndOffset(this.toc.years[index].year,0,this);var firstYearIndex=Math.floor(index/this.nSlots)*this.nSlots;this.firstYear=this.toc.getYearAtIndex(firstYearIndex);this.draw();},moveToYear:function(year,fromClick)
{var index=this.toc.getYearIndex(year);this.moveToIndex(index,fromClick);},precacheAll:function()
{if(isRenderedStyle(TOC_StyleId)==false)
return;for(i=0;i<this.toc.years.length;i++)
{var year=this.toc.years[i].year;if(year!=9999){this.imgCache.loadImage(Common_String_Format("/psimages/shared/Year{0}{1}.{2}.{3}.gif","White",this.toc.useDoubleYears?"2":"",this.toc.styleId,year),null,null);this.imgCache.loadImage(Common_String_Format("/psimages/shared/Year{0}{1}.{2}.{3}.gif","Black",this.toc.useDoubleYears?"2":"",this.toc.styleId,year),null,null);}
else{this.imgCache.loadImage(TOC_TAYWhiteUrl,null,null);this.imgCache.loadImage(TOC_TAYBlackUrl,null,null);}}},redraw:function()
{this.moveToYear(this.toc.getCurrentYear(),false);},draw:function()
{var parent=document.getElementById(this.parentId);this.clear();if(this.toc.getFirstYear()==null)
{return;}
var isFirstYear=this.firstYear==this.toc.getFirstYear();var imgSrc;if(!isFirstYear)
{var li=document.createElement("li");var anchor=document.createElement("a");anchor.href=Common_String_Format("javascript:{0}.moveBack(true)",this.id);anchor.className="yearheader-left-arrow";var img=document.createElement("img");img.style.height="25px";img.style.width="10px";img.src="/psimages/clearpixel.gif";anchor.appendChild(img);li.appendChild(anchor);parent.appendChild(li);}
var year=this.firstYear;var previousYear=-1;var years=0;do
{var li=document.createElement("li");var anchor=document.createElement("a");anchor.href=Common_String_Format("javascript:{0}.moveToYear({1}, true)",this.id,year);anchor.offset=0;anchor.year=year;anchor.count=15;if(isRenderedStyle(TOC_StyleId))
{var whiteBlack=year!=this.toc.currentYear?"White":"Black";var alt;imgSrc;if(year!=9999)
imgSrc=Common_String_Format("/psimages/shared/Year{0}{1}.{2}.{3}.gif",whiteBlack,this.toc.useDoubleYears?"2":"",this.toc.styleId,year);else
imgSrc=(year!=this.toc.currentYear)?TOC_TAYWhiteUrl:TOC_TAYBlackUrl;if(year<9999)
{alt=year;}
else
{alt='"'+TOC_TimelessHeader+'"';}
var img=this.imgCache.loadImage(imgSrc,null,null,true);img.alt=img.title=alt;anchor.appendChild(img);li.appendChild(anchor);}else{if(year!=9999){anchor.innerHTML="<span class='"+((year!=this.toc.currentYear)?"yearheader":"yearheaderselected")+"'>"+year+"</span>";}else{anchor.innerHTML="<span class='"+((year!=this.toc.currentYear)?"yearheader":"yearheaderselected")+"'>"+TOC_TimelessHeader+"</span>";}
li.appendChild(anchor);}
parent.appendChild(li);previousYear=year;year=this.toc.getNextYear(year);if(year==null)
break;years++;}
while(years<this.nSlots);var moreYearsToShow=previousYear!=this.toc.getLastYear();if(moreYearsToShow)
{var li=document.createElement("li");var anchor=document.createElement("a");anchor.href=Common_String_Format("javascript:{0}.moveForward(true)",this.id);anchor.className="yearheader-right-arrow";var img=document.createElement("img");img.style.height="25px";img.style.width="10px";img.src="/psimages/clearpixel.gif";anchor.appendChild(img);li.appendChild(anchor);parent.appendChild(li);}
if(parent.lastChild!=null)
parent.lastChild.className="lastItem";}}
function TOC_Toc(years,currentYear,currentYearOffset,useDoubleYears,yearStart,styleId,phanfarePhriendsCount,tocVersion)
{this.useDoubleYears=useDoubleYears;this.years=years;this.currentYear=currentYear;this.currentYearOffset=currentYearOffset;this.yearStart=yearStart;this.styleId=styleId;this.phanfarePhriendsCount=phanfarePhriendsCount;this.tocVersion=tocVersion;this.yearChangedEvent=new YAHOO.util.CustomEvent("selectedYearChanged",null,true,YAHOO.util.CustomEvent.FLAT);}
TOC_Toc.prototype.getAlbumCount=function()
{var sum=0;for(var i=0;i<this.years.length;i++)
{sum+=this.years[i].albums.length;}
return sum;}
TOC_Toc.prototype.yearAndOffsetToGlobalOffset=function(yearIndex,offset)
{var sum=0;if(yearIndex<0||yearIndex>this.years.length-1)
return;for(var i=0;i<yearIndex;i++)
{sum+=this.years[i].albums.length;}
sum+=Math.min(this.years[i].albums.length,offset);return sum;}
TOC_Toc.prototype.getCurrentYear=function()
{return this.currentYear;}
TOC_Toc.prototype.setCurrentYearAndOffset=function(year,offset,source,forceFire)
{if(this.getYear(year)==null)
return;if(year!=this.currentYear||offset!=this.currentYearOffset||forceFire)
{this.currentYear=year;this.currentYearOffset=offset;this.yearChangedEvent.fire({year:year,offset:offset,source:source});}}
TOC_Toc.prototype.getYear=function(year)
{var index=this.getYearIndex(year);if(index==null)
return null;else
return this.years[index];}
TOC_Toc.prototype.getYearIndex=function(year)
{for(var i=0;i<this.years.length;i++)
{var yearObject=this.years[i];if(yearObject.year==year)
return i;}
return null;}
TOC_Toc.prototype.getYearAtIndex=function(index)
{if(index<0||index>=this.years.length)
return null;return this.years[index].year;}
TOC_Toc.prototype.getPreviousYear=function(year)
{var index=this.getYearIndex(year);if(index==null||index==0)
{return null;}
return this.years[index-1].year;}
TOC_Toc.prototype.getNextYear=function(year)
{var index=this.getYearIndex(year);if(index==null||index>=this.years.length-1)
{return null;}
return this.years[index+1].year;}
TOC_Toc.prototype.getLastYear=function()
{if(this.years.length>0)
return this.years[this.years.length-1].year;else
return null;}
TOC_Toc.prototype.getFirstYear=function()
{if(this.years.length>0)
return this.years[0].year;else
return null;}
TOC_Toc.prototype.getAlbumsInYear=function(year)
{return this.getAlbumsInYearOffset(year,0);}
TOC_Toc.prototype.getAlbumsInYearOffset=function(year,offset)
{var yearObject=this.getYear(year);if(yearObject==null)
return 0;return Math.max((yearObject.albums.length-offset),0);}
TOC_Toc.prototype.addDeltaDown=function(year,offset,delta)
{var deltaToGo=delta;var currentYear=year;var currentOffset=offset;while(true)
{var leftInYear=this.getAlbumsInYear(currentYear)-currentOffset;if(leftInYear>=deltaToGo)
{var rv={year:currentYear,offset:(currentOffset+deltaToGo)};return rv;}
deltaToGo-=leftInYear;var nextYear=this.getNextYear(currentYear);if(nextYear==null)
{rv={year:currentYear,offset:this.getAlbumsInYear(currentYear)-1};return rv;}
currentYear=nextYear;currentOffset=0;}
return null;}
TOC_Toc.prototype.addDeltaUp=function(year,offset,delta,overheadSlotsPerYear)
{var deltaToGo=delta;var currentYear=year;var currentOffset=offset;while(true)
{var leftInYear=currentOffset;if(leftInYear>=deltaToGo)
{var rv={year:currentYear,offset:(currentOffset-deltaToGo)};return rv;}
deltaToGo-=leftInYear;deltaToGo-=overheadSlotsPerYear;var previousYear=this.getPreviousYear(currentYear);if(previousYear==null)
{rv={year:currentYear,offset:0};return rv;}
currentYear=previousYear;currentOffset=this.getAlbumsInYear(currentYear);}
return null;}
function TOC_FeaturedImageManager(myGlobalJavaScriptId,idPrefix,classPrefix,imageClass,maxDimension,rendition,useRandom,useBrowserScaling)
{this.id=myGlobalJavaScriptId;this.idPrefix=idPrefix;this.classPrefix=classPrefix;this.imageClass=imageClass;this.rendition=rendition;this.useRandom=useRandom;this.useBrowserScaling=useBrowserScaling;this.maxDimension=maxDimension;this.toc=null;this.largeMode=this.IsLargeMode();this.featuredImages=new Object();this.currentImages=new Object();window.onresize=this.onResize.bindAsEventListener(this);}
TOC_FeaturedImageManager.prototype.IsLargeMode=function()
{return(Common_GetWindowWidth(false)>1130);}
TOC_FeaturedImageManager.prototype.onResize=function()
{var whatModeNow=this.IsLargeMode();if(whatModeNow!=this.largeMode){this.largeMode=whatModeNow;this.redraw(true);}
else this.largeMode=whatModeNow;}
TOC_FeaturedImageManager.prototype.onYearChanged=function(obj)
{if(obj.source!=this)
{this.moveToYear(obj.year);}}
TOC_FeaturedImageManager.prototype.moveToYear=function(year)
{this.currentYear=year;if(this.loadFeaturedImagesForYear(year)==true)
this.redraw();}
TOC_FeaturedImageManager.prototype.precacheAll=function()
{if(this.toc==null)
return;var timeout=0;for(var i=0;i<this.toc.years.length;i++)
{setTimeout(Common_String_Format("{0}.loadFeaturedImagesForYear({1})",this.id,this.toc.years[i].year),timeout);timeout+=1250;}}
TOC_FeaturedImageManager.prototype.loadFeaturedImagesForYear=function(year)
{if(this.featuredImages[year]!=null)
{return true;}
var url=Common_String_Format("{0}&year={1}&manager={2}",TOC_FeaturedImageJavaScriptUrl,year,this.id)
var script=document.createElement("script");script.src=url;script.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(script);return false;}
TOC_FeaturedImageManager.prototype.yearLoadedCallback=function(year,redraw,images)
{this.featuredImages[year]=images;if(this.currentYear==year||redraw==true)
this.redraw();}
TOC_FeaturedImageManager.prototype.clearFeaturedImages=function()
{var parent=document.getElementById(Common_String_Format("{0}FeaturedItems",this.idPrefix));if(parent!=null)
Common_RemoveChildren(parent);}
TOC_FeaturedImageManager.prototype.computeFeaturedImageSlots=function()
{if(this.useRandom)
{var rowsDisplayed=this.albumsListingManager.rowsDisplayed;rowsDisplayed+=this.toc.phanfarePhriendsCount+1;var numImages;if(this.largeMode){numImages=Math.ceil(rowsDisplayed/8);}
else{numImages=Math.ceil(rowsDisplayed/10);}
return numImages;}
else
{var imageArray=this.featuredImages[this.currentYear];if(imageArray==null)
return 0;return imageArray.length;}}
TOC_FeaturedImageManager.prototype.redraw=function(fromResize)
{var imageArray=this.featuredImages[this.currentYear];if(imageArray==null)
{this.loadFeaturedImagesForYear(this.currentYear);return;}
var slots=this.computeFeaturedImageSlots();var desiredImageCount=slots;var actualImageCount=Math.min(desiredImageCount,imageArray.length);if(!fromResize){this.currentImages=new Array(actualImageCount);}
this.clearFeaturedImages();var parent=document.getElementById(Common_String_Format("{0}FeaturedItems",this.idPrefix));var table=document.createElement("table");table.cellspacing=0;table.cellpadding=0;var tbody=document.createElement("tbody");table.appendChild(tbody);var tr=document.createElement("tr");tbody.appendChild(tr);var td=document.createElement("td");tr.appendChild(td);var ul=document.createElement("ul");ul.className=Common_String_Format("{0}List",this.classPrefix);td.appendChild(ul);var imagesRemaining=new Array(imageArray.length);for(var i=0;i<imageArray.length;i++)
{imagesRemaining[i]=i;}
var maxWidth=0;for(var i=0;i<actualImageCount;i++)
{var elementNode=null;var url=null;var chosenImage;if(!fromResize){var choice;var index=Math.floor(Math.random()*imagesRemaining.length);choice=imagesRemaining[index];imagesRemaining.splice(index,1);chosenImage=imageArray[choice];this.currentImages[i]=chosenImage;}
else{chosenImage=this.currentImages[i];}
var src=chosenImage.priv_url;var pair=Common_MakeImgTagAndPlaceholder(src,Common_String_Format("tocFeaturedImage.{0}.{1}",chosenImage.image_id,this.maxDimension),true);image=pair.img;image.className="standardImageDisplayImageIMG";image.alt=image.title=chosenImage.title;var height=chosenImage.height;var width=chosenImage.width;var scaleFactor;if(this.largeMode){scaleFactor=1.0;}
else{scaleFactor=(width<this.maxDimension)?1.0:0.75;}
var scaledHeight=Math.floor(height*scaleFactor);var scaledWidth=Math.floor(width*scaleFactor);maxWidth=Math.max(scaledWidth,maxWidth);if(true||this.useBrowserScaling)
{image.height=scaledHeight;image.width=scaledWidth;}
if(pair.placeholder!=null)
{pair.placeholder.style.width=scaledWidth;pair.placeholder.style.height=scaledHeight;}
url=Common_String_Format("/{0}{1}_{2}#imageID={3}",TOC_WebRoot,chosenImage.album_id,chosenImage.section_id,chosenImage.image_id);var imageOrPlaceholder=pair.placeholder==null?pair.img:pair.placeholder;elementNode=Common_MakeCroppableIMG(imageOrPlaceholder,null,this.imageClass,false,chosenImage.suppress_context,false,url,null,0,0,scaledHeight,scaledWidth,false,null,null,null,null,null,true,null,null,null,null,null)
var li=document.createElement("li");li.className=Common_String_Format("{0}Entry",this.classPrefix);li.appendChild(elementNode);ul.appendChild(li);}
spacer=document.createElement("img");spacer.src="/psimages/clearpixel.gif";spacer.height=1;spacer.width=maxWidth+30;parent.appendChild(table);parent.appendChild(spacer);}
function TOC_AlbumsListingManager(myGlobalId,domId,maxDimension,className,imageClass,parentId,moreAlbumsNamePrefix,toc,rows,continuedIndicatorId,moreToShowIndicatorId,previousPageLinkId,nextPageLinkId)
{this.id=myGlobalId;this.domId=domId;this.toc=toc;this.maxDimension=maxDimension;this.className=className;this.imageClass=imageClass;this.parentId=parentId;this.moreAlbumsNamePrevix=moreAlbumsNamePrefix;this.rows=rows;this.pagingEnabled=rows>0;this.rowsDisplayed=0;this.featuredImagesManager=null;this.previousPageLinkId=previousPageLinkId;this.nextPageLinkId=nextPageLinkId;this.continuedIndicatorNode=document.getElementById(continuedIndicatorId);this.moreToShowIndicatorNode=document.getElementById(moreToShowIndicatorId);Common_ClearIds(this.continuedIndicatorNode);Common_ClearIds(this.moreToShowIndicatorNode);Common_DetachNode(this.continuedIndicatorNode);Common_DetachNode(this.moreToShowIndicatorNode);this.columnCache=-1;this.moreAlbumsDiv=document.getElementById(Common_String_Format("{0}Div",moreAlbumsNamePrefix));this.moreAlbumsLink=document.getElementById(Common_String_Format("{0}Link",moreAlbumsNamePrefix));this.moreAlbumsYear=document.getElementById(Common_String_Format("{0}Year",moreAlbumsNamePrefix));this.moreAlbumsTotal=document.getElementById(Common_String_Format("{0}Total",moreAlbumsNamePrefix));Common_DetachNode(this.moreAlbumsDiv);this.firstYear=toc.currentYear;this.firstYearFirstOffset=toc.currentYearOffset;this.lastYear=0;this.lastYearLastOffset=0;this.toc.yearChangedEvent.subscribe(this.onYearAndOffsetChanged,null,this);}
TOC_AlbumsListingManager.prototype.clearAlbumsListing=function()
{Common_RemoveChildren(document.getElementById(this.parentId));}
TOC_AlbumsListingManager.prototype.moveDown=function(fromClick)
{var pair=this.toc.addDeltaDown(this.lastYear,this.lastYearLastOffset,1);if(pair!=null)
this.moveTo(pair.year,pair.offset,false,fromClick);}
TOC_AlbumsListingManager.prototype.moveUpNFT=function(year,fromClick)
{var listingSlotsAvailable=this.slotsAvailable()-1;var pair=this.toc.addDeltaUp(this.firstYear,this.firstYearFirstOffset,listingSlotsAvailable,this.columnsAvailable().columns);if(pair!=null)
{if(pair.year==year)
this.moveTo(pair.year,pair.offset,false,true,fromClick);else
this.moveToYear(year,true,fromClick);}}
TOC_AlbumsListingManager.prototype.moveUp=function(fromClick)
{var pair=this.toc.addDeltaUp(this.firstYear,this.firstYearFirstOffset,this.slotsAvailable(),this.columnsAvailable().columns);if(pair!=null)
this.moveTo(pair.year,pair.offset,false,fromClick);}
TOC_AlbumsListingManager.prototype.redraw=function()
{this.moveTo(this.firstYear,this.firstYearFirstOffset,false,false);}
TOC_AlbumsListingManager.prototype.moveToYear=function(year,fromClick)
{this.moveTo(year,0,false,fromClick);}
TOC_AlbumsListingManager.prototype.moveTo=function(year,offset,singleCompleteYear,fromClick)
{this.clearAlbumsListing();if(offset>=this.toc.getAlbumsInYear(year))
{year=this.toc.getNextYear(year);offset=0;}
if(year==null)
{Common_SetDisplayN(this.previousPageLinkId,false);Common_SetDisplayN(this.nextPageLinkId,false);return;}
var yearChanged=this.toc.currentYear!=year;this.firstYear=this.toc.currentYear=year;this.firstYearFirstOffset=offset;var parent=document.getElementById(this.parentId);var rowsAvailable;var columns=this.columnCache=this.columnsAvailable().columns;if(!this.pagingEnabled||singleCompleteYear)
rowsAvailable=Math.ceil((this.toc.getAlbumsInYear(this.firstYear)+1)/columns);else
rowsAvailable=this.rowsAvailable();var rows=rowsAvailable;var nextYear=this.firstYear;this.lastYear=nextYear;var nextYearAlbumsToShow;if(!singleCompleteYear)
nextYearAlbumsToShow=Math.min(this.toc.getAlbumsInYearOffset(this.firstYear,this.firstYearFirstOffset)+1,rows);else
nextYearAlbumsToShow=rowsAvailable;this.lastYearLastOffset=offset+nextYearAlbumsToShow-2;var isFirst=true;if(nextYearAlbumsToShow>0)
{parent.appendChild(this.buildAlbumListingYear(this.firstYear,this.firstYearFirstOffset,(rows*columns)-1,isFirst));isFirst=false;}
rows-=Math.ceil(this.toc.getAlbumsInYearOffset(this.firstYear,this.firstYearFirstOffset)/columns)+1;while(rows>=2&&!singleCompleteYear)
{var ny=this.toc.getNextYear(nextYear);if(ny==null)
break;var albumsInNy=this.toc.getAlbumsInYear(ny);nextYearAlbumsToShow=Math.min((rows-1)*columns,albumsInNy);this.lastYearLastOffset=nextYearAlbumsToShow-1;this.lastYear=ny;nextYearRowsUsed=(1+Math.ceil(nextYearAlbumsToShow/columns));parent.appendChild(this.buildAlbumListingYear(ny,0,nextYearAlbumsToShow,isFirst));isFirst=false;rows-=nextYearRowsUsed;nextYear=ny;}
this.rowsDisplayed=rowsAvailable-Math.max(rows,0);Common_SetDisplayN(this.previousPageLinkId,this.pagingEnabled&&!(this.firstYear==this.toc.getFirstYear()&&this.firstYearFirstOffset==0));Common_SetDisplayN(this.nextPageLinkId,this.pagingEnabled&&!(this.lastYear==this.toc.getLastYear()&&this.lastYearLastOffset==this.toc.getAlbumsInYear(this.lastYear)-1));if(fromClick)
{}}
TOC_AlbumsListingManager.prototype.slotsAvailable=function()
{return this.rowsAvailable()*this.columnsAvailable().columns;}
TOC_AlbumsListingManager.prototype.rowsAvailable=function()
{return this.rows;}
TOC_AlbumsListingManager.prototype.columnsAvailable=function()
{var parent=document.getElementById(this.parentId);var outerDiv=document.createElement("div");outerDiv.className="standardTocAlbumListing";Common_SetStyleAttribute(outerDiv,"clear","both");parent.appendChild(outerDiv);var prevWidth=-1;var prevLeft=-1;var count=0;while(true&&count<20)
{var innerDiv=document.createElement("div");innerDiv.className="standardTocAlbumListingEntry";outerDiv.appendChild(innerDiv);var left=innerDiv.offsetLeft;var width=parent.clientWidth;if(left<=prevLeft)
{break;}
else
{prevLeft=left;prevWidth=width;count++;}}
Common_RemoveNode(outerDiv);return{columns:count,width:prevWidth};}
TOC_AlbumsListingManager.prototype.buildAlbumListingYear=function(year,offset,maxEntries,isFirst)
{var div=document.createElement("div");div.className=Common_String_Format("{0}Wrapper",this.className);div.id=Common_String_Format("{0}{1}",this.domId,year);var yearDiv=document.createElement("div");var yearImgDiv=document.createElement("div");yearImgDiv.className="tocYearHeaderImageWrapper";if(isRenderedStyle(TOC_StyleId))
{var headerImg;if(year!=9999){headerImg=Common_MakeImage(Common_String_Format("/psimages/shared/TocHeader{0}.{1}.{2}.gif",this.toc.useDoubleYears?"2":"",TOC_StyleId,year),Common_String_Format("tocHeaderImage_{0}",year));}
else{headerImg=Common_MakeImage(TOC_TAHUrl,"tocHeaderImage_9999");}
headerImg.className="standardTocYearHeaderGraphic";yearImgDiv.appendChild(headerImg);if(Common_isIE&&year==9999){headerImg.removeAttribute("width");headerImg.removeAttribute("height");}}else{var span=document.createElement("span");if(year!=9999)
{if(this.toc.useDoubleYears==true)
{var nextYear=year+1;nextYear+=" ";span.innerHTML=Common_String_Format("{0} - '{1} ALBUMS",year,nextYear.substring(2,4));}else{span.innerHTML=Common_String_Format("{0} ALBUMS",year);}}else{span.innerHTML=TOC_TimelessHeader;}
span.className="tocYearHeaderText";yearImgDiv.appendChild(span);}
var totalAlbums=this.toc.getAlbumsInYear(year);var albumsLeft=totalAlbums-offset-maxEntries;var isPartial=(totalAlbums>0)&&(offset>0||albumsLeft>0);var showAllString;if(isPartial)
{var continued=this.continuedIndicatorNode.cloneNode(true);Common_RemoveChildren(continued);Common_SetVisibility(continued,true);var a1=document.createElement("a");var yearString;if(year<9999){showAllString=Common_String_Format("{0}{1} albums",year,this.toc.useDoubleYears?(" - "+(year+1)):"",albumsLeft,albumsLeft>1?"s":"");yearString=Common_String_Format("{0}{1}",year,this.toc.useDoubleYears?(" - "+(year+1)):"");}
else{showAllString=TOC_TimelessHeader;yearString=TOC_TimelessHeader;}
a1.innerHTML=Common_String_Format("[Show all {0}]",showAllString);a1.href=Common_String_Format("javascript:TOC_MyAlbumsListingManager.moveTo({0}, 0, true, true)",year);var textNode1=document.createTextNode(Common_String_Format("{2} albums in {3}, showing {0}-{1} ",(offset+1),Math.min((offset+maxEntries),totalAlbums),totalAlbums,yearString));continued.appendChild(textNode1);continued.appendChild(a1);a1.year=year;a1.offset=0;a1.count=totalAlbums;yearDiv.appendChild(continued);}
div.appendChild(yearDiv);div.appendChild(this.buildAlbumListing(year,offset,maxEntries));yearDiv.appendChild(yearImgDiv);if(isPartial){var more=this.moreToShowIndicatorNode.cloneNode(true);Common_RemoveChildren(more);Common_SetVisibility(more,true);var a1=document.createElement("a");a1.innerHTML=Common_String_Format("[Show all {0}]",showAllString);a1.href=Common_String_Format("javascript:TOC_MyAlbumsListingManager.moveTo({0}, 0, true, true)",year);more.appendChild(a1);a1.year=year;a1.offset=0;a1.count=totalAlbums;div.appendChild(more);}
return div;}
TOC_AlbumsListingManager.prototype.buildAlbumListing=function(year,offset,maxEntries)
{var yearObject=this.toc.getYear(year);var div=document.createElement("div");div.className=this.className;var content="";if(yearObject!=null)
{var firstElement=offset;var lastElement=maxEntries>0?Math.min(yearObject.albums.length,offset+maxEntries):yearObject.albums.length;for(var i=firstElement;i<lastElement;i++)
{div.appendChild(this.buildAlbumListingEntry(yearObject.albums[i]));}}
return div;}
TOC_AlbumsListingManager.prototype.startPrecache=function(year,offset,count)
{var i=0;while(i<count)
{var yearObject=this.toc.getYear(year);var albumsInYear=this.toc.getAlbumsInYear(year);if(yearObject==null||offset>=albumsInYear)
{year=this.toc.getNextYear(year);if(year==null)
break;else
{offset=0;continue;}}
albumsInYear=this.toc.getAlbumsInYear(year);while(i<count&&offset<albumsInYear)
{var album=yearObject.albums[offset];if(album.leadImageId>0)
{var imageSrc=album.leadImageUrl;Common_MakeImgTagAndPlaceholder(imageSrc);}
offset++;i++;}}}
TOC_AlbumsListingManager.prototype.buildAlbumListingEntry=function(album)
{var href=Common_String_Format("/{0}{1}",TOC_WebRoot,album.albumId);var image=null;if(album.leadImageId>0)
{var imageSrc=album.leadImageUrl;imageSrc+="/0_0_71_71/nil";var imgId=Common_String_Format("ThumbnailSmall.{0}.{1}.{2}",album.albumId,0,album.leadImageId);var pair=Common_MakeImgTagAndPlaceholder(imageSrc,imgId,true);var image=pair.img;if(pair.placeholder!=null)
{image=pair.placeholder;image.height=33;image.width=33;image.style.height=pair.placeholder.style.width=33;}
image.className="standardTocAlbumListingThumbImageIMG";}
var nameLink=document.createElement("a");nameLink.href=href;nameLink.innerHTML=album.albumName;var nameDiv=document.createElement("div");nameDiv.className=Common_String_Format("{0}AlbumName",this.className);var date=document.createElement("div");date.className=Common_String_Format("{0}AlbumDate",this.className);var itemCount=document.createElement("div");itemCount.className=Common_String_Format("{0}AlbumDate",this.className);if(album.albumType=="Dated")
date.innerHTML=album.albumDateString;var wrapperDiv=document.createElement("div");wrapperDiv.className=Common_String_Format("{0}EntryWrapperDiv",this.className);wrapperDiv.href="/"+TOC_WebRoot+album.albumId;wrapperDiv.onclick=this.onAlbumListingClick;if(image!=null)
{wrapperDiv.appendChild(image);}
if(TOC_HasBackground==0)
{var thumbnailMask=document.createElement("div");thumbnailMask.style.border="0";thumbnailMask.className="album-thumbnailsmall-mask";wrapperDiv.appendChild(thumbnailMask);}
wrapperDiv.appendChild(nameDiv);wrapperDiv.appendChild(date);nameDiv.appendChild(nameLink);itemCount.innerHTML=Common_String_Format("{0} photos and videos",album.itemCount);if(Common_isIE6){itemCount.style.paddingBottom="12px";}
wrapperDiv.appendChild(itemCount);return wrapperDiv;}
TOC_AlbumsListingManager.prototype.onAlbumListingClick=function(){document.location=this.href;}
TOC_AlbumsListingManager.prototype.onYearAndOffsetChanged=function(obj)
{if(obj.source==this)
return;this.moveTo(obj.year,obj.offset,false,false);},TOC_StartPrecache=function()
{TOC_MyFeaturedImagesManager.loadFeaturedImagesForYear(this.year);TOC_MyAlbumsListingManager.startPrecache(this.year,this.offset,this.count);},TOC_TimelessLoaded=function()
{var img=Common_GetChildById(document,"tocHeaderImage_9999");}
TOC_Present=true;
