function getxmlhttp()
{	
	var xmlhttp = false;	
	try{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e) {
		try{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}catch(E) {
			xmlhttp = false;
		}
	}
	if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}
function processajax (obj, serverPage)
{
	var theimg;
	xmlhttp = getxmlhttp();
    xmlhttp.open("GET",serverPage);
	xmlhttp.onreadystatechange = function()
	{
		if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
		{
			document.getElementById(obj).innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
	
}

function runAjax(objID, serverPage)
{
	var xmlhttp = false;	
	try{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e) {
		try{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}catch(E) {
			xmlhttp = false;
		}
	}
	if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){
		xmlhttp = new XMLHttpRequest();
	}

	xmlhttp.open("GET", serverPage);
	xmlhttp.onreadystatechange = function()
	{
		if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
		{
			document.getElementById(objID).innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}

function updateStatus()
{
	document.getElementById("pics").innerHTML = "<b>Loading....</b>";
}

var refreshrate = 1500;
function refreshView(divID,serverPage)
{
	var command = 'runAjax ("' + divID + '","' + serverPage + '")';
	updateStatus();
	setTimeout (command, refreshrate);
}

function uploadimgs (theform,divID,serverPage)
{
	updateStatus();
	theform.submit();
	refreshView(divID,serverPage);
}
		

