function checkF(){var comment=$('#comment').val();if(comment!=""&&$.trim(comment)!='撰写评论（只提交对'+post.no1+'，而不撰写评论，系统将只记录分值到数据库中。每条评论限传3张图片，每张不超过100KB。）'){if($.trim(comment).length>800||$.trim(comment).length<10){alert("评论内容字数须在10和800之间。");$('#comment').focus();return false;}}
var brand_images=$('#file_brand1').val();var brand_images_ext=brand_images.substr(brand_images.lastIndexOf(".")+1).toLowerCase();if(ext.lastIndexOf(brand_images_ext)==-1){alert("请选择jpg,jpeg,gif,png的图片。");return false;}
var brand_images=$('#file_brand2').val();var brand_images_ext=brand_images.substr(brand_images.lastIndexOf(".")+1).toLowerCase();if(ext.lastIndexOf(brand_images_ext)==-1){alert("请选择jpg,jpeg,gif,png的图片。");return false;}
var brand_images=$('#file_brand3').val();var brand_images_ext=brand_images.substr(brand_images.lastIndexOf(".")+1).toLowerCase();if(ext.lastIndexOf(brand_images_ext)==-1){alert("请选择jpg,jpeg,gif,png的图片。");return false;}
if($('#comment_score0').val()==""){alert("请选择你对"+post.no1+"。");return false;}
var count=0;var len=document.form1.used.length;if(len==undefined){var lent=document.getElementById("used");if(!lent.checked){alert("请选择"+post.no2+"？");return false;}}else{var radios=document.getElementsByTagName("input");for(i=0;i<radios.length;i++){if(radios[i].type=="radio"){if(radios[i].checked){count=count+1;}}}
if(count==0){alert("请选择产品"+post.no3+"经验。");return false;}
a=document.getElementsByName("used")
for(i=0;i<a.length;i++){if(a[i].checked){if(a[i].value==1){var cnt=0;var len1=document.form1.used_pass_six.length;if(len1==undefined){var lent1=document.getElementById("used_pass_six");if(!lent1.checked){alert("请选择您过去6个月是否使用过该产品？");return false;}}else{var radios=document.getElementsByTagName("input");for(i=0;i<radios.length;i++){if(radios[i].type=="radio"){if(radios[i].checked){cnt=cnt+1;}}}
if(cnt==1){alert("请选择您过去6个月是否使用过该产品？");return false;}}
tb_show('','/users/popup_postcomment?TB_iframe=true&height=600px&width=600px',"thickbox");return false;}
if(a[i].value==2){var cnt=0;var len1=document.form1.will_buy.length;if(len1==undefined){var lent1=document.getElementById("will_buy");if(!lent1.checked){alert("请选"+post.no4+"？");return false;}}else{var radios=document.getElementsByTagName("input");for(i=0;i<radios.length;i++){if(radios[i].type=="radio"){if(radios[i].checked){cnt=cnt+1;}}}
if(cnt==1){alert("请选"+pro_post.no4+"？");return false;}}
tb_show('','/users/popup_postcomment?TB_iframe=true&height=600px&width=600px',"thickbox");return false;}}}}}
function get_pro(type){if(type=="best"){p10_tab(1,'','');}
if(type=="worst"){p10_tab(0,1,'');}
if(type=="new"){p10_tab(0,0,1);}
$('#pro_data').html("正在加载数据...");$.ajax({url:"/brands/get_pro&catid="+catid+"&type="+type,type:'GET',dataType:'html',success:function(str){$('#pro_data').html(str);}});}
function p10_tab(m,n,o){for(i=0;i<3;i++){$(".listtb span:eq("+i+")").removeClass();}
$(".listtb span:eq(0)").addClass("rtbon"+m);$(".listtb span:eq(1)").addClass("rtbon"+n);$(".listtb span:eq(2)").addClass("rtbon"+o);}
function display_history(comm_id){var brand_html="";var brand_title;$.getJSON("/users/ajax_get_history_comm?comm_id="+comm_id+"",function(data){history_html='';$.each(data,function(i,item){history_html+='<div class="com_latest com_history">';history_html+='<div class="com_line">';history_html+='<span>'+item.Comment.comment_create_time+'</span>为产品打<b>'+item.Comment.comment_score+'</b>分';history_html+='<div class="com_trust">该评论有<i id="comment_vote_'+item.Comment.id+'">'+item.Comment.comment_reply_num+'</i>人投票，可信度为<i id="comment_credit_'+item.Comment.id+'">'+item.Comment.comment_credit+'</i></div>';if(item.Comment.has_img==1){images=eval(item.Comment.img);$.each(images,function(i,item){if(i==0){css_style="com_a_pic";}
if(i==1){css_style="com_b_pic";}
if(i==2){css_style="com_c_pic";}
if(i==0){css='com_r_pic';}
if(i>0){css='com_r_pic com_r'+(i-1);}
history_html+='<a class="'+css_style+'" onmouseover="show_img('+item.attachments.id+');getProPic('+item.attachments.type_id+','+item.attachments.id+');" onmouseout="hide_img('+item.attachments.id+')" href="#">此评论相关图片</a>';history_html+='<div class="'+css+'" id="picsss_'+item.attachments.id+'" style="display:none"><p></p></div>';});}
history_html+='</div>';history_html+='<div class="com_bd" style="overflow-x:hidden;width:547px">';history_html+=item.Comment.comment;history_html+='</div>';history_html+='<div class="com_else"></div>';history_html+='<div class="com_bottom">';var temp="";var i=1;for(j=10;j>=0;j--){i++;temp+="<li><a href=\"javascript:void(0);\" onclick=\"putscore("+j+","+item.Comment.id+",'"+user_id+"',"+item.Comment.user_id+","+i+");\" style=\"cursor:pointer;\">"+j+"</a></li>";}
history_html+='<ul class="comment_vote" id="vst_'+item.Comment.id+'"><li>绝对可信</li>'+temp+' <li>绝对不可信</li></ul>';history_html+='<a href="javascript:void(0);" onclick="open_dialog(\'report?comment_id='+item.Comment.id+'&id='+item.Comment.user_id+'&pro_id='+item.Comment.pro_id+'\');return false;">举报信息</a> | <a href="javascript:void(0);" onclick="open_dialog(\'send_comment?comment_id='+item.Comment.id+'&id='+item.Comment.user_id+'&pro_id='+item.Comment.pro_id+'\');return false;">发送给好友</a> | <a href="javascript:void(0);" onclick="open_dialog(\'bookmark?comment_id='+item.Comment.id+'&id='+item.Comment.user_id+'&pro_id='+item.Comment.pro_id+'\');return false;">收藏本评论</a></p>';history_html+='</div>';history_html+='</div>';});brand_title="#history"+comm_id;$(brand_title).html(history_html);$("#history"+comm_id).show();$("#open_history_"+comm_id).hide();$("#close_history_"+comm_id).show();});}
function close_history(comm_id){$("#history"+comm_id).hide();$("#open_history_"+comm_id).show();$("#close_history_"+comm_id).hide();}
