/*======用户积分=======*/
//用户积分更新提示
function score_update_tip(/*int*/score,/*double?*/currency){
	//没有参数或者都为零，退出处理
	
	if((!score && !currency) || (score==0 && currency==0))return;
	
	var _html = "<div id='score_update_tip_box'  class='score_update_tip'>"
	if(score && score>0){
		_html += "积分+" + score + " &nbsp;&nbsp;"
	}else if(score && score<0){
		_html += "积分-" + score +" &nbsp;&nbsp;"
	}
	if(currency && currency>0){
		_html += "OK币+" + currency
	}else if(currency && currency>0){
		_html += "OK币-" + currency
	}
	_html += "</div>"

	$(_html).appendTo("body");

	var de = document.documentElement;
	//获取屏幕尺寸
	var windowWidth = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var windowHeight = self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
	var yScroll = 0;//取滚动条高度
	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (de && de.scrollTop){
		yScroll = de.scrollTop;
	} else if (document.body) {
		yScroll = document.body.scrollTop;
	}
	var popupHeight = $("#score_update_tip_box").height();
	var popupWidth = $("#score_update_tip_box").width();
	
	var _element_top = yScroll+windowHeight/2-popupHeight/2
	var _element_left = windowWidth/2-popupWidth/2

	//centering
	$("#score_update_tip_box").css({
	    "position": "absolute",
	    "top": _element_top,
	    "left":_element_left
	}); 	
	
	$('#score_update_tip_box').fadeIn(200,function(){
		//停顿2s
		$('#score_update_tip_box').fadeTo(2000,1,function(){
			//渐出
			$('#score_update_tip_box').fadeOut(1000,function(){
				//移除
				$('#score_update_tip_box').remove();
			})
		});
	});
}
