// JavaScript Document
$(document).ready(function(){
// jQueryTools Gallery
	$(".scrollable").scrollable();
	$(".items a").click(function() {	
		// see if same thumb is being clicked
		if ($(this).hasClass("active")) { return; }	
		// calclulate large image's URL based on the thumbnail URL (flickr specific)
		var url = $(this).attr("rel");	
		// get handle to element that wraps the image and make it semi-transparent
		var wrap = $("#image_wrap").fadeTo(0, 1);	
		// the large image from www.flickr.com
		var img = new Image();	
		// call this function after it's loaded
		img.onload = function() {	
			// change the image
			wrap.find("img").attr("src", url);	
		};
		// begin loading the image from www.flickr.com
		img.src = url;	
		// activate item
		$(".items a").removeClass("active");
		$(this).addClass("active");	
	// when page loads simulate a "click" on the first image
		return false;
	}).filter(":first").click();
	$("#verifyage").overlay({
	// custom top position
	top: 120,
	closeOnEsc: false,
	// some mask tweaks suitable for facebox-looking dialogs
	mask: {
		// you might also consider a "transparent" color for the mask
		color: '#000',
		// load mask a little faster
		loadSpeed: 200,
		// very transparent
		opacity: 0.86
	},
	// disable this for modal dialog-type of overlays
	closeOnClick: false,
	// load it immediately after the construction
	load: true
	});
});
