
﻿$(function(){img=new Image();img.src='/tpl/img/loadings.gif';if($('#gw1').length){$('#gw1 textarea').keydown(function(evt){evt=evt||window.event;var key=evt.keyCode||evt.which;if(evt.ctrlKey){if(key==10||key==13){GpWall();}}});$('#gw1 textarea').jGrow({rows:15});}
SInV='g';});var InvLoad='';function GPInv(id){showDialog('<div id="gi0"><div style="padding:30px;text-align:center"><img src="/tpl/img/loadings.gif"/></div></div>','<div style="text-align:right"><a href="/users/?us[ginvite]='+id+'" style="color:#369;float:left;margin:4px 0 0 10px">'+ln15+' >></a><input type="button" value="'+ln14+'" class="btn1"/></div>',400);$('#dlgB .btn1').click(function(){InvLoad=$('#gi0').html();hideDialog();});if(InvLoad==''){$.get('/groups/ajax.php?invite='+id+'&r='+Math.random(),function(data){if(data!='false'){$('#gi0').html(data);InvLoad=data;}});}else $('#gi0').html(InvLoad);}
function GpUInv(uid,gid){$('#ga'+uid).html('<img src="/tpl/img/loadings.gif"/>');$.get('/groups/ajax.php?uinv='+uid+'&gid='+gid+'&r='+Math.random(),function(data){if(data!='false')$('#ga'+data).remove();});}
function GpConf(a,id){$('#gv012').html('<img src="/tpl/img/loadings.gif"/>');$.get('/groups/ajax.php?action='+a+'&gid='+id+'&r='+Math.random(),function(data){if(data=='false')return;if(data=='2z'){$('#gv012').remove();$('<div class="gv13">'+ln11+'</div>').appendTo('#gv12');}
else window.location='/group'+id;});}
(function($){$.fn.jGrow=function(options){var opts=$.extend({},3,options);return this.each(function(){$(this).css({overflow:'hidden'}).bind('keyup',function(){$this=$(this);var o=$.meta?$.extend({},opts,$this.data()):opts;if(o.rows==0&&(this.scrollHeight>this.clientHeight))this.rows+=1;else if((this.rows<=o.rows)&&(this.scrollHeight>this.clientHeight))this.rows+=1;else if(o.rows!=0&&this.rows>o.rows)$this.css({overflow:'auto'});$this.html();});});};})(jQuery);function GpWNew(){$('#gw1').slideToggle('fast');if($('#gv08').length)$('#gv08').slideToggle('fast');}
function GpWall(){if($('#gw1 textarea').val()!=''){$('#gw1').hide();id=$('#gw01').val();var pg=1;if($('#gw02').length)pg=$('#gw02').text();$.post('/groups/ajax.php?ncmt='+id+'&r='+Math.random(),{cmt:$('#gw1 textarea').val(),pg:pg},function(data){if(data!='false'){$('#gw2').html(data);$('#gw9').hide();}
$('#gw1 textarea').val('');});$('#gw9').show();}}
function GpLP(p,id){$.get('/groups/ajax.php?pgl='+p+'&id='+id+'&r='+Math.random(),function(data){if(data!='false')$('#gw2').html(data);$('#gw9').hide();});$('#gw03').html('<img src="/tpl/img/loadings.gif">');}
function GpEw(c){var tx=$('#GWm'+c+' .gw7').html();$('#GWm'+c+' .gw8').hide();$('#GWm'+c+' .gw7').html('<textarea rows=3></textarea><input type="button" value="'+ln7+'" class="btn2" onclick="GpSw('+c+')"/>');$('#GWm'+c+' textarea').jGrow({rows:15}).val(tx.replace(/<br>/gi,'\n')).keydown(function(evt){evt=evt||window.event;var key=evt.keyCode||evt.which;if(evt.ctrlKey){if(key==10||key==13){GpSw(c);}}});}
function GpSw(c){var tx=$('#GWm'+c+' textarea').val();$('#GWm'+c+' .gw7').html('<div style="text-align:center;padding:20px"><img src="/tpl/img/loadings.gif"/></div>');$.post('/groups/ajax.php?scmt='+c+'&r='+Math.random(),{cmt:tx},function(data){if(data!='false'){$('#GWm'+c+' .gw7').html(tx.replace(/\n/gi,'<br>'));$('#GWm'+c+' .gw8').show();}});}
function GpDw(n,id){$('#GWm'+n+' .gw8 *').hide();$('#GWm'+n+' .gw8').append('<img src="/tpl/img/loadings.gif"/>');$.get('/groups/ajax.php?dcmt='+n+'&id='+id+'&r='+Math.random(),function(data){if(data!='false'){$('#GWm'+n+' *').hide();$('#GWm'+n).append('<div class="gw10">'+ln8+'. <a href="javascript:GpRw('+n+','+id+');">'+ln9+'</a>.</div>');$('#GWm'+n+' .gw8 img').remove();}});}
function GpRw(n,id){$('#GWm'+n+' .gw10').html('<img src="/tpl/img/loadings.gif"/>');$.get('/groups/ajax.php?dcmt='+n+'&id='+id+'&restore='+Math.random(),function(data){if(data!='false'){$('#GWm'+n+' .gw10').remove();$('#GWm'+n+' *').show();}});}
