function rotateText(el, textGroup) {
  setOpacity(el, 0);
  var t = rotateText.texts[textGroup];
  var t = t[Math.floor(Math.random() * (t.length - 1))];
  el.innerHTML = t;
  unfadeText(el, textGroup);
}
rotateText.texts = {
  quotes: [
    "You have a very organized picture day, which makes it very nice with so many young girls.",
    "Staff was very professional and courteous, quick and efficient.  Photos are good quality.",
    "The picture taking process was very organized and your staff was very helpful and friendly.",
    "We have always been pleased with our photos from Pawsat.  The only suggestion I could ever make was there was once or twice where the sun was facing the girl's faces so they were squinting a little.  The photos were still very cute though.  The wait is always minimal, etc.  The staff is always friendly and efficient. Thanks.",
    "It would be nice to have the option of Pawsat coming to practice times.",
    "Satisfied with the overall experience with Pawsat Pro Photo.",
    "Everything moved quickly.  Was some confusion in the beginning - didn't know if we had to wait to hand in our order forms as a group, or individually.",
    "I think you guys are wonderful!  You are always pleasant and patient with our kids.",
    "Staff was wonderful with all the kids. Our Pictures are perfect!! Prices are a bit high. Overall terrific!!",
    "I loved the pictures of my daughter they were so clear and u captured a great moment 4 us. I only have my space or cell number thank u",
    "I thought my daughter's pictures turned out really well.",
    "Pictures turned out wonderful... would definitely use again!",
    "I was pleased with the professionalism of the photographers and the ease that they made the children feel.  Olivia was not feeling well and they were able to take her picture and get her to smile with no problem.  They also waited for the group picture while she used the restroom - which was extremely nice.  Everyone had smiles and were very pleasant.  Thanks!",
    "I am completely satisfied with my entire purchase.  The price is reasonable enough to even please my daughter herself.  She loves to pass her trading cards out.  Also, we got them very quickly.",
    "being flexible with changing times, quick and efficient timing with on the day of photos, did not have to wait long at all",
    "I would have liked to have seen the wording (team name) of the uniform on my daughter's jersey. Instead, the soccer ball she was holding blocked the name of her team. It's best to have the children hold the soccer ball to the side on their hip. That is what I would have changed.",
    "I think the Pawsat Pro Photo group is highly organized and professional. Photos are reasonably priced.",
    "The staff was friendly and professional and the pictures were good quality-the packages were a little expensive for the number of pictures you receive.",
    "The day of the photo shoot the 'Staff' was extremely helpful and created a stress free environment."
  ]
};

function setOpacity(el, value) {
  el.style.opacity = value / 100;
  el.style.filter = "alpha(opacity=" + value + ")";
}

function unfadeText(el, tg) {
  var v = el.style.opacity * 100 + 1;
  if(v > 100) {
    setOpacity(el, 100);
    setTimeout(bundleFunction(null, fadeText, [el, tg]),10000);
    return;
  }
  setOpacity(el, v);
  setTimeout(bundleFunction(null, unfadeText, [el, tg]), 10);
}

function fadeText(el, tg) {
  var v = el.style.opacity * 100 - 1;
  if(v < 0) {
    setOpacity(el, 0);
    rotateText(el, tg);
    return;
  }
  setOpacity(el, v);
  setTimeout(bundleFunction(null, fadeText, [el, tg]), 10);
}

function bundleFunction(context, func, args) {
  context = context || null;
  if(typeof func == "string" && context)
    func = context[func];
  if(!args)
    args = [];
  else if(!(args instanceof Array))
    args = [args];
  return function() {
    return func.apply(context, args);
  };
}
