/**
 * Copyright (c) 2002-2007 i-Seven A/S.
 * Herlev Hovedgade 195, 2730 Herlev, Denmark.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of i-Seven A/S. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with i-Seven A/S.
 */
function replaceSubstring(inputString, fromString, toString) {
  var tempString = inputString;
  for(var i=0;i<inputString.length;i++) {tempString = tempString.replace(fromString,toString);}
  return tempString;
} 
function replaceNoDocumentsFoundMsg(msg) {
  if (browser.isIE) {
    if (document.getElementById('ContentJob').innerHTML.indexOf('<H2>No documents found</H2>') != -1) {
      document.getElementById('ContentJob').innerHTML = replaceSubstring(document.getElementById('ContentJob').innerHTML, '<H2>No documents found</H2>', msg);
    };
    if (document.getElementById('ContentJob').innerHTML.indexOf('<H2>Kan ikke finde nogen dokumenter</H2>') != -1) {
      document.getElementById('ContentJob').innerHTML = replaceSubstring(document.getElementById('ContentJob').innerHTML, '<H2>Kan ikke finde nogen dokumenter</H2>', msg);
    }
  } else {
    if (document.getElementById('ContentJob').innerHTML.indexOf('<h2>No documents found</h2>') != -1) {
      document.getElementById('ContentJob').innerHTML = replaceSubstring(document.getElementById('ContentJob').innerHTML, '<h2>No documents found</h2>', msg);
    }
    if (document.getElementById('ContentJob').innerHTML.indexOf('<h2>Kan ikke finde nogen dokumenter</h2>') != -1) {
      document.getElementById('ContentJob').innerHTML = replaceSubstring(document.getElementById('ContentJob').innerHTML, '<h2>Kan ikke finde nogen dokumenter</h2>', msg);
    }
  }
}

