<?php
global $post;

if (! get_post_gallery($post->ID) ) {
	echo '<h1>Please, insert gallery into post!</h1>';
} else {

	$gallery = get_post_gallery( get_the_ID(), false );

	echo '<div class="slide-post">';

	foreach ( $gallery['src'] AS $src ) {

		$thumb_image = aq_resize( $src, 63, 63, true );

		$full_image = str_replace( '-150x150', '', $src );

		$post_thumbnail = aq_resize( $full_image, 1200, 980, true );?>

		<div><a href="<?php echo $full_image; ?>" rel="prettyPhoto[pp_gal]">
				<img src="<?php echo $post_thumbnail ?>" alt="<?php the_title(); ?>"/>
			</a></div>

	<?php }
	echo '</div>';
}


$postid = get_the_ID(); ?>

<script type="text/javascript">
	jQuery(document).ready(function() {
		jQuery(".post-<?php echo $postid; ?> .slide-post").orbit({
			fluid: true,
			advanceSpeed: 6000, 		 // if timer is enabled, time between transitions
			directionalNav: false
		});

	});

</script>
