function flash(pmovie,pheight,pwidth,pid,pbgcolor){
	this.movie=pmovie;
	this.bgcolor=pbgcolor;
	this.align='middle';
	this.quality='high';
	this.wmode='transparent';
	this.height=pheight;
	this.width=pwidth;
	this.id=pid;
	this.html='';
	
	this.display = function(){
		this.html+=('<object tabindex="-1" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+this.width+'" height="'+this.height+'" id="'+this.id+'" align="'+this.align+'" VIEWASTEXT>');
		this.html+=('<param name="allowScriptAccess" value="sameDomain" />\n');
		this.html+=('<param name="movie" value="'+this.movie+'" />\n');
		this.html+=('<param name="src" value="'+this.movie+'" />\n');
		this.html+=('<param name="menu" value="false" />\n');
		this.html+=('<param name="quality" value="'+this.quality+'" />\n');
		this.html+=('<param name="wmode" value="'+this.wmode+'" />\n');
		this.html+=('<param name="bgcolor" value="'+this.bgcolor+'" />\n');
		this.html+=('<embed src="'+this.movie+'" menu="false" quality="'+this.quality+'" wmode="'+this.wmode+'" bgcolor="'+this.bgcolor+'" width="'+this.width+'" height="'+this.height+'" name="'+this.id+'" align="'+this.align+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
		this.html+=('</object>\n');
		document.write(this.html);
	}
	
	this.display();
}


function closeIt() {
  document.getElementById('flashContainer').style.height='44px';
}
function openMenu() {
  var flashContainer=document.getElementById('flashContainer')
  if (flashContainer.style.height!='600px') {
    flashContainer.style.height='600px';
  }
}

function say(s) {
  document.getElementById("thespan").innerHTML = s;
}

function renderFlash(params, width, height, id, align, version) {
  if (!version)
    version = "7,0,0,0";
  var html = ""
  html += '<object tabindex="-1" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + version + '" width="'+width+'" height="'+ height+'" id="'+ id+'" align="'+align+'" VIEWASTEXT>';
  for (var p in params) {
	  html += '<param name="' + p + '" value="' + params[p] + '" />\n';
  }
  html += '<embed';
  for (var p in params) {
    if (p == "movie")
      html += ' src="' + params[p] + '"';
    else 
		  html += ' ' + p + '="' + params[p] + '"';
  }
  html += ' width="'+width+'" height="'+ height+'" name="'+ id+'" align="'+align+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n';
  html += '</object>\n';
  //alert(html);
  //document.write(html.replace(/&/g, "&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"));
  document.write(html);
}
