﻿
var appFlea=new Object();

dcs.init.loadRes("codes");

appFlea.toPrice=function(strPrice,strDiscount)
{
	if (!dcs.common.isNumber(strDiscount)) strDiscount=100;
	var re=strPrice*strDiscount/100;
	re=dcs.codes.toPrice(re);
	return re;
}

appFlea.toProductEmoney=function(intEmoney,strUnit)
{
	var re="不可以使用金币购买";
	if (intEmoney > 0) re="<font class=\"emoney\">"+intEmoney+"</font> "+strUnit;
	return re;
}

appFlea.toButtonBuyEmoney=function(intEmoney,intID)
{
	var re="";
	if (isNum(intEmoney) && toNum(intEmoney)>0) re="<a href=\""+dcs.config.getURL()+"shop/cart.asp?eid="+intID+"\"><img class=\"icon\" src=\""+dcs.config.getURL("skin")+"images/common/ico_emoney.gif\" alt=\"金币("+intEmoney+")购买\"></a>";
	return re;
}
