/* @(#) $Id: department.js 33077 2008-04-28 07:31:39Z mo $ */
if(typeof BECOME == 'undefined') BECOME = {};
if(typeof BECOME.widgets == 'undefined') BECOME.widgets = {};

BECOME.widgets.ShopProducts = function(id, data)
{
	this.id = id;
	if((this.sorter = document.getElementById(this.id + '-sort')))
	{
		Shine.addEventHandler(this.sorter, 'change', { host: this, handler: this.onsorter });
	}
}
BECOME.widgets.ShopProducts.prototype.onsorter = function(Shine, sender, ev, data)
{
	var s, q;
	
	s = '?sort=' + sender.value;
	q = document.getElementById(this.id + '-query');
	if(q && q.value)
	{
		s = s + '&q=' + q.value;
	}
	window.location = s;
}
