<?php switch( $post['postMetaData']['media_type'] ){
	case 'slider':?>
		<?php $sliderImages = explode(',', $post['postMetaData']['slider_url']); ?>
		<div class="otw_portfolio_manager-slider otw_portfolio_manager-format-gallery" data-animation="slide">
			<ul class="slides">
				<?php foreach( $sliderImages as $sliderImage ){?>
				<?php $imagePath = parse_url($sliderImage); ?>
				<?php $attachmentMetaData = $this->getAttachmentMetaData( $sliderImage, $post );?>
					<li>
						<?php if( $post['otw_pm_media_lightbox'] == 'yes' ){?>
						<a href="<?php echo $this->otwImageCrop->resize( $imagePath['path'], $post['imageLightboxWidth'], $post['imageLightboxHeight'], $post['imageCrop'], $post['imageWhiteSpaces'], $post['imageBackground'], $post['imageLightboxFormat'] )?>" rel="otw_fslide_<?php echo esc_attr( $post['post']->ID )?>" class="otw_portfolio_manager-fancybox-slider">
						<?php }?>
						<img src="<?php echo $this->otwImageCrop->resize( $imagePath['path'], $post['imageWidth'], $post['imageHeight'], $post['imageCrop'], $post['imageWhiteSpaces'], $post['imageBackground'], $post['imageFormat'] )?>"  alt="<?php echo esc_attr( $attachmentMetaData['alt'] )?>"  title="<?php echo esc_attr( $attachmentMetaData['title'] )?>" data-item="media">
						<?php if( $post['otw_pm_media_lightbox'] == 'yes' ){?>
						</a>
						<?php }?>
					</li>
				<?php }?>
			</ul>
		</div>
		<?php break;
	case 'img':?>
		<?php $imagePath = parse_url($post['postMetaData']['img_url']);?>
		<?php $attachmentMetaData = $this->getAttachmentMetaData( $post['postMetaData']['img_url'], $post );?>
			<figure class="otw_portfolio_manager-portfolio-media otw_portfolio_manager-format-image">
				<?php if( $post['otw_pm_media_lightbox'] == 'yes' ){?>
				<a href="<?php echo $this->otwImageCrop->resize( $imagePath['path'], $post['imageLightboxWidth'], $post['imageLightboxHeight'], $post['imageCrop'], $post['imageWhiteSpaces'], $post['imageBackground'], $post['imageLightboxFormat'] )?>" class="otw_portfolio_manager-fancybox-img">
				<?php }?>
				<img src="<?php echo $this->otwImageCrop->resize( $imagePath['path'], $post['imageWidth'], $post['imageHeight'], $post['imageCrop'], $post['imageWhiteSpaces'], $post['imageBackground'], $post['imageFormat'] )?>"  alt="<?php echo esc_attr( $attachmentMetaData['alt'] )?>"  title="<?php echo esc_attr( $attachmentMetaData['title'] )?>" />
				<?php if( $post['otw_pm_media_lightbox'] == 'yes' ){?>
				</a>
				<?php }?>
			</figure>
		<?php break;
	case 'soundcloud':?>
			<figure class="otw_portfolio_manager-portfolio-media otw_portfolio_manager-format-video">
				<?php if( $post['otw_pm_media_lightbox'] == 'yes' ){?>
				<?php $imgLink = $this->getLink( $post['post'], 'item_media' );?>
				<a href="javascript:;" rel="<?php echo esc_attr( $imgLink )?>" class="otw_portfolio_manager_video_link otw_portfolio_manager-fancybox-movie-wrap"></a>
				<?php }?>
				<?php echo $this->otwImageCrop->embed_resize( $this->oembed_get($post['postMetaData']['soundcloud_url'], array('width' => $post['imageWidth'])), $post['imageWidth'], $post['imageHeight'], $post['imageCrop'] );?>
				<?php if( $post['otw_pm_media_lightbox'] == 'yes' ){?>
				</a>
				<?php }?>
			</figure>
		<?php break;
	case 'vimeo':?>
			<figure class="otw_portfolio_manager-portfolio-media otw_portfolio_manager-format-video">
				<?php if( $post['otw_pm_media_lightbox'] == 'yes' ){?>
				<?php $imgLink = $this->getLink( $post['post'], 'item_media' );?>
				<a href="javascript:;" rel="<?php echo esc_attr( $imgLink )?>" class="otw_portfolio_manager_video_link otw_portfolio_manager-fancybox-movie-wrap"></a>
				<?php }?>
				<?php echo $this->otwImageCrop->embed_resize( $this->oembed_get($post['postMetaData']['vimeo_url'], array('width' => $post['imageWidth'])), $post['imageWidth'], $post['imageHeight'], $post['imageCrop'] );?>
				<?php if( $post['otw_pm_media_lightbox'] == 'yes' ){?>
				</a>
				<?php }?>
			</figure>
		<?php break;
	case 'youtube': ?>
			<figure class="otw_portfolio_manager-portfolio-media otw_portfolio_manager-format-video">
				<?php if( $post['otw_pm_media_lightbox'] == 'yes' ){?>
				<?php $imgLink = $this->getLink( $post['post'], 'item_media' );?>
				<a href="javascript:;" rel="<?php echo esc_attr( $imgLink )?>" class="otw_portfolio_manager_video_link otw_portfolio_manager-fancybox-movie-wrap"></a>
				<?php }?>
				<?php echo $this->otwImageCrop->embed_resize( $this->oembed_get($post['postMetaData']['youtube_url'], array('width' => $post['imageWidth'])), $post['imageWidth'], $post['imageHeight'], $post['imageCrop'] );?>
				<?php if( $post['otw_pm_media_lightbox'] == 'yes' ){?>
				</a>
				<?php }?>
			</figure>
		<?php break;
}?>
<!-- End Portfolio Media -->