<?php
cout('</head>');
cout('<body>');
if (!islocal()) {
	/*
	?>
	<!-- Google Tag Manager -->
	<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
	new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
	j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
	'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
	})(window,document,'script','dataLayer','GTM-5LL4PCR');</script>
	<!-- End Google Tag Manager -->
	<!-- Google Tag Manager (noscript) -->
	<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5LL4PCR"
	height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
	<!-- End Google Tag Manager (noscript) -->
	<?php
	*/
}
if($detect->isMobile()){
	require(root."/_tpl/body_open.m.php");
} else {
	cout('<div class="container-fluid nice-header">');
		cout('<div class="decor1"></div><!--/.decor1-->');
		cout('<div class="decor2"></div><!--/.decor2-->');
		cout('<div class="decor3"></div><!--/.decor3-->');
		cout('<div class="decor4"></div><!--/.decor4-->');
		cout('<div class="decor5"></div><!--/.decor5-->');
		cout('<div class="decor6">');
			cout('<div class="decor-decor6-1"></div><!--/.decor-decor6-1-->');
		cout('</div><!--/.decor6-->');
		cout('<div class="container tt">');
			cout('<div class="logo"><a href="/"><img class="img-responsive" src="/img/_main-logo.png" alt="Logo" /></a></div><!--/.logo-->');
			cout('<div class="contact-utama">');
				$arr_class = array(
					1=>"info-wa",
					2=>"info-bbm",
					3=>"info-ym",
					4=>"info-line",
					5=>"info-wechat",
					6=>"info-skype",
					7=>"info-sms",
				);
				$qfc="SELECT a.*, b.nama AS nama_cats FROM contacts a 
					LEFT JOIN contact_cats b ON b.kdcontact_cat=a.kdcontact_cat
					WHERE a.isactive=1 AND b.isactive=1
					ORDER BY b.kdcontact_cat, kdcontact";
				$rsfc = callRS($qfc);
				$once = 0;
				for ($i=0;$i<count($rsfc);$i++) {
					$kdcats = intval($rsfc[$i]["kdcontact_cat"]);
					$ctc_link = $arr_class[$kdcats]=="info-bbm"?'//pin.bbm.com/'.$rsfc[$i]["info"].'':'#';
					$ctc_targ = $arr_class[$kdcats]=="info-bbm"?'target="_blank"':'';
					$str_full = '';
					if ($kdcats==2) {
						if ($once==0) {
							$str_full = '<strong style="color:#000;">[FULL]</strong>';
							$once = 1;
						} else {
							$once += 1;
							$str_full = '<strong>'.$once.'</strong>';
						}
					}
					cout('<a href="'.$ctc_link.'" '.$ctc_targ.' class="top-header-info '.$arr_class[$kdcats].'">');
						cout('<span class="icon"></span><!--/.icon-->');
						cout('<span class="for-info">');
							cout('<span class="info-cat">'.$rsfc[$i]["nama_cats"].' '.$str_full.'</span><!--/.info-cat-->');
							cout('<span class="info-det">'.$rsfc[$i]["info"].'</span><!--/.info-det-->');
						cout('</span><!--/.for-info-->');
					cout('</a><!--/.top-header-info '.$arr_class[$kdcats].'-->');
				}
			cout('</div><!--/.contact-utama-->');
			cout('<div class="menu-utama">');
				cout('<a href="/news">BERITA</a>');
				cout('<a href="/tv-schedule">JADWAL TV</a>');
				cout('<a href="/live-scores">LIVESCORE</a>');
				cout('<a href="/pasaran-bola">PASARAN BOLA</a>');
				cout('<a href="/nonton-online">NONTON ONLINE</a>');
			cout('</div><!--/.menu-utama-->');
		cout('</div><!--/.container tt-->');
	cout('</div><!--/.container-fluid nice-header-->');
	cout('<style>
		.for-poker { position:relative; }
		.for-poker .container { position:relative;z-index:999; }
		.poker { display:block;position:absolute;top:0;left:-100px;width:100px;height:250px; }
		.poker img { position:absolute;top:0;left:0; }
	</style>');
	cout('<div class="container-fluid for-poker">');
		cout('<div class="container">');
			cout('<a href="//pokertan.com" class="poker" target="_blank">
				<img class="normal" src="/img/banner-pokertan.v3.100x250.gif" />
			</a>');
		cout('</div><!--/.container-->');
	cout('</div><!--/.container-fluid-->');
	cout('<script>');
		cout('function dodo(){');
			cout('var wH = $(window).height();');
			cout('var bkiH = $(".poker").height();');
			cout('var scrollAmount=$(document).scrollTop();');
			cout('var menuPosition = $(".poker").position().top;');
			cout('var newPosition=menuPosition+scrollAmount+200;');
			#cout('//$(".banner-iklan-kiri").html(scrollAmount);');
			cout('var maxTop = ($(".nice-header").length)?50:40;');
			cout('newPosition = (scrollAmount>=maxTop)?(scrollAmount + 130):(maxTop + 30);');
			cout('if(wH<bkiH){');
				cout('$(".poker").css("top",menuPosition );');
			cout('} else {');
				cout('$(".poker").stop().animate({top: newPosition}, 800);');
			cout('}');
		cout('}');
		cout('$(document).ready(function(){');
			cout('dodo();');
		cout('});');
		cout('$(window).load(function(){');
			cout('dodo();');
		cout('});');
		cout('$(window).scroll(function(){');
			cout('dodo();');
		cout('});');
	cout('</script>');
	/*
	cout('<style>
		.for-angpao { position:relative; }
		.for-angpao .container { position:relative;z-index:999; }
		.angpao { position:absolute;top:0;left:-100px;width:200px;height:201px; }
		.angpao img { position:absolute;top:0;left:0; }
		.toggleMusic, .toggleMusic:active, .toggleMusic:visited, .toggleMusic:hover, .toggleMusic:focus { color:#fff;position:absolute;left:10px; }
	</style>');
	if ($page_id!="angpao") {
		cout('<div class="container-fluid for-angpao">');
			cout('<div class="container">');
				cout('<a href="/angpao" class="angpao">
					<img class="normal" src="/img/angpao/angpao.png" />
					<img class="glow" src="/img/angpao/angpao.glow.png" />
				</a>');
			cout('</div><!--/.container-->');
		cout('</div><!--/.container-fluid-->');
		cout('<script>');
			cout('
			$(".angpao .glow").stop().fadeOut(1);
			$(".angpao").bind("mouseenter", function(){
				$(".angpao .glow").stop().fadeIn();
			});
			$(".angpao").bind("mouseleave", function(){
				$(".angpao .glow").stop().fadeOut();
			});
			');
			cout('
			flickering();
			function flickering() {
				$(".angpao .glow").stop().fadeIn(500, function(){
					$(".angpao .glow").stop().fadeOut(500, function(){
						flickering();
					});
				});
			}');
			cout('function dodo(){');
				cout('var wH = $(window).height();');
				cout('var bkiH = $(".angpao").height();');
				cout('var scrollAmount=$(document).scrollTop();');
				cout('var menuPosition = $(".angpao").position().top;');
				cout('var newPosition=menuPosition+scrollAmount+200;');
				#cout('//$(".banner-iklan-kiri").html(scrollAmount);');
				cout('var maxTop = ($(".nice-header").length)?50:40;');
				cout('newPosition = (scrollAmount>=maxTop)?(scrollAmount + 130):(maxTop + 30);');
				cout('if(wH<bkiH){');
					cout('$(".angpao").css("top",menuPosition );');
				cout('} else {');
					cout('$(".angpao").stop().animate({top: newPosition}, 800);');
				cout('}');
			cout('}');
			cout('$(document).ready(function(){');
				cout('dodo();');
			cout('});');
			cout('$(window).load(function(){');
				cout('dodo();');
			cout('});');
			cout('$(window).scroll(function(){');
				cout('dodo();');
			cout('});');
		cout('</script>');
	}
	*/
}
?>