def doFile(file):
    if file in context.objectIds():
        context.manage_delObjects(file)
    doc = context.invokeFactory(type_name='Document', id=file)
    ok = doc in context.objectIds()
    docObj = context[doc]
    newText=str(srcFolder[file])
    newText = newText.replace('<h2>','<div class="links"><h2>')
    newText = newText.replace('<a href="javascript:history.back()"><img height=29 alt="Click here to go Back" src  ="../images/back.gif" width=92 /></a>','<br>Return to <a href="..">"What Can I Do With This Major"</a><br>')
    newText = newText.replace('</body>','</div>')
    docObj.setText(newText)
    print "created document %s" % doc
    return printed

srcFolder=context['src']
srcFiles=srcFolder.objectIds()

for f in srcFiles:
    print doFile(f)

return printed
