function getWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
      //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && document.documentElement.clientWidth ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && document.body.clientWidth ) {
      //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return(myWidth);
}

function getHeight() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      document.documentElement.clientHeight ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && document.body.clientHeight ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return(myHeight);
}

function GoToStart() {
	document.location='index.php?id=1';
}

function ShowWhenReady() {
  document.getElementById('tekst').style.display='';
  document.getElementById('foto').style.display='';
	if (document.getElementById('blok')) {
  	setTimeout('beeldwissel()',4000);
	}
}

function ShowFrameWhenReady() {
  document.getElementById('foto').style.display='';
	if (document.getElementById('blok')) {
  	setTimeout('beeldwisselInFrame()',4000);
	}
}

function Stippel(menu, current) {
  for (i=1;i<=7;i++) {
  	if (i != current) {
  	  document.getElementById('stippel'+i).style.visibility='hidden';
	}
  }
  if (menu > 0) {
  	document.getElementById('stippel'+menu).style.visibility='visible';
  }
}

function beeldwissel(){
	if (window.createPopup)
		blok.filters[0].apply()
		document.images.blok.src=afb[teller].src;
		document.images.data.src=text[teller].src;
	if (window.createPopup)
		blok.filters[0].play()
		teller++;
	if (teller==afb.length)
		teller=0;
	setTimeout("beeldwissel()",tussentijd)
}

function beeldwisselInFrame(){
	if (window.createPopup)
		blok.filters[0].apply()
		document.images.blok.src=afb[teller].src;
	if (window.createPopup)
		blok.filters[0].play()
		teller++;
	if (teller==afb.length)
		teller=0;
	setTimeout("beeldwisselInFrame()",tussentijd)
}

function vergrootwissel(){
	if (window.createPopup)
		vergroting.filters[0].apply()
		document.images.vergroting.src=vergr[teller].src;
	if (window.createPopup)
		vergroting.filters[0].play()
		teller++;
	if (teller==vergr.length)
		teller=0;
	setTimeout("vergrootwissel()",tussentijd)
}

function ShowButton(obj) {
//  obj.style = 'background: url(img_mt/minisave.gif); background-repeat: no-repeat; width: 26px; padding: 0 0 0 0 ';
  obj.style.display = '';
}

function showImage(image, title, width, height) {
  var windowNote;
  windowNote = window.open('','Image','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + width + ',height='+height);
  text = '<HTML><HEAD><TITLE>' + title + '</TITLE></HEAD><BODY alink="ff0000" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">';
  text += '<IMG SRC="' + image + '" BORDER=0 ALIGN=LEFT>';
  text += '</BODY></HTML>';
  windowNote.document.write(text);
  windowNote.focus();
  windowNote.document.close();
  return false;
}

function SetTooltip(n, b, l, editible) {
	if (n.value == '' || n.value == l.options[l.selectedIndex].text) {
		b.style.background = "url(img_mt/miniback.gif)"
		b.title = 'Terug naar selectie';
	} else {
		if (editible==0) {	 // item aanpassen NIET toegestaan!!
			b.style.background = "url(img_mt/minisave_n.gif)"
			b.title = "Nieuw item opslaan";
		} else if (l.options[l.selectedIndex].value==0) {	 // geen item geselecteerd!!
			b.style.background = "url(img_mt/minisave_n.gif)"
			b.title = "Nieuw item opslaan";
		} else {
			b.style.background = "url(img_mt/minisave_e.gif)"
			b.title = "Aanpassing opslaan";
		}
	}
}

function ToggleListbox(n, b, l, t, id, cb) {
	if (b.title == "Aanpassing opslaan" || b.title == "Nieuw item opslaan") {
		document.forms[0].submit();
		b.title = 'Terug naar de selectie';
		b.style.background = "url(img_mt/miniback.gif)"
	} else {		// in rust...
		if (l.options[l.selectedIndex].value==0) {	 // geen item geselecteerd, dus toevoegen!!
			if (n.style.display == '') {
				document.getElementById(id).style.color = '#000099';
				b.style.background = 'url(img_mt/minikruisje.gif)'
				b.title = t + ' toevoegen';
				n.style.display = 'none';
				if (cb) {
				  cb.style.display = 'none';
				}
				l.style.display = '';
			} else {
				n.value = '';
				document.getElementById(id).style.color = 'Red';
				b.style.background = 'url(img_mt/miniback.gif)'
				b.title = 'Terug naar de selectie';
				n.style.display = '';
				if (cb) {
				  cb.style.display = '';
				}
				l.style.display = 'none';
				n.focus();
			}
		} else {															// wel een item geselecteerd !!
			if (n.style.display == '') {
				document.getElementById(id).style.color = '#000099';
				b.style.background = 'url(img_mt/b_edit.png)'
				b.title = t + ' voor ALLE gekoppelde items aanpassen?';
				n.style.display = 'none';
				if (cb) {
				  cb.style.display = 'none';
				}
				l.style.display = '';
			} else {
				n.value = l.options[l.selectedIndex].text;
				document.getElementById(id).style.color = 'Red';
				b.style.background = "url(img_mt/miniback.gif)"
				b.title = 'Terug naar de selectie';
				n.style.display = '';
				if (cb) {
				  cb.style.display = '';
				}
				l.style.display = 'none';
				n.focus();
			}
		}
	}
}

function AddOrEdit(n, b, l, t, editible) {
  if (l.options[l.selectedIndex].value==n) {
    b.title = t + ' toevoegen';
  }  else {
  	if (editible==1) {	 // forceer: bewerken is WEL toegestaan!!!
   		b.title = t + ' voor ALLE gekoppelde items aanpassen?';
	} else {
    	b.title = t + ' toevoegen';
 	}
  }
}

function AddOrRemove(lst1, b) {
	if (lst1.options[lst1.selectedIndex].value < 0) {
		b.title = 'Voeg een koppeling toe van de geselecteerde artikelomschr. naar de geselecteerde artikelgroep';
		b.style ='background: url(img_mt/miniback.gif); background-repeat: no-repeat; width: 26px; padding: 0 0 0 0';
	} else if (lst1.options[lst1.selectedIndex].value > 0) {
		b.title = 'Verwijder de koppeling van de geselecteerde artikelomschr. naar de geselecteerde artikelgroep';
		b.style ='background: url(img_mt/ed_delete.gif); background-repeat: no-repeat; width: 26px; padding: 0 0 0 0' ;
	}
}
	


