/**
 * General new functions for themepages
 */

jQuery(document).ready(function() {
	jQuery(".expand_list").click(expand_list);
	jQuery("a[rel^='prettyPhoto']").prettyPhoto({
	autoplay_slideshow: false,
	autoplay: true,
	modal: false,
	overlay_gallery: false,
	callback: function(){}
	});
});


/*
 * Expand list
 * @author Terry Duivesteijn <terry@duivesteijn.com>
 */
function expand_list(event){
	event.preventDefault();
	var listtoexpand = jQuery(this).attr("rel");

	var numberofhidden = jQuery("table#"+ jQuery(this).attr("rel")+" tr.hidden");
	if(numberofhidden.length > 0) {
		jQuery("table#"+ jQuery(this).attr("rel")+" tr.hidden:lt(5)").slideDown(function() {
			jQuery(this).removeClass('hidden').addClass('shown');
		});
	} else {
		window.location = jQuery(this).attr("href");
	}

}
