<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>{$CONFIG.site_title} | {$photo_info.photo_title}</title>

		<meta http-equiv="content-type" content="text/html; charset=utf-8">
                <meta http-equiv="imagetoolbar" content="no" />
                <link rel="stylesheet" type="text/css" href="/templates/css/all.css">
                <link rel="stylesheet" type="text/css" href="/templates/css/selection.css">
                <!--[if lte IE 6]><link rel="stylesheet" type="text/css" media="screen" href="/templates/css/lt7.css" /><![endif]-->
		<link rel="alternate" href="/rss/{$photo_info.album_title_url}" type="application/rss+xml" title="{$CONFIG.site_title} | {$photo_info.album_title} ({$photo_info.num_photos})" id="gallery" />               
		<link rel="icon" href="/templates/img/favicon.ico" type="image/x-icon" /> 
		<script src="/js/jquery-1.2.6.pack.js" type="text/javascript"></script>
		<script src="/js/jquery.imgareaselect-0.5.1.min.js" type="text/javascript"></script>
		<script src="/js/jquery.autocomplete.js" type="text/javascript"></script>
		<script src="/js/main.js" type="text/javascript"></script>
		<script src="/js/toggle.js" type="text/javascript"></script>
		<script src="/js/jquery.jeditable.js" type="text/javascript" charset="utf-8"></script>
		{if $photo_info.is_video}
                <script src="/js/flowplayer-3.1.0.min.js"></script>     
                {/if}
		<script type="text/javascript" charset="utf-8">
		jQuery(document).ready(function() {ldelim}
		     jQuery(".edit").editable("{$_SERVER.REQUEST_URI}", {ldelim}
			 indicator : "Saving ...",
			 tooltip   : 'Click to edit...',
			 onblur    : 'submit',
		         select    : true
		     {rdelim});
		     jQuery(".edit_area").editable("{$_SERVER.REQUEST_URI}", {ldelim} 
			 type      : 'textarea',
			 indicator : "Saving ...",
			 tooltip   : 'Click to edit...',
			 onblur    : 'submit',
      			 select    : true,
			 cssclass :  'edit_text'
		     {rdelim});
		     //Preload the next, next next, previous, and previous previous images
		     jQuery.preloadImages = function() {ldelim}
			  for(var i = 0; i<arguments.length; i++) {ldelim}
			    jQuery("<img>").attr("src", arguments[i]);
			  {rdelim}
		     {rdelim}
		    jQuery.preloadImages("{$photo_info.preview_url_next}","{$photo_info.preview_url_next_next}","{$photo_info.preview_url_previous}","{$photo_info.preview_url_previous_previous}");
		 {rdelim});
		</script>
	</head>
	<body>
		<div id="pagebody">
			{if $_USER.level >= $CONFIG.permission_show_admin_menu}
			<div id="admin_menu">
                        {foreach from=$ERROR item=message}
                                <div class="error">
                                {$message}
                                </div>
                        {/foreach}

	                {if $_USER.level >= $CONFIG.permission_change_level AND $photo_info}
			<div class="content_block">
		                <div id="permissions">
		                <h1>Photo Permissions</h1>
		                <form action="{$_SERVER.REQUEST_URI}" method="POST">
		                <table>
		                        {section name=row loop=$_LEVELS}
		                        <tr>
		                                <td>{$_LEVELS[row].title}</td>
		                                <td><input type="radio" name="level" value="{$_LEVELS[row].level}" {if $_LEVELS[row].level == $photo_info.level}CHECKED{/if} onclick="javascript:this.form.submit();" {if $album_info.highlight_photo_id == $photo_info.photo_id}DISABLED{/if}/></td>
		                        </tr>
		                        {/section}
		                </table>
		                </form>
		                </div>
		                {/if}

		                {if $_USER.level >= $CONFIG.permission_make_highlight AND $photo_info}
		                <div id="make_highlight">
		                <h1>Album Highlight</h1>
		                <form action="{$_SERVER.REQUEST_URI}" method="POST">
		                <table>
		                        <tr>
		                                <td>Make Highlight</td>
		                                <td><input type="checkbox" name="highlight" value="yes" {if $photo_info.photo_id == $album_info.highlight_photo_id}CHECKED{/if} onclick="javascript:this.form.submit();"/></td>
		                        </tr>
		                </table>
		                </form>
		                </div>
		                {/if}

		                {if $_USER.level >= $CONFIG.permission_create_album AND $photo_info}
		                <div id="create_album">
		                <h1>Create Album</h1>
		                <form action="{$_SERVER.REQUEST_URI}" method="POST">
		                <table>
					<tr>
						<td>
						<select name="type" class="input_text">
						<option>--Album Type--</option>
						{section name=row loop=$album_type_list}
						<option value="{$album_type_list[row].type}">{$album_type_list[row].title}</option>
						{/section}
						</select>
						</td>
					<tr>
		 	                         <td>
		       	                         <input type="text" name="album_title" value="album title" class="input_text" onFocus="doClear(this);"/>
		                                 </td>
					</tr>
					<tr>
						<td>
						<input type="text" name="location" value="location" class="input_text" onFocus="doClear(this);"/>
       	                         		</td>
       	                 		<tr>
					<tr>
						<td>
						<input type="submit" name="create" value="create" />
						</td>
					</tr>
		                </table>
		                </form>
		                </div>
		                {/if}

			</div>
		
			<div class="content_block">
		                {if $_USER.level >= $CONFIG.permission_album_association}
		                <div id="album_association">
		                <h1>Album Association</h1>
		                <form action="{$_SERVER.REQUEST_URI}" method="POST">
		                <table>
				{section name=row2 loop=$album_type_list}
				{if $album_type_list[row2].type == 2}
					<tr>
						<td class="album_header">{$album_type_list[row2].title}</td>
					</tr>
		                        {section name=row loop=$custom_albums}
					{if $album_type_list[row2].type == $custom_albums[row].type}
		                        <tr>
		                                <td class="album_title">{$custom_albums[row].title}</td>
		                                <td><input type="checkbox" name="{$custom_albums[row].album_id}" onclick="javascript:this.form.submit();" {if $custom_albums[row].album_id|in_array:$photo_albums_ids}CHECKED{/if}/></td>
		                        </tr>
					{/if}
		                        {/section}
				{/if}
				{/section}
		                </table>
		                <input type="hidden" name="album_association" value="1" />
		                </form>
		                </div>
		                {/if}
			</div>

			<div class="content_block">
                                {if $_USER.level >= $CONFIG.permission_album_association}
                                <div id="album_association">
                                <h1>Album Association</h1>
                                <form action="{$_SERVER.REQUEST_URI}" method="POST">
                                <table>
                                {section name=row2 loop=$album_type_list}
                                {if $album_type_list[row2].type == 3}
                                        <tr>
                                                <td class="album_header">{$album_type_list[row2].title}</td>
                                        </tr>
                                        {section name=row loop=$custom_albums}
                                        {if $album_type_list[row2].type == $custom_albums[row].type}
                                        <tr>
                                                <td class="album_title">{$custom_albums[row].title}</td>
                                                <td><input type="checkbox" name="{$custom_albums[row].album_id}" onclick="javascript:this.form.submit();"
 {if $custom_albums[row].album_id|in_array:$photo_albums_ids}CHECKED{/if}/></td>
                                        </tr>
                                        {/if}
                                        {/section}
                                {/if}
                                {/section}
                                </table>
                                <input type="hidden" name="album_association" value="1" />
                                </form>
                                </div>                                
				{/if}
                        </div>

			<div class="content_block">
                                {if $_USER.level >= $CONFIG.permission_album_association}
                                <div id="album_association">
                                <h1>Album Association</h1>
                                <form action="{$_SERVER.REQUEST_URI}" method="POST">
                                <table>
                                {section name=row2 loop=$album_type_list}
                                {if $album_type_list[row2].type != 2 AND
				    $album_type_list[row2].type != 3 }
                                        <tr>
                                                <td class="album_header">{$album_type_list[row2].title}</td>
                                        </tr>
                                        {section name=row loop=$custom_albums}
                                        {if $album_type_list[row2].type == $custom_albums[row].type}
                                        <tr>
                                                <td class="album_title">{$custom_albums[row].title}</td>
                                                <td><input type="checkbox" name="{$custom_albums[row].album_id}" onclick="javascript:this.form.submit();"
 {if $custom_albums[row].album_id|in_array:$photo_albums_ids}CHECKED{/if}/></td>
                                        </tr>
                                        {/if}
                                        {/section}
                                {/if}
                                {/section}
                                </table>
                                <input type="hidden" name="album_association" value="1" />
                                </form>
                                </div>                                
				{/if}
                        </div>

		
		</div>
	        {/if}

			<div id="content_container">
			{include file="$TEMPLATES/includes/header.tpl"}
				<div id="content">
					<div class="main">
						<div class="resize">
							<div class="photoview_panel">
								{if $photo_info.url_next OR $photo_info.url_previous}
                                                                <div class="prev_next_panel">
                                                                        {if $photo_info.url_previous}<a class="prev" href="{$photo_info.url_previous}">PREV</a>{/if}
                                                                        {if $photo_info.url_next}<a class="next" href="{$photo_info.url_next}">NEXT</a>{/if}
                                                                </div>
                                                                {/if}
								<a href="/{$photo_info.album_title_url}" class="back_link">BACK TO GALLERY</a>{if $roll_info}<a href="{$roll_info.url}" class="roll_link">ROLL {$roll_info.title|truncate:55:"..."|upper}</a>{else}<a href="/{$album_info.title_url}" class="roll_link">{$album_info.title|truncate:55:"..."|upper}</a>{/if}
							</div>
						</div>
						<div class="photoview_main">
							<div class="photo_main_photo" style="" id="photo_main">
								{if $photo_info.is_video}
								<a id="player" style="display:block;{if $photo_info.preview_width}width:{$photo_info.preview_width}px;height:{$photo_info.preview_height}px;{else}width:{$CONFIG.preview_width}px;height:555px{/if}"></a>
								<script language="JavaScript">
								flowplayer("player", "/flash/flowplayer-3.1.0.swf", {ldelim}
								    // this here is the configuration object 
								    clip: {ldelim}
									url: '{$photo_info.video_url}', 
									autoPlay: false,         
									autoBuffering: true,
									accelerated: true,
									scaling: 'scale' 
								    {rdelim},

								    plugins: {ldelim}
								        controls: {ldelim}
									    backgroundColor: '#0C0C0C', 
									    backgroundGradient: 'none',             
									    all:false, 
									    scrubber:true, 
									    mute:true,
									    fullscreen: true,
								       	    autoHide: 'always', 
									    height:30, 
									    progressColor: '#2C2C2C', 
									    bufferColor: '#111111' 
								   	{rdelim},
			
									controlbar: {ldelim} 
									    url: '/flash/flowplayer.controls-3.1.0.swf', 
									    top: 0, 
									    backgroundGradient: 'none', 
									    backgroundColor: 'transparent', 
									    buttonColor: '#000000', 
									    all: false, 
									    time: true, 
									    height: 50, 
									    right: 30, 
									    width: 100,
									    timeColor: '#a93326', 
									{rdelim}  
								    {rdelim},
								    canvas : {ldelim}
									backgroundColor:'#000000', 
        								backgroundGradient: 'none',
									backgroundImage: 'url({$photo_info.preview_url})' 
								    {rdelim}
								{rdelim}); 
								</script>
								<img src="/templates/img/spacer.gif" />
								{else}
									{if $photo_info.url_next}<a href="{$photo_info.url_next}">{/if}<img src="{$photo_info.preview_url}" {if $photo_info.preview_height AND $photo_info.preview_width}height="{$photo_info.preview_height}" width="{$photo_info.preview_width}" {/if}/>{if $photo_info.url_next}</a>{/if}
								{/if}
								{if $photo_info.rating}
                                                                <div class="photoview_rating" title="{$photo_info.title} has an EXIF rating of {$photo_info.rating} / 5">
                                                                {section name=rating loop=$photo_info.rating}
                                                                        <div class="star"></div>
                                                                {/section}
                                                                </div>
                                                                {/if}

								{if $similar_media}
								<div class="micro_thumbs">
								<ul>
									{section name=row loop=$similar_media}
                                                                        <li>
									<a href="{$similar_media[row].url}" title="{if $similar_media[row].is_video}Play video: {/if}{$similar_media[row].title}"><img {if $similar_media[row].photo_id == $photo_info.photo_id}class="current" {/if}src="{$similar_media[row].micro_url}" height="{$CONFIG.micro_height}" width="{$CONFIG.micro_width}" /></a>

									<div class="culinary_panel">
										{if $similar_media[row].is_video}
										<div class="culinary_video">
											<a href="{$similar_media[row].url}"></a>
										</div>
										{/if}

										{if $similar_media[row].comments}
										<div class="culinary_comment">
											<a href="{$similar_media[row].url}">{$similar_media[row].comments}</a>
										</div>
										{/if}
                                                                	</div>
									</li>
									{/section}
                                                                </ul>
								</div>
								{/if}

								<ul class="photo_tools">
									<li class="expand"><a href="{$photo_info.full_url}" title="Expand Photo"></a></li>

									{if $_USER.level >= $CONFIG.permission_download_original}
									<li class="download"><a href="{$photo_info.download_url}" title="Download Original"></a></li>
									{/if}

									{if $_USER.level == $CONFIG.permission_show_admin_menu}
									<li class="settings"><a href="javascript:showhide('admin_menu')"></a></li>
									{/if}

									{if !$photo_info.is_video}
									<li class="photo_tags"><a href="#" id="tagging_menu" title="Tag this photo" ></a></li>
									{/if}
								</ul>
							</div>
						</div>
						<div class="resize">
							<div class="photoview_title_des">
								<div class="photoview_title">
									{if !$photo_info.untitled AND $_USER.level >= $CONFIG.permission_modify_photo_texts}
                                                                        <p class="edit" id="photo_title">{$photo_info.title}</p>
                                                                        {elseif $photo_info.untitled AND $_USER.level >= $CONFIG.permission_modify_photo_texts}
                                                                        {if $photo_info.views >= $CONFIG.tooltip_min_views}<div id="edit_tooltip_title"></div>{/if}
                                                                        <p class="edit" id="photo_title">{$CONFIG.text_title}</p>
                                                                        {elseif $photo_info.title}
                                                                        <p>{$photo_info.title}</p>
									{/if}
								</div>
								<div class="photoview_title_image"></div>
								<div class="photoview_descript">
									{if $photo_info.text AND $_USER.level >= $CONFIG.permission_modify_photo_texts}
									<p class="edit_area" id="photo_text">{$photo_info.text|nl2br}</p>
									{elseif !$photo_info.text AND $_USER.level >= $CONFIG.permission_modify_photo_texts}
									{if $photo_info.views >= $CONFIG.tooltip_min_views}<div id="edit_tooltip_descript"></div>{/if}
									<p class="edit_area" id="photo_text">{$CONFIG.text_description}</p>
									{elseif $photo_info.text}
									<p>{$photo_info.text|nl2br}</p>
									{/if}
								</div>
							</div>

							{if $photo_info.comments}
							<div class="photoview_block">
								<div class="title">COMMENTS ({$photo_info.comments})</div>
								{section name=row loop=$comment_list}
								<div class="photoview_comment">
									<span class="photoview_comm_title">{$comment_list[row].first|upper}&nbsp;{$comment_list[row].last|upper} SAYS</span>
									<span class="photoview_comm_date">{$comment_list[row].timestamp_created|date_format:"%A, %B %d, %Y - %I:%M:%S %p"|upper}</span>
									<div class="photoview_comm_data">
									<p>{$comment_list[row].text|nl2br}</p>
									</div>
									{if $_USER.level >= $CONFIG.permission_delete_comments}
									<form action="{$_SERVER.REQUEST_URI}" method="post" id="delete">
									<input type="image" src="/templates/img/btn-delete.gif" alt="submit" id="submit" name="delete" onclick="this.disabled=disabled"/>
									<input type="hidden" name="comment_id" value="{$comment_list[row].comment_id}" />
									</form>
									{/if}

								</div>
								{/section}
							</div>
							{/if}

							<div class="photoview_block">
								<div class="title">ADD COMMENT</div>
								<form action="{$_SERVER.REQUEST_URI}" method="post" id="contact">
									<fieldset>
										<div class="contact_form">
											<div class="right">
												<div class="contact_comm">
													<div class="textarea_comm">
														<textarea id="comments" rows="10" cols="10" name="comment_text"></textarea>
													</div>
													<input type="image" src="/templates/img/btn-submit.gif" alt="submit" id="submit" onclick="this.disabled=disabled"/>
												</div>
											</div>
											<div class="left">
												<ul>
													<li>
														<div class="contact_label">
															<label for="name" class="label_name">Name</label>
														</div>
														<div class="contact_input">
															<input type="text" id="name" class="txt" name="name" value="{$_USER.first} {$_USER.last}" disabled="true"/>
														</div>
													</li>
													<li>
														<div class="contact_label">
															<label for="e-mail" class="label_name">E-Mail</label>
														</div>
														<div class="contact_input">
															<input type="text" id="e-mail" class="txt" name="email" value="{$_USER.email}" disabled="true"/>
														</div>
													</li>
													<li>
														<div class="contact_label">
															<label for="site" class="label_name">Site</label>
														</div>
														<div class="contact_input">
															<input type="text" id="site" class="txt" name="site" value="{$_USER.site}" disabled="true"/>
														</div>
													</li>
												</ul>
											</div>
										</div>
									</fieldset>
								</form>
							</div>
						</div>
					
						<div class="photoview_block">
							<div class="title">PEOPLE, PLACES, &amp; THINGS ASSOCIATED WITH THIS ITEM</div>
							<div class="tags_list">
								{if $tag_string AND $_USER.level >= $CONFIG.permission_add_photo_tags}
                                                                <p class="edit" id="photo_tags">{$tag_string}</p>
                                                                {elseif !$tag_string AND $_USER.level >= $CONFIG.permission_modify_photo_texts}
                                                                {if $photo_info.views >= $CONFIG.tooltip_min_views}<div id="edit_tooltip_tags"></div>{/if}
                                                                <p class="edit" id="photo_tags">{$CONFIG.text_tags}</p>
                                                                {elseif $tag_string}
                                                                <p>{$tag_string}</p>
                                                                {/if}
							</div>
						</div>

						<div class="photoview_block">
							<div class="title">STATS</div>
							<div class="photoview_stats_block">
								<div class="photoview_stats">
									<div class="litle_title">Title</div>
									<p>{$photo_info.photo_title}</p>
								</div>
								<div class="photoview_stats">
                                                                        <div class="litle_title">Captured</div>
                                                                        <p>{$photo_info.EXIF_DateTimeOriginal|date_format:"%A, %B %e, %Y %I:%M %p"}</p>
                                                                </div>
                                                                <div class="photoview_stats">
                                                                        <div class="litle_title">Digitized</div>
                                                                        <p>{$photo_info.EXIF_DateTimeDigitized|date_format:"%A, %B %e, %Y %I:%M %p"}</p>
                                                                </div>

								<div class="photoview_stats">
									<div class="litle_title">Filename</div>
									<p>{$photo_info.filename}</p>
								</div>
								<div class="photoview_stats">
									<div class="litle_title">Views</div>
									<p>{$photo_info.views}</p>
								</div>
								{if $photo_info.comments}
								<div class="photoview_stats">
									<div class="litle_title">Comments</div>
									<p class="litle_comm">{$photo_info.comments}</p>
								</div>
								{/if}
							</div>
							<div class="photoview_stats_block">
								<div class="photoview_stats">
									<div class="litle_title">Original Resolution</div>
									<p>{$photo_info.width} x {$photo_info.height}</p>
								</div>	
								<div class="photoview_stats">
									<div class="litle_title">File Size</div>
									<p>{$photo_info.filesize_megabytes} MB</p>
								</div>
			
								{if $photo_info.EXIF_Make}
								<div class="photoview_stats">
									<div class="litle_title">Camera Make</div>
									<p>{$photo_info.EXIF_Make}</p>
								</div>
								{/if}

								{if $photo_info.EXIF_Model}
								<div class="photoview_stats">
									<div class="litle_title">Camera Model</div>
									<p>{$photo_info.EXIF_Model}</p>
								</div>
								{/if}

								{if $photo_info.EXIF_Orientation}
								<div class="photoview_stats">
									<div class="litle_title">Original Orientation</div>
									<p>{if $photo_info.EXIF_Orientation == 1}Landscape{else}Portrait{/if}</p>
								</div>
								{/if}

								{if $photo_info.EXIF_Software}
								<div class="photoview_stats">
									<div class="litle_title">Processing Software</div>
									<p>{$photo_info.EXIF_Software}</p>
								</div>
								{/if}

								{if $photo_info.EXIF_HostComputer}
								<div class="photoview_stats">
                                                                        <div class="litle_title">Processing OS</div>
                                                                        <p>{$photo_info.EXIF_HostComputer}</p>
                                                                </div>
								{/if}

								{if $photo_info.EXIF_Software}
								<div class="photoview_stats last_stats">
                                                                        <div class="litle_title">Processing Software</div>
                                                                        <p>{$photo_info.EXIF_Software}</p>
                                                                </div>
								{/if}

							</div>
							<div class="photoview_stats_block">
								{if $photo_info.EXIF_ISOSpeedRatings}
								<div class="photoview_stats">
									<div class="litle_title">ISO Speed</div>
									<p>{$photo_info.EXIF_ISOSpeedRatings}</p>
								</div>
								{/if}

								{if $photo_info.EXIF_ShutterSpeedValue}
								<div class="photoview_stats">
                                                                        <div class="litle_title">Shutter Speed</div>
                                                                        <p>{$photo_info.EXIF_ShutterSpeedValue}</p>
                                                                </div>
								{/if}

								{if $photo_info.EXIF_FNumber}
								<div class="photoview_stats">
                                                                        <div class="litle_title">F-Stop</div>
                                                                        <p>f / {$photo_info.EXIF_FNumber}</p>
                                                                </div>
								{/if}
	
								{if $photo_info.EXIF_FocalLength}
								<div class="photoview_stats">
									<div class="litle_title">Focal Length</div>
									<p>{$photo_info.EXIF_FocalLength} mm</p>
								</div>
								{/if}

								{if $photo_info.EXIF_Flash}
								<div class="photoview_stats">
									<div class="litle_title">Flash Fired</div>
									<p>{$photo_info.EXIF_Flash}</p>
								</div>
								{/if}

								<div class="photoview_stats">
                                                                        <div class="litle_title">Source Roll</div>
                                                                        {section name=row loop=$photo_albums}
									{if $photo_albums[row].type == 1}
                                                                        <a href="/{$photo_albums[row].title_url}">{$photo_albums[row].title}</a>
									{/if}
                                                                        {/section}
                                                                </div>

								{if $album_count > 0}
								<div class="photoview_stats">
									<div class="litle_title">Albums</div>
									{section name=row loop=$photo_albums}
									{if $photo_albums[row].type != 1}
                                    					<a href="/{$photo_albums[row].title_url}">{$photo_albums[row].title}&nbsp;{if $photo_albums[row].title_url == $a}(this album){/if}</a>
									{/if}
                                    					{/section}
								</div>
								{/if}
							</div>
						</div>

						{*********************************
						<div class="photoview_block last_photopreview">
							<div class="title">GEO-LOCATION</div>
							<div class="coordinates_area">
								<div class="coordinates">
									<p>40&deg; 39' 11'' N</p>
									<p class="litle_title">Latitude</p>
								</div>
								<div class="coordinates">
									<p>40&deg; 39' 11'' N</p>
									<p class="litle_title">Latitude</p>
								</div>
							</div>
							<div class="coordinates_area">
								<div class="location_image">
									<img src="/templates/img/geo-location_1.jpg" alt="" />
								</div>
								<div class="location_image">
									<img src="/templates/img/geo-location_2.jpg" alt="" />
								</div>
								<div class="location_image">
									<img src="/templates/img/geo-location_3.jpg" alt="" />
								</div>
							</div>
						</div>
						*******************************}
					</div>
				</div>
			{include file="$TEMPLATES/includes/footer.tpl"}
			</div>
		</div>
	</body>
</html>
