/**
 *  SWFObject Extension
 *   to either load flash or an image as fallback
 *  
 *  based on SWFObject by Geoff Stearns
 *  http://blog.deconcept.com/swfobject/
 *  
 *  @author martin glaß <mglass at 3-point dot de>
 */
       
if(deconcept && deconcept.SWFObject) {
    
  deconcept.SWFObject.prototype.writeEither = function(id, img, opts) {

    if(this.write(id)) {
      return true;
    } else {
      
      if(typeof opts !== 'object') var opts = {
        alt: ''
      };
      opts.src = img;
      var imgTag = document.createElement('img');
      for(var attrib in opts) {
        imgTag.setAttribute(attrib, opts[attrib]);
      }
      element = (typeof id === 'string') ? document.getElementById(id) : id;
      element.appendChild(imgTag);
      return true;
       
    }

  }

} else {
  
  if(window.console) console.debug('Error: SWFObject not available!');
  else alert('Error: SWFObject not available!')
  
}
