﻿// Common methods

function setOpenerHref(href) {
  /// <summary>
  /// Use this method to change the URL of the opener window or
  /// popup a new window if there is no opener.
  /// </summary>
  if (typeof(window.opener) === "object" && typeof(window.opener.location.href) !== "unknown") {
    window.opener.location.href = href;
    window.opener.focus();
  } else {
    window.open(href);
  }
}

function setVisible(element, value) {
  /// <summary>Extracted from Microsoft AJAX Control Toolkit</summary>
  if (element) {
    if (value) {
      if (element.style.removeAttribute) {
        element.style.removeAttribute("display");
      } else {
        element.style.removeProperty("display");
      }
    } else {
      element.style.display = 'none';
    }
    element.style.visibility = value ? 'visible' : 'hidden';
  }
}


