function $(b){return document.getElementById(b)}function mktime(){return(new Date).getTime()}function datetime(b){var a=new Date;a.setTime(b*1E3);return a.getFullYear()+"/"+(a.getMonth()+1)+"/"+a.getDate()+" "+a.getHours()+":"+a.getMinutes()+":"+a.getSeconds()}function datetime_date(b){var a=new Date;a.setTime(b*1E3);return a.getFullYear()+"/"+(a.getMonth()+1)+"/"+a.getDate()}function trim(b){return b.replace(/(^\s*)|(\s*$)/g,"")}
function uri_q(b){var a=[];a.push("q_time="+mktime());for(var c in b)a.push(c+"="+encodeURIComponent(b[c]));return a.join("&")}user={list:{},ssi:"index.php",check_list:{},check:function(b,a){j.ajax({url:this.ssi+"?a=user_check&view=json&"+uri_q(b),dataType:"json",success:function(c){if(c["return"])if(c.user)user.check_list[c.user.id]=c.user;else user.check_list[c.id]=c.reason;a&&a(c)}})}};
ui={el:{},combo_box:function(b,a,c){ui.el[b]=this;this.data=a?a:[];var e=this;this.target=j(b);this.set_position=function(){var d=this.target.offset();this.list_box.css({position:"absolute",left:d.left+"px",top:d.top+this.target.height()+"px"})};this.toggle=function(){this.set_position();this.list_box.toggle()};this.render=function(d){this.list_box=j("<div></div>").appendTo("body").addClass("combo_box_list").width(this.target.width()).hide();this.set_position();if(d)this.data=d;d="";for(var f in this.data)d+=
'<a href="#">'+this.data[f]+"</a>";this.list_box.html(d);this.items=this.list_box.children("a").click(function(){j(b).val(j(this).text());e.toggle();e.cb&&e.cb(j(this).text());return false})};if(c){if(c.btn)this.btn=j(c.btn).click(function(){e.toggle();return false});if(c.cb)this.cb=c.cb}}};
