
var ContentHeight = 375;
var TimeToSlide = 300.0;
var openAccordion = '';

function runAccordion(index)
{

  var nID = "Accordion" + index + "Content";
//  var acctitleId = "acctitle" + index;
 /* var imageId = "myButton" + index;*/
  if(openAccordion == nID)
    nID = '';

  setTimeout("animate("
      + new Date().getTime() + ","  + TimeToSlide + ",'"
      + openAccordion + "','" + nID  + "')", 33);

  openAccordion = nID;
}

function animate(lastTick, timeLeft, closingId, openingId)
{
    
  var curTick = new Date().getTime();
  var elapsedTicks = curTick - lastTick;

  var opening = (openingId == '') ?
      null : document.getElementById(openingId);
  var closing = (closingId == '') ?
      null : document.getElementById(closingId);
 /*alert("Variables: " + lastTick + timeLeft + closing + opening + imageId);*/
  if(timeLeft <= elapsedTicks)
  {
    if(opening != null)
      opening.style.height = ContentHeight + 'px';
	 if(closing != null)
    {
      closing.style.display = 'none';
      closing.style.height = '0px';
	 /* document.getElementById(imageId).src="images/plus.gif";*/
    }

    return;
  }

  timeLeft -= elapsedTicks;
  var newClosedHeight =
      Math.round((timeLeft/TimeToSlide) * ContentHeight);

  if(opening != null)
  {
    if(opening.style.display != 'block')
      opening.style.display = 'block';
    opening.style.height =
        (ContentHeight - newClosedHeight) + 'px';
     /* swapImage(imageId, "minus");*/
     /*document.getElementById(imageId).src ="images/minus.gif";*/
  }

  if(closing != null)
    closing.style.height = newClosedHeight + 'px';
setTimeout("animate(" + curTick + "," + timeLeft + ",'"
      + closingId + "','" + openingId  + "')", 33);

}

// The below are for countyInddetail.jsp file
function showHideItems(myItem, myButton)
{

    //this is the ID of the hidden item
    var myitem = document.getElementById(myItem);
    //this is the ID of the plus/minus button image
    var mybutton = document.getElementById(myButton);
    if (myitem.style.display != "none") {
    //items are currently displayed, so hide them
    myitem.style.display = "none";

    swapImage(mybutton,"plus");
    }
    else {

    //items are currently hidden, so display them
    myitem.style.display = "block";
    swapImage(mybutton,"minus");
    }
 }


//function to swap an image based on its current state
function swapImage(myImage, state) {

if (state == "minus") {

myImage.src = "images/minus.gif";
}

else {
myImage.src = "images/plus.gif";
}

}


 /* jQuery functions begin here - used in the welcome page for FAQs */
$(function() {
  // hide answers from view:
  $("div.answer").hide();

  // function displays the answers when the corresponding question link is clicked:
  $("a.question").click(function() {
    // use fact that question links have ids = some integer and corresponding answers have
    // ids = that same integer:
    var answer = $("#a" + $(this).attr('id'));
    answer.slideToggle("fast");
  });

  $("#openAll").click(function() {
    $("div.answer").each(function() {
      $(this).slideDown("fast");
    });
  });

  $("#closeAll").click(function() {
    $("div.answer").slideUp("fast");
  });

/*$("div.AccordionContainer").corner("tl tr round 10px");*/
/*$("div.AccordionTitle").hover(function() {
   $(this).css({backgroundColor: 'red'});
});*/

 /* $("dd:not(:first)").hide();*/
	          $('#accordion dd').hide();
		       $("dt a").click(function(){
			$("dd:visible").slideUp("slow");
			$(this).parent().next().slideDown("slow");
			return false;
		});

});

function ffhelpWindow()
 {
  mywindow = open('html/ffhelp.htm', 'myname', 'resizable=no, scrollbars=yes, width=560, height=620');
  if(mywindow.opener == null) mywindow.opener=self;
 }




