function akfGetHtmlFilename(tabId) {
   f_html = '/akf_html/' + tabId + '.html';
   if (tabId == 'bollogram_love' ||
       tabId == 'bollogram_friends' ||
       tabId == 'bollogram_festival' ||
       tabId == 'bollogram_birthday' ||
       tabId == 'bollogram_actor' ||
       tabId == 'bollogram_actress' ||
       tabId == 'bollogram_singer') {
      split_result = tabId.split("_");
      id = split_result[1];
      f_html = '/bollogram/' + id + '_images.html';
   }
   return f_html;
}

function onTabClicked(tabId) {
   f_html = akfGetHtmlFilename(tabId);
   new Ajax.Request (f_html,
   {
      method:'get',
      onSuccess: function(transport) {
         var content = transport.responseText || 'no response text';
         document.getElementById(tabId).innerHTML = content;   
      },
      onFailure: function() {
         if (! (tabId == 'movie_tab' || tabId == 'actor_tab' ||
                tabId == 'binaca_tab' ||
                tabId == 'singer_tab' || tabId == 'music_director_tab' ||
                tabId == 'director_tab' || tabId == 'lyricist_tab')) {
            alert("Failed to fetch html: " + "/akf_html/" + tabId + ".html");
         }
      }
   });
}

