You have some bad code inside the productMaindImage script. Can't do a document.write with </a> Gotta be <\ /a>
NOTE: I put a space between the two slashes just to keep them from looking like a capital V.

Change all the </ to <\/ and you may find the error goes away.

ADDED: it's in additionalImages as well