
var voteCls={insertNewTextOption:function(objname){var objs=$(objname).getElementsByTagName("li");if(objs.length>=20){alert("20个选项足够大家来投票八卦了。。。还要添加？小心弄晕你自己~ 吼吼……");return;}
if(objs.length>=10){var htmlContent='<select name="select_atmost" id="select_atmost">';htmlContent+='<option value="0">单选</option>';for(i=1;i<=objs.length;i++){htmlContent+='<option value="'+parseInt(i+1)+'">最多选'+parseInt(i+1)+'项</option>';}
htmlContent+='</select>';$("p_select_atmost").innerHTML=htmlContent;}
var obj=document.createElement("li");var btshowres=$("btshowres").innerHTML;obj.className="m_top10 cboth clearfix";obj.id="lioptions"+parseInt(objs.length+1);if(btshowres=="－隐藏"){obj.innerHTML='<div class="text fleft t_right font_bold font_gray_a">候选项'+parseInt(objs.length+1)+':</div><div class="fleft m_left10"><input type="text" name="option'+parseInt(objs.length+1)+'" id="option'+parseInt(objs.length+1)+'" class="input_a"  maxlength="50"></div><div class="list_concent m_top10 cboth" id="mylioption'+parseInt(objs.length+1)+'"><div class="text fleft t_right font_bold font_lv">我的回应:</div><div class="fleft m_left10"><input type="text"  maxlength="255" class="input_a" id="mytxtoption'+parseInt(objs.length+1)+'" name="mytxtoption'+parseInt(objs.length+1)+'"/></div></div>';}else{obj.innerHTML='<div class="text fleft t_right font_bold font_gray_a">候选项'+parseInt(objs.length+1)+':</div><div class="fleft m_left10"><input type="text" name="option'+parseInt(objs.length+1)+'" id="option'+parseInt(objs.length+1)+'" class="input_a"  maxlength="50"></div>';}
$(objname).appendChild(obj);},insertNewPhotoOption:function(objname){var objs=$(objname).getElementsByTagName("li");if(objs.length>=10){alert("10个图图选项足够大家来投票八卦了。。。不要再添加啦！小心撑爆框框~ 嘎嘎……");return;}
if(objs.length>=5){var htmlContent='<select name="select_atmost" id="select_atmost">';htmlContent+='<option value="0">单选</option>';for(i=1;i<=objs.length;i++){htmlContent+='<option value="'+parseInt(i+1)+'">最多选'+parseInt(i+1)+'项</option>';}
htmlContent+='</select>';$("p_select_atmost").innerHTML=htmlContent;}
var obj=document.createElement("li");var btshowres=$("btshowres").innerHTML;obj.id="lioptions"+parseInt(objs.length+1);obj.className="m_top10 cboth";if(btshowres=="－隐藏"){obj.innerHTML='<div class="text fleft t_right font_bold font_gray_a">候选项'+parseInt(objs.length+1)+':</div><div class="fleft m_left10"><input type="file" name="option'+parseInt(objs.length+1)+'" id="option'+parseInt(objs.length+1)+'" class="input_h"><input type="text" name="txtoption'+parseInt(objs.length+1)+'" class="input_i" id="txtoption'+parseInt(objs.length+1)+'"  maxlength="8" value="可添加图片说明" onfocus="if(this.value==\'可添加图片说明\'){this.value=\'\';this.style.color=\'black\';}" onblur="if(this.value==\'\'){this.value=\'可添加图片说明\';this.style.color=\'#999999\';}"  /></div><div class="list_concent m_top10 cboth" id="mylioption'+parseInt(objs.length+1)+'"><div class="text fleft t_right font_bold font_lv">我的回应:</div><div class="fleft m_left10"><input type="text" maxlength="255" class="input_a" id="mytxtoption'+parseInt(objs.length+1)+'" name="mytxtoption'+parseInt(objs.length+1)+'"/></div></div>';}else{obj.innerHTML='<div class="text fleft t_right font_bold font_gray_a">候选项'+parseInt(objs.length+1)+':</div><div class="fleft m_left10"><input type="file" name="option'+parseInt(objs.length+1)+'" id="option'+parseInt(objs.length+1)+'" class="input_h"><input type="text" name="txtoption'+parseInt(objs.length+1)+'" class="input_i" id="txtoption'+parseInt(objs.length+1)+'"  maxlength="8" value="可添加图片说明" onfocus="if(this.value==\'可添加图片说明\'){this.value=\'\';this.style.color=\'black\';}" onblur="if(this.value==\'\'){this.value=\'可添加图片说明\';this.style.color=\'#999999\';}"  /></div>';}
$(objname).appendChild(obj);},getTemplate:function(flag){this.selectedRemember=0;var url="/ajax/vote.php";var par=[];var pars="act=gettemplate";par.push(pars);pars="flag="+flag;par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:'post',parameters:pars,onComplete:function(e)
{var result=eval("("+e.responseText+")");if(result.rtn_code=="nosession"){login_user_ajax()}else{if(flag==0){$("img_0").src=static_url_prefix+"/images/common/icon_534.gif";$("img_1").src=static_url_prefix+"/images/common/icon_535.gif";}else{$("img_0").src=static_url_prefix+"/images/common/icon_570.gif";$("img_1").src=static_url_prefix+"/images/common/icon_569.gif";}
$("subtpl_div").innerHTML=result;$("btshowres").innerHTML="＋添加";}}});},subForm:function(){if(isnull("subject")){$("tip").innerHTML="标题不能为空";$("subject").focus();return;}
var objs=$("options").getElementsByTagName("li");var valuenums=0;var vote_classnums=0;for(i=1;i<=objs.length;i++){if(!isnull("option"+i)){valuenums+=1;}}
if(valuenums<2){alert("至少要有两个选项");return;}
if(valuenums<$("select_atmost").value){alert("可投选项最多可选"+valuenums+"项哦~ MS选多了吧！嘻嘻…");return;}
var a=document.getElementsByName("check_class");for(i=0;i<a.length;i++){　 if(a[i].checked){$("items").value=a[i].value;for(j=i+1;j<a.length;j++){if(a[j].checked){$("items").value+="\001";$("items").value+=a[j].value;　}}break;　}}
if($("items").value==""){alert("投票类型不能为空");return;}
date1=Date.parse(new Date(todayaa.replace(/-/g,"/")));date2=Date.parse(new Date($("enddate").value.replace(/-/g,"/")));if(date1-date2>0){alert("截止日期不能晚于发表日期");return;}
if($('li_desc').style.display=="none")
$("desc").value="";$("btnOk").disabled=true;$("tip").innerHTML="正在发布,请稍候...";$("theForm").submit();},selectedRemember:0,selectOptions:function(obj,type){if(obj.type=="checkbox"){if(obj.checked==true){if(type==1){if($("checkbox_atmost").value!='0'&&this.selectedRemember+1>$("checkbox_atmost").value){var pop_w=new Popup({contentType:2,isReloadOnClose:false,width:300,height:100});pop_w.setContent("title","提示信息");pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:20px;font-size:14px'>最多可选"+$("checkbox_atmost").value+"项哦~ MS选多了吧！嘻嘻…</div>");pop_w.setContent("time_out",1000);pop_w.build();pop_w.show();obj.checked=false;return;}}
if($("select_atmost").value!='0'&&this.selectedRemember+1>$("select_atmost").value){var pop_w=new Popup({contentType:2,isReloadOnClose:false,width:300,height:100});pop_w.setContent("title","提示信息");if(type==1){pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:20px;font-size:14px'>最多可选"+$("select_atmost").value+"项哦~ MS选多了吧！嘻嘻…</div>");}else{pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:20px;font-size:14px'>最多可选"+$("select_atmost").value+"项哦~ MS选多了吧！嘻嘻…</div>");}
pop_w.setContent("time_out",1000);pop_w.build();pop_w.show();obj.checked=false;return;}
this.selectedRemember++;}else if(this.selectedRemember>0){this.selectedRemember--;}}else if(obj.type=="radio"){this.selectedRemember=1;}},showResponsesTxt:function(objname){var btshowres=$("btshowres").innerHTML;var objs=$(objname).getElementsByTagName("li");if(btshowres=="＋添加"){$("btshowres").innerHTML="－隐藏";for(var i=1;i<=objs.length;i++){var obj=document.createElement("div");obj.className="m_top10 cboth";obj.id="mylioption"+i;obj.innerHTML='<div class="text fleft t_right font_bold font_lv">我的回应:</div><div class="fleft m_left10"><input type="text" name="mytxtoption'+i+'" id="mytxtoption'+i+'" class="input_a"  maxlength="255"></div>';$('lioptions'+i).appendChild(obj);}}else{$("btshowres").innerHTML="＋添加";for(var j=1;j<=objs.length;j++){$('lioptions'+j).removeChild($("mylioption"+j));}}},doVote:function(voteId){var pop_w=new Popup({contentType:2,isReloadOnClose:false,width:200,height:100});pop_w.setContent("title","提示信息");pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:30px;font-size:14px'>处理中，请稍候...</div>");pop_w.build();pop_w.show();var url="/ajax/vote.php";var par=[];var pars="act=vote";par.push(pars);if(typeof otherUrl!="undefined"){var pars="urltype=fkplay";par.push(pars);}
inputArray=$("inputArea").getElementsByTagName("input");len=inputArray.length;selectedOptions=new Array();for(i=0;i<len;i++){　 if(inputArray[i].checked&&inputArray[i].name=="voteButton"){selectedOptions.push(inputArray[i].id);　}}
if(selectedOptions.length==0){pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:20px;font-size:14px'>请选择 1 项</div>");pop_w.setContent("time_out",1000);pop_w.reBuild();pop_w.show();return;}
pars="selectedOptions="+selectedOptions.join(",");par.push(pars);pars="voteId="+voteId;par.push(pars);pars="anonymity="+($("anonymity").checked?'1':'0');par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:'post',parameters:pars,onComplete:function(e)
{var result=eval("("+e.responseText+")");if(result.rtn_code=="nosession"){login_user_ajax()}else if(result.rtn_code=='0'){if(result.ifofficial=='1'){pop_w.config.width=200;pop_w.setContent("contentHtml","<div style='margin-top:20px;margin-bottom:20px;margin-left:10px;font-size:14px'>参与官方投票成功<br />你的KOO币由 <font class='font_bold'>"+(result.kooMoney-1)+"</font> 个  升到了<font class='font_bold'> "+(result.kooMoney)+"</font> 个。</div>");pop_w.reBuild();pop_w.show();}else{pop_w.close();}
$("voteDetailArea").innerHTML=result.content;guidCls.Start(1);if(typeof crazy=="undefined"){voteCls.voteDetailWho_page();$("voteDetailSimilarArea").innerHTML=$("voteDetailSimilarAgainArea").innerHTML;$("img_whoVote_2").style.display="";voteCls.whoVote_nomal(2);}else{this.currentCrazyNums++;voteCls.voteDetailAll(voteId,'voted');voteCls.prevCrazyId=0;}}else if(result.rtn_code=='1'){pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:20px;font-size:14px'>你已经投票啦！</div>");pop_w.setContent("time_out",1000);pop_w.reBuild();pop_w.show();}else if(result.rtn_code=='2'){pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:20px;font-size:14px'>此投票已经结束！</div>");pop_w.setContent("time_out",1000);pop_w.reBuild();pop_w.show();}else if(result.rtn_code=='3'){pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:20px;font-size:14px'>此投票有性别限制！</div>");pop_w.setContent("time_out",1000);pop_w.reBuild();pop_w.show();}else if(result.rtn_code=='4'){pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:20px;font-size:14px'>超过此投票最多可投数量！</div>");pop_w.setContent("time_out",1000);pop_w.reBuild();pop_w.show();}else if(result.rtn_code=='5'){pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:20px;font-size:14px'>系统错误！</div>");pop_w.setContent("time_out",1000);pop_w.reBuild();pop_w.show();}}});},voteDetailWho_page:function(url,pageName){var url_1=(typeof otherUrl!="undefined")?"/ajax/fkplayflashgame.php":"/ajax/vote.php";if(typeof pageName!="undefined"&&pageName!="")
var url=url_1+"?"+pageName;else
var url=url_1;var par=[];var pars="act=votewho";par.push(pars);pars="voteId="+$("voteId").value;par.push(pars);pars="whoType="+$("whoType").value;par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=='0'){Element.update("voteDetailWhoArea",temp.content);}}});},currentType:0,currentCrazyNums:0,prevCrazyId:0,randOfficial:(Math.floor(Math.random()*10)),officialArray:Array(1,2,3,4,5,1,2,3,4,5),ifVotedOfficial:0,voteDetailAll:function(voteId,type,curVoteId,obj){hideMenu();if((this.currentCrazyNums==20&&type!="voted")||(voteId==''&&(typeof type=="undefined"||type==''))){this.currentCrazyNums=0;this.prevCrazyId=0;this.randOfficial=((Math.random()*10).toString().substr(0,1));this.ifVotedOfficial=0
if($("crazyVoteSenderArea"))$("crazyVoteSenderArea").innerHTML="";$("buttonNext").style.display="none";var url=(typeof otherUrl!="undefined")?"/ajax/fkplayflashgame.php":"/ajax/vote.php";var par=[];var pars="act=crazyTip";par.push(pars);pars="voteId="+voteId;par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){var temp=eval("("+e.responseText+")");$("crazyMainContentArea").innerHTML=temp.content;}});return;}
if(voteId=="prev"){voteId=this.prevCrazyId;this.currentCrazyNums--;}else{if(typeof curVoteId!="undefined")
this.prevCrazyId=curVoteId;}
if(typeof type!="undefined"&&type=="")
this.currentCrazyNums++;if(typeof type=="undefined"||type==""||type=="voted")
type=this.currentType;else
this.currentType=type;if(this.currentType==1){if($("button_0"))$("button_0").className="vote_type_btn_out";if($("button_1"))$("button_1").className="vote_type_btn_on";if($("button_2"))$("button_2").className="vote_type_btn_out";}else if(this.currentType==2){if($("button_0"))$("button_0").className="vote_type_btn_out";if($("button_1"))$("button_1").className="vote_type_btn_out";if($("button_2"))$("button_2").className="vote_type_btn_on";}else{if($("button_0"))$("button_0").className="vote_type_btn_on";if($("button_1"))$("button_1").className="vote_type_btn_out";if($("button_2"))$("button_2").className="vote_type_btn_out";}
this.selectedRemember=0;var url=(typeof otherUrl!="undefined")?"/ajax/fkplayflashgame.php":"/ajax/vote.php";var par=[];var pars="act=crazyAll";par.push(pars);pars="voteId="+voteId;par.push(pars);if(this.currentCrazyNums==this.officialArray[this.randOfficial]&&this.ifVotedOfficial==0){pars="ifofficial=1";par.push(pars);this.ifVotedOfficial=1;}
pars="type="+type;par.push(pars);pars=par.join("&");loadCls.Begin(obj);new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){loadCls.End();var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=='0'){this.currentType=type;Element.update("crazyAllArea",temp.content);if((typeof otherUrl!="undefined")){document.getElementById("contentArea_1").style.height=varClientHeight;}}
if(voteCls.prevCrazyId!=0&&voteCls.prevCrazyId!=voteId){$("prevButton").style.display="";}}});},currentWhoType:-1,whoVote:function(type){this.currentWhoType=type;if(type==0){$("whoVote_img_0").src=static_url_prefix+"/images/common/icon_564.gif";$("whoVote_img_1").src=static_url_prefix+"/images/common/icon_565.gif";if($("whoVote_img_2"))
$("whoVote_img_2").src=static_url_prefix+"/images/common/icon_652.gif";if($("whoVote_img_3"))$("whoVote_img_3").src=static_url_prefix+"/images/common/icon_649.gif";$("voteDetailWhoArea").style.display="";$("voteDetailCommentArea").style.display="none";$("voteDetailSimilarArea").style.display="none";$("whoType").value=type;this.voteDetailWho_page();}else if(type==1){$("whoVote_img_0").src=static_url_prefix+"/images/common/icon_571.gif";$("whoVote_img_1").src=static_url_prefix+"/images/common/icon_572.gif";if($("whoVote_img_2"))
$("whoVote_img_2").src=static_url_prefix+"/images/common/icon_652.gif";if($("whoVote_img_3"))$("whoVote_img_3").src=static_url_prefix+"/images/common/icon_649.gif";$("voteDetailWhoArea").style.display="";$("voteDetailCommentArea").style.display="none";$("voteDetailSimilarArea").style.display="none";$("whoType").value=type;this.voteDetailWho_page();}else if(type==2){$("whoVote_img_0").src=static_url_prefix+"/images/common/icon_571.gif";$("whoVote_img_1").src=static_url_prefix+"/images/common/icon_565.gif";if($("whoVote_img_2"))
$("whoVote_img_2").src=static_url_prefix+"/images/common/icon_651.gif";if($("whoVote_img_3"))$("whoVote_img_3").src=static_url_prefix+"/images/common/icon_649.gif";$("voteDetailWhoArea").style.display="none";$("voteDetailCommentArea").style.display="none";$("voteDetailSimilarArea").style.display="";}else if(type==3){$("whoVote_img_0").src=static_url_prefix+"/images/common/icon_571.gif";$("whoVote_img_1").src=static_url_prefix+"/images/common/icon_565.gif";if($("whoVote_img_2"))
$("whoVote_img_2").src=static_url_prefix+"/images/common/icon_652.gif";if($("whoVote_img_3"))$("whoVote_img_3").src=static_url_prefix+"/images/common/icon_650.gif";$("voteDetailWhoArea").style.display="none";$("voteDetailCommentArea").style.display="";$("voteDetailSimilarArea").style.display="none";}},currentWhoType_nomal:0,whoVote_nomal:function(type){if(type==this.currentWhoType_nomal)
return;this.currentWhoType_nomal=type;if(type==0){$("whoVote_img_0").src=static_url_prefix+"/images/common/icon_564.gif";$("whoVote_img_1").src=static_url_prefix+"/images/common/icon_565.gif";$("whoVote_img_2").src=static_url_prefix+"/images/common/icon_652.gif";$("voteDetailWhoArea").style.display="";$("voteDetailSimilarArea").style.display="none";$("whoType").value=type;this.voteDetailWho_page();}else if(type==1){$("whoVote_img_0").src=static_url_prefix+"/images/common/icon_571.gif";$("whoVote_img_1").src=static_url_prefix+"/images/common/icon_572.gif";$("whoVote_img_2").src=static_url_prefix+"/images/common/icon_652.gif";$("voteDetailWhoArea").style.display="";$("voteDetailSimilarArea").style.display="none";$("whoType").value=type;this.voteDetailWho_page();}else if(type==2){$("whoVote_img_0").src=static_url_prefix+"/images/common/icon_571.gif";$("whoVote_img_1").src=static_url_prefix+"/images/common/icon_565.gif";$("whoVote_img_2").src=static_url_prefix+"/images/common/icon_651.gif";$("voteDetailWhoArea").style.display="none";$("voteDetailSimilarArea").style.display="";}},subVoteComment:function(obj){var content=$("txtvotecomment").value;$("txtvotecomment").value="";if(content==""){var pop_w=new Popup({contentType:2,isReloadOnClose:false,width:200,height:100});pop_w.setContent("title","提示信息");pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:30px;font-size:14px'>留言内容不能为空！</div>");pop_w.build();pop_w.setContent("time_out",1000);pop_w.show();$("txtvotecomment").focus();return;}
var url=(typeof otherUrl!="undefined")?"/ajax/fkplayflashgame.php":"/ajax/vote.php";var par=[];var pars="act=dosubmitvotecomment";par.push(pars);pars="voteId="+$("voteId").value;par.push(pars);pars="content="+encodeURIComponent(content);par.push(pars);pars=par.join("&");loadCls.Begin(obj);new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){loadCls.End();var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=='0'){$("totalcomment").innerHTML=parseInt($("totalcomment").innerHTML)+1;Element.update("votecommentDiv",temp.content);}else if(temp.rtn_code=='1'){security_notify();}}});},showAllVoteWhoHeightType:0,showAllVoteWho:function(obj){if(this.showAllVoteWhoHeightType==0){this.showAllVoteWhoHeightType=1;obj.innerHTML="－关闭全部";}else{this.showAllVoteWhoHeightType=0;obj.innerHTML="＋显示全部";}},sendMessageBoard:function(userId){var pop_w=new Popup({contentType:2,isReloadOnClose:false,width:260,height:200});pop_w.setContent("title","留言");pop_w.setContent("contentHtml","<div style=\"margin-top:10px;height:100px;\" id=\"messageBox\"><p class=\"m_left25\">剩余字数:<span id=\"leftwords\">100</span></p><p class=\"m_left25\"><textarea style=\"width:200px;\" name=\"messageboard_content\" id=\"messageboard_content\"onmousedown=\"textCounter('messageboard_content','leftwords',100);\" onblur=\"textCounter('messageboard_content','leftwords',100);\" onkeyup=\"textCounter('messageboard_content','leftwords',100);\" onmouseup=\"textCounter('messageboard_content','leftwords',100);\" onkeypress=\"textCounter('messageboard_content','leftwords',100);\" onchange=\"textCounter('messageboard_content','leftwords',100);\"></textarea></p><p class=\"m_left25\"><a href=\"javascript:voteCls.doSendMessageBoard('"+userId+"')\"><img src=\""+static_url_prefix+"/images/common/message_ico_03.gif\" border=\"0\" /></a></p></div>");pop_w.build();pop_w.show();},doSendMessageBoard:function(userid){if(isnull('messageboard_content')){$("messageboard_content").focus();return;}
var url="/ajax/messageboard.php";var par=new Array();pars="act=submit";par.push(pars);pars="messageboardcontent="+encodeURIComponent($("messageboard_content").value);par.push(pars);pars="uid="+userid;par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:'post',parameters:pars,onComplete:function(e){temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=="security"){security_notify();}else if(temp.rtn_code=="false"){var pop_w=new Popup({contentType:2,isReloadOnClose:false,width:260,height:200});pop_w.setContent("title","留言");pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:20px;font-size:14px'>留言失败，请重试！</div>");pop_w.setContent("time_out",1000);pop_w.build();pop_w.show();}else{var pop_w=new Popup({contentType:2,isReloadOnClose:false,width:260,height:200});pop_w.setContent("title","留言");pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:20px;font-size:14px'>留言成功！</div>");pop_w.setContent("time_out",1000);pop_w.build();pop_w.show();}}});},diggVote:function(type){if(typeof pageName!="undefined"&&pageName!="")
var url="/ajax/vote.php?"+pageName;else
var url="/ajax/vote.php";var par=[];var pars="act=diggVote";par.push(pars);pars="type="+type;par.push(pars);pars="voteId="+$("voteId").value;par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=='0'){var diggtopNum=$("diggtopNum").innerHTML;var diggdownNum=$("diggdownNum").innerHTML;if(type=='0'){$("diggtopNum").innerHTML=parseInt(diggtopNum)+1;}else{$("diggdownNum").innerHTML=parseInt(diggdownNum)+1;}}else{var pop_w=new Popup({contentType:2,isReloadOnClose:false,width:250,height:100});pop_w.setContent("title","提示信息");pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:30px;font-size:14px'>你已经顶过它或者踩过它了！</div>");pop_w.build();pop_w.setContent("time_out",1000);pop_w.show();}}});},votePersonKing:function(type){if(type==1){$('todayperson').style.display='';$('weekperson').style.display='none';$('monthperson').style.display='none';}else if(type==2){$('todayperson').style.display='none';$('weekperson').style.display='';$('monthperson').style.display='none';}else{$('todayperson').style.display='none';$('weekperson').style.display='none';$('monthperson').style.display='';}
for(var i=1;i<4;i++){if(type==i)
$("votePersonKing_"+i).className="on_bth t_center fleft";else
$("votePersonKing_"+i).className="no_bth t_center fleft";}},voteLuck:function(type){if(type==1){$("voteLuck_1").className="boy off m_right5";$("voteLuck_2").className="girl";$("voteLuckArea_girl").style.display="none";$("voteLuckArea_boy").style.display="";}else{$("voteLuck_1").className="boy m_right5";$("voteLuck_2").className="girl off";$("voteLuckArea_boy").style.display="none";$("voteLuckArea_girl").style.display="";}},voteCrazy:function(){var url="/modules/vote.php?act=crazy";pop_w=new Popup({contentType:1,isReloadOnClose:false,width:918,height:500,isSupportDraging:false});pop_w.setContent("title","疯狂投票");pop_w.setContent("contentUrl",url);pop_w.build();pop_w.show();},commendFriend:function(){this.commendFriendArray.clear();this.pop_w=new Popup({contentType:1,isReloadOnClose:false,width:220,height:400,isSupportDraging:false});this.pop_w.setContent("title","我喜欢！");this.pop_w.setContent("contentUrl","/modules/fkplay.php?act=commend");this.pop_w.build();this.pop_w.show();},commendFriendArray:[],doCommendFriendArray:function(friendValue,objId){if($(objId).checked==true){parent.voteCls.commendFriendArray.push(friendValue);}else{parent.voteCls.commendFriendArray=parent.voteCls.commendFriendArray.without(friendValue);}},doCommendFriend:function(){this.pop_w.close();var url="/ajax/fkplayflashgame.php";var par=[];var pars="act=commendfriend";par.push(pars);pars="friendId="+this.commendFriendArray.join(",");par.push(pars);pars="votename="+encodeURIComponent($("voteSubjectArea").innerHTML);par.push(pars);pars="voteid="+encodeURIComponent($("voteId").value);par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=='0'){voteCls.tipInfoFun("\"我喜欢！\"成功");this.commendFriendArray.clear();}else{voteCls.tipInfoFun("\"我喜欢！\"失败");this.commendFriendArray.clear();}}});},tipInfoFun:function(content){this.pop_w=new Popup({contentType:2,isReloadOnClose:false,width:200,height:100,isSupportDraging:false});this.pop_w.setContent("title","提示信息");this.pop_w.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:30px;font-size:14px'>"+content+"</div>");this.pop_w.setContent("time_out",1000);this.pop_w.build();this.pop_w.show();},myvotelist_page:function(url,pageName){if(typeof pageName!="undefined"&&pageName!="")
var url="/ajax/vote.php?"+pageName;else
var url="/ajax/vote.php";var par=[];var pars="act=myvotelist_page";par.push(pars);pars="userid="+$("cur_userId").value;par.push(pars);pars="type="+$("type").value;par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){loadCls.End();var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=='0'){Element.update("votelist_span",temp.content);Element.scrollTo_ie6hack("friendVoteListArea_scroll");}}});},friendsvotelist_page:function(url,pageName){if(typeof pageName!="undefined"&&pageName!="")
var url="/ajax/vote.php?"+pageName;else
var url="/ajax/vote.php";var par=[];var pars="act=friendsvotelist_page";par.push(pars);pars="type="+$("type").value;par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){loadCls.End();var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=='0'){Element.update("friendVoteListArea_span",temp.content);Element.scrollTo_ie6hack("friendVoteListArea_scroll");}}});},topvotelist_page:function(url,pageName){if(typeof pageName!="undefined"&&pageName!="")
var url="/ajax/vote.php?"+pageName;else
var url="/ajax/vote.php";var par=[];var pars="act=topvotelist_page";par.push(pars);pars="type="+$("type").value;par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){loadCls.End();var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=='0'){Element.update("friendVoteListArea",temp.content);Element.scrollTo_ie6hack("friendVoteListArea_scroll");}}});},offvotelist_page:function(url,pageName){if(typeof pageName!="undefined"&&pageName!="")
var url="/ajax/vote.php?"+pageName;else
var url="/ajax/vote.php";var par=[];var pars="act=offvotelist_page";par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){loadCls.End();var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=='0'){Element.update("friendVoteListArea",temp.content);Element.scrollTo_ie6hack("friendVoteListArea_scroll");}}});}}
function voteDetailComment_page(url,pageName){if(typeof pageName!="undefined"&&pageName!="")
var url="/ajax/vote.php?"+pageName;else
var url="/ajax/vote.php";var par=[];var pars="act=votedetailcommentlist";par.push(pars);pars="voteId="+$("voteId").value;par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){loadCls.End();var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=='0'){$("voteDetailCommentpage").innerHTML=temp.content;}}});}
function delVoteComment(cid){pop=new Popup({contentType:3,isReloadOnClose:false,width:300,height:120});pop.setContent("title","友情提示");pop.setContent("confirmCon","确实要删除该评论吗?");pop.setContent("callBack",delVoteComment_callback);pop.setContent("parameter",{cid:cid,popup:pop});pop.build();pop.show();}
function delVoteComment_callback(para){o_pop=para["popup"];o_pop.config.contentType=2;o_pop.setContent("contentHtml","<div style='margin-top:35px;margin-bottom:40px;margin-left:20px;font-size:14px'>正在删除，请稍候……</div>");o_pop.reBuild();var url="/ajax/vote.php";var par=[];var pars="act=delvotecomment";par.push(pars);pars="commentId="+para["cid"];par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=='0'){$("totalcomment").innerHTML=parseInt($("totalcomment").innerHTML)-1;$(para["cid"]+"_comment").parentNode.removeChild($(para["cid"]+"_comment"));o_pop.close();}}});}
function editVoteEndTime(){date1=Date.parse(new Date(todayaa.replace(/-/g,"/")));date2=Date.parse(new Date($('endTime_time').value.replace(/-/g,"/")));date3=Date.parse(new Date($('startdate').innerHTML.substr(0,10).replace(/-/g,"/")));if(date2<date3){alert("截止日期不能晚于发表日期");return;}
if(date2<date1){alert("截止日期不能早于今天");return;}
if(typeof pageName!="undefined"&&pageName!="")
var url="/ajax/vote.php?"+pageName;else
var url="/ajax/vote.php";var par=[];var pars="act=updateVoteEndTime";par.push(pars);pars="newTime="+$('endTime_time').value;par.push(pars);pars="voteId="+$("voteId").value;par.push(pars);if(typeof urltype!="undefined"){pars="urltype=fkplay";par.push(pars);}
pars=par.join("&");new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code=='0'){$("voteDetailArea").innerHTML=temp.content;new Effect.Highlight("enddate",{duration:3.0,startcolor:"#ffaaaa"})}}});}