 function popUp(URL) {
    var xmlHttp;
    try {
      // Firefox, Opera 8.0+, Safari
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
      // Internet Explorer
      try {
        xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
      }
      catch (e) {
        try {
          xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (e) {
          alert("Your browser does not support AJAX!");
          return false;
        }
      }
    }
    xmlHttp.onreadystatechange = function() {
      if (xmlHttp.readyState == 4) {
        var dim = xmlHttp.responseText;
        img_dim = dim.split(";");
        if (img_dim[0] > 0 && img_dim[1] > 0) {
          day = new Date();
          id = day.getTime();
          window.open(URL, id, "toolbar=0,scrollbars=no,location=no,statusbar=no,menubar=0,resizable=no,width=" + img_dim[0] + ",height=" + img_dim[1] + ",left = 0,top = 0");
        }
      }
    }
    xmlHttp.open("GET", "imagesize.php?img="+URL+"&cache="+Math.random(), true);
    xmlHttp.send(null);
  }

