function send(page, type)
{
	if (window.XMLHttpRequest)
	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	xmlhttp.onreadystatechange = receive;
	xmlhttp.open("POST", "contents/"+page+"."+type, true);
	xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlhttp.send();

	glowCurrent(page);

}

function receive()
{
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
	{
		//alert(xmlhttp.responseText);
		document.getElementById('content').innerHTML = xmlhttp.responseText;

		//init fancybox elements;
		$(".lightbox a").fancybox({
			'titlePosition'	:	'inside',
			'titleFormat'		:	function(title, currentArray, currentIndex, currentOpts) {
    			    						return title + '<br /><span class="imageIndex">' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span><br />';
    									}
		});
		$(".player a").fancybox();
	}
}
