function scoreCustLogin(){var a={div_id:"login_info_show",content:"欢迎您，{*nickname*}"};indexCustLogin("loginBox","index_login_bo","",a);window.location.reload();}function selectedFriend(b,a,c){if(c&&c>0){alert("您已经向该好友推荐过业务，请不要重复推荐！");return;}document.getElementById("txtFriendName").value=a;document.getElementById("hidFriendId").value=b;document.getElementById("friends_list").style.display="none";}function recmds(a,h){var g=document.getElementById("hidFriendId").value;if(g==""){alert("请选择好友！");return;}var e="";var f=document.getElementsByName("radRecValue");for(var c=0;c<f.length;c++){if(f[c].checked){e=f[c].value;break;}}recommendNotify(g,a);var b="";var d="{'actor':'"+h+"','content':'"+e+"','product':'"+a+"','url':'"+a+"','type':'2'}";getmodule("pubwin","bo_id=score_recmdbss_friends_resultmsg&friend_id="+g+"&content="+d+"&pid="+a);}function recommendNotify(e,b){var c="ajax.do?method=doApp&app_attribute=recommendMsgSendApp&friendId="+e+"&pid="+b;var d=new Ajax.Request(c,{asynchronous:false,method:"get",evalScripts:true,onSuccess:function a(f){str=f.responseText;}});}function orderPrice(c,b){var a=0;if(c.value=="-1"){a=c.options[c.selectedIndex].id;}getmodule("score_center","bo_id=score_consume_content&price_flag="+c.value+"&price="+a+"&orderby="+b);}function execVals(a,b){var f=parseInt(document.getElementById("hidprice").value,10);var d=document.getElementById("hidprocname").value;var c=0;if(document.getElementById("hid_score_total")){c=parseInt(document.getElementById("hid_score_total").value,10);}var e=parseInt(document.getElementById("hidprocount").value,10);if(a==1){if(c<f){getmodule("pubwin","bo_id=score_product_failed&name="+d+"&price="+f+"&user_price="+c+"&op_name=兑换");return;}getmodule("pubwin","bo_id=score_product_pre_exchange&flag=1&name="+d+"&price="+f+"&pid="+b+"&user_price="+c);}else{if(a==2){if(c<f){getmodule("pubwin","bo_id=score_product_failed&name="+d+"&price="+f+"&user_price="+c+"&op_name=赠送");return;}getmodule("pubwin","bo_id=score_product_pre_exchange&flag=2&name="+d+"&price="+f+"&pid="+b+"&user_price="+c);}else{if(a==3){getmodule("pubwin","bo_id=score_product_pre_ask&name="+d+"&price="+f+"&pid="+b+"&user_price="+c);}}}}function exchange(){var a=document.getElementById("product_id").value;var c=document.getElementById("user_price").value;var e=document.getElementById("price").value;var b=document.getElementById("pname").value;var d=1;getmodule("main","bo_id=score_product_exchange&name="+b+"&price="+e+"&user_price="+c+"&pid="+a+"&count="+d);closePubWin();}function showAddAndPost(){var b=document.getElementById("showAdd");b=trim(b.innerText.substring(3));if(b==""){b.innerText="输入有效的邮政地址";document.getElementById("cust_add").value="";}else{document.getElementById("cust_add").value=b;}var a=document.getElementById("showPost");a=trim(a.innerText.substring(3));if(a==""){a.innerText="输入6位邮编";document.getElementById("cust_post").value="";}else{document.getElementById("cust_post").value=a;}}function showInArea(){document.getElementById("div_score_area_in").style.display="block";document.getElementById("div_score_area").style.display="none";}function editCustAdd(){var d=trim(document.getElementById("cust_add").value);var g=trim(document.getElementById("cust_post").value);if(d=="输入有效的邮政地址"||d==""){alert("请输入有效的邮政地址");return;}var c=/^[1-9]\d{5}(?!\d)$/;if(!c.test(g)){alert("请输入6位有效邮编");return;}var b=d.length;var f=parseInt(b/20,10);var e="";if(b>0){for(var a=0;a<f;a++){e+=d.substring(a*20,(20*a)+20);e+="<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";}e+=d.substring((f*20)+(b%f));}else{e=d;}document.getElementById("showAdd").innerHTML="地址："+e;document.getElementById("showPost").innerText="邮编："+g;cancelValue();getmodule("","bo_id=score_product_updateadd&cust_add="+d+"&cust_post="+g);}function cancelValue(){document.getElementById("div_score_area_in").style.display="none";document.getElementById("div_score_area").style.display="block";}function resetValue(a){if(a==1){var c=document.getElementById("cust_add");if(c.value=="输入有效的邮政地址"){c.value="";return;}}else{if(a==2){var d=document.getElementById("cust_post");var b=/^[1-9]\d{5}(?!\d)$/;if(!b.test(parseInt(d.value))){d.value="";return;}}}}function present(b){var d=document.getElementById("hidFriendId").value;var g=document.getElementById("product_id").value;var a=document.getElementById("user_price").value;var h=document.getElementById("price").value;var f=document.getElementById("pname").value;var j=1;if(d==""){alert("请选择好友！");return;}var c="{'actor':'"+b+"','product':'"+g+"','type':'3'}";var e="&result_msg=已通知您的朋友前来领取。&opname=赠送成功&flag=1";getmodule("sent_result","bo_id=score_product_presentok"+e+"&fid="+d+"&pname="+f+"&price="+h+"&user_price="+a+"&pid="+g+"&count="+j);}function reqproc(h){var g=document.getElementById("hidFriendId").value;var a=document.getElementById("product_id").value;var c=document.getElementById("user_price").value;var e=document.getElementById("price").value;var b=document.getElementById("pname").value;var d=1;if(g==""){alert("请选择好友");return;}var f="&result_msg=已向好友发出索要信息，请等待你的好友来买单。&opname=索要成功&flag=2";getmodule("sent_result","bo_id=score_product_presentok"+f+"&fid="+g+"&pname="+b+"&price="+e+"&user_price="+c+"&pid="+a+"&count="+d);}function getTips(a){var b="";var c="";if(a==1){c="为什么我兑换的物品还没送到：";b="视运输路程远近，奖品送达时间有所偏差。";}else{c="为什么我的积分没有增加：";b="在订制了可以换积分的业务之后，需要七天之内没有退订才能获得积分。";}getmodule("pubwin","bo_id=score_resp_tips&title="+c+"&note="+b);}function fireEvents(b,a,c){if(b=="10"){insertMomaViewLog(a,c);}else{window.location.href="initPage?topid=score_top&buid=score_consume_detail&tailid=tail&pid="+a;}}function tGoto(d,a){var b=document.getElementById("hidFlag");var e=document.getElementById("li"+a);var c=document.getElementById("li"+b.value);if(document.uniqueID){c.className="";e.className="hover";}else{c.setAttribute("class","");e.setAttribute("class","hover");}b.value=a;getmodule("score_center","bo_id="+d);}function appendStart(d){var a=[];for(var c=1,b=0;c<=d;c++){var e=document.getElementById("apres"+c);if(e){var f={count:e.value,id:"divAppraiserStart"+c};a[b++]=f;}}bussAppraiserStart(a);}function bussAppraiserStart(a){if(!a){return;}var d="<img src='"+basePath+"/images/star_n.gif' style='width:20px;height:20px;border:none' >";var j="<img src='"+basePath+"/images/star_y.gif' style='width:20px;height:20px;border:none' >";var c="<img src='"+basePath+"/images/star_half.gif' style='width:20px;height:20px;border:none' >";var k=a.length;for(var e=0;e<k;e++){if(a[e].count==0){if(document.getElementById(a[e].id)){document.getElementById(a[e].id).innerHTML=writeNIMG(5,d);}}else{var g=""+a[e].count;var h=g.split(".");var f=writeNIMG(h[0]>5?5:h[0],j);var b=5-(parseInt(h[0])+parseInt((h[1]?1:0)));if(b>0){f+=writeNIMG(h[1]?1:0,c);f+=writeNIMG(b,d);}document.getElementById(a[e].id).innerHTML=f;}}}function writeNIMG(b,a){var c="";for(i=0;i<b;i++){c+=a;}return c;}