//var http_request = false;
//
//imagenames = getElementsByTagAndClassName('img', 'gallery-image');
//which_image_loaded = 0;
//
//function changeImage(direction) {
//	which_image_loaded += direction;
//	if (which_image_loaded < 0) {
//		which_image_loaded = (imagenames.length);
//	}
//	if (which_image_loaded > imagenames.length) {
//		which_image_loaded = 0;
//	}
//	
//}
//
//function changePhotoAndCaption (photo_id) {
//	activePhoto = $(photo_id);
//	photoList = getElementsByTagAndClassName('img', 'gallery-image');
//	for (i=0; i<photoList.length; i++) {
//		id = photoList[i].id.split("-")[2];
//		a = $('gallery-caption-'+id);
//		if (photoList[i].id == activePhoto.id) {
//			showElement(photoList[i]);
//			showElement(a);
//			send_ajax_request('/gallery/session/update/?', 'picture='+activePhoto.id, true);
//		}
//		else {
//			hideElement(photoList[i]);
//			hideElement(a);
//		}
//	}
//}
//
//function send_ajax_request(url, args, async) {
//	myRand = parseInt(Math.random()*999999999999999, 10);
//	http_request = new getXMLHttpRequest();
//	http_request.open('GET', url + args + '&dontcacheme='+ myRand, async);
//	http_request.onreadystatechange=alertContents;
//	http_request.send(null);
//}
//
//function alertContents() {
//	if (http_request.readyState == 4) { 
//		if (http_request.status != 200) { 
//			alert('There was a problem with the request.');
//		}
//	}
//}
//
//function hidePhotosAndCaptions() {
//	photoList = getElementsByTagAndClassName('img', 'gallery-image');
//	for (i=0; i<photoList.length; i++) {
//		if ( i > 0 ) {
//			hideElement(photoList[i]);
//		}
//	}
//	captionList = getElementsByTagAndClassName('div', 'gallery-caption');
//	for (i=0; i<captionList.length; i++) {
//		if ( i > 0 ) {
//			hideElement(captionList[i]);
//		}
//	}
//}
//
//function nextPhoto(photo) {
//	if (photo != 'false') {
//		p = $(photo);
//		for (i=0; i<images.length; i++) {
//			if (images[i] == p.id) {
//				changePhotoAndCaption(images[i+1]);
//			}
//		}
//	}
//}
//
//function imageList() {
//	photoList = getElementsByTagAndClassName('img', 'gallery-image');
//	for (i=0; i<photoList.length; i++) { images.push(photoList[i].id); }
//	images.reverse();
//	return images;
//}
//addLoadEvent(hidePhotosAndCaptions);
//addLoadEvent(imageList);

$(document).ready(function() {
    $('img.hidden').hide();
    $('a.slideshow-thumbnails').click(function() {
        alert($(this).attr('href'));
        return false;
    });
});