// Place your application-specific JavaScript functions and classes here
jQuery(document).ready(function($){
  var $tabs = $("ul.jq-tabs").tabs();
  
  $('#welcome_image').click(function() { // bind click event to link
      $tabs.tabs('select', 3); // switch to third tab
      return false;
  });

  $('#start_trial_now').click(function() { // bind click event to link
      $tabs.tabs('select', 3); // switch to third tab
      return false;
  });

    // hide all comment forms and activate "post a comment" and "post a reply"
    // TODO: replace the show and hide in toggle with something sexy that fits
    $("div.comment_form").hide();
    $("a.comment_form_show").toggle(function(){
        $("div." + this.className.match(/comment_form_\w+_\d+/)).show();
        return false;
    }, function(){
        $("div." + this.className.match(/comment_form_\w+_\d+/)).hide();
        return false;
    });
    $("a.comment_form_cancel").click(function(){
        $("div." + this.className.match(/comment_form_\w+_\d+/)).hide();
        return false;
    });
});