function MWJ_getSize( oFrame ) {
	if( !oFrame ) { oFrame = window; } var myWidth = 0, myHeight = 0;
	if( typeof( oFrame.innerWidth ) == 'number' ) { myWidth = oFrame.innerWidth; myHeight = oFrame.innerHeight; }
	else if( oFrame.document.documentElement && ( oFrame.document.documentElement.clientWidth || oFrame.document.documentElement.clientHeight ) ) {
		myWidth = oFrame.document.documentElement.clientWidth; myHeight = oFrame.document.documentElement.clientHeight; }
	else if( oFrame.document.body && ( oFrame.document.body.clientWidth || oFrame.document.body.clientHeight ) ) {
		myWidth = oFrame.document.body.clientWidth; myHeight = oFrame.document.body.clientHeight; }
	return [myWidth,myHeight];
}

function gen_swf_code (file, version, width, height) {
/*
Extern javascript om een flash-toepassing te starten
Dit is nodig om vanwege de 'eolas' feature waardoor in IE een keer extra moet worden geklikt op flash-object
--------------------------------------------------
Mee te geven parameters:
file (naam van swf-bestand)
version (minimaal vereiste flash-versie: staat in 4e byte swf-bestand)
width (breedte van het flash-object)
height (hoogte van het flash-object)
*/
  var w, h;
  w = Math.floor((MWJ_getSize()[0] * 100) / width); // percentage
  h = Math.floor((MWJ_getSize()[1] * 100) / height); // percentage
  if  ((w > 100) && (h > 100)) { // allebei groter dan maximum
    w = width + "px"; // gebruik absolute breedte
	h = height + "px"; // gebruik absolute hoogte
	}
  else {
    w = h = "100%"; // past binnen window size: zet op 100% zodat resize ook werkt
	}
  document.write ('<div id="flashobj" style="width: ' + w + '; height: ' + h + ';">');
  document.write ('    <object classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
  document.write ('     codebase = "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + version + ',0,0,0"');
  document.write ('     width = "100%" height = "100%" align = "middle">');
  document.write ('        <param name="movie" value="' + file + '" />');
  document.write ('        <param name="quality" value="high" />');
  document.write ('        <embed width = "100%" height = "100%" align = "middle"');
  document.write ('         src="' + file + '"');
  document.write ('         quality = "high"');
  document.write ('         type = "application/x-shockwave-flash"');
  document.write ('         pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  document.write ('    </object>');
  document.write ('</div>');
}

