Issue with window.document in IE 11

Issue with window.document in IE 11

HI Every one,

I have strange issue on my JSP page like strings "Undefined" are displayed every where on page. I have given sample code snippet below and help me out to resolve the issue. gave source code as well for your reference. open_link4 will return the window object. Please provide me the resolution as as possible.

 private void writeTopLinks(Claim claim, JspWriter writer,
   IClaimVehicleFacade claimVehicleFacade,
   RolloutDelegate icsRolloutDelegate) throws IOException {
  if (SecurityThreadUtils.hasAccess(Function.CLAIM_NOTES_ADD)) {
   writer.print("<a href=\"javascript:void(0)\" onclick=\"var win = open_link4('', 'notesAddWin");
   writer.print(claimNumber);
   writer.print("', 650, 700); if( win.document == undefined || win.document.forms[0] == undefined || ");
   writer.print("win.document.forms[0].claimNumber == undefined || win.document.forms[0].claimNumber.value != '");
   writer.print(claimNumber);
   writer.print("' ) { open_link4('");
   writer.print(LinkManager.getLink("ICSAddNote"));
   writer.print("?claimNumber=");
   writer.print(claimNumber);
   writer.print("', 'notesAddWin");
   writer.print(claimNumber);
   writer.print("', 650, 700) } \">Add Note</a><br />");