function ShowHide(id) {
  var st = document.getElementById(id).style;
  if (st) {
    if (st.display != "none") {
      st.display = "none";
    } else {
      st.display = "block";
    }
  } else {
    alert('Error:');
  }
}

function ShowHideForce(element, id) {
  var st = document.getElementById(id).style;
  if (element.checked == true) {
    st.display = "none";
  } else {
    st.display = "block";
  }
}

function ShowElement(id) {
  var st = document.getElementById(id).style;
  st.display = "block";
}

function HideElement(id) {
  var st = document.getElementById(id).style;
  st.display = "none";
}

function ShowHideOption(element, id) {
  if (element.selectedIndex == 0) {
    HideElement(id);
  } else {
    ShowElement(id);
  }
}

function ChangeDateRange(element, fromid, toid) {
  if (element.selectedIndex == 0) {
    HideElement(fromid);
    HideElement(toid);
  }
  if (element.selectedIndex == 1) {
    ShowElement(fromid);
    HideElement(toid);
  }
  if (element.selectedIndex == 2) {
    HideElement(fromid);
    ShowElement(toid);
  }
  if (element.selectedIndex == 3) {
    ShowElement(fromid);
    ShowElement(toid);
  }
}

function WhichBrowser () {
  var browser;
  with(navigator) {
    if(appName.charAt(0) == "N") {  // Mozilla
      if(appVersion.indexOf("4.0") >= 0)
        v = appName + " 4.0";
      else if(appVersion.indexOf("3.0") >= 0)
        v = appName + " 3.0";
      else
        v = "other";
    }
    else if(appName.charAt(0) == "M") { // IE
      if(appVersion.indexOf("4.0") >= 0)
        v = appName + " 4.0";
      else if(appVersion.indexOf("3.0") >= 0)
        v = appName + " 3.0";
      else
        v = "other";
    } // Others
    else
      v = "other";
  }
  alert(v);
}
