function toggleMoreInfo(id) {

  var linkEl, divEl;

  imgEl = document.getElementById("moreImg" + id);
  divEl = document.getElementById("moreDiv" + id);
  
  if (divEl.style.display == "") {
    divEl.style.display = "none";
    imgEl.src = imgEl.src.toLowerCase().replace("hide", "show");
    imgEl.alt = "Show"
  }
  else {
    divEl.style.display = "";
    imgEl.src = imgEl.src.toLowerCase().replace("show", "hide");
    imgEl.alt = "Hide"
  }
  return false;
}

//used on all pages where user has options for regional searches (by state, by zip, local listings)
//including the BTM directory and the Station List
//Author: Nick LaPolla
function toggleDiv(id, idNum, num)
{
  var tf = false
  if (idNum > 0) { tf = true; }
  var divId, divElement;
  for ( i=1; i<=num; i++ )
  {
	divId = id + i;
	divElement = document.getElementById(divId);
	divElement.style.display = "none";
  }
  if (idNum > 0)
  {
      if (tf == true)
      {
        if (idNum < 2 )
        {
            if (tf == true) 
            {
                idNum = 1;
            }
        }
	    divId = id + idNum;
	    divElement = document.getElementById(divId);
	    divElement.style.display = "";
      }
  }
  return false;
}

//used on the Community Calendar Page
//Author: Nick LaPolla
function inactivateEndTimeDdls ( ddl1, ddl2, ddl3 )
{
	var ddlObj1, ddlObj2, ddlObj3;
	ddlObj1 = document.getElementById(ddl1);
	ddlObj1.disabled = !ddlObj1.disabled;
	ddlObj2 = document.getElementById(ddl2);
	ddlObj2.disabled = !ddlObj2.disabled;
	ddlObj3 = document.getElementById(ddl3);
	ddlObj3.disabled = !ddlObj3.disabled;
}

//used on the Community Calendar Page
//Author: Nick LaPolla
function toggleMultiDivs(id, e, txtbx, total)
{
  var divId, divElement;
  var isNumber = true;
  //if (e != null) { isNumber = numberOnly(e); }

  for ( i=1; i<=total; i++ )
  {
	divId = id + i;
	divElement = document.getElementById(divId);
	divElement.className = "hide";
  }

  if (isNumber)
  {
    //If a dependent checkbox control is passed and someone enters a number here, the checkbox will be unchecked
    //this "if" is a special exception for Community Calendar - otherwise, pass null for "otherControl"
    //if (otherControl != null)
    //{
    //   otherControl.checked = false;
    //   toggleDiv('NoDate', 0, 1);
    //}

	var num = txtbx.options[txtbx.selectedIndex].value;
	//var num = keyPressed(e);
	//if (num > total) 
	//{
	//	num = total;
	//	txtbx.value = num;
	//}
	//else { txtbx.value = num; }
	for ( i=1; i<=num; i++ )
	{
		divId = id + i;
		divElement = document.getElementById(divId);
		divElement.className = "show";
	}
  }
  else { txtbx.value = ""; }

  return isNumber;
}

//used in Community Calendar
function toggleDivController (thisId, thisNum, thisTotal, otherId, otherControl, otherTotal)
{
	toggleDiv(thisId, thisNum, thisTotal);
	toggleMultiDivs(otherId, null, otherControl, null,  otherTotal)
}

