//provide is 1st
dojo.provide("dtdg.genie");   //upper or lower, fib was lower

dtdg.genie=function() {} //prototype way

dojo.extend(dtdg.genie, {
   _predictions:  [
      "As I see it, yes",
      "Ask again later",
      "Cannot say now",
      "Definitely",
      "Not while you live",
      "Focus and repeat the question",
      "Don't bet on it",
      "Absolutely",
      "Probably",
      "The spirits say no",
      "Outlook promising",
      "Outlook not promising",
      "Spirits out to lunch, ask again later",
      "I don't think so",
      "Indubitably",
      "Doubtful",
      "That's a definite maybe"
   ],

   initialize: function() {
      var label = document.createElement("p");
      label.innerHTML = "Ask a question, The magic genie will tell you the answer...";
 
      var question = document.createElement("input");
      question.size=50;

      var button = document.createElement("button");
      button.innerHTML="Ask, fool!";
      button.onclick=function() {
         alert(dtdg.genie.prototype._getPrediction());
         question.value='';
      }

      var container=document.createElement("div");
      container.appendChild(label);
      container.appendChild(question);
      container.appendChild(button);
      dojo.body().appendChild(container);
   },

   _getPrediction : function() {
      var idx = Math.round(Math.random()*16);
      return this._predictions[idx];
   }
});
