

///	<summary>Class LinkadoosVerticalScroller<br>
///	Adds methods/properties specific to a <c>BaseScroller</c> of <c>Product</c> items on the Linkadoos sub-site. 
///	Main purpose is to overload GetHtml() method for specific html rendering</summary>
///	<extends>ProductScroller</extends>
function LinkadoosVerticalScroller() {
	this.additionalSpacing = 0;		// For spacers between arrows and main cells
	this.defaultImageType = "fp_thumb";
	this.orientation = "Vertical";
	this.verticalSpace = 0;
	this.bgcolor = "#e5afdb";
	
	// =================
	// Protected Methods
	// =================
	
	///	<summary>Generates the html for the <c>LinkadoosVerticalScroller</c>.</summary>
	/// <remarks>Overridden method of <c>ProductScroller</c></remarks>
	this.GetHtml = function() {
		var html = "";
		var lArrowCell = '<td align="center" class="sideCell"><a href="javascript: ' + this.name + '.Scroll(-1);">' + this.backArrow.html + '</a></td>';
		var rArrowCell = '<td align="center" class="sideCell"><a href="javascript: ' + this.name + '.Scroll(1);">' + this.forwardArrow.html + '</a></td>';

				// Generate html only if there are items for scroller
		if (this.items.length >= this.MIN_ITEMS_FOR_RENDER) {
			html += '<table border="0" width="' + this.width + '" bgcolor="' + this.bgcolor + '" cellpadding="0" cellspacing="8">' +
						this.FormatElement(lArrowCell) +						// Back link
						this.GetCellsHtml(this.start, this.items.length) +		// Items after start item
						this.GetCellsHtml(0, this.start) +						// Items before start item
						this.FormatElement(rArrowCell) +						// Forward link
					"</table>";
		}
		
		//alert(html);
		return html;
	}
	
	///	<summary>Generates the html for the <c>LinkadoosVerticalScroller</c> cell.</summary>
	/// <param name="i"><c>int</c> index of the <c>items</c> array.</param>
	/// <returns><c>string</c> of cell html</returns>
	this.GetCellHtml = function(i) {
		var html = "";
		var product = this.items[i];
		var mainImages = product.GetMedia(this.defaultImageType);
		var mainImg = mainImages[0];
		var mainImgHtml = "";
		if(mainImg != null)
		{
			var tmpImg = mainImg.CreateFPImage();
			//alert(tmpImg.className);
			tmpImg.className = 'thumb60';
			tmpImg.SetHtml();
			//alert(tmpImg.className);
			//alert('tmpImg.html' + tmpImg.html);
			mainImgHtml = tmpImg.html;
		}
			
		//alert(mainImgHtml);
		
		html += '<td class="sideCell" id="' + this.name + 'cell' + i + '" align="center" width="' + this.cellWidth + '">' +
					'<a href="' + this.productLink + product.GetId() + '">' +
					mainImgHtml + '</a><br>' +
					Scroller.GetSpacer(1, 5).html + '<br>' +
					'<a href="' + this.productLink + product.GetId() + '" class="prdName60">' +
					product.GetName() +
					'</a>' +
				'</td>';
		
		return html;
	}
	
	// ===================
	// Constructor Details
	// ===================
	this.SetProductLink("fp.aspx?a=get&t=product&s=linkadoos&p=product&site=usp&id=");
}
LinkadoosVerticalScroller.prototype = new ProductScroller();
LinkadoosVerticalScroller.prototype.constructor = LinkadoosVerticalScroller;
