window.onload = initAll;

function initAll()
{
	for(i=0; i<document.links.length; i++)
	{
		if(document.links[i].className == "gallery")
		{
		document.links[i].onclick = openGallery;
		}

	}


}

function openGallery()
{
window.open("/gallery/", "win", "toolbar=no,location=no,status=no,menubar=no,scrollbar=yes,resizable=yes,width=1024,height=768,left=0,top=0");
}

function getNewFile() 
{
getRequest(this.href);
return false;
}

function getRequest(url)
{
	try
	{
	req = new XMLHttpRequest();
	}
	catch(err1)
	{
		try
		{
		req = new ActiveXObject("Msxml2.XMLHTTP");
 		}
		catch(err2)
     		{
			try
          			{		
			req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(err3)
          			{
			req = false;
          			}
      		}
  	 }

	if(req)
	{
	req.onreadystatechange = useResponse;
	req.open("GET", url, true);
	req.send(null);
	}
	else 
	{
	document.getElementById("updateArea").innerHTML = "Could not create an XMLHttpRequest";
	}

}


function useResponse()
{

	if(req.readyState == 4)
    	{
		if(req.status == 200)
          		{
		var outMsg = req.responseText;
		}
    	}
	else
    	{
	document.getElementById('updateArea').innerHTML = "<p>Loading...</p>";
    	}

document.getElementById("updateArea").innerHTML = outMsg;
}
