
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Global Library  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Global Library:	functies die zowel door de voorkant als de achterkant van deze site worden gebruikt. /////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//opent een nieuwe window
function showWindow(whichpage, namepage, winwidth, winheight) {
	theWindow = window.open (whichpage, namepage, 'scrollbars=yes,status=no,resizable=1,resizable=yes,toolbar=no,location=no,menubar=no,width=' + winwidth + ',height=' + winheight);
	theWindow.focus();
}

//laat de laag zien of verbergen
//showLayer('laag', 'visible')
//showLayer('laag', 'hidden')
function showLayer(wsLayername, wsState) {
	if (giPositionTopLayer!=0 && giPositionLeftLayer !=0) {
	    if (document.layers && document.layers[wsLayername])
	        document.layers[wsLayername].visibility = wsState;
	    else if (document.all && document.all[wsLayername]) {
	        document.all[wsLayername].style.visibility = wsState;
	        document.all[wsLayername].style.zIndex = 100;
	    }
	}
}



function printPage() {

  // PRINTING STUFF Taken from www.webreference.com/js/tips/991029.html
  var da = (document.all) ? 1 : 0;
  var pr = (window.print) ? 1 : 0;
  var mac = (navigator.userAgent.indexOf("Mac") != -1); 

  if (da && !pr && !mac) with (document) {
	writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
	writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
	writeln('Sub window_onunload');
	writeln('  On Error Resume Next');
	writeln('  Set WB = nothing');
	writeln('End Sub');
	writeln('Sub vbPrintPage');
	writeln('  OLECMDID_PRINT = 6');
	writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
	writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
	writeln('  On Error Resume Next');
	writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
	writeln('End Sub');
	writeln('<' + '/SCRIPT>');
  }
  if (pr) // NS4, IE5
  {
	//alert("Calling window.print()");
	window.focus();
    window.print();
  }
  else if (da && !mac) // IE4 (Windows)
  {
	//alert("Calling vbPrintPage()");
	window.focus();
    vbPrintPage();
  }
  else // other browsers
  {
    alert("Sorry, uw browser kan de printopdracht niet automatisch afhandelen.");
  }
  //return false;
}


