function loadDiv(url, target) {
  document.getElementById(target).innerHTML = 'Loading content...';
  if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
  }
  if (req != undefined) {
    req.onreadystatechange = function() { loadDivDone(url, target); };
    req.open("GET", url, true);
    req.send("");
  }
}  

function loadDivDone(url, target) {
  if (req.readyState == 4) { // only if req is "loaded"
    if (req.status == 200) { // only if "OK"
      document.getElementById(target).innerHTML = req.responseText;
      lang = read_cookie("lang");
      if (lang == null) { // Cookie not set
        lang = "swedish";
      }
      set_language(lang);
    } else {
      document.getElementById(target).innerHTML=" Error:\n"+ req.status + "\n" +req.statusText;
    }
  }
}

function loadIntoDiv(name, div) {
  loadDiv(name, div);
}

    function popupImg(img) 
    {
        html = "<HTML><HEAD><TITLE>Photo</TITLE>"
        + "<base href=http://www.boxholmsmaskiner.se>"
        + "</HEAD><BODY LEFTMARGIN=0 "   
        + "MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER>"   
        + "<a href='javascript:window.close();'>"
        + "<IMG src='" + img + "' BORDER=0 NAME=image width=700>"   
        + "</a></CENTER>"
        + "</BODY></HTML>"; 
        popup=window.open('','image', 'width=750,height=550,toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1'); 
        popup.document.open(); 
        popup.document.write(html); 
        popup.document.focus(); 
        popup.document.close();
}