var flashInstalled = false;
 /* flash dectective */   
  function flashDetective() { 
    if (navigator.plugins && navigator.plugins.length) { 
      for (x=0; x < navigator.plugins.length; x++) { 
        if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) { 
          flashInstalled = true; 
          break; 
        } 
      } 
    } 
    else if (window.ActiveXObject) { 
      for (x = 2; x <= 20; x++) { 
	    try { 
          oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');"); 
          if(oFlash) { flashInstalled = true; } 
        } 
        catch(e) {} 
      } 
    } 
  } // end 
 
  
  
  
  // insert flash into page ... 
  function insertFlash(path,height,width,background) { 
    
	flashDetective(); 
    
	if(flashInstalled == false) { 
	  
	  var graphic=path.substring(0,path.indexOf('.swf'))+ "_flat" + ".gif"; 
	  
      document.write('' + 
      '<img src="'+graphic+'">' + 
      '<br>' + 
      '' ); 
	  
	} 
	
	else { 
	  
      var name="insert"; 
      
      var color="ffffff"; // defaults to white 
      if(background) { color=background; } 
    
      document.write('' + 
      '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' + 
      'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ' + 
      'name="' + name + '" ' + 
      'id="' + name + '" ' + 
      'width="' + width + '" ' +
      'height="' + height + '"> ' +
      '<param name="movie" value="' + path + '"> ' + 
      '<param name="play" value="'+ name + '"> ' + 
      '<param name="menu" value="false"> ' + 
      '<param name="quality" value="high"> ' + 
      '<param name="bgcolor" value="' + color + '"> ' + 
      '<embed ' + 
      'src="' + path +'" ' + 
      'play="true" ' + 
      'menu="false" ' + 
      'quality="high" ' + 
      'bgcolor="' + color + '" ' + 
      'width="' + width + '" ' + 
      'height="' + height + '" ' + 
      'swLiveConnect="true" ' + 
      'name="' + name + '" ' + 
      'type="application/x-shockwave-flash" ' +       'pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">' + '</embed> ' + '</object> ' + '' ); 
	  
	} 
    
  } // end 
