<?php

/*

Template Name: POCETNA

*/

get_header(); ?>

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

<?php

/*storovanje svih promenljivih pre novog querija za slider*/

//youtube link

if( get_post_meta($post->ID, "youtube_link", true) ): 

$youtube = get_post_meta($post->ID, "youtube_link", true);

$youtube = substr($youtube, 31);

//slika za mesec

$y = wp_get_attachment_image_src(get_post_thumbnail_id(),'full');

$mesec = $y[0];

?>

        	<div id="columnLeft">

            	<div id="carousel" class="hpItem">

                    <div id="splash">

                        <div id="button">

                             <a class="button1 active" rel="1" href="#"></a>

                             <a class="button2" rel="2" href="#"></a>

                             <a class="button3" rel="3" href="#"></a>

                             <a class="button4" rel="4" href="#"></a>

                             <a class="button5" rel="5" href="#"></a>

                        </div> <!-- end of div button-->

                        <div class="clear"></div>

                        <div id="myslide">

                            <div class="cover">

							<?php $recent = new WP_Query('cat=15&showposts=5&order=ASC'); while($recent->have_posts()) : $recent->the_post();?> 

                                <div class="mystuff">

                                	<?php $x = wp_get_attachment_image_src(get_post_thumbnail_id(),'full'); ?>

                                    <img src="<?=$x[0]?>" width="540" />

                                   	<div class="carouselUI">

                                    	<h3><span class="blue"><?php the_time('j.n.Y.') ?></span><br />

                               	        <span class="white"><?php the_title(); ?></span></h3>

                        			</div><!--end #carouselUI-->

                                </div>

							<?php endwhile; ?>

                            </div> <!-- end of div cover -->

                        </div>  <!-- end of div myslide -->

                    </div><!--end #splash-->

                </div><!--end #carousel-->

                <div class="clear"></div>

                <div id="video" class="hpItem">

                    <h2><a href="http://www.youtube.com/user/ukparobrod" target="_blank"><strong>VIDEO</strong></a></h2>

                        <object width="265" height="165"><param name="movie" value="http://www.youtube.com/v/<?php echo $youtube ?>?fs=1&amp;hl=en_US&amp;rel=0"><param name="wmode" value="opaque" /></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/<?php echo $youtube ?>?fs=1&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="265" height="165" wmode="opaque"></embed></object>

                        <?php else: ?><?php endif; ?>	

                </div><!--end #video-->

                <div id="gallery" class="hpItem">

                    <h2><a href="http://www.flickr.com/photos/parobrod/sets/72157625907086524/" target="_blank"><strong>GALERIJA</strong></a></h2>

                    <a href="http://www.flickr.com/photos/parobrod/sets/" target="_blank" class="readMore"><img src="<?php bloginfo('template_directory'); ?>/images/more.png" width="48" height="16" alt="više" /></a>

                </div><!--end #gallery-->

                <?php $recent = new WP_Query("cat=14&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>

                <div id="dogodilose" class="hpItem">

                	<?php the_post_thumbnail(array(268,180,true)); ?>

                    <h2><a href="/desilo-se"><strong>DESILO SE</strong></a></h2>

                    <a href="/desilo-se" class="readMore"><img src="<?php bloginfo('template_directory'); ?>/images/more.png" width="48" height="16" alt="više" /></a>

                </div><!--end #desilose-->

                <?php endwhile; ?>

                <?php $recent = new WP_Query("cat=16&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>

                <div id="unajavi" class="hpItem" style="overflow:hidden">

                    <h2><a href="/desavanja"><strong>U NAJAVI</strong></a></h2>

                	<?php the_post_thumbnail(array(268,180,true)); ?>

                </div><!--end #unajavi-->

                <?php endwhile; ?>

            </div><!--end #columnLeft-->

            <div id="columnRight">

            	<div id="najave">

                	<a href="<?=$mesec?>"><img src="<?=$mesec?>" alt="" width="250" /></a>

                </div><!--end #najave-->

                <div id="blog" class="box hpItem">

				<?php $recent = new WP_Query("cat=1&showposts=1"); while($recent->have_posts()) : $recent->the_post();?> 

                    <h2 class="top left"><strong>BLOG</strong></h2>

                    <h3><?php the_author_link(); ?></h3><?php userphoto_the_author_thumbnail() ?>

                    <h4><?php the_title(); ?></h4>

                    <p><?php content('30'); ?></p>

                    <a href="<?php the_permalink(); ?>" class="readMore"><img src="<?php bloginfo('template_directory'); ?>/images/more.png" width="48" height="16" alt="više" /></a>

                <?php endwhile; ?>

                </div><!--end #blog-->

            </div><!--end #columnRight-->

            <div id="columnBanners">

                <?php if(function_exists("useful_banner_manager_banners")){ useful_banner_manager_banners("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60",10); } ?>

            </div><!--end #columnBanners-->

<?php endwhile; ?>

<?php get_footer(); ?>