function listproduct()
{
	var status;
	
	loadingtip(true);
	if (Request.QueryString('page')=='1')
	{
		status=LSA.biz_base.loadproductdataset(5,Request.QueryString('category'),Request.QueryString('mod'),Request.QueryString('app'),Request.QueryString('supplier')).value;
	}
	if (Request.QueryString('admin')=='1')
	{
		//document.all['divlink'].style.display='';
		document.all['divproductlist'].innerHTML=LSA.biz_base.slistproduct(true,Request.QueryString('page')).value;
		
		//document.all['divnewslist'].innerHTML=LSA.biz_base.slistnews(true).value;
	}
	else
	{
		//document.all['divlink'].style.display='none';
		document.all['divproductlist'].innerHTML=LSA.biz_base.slistproduct(false,Request.QueryString('page')).value;
		//document.all['divnewslist'].innerHTML=LSA.biz_base.slistnews(false).value;
	}
	productpager();
	loadingtip(false);
}

function productpager()
{
	if (Request.QueryString('admin')=='1')
	{
		document.all['divpager'].innerHTML=LSA.biz_base.sproductpager(true,Request.QueryString('page')).value;
	}
	else
	{
		document.all['divpager'].innerHTML=LSA.biz_base.sproductpager(false,Request.QueryString('page')).value;
	}
}

function delitem(id)
{
	checkauth1()
	if (confirm('Are you sure you want to delete this item?'))
	{
		if (LSA.biz_base.sdelitem(id).value)
		{
			alert('Item has been deleted!');
			window.location.replace('productlist.aspx?admin=1&page=1');
		}
		else
		{
			alert('Failed to delete this item! Please try again later!');
		}
	}
}

function checkauth1()
{
	if (!LSA.biz_base.scheckauth().value)
	{
		window.location.replace('admin/default.aspx?url='+window.location.pathname+window.location.search);
	}
}