function randomString() {
	var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var string_length = 8;
	var randomstring = '';
	for (var i=0; i<string_length; i++) {
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	return randomstring;
}

var detect = navigator.userAgent.toLowerCase();
function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}


function fireFlash(myMovie,myContainer,hei,wid) {
 if (checkIt('msie')) {
  var fFlash = document.createElement("object");
  fFlash.setAttribute("classid", "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000");
  fFlash.setAttribute("width", wid);
  fFlash.setAttribute("height", hei);
  var rname = randomString();
  fFlash.setAttribute("id", rname);
  var here = document.getElementById(myContainer);
  here.appendChild(fFlash);
  var ohey = document.getElementById(rname);
  ohey.movie = myMovie;
 } else {
   var ohey = document.getElementById(myContainer);
   ohey.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+wid+'" height="'+hei+'" align="middle">'+
      '<param name="allowScriptAccess" value="sameDomain" />'+
      '<param name="movie" value="'+myMovie+'" />'+
      '<param name="quality" value="high" />'+
      '<param name="bgcolor" value="#ec2027" />'+
      '<embed src="'+myMovie+'" quality="high" bgcolor="#ec2027" width="'+wid+'" height="'+hei+'" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
      '</object>';
 }
}

