// ==============================================================================================================================
// Class TemcoProductInterface1
// ==============================================================================================================================
TemcoProductInterface1.prototype = new TemcoInterface1;
TemcoProductInterface1.prototype.constructor = TemcoProductInterface1;
TemcoProductInterface1.superclass = TemcoInterface1.prototype;

function TemcoProductInterface1 (sId) {
	if ( arguments.length > 0 ) this.construct(sId);
}

//-----------------------------------------------------------------
// Method TemcoProductInterface1.construct()
//-----------------------------------------------------------------
TemcoProductInterface1.prototype.construct = function (sId) {
	TemcoProductInterface1.superclass.construct.call(this, sId);
}

//-----------------------------------------------------------------
// Method TemcoProductInterface1.captureEvent()
//-----------------------------------------------------------------
TemcoProductInterface1.prototype.captureEvent = function (oEvent) {
	switch ( oEvent.name ) {
		case 'update_basket':
			this.refresh();
			break;
		case 'edit_entry':
			this.editEntry(oEvent.subject[0]);
			break;
		case 'view_entry':
			this.viewEntry(oEvent.subject[0], oEvent.subject[1]);
			break;
		default:
			TemcoProductInterface1.superclass.construct.call(this, oEvent);
			break;
	}
}

//-----------------------------------------------------------------
// Method TemcoProductInterface1.refresh()
//-----------------------------------------------------------------
TemcoProductInterface1.prototype.refresh = function () {
	switch( this.getArgument('cmd') ) {
		case 'order':
		case 'refresh_order':
			this.setArgument('cmd', 'refresh_order');
			break;
		default:
			this.setArgument('cmd', 'refresh');
			break;
	}
	this.submit();
}

//-----------------------------------------------------------------
// Method TemcoProductInterface1.backToList()
//-----------------------------------------------------------------
TemcoProductInterface1.prototype.backToList = function () {
	this.setArgument('cmd', '');
	this.setArgument('id', '');
	this.submit();
}

//-----------------------------------------------------------------
// Method TemcoProductInterface1.gotoBasket()
//-----------------------------------------------------------------
TemcoProductInterface1.prototype.gotoBasket = function () {
	this.setAction('/producten/basket.php');
	this.setArgument('cmd', '');
	this.submit();
}

//-----------------------------------------------------------------
// Method TemcoProductInterface1.addBasketEntry()
//-----------------------------------------------------------------
TemcoProductInterface1.prototype.addBasketEntry = function () {
	this.setAction('/producten/basket.php');
	this.setArgument('cmd', 'add_entry');
	this.submit();
}

//-----------------------------------------------------------------
// Method TemcoProductInterface1.updateBasketEntry()
//-----------------------------------------------------------------
TemcoProductInterface1.prototype.updateBasketEntry = function () {
	this.setAction('basket.php');
	this.setArgument('cmd', 'update_entry');
	this.submit();
}

//-----------------------------------------------------------------
// Method TemcoProductInterface1.editEntry()
//-----------------------------------------------------------------
TemcoProductInterface1.prototype.editEntry = function (sIdentifier) {
	this.setAction('systemen.php');
	this.setArgument('cmd', 'edit_basket_entry');
	this.setArgument('basket_entry', sIdentifier);
	this.submit();
}

//-----------------------------------------------------------------
// Method TemcoProductInterface1.viewEntry()
//-----------------------------------------------------------------
TemcoProductInterface1.prototype.viewEntry = function (sIdentifier, bSystem) {
	if ( bSystem )
		this.setAction('systemen.php');
	else
		this.setAction('componenten.php');
	this.setArgument('cmd', 'view_basket_entry');
	this.setArgument('basket_entry', sIdentifier);
	this.submit();
}

//-----------------------------------------------------------------
// Method TemcoProductInterface1.order()
//-----------------------------------------------------------------
TemcoProductInterface1.prototype.order = function () {
	this.setArgument('cmd', 'order');
	this.submit();
}

//-----------------------------------------------------------------
// Method TemcoProductInterface1.placeOrder()
//-----------------------------------------------------------------
TemcoProductInterface1.prototype.placeOrder = function () {
	this.setArgument('cmd', 'place_order');
	this.submit();
}

//-----------------------------------------------------------------
// Method TemcoProductInterface1.viewWarranty()
//-----------------------------------------------------------------
TemcoProductInterface1.prototype.viewWarranty = function () {
	var oDialog = this.createDialog();
	oDialog.setURL('warranty.php');
	oDialog.scrolling = true;
	oDialog.addArgument('id', document.pageform.id[0].value);
	oDialog.addArgument('type', document.pageform.type[0].value);
	oDialog.show();
}
