$C = document.getElementsByClassName;

/**
 * Raise a help popup window, defaulting to bo standard size and name.
 *
 * @param {Object} linkRef if this is a String, it will be used as the URL
 * of the popped window; otherwise it's assumed to be an HTMLAnchorElement
 * (or some other object with "target" and "href" properties).
 *
 * @param {Object} options supports the following options:
 *  target: (Object) target (window name). If null, linkRef.target will 
 *          be used. If *that's* null, the default is "bo_popup".
 *  width: (Number) window width. If null, the default is 690.
 *  height: (Number) window height. If null, the default is 500.
 *  toolbar: (Boolean) show toolbar
 *  scrollbars: (Boolean) show scrollbars
 *  location: (Boolean) show location
 *  statusbar: (Boolean) show statusbar
 *  menubar: (Boolean) show menubar
 *  resizable: (Boolean) resizable
 *
 * @return {Boolean} true if the window was not popped up, false if it was.
 */
wt_popup = function(linkRef, options) {
  var DEFAULT_POPUP_TARGET = 'bo_popup';
  var DEFAULT_POPUP_HEIGHT = 500;
  var DEFAULT_POPUP_WIDTH = 690;

  if (!window.focus) return true;

  var default_options = {
    width: DEFAULT_POPUP_WIDTH,
    height: DEFAULT_POPUP_HEIGHT,
    toolbar: 1,
    scrollbars: 1,
    location: 1,
    statusbar: 1,
    menubar: 1,
    resizable: 1
  };

  options = options || {};
  for (var option in default_options) {
    if ((! (option in options)) || options[option] === null) {
      options[option] = default_options[option];
    }
  }

  var href = typeof linkRef == 'string' ? linkRef : linkRef.href;
  var target = options.target || linkRef.target || DEFAULT_POPUP_TARGET;
  delete options['target'];

  var optionString = '';
  for (var option in options) {
    if (optionString != '') optionString += ',';
    optionString += option + '=' +
      (options[option] === true ? '1' :
         (options[option] === false ? '0' : options[option]));
  }

  var newWin = window.open(href, target, optionString);
  newWin.focus();
  
  return false;
}

function nzco_search_change(){
	var byname = $("byname");
	var bykws = $("bykws");
	var s = $("stype");
	if(s.value == "kws"){
		byname.hide();
		bykws.show();
	}else{
		byname.show();
		bykws.hide();
	}
}

