function download(id)
{
 var elt = document.getElementById(id);
 elt.submit();
}

function changeFontSize(from)
{
  var font_size = document.getElementById("font_size");
  window.document.body.style.fontSize = font_size.value + "pt"
  ajaxGetCall( "/phpscript/setSize.php", "size=" + font_size.value, null );
}

var una25 = "UNA.html"
var anderson = "AND.html"

//"http://www.wcupa.edu/_information/afa/Facilities/CampusMaps/mapSWO.htm"
//"http://www.wcupa.edu/_information/afa/Facilities/CampusMaps/mapAND.htm";

function openpopup(url, name, width, height) {
  var features =
    'width=' + width + ',height=' + height 
             + ',status=0,location=0,resizable=1,scrollbars=1';
  open( url, name, features );
}

function getTopPos(elt) 
{
  if (elt == null) 
    return 0
  else 
    return elt.offsetTop + getTopPos(elt.offsetParent)
}

function getLeftPos(elt) 
{
  if (elt == null) 
    return 0
  else 
    return elt.offsetLeft + getLeftPos(elt.offsetParent)
}

function set_div_size(holder) {
  if (holder == null) return
  var body_height = document.body.clientHeight
  var holder_top = getTopPos(holder)
  var min_height = body_height - holder_top - 60
  if (holder.offsetHeight < min_height)
    holder.style.height = min_height
}

function set_holder_size() { 
  set_div_size(document.getElementById("holder"))
}

function choose_section() {
  var section = document.getElementById("section_select")
  var sec = section.value
  var newloc = "#" + sec
  location = newloc
  //location.replace(newloc)
}

function showHide( btn_id, div_id, show, hide ) {
   var btn = document.getElementById( btn_id )
   var div = document.getElementById( div_id )
   if (!btn.val) {
     div.style.display = "block"
     btn.innerHTML = hide
     btn.val = 1
   } else {
     div.style.display = "none"
     btn.innerHTML = show
     btn.val = 0
   }
}

function make_fixed() {
  if (window.location.toString().indexOf("#", 0) == -1)
    window.location.replace( window.location + "#")
  blur()
}
