function getRefToObj(divID,oDoc) {
  if( !oDoc ) { oDoc = document; }
  if( document.layers ) {
    if( oDoc.layers[divID] ) {
      return oDoc.layers[divID];
    } else {
      //repeatedly run through all child layers
      for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
        //on success, return that layer, else return nothing
         y = getRefToObj(divID,oDoc.layers[x].document);
       }
       return y;
    }
  }
  if( document.getElementById ) {
    return document.getElementById(divID);
  }
  if( document.all ) {
    return document.all[divID];
  }
  return false;
}

function openImg(img,width,height,titel) {
  window.open('plaatje.php?img=' + img + '&w='+width+'&h='+height+'&t='+titel,'imagewindow','height='+height+',width='+width+',top=10,left=10,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
  return false;
}

function opurlz(url) {
  width = screen.width - 20;
  height = screen.height - 120;
  
  window.open(url,'imagewindow','height='+height+',width='+width+',toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
  return false;
}

function opurlm(url,width,height,titel) {
    if( width ) {
		;
    } else {
	width = screen.width - 20;
  	height = screen.height - 120;
    }
  window.open(url,'imagewindow','height='+height+',width='+width+',top=30,left=10,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
  return false;
}

function changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = getRefToObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}
