﻿<!--
    function sliderComponent(type, itemsArray) {    
        var currentIdx = 0;    
        this.type = type;
        this.itemsArray = itemsArray;
                      
        function prev() {
            if (currentIdx == 0)
                return;                
            currentIdx--;            
            populate();
        }
    
        function next() {        
            if (currentIdx + 4 >= itemsArray.length)
                return;                
            currentIdx++;            
            populate();
        }
    
        function populate() {
            for (i = 0; i < 4; i++) {
                if (currentIdx + i == itemsArray.length)
                    break;                
                document.getElementById('td' + type + 'Column' + i).innerHTML = formatThumbnailHolder(itemsArray[currentIdx + i][0], itemsArray[currentIdx + i][1], itemsArray[currentIdx + i][2]);
            }
        }
        
        function formatThumbnailHolder(title, thumbnail, link) {
            var html = '<table width="100%" cellpadding="0" cellspacing="2" border="0" class="bgc0">';
            html += '<tr><td align="center" height="75"><a href="' + link + '"><img src="' + thumbnail + '" border="0"/></a></td></tr>';
            html += '<tr><td height="50" valign="top"><a href="' + link + '" class="f10b c0">' + title + '</a></td></tr>';
            html += '</table>';
            return html;
        }
    
        this.prev = prev;
        this.next = next;
        this.populate = populate;
    }   
//-->
