function writeFlash(_source, _name, _playerversion, _bgcolor, _width, _height, _wmode, _style) {
	var theFlash = '';
	theFlash += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
	theFlash += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + _playerversion + ',0,0,0"';
	theFlash += ' width="' + _width + '" height="' + _height + '" id="' + _name + '" align="middle"';
	theFlash += ' style="' + _style + '">';
	theFlash += ' <param name="allowScriptAccess" value="sameDomain" />';
	theFlash += ' <param name="movie" value="' + _source + '" />';
	theFlash += ' <param name="wmode" value="' + _wmode + '">';
	theFlash += ' <param name="quality" value="high" />';
	theFlash += ' <param name="bgcolor" value="' + _bgcolor +'" />';
	theFlash += ' <embed src="' + _source + '" quality="high" bgcolor="' + _bgcolor + '" id="' + _name + '" name="' + _name + '" ';
	theFlash += ' wmode="' + _wmode + '" ';
	theFlash += ' width="' + _width + '" height="' + _height + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ';
	theFlash += ' swliveconnect="true" style="' + _style + '" />';
	theFlash += ' </object>';
	document.write(theFlash);	
}

function resizeFlash(showDims) {
	var isIE = false;
	if (document.all) {
		isIE = true;
	}		
		
	var cnt = document.getElementById("container");

	if (isIE) {
		var ww = document.body.offsetWidth - 50;
		var wh = document.body.offsetHeight - 50;
	} else {
		var ww = window.innerWidth - 50;
		var wh = window.innerHeight - 50;
	}

	var nw = 0;
	var nh = 0;
	
	if (ww > wh) {
		nh = wh;
		nw = Math.floor(wh * 1.3333);
		if (nw > ww) {
			nw = ww;
			nh = Math.floor((nw/4) * 3);		
		}
	} else {
		nw = ww;
		nh = Math.floor((nw/4) * 3);		
	}

	var nl = Math.floor((ww - nw) / 2);
	var nt = Math.floor((wh - nh) / 2);
	
	cnt.style.width = nw+"px";
	cnt.style.height = nh+"px";
	cnt.style.left = (nl+15) + "px";
	cnt.style.top = (nt+15) +"px";
	
	if (showDims) {
		alert("win w : " + ww + " win h: " + wh + " new w : " + nw + " & new h : " + nh + " new left: " + nl + " new top: " + nt); 
	}
}
