function imageview(imgname, type, date, portfolio)
{
	var xmlHttp = GetXmlHttpObject();
	
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	imgname = imgname.replace(" ", "%20");
	type = type.replace(" ", "%20");
	date = date.replace(" ", "%20");
	portfolio = portfolio.replace(" ", "%20");
	
	imgname = imgname.replace("&", "%26");
	type = type.replace("&", "%26");
	date = date.replace("&", "%26");
	portfolio = portfolio.replace("&", "%26");

	var url="./imageviewer.php";
	url=url+"?imgname="+imgname;
	
	if (type != "")
	{
		url=url+"&type="+type;
	}
	if (date != "")
	{
		url=url+"&date="+date;
	}
	if (portfolio != "")
	{
		url=url+"&portfolio="+portfolio;
	}
	
	url=url+"&include=t";
	//url=url+"&sid="+Math.random();
	
	xmlHttp.onreadystatechange=function() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById("target").innerHTML=xmlHttp.responseText;
		}
		else
		{
			document.getElementById("target").innerHTML="<div class='centerwrapper'><img src='images/loading.gif' class='borderless' alt='Loading...'/></div>";
		}
    }
	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	
	try
	{
		//Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		//Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	
	return xmlHttp;
}