// AJB 28/10/2001 Better Archive Listings // Last Update 3/8/2002 // My Type 'BlogArchiveEntry' function BlogArchiveEntry( theLink, theName ) { this.Link = theLink; this.Name = theName; // Extract Date from Name, Yuk! // 09/30/2001 - 10/06/2001 this.StartDate = new Date( this.Name.slice(6,10), this.Name.slice(0,2)-1, this.Name.slice(3,5) ); this.EndDate = new Date( this.Name.slice(13+6,13+10), this.Name.slice(13+0,13+2)-1, this.Name.slice(13+3,13+5) ); } BlogArchiveEntry.prototype.Compare = function( rhs ){ if ( this.StartDate == rhs.StartDate ) return 0; else if ( this.StartDate > rhs.StartDate ) return 1; else return -1; } BlogArchiveEntry.prototype.MakeLink_UKShort = function(){ var newName = this.StartDate.getDate()+"/"+(this.StartDate.getMonth()+1)+"/"+this.StartDate.getFullYear(); var outString = ""; if ( -1 != location.href.indexOf( this.Link ) ){ // No Link, this is our page! outString = "" + newName + ""; } else { // Link outString = "" + newName + ""; } return outString; } BlogArchiveEntry.prototype.MakeLink_Normal = function(){ var outString = ""; if ( -1 != location.href.indexOf( this.Link ) ) { // No Link, this is our page! outString = this.Name; } else { // Link outString = "" + this.Name + ""; } return outString; } // Short/Long listing selection function ShowAll(){ var cookie = new obiCookie( "LimitArchive", 365 ); cookie.SetCookie( 0 ); location.href = location.href; } function ShowSubset( HowMany ){ var cookie = new obiCookie( "LimitArchive", 365 ); cookie.SetCookie( HowMany ); location.href = location.href; } // Locate URL in list of archives function FindIdx( myURL ){ for ( var n=0; n" + AnchorText + ""; } function MakeNextArchiveLink( myURL, AnchorText ) { var idx; if ( -1 == ( idx = FindIdx( myURL )) ) return null; if ( (BlogInfo.length-1) == idx ) return null; if (( null == AnchorText ) || ( "" == AnchorText )) return BlogInfo[idx+1].MakeLink_UKShort(); else return "" + AnchorText + ""; } function MakeFirstArchiveLink( AnchorText ) { if (( null == AnchorText ) || ( "" == AnchorText )) return BlogInfo[0].MakeLink_UKShort(); else return "" + AnchorText + ""; } function WriteArchiveSection() { document.write( "" ); } function WriteArchiveBottom() { // Next/Previous Links var navlink=""; var wrotelink=false; if ( navlink = MakeNextArchiveLink( location.href, "[<< Previous Week]" )) { document.write( navlink ); wrotelink=true; } if ( navlink = MakePreviousArchiveLink( location.href, "[Following Week >>]" )) { document.write( (wrotelink?" ":"") + navlink ); wrotelink=true; } if ( !wrotelink ) { document.write( MakeFirstArchiveLink( "[<< Archives]" ) ); } }