<?php get_header(); ?>
<div id="content-full">
<div id="content" class="col-full">

<?php
$the_slug = $post->post_name;
if($the_slug == "kontakt" || $the_slug == "kontaktirajte-nas" || $the_slug == "contact-us") { ?>

<?php while ( have_posts() ) : the_post(); ?>
<div class="contact-post-title">
<h1><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e('Permanent Link to', 'cp'); ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
</div>
<div id="contactleft" class="post-entry">
<?php the_content( '<div class="post-read-more">' . __("Continue reading &raquo;", "cp") . '</div>' ); ?>
</div>
<?php endwhile; ?>

<div id="contactright">
	<img src="<?php bloginfo('template_url'); ?>/images/beton-trend-kontakt.jpg">
</div>
<?php
//contact form variables
if($_COOKIE['betontrendlanguage'] == "hungarian") {
$cfname = "Név";
$cfphone = "Telefonszám";
$cfmail = "E-Mail";
$cfmsg = "Üzenet";
$cfsend = "Üzenet Küldése";
} elseif($_COOKIE['betontrendlanguage'] == "english") {
$cfname = "Name";
$cfphone = "Phone Number";
$cfmail = "E-Mail";
$cfmsg = "Message";
$cfsend = "Send Message";
} else {
$cfname = "Vaše Ime";
$cfphone = "Broj Telefona";
$cfmail = "E-Mail";
$cfmsg = "Vaša Poruka";
$cfsend = "Pošalji Poruku";
}
?>
<div id="contactform">
<form id="contactus" method="POST" action="">
<label for="name"><?php echo $cfname; ?></label>
<input type="text" id="name">
<label for="phone"><?php echo $cfphone; ?></label>
<input type="text" id="phone">
<label for="email"><?php echo $cfmail; ?></label>
<input type="text" id="email">
<label for="message"><?php echo $cfmsg; ?></label>
<textarea id="message"></textarea><br />
<input type="submit" id="submitbutton" value="<?php echo $cfsend; ?>">
</form>
</div>

<div id="googlemaps">
<iframe width="465" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=46.137832,19.68099&amp;num=1&amp;t=h&amp;ie=UTF8&amp;z=14&amp;iwloc=near&amp;output=embed"></iframe>
</div>

<br class="clear">
<div id="response"></div>
<br class="clear">

<?php
} elseif($the_slug == "products" || $the_slug == "proizvodi" || $the_slug == "termekek") {
?>

	<div id="main" class="col-left">


<div id="products-listing">
<?php
//start of latest posts section
	if($_COOKIE['betontrendlanguage'] == "hungarian") {
	$products_selector = 'products-hun';
	$no_products = "Oh ohm no posts!";
	} elseif($_COOKIE['betontrendlanguage'] == "english") {
	$products_selector = 'products-eng';
	$no_products = "Oh ohm no posts!";
	} else {
	$products_selector = 'products-srb';
	$no_products = "Oh ohm no products!";
	}
	$args = array(
		'post_type' => $products_selector,
	);

	$latest_posts = new WP_Query( $args );
	if( $latest_posts->have_posts() ) {
		while( $latest_posts->have_posts() ) {
			$latest_posts->the_post();
$permalink = get_permalink($post->ID);
?>


<div id="category-products">
<div class="thumbnail">

<?php
//$img = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID, 'archive-thumb'), 'archive-thumb');
$img = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'archive-thumb');

$img = $img[0];

echo "<a href=\"" . $permalink . "\"><img src=\"" . $img . "\"></a>";
?>



</div>
<?php echo "<a href=\"" . $permalink . "\">" . get_the_title() . "</a>"; ?>
</div>


<?php } } ?>

</div>



	</div><!-- #END main -->

<?php get_sidebar(); ?>



<?php } else { ?>

	<div id="main" class="col-left">
		<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

			<?php include('content-fullpage.php'); ?>

		<?php endwhile; ?>

		<?php else : ?>

			<div class="post-title">				

				<h4><?php _e('Sorry, no posts matched your criteria.', 'cp'); ?></h1>

			</div>

		<?php endif; ?>

	</div><!-- #END main -->

<?php get_sidebar(); ?>
<?php } ?>

</div><!-- #END content -->
</div>
<?php get_footer(); ?>
