/*
*           
*   __  _____    __
*  /\_\/\_ __\__/\_\  
*  \ \_\/_/\____\ \_\   S E R V I C E S
*   \/_/  \/____/\/_/
*
* Classname    : BookOnline.engine.class.js
* Function     : core of online booking MVC 
* Date         : 01-08-2007
* Company      : IZI services
* Usage        : with care
*
* Changelog    : 01-08-2007 [tim] developed initial versiosn
*
* @author      	Tim Gerritsen <tim@izi-services.nl>
* @copyright	  IZI-Services 2007
* @version	    1.0
*
*/

var BookOnlineEngine = new Class({
  /* Model */
  model: false,
  
  /* Views */
  view: Array(),
  
  /* Controllers */
  control: Array(),
  
  initialize: function ()
  {
    this.model = new BookOnlineModel();
        
    this.view['calendar']		     = new CalendarView(this.model);
    this.control['calendar'] 	   = new CalendarControl(this.model);

    this.model.init(_callback(this,this.run));
  },
  
  run: function ()
  {
  	// fire run() with composite design pattern
  	for( v in this.view) 
			if( typeof(this.view[v]) 		== "object") this.view[v].run();
  	for( c in this.control) 
			if( typeof(this.control[c]) == "object") this.control[c].run();
      
    this.view["calendar"].run("calendar");
	  this.view["calendar"].createAll("raCalendar");
	  
   // $("raBookingSystem").setStyle("visibility","visible");

  }
  
});

/* Initialize OnlineBookingSystem */
var bs;
window.addEvent('domready', function() { bs = new BookOnlineEngine(); });


