﻿

var currentFaq = ''; //The id of the current expanded FAQ.

/* Clicking the FAQ title toggles the FAQ
between expanded and collapsed states.*/
function faq_mouseClick(faqId)
{

    if(faqId == currentFaq)
    {
     collapsefaq(faqId);
     currentFaq = '';
    }
    else expandfaq(faqId);
}


//Expands the feature with the given featureId
//and collapses the feature with the currentFeature id.
function expandfaq(faqId)
{

    //hide the previously selected feature.
    if (currentFaq != '')collapsefaq(currentFaq);
    
    //show the big paragraph
    var paradiv = document.getElementById(faqId);
 //   if(paradiv!=null)paradiv.className = 'featurepara'; 
    if(paradiv!=null)paradiv.style.visibility='visible';
    if(paradiv!=null)paradiv.style.display='block';
      

    //expand the div height to 'auto'
    var faq = document.getElementById(faqId);
    if(faq ==null)return;
    faq.style.height = 'auto';
    faq.style.display='block';
   
   
    //keep track of which feature is currently expanded.
    currentFaq = faqId;   
}


   
 //Collpases the feature indiceated by the featureId param.
function collapsefaq(faqId)
{

    var faq = document.getElementById(faqId);
    
    
    //hide the long paragrph 
    var paradiv = document.getElementById(faqId);
    if(paradiv!=null)paradiv.style.visibility = 'hidden';
    if(paradiv!=null)paradiv.style.display='none';
    

}

