maks4339 / кнопки "Для всего"

// ==UserScript==
// @name        кнопки "Для всего"
// @include     *vk.com*im*
// @description отправляет сообщения в ВКонтакте
// @version     99999+
// @grant       none
// @copyright   2015, Maks
// ==/UserScript==

function $_GET(key) {
    var s = window.location.search;
    s = s.match(new RegExp(key + '=([^&=]+)'));
    return s ? s[1] : false;
}
function BGrefresh(){
if(!document.getElementById("ButtonGoodId")){
  var butt = document.createElement("div");
  butt.innerHTML = "Хорошо";
  butt.style.marginTop="2px";
  butt.style.paddingLeft="27px";
  butt.style.paddingRight="27px";
  butt.className="flat_button im_send_cont fl_l";
  butt.id="ButtonGoodId";
  butt.onclick=function(){
    document.getElementById("im_editable"+$_GET('sel')).innerHTML='Хорошо';
    document.getElementById('im_send').click();
  }
  document.getElementById("im_write_form").appendChild(butt);  
  
  var butt2 = document.createElement("div");
  butt2.innerHTML = "Да";
  butt2.style.marginTop="2px";
  butt2.style.paddingLeft="27px";
  butt2.style.paddingRight="27px";
  butt2.className="flat_button im_send_cont fl_l";
  butt2.id="ButtonGoodId2";
  butt2.onclick=function(){
    document.getElementById("im_editable"+$_GET('sel')).innerHTML='Да';
    document.getElementById('im_send').click();
  }
  document.getElementById("im_write_form").appendChild(butt2); 
  
  var butt3 = document.createElement("div");
  butt3.innerHTML = "Нет";
  butt3.style.marginTop="2px";
  butt3.style.paddingLeft="27px";
  butt3.style.paddingRight="27px";
  butt3.className="flat_button im_send_cont fl_l";
  butt3.id="ButtonGoodId3";
  butt3.onclick=function(){
    document.getElementById("im_editable"+$_GET('sel')).innerHTML='Нет';
    document.getElementById('im_send').click();
  }
  document.getElementById("im_write_form").appendChild(butt3);
  
  var butt4 = document.createElement("div");
  butt4.innerHTML = "Ага";
  butt4.style.marginTop="2px";
  butt4.style.paddingLeft="27px";
  butt4.style.paddingRight="27px";
  butt4.className="flat_button im_send_cont fl_l";
  butt4.id="ButtonGoodId4";
  butt4.onclick=function(){
    document.getElementById("im_editable"+$_GET('sel')).innerHTML='Ага';
    document.getElementById('im_send').click();
  }
  document.getElementById("im_write_form").appendChild(butt4);
  
  var butt6 = document.createElement("div");
  butt6.innerHTML = "Привет";
  butt6.style.marginTop="2px";
  butt6.style.paddingLeft="27px";
  butt6.style.paddingRight="27px";
  butt6.className="flat_button im_send_cont fl_l";
  butt6.id="ButtonGoodId6";
  butt6.onclick=function(){
    document.getElementById("im_editable"+$_GET('sel')).innerHTML='Привет';
    document.getElementById('im_send').click();
  }
  document.getElementById("im_write_form").appendChild(butt6);
  
  var butt7 = document.createElement("div");
  butt7.innerHTML = "Как дела";
  butt7.style.marginTop="2px";
  butt7.style.paddingLeft="27px";
  butt7.style.paddingRight="27px";
  butt7.className="flat_button im_send_cont fl_l";
  butt7.id="ButtonGoodId7";
  butt7.onclick=function(){
    document.getElementById("im_editable"+$_GET('sel')).innerHTML='Как дела';
    document.getElementById('im_send').click();
  }
  document.getElementById("im_write_form").appendChild(butt7);
  
  var butt8 = document.createElement("div");
  butt8.innerHTML = "Что делаешь";
  butt8.style.marginTop="2px";
  butt8.style.paddingLeft="27px";
  butt8.style.paddingRight="27px";
  butt8.className="flat_button im_send_cont fl_l";
  butt8.id="ButtonGoodId8";
  butt8.onclick=function(){
    document.getElementById("im_editable"+$_GET('sel')).innerHTML='Что делаешь';
    document.getElementById('im_send').click();
  }
  document.getElementById("im_write_form").appendChild(butt8);
  
  var butt9 = document.createElement("div");
  butt9.innerHTML = "Норм";
  butt9.style.marginTop="2px";
  butt9.style.paddingLeft="27px";
  butt9.style.paddingRight="27px";
  butt9.className="flat_button im_send_cont fl_l";
  butt9.id="ButtonGoodId9";
  butt9.onclick=function(){
    document.getElementById("im_editable"+$_GET('sel')).innerHTML='Норм';
    document.getElementById('im_send').click();
  }
  document.getElementById("im_write_form").appendChild(butt9);
  
  var butt10 = document.createElement("div");
  butt10.innerHTML = "Ничего";
  butt10.style.marginTop="2px";
  butt10.style.paddingLeft="27px";
  butt10.style.paddingRight="27px";
  butt10.className="flat_button im_send_cont fl_l";
  butt10.id="ButtonGoodId10";
  butt10.onclick=function(){
    document.getElementById("im_editable"+$_GET('sel')).innerHTML='Ничего';
    document.getElementById('im_send').click();
  }
  document.getElementById("im_write_form").appendChild(butt10);
}
setTimeout(BGrefresh, 300);
}
BGrefresh();