<?php get_header(); ?>

<div class="wrap background">
		

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>

<div class="simpleCart_shelfItem">

<div class="productdescription">
<h1 class="item_name"><?php the_title(); ?></h1>
<?php the_content(); ?>

<div class="options">

<?php $optiontitle = get_post_meta($post->ID, 'optiontitle', $single = true);?>
<?php if($optiontitle !== '') { ?>
<span class="select_title"><?php echo $optiontitle; ?>:

<select class="item_specifications">
<?php $option1 = get_post_meta($post->ID, 'option1', $single = true);?>
<?php if($option1 !== '') { ?>
<option value="<?php echo $option1; ?>"><?php echo $option1; ?></option>
<?php } else { echo ''; } ?>

<?php $option2 = get_post_meta($post->ID, 'option2', $single = true);?>
<?php if($option2 !== '') { ?>
<option value="<?php echo $option2; ?>"><?php echo $option2; ?></option>
<?php } else { echo ''; } ?>

<?php $option3 = get_post_meta($post->ID, 'option3', $single = true);?>
<?php if($option3 !== '') { ?>
<option value="<?php echo $option3; ?>"><?php echo $option3; ?></option>
<?php } else { echo ''; } ?>

<?php $option4 = get_post_meta($post->ID, 'option4', $single = true);?>
<?php if($option4 !== '') { ?>
<option value="<?php echo $option4; ?>"><?php echo $option4; ?></option>
<?php } else { echo ''; } ?>

<?php $option5 = get_post_meta($post->ID, 'option5', $single = true);?>
<?php if($option5 !== '') { ?>
<option value="<?php echo $option5; ?>"><?php echo $option5; ?></option>
<?php } else { echo ''; } ?>
</select>

</span>
<?php } else { echo ''; } ?>

<span class="quantity_title">Quantity:
<input type="text" class="item_quantity" value="1" />
</span>


<!-- field for item shipping cost -->
<?php $shipping = get_post_meta($post->ID, 'shipping', $single = true);?>
<?php if($shipping !== '') { ?>
<input type="hidden" class="item_shipping" value="<?php echo $shipping; ?>">
<?php } else { echo ''; } ?>

<a href="<?php if ( get_option('envira_cart_url') <> "" ) { ?><?php echo get_option('envira_cart_url'); ?>"<?php } else { ?><?php } ?>" class="item_add">Add to Cart</a>

<?php $price = get_post_meta($post->ID, 'price', $single = true);?>
<?php if($price !== '') { ?>
<span class="item_price" ><?php echo $price; ?></span>
<?php } else { echo ''; } ?>
</div>

</div>



		<div class="productsidebar">

		<!--- Thumbnailed Images Starts -->		

<?php $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); ?>
<?php if($thumb !== '') { ?>
<ul id="gallery" style="background-image:url(<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb; ?>&amp;h=265&amp;w=265&amp;zc=1); background-repeat: no-repeat;">

<?php $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); ?>
<?php if($thumb !== '') { ?>
<li><a class="zoom2" href="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb; ?>&amp;h=600&amp;w=600&amp;zc=1">
<img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb; ?>&amp;h=45&amp;w=45&amp;zc=1" alt="" />
<span><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb; ?>&amp;h=265&amp;w=265&amp;zc=1" alt="" /></span>
</a>
</li>
<?php } else { echo ''; } ?>

<?php $thumb1 = get_post_meta($post->ID, 'Thumbnail1', $single = true); ?>
<?php if($thumb1 !== '') { ?>
<li><a class="zoom2" href="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb1; ?>&amp;h=600&amp;w=600&amp;zc=1">
<img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb1; ?>&amp;h=45&amp;w=45&amp;zc=1" alt="" />
<span><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb1; ?>&amp;h=265&amp;w=265&amp;zc=1" alt="" /></span>
</a>
</li>
<?php } else { echo ''; } ?>

<?php $thumb2 = get_post_meta($post->ID, 'Thumbnail2', $single = true); ?>
<?php if($thumb2 !== '') { ?>
<li><a class="zoom2" href="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb2; ?>&amp;h=600&amp;w=600&amp;zc=1">
<img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb2; ?>&amp;h=45&amp;w=45&amp;zc=1" alt="" />
<span><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb2; ?>&amp;h=265&amp;w=265&amp;zc=1" alt="" /></span>
</a></li>
<?php } else { echo ''; } ?>

<?php $thumb3 = get_post_meta($post->ID, 'Thumbnail3', $single = true); ?>
<?php if($thumb3 !== '') { ?>
<li><a class="zoom2" href="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb3; ?>&amp;h=600&amp;w=600&amp;zc=1">
<img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb3; ?>&amp;h=45&amp;w=45&amp;zc=1" alt="" />
<span><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb3; ?>&amp;h=265&amp;w=265&amp;zc=1" alt="" /></span>
</a></li>
<?php } else { echo ''; } ?>

<?php $thumb4 = get_post_meta($post->ID, 'Thumbnail4', $single = true); ?>
<?php if($thumb4 !== '') { ?>
<li><a class="zoom2" href="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb4; ?>&amp;h=600&amp;w=600&amp;zc=1">
<img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb4; ?>&amp;h=45&amp;w=45&amp;zc=1" alt="" />
<span><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb4; ?>&amp;h=265&amp;w=265&amp;zc=1" alt="" /></span>
</a></li>
<?php } else { echo ''; } ?>

<?php $thumb5 = get_post_meta($post->ID, 'Thumbnail5', $single = true); ?>
<?php if($thumb5 !== '') { ?>
<li><a class="zoom2" href="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb5; ?>&amp;h=600&amp;w=600&amp;zc=1">
<img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb5; ?>&amp;h=45&amp;w=45&amp;zc=1" alt="" />
<span><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb5; ?>&amp;h=265&amp;w=265&amp;zc=1" alt="" /></span>
</a></li>
<?php } else { echo ''; } ?>

</ul>
</div>
<?php } else { echo ''; } ?>
<!--- Thumbnailed Images Ends -->		
<?php if ( get_option('envira_related_posts') == 'Yes') { ?><?php include(TEMPLATEPATH . '/includes/relatedproducts.php'); ?><?php } elseif ( get_option('envira_related_posts') <> "No" ) { ?><?php } ?>


</div>
</div>

<!--- Post Ends -->

		</div>
			
	</div>
	
<?php endwhile; else: ?>

<p><?php _e('Sorry, no posts matched your criteria'); ?>.</p>

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