Question: flag folding ceremony

Yesterday I witnessed a flag-folding ceremony at a Veteran's Day assembly at my new school. I've been trying to find out from when and whence this thing comes. Some historical background with citation to sources. Here's what I'm talking about. This would be a military history search, and I've been looking, but am stumped, so... thought about RadRef as a source of help. I particularly want to know the age of the "meaning" of the 13 folds. Mucho gracias!