function gotoListing()
{
	var bid = '';
	for(i=0; i < document.getElementById('csr_top_numbrand').value; ++i) {
		if (document.getElementById('csr_top_brand_' + i).checked == true)
		{
			bid = bid + ',' + document.getElementById('csr_top_brand_' + i).value;
		}
	}

	if (bid != '')
	{
		bid = '0' + bid;
	}

	var price = '';
	for(i=0; i < document.getElementById('csr_top_numprice').value; ++i) {
		if (document.getElementById('csr_top_price_' + i).checked == true)
		{
			price = price + ',' + document.getElementById('csr_top_price_' + i).value;
		}
	}

	if (price != '')
	{
		price = '0' + price;
	}

	var catid = document.getElementById('csr_catid').value;
	var subcatid = document.getElementById('csr_subcatid').value;
	var order = document.getElementById('pl_order').value;
	var page = document.getElementById('csr_page').value;

	self.location = 'index.php?file=csr&bid=' + bid + '&catid=' + catid + '&subcatid=' + subcatid + '&prid=' + price + '&order=' + order + '&pg=' + page;
}

function gotoSubcat(_subcatid)
{
	var bid = '';
	for(i=0; i < document.getElementById('csr_top_numbrand').value; ++i) {
		if (document.getElementById('csr_top_brand_' + i).checked == true)
		{
			bid = bid + ',' + document.getElementById('csr_top_brand_' + i).value;
		}
	}

	if (bid != '')
	{
		bid = '0' + bid;
	}

	var price = '';
	for(i=0; i < document.getElementById('csr_top_numprice').value; ++i) {
		if (document.getElementById('csr_top_price_' + i).checked == true)
		{
			price = price + ',' + document.getElementById('csr_top_price_' + i).value;
		}
	}

	if (price != '')
	{
		price = '0' + price;
	}

	var catid = document.getElementById('csr_catid').value;
	var order = document.getElementById('pl_order').value;
	var page = document.getElementById('csr_page').value;

	self.location = 'index.php?file=csr&bid=' + bid + '&catid=' + catid + '&subcatid=' + _subcatid + '&prid=' + price + '&order=' + order + '&pg=' + page;
}

function gotoPage(_page)
{
	var bid = '';
	for(i=0; i < document.getElementById('csr_top_numbrand').value; ++i) {
		if (document.getElementById('csr_top_brand_' + i).checked == true)
		{
			bid = bid + ',' + document.getElementById('csr_top_brand_' + i).value;
		}
	}

	if (bid != '')
	{
		bid = '0' + bid;
	}

	var price = '';
	for(i=0; i < document.getElementById('csr_top_numprice').value; ++i) {
		if (document.getElementById('csr_top_price_' + i).checked == true)
		{
			price = price + ',' + document.getElementById('csr_top_price_' + i).value;
		}
	}

	if (price != '')
	{
		price = '0' + price;
	}

	var catid = document.getElementById('csr_catid').value;
	var subcatid = document.getElementById('csr_subcatid').value;
	var order = document.getElementById('pl_order').value;

	self.location = 'index.php?file=csr&bid=' + bid + '&catid=' + catid + '&subcatid=' + subcatid + '&prid=' + price + '&order=' + order + '&pg=' + _page;
}

function removeBrand(_bid)
{
	var bid = '';
	for(i=0; i < document.getElementById('csr_top_numbrand').value; ++i) {
		if (document.getElementById('csr_top_brand_' + i).checked == true)
		{
			if (document.getElementById('csr_top_brand_' + i).value != _bid)
			{
				bid = bid + ',' + document.getElementById('csr_top_brand_' + i).value;
			}
		}
	}

	if (bid != '')
	{
		bid = '0' + bid;
	}

	var price = '';
	for(i=0; i < document.getElementById('csr_top_numprice').value; ++i) {
		if (document.getElementById('csr_top_price_' + i).checked == true)
		{
			price = price + ',' + document.getElementById('csr_top_price_' + i).value;
		}
	}

	if (price != '')
	{
		price = '0' + price;
	}

	var catid = document.getElementById('csr_catid').value;
	var subcatid = document.getElementById('csr_subcatid').value;
	var order = document.getElementById('pl_order').value;

	self.location = 'index.php?file=csr&bid=' + bid + '&catid=' + catid + '&subcatid=' + subcatid + '&prid=' + price + '&order=' + order;
}

function removePrice(_prid)
{
	var bid = '';
	for(i=0; i < document.getElementById('csr_top_numbrand').value; ++i) {
		if (document.getElementById('csr_top_brand_' + i).checked == true)
		{
			bid = bid + ',' + document.getElementById('csr_top_brand_' + i).value;
		}
	}

	if (bid != '')
	{
		bid = '0' + bid;
	}

	var price = '';
	for(i=0; i < document.getElementById('csr_top_numprice').value; ++i) {
		if (document.getElementById('csr_top_price_' + i).checked == true)
		{
			if (document.getElementById('csr_top_price_' + i).value != _prid)
			{
				price = price + ',' + document.getElementById('csr_top_price_' + i).value;
			}
		}
	}

	if (price != '')
	{
		price = '0' + price;
	}

	var catid = document.getElementById('csr_catid').value;
	var subcatid = document.getElementById('csr_subcatid').value;
	var order = document.getElementById('pl_order').value;

	self.location = 'index.php?file=csr&bid=' + bid + '&catid=' + catid + '&subcatid=' + subcatid + '&prid=' + price + '&order=' + order;
}

function removeSubcat()
{
	var bid = '';
	for(i=0; i < document.getElementById('csr_top_numbrand').value; ++i) {
		if (document.getElementById('csr_top_brand_' + i).checked == true)
		{
			bid = bid + ',' + document.getElementById('csr_top_brand_' + i).value;
		}
	}

	if (bid != '')
	{
		bid = '0' + bid;
	}

	var price = '';
	for(i=0; i < document.getElementById('csr_top_numprice').value; ++i) {
		if (document.getElementById('csr_top_price_' + i).checked == true)
		{
			price = price + ',' + document.getElementById('csr_top_price_' + i).value;
		}
	}

	if (price != '')
	{
		price = '0' + price;
	}

	var catid = document.getElementById('csr_catid').value;
	var subcatid = '';
	var order = document.getElementById('pl_order').value;

	self.location = 'index.php?file=csr&bid=' + bid + '&catid=' + catid + '&subcatid=' + subcatid + '&prid=' + price + '&order=' + order;
}

function returnCatlist()
{
	self.location = 'index.php?file=catlist';
}
