function doSetHomepage() {
  $.cookie('home_page_override', window.location.href, { expires: 365 });
  InterimPartners.flashNotice('Your home page has been updated; use the "Reset" option in Quicklinks to change it back.');
}

$(function() {
  $('a#set_home_page').click(function() {
    doSetHomepage();
    return false;
  });

  $('a#reset_home_page').click(function() {
    $.cookie('home_page_override', null);
    $.cookie('has_home_page_question_been_asked', null);
    InterimPartners.flashNotice('Your home page has been reset');
    return false;
  });

  var homePageQuestionAsked = $.cookie('has_home_page_question_been_asked');
  if ((homePageQuestionAsked == null) && (window.location.href.search('/for-c') != -1)) {
    InterimPartners.flashConfirmation('Would you like to set this as your home page for this website? If yes than you will be taken to this page each time on your return.', function() {
      doSetHomepage();
    });  
    $.cookie('has_home_page_question_been_asked', 'yes', { expires: 365 });
  }
  
});


