if (document.forms[0].PageType.value == "index" && currentSection != "Blogs" && currentSubsection != "Wheels Handling Olympics") { tmpCount = Number(document.forms[0].Count.value); if (currentSubsection =="Galleries") tmpCount = 12; tmpStart = Number(document.forms[0].Start.value); tmpLast = tmpStart+tmpCount; tmpType = document.forms[0].PageType.value; tmpElements = viewResults.length - 1; // headline //if (unescape(document.forms[0].Type.value) == "Subsections" && currentSection=="Car of the Year 2007") { if (unescape(document.forms[0].Type.value) == "Subsections") { document.write('
'); document.write('

',currentSubsection.toUpperCase(),'

'); document.write(''); document.write('AddThis Social Bookmark Button'); var addthis_pub = 'rogertech'; document.write(''); document.write('
'); document.write(''); } else { //document.write('

',currentSection,'

'); document.write(''); } if ( tmpLast > (tmpStart + tmpElements) ) { tmpLast = tmpStart + tmpElements; } if(document.forms[0].Section.value == 'Galleries' && document.forms[0].Subsection.value == 'Galleries') { var galleryIndex = new MultimediaGalleryIndex(); for (var j = tmpStart; j < tmpLast; j++) { if (typeof(viewResults[j]) != 'undefined') { // check error for non-existing indexes if (unescape(viewResults[j].viewTitle) == "No items available.") { document.write('
No items available.
'); } else { var article = new Article(viewResults[j].viewDocID); var str = article.loadAjax(); if(str.indexOf('articleResult') != -1) { eval(str); var articleThumb = getIndexThumb(articleResult.Attachments); galleryIndex.add(viewResults[j].viewDocID,articleThumb,unescape(viewResults[j].viewTitle)); } } } } galleryIndex.print(); } else { for (var j = tmpStart; j < tmpLast; j++) { if (typeof(viewResults[j]) != 'undefined') { // check error for non-existing indexes if (unescape(viewResults[j].viewTitle) == "No items available.") { document.write('
No items available.
'); } else { //check not related article //if (viewResults[j].viewDocID == viewResults[j].viewParentID) var storyClass = new Array(); storyClass.push('storyContainer'); if(currentSection == 'In the Magazine')storyClass.push('inthemagazine'); // var storyLink=getStoryLink(currentSection.replace(/\s/ig,"_"),viewResults[j].viewDocID,(unescape(viewResults[j].viewTitle)).replace(/\s/ig,"+")); var storyLink=getStoryLink(unescape(viewResults[j].viewSection),viewResults[j].viewDocID,(unescape(viewResults[j].viewTitle)).replace(/\s/ig,"+")); if(j == tmpStart)//if it is the first storyContainer add a top margin { document.write('
',unescape(viewResults[j].viewTitle),''); } else { document.write('
',unescape(viewResults[j].viewTitle),''); } if (currentSection!="News" && currentSection!="Road Tests" && currentSection!="My Wheels") { //document.write('
',unescape(viewResults[j].viewTitle),''); document.write(''); } else { document.write(''); } var subsectionLink = "/wheels/site/index?open&type=Subsections&cat=" + unescape(viewResults[j].viewSection) + "&ui=dom&template=domWheels&start=1&count=10"; var splitLinkTitle = (unescape(viewResults[j].viewSection)).split(">"); if(currentSection != 'In the Magazine') { document.write(''); } //formatDate(unescape(viewResults[j].viewPageDate)) if((unescape(viewResults[j].viewSection)).toLowerCase().indexOf('galleries') == -1) { document.write('
',unescape(viewResults[j].viewSummary),'
'); } document.write('
'); //} } } } } // next / previous document.write('

'); // previous if (tmpStart > 1) { document.write(''); } if (viewResults.length > tmpStart+(tmpCount-1)) { // next document.write(''); } document.write('
PreviousNext
'); }