var state = 'none';

function showhide(layer_ref)
{
  if (state == 'block')
  {
    state = 'none';
  } 
  else {
    state = 'block';
  }
  if (document.all)
  {
    eval( "document.all." + layer_ref + ".style.display = state");
  }
  if (document.layers)
  {
    document.layers[layer_ref].display = state;
  }
  if (document.getElementById &&!document.all)
  {
    hza = document.getElementById(layer_ref);
    hza.style.display = state;
  }
}

function toggleSpecific(tagName, targetClass, prefix, idname)
{
  divs = document.getElementsByTagName(tagName);
  for ( i=0; i<divs.length; i++)
  {
    thisDiv = divs[i];
    if (thisDiv.className == targetClass)
    {
      // alert(thisDiv.id);
      divPrefix = thisDiv.id.substr(0, prefix.length + 1);
      if (divPrefix == prefix+ ':' )
      {
        thisId = thisDiv.id.substr(divPrefix.length);
        thisDiv.style.display = (thisId == idname) ? 'block' : 'none';
      }
    }
  }
}

function toggleSpecificLayers(targetClass, prefix, idname) {
  toggleSpecific('div', targetClass, prefix, idname);
}
function toggleSpecificSpan(targetClass, prefix, idname) {
  toggleSpecific('span', targetClass, prefix, idname);
}
// track zip code on find child care search
function trackZipSearch(category) {
	var zip_code = document.getElementById('zip_code').value;
	if (zip_code != '' && !isNaN(zip_code)) {
		_gaq.push(['_trackEvent', category, zip_code]);
	}
	return true;
}
