define([
	'Global'
],
	function (Global) {
		'use strict';
		var SelectedDetails =  Backbone.Model.extend({
			defaults: {
				"collection": {},
				"id": "",
				"type": "",
				"whatChanged": ""
			},

			initialize: function () {
			},

			setCollection: function (collection) {
				var data = {};

				data.collection = collection;
				data.whatChanged = "collection";

				this.set(data);

				return this;
			},

			getCollection: function () {
				return this.get("collection");
			},

			setType: function (type) {
				var data = {};

				data.type = type;
				data.whatChanged = "type";

				this.set(data);

				return this;
			},

			getType: function () {
				return this.get("type");
			},

			setId: function (id) {
				var data = {};

				data.id = id;
				data.whatChanged = "id";

				this.set(data);

				return this;
			},

			getId: function () {
				return this.get("id");
			},

			reset: function () {
				var data = {};

				data.collection = {};
				data.type = "";
				data.whatChanged = "";

				this.set(data);
			}
		});

		SelectedDetails.singleInstance = null;

		SelectedDetails.instance = function () {
			SelectedDetails.singleInstance = SelectedDetails.singleInstance || new SelectedDetails();
			return SelectedDetails.singleInstance;
		};

		return SelectedDetails;
	}
);
