/* ***** Begin: GreyWyvern's Buffered Text-fade Effect - v2.1 ****** */
var fader = new Array(), fadeQ = new Array();
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 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);
  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 = "&nbsp;";
    }
  } else setTimeout("fadeEng(" + number + ", " + message + ", " + direction + ");", 0);
}
/* ***** End: GreyWyvern's Buffered Text-fade Effect - v2.1 ******** */


/* ***** User defined fade objects and messages ******************** */
var Quotes=new Array();
Quotes[0]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>No hard rubbing (with the Teak Care System), it was really easy with a pan scourer. <A HREF='customer_comments.asp#1'>See the photos</A><nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Brian and Jennifer N</p>"
Quotes[1]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/><A HREF='customer_comments.asp#2'>Pretty Good we think</A>. A great product, many thanks.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Brian and Jennifer N</p>"
Quotes[2]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>Before and after using A Glaze Metal Restorer and Stainless Steel polish. <A HREF='customer_comments.asp#3'>Brilliant as usual</A> with all your products.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Geoff G</p>"
Quotes[3]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>I have now used A-Glaze on my yacht here in Turkey and am <A HREF='customer_comments.asp#4'>enclosing some photos</A> so you can see the results. I think the photos speak For themselves, showing the 'before' and 'after'.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Ray G - Turkey</p>"
Quotes[4]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>My <A HREF='customer_comments.asp#5'>favourite product</A> is Marine A Glaze.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Tony Jones, Motor Boat and Yachting</p>"
Quotes[5]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>Boats we have monitored have <A HREF='customer_comments.asp#18'>retained a healthy shine</A> well throughout the winter months.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Motor Boats Monthly</p>"
Quotes[6]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>We must say that Marine A Glaze craft sealant system is a <A HREF='customer_comments.asp#6'>fantastic product</A>.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Jet Skier and Watercraft Magazine</p>"
Quotes[7]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>We've inspected several boats coated with Marine A Glaze last year and they all look <A HREF='customer_comments.asp#7'>remarkably good</A>.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Peter Caplan - Boat Mart</p>"
Quotes[8]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>My Boat's not a new one but she's <A HREF='customer_comments.asp#8'>looking the best</A> she has in years after treatment with A Glaze.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Mr Castle - London</p>"
Quotes[9]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>I went down to look at the boat on Friday to see how she looked - <A HREF='customer_comments.asp#9'>Amazing!!!</A> I will be pleased to promote your products.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Mr B - South of England ref: Targa 50</p>"
Quotes[10]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>A quick rinse down is all our boat now needs after each trip out, the <A HREF='customer_comments.asp#10'>A Glaze keeps her looking perfect</A>.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Mr &amp; Mrs Dowling - Dublin</p>"
Quotes[11]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>So nice to see a product that <A HREF='customer_comments.asp#11'>lives up to ALL its claims</A>. This is a fantastic product and the people are great to deal with. I no longer polish my boat, I just watch others struggling with theirs!<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Geoff Gritton - Brightlingsea, Essex</p>"
Quotes[12]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>Not only was the application easy and trouble free but the finished results were amazing. I have never seen a 'blue-hulled' boat look so fantastic - <A HREF='customer_comments.asp#12'>a truly mirror finish</A>. It also has the added benefit of making the washing of the boat so much easier. No more stubborn black streaks! We have also used your protectors on all the canvas, fenders and tender. All great products.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Mr G. Martin - Kent</p>"
Quotes[13]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>An A Glaze test piece was conducted during the summer of 2004 with impressive results. Which reduced the ingress of exhaust fumes within the paint, aided the process of cleaning the hull and super structure. After 7 months of having the product applied we are still <A HREF='customer_comments.asp#13'>impressed with the results and shine</A>. The finished product once applied enhances any paint work and has aided Rahal's crew to maintain the high standards this industry requires for its owner.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Hamish Burr - MY RAHAL</p>"
Quotes[14]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>In September 2004 the transom and exhaust areas of M/Y Tugatsu had the A Glaze Paint Protection system applied. The areas mentioned had, as always, suffered from paint degradation due to the exhaust fumes continually bellowing down the side of the hull and around the stern. We found that the application of the A Glaze system immediately and <A HREF='customer_comments.asp#14'>dramatically improved the appearance</A> of the vessel. Prior to A Glaze being applied, the stern areas of TUGATSU had to be re-painted annually, however this year, no such work is needed as the A Glaze system has withstood a a busy season and fortunately TUGATSU does not need re-painting, which helps us enormously as the vessel is for sale.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Matthew Marlow - MY TUGATSU</p>"
Quotes[15]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>During the spring of 2004, RMP Marine were commissioned to polish and treat Aladina with their A Glaze finishing/protection system. Before they started the gel coat on the boat was very aged and matt causing us to have great difficulty keeping it clean. After 2 weeks of polishing the finish was almost back to a new condition, the A Glaze system appears to have <A HREF='customer_comments.asp#15'>withstood the elements</A> and cleaning products applied throughout the season.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Scott Walton - MY ALADINA</p>"
Quotes[16]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>The yacht <A HREF='customer_comments.asp#16'>looks better now than on the day of delivery</A> by the yard, on the areas of most fading the team worked tirelessly to ensure we were completely satisfied. Their work exceeded my expectations and I will not hesitate to use them in the future.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Stuart Andrews - MY LADY LUCK</p>"
Quotes[17]="<p style='text-align:left;'><img src='images/quotationmarkbegin.gif' width='10' height='7' align='texttop'/>Phryne is a 50mt Perini Navi Sailing Yacht with a blue hull and white superstructure. After completing a two year circumnavigation, Phryne was almost ready for a complete paint job....I decided to go ahead with the treatment (A Glaze) starting with the blue hull during our yard period. We could see immediately how well the system was giving depth and returning the original gloss to our Perini blue hull. I would certainly recommend this treatment to other Captains as this has <A HREF='customer_comments.asp#17'>certainly extended the life of the paint work</A> on Phryne.<nobr><img src='images/quotationmarkend.gif' width='10' height='7' align='texttop'/></nobr></p><p style='text-align:left;'>Captain Stuart Bird - MY Phryne</p>"
/* UPDATE settings.asp randomquote() AS WELL */

var fader=new Array();
fader[0] = new fadeObj(0, 'fade0', 'dddddd', '000000', 60, 60, true);
for(var i=0;i<Quotes.length;i++)
     fader[0].message[i]=Quotes[i];

var olditem=-1;

function fadeRandom(){
     if(olditem>-1)
          fade(0,olditem,false);
     var newitem=-1;
     while(newitem<0 || newitem==olditem)
          var newitem=parseInt(fader[0].message.length*Math.random());
     fade(0,newitem,true);
     olditem=newitem;
}

var fadeInterval=window.setInterval('fadeRandom();',25000);
