function doUniqueNumberSearch() {
  var un = document.getElementById('uniqueNum').value;
  window.location="uniquenumbersearch.action?un=" + un;
}

function searchOnEnter(field,e) {
  var keycode;
  if(window.event) {
    keycode = window.event.keyCode;
  } else if(e) {
    keycode = e.which;
  } else {
    return true;
  }

  if (keycode == 13) {
    doUniqueNumberSearch()
    return false;
  } else {
    return true;
  }
}

function doSearch() {
  hideAll();
  var commercial = document.getElementById("commercial_break");
  commercial.src = "commercial-break.action";
  commercial.style.visibility = "visible";
  commercial.style.display = "block";
  
  //  set iframe size
  commercial.style.width = getPageWidth() + "px";

  self.scrollTo(0, 0);
  setTimeout("runsearch()",4000);
}

function runsearch() {
  document.searchForm.submit();
}

function getPageWidth() {
  if(navigator.appName == "Microsoft Internet Explorer") {
    return document.body.scrollWidth;
  }
  var w = document.documentElement.offsetWidth;
  if (window.scrollMaxX) {
    w += window.scrollMaxX;
  }
  return w;
}

function hideAll() {
  var divs = document.getElementsByTagName("div");
  for(i = 0; i < divs.length; i++){
    divs[i].style.display = "none";
  }
}