title: problem with OOP Javascript
body: <p>I have one javasctipc class... Lets call it X.</p>
  
  <pre><code>myClass = new X(bunc, of, stuff);
  </code></pre>
  
  <p>Then i have method like:</p>
  
  <pre><code>X.prototype.drawTripOnMap = function(request) {
    ...
    var y = new ChartClass();
    //or this.chart = new ChartClass():
    y.drawchart(data, options, etc);
    ...
  }
  </code></pre>
  
  <p>Now i dont want to create new instance of X - How can i, within ChartClass.drawchart method call myClass methods? </p>
  
  <p>to give you bit more info about my problem - im writing pure javascript class which handles bunch of OpenLayer stuff. My website uses prototype.js atm, but we want to get rid of that. We cant do it right away, so im tryng to write my class so that i could easyly swap out parts that handle dom, events or ajax calls. right now im drawin charts below the map and i need to handle chart click events. When i click on chart, something needs to happen on map... vice versa is simple - since chart can be subclass of myClass (this.chart in above code). </p>
  
  <p>soo... how? </p>
  
  <p>Alan</p>