var docColor = "Black"
Create a variable named docColor and set its value to the string "Black"
var strInnerHTML = prtContent.innerHTML;
Create a variable named strInnerHTML and set its value to the innerHTML value of the prtContent page element.
var strModifiedInnerHTMl = strInnerHTML.replace(/white/g, docColor);
Create a variable named strModifiedInnerHTML and set its value to a modified copy of strInnerHTML where any instances of "white" have been replaced by the current value of docColor(Which is currently "Black"). This is being done with a regular expression /white/ with a g switch indicating that it will update all instances that it finds.
Writes the strModifiedInnerHTML string to a WinPrint document object.
Closes the WinPrint document
Gives the WinPrint object focus
Sends the Winprint object to the printer
Closes/Finished the WinPrint object. More than likely this call is required to clean up resources that the WinPrint object required to perform its actions.