var _imps_sum, _imps_top, _imps_hot;
_imps_sum = '0';
_imps_top = [
];
_imps_hot = [
];
function show_imp_acts(cid, num, pct){
return "title='"+num+"人投票支持,占"+pct+"' onClick=\"add_yinxiang('"+cid+"', 1);\"";
}
function show_imp_main(n){
var s = '';
for(i=0;i<_imps_hot.length;i++){
if(i==n) break;
var f=''; var r = _imps_hot[i];
if(i==0) f="one"; if(i==1 || i==2) f="two";
var cid = r[0], imp = r[1], num = r[2], pct = r[3];
s += ""+imp+"";
}
$id('imps_a1s').innerHTML = s;
}
function show_imp_new(n){
var s = '';
for(i=0;i<_imps_top.length;i++){
if(i==n) break;
var f=''; var r = _imps_top[i];
var cid = r[0], imp = r[1], num = r[2], pct = r[3];
s += ""+imp+"";
}
$id('kbslide').innerHTML = '最新印象:'+s;
}
function show_imp_more(n){
var s = '';
for(i=0;i<_imps_top.length;i++){
if(i==n) break;
var f=''; var r = _imps_top[i];
var cid = r[0], imp = r[1], num = r[2], pct = r[3];
s += ""+imp+"";
}
$id('yixiang').innerHTML = s;
}
/*
function show_imp_hot(n){
var s = '';
for(i=0;i<_imps_hot.length;i++){
if(i==n) break;
var r = _imps_hot[i];
var f = i ? "class='first'" : '';
var cid = r[0], imp = r[1], num = r[2], pct = r[3];
s += "
"+imp+""+num+""+pct+"";
}
$id('_imp_hot_id').innerHTML = '品牌口碑得票数支持率'+s;
}*/
function add_yinxiang(val, iscid){
var key = iscid ? 'cid' : 'impression';
var url2 = url+'&ccid=1031&'+key+'='+escape(val);
var head = document.getElementsByTagName("head")[0];
var script = document.createElement('script');
//console.log(url2); // &datatype=js|json
script.onload = script.onreadystatechange = script.onerror = function (s){
if (script && script.readyState && /^(?!(?:loaded|complete)$)/.test(script.readyState)) return;
script.onload = script.onreadystatechange = script.onerror = null;
script.src = '';
script.parentNode.removeChild(script);
script = null;
eval(s);
var re = _remsg;
//if(re=='succeed'){
// $.modal.tip('印象提交成功!','succeed');
// $id('new_imp').value = '最多6个字';
//}else{
if(re=='OK') $.modal.tip('印象添加成功!','succeed');
else $.modal.tip(re,'error');
// }
$(".jiayx em,.jiayx i").removeClass("act");
$id('addyx').innerHTML = '添加印象';
//alert(s);
}
script.charset = "utf-8";
script.src = url2;
try { head.appendChild(script); }
catch (ex1) {}
/*
Ajax().get(url+'&ccid=1031&'+key+'='+val,function(s){
alert(s); eval(s); var re = _remsg;
if(re=='succeed'){
alert('印象提交成功。');
}else{
alert(re);
}
$(".jiayx em,.jiayx i").removeClass("act");
$id('addyx').innerHTML = '添加印象';
});*/
return false;
}
function new_yinxiang(){
var val = $id('new_imp').value;
if(val=='最多6个字' || val.length==''){
$.modal.tip('请填写内容!','error');
$id('new_imp').focus();
return false;
}
add_yinxiang(val);
return false;
}