var lpszTitle = new Array();		// Title of the testimonial

var lpszTestimonial = new Array();	// Testimonial text

var lpnHeight = new Array();		// Array of offset heights

var nTCount = 0;			// Count of testimonials.

var bMSIE = false;

var bFFX = false;

var bOpera = false;

var szBrowser = window.navigator.appName;

var bScrolling = false;

var nCurrTestimonial = 0;

var nNextTestimonial = 1;



if(szBrowser.indexOf("Microsoft") != -1)

{

	bMSIE = true;

}

else if(szBrowser.indexOf("Netscape") != -1)

{

	bFFX = true;

}

else if(szBrowser.indexOf("Opera") != -1)

{

	bOpera = true;

}



function AddTestimonial(szTitle, szTestimonial)

{

	// You can use as many variables as you need. Just add them as arrays and fill them with this function.

	lpszTitle[nTCount] = szTitle;

	lpszTestimonial[nTCount] = szTestimonial;

	nTCount++;

}

function Init()

{

	/*var dDebug = document.getElementById("debugPort");

	dDebug.innerHTML += "Test";*/

	if(nTCount < 1)

	{

		// ERROR: No testimonials added.

		// alert("No testimonials to scroll.");

	}

	else

	{

		var dViewPort = document.getElementById("ViewPort");

		if(dViewPort)

		{

			if(bMSIE || bFFX || bOpera)

			{

				var i = 0;

				for(i = 0; i < nTCount; i++)

				{

					var dNewObject = document.createElement('div');

					dNewObject.setAttribute("id", "test" + i);

					dNewObject.className = "testimonial";

					dNewObject.style.position = "absolute";

					if(i == 0)

					{

						dNewObject.style.top = "0px";

					}

					else

					{

						dNewObject.style.top = "" + ((dViewPort.offsetTop / 2) + dViewPort.offsetHeight) + "px";

					}

					dNewObject.style.left = "0px";

					

					// This is the HTML for inside each of the testimonials

					dNewObject.innerHTML = "<p>" + lpszTestimonial[i] + "</p>\n";

					dNewObject.innerHTML += "<p><strong>" + lpszTitle[i] + "</strong></p>\n";

					

					dViewPort.appendChild(dNewObject);

				}

				bScrolling = true;

				setTimeout("Scroll(0)", 5000);

			}

			else

			{

			}

		}

		else

		{

			// ERROR: No viewport to scroll through.

			// alert("No viewport to scroll through.");

		}

	}

}



function Scroll(bNext)

{

	var i = 0;

	var dObj = document.getElementById("test" + nCurrTestimonial);

	var dViewPort = document.getElementById("ViewPort");

	if(bNext)

	{

		nCurrTestimonial = nNextTestimonial;

		nNextTestimonial++;

		if(nNextTestimonial == nTCount)

		{

			nNextTestimonial = 0;

		}

		bScrolling = true;	

	}

	if(bScrolling)

	{

		var dObj2 = document.getElementById("test" + (nNextTestimonial));

		var nDiff = dObj2.offsetTop - 2;

		var nTop;

		if(nDiff <= 0)

		{

			nTop = parseInt(dObj2.style.top)

			nTop += nDiff;

			dObj.style.top = "" + ((dViewPort.offsetTop / 2) + dViewPort.offsetHeight) + "px";

			dObj2.style.top = "" + nTop + "px";

			

			setTimeout("Scroll(1)", 5000);

		}

		else

		{

			nTop = parseInt(dObj2.style.top);

			nTop -= 2;

			//document.getElementById("debugPort").innerHTML += "OBJECT" + nNextTestimonial + " TOP: " + nTop + "<br />\n";

			dObj2.style.top = "" + nTop + "px";

			

			

			nTop = parseInt(dObj.style.top);

			nTop -= 2;

			dObj.style.top = "" + nTop + "px";

			setTimeout("Scroll(0)", 33);

		}

	}

}

AddTestimonial("", "EVD Networks is a technology company. And we specialize in a highly-skilled trade. But we think of ourselves as a service provider. Everything we do - from customized voice and data infrastructure solutions to returned phone calls - is done because we care about the success and satisfaction of our clients.");

AddTestimonial("", "An EVD Networks, Inc. proposal is accurate and there are no end-of-job surprises. No request from your IT Department is too big; no crawl space in a ceiling or under a floor is too small. Service is 24/7 and is never ever ordinary. ");

AddTestimonial("", "Whether you have an immediate need for installation or service - or you are in the RFP stages for a major project - contact EVD Networks today. ");


