var isNav, isIE
var coll=""
var styleObj=""

function showLibLoaded() {
 alert('lib.js loaded OK')
}

if (parseInt(navigator.appVersion) >= 4) {
 if (navigator.appName == "Netscape") {
  isNav = true
 } else {
  isIE = true
  coll = "all."
  styleObj = ".style"
 }
}

function getInsideWindowWidth() {
 if (isNav) {
  return window.innerWidth
 } else {
  return document.body.clientWidth
 }
}

function getObject(obj) {
  var theObj
  if (typeof obj == "string") {
    theObj = eval("document." + coll + obj + styleObj)
  } else {
    theObj = obj
  }
  return theObj
}

function shiftTo(obj, x, y) {
 theObj = getObject(obj)
 if (isNav) {
  theObj.moveTo(x,y)
 } else {
  theObj.pixelLeft = x
  theObj.pixelTop = y
 }
}

function getBannerX() {
     calcx = (getInsideWindowWidth() - 800) * 2/3
     targetx = Math.max(0, calcx)
     return targetx
}
function writeBanner() { 
     document.write('<div id="banner" style="position:relative; left:' + getBannerX() + '; top:0">')
     document.write('<img src="/struct/banner" alt="Utrechts Stedelijk Gymnasium" />')
     document.write('</div>')
}
function handleResize() {
//  if(isNav) {
//    location.reload()
//  } else {
    shiftTo('banner',getBannerX(),0)
//  }
}
