$(document).ready(function() {
    $('a.lightbox').lightBox(); // Select all links with lightbox class
});

//ajax
function ajax(XMLURL, responseMode, functionName, functionArgs)
{
	var xmlHttp;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				//alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4)
		{		
			//xml response
			if(responseMode == 'text')
			{
				if(functionArgs != undefined)
				{
					functionName(xmlHttp.responseText, functionArgs);
				}
				else
				{
					functionName(xmlHttp.responseText);
				}
			}
			//text response
			else if(responseMode == 'xml')
			{
				if(functionArgs != undefined)
				{
					functionName(xmlHttp.responseXML, functionArgs);
				}
				else
				{
					functionName(xmlHttp.responseXML);
				}
			}
			//no response
			else
			{
				if(functionArgs != undefined)
				{
					functionName(functionArgs);
				}
				else
				{
					functionName();
				}
			}
		}
	}
	xmlHttp.open("GET", XMLURL, true);
	xmlHttp.send(null);
}

//place gallery text
function placeGalleryDescription(textResponse, elementSelected) {
	//selected nav
	$('#content_pane_links a').removeClass('selected');
	$(elementSelected).addClass('selected');
	
	//content
	$('.gallery_description').html(textResponse);
}
