var isNS4,isIE4,isIE5,isNS6;
var currentPageNumber, leeg, lPijl, rPijl;
var readyToRock = false;

isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && ! document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;

function getObject(str){
  if (isIE4){
    return(document.all[str]);
  }else if (isIE5 || isNS6) {
    return(document.getElementById(str));
  }
}

function resizeAdapt(width, height){
  var x, y, currentWidth, currentHeight;
  if(isNS4 || isNS6){

    currentWidth = window.innerWidth;
    currentHeight = window.innerHeight;
  }else{
    currentWidth = document.body.offsetWidth;
    currentHeight = document.body.offsetHeight;
  }
  if(currentWidth != width || currentHeight != height){
    n = isNS6 ? 2 : 0;
    width = currentWidth;
    height = currentHeight;
    x = width - 160;
    y = height - 100;
    getObject("text").style.width = (x-n).toString();
    getObject("textBG").style.width = x.toString();
    getObject("text").style.height = (y-n).toString();
    getObject("textBG").style.height = y.toString();
    x=x+2;
    y=y+2;
    getObject("text").style.clip = "rect(0, " + x.toString() + " " + y.toString() + " 0)";
    getObject("textBG").style.clip = "rect(0, " + x.toString() + " " + y.toString() + " 0)";
  }
  if(getObject("text").style.visibility == "hidden"){
    getObject("text").style.visibility = "visible";
    getObject("textBG").style.visibility = "visible";
  }
  x = "resizeAdapt(" + width + ", " + height + ");";
  window.setTimeout(x, 250);
}

function go(){
var x;
  x = getObject("text").style.height;
  alert (x);
  getObject("text").style.overflow = 'hidden';
}

function setSelection(n){
  leeg = new Image(12, 12);
  leeg.src = "../images/empty.gif";
  lPijl = new Image(12, 12);
  lPijl.src = "../images/lpijl.gif";
  rPijl = new Image(12, 12);
  rPijl.src = "../images/rpijl.gif";
  readyToRock = true;
  currentPageNumber = n;
  if(currentPageNumber > 0){
    eval("document.s" + currentPageNumber + ".src = rPijl.src;");
  }
}

function blink(n,b){
  if((n != currentPageNumber) && readyToRock){
    var x = b ? "lPijl" : "leeg";
    eval("document.s" + n + ".src = " + x + ".src;");
  }
}
