var fader = new Array(), fadeQ = new Array();
var textx = 0;
var RGB = new Array(256), k = 0, hex = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];
for (var i = 0; i < 16; i++) for (var j = 0; j < 16; j++) RGB[k++] = hex[i] + hex[j];
function get_random()
{
var ranNum= Math.floor(Math.random()*18);
return ranNum;
}
function fadeObj(number, id, colOff, colOn, spdIn, spdOut, def) {
this.number = number;
this.id = id;
this.colOff = [parseInt(colOff.substr(0, 2), 16), parseInt(colOff.substr(2, 2), 16), parseInt(colOff.substr(4, 2), 16)];
this.colOn = [parseInt(colOn.substr(0, 2), 16), parseInt(colOn.substr(2, 2), 16), parseInt(colOn.substr(4, 2), 16)];
this.colNow = [parseInt(colOff.substr(0, 2), 16), parseInt(colOff.substr(2, 2), 16), parseInt(colOff.substr(4, 2), 16)];
this.spdIn = spdIn;
this.spdOut = spdOut;
this.def = def;
this.direction = false;
this.active = false;
this.message = new Array();
this.messageNow = 0;
}
function fadeCmd(number, message, direction) {
this.number = number;
this.message = message;
this.direction = direction;
}
function fade(number, message, direction) {
if (fader[number].def && fader[number].messageNow == 0 && fader[number].direction) {
fadeQ[fadeQ.length] = new fadeCmd(number, 0, false);
fadeQ[fadeQ.length] = new fadeCmd(number, message, direction);
message = 0;
direction = false;
} else fadeQ[fadeQ.length] = new fadeCmd(number, message, direction);
setTimeout("fadeBegin(" + number + ");", 20);
}
function fadeBegin(number) {
for (var x = 0; x < fadeQ.length; x++) {
for (var y = x + 1; y < fadeQ.length; y++) {
if (fadeQ[x].number == fadeQ[y].number && fadeQ[x].message == fadeQ[y].message && fadeQ[x].direction != fadeQ[y].direction) {
fadeQ.splice(x, 1);
fadeQ.splice(y - 1, 1);
}
}
}
if (!fader[number].active) {
for (var x = 0; x < fadeQ.length; x++) {
if (fadeQ[x].number == number && fadeQ[x].direction != fader[number].direction) {
var del = fadeQ.splice(x, 1);
setTimeout("fadeEng(" + number + ", " + del[0].message + ", " + del[0].direction + ");", 0);
break;
}
}
}
}
function fadeEng(number, message, direction) {
if (!fader[number].active) {
fader[number].active = true;
fader[number].direction = direction;
fader[number].messageNow = message;
document.getElementById(fader[number].id).innerHTML = fader[number].message[message];
}
var iniCol = (direction) ? fader[number].colOff : fader[number].colOn;
var endCol = (direction) ? fader[number].colOn : fader[number].colOff;
var incCol = fader[number].colNow;
var spd = (direction) ? fader[number].spdIn : fader[number].spdOut;
for (var x = 0; x < 3; x++) {
var incr = (endCol[x] - iniCol[x]) / spd;
incCol[x] = (incr < 0) ? Math.max(incCol[x] + incr, endCol[x]) : Math.min(incCol[x] + incr, endCol[x]);
}
document.getElementById(fader[number].id).style.color = "#" + RGB[parseInt(incCol[0])] + RGB[parseInt(incCol[1])] + RGB[parseInt(incCol[2])];
if (incCol[0] == endCol[0] && incCol[1] == endCol[1] && incCol[2] == endCol[2]) {
fader[number].active = false;
for (var x = 0; x < fadeQ.length; x++) {
if (fadeQ[x].number == number) {
var del = fadeQ.splice(x, 1);
setTimeout("fadeEng(" + number + ", " + del[0].message + ", " + del[0].direction + ");", 0);
return false;
}
}
if (!direction) {
if (fader[number].def) {
setTimeout("fadeEng(" + number + ", 0, true);", 0);
} else document.getElementById(fader[number].id).innerHTML = " ";
}
} else setTimeout("fadeEng(" + number + ", " + message + ", " + direction + ");", 0);
}
/* ***** End: GreyWyvern's Buffered Text-fade Effect - v2.2 ******** */
/* ***** User defined fade objects and messages ******************** */
fader[0] = new fadeObj(0, 'fade0', 'dddddd', '000000', 20, 20, true);
fader[0].message[0] = "Very professional, very helpful, polite and enthusiastic. Dealt with problem efficiently and comprehensively.
Hannah Dwyer (Sector: Charity), 12/01/2010 (28 days ago)";
fader[0].message[1] = "To be honest, the service I receive whenever I call Wavex is better than Good. This call was no exception. Excellent as always.
Andrea Papaconstantinou (Sector: Recruitment), 12/01/2010 (28 days ago)";
fader[0].message[2] = "Super fast service that I needed...where is the excellent button.
Nicholas Brandon (Sector: Distribution), 13/01/2010 (27 days ago)";
fader[0].message[3] = "No - I was very pleased with the service I received today.
Alison Kennedy (Sector: Recruitment), 13/01/2010 (27 days ago)";
fader[0].message[4] = "Great work, excellent turn around, never seen such a speedy response before...lol
Divesh Davdra , 11/01/2010 (29 days ago)";
fader[0].message[5] = "No problems..would not have known this was a new engineer..good job!
Kevin hawkins (Sector: Financial Services), 14/01/2010 (26 days ago)";
fader[0].message[6] = "Neil is a very efficient and polite individual with fantastic customer service. He has been most helpful
Janice Telfer (Sector: Charity), 05/01/2010 (35 days ago)";
fader[0].message[7] = "Excellent Service.
Chirag Patel (Sector: Recruitment), 06/01/2010 (34 days ago)";
fader[0].message[8] = "Great service as usual!
Julie Lodge (Sector: Oil & Mining), 06/01/2010 (34 days ago)";
fader[0].message[9] = "as usual, excelent service
Yael Shmueli-Goetz (Sector: Charity), 08/01/2010 (32 days ago)";
fader[0].message[10] = "thanks very much! Matt just saved me 3 hours of work.
Sarah Westlake (Sector: Charity), 11/01/2010 (29 days ago)";
fader[0].message[11] = "efficient and accurate. Thanks
Darren Fernee (Sector: Marketing / Media / PR), 12/01/2010 (28 days ago)";
fader[0].message[12] = "As always, your technician's support is consistently good. Paul was most efficient and courteous. Thank you, Paul.
Beverley Stansfield (Sector: Charity), 23/12/2009 (48 days ago)";
fader[0].message[13] = "Very quick response!
Geoff Snow (Sector: Oil & Mining), 05/01/2010 (35 days ago)";
fader[0].message[14] = "Although I still am not able to download the document, this is as a result of my phone and not the engineers fault. His quick help saved me about an hour of trying to do myself!
Jenna Litchfield (Sector: Charity), 06/01/2010 (34 days ago)";
fader[0].message[15] = "San dealt with me extremely well and prompted me to deal with the issue on my return to work. He had good inter-personal skills.
Michael John Carr (Sector: Charity), 11/01/2010 (29 days ago)";
fader[0].message[16] = "Very easy to deal with
Kirsty Lewis (Sector: Prof services - Law), 08/01/2010 (32 days ago)";
fader[0].message[17] = "Quick and good as always. Thanks.
Juan LO BELLO (Sector: Distribution), 11/01/2010 (29 days ago)";
fader[0].message[18] = "Very prompt, thank you.
Abigail Cartledge (Sector: Financial Services), 13/01/2010 (27 days ago)";
fader[0].message[19] = "Very efficient.
Rowena Lai (Sector: Financial Services), 13/01/2010 (27 days ago)";
document.getElementById(fader[0].id).style.color = "#123333"
var running = 0
function fadeMain() {
if (running == 1) {
fade(0, textx, false);
} else {
running = 1;
textx = get_random();
}
textx++;
if (textx > 19) {textx=0}
fade(0, textx, true)
setTimeout('fadeMain();',5000);
}
fadeMain();