





//-->

function writediv()
     {
     document.getElementById('tableTest').innerHTML = "";
     }



function makeTable() {
  var ourDiv=document.getElementById('tableTest');
  var t=document.createElement('table');  	// - start by creating the table element
  var tb=document.createElement('tbody');  	// - create a tbody element 
  tb.setAttribute("id", "dataTable");
  // - !! YOU MUST INCLUDE THE TBODY TAG FOR THIS EXAMPLE TO WORK IN WIN IE5+ !! 


  
 // - create the text that will go in the table cell
  
				// - put the row into the tbody
  t.appendChild(tb);						// - put the tbody into the table
  ourDiv.appendChild(t); 					// - put the table into the div
}


function processReqChange()
{
 if (req.readyState == 4 && req.status == 200 && req.responseXML != null)
 {
   var dto = document.getElementById( 'dataTable' );
    var items = [];
    var nl = req.responseXML.getElementsByTagName( 'slide' );
    for( var i = 0; i < nl.length; i++ )
    {


        
    
      var nli = nl.item( i );
      var src = nli.getAttribute( 'src' ).toString();
      var width = parseInt( nli.getAttribute( 'width' ).toString() );
      var height = parseInt( nli.getAttribute( 'height' ).toString() );
	  var image_id = parseInt( nli.getAttribute( 'image_id' ).toString() );

      var trNode = document.createElement( 'tr' )
	  trNode.setAttribute('id',image_id);
	  
	  var tdNode = document.createElement( 'td' );
	  trNode.appendChild( tdNode );
	  

      var imgNode = document.createElement( 'img' );
      imgNode.src = src;
	  imgNode.setAttribute("width",width);
	  imgNode.setAttribute("height",height);
	  
	  tdNode.appendChild( imgNode );
      dto.appendChild( trNode );
    }

  }
}



function loadXMLDoc(url,batch)
{
  if (url == 'arrow')
  {
   url = 'slide.php?batch=' + batch +'&slide=' + slide;
  }
  req = false;
  if(window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch(e) {
      req = false;
    }
  }
  else if(window.ActiveXObject)
  {
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
    try {
      req = new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) {
      req = false;
    }
  }
  }
  if(req) {
    req.onreadystatechange = processReqChange;
    req.open("GET", url, true);
    req.send("");
  }
}






