var Empulse = Empulse || {};

Empulse.ActionQueue = { _actions: new Array() };
Empulse.ActionQueue.push = function(action, params) {
	this._actions.push({"action": action, "params": params});
};
Empulse.ActionQueue.clear = function() {
	this._actions = new Array();
};
Empulse.ActionQueue.run = function() {
	for(var i = 0; i < this._actions.length; i++) {
		var obj = this._actions[i];
		obj.action(obj.params);
	}
	this.clear();
};

Empulse.map = {};

Empulse.initialize = function ()
{
	if (($('#gmap').length > 0) && GBrowserIsCompatible()) {
		this.map = new GMap2(document.getElementById("gmap"));
		this.map.setCenter(new GLatLng(50.942597, 6.95853), 13);
		this.map.setUIToDefault();
	}

  this.ActionQueue.run();
  
  //$("div.scrollable").scrollable();
  
//select the thumbnails and make them trigger our overlay 
  
  if ($("#triggers").length > 0 && $("#triggers a").length > 0)
  {
	  $("#triggers a[rel='gallery']").overlay({ 
	   
	      // each trigger uses the same overlay with the id "gallery" 
	      target: '#gallery', 

	      speed: 0

	      // optional exposing effect 
	  // let the gallery plugin do its magic! 
	  }).gallery({ 
	   
	      // the plugin accepts its own set of configuration options 
	      speed: 800 
	  });
  }

};
