<?php get_header(); ?>

	<div id="content" class="widecolumn">

	<h1 class="listhead">Welcome to the <strong>Gallery</strong></h1>
	
		<?php
		// query_posts($query_string.'&posts_per_page=40');	// for THUMBNAIL view
		query_posts($query_string.'&posts_per_page=10'); 	// for LIST view
		while (have_posts()) : the_post(); ?>

			<!-- Just a thumbnail version -->
			<!--
			<div style="padding-left:5px;">
			<?php
				$args = array(
				    'numberposts' => 1,
				    'post_type' => 'attachment',
				    'status' => 'publish',
				    'post_mime_type' => 'image',
				    'post_parent' => $post->ID
				);
				$images = &get_children($args);
				foreach ( (array) $images as $attachment_id => $attachment ) { ?>
				<div id="post-<?php the_ID(); ?>" <?php post_class('gallerypost'); ?>>
					<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
						<?php echo wp_get_attachment_image($attachment_id, 'thumbnail', ''); ?>
					</a>
				</div>
			<?php } ?>
			</div>
			//-->
			<!-- /ends -->
			
			<!-- Thumbnail with description -->
			<div id="post-<?php the_ID(); ?>" <?php post_class('gallerylisting'); ?>>
			<?php
				$args = array(
					'numberposts' => 1,
				    'post_type' => 'attachment',
				    'status' => 'publish',
				    'post_mime_type' => 'image',
				    'post_parent' => $post->ID
				);
				$images = &get_children($args);
				foreach ( (array) $images as $attachment_id => $attachment ) { ?>
					<div class="gallerylisting-thumb">
						<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
							<?php echo wp_get_attachment_image($attachment_id, 'thumbnail', ''); ?>
						</a>
					</div>
					<div class="gallerylisting-desc">
						<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
						<?php the_excerpt(); ?>
						<div class="postmeta"><span class="tags"><?php the_tags(__('Tagged with ', 'notesblog'),', ',''); ?></span></div>
					</div>
			<?php } ?>
			</div>
			<!-- /ends -->


		<?php endwhile; ?>
		
		<div class="nav widecolumn">
		    <div class="left"><?php next_posts_link('Previous image sets') ?></div>
		    <div class="right"><?php previous_posts_link('More recent image sets') ?></div>
		</div>

	</div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>