/**************************************************

Joshua K Roberson
Extra and random small but useful functions

**************************************************/

// Popup window
// IE7 has a security setting that displays address bar even if turned off
function extras_popUp(URL, w, h, scroll) {
  day = new Date();
  id = day.getTime();
  if(w == 0 || w > screen.width)  w = screen.width;
  if(h == 0 || h > screen.height) h = screen.height;
  LeftPos = (screen.width) ? (screen.width-w)/2 : 0;
  TopPos  = (screen.height) ? (screen.height-h)/2 : 0;
  settings = 'resizable=1,toolbar=0,location=0,statusbar=0,menubar=0,width='+w+',height='+h+',top='+TopPos+',left='+LeftPos+',scrollbars='+scroll;
  eval("page" + id + " = window.open(URL, '" + id + "', '"+settings+"');");
  return false;
}

// Show longer list when "more" link clicked
function extras_toogleDisplay(id_hide, id_show) {
  var id1 = id_hide;
  var id2 = id_show;
  var div1 = null;
  var div2 = null;

  if(document.getElementById) {
    div1 = document.getElementById(id1);
    div2 = document.getElementById(id2);
  } else if(document.all) {
    div1 = document.all[id1];
    div2 = document.all[id2];
  } else if(document.layers) {
    div1 = document.layers[id1];
    div2 = document.layers[id2];
  }

  div1.style.display = 'none';
  div2.style.display = 'block';
}
