function importCall() 
{
	importStateXML();
	importCouplesXML();
	importClassXML(); 
	importMissingXML();
}

function importStateXML()
	{
		if (document.implementation && document.implementation.createDocument)
		{
			xmlDoc = document.implementation.createDocument("", "", null);
			xmlDoc.onload = createStateTable;
		}
		else if (window.ActiveXObject)
		{
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			xmlDoc.onreadystatechange = function () {if (xmlDoc.readyState == 4) createStateTable()};
		}
		else
		{
			alert('Your browser can\'t handle this script. Please download a newer version to see the information on this page');
			return;
		}
		xmlDoc.load("states.xml");
	}


function createStateTable()
{
	var x = xmlDoc.getElementsByTagName('state');
	var newEl = document.createElement('TABLE');
	newEl.setAttribute('align','center');
	newEl.setAttribute('cellPadding',3);
	newEl.setAttribute('width','40%');	
	var tmp = document.createElement('TBODY');
	newEl.appendChild(tmp);
	var row = document.createElement('TR');
	row.className = "header";
	row.setAttribute('align', 'left');
/*	
	for (j=0;j<x[0].childNodes.length;j++)
	{
		if (x[0].childNodes[j].nodeType != 1) continue;
		var container = document.createElement('TH');		
		var theData = document.createTextNode(x[0].childNodes[j].nodeName);
		container.appendChild(theData);
		row.appendChild(container);
	}
*/
	tmp.appendChild(row);
	for (i=0;i<x.length;i++)
	{
		var row = document.createElement('TR');
		for (j=0;j<x[i].childNodes.length;j++)
		{
			if (x[i].childNodes[j].nodeType != 1) continue;
			var container = document.createElement('TD');
			container.className = "row";
			var theData = document.createTextNode(x[i].childNodes[j].firstChild.nodeValue);
			container.appendChild(theData);
			row.appendChild(container);
		}
		tmp.appendChild(row);
	}
	document.getElementById('st1').appendChild(newEl);
	document.getElementById('st').value = document.getElementById('st1').innerHTML	
}

function importCouplesXML()
	{
		if (document.implementation && document.implementation.createDocument)
		{
			xmlDoc = document.implementation.createDocument("", "", null);
			xmlDoc.onload = createCouplesTable;
		}
		else if (window.ActiveXObject)
		{
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			xmlDoc.onreadystatechange = function () {if (xmlDoc.readyState == 4) createCouplesTable()};
		}
		else
		{
			alert('Your browser can\'t handle this script. Please download a newer version to see the information on this page');
			return;
		}
		xmlDoc.load("couples.xml");
	}


function createCouplesTable()
{
	var x = xmlDoc.getElementsByTagName('couple');
	var newEl = document.createElement('TABLE');
	newEl.setAttribute('cellPadding',3);
	newEl.setAttribute('width','100%');	
	var tmp = document.createElement('TBODY');
	newEl.appendChild(tmp);
	var row = document.createElement('TR');
	row.className = "header";
	row.setAttribute('align', 'left');
	/* 
	for (j=0;j<x[0].childNodes.length;j++)
	{
		if (x[0].childNodes[j].nodeType != 1) continue;
		var container = document.createElement('TH');		
		var theData = document.createTextNode(x[0].childNodes[j].nodeName);
		container.appendChild(theData);
		row.appendChild(container);
	}
	*/
	tmp.appendChild(row);
	for (i=0;i<x.length;i++)
	{
		var row = document.createElement('TR');
		row.setAttribute('align', 'center');
		for (j=0;j<x[i].childNodes.length;j++)
		{
			if (x[i].childNodes[j].nodeType != 1) continue;
			var container = document.createElement('TD');
			container.className = "row";
			var theData = document.createTextNode(x[i].childNodes[j].firstChild.nodeValue);
			container.appendChild(theData);
			row.appendChild(container);
		}
		tmp.appendChild(row);
	}
	document.getElementById('cpls1').appendChild(newEl);
	document.getElementById('cpls').value = document.getElementById('cpls1').innerHTML	
}

function importClassXML()
	{
	  	if (document.implementation && document.implementation.createDocument)
		{
			xmlDoc = document.implementation.createDocument("", "", null);
			xmlDoc.onload = createClassTable;
		}
		else if (window.ActiveXObject)
		{
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			xmlDoc.onreadystatechange = function () {if (xmlDoc.readyState == 4) createClassTable()};
		}
		else
		{
			alert('Your browser can\'t handle this script. Please download a newer version to see the information on this page');
			return;
		}
		xmlDoc.load("class.xml");
	}

function createClassTable()
{
	var x = xmlDoc.getElementsByTagName('classmate');
	var newEl = document.createElement('TABLE');
	newEl.setAttribute('align','center');
	newEl.setAttribute('cellPadding',0);
	newEl.setAttribute('width','75%');	
	newEl.setAttribute('border',1);
	var tmp = document.createElement('TBODY');
	newEl.appendChild(tmp);
	var row = document.createElement('TR');
	row.className = "header";
	row.setAttribute('align', 'left');

	for (j=0;j<x[0].childNodes.length;j++)
	{
		if (x[0].childNodes[j].nodeType != 1) continue;
		var container = document.createElement('TH');		
		var theData = document.createTextNode(x[0].childNodes[j].nodeName);
		container.appendChild(theData);
		row.appendChild(container);	
	} 
	
	tmp.appendChild(row);
	for (i=0;i<x.length;i++)
	{
		var row = document.createElement('TR');
		row.setAttribute('align', 'left');
		
		for (j=0;j<x[i].childNodes.length;j++)
		{
			if (x[i].childNodes[j].nodeType != 1) continue;
			var container = document.createElement('TD');
			container.className = "row";
			var theData = document.createTextNode(x[i].childNodes[j].firstChild.nodeValue);
			container.appendChild(theData);
			row.appendChild(container);			
		}
		tmp.appendChild(row);		
	}
	document.getElementById('cls1').appendChild(newEl);
	document.getElementById('cls').value = document.getElementById('cls1').innerHTML	
	
}

function importMissingXML()
	{
		if (document.implementation && document.implementation.createDocument)
		{
			xmlDoc = document.implementation.createDocument("", "", null);
			xmlDoc.onload = createMissingTable;
		}
		else if (window.ActiveXObject)
		{
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			xmlDoc.onreadystatechange = function () {if (xmlDoc.readyState == 4) createMissingTable()};
		}
		else
		{
			alert('Your browser can\'t handle this script. Please download a newer version to see the information on this page');
			return;
		}
		xmlDoc.load("missing.xml");
	}

function createMissingTable()
{
	var x = xmlDoc.getElementsByTagName('classmate');
	var newEl = document.createElement('TABLE');
	newEl.setAttribute('align','center');
	newEl.setAttribute('cellPadding',0);
	newEl.setAttribute('cellSpacing',0);
	newEl.setAttribute('width','75%');
	newEl.setAttribute('border',1);
	var tmp = document.createElement('TBODY');
	newEl.appendChild(tmp);
	var row = document.createElement('TR');
	row.className = "header";
	row.setAttribute('align', 'left');
/*
	for (j=0;j<x[0].childNodes.length;j++)
	{
		if (x[0].childNodes[j].nodeType != 1) continue;
		var container = document.createElement('TH');		
		var theData = document.createTextNode(x[0].childNodes[j].nodeName);
		container.appendChild(theData);
		row.appendChild(container);	
	} 
*/	
	tmp.appendChild(row);
	for (i=0;i<x.length;i++)
	{
		var row = document.createElement('TR');
		for (j=0;j<x[i].childNodes.length;j++)
		{
			if (x[i].childNodes[j].nodeType != 1) continue;
			var container = document.createElement('TD');
			container.className = "row";
			var theData = document.createTextNode(x[i].childNodes[j].firstChild.nodeValue);
			container.appendChild(theData);
			row.appendChild(container);
		}
		tmp.appendChild(row);
	}
	document.getElementById('miss1').appendChild(newEl);
	document.getElementById('miss').value = document.getElementById('miss1').innerHTML	
}