What is True Thanksgiving? (1 Peter 1:3-9)

Thanksgiving is a time where we find our joy by counting our blessings.  There is nothing necessarily wrong with counting our blessings, but what is the basis of our blessing?  Peter challenges us to see that there are trials that we can be thankful for as well.  Why would be thankful for trials?  What hope does Peter give in calling our attention to thankfulness even in the midst of trials?  Or is Peter just telling us to be happy because the Lord commands us to be happy?