/* Spotlight show/hide functions */
function openDetails(i) {
	$("#openDetails_" + i).hide();
	$("#closeDetails_" + i).show();
	$("#details_" + i).fadeIn("slow");
}
function closeDetails(i) {
	$("#closeDetails_" + i).hide();
	$("#openDetails_" + i).show();
	$("#details_" + i).fadeOut("slow");
}

function loadXMLDoc(dname){
	if (window.XMLHttpRequest){
		xhttp=new XMLHttpRequest();
	}else{
		xhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xhttp.open("GET",dname,false);
	xhttp.send("");
	return xhttp.responseXML;
}

function displayNav(){
	xml=loadXMLDoc("xml/nav.xml");
	xsl=loadXMLDoc("xml/nav.xsl");
	// code for IE
	if (window.ActiveXObject){
		ex=xml.transformNode(xsl);
		document.getElementById("autoNav").innerHTML=ex;
	// code for Mozilla, Firefox, Opera, etc.
	}else if (document.implementation && document.implementation.createDocument){
		xsltProcessor=new XSLTProcessor();
		xsltProcessor.importStylesheet(xsl);
		resultDocument = xsltProcessor.transformToFragment(xml,document);
		document.getElementById("autoNav").appendChild(resultDocument);
	}
}

$(document).ready(function() {
	// Thumbnailer.config.shaderOpacity = 1;
	var tn1 = $('.mygallery').tn3({
		skinDir : "skins",
		imageClick : "fullscreen",
		image : {
			maxZoom : 1.5,
			crop : true,
			clickEvent : "dblclick",
			transitions : [ {
				type : "blinds"
			}, {
				type : "grid"
			}, {
				type : "grid",
				duration : 460,
				easing : "easeInQuad",
				gridX : 1,
				gridY : 8,
				// flat, diagonal, circle, random
				sort : "random",
				sortReverse : false,
				diagonalStart : "bl",
				// fade, scale
				method : "scale",
				partDuration : 360,
				partEasing : "easeOutSine",
				partDirection : "left"
			} ]
		}
	});
});

