﻿function showDiv(theCTLID, replaceText)
{
  var theCTL = theCTLID.replace(replaceText, 'showDiv');
  var divCTL = document.getElementById(theCTL);

  if (divCTL.style.visibility == 'visible')
  {
    divCTL.style.visibility = 'hidden';
  }
  else
  {
    divCTL.style.visibility = 'visible';
  }
  //end if
}
//end function

function ChangeFontSize(direction)
{
	var p = document.getElementsByTagName('p');

	for(n = 0; n < p.length; n++) {
		if (direction == "up") 
		{
			var size = 15;
		} 
		else 
		{
			var size = 12;
		}
    //end if
    
		p[n].style.fontSize = size + 'px';
	}
	//end foreach
}
//end function

function ShowAnswer(theAnswer)
{
  var divAnswer = document.getElementById('answer' + theAnswer);
  var divImage = document.getElementById('question' + theAnswer + 'img');
  var lastOpenQuestion = document.getElementById('txtLastOpenQuestion');
  
  if (divAnswer.style.display == 'none')
  {
    divAnswer.style.display = 'block';
    divImage.src = 'images/FAQs/Hide.gif';  
  }
  else
  {
    divAnswer.style.display = 'none';
    divImage.src = 'images/FAQs/Show.gif';
  }
  //end if
  if (lastOpenQuestion.value != theAnswer)
  {
    document.getElementById('answer' + lastOpenQuestion.value).style.display = 'none';
    document.getElementById('question' + lastOpenQuestion.value + 'img').src = 'images/FAQs/Show.gif';    
  }
  //end if
  lastOpenQuestion.value = theAnswer;
}
//end function

function HighlightRow(theCTLID, ctlName, rowName)
{
  var activeRow = theCTLID.replace(ctlName, rowName);
  var iLarge = ctlName.indexOf('Large');
  var theClass = 'faqLLSelected';
  
  if (iLarge != -1)
  {
    theClass += 'Large';
  }
  //end if
  
  document.getElementById(activeRow).className = theClass;
  if ((document.getElementById('txtRowName').value != "") && (document.getElementById('txtRowName').value != activeRow))
  {
    document.getElementById(document.getElementById('txtRowName').value).className = 'faqLL';
  }
  //end if
  document.getElementById('txtRowName').value = activeRow;
}
//end function