function getTweets() {
    $('tweets').innerHTML = $('loading').innerHTML;
    ajaxGet('application?ajax=true&query='+$F('search_input'),'tweets', twitterLink());
}

function twitterLink() {
    url = "http://www.mytweet16.com/user/"+$F('search_input');
    $$('.tweeter_link').each(function(s) {
       s.innerHTML = url;
       s.href = url;
    });
    $$('.tweeter_box').invoke('show');
}

function ajaxGet(url, div, func) {
    new Ajax.Request(url,
      {
        method:'get',
        onSuccess: function(transport){
          $(div).innerHTML = transport.responseText;
          if (eval('typeof(' + func + ')') == 'function') {
              eval(func + '();');
          }          
        },
        onFailure: function(){ alert('Something went wrong...') }
      });
}

function tweetIt() {
    url = 'http://www.twitter.com/home?status='+$('twitter_link').href;
    window.location = url;
}