/**
 * @file
 * @author Shannon M. Rause <shannon.rause@creativeflavor.com>
 * @version $Revision: 1.2 $
 * @version $Name: BOEFOUNDATION_2010-05-11_4 $
 * @version $Id: Faq.js,v 1.2 2008/04/16 21:26:45 smr Exp $
 *
 * These files are copyrighted to Creative Flavor Inc. and are
 * subject to the terms of the applicable Service Agreement.
 * If no service agreement is available you must contact us at
 * legal@creativeflavor.com or 303-379-9450.
 * 
 * These files may be watermarked to ensure traceability.
 */
/**
 * Faq class.
 *
 * @public
 */
function Faq()
{
} // Faq


/**
 * Shows an FAQ answer.
 *
 * @param index   Index of answer to show.
 */
Faq.showAnswer = function(index)
{
   var i = 0;
   var visible = (document.getElementById('faqAnswer' + index).style.display == 'block');

   while (true)
   {
      if ((visible) ||
          (i != index))
      {
         // answer.
         var elem = document.getElementById('faqAnswer' + i);

         if (!elem)
         {
            break;
         } //  if

         elem.style.display = 'none';

         // minus box.
         elem = document.getElementById('faqQuestionBoxMinus' + i);
         
         if (elem)
         {
            elem.style.display = 'none';
         } // if

         // plus box.
         elem = document.getElementById('faqQuestionBoxPlus' + i);
         
         if (elem)
         {
            elem.style.display = 'inline';
         } // if
      } // if

      i++;
   } // while

   if (!visible)
   {
      // answer.
      document.getElementById('faqAnswer' + index).style.display = 'block';

      // minus box.
      elem = document.getElementById('faqQuestionBoxMinus' + index);
         
      if (elem)
      {
         elem.style.display = 'inline';
      } // if

      // plus box.
      elem = document.getElementById('faqQuestionBoxPlus' + index);
         
      if (elem)
      {
         elem.style.display = 'none';
      } // if
   } // if
} // showAnswer
   

