/**
 * Registry for Events in the Frontend
 */
naviki.event.EventMgr = function() {
	 
	// routing request events
	this.disableDraggingMarker = new YAHOO.util.CustomEvent("disableDraggingMarker", this);
	this.enableDraggingMarker  = new YAHOO.util.CustomEvent("enableDraggingMarker", this);
	this.addRoutingMarker      = new YAHOO.util.CustomEvent("addRoutingMarker", this);
	this.moveRoutingMarker     = new YAHOO.util.CustomEvent("moveRoutingMarker", this);
	this.updateRoutingInputs   = new YAHOO.util.CustomEvent("updateRoutingInputs", this);
	this.enableDD              = new YAHOO.util.CustomEvent("enableDD", this);
	this.disableDD             = new YAHOO.util.CustomEvent("disableDD", this);
	this.clearRoutingRequest   = new YAHOO.util.CustomEvent("clearRoutingRequest", this);
	this.showRoutingRequest    = new YAHOO.util.CustomEvent("showRoutingRequest",this);
	
	//events that lead to social networks activities
	this.onWayUpload      =  new YAHOO.util.CustomEvent("onWayUpload", this);
	this.onPhotoUpload    =  new YAHOO.util.CustomEvent("onPhotoUpload", this);
	this.onWayComment     =  new YAHOO.util.CustomEvent("onWayComment", this);
	this.getLoginFacebook =  new YAHOO.util.CustomEvent("getLoginFacebook", this);
	this.getLoginTwitter  =  new YAHOO.util.CustomEvent("getLoginTwitter", this);
	this.collectInput     =  new YAHOO.util.CustomEvent("collectInput", this);
	
	// view events
	this.onWindowResize  = new YAHOO.util.CustomEvent("onWindowResize", this); 	
	this.onWindowLoad    = new YAHOO.util.CustomEvent("onWindowLoad", this);
	this.onWindowUnLoad  = new YAHOO.util.CustomEvent("onWindowUnLoad", this); 

	// show/hide events
	this.onShow = new YAHOO.util.CustomEvent("onShow", this); 
	this.onHide = new YAHOO.util.CustomEvent("onHide", this);
	
	// enable/disable customize map controls and earth mouse controls
	this.enableControls   = new YAHOO.util.CustomEvent("enableControls", this);
	this.disableControls  = new YAHOO.util.CustomEvent("disableControls", this);
	
	// enable/disable map functions
	this.enableMapFunctions   = new YAHOO.util.CustomEvent("enableMapFunctions", this);
	this.disableMapFunctions  = new YAHOO.util.CustomEvent("disableMapFunctions", this);	
	
	//enable/disable google earth
	this.disableGeDraggingMarker = new YAHOO.util.CustomEvent("disableGeDraggingMarker", this);	
	this.enableGeDraggingMarker  = new YAHOO.util.CustomEvent("enableGeDraggingMarker", this);	
	this.disableGoogleEarth      = new YAHOO.util.CustomEvent("disableGoogleEarth", this);	

	// georeference of images
	this.requestGeolocationImage          = new YAHOO.util.CustomEvent("requestGeolocationImage", this);
	this.responseGeolocationImage         = new YAHOO.util.CustomEvent("responseGeolocationImage", this);
	this.removeGeolocationImage           = new YAHOO.util.CustomEvent("removeGeolocationImage", this);
	this.removeAllGeolocationImage        = new YAHOO.util.CustomEvent("removeAllGeolocationImage", this);
	this.addGeolocationImage              = new YAHOO.util.CustomEvent("addGeolocationImage", this);
	this.enableDraggableGeolocationImage  = new YAHOO.util.CustomEvent("enableDraggableGeolocationImage", this);
	this.disableDraggableGeolocationImage = new YAHOO.util.CustomEvent("disableDraggableGeolocationImage", this);

	// gmap overlay events
	this.onMapAddOverlay        = new YAHOO.util.CustomEvent("onMapAddOverlay", this); 	
	this.onMapRemoveOverlay     = new YAHOO.util.CustomEvent("onMapRemoveOverlay", this); 		
	this.removeWayOverlay       = new YAHOO.util.CustomEvent("removeWayOverlay", this);
	this.addWayOverlay          = new YAHOO.util.CustomEvent("addWayOverlay", this);
	this.removeHighlightOverlay = new YAHOO.util.CustomEvent("removeHighlightOverlay", this);
	this.addHighlightOverlay    = new YAHOO.util.CustomEvent("addHighlightOverlay", this);
	this.updateWayOverlay       = new YAHOO.util.CustomEvent("updateWayOverlay", this);
	
	// wayInfo
	this.updateWayInfo          = new YAHOO.util.CustomEvent("updateWayInfo", this);
	this.removeWayInfoMarker    = new YAHOO.util.CustomEvent("removeWayInfoMarker", this); 	
	this.addWayInfoMarker       = new YAHOO.util.CustomEvent("addWayInfoMarker", this); 
	
	// way
	this.updateWayView          = new YAHOO.util.CustomEvent("updateWayView", this);
	this.enableDrawMode         = new YAHOO.util.CustomEvent("enableDrawMode", this);
	this.disableDrawMode        = new YAHOO.util.CustomEvent("disableDrawMode", this);
	this.storeDrawing           = new YAHOO.util.CustomEvent("storeDrawing", this);
	this.loadDrawing            = new YAHOO.util.CustomEvent("loadDrawing", this);
	this.getDrawing             = new YAHOO.util.CustomEvent("getDrawing", this);
	this.existDrawing           = new YAHOO.util.CustomEvent("existDrawing", this);
	
	// gmap action events
	this.onMapMoveEnd       = new YAHOO.util.CustomEvent("onMapMoveEnd", this);
	this.onMapDrag          = new YAHOO.util.CustomEvent("onMapDrag", this);
	this.onMapZoom          = new YAHOO.util.CustomEvent("onMapZoom", this);
	this.hideContextMenu    = new YAHOO.util.CustomEvent("hideContextMenu", this);
	this.showPopup          = new YAHOO.util.CustomEvent("showPopup", this);	
	this.hidePopup          = new YAHOO.util.CustomEvent("hidePopup", this);	
	this.updateContextMenu  = new YAHOO.util.CustomEvent("updateContextMenu", this);
	this.mapPositioning     = new YAHOO.util.CustomEvent("mapPositioning", this);
	
	// more events ....
	this.onTrackChanged      = new YAHOO.util.CustomEvent("onTrackChanged", this);
	this.displaySearchResult = new YAHOO.util.CustomEvent("displaySearchResult",this);
	
	// rating of ways
	this.showWayRatingDialog = new YAHOO.util.CustomEvent("showWayRatingDialog",this);
	
	// hannit haltestellen result
	this.hannitRequestResult = new YAHOO.util.CustomEvent("hannitRequestResult",this);
	
	// portlet
	this.updatePortlet = new YAHOO.util.CustomEvent("updatePortlet",this);
	this.updateWidth   = new YAHOO.util.CustomEvent("updateWidth",this);
	
	// new geoobjects events (e.g. accummodation)
	this.showBooking    = new YAHOO.util.CustomEvent("showBooking",this);
	this.showSmallMap   = new YAHOO.util.CustomEvent("showSmallMap",this);
};

/**
 * Event occurs if a value of an object changes the own value 
 */
naviki.event.ValueChangeEvent = function (oldValue, newValue){
	this.oldValue = oldValue;
	this.newValue = newValue;
};

naviki.event.Receiver = function (){
};

naviki.event.Receiver.prototype.onTrackChanged = function(type, e, me) { 
	alert(type + "/" + e[0].newValue + "/" + me);	
};


