<?php
global $post;
//Meta for this item
$link = get_permalink($post->ID);  
$args  = array( 'postid' => $post->ID, 'width' => 580, 'hide_href' => true, 'imglink' => false, 'imgnocontainer' => true, 'resizer' => '580' );
$image = get_obox_media( $args );
?>

<h3 class="section-title"><?php the_title(); ?></h3> 
<ul class="double-cloumn portfolio clearfix">    
<li id="left-column">
    <ul class="portfolio-list one-column">
        <li>
            <?php if( $image !="" ) : ?> 
                <div class="portfolio-image fitvid"> 
                     <?php echo $image; ?>
                </div>
            <?php endif; ?>
        </li>
        <?php $attach_args = array( "post_type" => "attachment", "post_parent" => $post->ID, "offset"=> "1", "orderby" => "menu_order", "order" => "ASC");
            $attachments = get_posts($attach_args);
            foreach($attachments as $attachement => $this_attachment) :  
                $image = wp_get_attachment_image_src($this_attachment->ID, array(580, 2000));
                $full = wp_get_attachment_image_src($this_attachment->ID,  "full"); ?>
                <li>
                    <div class="portfolio-image fitvid">
                        <a href="<?php echo $full[0]; ?>" rel="lightbox">
                            <img src="<?php bloginfo('template_directory'); ?>/functions/timthumb.php?src=<?php echo $image[0]; ?>&amp;w=580&amp;h=&amp;zc=1&amp;q=100&amp;f=<?php echo $get_effect; ?>" alt="<?php echo $this_attachment->title; ?>" />
                        </a>
                    </div>
                </li>
        <?php endforeach; ?>
    </ul>           
</li>
<li id="right-column">
	<?php if(the_content !="") : ?>
        <div class="copy">
            <?php the_content(""); ?>
        </div>
    <?php endif; ?>
</li>
</ul>
    <ul class="post-meta">    
        <li class="meta-block">
            <ul class="next-prev-post-nav">
                <li>
                    <?php if (get_adjacent_post(false, '', true)): // if there are older posts ?>
                        &larr;  <?php previous_post_link("%link", "%title"); ?>
                    <?php else : ?>
                        &nbsp;
                    <?php endif; ?>
                </li>
                <li>
                    <?php if (get_adjacent_post(false, '', false)): // if there are newer posts ?>
                        <?php next_post_link("%link", "%title"); ?> &rarr;
                    <?php else : ?>
                        &nbsp;
                    <?php endif; ?>    
                </li>
            </ul>
        </li>                    
		<?php if( get_option("ocmx_meta_social_port") !="false") : ?>
        <li class="meta-block social">
             <!-- AddThis Button BEGIN -->
            <div class="addthis_toolbox addthis_default_style ">
                <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
                <a class="addthis_button_tweet"></a>
                <a class="addthis_button_pinterest_pinit"></a>
                <a class="addthis_counter addthis_pill_style"></a>
            </div>
            <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-510a89ea449421b9"></script>
            <!-- AddThis Button END -->
	    </li>
        <?php endif; ?>                         
    </ul>
</li>
