/**
 * @fileoverview
 * 
 * <p>Copyright (c) 2006 Peter Michaux All rights reserved<br />
 * All rights reserved <br />
 * This file is not licensed for use or redistribution.</p>
 *
 * @author Peter Michaux
 * @version 0.1 (June 2006)
 */

/**
 * @class
 * <p>A PM.Dual instance is a JavaScript object
 * which duals or represents an HTML element.
 * The instance stores the DOM element which it represents.</p>
 * <p>The class name Dual was choosen as a shorter synonym for Doppelganger:
 * A ghostly double of a living person, especially one that haunts its
 * fleshly counterpart.</p>
 * 
 * <h4>Dependencies</h4>
 * PM.Object
 *
 * @constructor
 * @param {HTMLElement|String} element the DOM element the instance will
 * represent. For convenience this parameter can alternately be 
 * the string id of the HTMLElement.
 * @extends PM.Object
 */
PM.Dual = function(element) {
  PM.Dual.superclass.call(this);
  if (typeof element === 'string') {
    // TODO if unsuccessful throw exception
    element = document.getElementById(element);
  }
  /**
   * The DOM element which the instance of PM.Dual represents
   * @type HTMLElement
   * @final
   */
  this.element = element;

  /**
   * A flag to be used to check if an object is an instance of PM.Dual.
   * @type Boolean
   * @final
   */  
  this.isDual = true;
};
PM.extend(PM.Dual, PM.Object);