	var req;
	//var url = "imglist.php";
	var list;
	var currentSlide = -1;

	function loadXMLDoc(url) 
	{
		if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
			req.onreadystatechange = processReqChange;
			req.open("GET", encodeURI(url) , true);
			req.send(null);
		} else if (window.ActiveXObject) {
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = processReqChange;
				req.open("GET", url, true);
				req.send();
			}
		}
	}

	function processReqChange() 
	{
		if (req.readyState == 4) {
			if (req.status == 200) {
				list = req.responseText.split(",");
				showSlide("next");
				/*for(i=0;i<list.length-1;i++)
					alert(i +":"+list[i]);*/
			} else {
				alert("There was a problem retrieving the XML data:\n" + req.statusText);
			}
		}
	}

	function showSlide(x)
	{
		var slide = document.getElementById("slide");
		var slideInfo = document.getElementById("slideInfo");

		if( x == "next" ){
			if( currentSlide < list.length-2 )
				currentSlide++;
		}else{
			if( currentSlide > 0)
				currentSlide--;
		}
		slide.src = list[currentSlide];
		slideInfo.innerHTML = (currentSlide+1) +" of " + (list.length-1);
		return false;
	}
