The code makes no sense at all.
<![CDATA[ ]]> is only valid for pages served as XHTML - in those pages it should not be commented out. XHTML also does not allow document.write to be used at all and so having both of those in the same script is completely invalid.
The only use for commenting out the CDATA tag is where you have a page currently being served as HTML that you intend serving as XHTML as soon as IE8 dies (the only browser that still has a significant following that doesn't support XHTML). The script code should therefore be written ready for that conversion which again means that document.write is completely invalid.
Which book was it that presented such meaningless code?
Helping others to solve their computer problem at http://www.felgall.com/