
function updateJobPostingRow(post_id, app_id) {
  var disclose_img = "img_" + post_id
  if ($(app_id).visible()) {
    document.getElementById(disclose_img).src = '/images/arrow_right.gif'
    $(post_id).className = $(post_id).className.replace(' expanded', '')
  }
  else {
    document.getElementById(disclose_img).src = '/images/arrow_down.gif'
    $(post_id).className += ' expanded'
  }
}

function showPageHelp() {
  $('page_help_link').hide();
  $('page_help').show();
}
function hidePageHelp() {
  $('page_help_link').show();
  $('page_help').hide();
}


/*window.onload = function() {
  Prototype.Browser.IE6 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 6;
  // only do rollovers on non-IE6 due to IE6's PNG limitations
  if(!Prototype.Browser.IE6) {
    if ($('top_photos')) {
      Event.observe($('top_photos'), 'mouseover', function() {
       $('top_photos').src = '/images/photo_home_summer10.png';
      });
      Event.observe($('top_photos'), 'mouseout', function() {
       $('top_photos').src = '/images/photo_home_group.png';
      });  
    }
  }
}*/


Event.observe(window, 'load', function() {  
  // Handle clicks for in-page help
  if ($('page_help_link'))  Event.observe('page_help_link', 'click', showPageHelp);
  if ($('page_help_close')) Event.observe('page_help_close', 'click', hidePageHelp);
  
  // Track clicks on outgoing links using Google Analytics
  $$('a.track_outgoing').each(function(link) {
    Event.observe(link, 'click', function(e) {
      var link_name = link.readAttribute('href').strip().gsub('http://', '').gsub('www\.', '').gsub('\\.', '_');
      urchinTracker('/ads/' + link_name);
    });
  });
  
  // Track clicks on outgoing Walmart links using Google Analytics
  $$('a[href*=walmartdrs]').each(function(link) {
    urchinTracker('/ads/walmart');
  });
  
  // Resubmit job search with TEG results included
  if ($('teg_button')) {
    Event.observe('teg_button', 'click', function() {
      $('search_include_teg').checked = true;
      $('job_search_form').submit();
      return false;
    });
  }
  
  // Show all subscription options
  if ($('show_additional_options')) {
    Event.observe('show_additional_options', 'click', function (event) {
      $('subscription_plans').addClassName('show_extra');
      event.stop();
    });
  }
});
