//Create div for audioTable
function createAudioDiv(xmlDoc, itemsIn)
{
	var div = null;
	var newDiv = null;
	var corps=xmlDoc.getElementsByTagName("corps");
	var pic=corps[0].getElementsByTagName("pic");
	var iterCount = 0; //To count how many times through region is specified region
	var rowCount = 1; //Start row counter at one
	var regionItems = itemsIn; //How many items for each region
	var cellControl = 1; //How many cells max wanted in each row
	var remainder = regionItems%cellControl; //The remainder of region items divided by cellControl = number of cells in first row	
	
	newDiv = document.createElement("div");
	var Vtable=document.createElement('table');
		Vtable.setAttribute('id','audioTable'); //Set table attriubtes
		Vtable.setAttribute('cellpadding','0'); //Set table attriubtes
		Vtable.setAttribute('cellspacing','0'); //Set table attriubtes
	newDiv.appendChild(Vtable);
	
	var Vtbody=document.createElement('tbody');
	Vtable.appendChild(Vtbody);
		
	for(var i=0; i<pic.length; i++)
		{
			var region = pic[i].getAttribute("region");
			if(region == regionName) {
				iterCount++; //When equal increase iterCount by 1				
				
				var rowId=document.createElement('tr'); //Create a table row				
				Vtbody.appendChild(rowId);
			
				var Vtd=document.createElement('td');
					Vtd.setAttribute('class','audioCellImage');
					Vtd.setAttribute('className','audioCellImage'); //for IE
				rowId.appendChild(Vtd);
				
				var Vtd2=document.createElement('td');
					Vtd2.setAttribute('class','audioCellText');
					Vtd2.setAttribute('className','audioCellText'); //for IE
				rowId.appendChild(Vtd2);
				
				var img=document.createElement('img');
					img.setAttribute('src',pic[i].getAttribute("path"));
				Vtd.appendChild(img);
				
				var display=document.createElement('p');
				Vtd2.appendChild(display);
				
				var audioLink=document.createElement('a');
					audioLink.setAttribute('href',("javascript:popUp('" + pic[i].getAttribute("audio") + "'," + 200 + "," + 100 + ");"));
				display.appendChild(audioLink);
							
				var displayText1 = pic[i].getAttribute("name") + ", " + pic[i].getAttribute("year") + " "+ pic[i].getAttribute("region");
				var displayText2 = pic[i].getAttribute("college") + " - "+ pic[i].getAttribute("major");
				var text1=document.createTextNode(displayText1);	
				var text2=document.createTextNode(displayText2);
				var br = document.createElement('br');			
				audioLink.appendChild(text1);
				audioLink.appendChild(br);
				audioLink.appendChild(text2);
			}			
		document.getElementById('audioDiv').appendChild(newDiv);
	}
}
