function FeaturedGallery()
{
if(typeof FeaturedGallery._initialized == "undefined")
{
FeaturedGallery.prototype.load = function()
{
var doc = document.forms[0];
this.loadArticles();
};
FeaturedGallery.prototype.loadArticles = function()
{
this.featGallery = new StoriesIndex();
var searchQuery = '(([PageType]=article)+and+([SectionPath]=Galleries)+and+([Subsection]=Galleries))';
this.featGallery.addSearch(searchQuery,'1','9','3','featuredgallery');
this.featGallery.loadSearch();
this.featGallery.removeSearchCurArticle();
};
FeaturedGallery.prototype.print = function()
{
if(!this.featGallery || this.featGallery.searchStories.length == 0)return false;
document.write('
');
document.write('
Featured Gallery
');
var maxStories = 9;
if(this.featGallery.searchStories.length < 9) maxStories = this.featGallery.searchStories.length;
for(var i = 0; i < maxStories; i++)
{
var story = this.featGallery.searchStories[i];
var storyImg = '/wheels/site/articleIDs/' + story.viewDocID + '/$file/featured.jpg';
var tempStorySection = unescape(story.viewSection).replace(/\s/ig,"_");
var storySection = (tempStorySection.indexOf('>') == -1) ? tempStorySection : tempStorySection.split('>')[0];
var storyTitle = (unescape(story.viewTitle)).replace(/\+/gi," ");
//Get article link
//var storyLink = getStoryLink(storySection,story.viewDocID,storyTitle);
var storyLink = getStoryLink(unescape(story.viewSection),story.viewDocID,storyTitle);
document.write('
');
document.write('
');
document.write('');
}
document.write('
');
};
}
FeaturedGallery._initialized = true;
}
var featuredGallery = new FeaturedGallery();
featuredGallery.load();
featuredGallery.print();