function setPointer(element, num, color1, color2, color3) {
}

function showElement(element) {
  document.getElementById(element).style.display="block";
}

function hideElement(element) {
  document.getElementById(element).style.display="none";
}

function makeOption(value, text) {
  var opt = document.createElement("option");
  opt.value = value;
  //opt.innerHTML = text; // REMARKED BY KEN ON 20071209
  opt.text = text; // ADDED BY KEN ON 20071209
  return opt;
}

function changeCatetype() {
  var category = document.getElementById("category");
  with (document.getElementById("catetype_ctrl") ) {
    if (category.value%10000 == 999)
      style.display = "block";
    else style.display = "none";
  }
  document.getElementById("catetype").value = category[category.selectedIndex].innerHTML;
}

function changeCategory() {
  with(document.getElementById("cate") ) {
    var category = document.getElementById("category");
    category.selectedIndex = 0;
    killOption(category);
    if (selectedIndex>0) addOption(category, cate[selectedIndex]);
  }
  changeCatetype();
}

function killOption(sel) {
  with (sel) while (options.length>1) remove(options.length-1);
}

function addOption(sel,optArr) {
  with (sel) for (var i=0; i<optArr.length; i++) options.add(optArr[i]);
}

function $(elementId) {
  return document.getElementById(elementId);
}

function highLightError(elemFocus,elemHL, failCond, oriColor) {
try {
  if (!oriColor) oriColor = "#666666";
  if (failCond) {
    elemHL.style.color = "#FF0000";
    elemFocus.focus();
    return false;
  } else elemHL.style.color = oriColor;
  return true;
} catch (e) { alert(e+"\n"+e.message); }
return false;
}

function bodyScroll(e) {
  with ($("disclaimer") ) {
    if (document.documentElement)
      //style.top = (document.documentElement.scrollTop + document.documentElement.offsetHeight / 2 - offsetHeight / 2) +"px";
      style.top = (document.documentElement.scrollTop + document.documentElement.offsetHeight / 3) +"px";
    else
      //style.top = (window.scrollY + window.innerHeight / 2 - offsetHeight / 2) +"px";
      style.top = (window.scrollY + window.innerHeight / 3) +"px";
  }
}

function showDisclaimer(elem) {
  //window.onscroll = function(event) { bodyScroll(event); }
  with ($("disclaimer") ) {
    var a = getElementsByTagName("a")[0];
    a.href = elem.href;
    if (elem.target) a.target = elem.target;
    //bodyScroll(null);
    showElement(id);
    $("popupTop").focus();
    $("popupLink").focus();
  }
}
function hideDisclaimer() {
  hideElement("disclaimer");
  //window.onscroll = "";
  return false;
}

function defaultWord(txtField,word,remove) {
  if (!remove && (txtField.value=="" || txtField.value.indexOf(word) > -1) ) txtField.value = word;
  else if(remove && txtField.value.indexOf(word) > -1) txtField.value = "";
}
function submitSearch(form,word) {
  return form.keyword.value != "" && form.keyword.value.indexOf(word) < 0;
}
