<%

checkExistanceOf(data) {
	return data != null && data != void;	
}

boolean metadataExists() {
	return checkExistanceOf(cameraModel) || checkExistanceOf(exposureTime) || checkExistanceOf(isoEquivalent) || checkExistanceOf(aperture) || 
	checkExistanceOf(focusDistance) || checkExistanceOf(meteringMode) || checkExistanceOf(focalLength35mm) || checkExistanceOf(keywords);
} 

%>

<ja:if test="<%= showMetadata && metadataExists() %>">
	<div id="extras" style="display:block;width:<%= outerImageWidth - (extrasPadding * 2) + extrasAdditionalWidth %>px">
		<ul>
			<% dataCount = 0; 
			firstClass = "class=\"first\""; %>
			<ja:if exists="originalDate">
				<li class="first">$text.metadata.exposureTime: ${exposureTime}</li>
				<% dataCount++; %>
			</ja:if>
			<ja:if exists="cameraModel">
				<li <%= dataCount == 0 ? firstClass : "" %>>$text.metadata.cameraModel: ${cameraModel}</li>
				<% dataCount++; %>
			</ja:if>			
			<ja:if exists="exposureTime">
				<li <%= dataCount == 0 ? firstClass : "" %>>$text.metadata.exposureTime: ${exposureTime}</li>
				<% dataCount++; %>
			</ja:if>
			<ja:if exists="isoEquivalent">
				<li <%= dataCount == 0 ? firstClass : "" %>>$text.metadata.isoEquivalent: ${isoEquivalent}</li>
				<% dataCount++; %>
			</ja:if>
			<ja:if exists="aperture">
				<li <%= dataCount == 0 ? firstClass : "" %>>$text.metadata.aperture: ${aperture}</li>
				<% dataCount++; %>
			</ja:if>
			<ja:if exists="focusDistance">
				<li <%= dataCount == 0 ? firstClass : "" %>>$text.metadata.focusDistance: ${focusDistance}</li>
				<% dataCount++; %>
			</ja:if>
			<ja:if exists="focalLength35mm">
				<li <%= dataCount == 0 ? firstClass : "" %>>$text.metadata.focalLength35mm: ${focalLength35mm}</li>
				<% dataCount++; %>
			</ja:if>
			<ja:if exists="keywords">
				<li <%= dataCount == 0 ? firstClass : "" %>>$text.metadata.keywords: ${keywords}</li>
				<% dataCount++; %>
			</ja:if>
		</ul>
	</div>
</ja:if>
