var CollectionManager = {
	id: null,

	init: function(id) {
		this.id = id;
		var self = this;

		var checkboxes = Form.getInputs($(this.id).down('form'), 'checkbox');
		for(var i = 0; i < checkboxes.length; i++) {
			checkboxes[i].observe('click', function(event) {
				self.enablePrice(event.target.id);
			});
		}

	},
	enablePrice: function(id) {
		if($(id).checked) {
			$('price-'+$F(id)).disabled = false;
		} else {
			$('price-'+$(id).value).disabled = true;
		}
	},
	displayProduct : function(productQName) {
		var flash = getFlash('collectionView');
		flash.changeModelPartTempAS3("temp", productQName);
	}
}

var DoManageCollectionAjax = Class.create();
DoManageCollectionAjax.prototype = {
	id: 'collectionForm',
	page: projectUrl + '/member/business/collection/doManageCollection',
	customExecute: function(object) {

	}
}
Object.extend(DoManageCollectionAjax.prototype, FashiownAjax);


var GetCollectionAjax = Class.create();
GetCollectionAjax.prototype = {
	page: projectUrl + '/member/business/collection/getCollection',
	customExecute: function(object) {
		$('mainContent').innerHTML = object.collection;
		$('mainContent').innerHTML.evalScripts();
		CollectionManager.init("collectionManager");
	}
}
Object.extend(GetCollectionAjax.prototype, FashiownAjax);
