/*================================================================

	gsReview.js
	
						Author	:shopex.cn
						Modifier:groovesync, inc.
						copyright (c)2008 groovesync, inc.

================================================================*/


function onChangeCommentLevel(o)
{
	startPollGetReviewList();
	xajax_get_review_list( o.options[o.selectedIndex].value, 0, goods_id, keyword, page);
}

function onKeySearch(e)
{
	if(e.keyCode==13) onSubmitSearch()
}

function onSubmitSearch()
{
	startPollGetReviewList();
	xajax_get_review_list( gs.$('comment_level').value, 0, goods_id, gs.$('comment_search_key').value, page );
}



$( function() {
	startPollGetReviewList();
	xajax_get_review_list( 1, 0, goods_id, '', 1 );
} );

var getReviewListPollTimer = null;

function startPollGetReviewList()
{
	$("#goodsReviewCenter").html( "loading..." );
	if( getReviewListPollTimer ) clearInterval( getReviewListPollTimer );
	getReviewListPollTimer = setInterval( "pollGetReviewList()", 100 );
}

function pollGetReviewList()
{
	var h = $("#goodsReviewCenter").html();
	if( h == "loading..." ) return;
	$("#goodsReviewCenter").html( h.split("&amp;nbsp").join("&nbsp;") );
	clearInterval( getReviewListPollTimer );
	getReviewListPollTimer = null
}

