

      // Get the HTTP Object

      function getHTTPObject(){

      if (window.ActiveXObject) 

      return new ActiveXObject("Microsoft.XMLHTTP");

      else if (window.XMLHttpRequest) 

      return new XMLHttpRequest();

      else {

      alert("Your browser does not support AJAX.");

      return null;

      }

      }

         // Implement business logic

      function doWork(i,inty){


      httpObject = getHTTPObject();

      if (httpObject != null) {

      httpObject.open('GET', 'pimg.php?v='+inty, true);

      httpObject.send(null);

      httpObject.onreadystatechange = setOutput;

      }

      }
      // Change the value of the outputText field

      function setOutput(){

      if(httpObject.readyState == 4){

      document.getElementById('cpic').innerHTML = httpObject.responseText;



      }

      }
