threead.check_create_thread_form = function(event) {
  var text_elm = $('#create_thread_textarea');
  var error_elm = $('#create_thread_error');
  
  if(text_elm.val().length > 1000) {
    text_elm.css('background-color','#f9adad');
    error_elm.html('Max 1000 chars!');
    return false;
  } else if (text_elm.val().length == 0) {
    text_elm.css('background-color','#f9adad');
    error_elm.html('Write something!');
    return false;
  } else {
    text_elm.css('background-color','white');
    error_elm.html('');
    return true;
  }
}

$(document).ready(function() {
  $('.rounded').corners('7px transparent no-native');
  
  $('.tweet_and_avatar_holder').click(function(){
    document.location.href= this.id;
  }).mouseover(function(){
    $(this).css("cursor","pointer");
  });
  
  $('#create_thread_textarea').keyup(threead.check_create_thread_form);
  
  
});