﻿// JScript File
function ContentPlaceHolderControl() {
    this.ContentList = new Array();
    this.HighlightHolder = null;
    this.Index = -1;
    
    this.Append = function (cntArray) {
        this.ContentList.push(cntArray);
    };
    this.HolderName = "";
    this.MoveContentTo = moveContentTo;
    this.PlaceContent = placeContent;
    
}

function moveContentTo(n) {
	if (!this.HighlightHolder)
	{
		this.HighlightHolder = MM_findObj(this.HolderName); //document.getElementById("serviceHighlight");
	}
		
	if (this.ContentList.length > 0)
	{
		if ((this.Index + n) < 0)
		{
			this.Index = this.ContentList.length - 1;
		}
		else if ( (this.Index + n) >= this.ContentList.length)
		{
			this.Index = 0;
		}
		else 
		{
			this.Index += n;
		}

		this.HighlightHolder.innerHTML = buildContentString(this.ContentList[this.Index]); 
	}
}


function placeContent(num)
{
	if (num >= 0 && num < this.ContentList.length)
	{
		this.HighlightHolder = MM_findObj(this.HolderName); //document.getElementById("serviceHighlight");
		this.Index = num;
		this.HighlightHolder.innerHTML = buildContentString(this.ContentList[this.Index]); 
	}
}


function buildContentString(contentArray)
{
	var sb = new StringBuilder();
	sb.Append("<strong>");
	sb.Append(contentArray[0]);
	sb.Append("</strong>");
	sb.Append("<br />");
	sb.Append("<span><br />");
	sb.Append(contentArray[1]);
	sb.Append("</span>");

	return sb.ToString();	
}




