function Destination(destinationData)
{
	//-Configuration---------------------------------------------------------------------------------------------------------

	/**
	 * @cfg
	 * @type (String) 
	 */
	this.id = $.trimRight($.trimLeft(destinationData.attr("LABEL_EN"),' '),' ') || '';
	
	/**
	 * @cfg
	 * @type (Number) 
	 */
	this.x = destinationData.attr("X") || 0;
	
	/**
	 * @cfg
	 * @type (Number) 
	 */
	this.y = destinationData.attr("Y") || 0;

	//-Properties---------------------------------------------------------------------------------------------------------
	
	/**
	 * @property
	 * @type (DOMObject) 
	 */
	this.view = null;

	/**
	 * @property
	 * @type (DOMObject) 
	 */	
	this.parentView = null;

	/**
	 * @property
	 * @type (Connection) 
	 */	
	this.connection = null;
	
	/**
	 * @property
	 * @type (String) 
	 */
	//this.label = app.lang == 'de' ? destinationData.attr("LABEL_DE") : destinationData.attr("LABEL_EN");
	this.label = null;

	/**
	 * @property
	 * @type (Boolean) 
	 */	
	this.selected = false;
	
	//-Private Methods---------------------------------------------------------------------------------------------------------

	/**
	 * @method
	 * @private 
	 */
	Destination.prototype.createView = function () {
	    if (app.lang == 'de') {
	        this.label = $(destinationData).attr("LABEL_DE");
	    } else if (app.lang == 'fr') {
	        this.label = $(destinationData).attr("LABEL_FR");
	    } else {
	        this.label = $(destinationData).attr("LABEL_EN");
	    } 	
		this.view = $("<a class='flugZiel' style='left: " + this.x +"px; top: " + this.y + "px;'><span>" + this.label + "</span></a>");
		this.parentView.append(this.view);		
	};

	/**
	 * @method
	 * @private 
	 */	
	Destination.prototype.addedToDom = function(){
		this.view.bind('mouseenter', $.makeCallback(this,this.handleMouseenter));
		this.view.bind('mouseleave', $.makeCallback(this,this.handleMouseleave));
		this.view.bind('click', $.makeCallback(this,this.handleClick));
	};

	/**
	 * @method
	 * @private 
	 */	
	Destination.prototype.trigger = function(event, params){
		this.view.trigger(event,params);
	};
	
	/**
	 * @method
	 * @private 
	 */
	Destination.prototype.createConnection = function(){
		this.connection = new Connection(this.id);
		this.connection.create(this.parentView);
	}
	
	/**
	 * @method
	 * @private 
	 */
	Destination.prototype.destroyConnection = function(){
		
		if (this.connection) 
		{
			this.connection.destroy();
			this.connection = null;
		}
	}
		
	
	//-Event Handler-----------------------------------------------------------------------------------------------------------

	/**
	 * @method
	 * @private 
	 */	
	Destination.prototype.handleClick = function(event){		
		this.trigger(DestinationEvents.DESTINATION_CHANGED,this.id);
		this.selected = true;
	};

	/**
	 * @method
	 * @private 
	 */	
	Destination.prototype.handleMouseenter = function(event){		
		if (!this.selected) {
			this.showLabel();
			this.createConnection();
		}
	}; 
	
	/**
	 * @method
	 * @private 
	 */
	Destination.prototype.handleMouseleave = function(event){
		if (!this.selected) {			
			this.hideLabel();
			this.destroyConnection();
		}
	};
	
	/**
	 * @method
	 * @private 
	 */
	Destination.prototype.showLabel = function(){			
		this.view.addClass('selected');

	};
	
	/**
	 * @method
	 * @private 
	 */
	Destination.prototype.hideLabel = function(){			
		this.view.removeClass('selected');

	};
	
	
	//-Public------------------------------------------------------------------------------------------------------------------

	/**
	 * @method
	 */	
	Destination.prototype.create = function(parentView){
		this.parentView = parentView;
		this.createView();
		this.addedToDom();
	};	

	/**
	 * @method
	 */	
	Destination.prototype.destroy = function(){
		this.view.remove();
		this.view = null;
		this.view.unbind('mouseenter');
		this.view.unbind('mouseleave');
		this.view.unbind('click');
		this.parentView = null;
		this.connection = null;
		this.selected = false;
	};

	/**
	 * @method
	 */	
	Destination.prototype.select = function(){	
		this.selected = true;	
		this.showLabel();
		this.createConnection();
	}		

	/**
	 * @method
	 */	
	Destination.prototype.unselect = function(){
		this.selected = false;			
		this.hideLabel();
		this.destroyConnection();
	}		
	
	/**
	 * @method
	 */	
	Destination.prototype.bind = function(event, callback){
		this.view.bind(event,callback)
	};
}			
