//Fading quoations in header
var texts = new Array();
texts[0] = "<font color='{COLOR}'>\"We love <b>EarGlue On Hold</b> in our branches, because it is so easy \n"
texts[0] += "to change the messages...new messages are recorded and \n"
texts[0] += "transmitted to our telephone systems at branches <b>within 72 hours or less.</b>\" <br /> \n"
texts[0] += "<b>Theresa Wright</b> - Senior VP<br /> \n"
texts[0] += "Union Planters Bank</font>";
texts[1] = "<font color='{COLOR}'>\"We have changed our thinking about how we approach <b>on hold</b> and now truly use it as a \n"
texts[1] += "strategic marketing tool.  We now have the ability to create a <b>customized message program</b> for each \n"
texts[1] += "of our brands.\" <br /> \n"
texts[1] += "<b>Diane Jackson</b> - Senior Analyst<br /> \n"
texts[1] += "Promus Hotels</font>";
texts[2] = "<font color='{COLOR}'>\"EarGlue does a wonderful job of getting our messages changed and <b>up and running in \n"
texts[2] += "record time.</b>...It's great to just \n"
texts[2] += "pick up the phone and have a message dropped or added so fast.\" <br /> \n"
texts[2] += "<b>Missy Jones</b><br /> \n"
texts[2] += "Faulkner University</font>";
texts[3] = "<font color='{COLOR}'>\"Our bank has enjoyed this marketing tool for some time.  We find it to be very \n"
texts[3] += "<b>professional, adaptable, and responsive</b>... \n"
texts[3] += "I would not hesitate to recommend EarGlue to any business owner or office manager.\" <br /> \n"
texts[3] += "<b>Nicholas Horner</b> - President & CEO<br /> \n"
texts[3] += "Regions Bank</font>";
texts[4] = "<font color='{COLOR}'>\"First Bank is very pleased with our service and product from your company.  \n"
texts[4] += "Our customers are constantly telling us about the products mentioned and the \n"
texts[4] += "professionalism of our ads.\" <br /> \n"
texts[4] += "<b>Wilburn J. Evans</b> - Executive Vice President<br /> \n"
texts[4] += "First Bank</font>";
texts[5] = "<font color='{COLOR}'>\"We have noticed that we are getting more inquiries about the features \n"
texts[5] += "we are announcing [while callers are on hold] such as group functions and gift \n"
texts[5] += "certificates.\" <br /> \n"
texts[5] += "<b>Cari Pirello</b> - Marketing Director<br /> \n"
texts[5] += "Rio Bravo Restaurants</font>";

var bgcolor = "#E75E0B"; 
var fcolor = "#FFFFFF";  //font color
var steps = 20; //number of steps to fade
var show = 8000; //milliseconds to display message
var sleep = 30; //milliseconds to pause in between messages
var loop = true; // true = continue to display messages, false = stop at last message

var colors = new Array(steps);
getFadeColors(bgcolor,fcolor,colors);
var color = 0;
var text = 0;
var step = 1;

function fade() {

var text_out = texts[text].replace("{COLOR}", colors[color]); 

if (document.all) fader.innerHTML = text_out; //IE
if (document.layers) { document.fader.document.write(text_out); document.fader.document.close(); } //Netscape

color += step; 

if (color >= colors.length-1) {
step = -1; 


if (!loop && text >= texts.length-1) return; 
}

if (color == 0) {
step = 1; 

text += 1;
if (text == texts.length) text = 0; 
}

setTimeout("fade()", (color == colors.length-2 && step == -1) ? show : ((color == 1 && step == 1) ? sleep : 50));
}

function getFadeColors(ColorA, ColorB, Colors) {
len = Colors.length; 
 
if (ColorA.charAt(0)=='#') ColorA = ColorA.substring(1);
if (ColorB.charAt(0)=='#') ColorB = ColorB.substring(1);

var r = HexToInt(ColorA.substring(0,2));
var g = HexToInt(ColorA.substring(2,4));
var b = HexToInt(ColorA.substring(4,6));
var r2 = HexToInt(ColorB.substring(0,2));
var g2 = HexToInt(ColorB.substring(2,4));
var b2 = HexToInt(ColorB.substring(4,6));

var rStep = Math.round((r2 - r) / len);
var gStep = Math.round((g2 - g) / len);
var bStep = Math.round((b2 - b) / len);

for (i = 0; i < len-1; i++) {
Colors[i] = "#" + IntToHex(r) + IntToHex(g) + IntToHex(b);
r += rStep;
g += gStep;
b += bStep;
}
Colors[len-1] = ColorB;
}

function IntToHex(n) {
var result = n.toString(16);
if (result.length==1) result = "0"+result;
return result;
}

function HexToInt(hex) {
return parseInt(hex, 16);
}
//End fading quotations

//Global Links Array - not bound yet
function LinkRecord(Name, URL, Description)
{
	this.Name = Name;
	this.URL = URL;
	this.Description = Description;
}

var LinkList = new Array();
LinkList[0] = new LinkRecord("On Hold", "oh1.html", "EarGlue On Hold");
LinkList[1] = new LinkRecord("Overhead Music", "is1.html", "EarGlue Harmony - Overhead music & messaging");
LinkList[2] = new LinkRecord("Telecom Solutions", "vodavi1.html", "EarGlue-Authorized Vodavi STS Telephone Systems");
LinkList[3] = new LinkRecord("Samples", "samples.html", "Listen to Sample EarGlue Messages");
LinkList[4] = new LinkRecord("Contact Us", "contactus.aspx", "Contact EarGlue For Pricing and Additional Information");
//End global declaration to be used in NavBar and site map functions

//Dynamically build the sidebar nav table
function BuildNavBar()
{
	var Links = new Array();
	Links[0] = "On Hold";
	Links[1] = "Overhead Music";
	Links[2] = "Telephone Systems";
	Links[3] = "Samples";
	Links[4] = "Pricing";
	Links[5] = "Contact Us";
	var Limit = Links.length;
	
	//var Images = new Array();
	//Images[0] = "images/ohlink.gif";
	//Images[1] = "images/islink.gif";
	//Images[2] = "images/vodavilink.gif";
	//Images[3] = "images/sampleslink.gif";
	//Images[4] = "images/pricinglink.gif";
	//Images[5] = "images/contactlink.gif";
	//var Limit = Images.length;
	
	var Anchors = new Array();
	Anchors[0] = "oh1.html";
	Anchors[1] = "is1.html";
	Anchors[2] = "vodavi1.html";
	Anchors[3] = "samples.html";
	Anchors[4] = "contactus.aspx";
	Anchors[5] = "contactus.aspx";
	var ALimit = Anchors.length;
	
	for (var i = 0; i < Limit; i++)	{
		var newTR = document.createElement("tr");
		var newTD = document.createElement("td");
		//var linkImage = document.createElement("img");
		var newText = document.createTextNode(Links[i]);
		var newLink = document.createElement("a");
		
		//linkImage.setAttribute("src", Images[i]);
		
		newLink.setAttribute("href", Anchors[i]);
		newLink.className = "NavBar";
		
		newTD.className = "SideBarCell";
		
		newTD.appendChild(newLink);
		newLink.appendChild(newText);
		//newLink.appendChild(linkImage);
		newTR.appendChild(newTD);		
		
		var tbody = document.getElementById("SideBar").firstChild;
		
		tbody.appendChild(newTR);
	}
}
//End sidebar construction
		


