function scChangeCategory(cat)
{
	var form = document.forms['OrderInitPackageForm'];
	form.sc_cat.value = cat;
	form.sc_page.value = 0;
	form.sc_keep_search.value = 0;
	form.submit();
}

function scGoPage(pid)
{
	var form = document.forms['OrderInitPackageForm'];
	if (pid != undefined)
		form.sc_page.value = pid;
	form.submit();
}

function scSearch()
{
	var form = document.forms['OrderInitPackageForm'];
	
	if (form.sea_cat != undefined)
		form.sc_cat.value=form.sea_cat.value;
	
	form.sc_go_search.value = 1;
	form.submit();
}

function scShowCart()
{
	var form = document.forms['OrderInitPackageForm'];
	form.sc_show_cart.value = 1;
	form.submit();
}

function scShowProdInfo(pid)
{
	var form = document.forms['OrderInitPackageForm'];
	form.sc_show_prod.value = pid;
	form.submit();
}

function scGoAction(act)
{
	var form = document.forms['OrderInitPackageForm'];
	form.sc_act.value = act;
	form.submit();
}

function scVote(pid)
{
	var form = document.forms['OrderInitPackageForm'];
	form.sc_act.value = 'vote';
	form.sc_show_prod.value = pid;
	form.submit();
}

function scAjaxReviewList(page)
{
	var form = document.forms['OrderInitPackageForm'];
	
	// Create ajax
	var ajax = new sack();
	ajax.method = 'POST';
	ajax.requestFile = sys_uri + '/action/Jin/ShopcartReview/Web/list.html';
	
	ajax.setVar('prod_id', prod_id);
	ajax.setVar('pack_id', pack_id);
	ajax.setVar('page', page);
	
	// Specify function that will be executed after request complete
	ajax.onCompletion = 
		function()
		{
			document.getElementById('scDivReview').innerHTML = ajax.response;
		};
	
	// POST data
	ajax.runAJAX();
}

function scAjaxReviewPost(act)
{
	var form = document.forms['OrderInitPackageForm'];
	
	// Create ajax
	var ajax = new sack();
	ajax.method = 'POST';
	ajax.requestFile = sys_uri + '/action/Jin/ShopcartReview/Web/post.html';
	
	ajax.setVar('prod_id', prod_id);
	ajax.setVar('pack_id', pack_id);
	if (act)
	{
		ajax.setVar('post_review', 1);
		ajax.setVar('sc_review_author_name', form.sc_review_author_name.value);
		ajax.setVar('sc_review_author_email', form.sc_review_author_email.value);
		ajax.setVar('sc_review_message', form.sc_review_message.value);
		
	}
	
	// Specify function that will be executed after request complete
	ajax.onCompletion = 
		function()
		{
			document.getElementById('scDivReview').innerHTML = ajax.response;
		};
	
	// POST data
	ajax.runAJAX();
}