First, don't use the name "data" for your root node, since "data" is already the name of the dataset the form data is stored in. Using the same name with other form objects can cause strange side effects. Rename it to "form" or someting else.
Ok, you need to reference all instances of the master page "DocumentHeader" and manipulate everyone of them separately.
The best way is to use a for loop like this:
var cType = form.#pageSet.DocumentHeader.TYPE").rawValue,