function popup(name, width, height, type) {
		if (!type) {
			return 1;
		}
  	var left = (screen.width - width) / 2;
  	var top = (screen.height - height) / 2;
  	var url = 'project.php?name=' + name + '&width=' + width + '&height=' + height + '&type=' + type;
  	var params = 
  		'height=' + height + ',' +
  		'width=' + width + ',' +
  		'location=no' + ',' +
  		'menubar=no' + ',' +
  		'resizable=no' + ',' +
  		'scrollbars=no' + ',' +
  		'status=no' + ',' +
  		'toolbar=no' + ',' +
  		'left=' + left + ',' +
  		'top=' + top +
  		'';
  	w = window.open(url, "popup", params);
  	w.focus();
}

function insertMovie(name, width, height) {
	document.write('<object ');
	document.write('classid="clsid:clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ');
	document.write('codebase="http://www.apple.com/qtactivex/qtplugin.cab ');
	document.write('height="' + height + '" ');
	document.write('width="' + width + '" ');
	document.write('>');
	document.write('<param name="src" value="' + name + '.mov" />');
	document.write('<param name="kioskmode" value="true">');
	document.write('<param name="cache" value="true">');
	document.write('<param name="autoplay" value="true">');
	document.write('<param name="controller" value="true">');
	document.write('<embed ');
	document.write('pluginspage="http://www.apple.com/quicktime/download/" ');
	document.write('src="' + name + '.mov" ');
	document.write('type="video/quicktime" ');
	document.write('controller="true" ');
	document.write('autoplay="true" ');
	document.write('cache="true" ');
	document.write('kioskmode="true" ');
	document.write('height="' + height + '" ');
	document.write('width="' + width + '" ');
	document.write('>');
	document.write('</object>');
}

function insertFlash(name) {
	document.write('<object ');
    document.write('type="application/x-shockwave-flash" ');
    document.write('width="100%" ');
    document.write('height="100%" ');
    document.write('data="' + name + '.swf"> ');
    document.write('<param name="movie" value="' + name + '.swf" /> ');
  	document.write('</object>');
}
