	var xmlHttp = new XMLHttpRequest();
	var url = "gallery_inc/caption.php?";
	
	if (!xmlHttp)
	{
		alert("No Sarissa");;
	}
	
	function getView(view, id)
	{
	getCaption(id);
	var source = view.getAttribute("href");
	var placeholder = document.getElementById("view");
	placeholder.setAttribute("src", source);
	setClass(view);
	}
	
	
	function setClass(view)
	{
		var classN = "inactive";
		var target = document.getElementById("imgList");
		var arLinks = target.getElementsByTagName("a");
		var ct = arLinks.length;
		var j;
		for (var i=0; i<ct; i++)
		{
			arLinks[i].className = "inactive";
		}
		view.className = "active";
	}
	
	function getCaption(id)
	{
		var query = "timestamp=" + new Date().getTime() + "&cat=" + category + "&id=" + id;
		url = url + query;
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange=handleCaption;
		xmlHttp.send(null);
	}
	function handleCaption()
	{
		if (xmlHttp.readyState == 4)
		{
			if (xmlHttp.status == 200)
				{
					response=xmlHttp.responseText;
					var targetDiv = document.getElementById("caption");
					targetDiv.innerHTML = response;
				}
		}
	}
