
function getFlashString(id, src, width, height, wmode, flashVars, classID, codebase, base, backgroundColor, generalObjectString) {
  bP = '';
  bE = '';
  if (base != undefined && base != null) {
    bP = ' <param name="base" value="'+base+'"/>';
    bE = ' base="'+base+'"';
  }
  
  if (backgroundColor == undefined) {
  	backgroundColor = '#000000';
  }
  
  if (generalObjectString == undefined) {
    generalObjectString = '';
  }

flashStr = '<object id="'+id+'" width='+width+' height='+height+' align="middle" classid="clsid:'+classID+'" codebase="'+codebase+'" '+generalObjectString+'>'+
    ' <param name="movie" value="'+src+'" />'+
    ' <param name="wmode" value="'+wmode+'" />'+
    ' <param name="quality" value="high" />'+
    ' <param name="bgcolor" value="'+backgroundColor+'" />'+
    ' <param name="allowScriptAccess" value="sameDomain" />'+
    ' <param name="FlashVars" value="'+flashVars+'" />'+
    bP+
    ' <embed name="'+id+'" '+bE+' src="'+src+'" width='+width+' height='+height+' align="middle" wmode="'+wmode+'" quality="high" bgcolor="'+backgroundColor+'" allowScriptAccess="sameDomain" FlashVars="'+flashVars+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
    '</object>';
  return flashStr;
}


function insertFlash(id, src, width, height, wmode, flashVars, classID, codebase, base, backgroundColor, generalObjectString) {
	document.write(getFlashString(id, src, width, height, wmode, flashVars, classID, codebase, base, backgroundColor, generalObjectString));
}

function getFlash(movieName) {
  if (navigator.appName.indexOf("Microsoft") != -1) {
    return window[movieName]
  }
  else {
    return document[movieName]
  }
}
