var tmp="请输入你的观点";function checkCommentInput(b){if(b.value.length>50){b.value=b.value.substr(0,50)}}function submitFavorite(pid){var forward=location.pathname+location.search;var jsonRequest=new Request.JSON({url:"/favoriteSubmit.php",onComplete:function(result,text){var commentPopup=new Popup({autoClose:true,pos:"rightTop"});alert(result.message);if(result.action!=null){commentPopup.addEvent("closeAll",function(){eval(result.action)});if(result.actionPreMsg!=null){var ttip='<div style="width:200px; font-weight:bold; color:red; border:#dddddd solid 2px;">'+result.actionPreMsg+"</div>";commentPopup._alert("",ttip)}}}}).get({pid:pid,forward:forward})}var delaycomment=0;function submitComment(id,pid){$("commenttextinput").fireEvent("focus");if($("commenttextinput").value.trim()==""){alert("观点不得为空~");return}if($("commenttextinput").value.trim().length>50){alert("观点不能超过50个字符");return}if(delaycomment>0){alert("每人每产品只能发表一个观点。");return}var forward=location.pathname+location.search;var forward2="getProductComment(); ";var jsonRequest=new Request.JSON({url:"/commentSubmit.php",onComplete:function(result,text){var commentPopup=new Popup({autoClose:true,pos:"rightTop"});var ttip='<div style="width:200px; color:red; padding:10px; text-align:center; ">'+result.message+"</div>";commentPopup._alert("",ttip);if(result.action!=null){commentPopup.addEvent("closeAll",function(){eval(result.action)});if(result.gain!=null){commentPopup._letyoBi("发表观点",2)}}if(result.delay&&result.delay=="delay"){delaycomment=1}}}).get({comment:$("commenttextinput").value.trim(),pid:pid,id:id,forward:forward,forward2:forward2})}function clickComment(e,f,d){comment=$(d).getElement("span.normal").get("html");$("commenttextinput").fireEvent("focus");$("commenttextinput").value=comment;submitComment(e,f)}function showMoreComments(){$$(".comment_cf").each(function(b){b.set("class","comment_c15")});$("morecommentslink").setStyle("display","none")}window.addEvent("domready",function(){$$("dd.comment_c").each(function(g){var l=g.getElement("div");g.setProperty("sbgcolor",l.getStyle("background-color"));if(l.getStyle("width").toInt()>100){g.set("class","comment_w");var k=new Element("b");k.inject(l,"bottom");var i=l.getElement("span.normal");var h=l.getElement("p");var j=new Fx.Tween(h);g.addEvent("mouseenter",function(){l.setStyle("color",g.getProperty("sbgcolor"));l.setStyle("background","none repeat scroll 0% 0% #ffffff");g.setStyle("z-index","1");j.start("width",i.getSize().x)});g.addEvent("mouseleave",function(){j.cancel();l.setStyle("color","#ffffff");l.setStyle("background",g.getProperty("sbgcolor"));g.setStyle("z-index","0");h.setStyle("width",null)})}})});
