var sWallTemplate='';var sReplyTemplate='';var sWallDiv='idWallListing';var nWallMoreMode=0;var nActiveCID='new';var nWallIdx=0;aNum[nWallIdx]=0;var nCReplyCID=0;var nOID=0;var nWallType=62;var nMultimediaFormat=1;function wall_send(nCType){htmleditor_gettext('idWallPost',1);show_result('idWallAttached',0,'','');show_result('idWallPostButton',10000,"Wait, sending...",'');AJAX('op=wall_write&sAuthKey='+sAuthKey+'&nCID='+nActiveCID+'&nCReplyCID='+nCReplyCID+'&nOID='+nOID+'&nType='+nWallType +'&nMultimediaFormat='+nMultimediaFormat+'&sUUsername='+sUUsername+'&nUUID='+nUUID +'&sCDesc='+escape($('#idWallPost').val()),'wall_send_result');};function wall_send_result(nResult,sResponse){if(nResult!=-1){$('#idWallPost').val('');nActiveCID='new';wall_show(1);show_result('idWallPostButton',1500,"Posted!    ",'wall_tab();');}else{show_result('idWallPostButton',1500,"Failed, not posted!    ",'');};};function reply_show(nReplyCID,nType,nOID,nUID,sUsername,nReplyCnt){if(nSUID>0||nReplyCnt>0){if($('#idReply'+nReplyCID).html().length>5){$('#idReply'+nReplyCID).html(' ').hide();return;};sReplyTemplate=$('#idReplyTemplate').html().replace(/#ReplyID#/g,nReplyCID).replace(/#Type#/g,nType).replace(/#OID#/g,nOID);$('#idReply'+nReplyCID).html('

        Loading..

 ').show();AJAX('op=reply_fetch&sAuthKey='+sAuthKey+'&nOID='+nOID+'&nCType='+nType+'&nCReplyCID='+nReplyCID +'&sUUsername='+sUsername+'&nUUID='+nUID+'&nReplyCnt='+nReplyCnt+'&sTemplate='+escape(sReplyTemplate) +'&nPos=1&nPerPage=500','reply_show_result');}else{alert('You must be logged-in to post comments');};};function reply_show_result(nResult,sResponse){if(nResult!=-1){$('#idReply'+nResult).html(unescape(sResponse)).show();}else{$('#idReply'+nCID).html(' ').show();show_result('idReply'+nCID,1500,"Sorry unable to retrieve comments",'');};};function reply_send(nCID,nType,nOID,nUID,sUsername){htmleditor_gettext('idWallPost'+nCID,1);show_result('idWallAttached'+nCID,0,'','');show_result('idWallPostButton'+nCID,10000,"Wait, sending...",'');AJAX('op=wall_write&sAuthKey='+sAuthKey+'&nCReplyCID='+nCID+'&nOID='+nOID+'&nType='+nType +'&nMultimediaFormat='+nMultimediaFormat+'&sUUsername='+sUsername+'&nUUID='+nUID +'&sCDesc='+escape($('#idWallPost'+nCID).val()),'reply_send_result');};function reply_send_result(nResult,sResponse){if(nResult!=-1){var nCID=nResult;$('#idWallPost'+nCID).val('');show_result('idWallPostButton'+nCID,3000,"Posted!    ","$('#idReplyCIDClick"+nCID+"').click();");}else{show_result('idWallPostButton'+nCID,1500,"Failed, not posted!    ",'');};};function wall_attach(){show_modal('sAction=media_edit&sAuthKey='+sAuthKey+'&sMode=upload&nType='+nWallType+'&nCID='+(nActiveCID=='new'||nActiveCID<10?-1:nActiveCID) +'&nUUID='+nUUID+'&sUUsername='+sUUsername+'&sCmd=wall_attach_result','')};function wall_attach_result(nOID,nCID,nAttachCnt,sAttached){$('#idWallPost').val($('#idWallPost').val()+"\n"+unescape(sAttached));show_result('idWallAttached',3000,""+nAttachCnt+" media attached.",'');htmleditor_appendtext('idWallPost',unescape(sAttached));};function wall_tab(){$('#idWallTab').click();};function wall_write(){$('#idWriteWallTab').click();};function wall_show(nPos){if(nPos==1) aPos[nWallIdx]=1;else if(nPos==undefined) nPos=aPos[nWallIdx];if(sWallTemplate==''||sWallTemplate==null)sWallTemplate=$('#'+sWallDiv+'Template').html();AJAX('op=wall_fetch&sAuthKey='+sAuthKey+'&nOID='+nOID+'&nCType='+nWallType+'&nCReplyCID='+nCReplyCID+'&sUUsername='+sUUsername+'&nUUID='+nUUID+'&sTemplate='+escape(sWallTemplate)+'&nPos='+nPos+'&nPerPage='+nPerPage,'wall_show_result');};function wall_show_result(nResult,sResponse){if(nResult!=-1){$('#'+sWallDiv).html(unescape(sResponse)).show();pagenav_init(sWallDiv,nWallIdx,aNum[nWallIdx],nPerPage);};};function wall_delete(nCID,sDiv){if(confirm('Are you sure you want to delete this wall posting?')) AJAX('op=post_delete&sAuthKey='+sAuthKey+'&nCOID='+nOID+'&nCType='+nWallType+'&nCID='+nCID+'&sDiv='+sDiv,'wall_delete_result');};function wall_delete_result(nResult,sResponse){if(nResult!=-1) $('#'+nResult).hide();else alert('Sorry could not delete it.');};$(document).ready(function(){if(aNum[nWallIdx]>0) pagenav_init(sWallDiv,nWallIdx,aNum[nWallIdx],nPerPage);});