		<?php

				$pp_portfolio_slider_sort = get_option('pp_portfolio_slider_sort'); 
				if(empty($pp_portfolio_slider_sort))
				{
					$pp_portfolio_slider_sort = 'DESC';
				}
			
				$slider_arr = get_posts('numberposts=6&order='.$pp_slider_sort.'&orderby=date&post_type=proyectos&meta_key=ft_portfolio&meta_value=Yes');

				if(!empty($slider_arr))
				{
		?>
		
						<ul id="kwicks_slider">
							<?php
								$slider_size = count($slider_arr);
								$initial_width = intval(900/$slider_size);
							
								foreach($slider_arr as $key => $gallery_item)
								{
									$image_url = '';
								
									if(has_post_thumbnail($gallery_item->ID, 'large'))
									{
										$image_id = get_post_thumbnail_id($gallery_item->ID);
										$image_url = wp_get_attachment_image_src($image_id, 'large', true);
                                                                                $image_url[0] = cleanSource($image_url[0]);
									}
													
									$hyperlink_url = get_permalink($gallery_item->ID);
							?>
							<li style="width:<?php echo $initial_width; ?>px">
							<div>
								<div class="kwicks_shadow"></div>
								<a href="<?php echo $hyperlink_url;?>">
									<img src="<?php bloginfo( 'stylesheet_directory' ); ?>/timthumb.php?src=<?php echo $image_url[0]; ?>&amp;h=380&amp;w=900&amp;zc=1" alt="" <?php if(!empty($caption_style)) { echo 'title="'.$caption_style.'"'; } ?> style="display:block"/>
								</a>
								<div class="kwicks_title" style="display:block">
									<h6 class="cufon"><?php _e($gallery_item->post_title); ?></h6>
								</div>
								<div class="kwicks_title_large" style="display:none">
									<h4 class="cufon"><?php _e($gallery_item->post_title); ?></h4>
									<?php echo pp_substr(strip_tags(strip_shortcodes($gallery_item->post_content)), 200); ?>
								</div>
							</div>
							</li>
							
							<?php
								}
							?>
						</ul>
		
		<br class="clear"/><br/>
		
		<?php 
				}
		?>
		
<script type="text/javascript"> 
$j(document).ready(function() {
	$j('#kwicks_slider').kwicks({
		max : 900,
		spacing : 0,
		duration : 1000
	});
	
	$j('#slider_wrapper').css('visibility', 'visible');
});
</script> 