	var xmlHttp = new XMLHttpRequest();
	var url = "model/caption.php?";
	
	if (!xmlHttp)
	{
		alert("No Sarissa");;
	}
	
	
	
	function getView(view, id)
	{
	getCaption(id);
	var source = view.getAttribute("href");
	var placeholder = document.getElementById("placeholder");
	placeholder.setAttribute("src", source);
	setClass(view);
	}
	
	
	function setClass(view)
	{
		var classN = "inactive";
		var target = document.getElementById("thmbMenu");
		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_id=" + cat_id + "&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;
				}
		}
	}
	
	
	function doEnlarge(dir, cat_id, img_id)
	{
			width = 700;
			height = 700;
			var url = "index.php?method=main.enlarge&dir=" + dir + "&cat_id=" + cat_id + "&img_id=" + img_id;

			var newLeft = (window.screen.availWidth - width) / 2;
			var newHeight = (window.screen.availHeight - height) / 2;
			var objPopup = window.open(url,'detailWin','height=' + height + ',width=' + width + ',left=' + newLeft +',top=150,menubar=0,status=0,scrollbars=0,directories=0');
			objPopup.focus();
	}
	


