function Plaatje(ox)
{
  totaal = "<img src='/image/binarypre.asp?refcode=" + ox + "&sel=' onclick='IEWO(\"" + ox + "\")' style='cursor:pointer;border: 1px solid gray;'>";
  document.write(totaal);
}

function IEWO(ox)
{
  options = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=80,height=60";
  window.open("/plaatje.asp?refcode=" + ox,"myPictureWindow",options);
}

function changeLayBttn(obj, strStyle)
{
  obj.style.textDecoration = strStyle;
}

var highlightElement = null;

function highlightElem(e)
{
  if (highlightElement != e)
  {
    dimElem(highlightElement);
    e.className = "headerB";
    highlightElement = e;
  }
}

function dimElem(e)
{
  if (e) e.className = "header";
}

function imgClick(theEvent)
{
  if (!highlightElement) return;

  var s = highlightElement.src;

  s = s.substring(s.length - 40, s.length);

  // alert("Deze vergroten: " + s);

  window.open("/plaatje.asp?refcode=" + s, "myPictureWindow", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=80,height=60").focus();
}

function findAbsolutePosition(obj)
{
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	return [curleft,curtop];
}

function imgMove(evnt)
{
  var
    e = document.getElementById("myDivMsg"),
    x, y, l = 0, i;


  if (document.all)
  {
    //x = event.x;
    //y = event.y;
    x = event.offsetX;
    y = event.offsetY;
    l = (document.body.clientWidth-900)/2;

    srcElem = event.srcElement;
    abspos = findAbsolutePosition(srcElem);

    x += abspos[0];
    y += abspos[1];

  }
  else
  {
    x = evnt.pageX;
    y = evnt.pageY;
    l = (document.width-900)/2;
  }

  if (l < 0) l = 0;

  x -= l;

  i = Math.round(0.5 + x / 150);

  if (y > 90 || x < 0 || x > 900) { dimElem(highlightElement); highlightElement = null; return; }

  if (i < 1) i = 1;
  if (i > 6) i = 6;

  highlightElem(document.getElementById("img" + i));
}

function btnTerug(theEvent)
{
  theEvent.cancelBubble = true;

	history.back();
}

function btnStart(theEvent)
{
  theEvent.cancelBubble = true;

  window.location.href="http://www.artindex.nl/";
}

function loadComplete()
{
  if (document.all)
   document.onmousemove = imgMove;
  else
   window.onmousemove = imgMove;

  try { GotoNextTimer(); } catch (e) { }
}
