<!--
var js_q = '';
function cp_o(username) { if(document.getSelection) js_q = document.getSelection(); } 

function qs(username) { 
 if (document.selection) js_q = document.selection.createRange().text;
 var tmp = '';
 if(username != '') tmp = '="' + username + '"';
 emoticon('[quote' + tmp + ']' + js_q + '[/quote]\n');
 document.post.message.focus();
} 

function storeCaret(textEl) { if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate(); }
function u_n(text) { if(text != '') emoticon('[b]' + text + '[/b], \n'); }
function c_h(o) {o.style.cursor='hand';}

function emoticon(text) {
 var txtarea = document.post.message;
 text = ' ' + text + ' ';
 if(txtarea.createTextRange && txtarea.caretPos) {
  var caretPos = txtarea.caretPos;
  caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
  txtarea.focus();
 } else {
  txtarea.value  += text;
  txtarea.focus();
 }
}

function checkForm() {
 formErrors = false;    
 if(document.post.message.value.length < 2) {
  formErrors = "{L_EMPTY_MESSAGE}";
  }
 if (formErrors) {
  alert(formErrors);
  return false;
  } else {
  bbstyle(-1);
  return true;
  }
}


var wnd = 0;
function js_w(url_,width_,height_) {
 if(wnd && !wnd.closed) wnd.close();
 wnd = window.open(url_, "page", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width="+width_+",height="+height_);
 wnd.focus();
}

function c_b1(id) {
 var u_t = prompt("Пожалуйста, введите комментарий для модераторов","");
 if (!u_t) { alert("Причина должна быть указана обязательно!"); return; }
 document.formcard.post_id.value = id;
 document.formcard.u_text.value = u_t;
 document.formcard.action.value = 1;
 document.formcard.submit();
}

function c_b2(id) {
 document.formcard.post_id.value = id;
 document.formcard.action.value = 2;
 document.formcard.submit();
}
//-->