
var FateSearchAjsxBusy=false;function fateCls_getSpaceFateHistory(offset,total){if(typeof(offset)=='undefined'){var offset=0;}
if(typeof(total)=='undefined'){var offset=100;}
total=Math.min(total,5);if(offset<0||offset>=total){return;}
offset=Math.min(offset,5);var url="/ajax/fate.php";var par=[];var pars='act=spacehistory';par.push(pars);pars='uid='+$('fate_space_h_uid').value;par.push(pars);pars='offset='+offset;par.push(pars);pars=par.join("&");new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){FateSearchAjsxBusy=false;var temp=eval("("+e.responseText+")");if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code==0){var back_offset=temp.offset-1;var next_offset=temp.offset+1;var total=temp.total;var fate_h=temp.content;if(fate_h!=null){$('fate_del_id').innerHTML=fate_h['fid'];$('fate_space_icon').href='/'+fate_h['username'];$('fate_space_icon').innerHTML='<img style="width: 100%; height: 89px;" src="'+fate_h['mainphoto']+'" />';$('fate_space_nickname').innerHTML='<a href="/'+fate_h['username']+'">'+fate_h['nickname_short']+'</a>';$('fate_space_content').innerHTML=fate_h['fate_content']+'<p style="text-align: right;"><br /><a href="/modules/fate.php?act=history&uid='+$('fate_space_h_uid').value+'#f'+temp.offset+'">查看详细</a></p>';var outstr='';if(back_offset>-1){outstr+='<a href="javascript:;" onclick="fateCls_getSpaceFateHistory('+back_offset+', '+total+');">上一个</a>';}
if(next_offset<(Math.min(total,5))){outstr+=' <a href="javascript:;" onclick="fateCls_getSpaceFateHistory('+next_offset+', '+total+');">下一个</a>';}
$('fate_space_page').innerHTML=outstr;}else{$('indexele48').innerHTML='你还没测试过缘分，<a href="/modules/fate.php">快去测试吧！</a>';}}else{fk_alert('未知错误,请重试',250,50);}}});}
function fateCls_delFateHistory(fid,obj){if(window.location.href.indexOf('/modules/fate.php')>-1&&Fate_Cur_Uid!=Fate_My_Uid){return;}
if(typeof(fid)=='undefined'||fid==''){fk_alert('无效参数',250,50);return;}
var url="/ajax/fate.php";var par=[];var pars='act=delhistory';par.push(pars);pars='fid='+fid;par.push(pars);pars=par.join("&");loadCls.Begin(obj);new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(e){var temp=eval("("+e.responseText+")");if(temp.rtn_code!=0){loadCls.End();}
if(temp.rtn_code=="nosession"){login_user_ajax();}else if(temp.rtn_code==0){if(window.location.href.indexOf('/modules/fate.php')>-1){fateCls_getFateHistory();}else{fateCls_getSpaceFateHistory(0,5);}}else if(temp.rtn_code==1){}else{fk_alert('未知错误,请重试',250,50);}}});}
function fateCls_getFateHistory(url,pageName){if(typeof(pageName)!='undefined'&&pageName!=''){var url="/ajax/fate.php?"+pageName;}else{var url="/ajax/fate.php";}
var par=[];var pars='act=history';par.push(pars);pars='uid='+Fate_Cur_Uid;par.push(pars);pars=par.join("&");loadCls.Begin();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){$('fate_h_list').innerHTML=temp.content;$('fate_h_page').innerHTML=temp.pagelist;location.href="#pagecontent";}else{fk_alert('未知错误,请重试',250,50);}}});}