<?php include ("header.php"); ?>

<div id="main">

	<div class="center_albums">
		
		<?php //printGoogleMap(NULL, NULL, 'show'); ?>
		
		<div id="headline">
			<h3>
				<!-- ZP 1.4.6: html_encode(getGalleryIndexURL()) remplace htmlspecialchars(getGalleryIndexURL(false)) -->
				<a href="<?php echo html_encode(getGalleryIndexURL()); ?>" title="<?php echo gettext('Albums Index'); ?>"><?php echo getGalleryTitle(); ?></a>
				<?php printParentBreadcrumb(" » ", " » ", " » ");  printAlbumBreadcrumb("", " » "); printImageTitle(true); ?>
			</h3>

			<div class="headline-text"><?php //printAlbumDesc(true); ?></div>
		</div>
		<div class="imgnav">
			<?php if (hasPrevImage()) { ?>
			<div class="imgprevious"><a href="<?php echo htmlspecialchars(getPrevImageURL()); ?>" title="<?php echo gettext("Previous Image"); ?>">&laquo; <?php echo gettext("prev"); ?></a></div>
			<?php } 
			if (hasNextImage()) { ?>
			<div class="imgnext"><a href="<?php echo htmlspecialchars(getNextImageURL()) ;?>" title="<?php echo gettext("Next Image"); ?>"><?php echo gettext("next"); ?> &raquo;</a></div>
			<?php } ?>
		</div>

		<p class="clear"></p>

		<div id="image">
			<?php // Test uniquement dans un album
			//$yo = $_zp_current_album->getTitle(); ?>
			
			<div class="cadre">
			<!-- ZP 1.4.6: getAlbumURL remplace getAlbumLinkURL -->
			<a href="<?php echo getAlbumURL();?>" title="<?php echo getImageTitle();?>">
			<?php 
				//printDefaultSizedImage(''); 
				printHDDefaultSizedImage(NULL, true, NULL,NULL,NULL);
			?>
			</a> 
			<?php //printDefaultSizedImage(getImageTitle());
			//echo getImageLinkURL(); //  /zenphoto/index.php?album=chevreuilsℑ=2008-08-15_ChevretteFaons_0138.jpg
			//echo getDefaultSizedImage() //  /zenphoto/cache/chevreuils/2008-08-15_ChevretteFaons_0138_595.jpg;
			//echo getFullImageURL(); //  /zenphoto/zp-core/full-image.php?a=chevreuils&i=2008-08-15_ChevretteFaons_0138.jpg&q=75&wmk=!
			//echo htmlspecialchars($_zp_current_image->getCustomImage(NULL, 595, 398, $cw, $ch, NULL, NULL, true)); //  /zenphoto/zp-core/i.php?a=chevreuils&i=2008-08-15_ChevretteFaons_0138.jpg&w=595&h=398&cw=&ch=&q=75&t=1&wmk=!
			//echo ($_zp_current_image->getImageLink()); //  /zenphoto/index.php?album=chevreuilsℑ=2008-08-15_ChevretteFaons_0138.jpg
			//echo ($_zp_current_image->getFullImage());  //  /zenphoto/albums/chevreuils/2008-08-15_ChevretteFaons_0138.jpg
			//echo ($_zp_current_image->getImage());  // erreur
			//echo getProtectedImageURL();  //  /zenphoto/zp-core/full-image.php?a=chevreuils&i=2008-08-15_ChevretteFaons_0138.jpg&q=75&wmk=!
			//echo ($_zp_current_image->getSizedImage(595));  //  /zenphoto/cache/chevreuils/2008-08-15_ChevretteFaons_0138_595.jpg
			//echo ($_zp_current_image->getSizedImageURL(595));  //  erreur
			//echo getSizedImageURL(595);  //  rien
			//echo getUnprotectedImageURL();  //  /zenphoto/albums/chevreuils/2008-08-15_ChevretteFaons_0138.jpg
			//echo getURL(); // erreur
			//echo getURL($_zp_current_image); // /zenphoto/index.php?album=chevreuilsℑ=2008-08-15_ChevretteFaons_0138.jpg
			
			?>
			</div>
			<div class="desc_image"><?php printImageDesc(true); ?></div>
			<div id="idtag"><?php echo '<strong>'.gettext("Tags").': </strong>'; ?><?php printTags( 'links','','hor-list',', ',true,'',gettext('None') ); ?></div>
		</div>

	</div> <!-- /center_albums -->


	<div id="narrow">
	<!-- http://www.johnstyle.fr/langage/javascript/creer-des-onglets-facilement/ -->
	<script type="text/javascript">		
	function changeOnglet(_this){
		var getOnglets 	= document.getElementById('mes_onglets').getElementsByTagName('li');
		
		for(var i = 0; i < getOnglets.length; i++){
			/* alert(getOnglets[i].id); */
		
			/*if (getOnglets[i].id) {*/
			/*document.write(getOnglets[i].id); o_1 */
				if (getOnglets[i].id == _this.id) {
					/*document.write(_this.id); o_2 l'onglet cliqué */
				
					var nb = 'c' + _this.id;
					/*alert(_this.id);*/
					
					if (getOnglets[i].className == 'mon_onglet_selected') {
						getOnglets[i].className = 'mon_onglet';
						document.getElementById('c' + _this.id).style.display 			= 'none';
						}
					else{
						getOnglets[i].className = 'mon_onglet_selected';
						document.getElementById('c' + _this.id).style.display 			= 'block';
						}
				}
				else {
					getOnglets[i].className = 'mon_onglet';
					
					document.getElementById('c' + getOnglets[i].id).style.display 	= 'none';
					
				}
			/*}*/
		}
	}
	</script>	

		<div id="mes_onglets">
			<ul>
			<?php //$host = 'http://' . $_SERVER['HTTP_HOST'] . '/zenphoto/'; 
			/*<!--a href="<?php echo $host; ?>slideshow.php?album=<?php echo $_zp_current_album; ?>">slideshow</a-->*/
			?>
				<li id="o_1" class="mon_onglet" onclick="changeOnglet(this);">EXIF</li>
				<!--li id="o_2" class="mon_onglet"><a href="<?php echo getUnprotectedImageURL();?>" rel="shadowbox;options={animate: false}" title="<?php echo getImageTitle(); ?>"><?php echo gettext('Full size'); ?></a></li-->

				<li id="o_2" class="mon_onglet"><a rel="zoom" href="<?php echo htmlspecialchars(getFullImageURL());?>" title="<?php echo getBareImageTitle();?>"  onclick="changeOnglet(this);"><?php echo gettext('Full size'); ?></a></li>

				<li id="o_3" class="mon_onglet"><?php /*if (function_exists('printSlideShowLink')) printSlideShowLink(gettext('Slideshow'));*/ printSlideShowLink(); ?></li>
				
				<?php if(($_zp_loggedin & ADMIN_RIGHTS)) { ?>
				<li id="o_4" class="mon_onglet" onclick="changeOnglet(this);">
				<input type="hidden" id="clip_text" size="40" value="<?php echo 'http://' . $_SERVER["SERVER_NAME"] . getUnprotectedImageURL(); ?>" />
					<p id="d_clip_button"><?php echo gettext('Copy'); ?></p>
					<script type="text/javascript">
								/* http://code.google.com/p/zeroclipboard/
								nouvelle version suite à Flash 10 */
		                        var clip = new ZeroClipboard.Client();
                        
        		                clip.setText( '' ); // will be set later on mouseDown
                		        clip.setHandCursor( true );
                        		clip.setCSSEffects( true );
                        
		                        clip.addEventListener( 'mouseDown', function(client) { 
                                // set text to copy here
		
								//copie du lien format BBCode
								var board = document.getElementById('clip_text').value;
								board = '[img]' + board + '[/img]';
								//board = '[url]' + board + '[/url]';
                                clip.setText( board );

								//copie du lien
                                //clip.setText( document.getElementById('clip_text').value );
                                
                                //alert("mouse down"); 
                   			     } );

                        clip.glue( 'd_clip_button' );
                </script>
			</li>
			<?php } ?>

			<?php
				if (function_exists('zenPaypal') && getOption('Paypal')) { ?>
					<li id="o_5" class="mon_onglet" onclick="changeOnglet(this);">Tirages</li>
				<?php } 
				if (function_exists('printRating') && getOption('Rating')) { ?>
					<li id="o_6" class="mon_onglet" onclick="changeOnglet(this);"><?php echo gettext('Rating'); ?></li>
				<?php } ?>
				<?php if (getOption('Allow_comments')) {
					//$num = getCommentCount();
				?>
					<li id="o_7" class="mon_onglet" onclick="changeOnglet(this);"><?php //echo $num . ' ' . gettext('comments'); 
					$num = getCommentCount(); 
 					echo $num . ' ' . strtolower(gettext('Comment'));
 					if ($num > 1) echo 's';
					?>
					</li>
				<?php }
				
				if (function_exists('printFavoritesURL')) { ?>
					<li id="o_10" class="mon_onglet" onclick="changeOnglet(this);">
						<?php printAddToFavorites($_zp_current_image); ?>
					</li>
				<?php }
					
				if (function_exists('_printGoogleMap') && getOption('GoogleMap')) { ?>
					<li id="o_8" class="mon_onglet" onclick="changeOnglet(this);">
						<?php if (hasMapData()) _printGoogleMap('Carte', NULL, 'hide'); ?>
					</li> 
				<?php }

				if (function_exists('print_share_link')) { ?>
					<li id="o_9" class="mon_onglet" onclick="changeOnglet(this);">BBCode</li>
				<?php } ?>

			</ul>
			<p style="clear: both; "></p>

		</div> <!-- /mes_onglets -->

		<div id="mes_contenus">
		<?php if (getImageMetaData()) { // v1.2.7 ?>
			<div id="co_1" class="mon_contenu" style="display: none;">
				<?php printImageMetadataMod('', false,'exifdata'); ?>
			</div>
		<?php } ?>
			<div id="co_2" class="mon_contenu" style="display: none;">2</div>
			<div id="co_3" class="mon_contenu" style="display: none;">3</div>
			<div id="co_4" class="mon_contenu" style="display: none;">
				<input type="text" id="clip_text2" size="70" value="<?php echo 'http://' . $_SERVER["SERVER_NAME"] . getUnprotectedImageURL(); ?>" />
			</div>
		<?php if (function_exists('zenPaypal')) { ?>
			<div id="co_5" class="mon_contenu" style="display: none;">
		<?php 
				//zenPaypal(null, true, gettext('Price list'),"h3","liste");
				zenPaypal(); ?>
			</div>
		<?php } 
	
	if (function_exists('printRating')) { ?>
		<div id="co_6" class="mon_contenu" style="display: none;">
			<?php printRating(); ?>
		</div>
	<?php } 

	if (hasMapData() && false) { ?>
		<div id="co_8" class="mon_contenu" style="display: none;">
			<?php //if (hasMapData()) _printGoogleMap(NULL, NULL, 'show'); ?>
		</div>
	<?php } 
	?>

	<!-- comments -->

	<?php if (function_exists('printCommentForm')) { ?>
		<div id="co_7" class="mon_contenu" style="display: none;">
		<?php printCommentForm();
		//printCommentFormCustom();?>
		</div>
	<?php } ?>

	<!-- /comments -->

		
		</div> <!-- /mes_contenus -->

	</div> <!-- /narrow -->


	<div class="paging">
	<?php if (function_exists('printAlbumMenu')) { ?>
		<div id="albumjump">
			<?php printAlbumMenu('jump',true); ?>
		</div>
	<?php } ?>
	</div>

</div>

<?php include("footer.php"); ?>