// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

// Open image details
function image_details(name, title, url_large, url_small) {
	html = '<a href="' + url_large + '" rel="lytebox" title="' + name.replace(/"/g,"&quot;") + '"><img src="' + url_small + '" /></a><h3>' + name + '</h3><div id="toggle_description">';
	if (title != '') {
		html += '<a id="toggle" href="javascript:toggle_description()">more info</a> // ';
	}
	html += '<a href="' + url_large + '" rel="lytebox" title="' + name.replace(/"/g,"&quot;") + '">enlarge image</a></div><div id="description" style="display: none;"><p>' + title + '</p></div>';
	$('fullsize').update(html);
	initLytebox();
}

// Toggle image description
function toggle_description() {
	$('description').toggle();
}