basicURL = "http://www.metrickserver.net/~mrsub/";

function getXMLHTTPRequest() {
  try {
  req = new XMLHttpRequest();
  } catch(err1) {
    try {
    req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(err2) {
      try {
      req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch(err3) {
        req = false;
      }
    }
  }
  return req;
}

var http = getXMLHTTPRequest();

function showVideo(id) {
  var myurl = "video.php";
  myRand = parseInt(Math.random()*999999999);
  var modurl = myurl +  "?id=" + id + "&rand=" + myRand;
  http.open("GET", modurl, true);
  http.onreadystatechange = useHttpResponse;
  http.send(null);
}

function useHttpResponse() {
  if (http.readyState == 4) {
    if (http.status == 200 || http.status == 304) {
      var videoId = http.responseXML.getElementsByTagName("video")[0].childNodes[0].nodeValue;
      var videoPath = http.responseXML.getElementsByTagName("file")[0].childNodes[0].nodeValue;
      
      response  = '<object type="application/x-shockwave-flash" id="videoplayer3132" data="' + basicURL + 'player/uppod.swf" width="400" height="300">';
      response += '<param name="bgcolor" value="#ffffff" />';
      response += '<param name="allowFullScreen" value="true" />';
      response += '<param name="allowScriptAccess" value="always" />';
      response += '<param name="movie" value="' + basicURL + 'player/uppod.swf" />';
      response += '<param name="flashvars" value="comment=Sample flash&amp;st=' + basicURL + 'player/video525.txt&amp;file=' + videoPath + '" />';
      response += '</object>';
      
      document.getElementById("video").innerHTML = response;
    }
  } else {
    document.getElementById("video").innerHTML = '<img src="' + basicURL + 'img/bar.gif" alt="">';
  }
}