<?php
	if ($page_id!="index") {
		cout('<div class="container-fluid">');
			cout('<div class="container for-footer">');
				cout('<div class="decor decor-1"></div>');
				cout('<div class="decor decor-2"></div>');
				cout('<div class="decor decor-3"></div>');
				/*
				cout('<div class="special-box">');
					cout('<div class="decor decor-1"></div>');
					cout('<div class="decor decor-2"></div>');
					cout('<div class="content">');
						cout('<div class="decor decor-1"></div>');
						cout('<div class="decor decor-2"></div>');
						#cout('<div class="title">');
							#cout('<img src="/img/title-aboutus.png" alt="Tentang Kami" />');
							#cout('<div class="decor decor-1"></div>');
						#cout('</div>');
						cout('<div class="real-content">'.$isi.'</div>');
					cout('</div>');
				cout('</div><!--/.special-box-->');
				*/
				cout('<div class="special-box">');
					cout('<div class="text-center">');
						$rssos=array();
						$qsos = "SELECT a.*, b.nama AS nama_cats FROM sosmeds a
							LEFT JOIN sosmed_cats b ON b.kdsosmed_cat=a.kdsosmed_cat
							WHERE a.isactive=1 AND b.isactive=1";
						callRS($rssos, $qsos);
						for ($s=0;$s<count($rssos);$s++) {
							cout('<a href="//'.str_replace(array("http://", "//"), "", $rssos[$s]["info"]).'" target="_blank" class="icon-sosmeds icon-sosmeds-'.$rssos[$s]["nama_cats"].'"></a>');
						}
					cout('</div>');
				cout('</div><!--/.special-box-->');
				cout('<div class="footer-content">');
					cout('<div class="row">');
						cout('<div class="col-xs-12 col-md-7">');
							cout('<div class="footer-menu">');
								require(root."/_tpl/footer_menu.php");
							cout('</div><!--/.footer-menu-->');
							
						cout('</div><!--/.col-xs-12 col-md-7-->');
						cout('<div class="col-md-5 hidden-xs hidden-sm">');
							cout('<div class="row">');
								cout('<div class="col-md-3 text-right">');
								cout('</div><!--/.col-md-3-->');
								cout('<div class="col-md-2 text-right">');
									cout('<img class="logo-2" height="33" src="/img/amp_favicon.120.png" alt="" />');
								cout('</div><!--/.col-md-2-->');
								cout('<div class="col-md-7">');
									cout('<img class="logo-text" src="/img/title-websitename.png" alt="" />');
								cout('</div><!--/.col-md-7-->');
							cout('</div><!--/.row-->');
						cout('</div><!--/.col-md-5-->');
					cout('</div><!--/.row-->');
				cout('</div><!--/.footer-content-->');
				
			cout('</div><!--/.container for-footer-->');
		cout('</div><!--/.container-fluid-->');
		
	}


	#cout('<!--<div class="container bordering">');
	#	cout('<div class="fleft-200"></div>');
	#cout('</div>-->');
cout('</div><!--/.container-fluid-->');

cout('<div class="container-fluid copyright">Copyright &copy; <a href="/">AgenVIP88</a> 2017. All rights reserved.</div>');

#cout('<!-- Modal -->');
cout('<div class="modal fade" id="modalGames" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">');
	cout('<div class="modal-dialog">');
		cout('<div class="modal-content">');
			cout('<div class="modal-header">');
				cout('<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>');
				cout('<div class="modal-title" style="font-size:18px;font-weight:500;">Modal title</div>');
			cout('</div>');
			cout('<div class="modal-body row"><div class="te modal-body-x"></div></div>');
			cout('<div class="modal-footer">');
				cout('<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>');
				#cout('<!--');
				#cout('<button type="button" class="btn btn-primary">Save changes</button>');
				#cout('-->');
			cout('</div>');
		cout('</div><!-- /.modal-content -->');
	cout('</div><!-- /.modal-dialog -->');
cout('</div><!-- /.modal -->');

$stime = '?'.time();
$stime = '';
cout('<link href="'.absDom.'/css/bootstrap.min.css" rel="stylesheet" media="none" onload="if(media!=\'all\') media=\'all\'" />');
cout('<link href="'.absDom.'/css/bootstrap-theme.min.css" rel="stylesheet" media="none" onload="if(media!=\'all\') media=\'all\'" />');
cout('<link href="'.absDom.'/style.fonts/fonts.css'.$stime.'" rel="stylesheet" type="text/css" media="none" onload="if(media!=\'all\') media=\'all\'" />');
cout('<link href="'.absDom.'/css/style.css'.$stime.'" rel="stylesheet" type="text/css" media="none" onload="if(media!=\'all\') media=\'all\'" />');



#cout('<script src="'.absDom.'/js/jquery-1.11.3.min.js'.$stime.'"></script>');
##cout('<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>');
#cout('<script type="text/javascript" src="'.absDom.'/js/jquery-ui-1.9.2.custom.min.js'.$stime.'"></script>');
#cout('<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->');
#cout('<!--[if lt IE 9]>');
#	cout('<script src="'.absDom.'/js/html5shiv-3.7.2.min.js"></script>');
#	cout('<script src="'.absDom.'/js/respond-1.4.2.min.js"></script>');
#cout('<![endif]-->');
##cout('<script src="'.absDom.'/js/bootstrap.min.js"></script>');
#cout('<script src="'.absDom.'/js/ie10-viewport-bug-workaround.min.js"></script>');
#cout('<script src="'.absDom.'/js/gistfile1.min.js" type="text/javascript"></script>');
#cout('<script src="'.absDom.'/js/jquery.imagemapster.min.js"></script>');

cout('<script>');
	
	
	cout('function RandomString(length) {');
		cout('var chars = "0123456789".split("");');
		cout('if (!length)');
		cout('length = Math.floor(Math.random() * chars.length);');
		cout('var str = "";');
		cout('for (var i = 0; i < length; i++)');
		cout('str += chars[Math.floor(Math.random() * chars.length)];');
		cout('return str;');
	cout('}');
	cout('function reloadCaptcha() {');
		cout('$(".captcha-main-image").attr("src", "/img/ajax-loader.gif");');
		cout('$(".captcha-main-image").css("height", "30px").css("width", "100px");');
		cout('setTimeout(function(){');
			cout('$(".captcha-main-image").attr("src", "/gfx/captcha/"+RandomString(10)+".gif/captcha_order/");');
			#cout('//$(".captcha-main-image").css("height", "auto").css("width", "auto");');
		cout('}, 2000);');
	cout('}');
	cout('$(window).ready(function(){');
		cout('$(".captcha-main-image").bind("click", function(){');
			cout('reloadCaptcha();');
		cout('});');
	cout('});');
	
	cout('function go(data) {');
		#cout('alert(this.href);');
		cout('if (this.href && this.href !== "#") {');
			cout('window.location.href = this.href;');
		cout('}');
	cout('}');
	cout('$(window).load(function(){');
		cout('$("#mainMenu").mapster({');
			cout('stroke: false,');
			cout('fillColor: "000000",');
			cout('fillOpacity: 0.2,');
			cout('onClick: go');
		cout('});');
	cout('});');
	cout('var resizeTime = 500;');
	#cout('// total duration of the resize effect, 0 is instant');
	cout('var resizeDelay = 100;');
	#cout('// time to wait before checking the window size again');
	#cout('// the shorter the time, the more reactive it will be.');
	#cout('// short or 0 times could cause problems with old browsers.');
	
	#cout('// Resize the map to fit within the boundaries provided');
	cout('function resize(maxWidth,maxHeight) {');
		cout('var image =  $("#mainMenu"),');
		cout('imgWidth = image.width(),');
		cout('imgHeight = image.height(),');
		cout('newWidth=0,');
		cout('newHeight=0;');
		cout('if (imgWidth/maxWidth>imgHeight/maxHeight) {');
			cout('newWidth = maxWidth;');
		cout('} else {');
			cout('newHeight = maxHeight;');
		cout('}');
		cout('image.mapster("resize",newWidth,newHeight,resizeTime);');
	cout('}');
	
	#cout('// Track window resizing events, but only actually call the map resize when the');
	#cout('// window isn\'t being resized any more');

	cout('function onWindowResize() {');
		cout('var curWidth = $(window).width(),');
		cout('curHeight = $(window).height(),');
		cout('checking=false;');
		cout('if (checking) {');
			cout('return;');
		cout('}');
		cout('checking = true;');
		cout('window.setTimeout(function() {');
			cout('var newWidth = $(window).width(),');
			cout('newHeight = $(window).height();');
			cout('if (newWidth>=640) { newWidth = 575;curWidth = 575; }');
			#cout('alert(newWidth+"=="+curWidth);');
			cout('if (newWidth === curWidth && newHeight === curHeight) {');
				cout('resize(newWidth,newHeight); ');
			cout('}');
			cout('checking=false;');
		cout('},resizeDelay);');
	cout('}');
	cout('$(window).bind("resize",onWindowResize);');
	
	cout('function loadNewJG() {');
		cout('var rand_speed = Math.floor((Math.random() * 1000) + 1000);');
		cout('var rand_el_no = Math.floor((Math.random() * 15) + 0);');
		cout('var just_rand = 0;');
		cout('var randx = 0;');
		cout('var fake_opacity = 0;');
		cout('var fake_fill = 0;');
		cout('var rand_y = 0;');
		cout('var rand_x = 0;');
		cout('var rand_w = 0;');
		cout('var rand_h = 0;');
		cout('var ttt = 0;');
		cout('var $newdiv2 = $( "<div class=\'jg2\'></div>" );');
		
		#cout('//rand_el_no = Math.floor((Math.random() * 15) + 0);');
		#cout('//$newdiv2.addClass("jg2-pos"+ rand_el_no);');
		
		#cout('//rand_el_no = Math.floor((Math.random() * 15) + 0);');
		#cout('//$newdiv2.addClass("jg2-size"+ rand_el_no);');
		
		#cout('//rand_el_no = Math.floor((Math.random() * 15) + 0);');
		#cout('//$newdiv2.addClass("jg2-color"+ rand_el_no);');
		
		cout('$newdiv2.addClass("jg2-40deg");');
		
		cout('randx = Math.floor((Math.random() * 4) + 1);');
		cout('ttt = randx;');
		cout('switch(randx) {');
			cout('case 1: { fake_opacity = Math.floor((Math.random() * 20) + 30) / 100; fake_fill = Math.floor((Math.random() * 20) + 50) / 100; break; }');
			cout('case 2: { fake_opacity = Math.floor((Math.random() * 15) + 35) / 100; fake_fill = Math.floor((Math.random() * 15) + 55) / 100; break; }');
			cout('case 3: { fake_opacity = Math.floor((Math.random() * 10) + 40) / 100; fake_fill = Math.floor((Math.random() * 10) + 60) / 100; break; }');
			cout('case 4: { fake_opacity = Math.floor((Math.random() * 5) + 50) / 100; fake_fill = Math.floor((Math.random() * 5) + 65) / 100; break; }');
		cout('}');
		cout('randx = Math.floor((Math.random() * 4) + 1);');
		cout('switch(randx) {');
			cout('case 1: { rand_y = Math.floor((Math.random() * Math.floor((Math.random() * 200) + 100)) + Math.floor((Math.random() * 100) + 0));		break; }');
			cout('case 2: { rand_y = Math.floor((Math.random() * Math.floor((Math.random() * 400) + 300)) + Math.floor((Math.random() * 300) + 100));	break; }');
			cout('case 3: { rand_y = Math.floor((Math.random() * Math.floor((Math.random() * 600) + 500)) + Math.floor((Math.random() * 500) + 300));	break; }');
			cout('case 4: { rand_y = Math.floor((Math.random() * Math.floor((Math.random() * 800) + 700)) + Math.floor((Math.random() * 700) + 500));	break; }');
		cout('}');
		cout('randx = Math.floor((Math.random() * 4) + 1);');
		cout('switch(randx) {');
			cout('case 1: { rand_x = Math.floor((Math.random() * (-500)) + (-1000));break; }');
			cout('case 2: { rand_x = Math.floor((Math.random() * 0) + (-500));break; }');
			cout('case 3: { rand_x = Math.floor((Math.random() * 500) + 0);break; }');
			cout('case 4: { rand_x = Math.floor((Math.random() * 1000) + 500);break; }');
		cout('}');
		cout('randx = Math.floor((Math.random() * 4) + 1);');
		cout('switch(randx) {');
			cout('case 1: { rand_w = Math.floor((Math.random() * 600) + 500);	rand_h = (rand_w) + Math.floor((Math.random() * 20) + 0);	break; }');
			cout('case 2: { rand_w = Math.floor((Math.random() * 650) + 550);	rand_h = (rand_w) + Math.floor((Math.random() * 40) + 20);	break; }');
			cout('case 3: { rand_w = Math.floor((Math.random() * 700) + 600);	rand_h = (rand_w) + Math.floor((Math.random() * 60) + 40);	break; }');
			cout('case 4: { rand_w = Math.floor((Math.random() * 750) + 650);	rand_h = (rand_w) + Math.floor((Math.random() * 80) + 60);	break; }');
		cout('}');
		cout('$newdiv2.css({ ');
			cout('"width":""+ rand_w +"px",');
			cout('"height":""+ rand_h +"px",');
			cout('"background":"rgba(138,6,6,"+ (fake_opacity * fake_fill) +")",');
			cout('"top":""+ rand_y +"px",');
			cout('"left":"50%",');
			cout('"z-index":"1",');
			cout('"margin-left":""+ rand_x +"px",');
		cout('});');
		cout('$(".main-body").append($newdiv2);');
		cout('setTimeout(function(){');
			cout('$newdiv2.fadeOut(1, function(){');
				cout('rand_speed = Math.floor((Math.random() * 1000) + 1000);');
				cout('$newdiv2.fadeIn(rand_speed, function(){');
					cout('fadesJG($(this));');
				cout('});');
			cout('});');
		cout('}, 10);');
	cout('}');
	cout('function fadesJG(parEl){');
		cout('var rand_speed = Math.floor((Math.random() * 3000) + 2000);');
		cout('setTimeout(function(){');
			cout('rand_speed = Math.floor((Math.random() * 3000) + 2000);');
			cout('parEl.fadeOut(rand_speed, function(){');
				cout('parEl.remove();');
				cout('loadNewJG();');
			cout('});');
		cout('}, rand_speed);');
	cout('}');
	cout('$(window).load(function(){');
		cout('for (var i=0;i<=8;i++) {');
			cout('setTimeout(function(){');
				cout('loadNewJG();');
			cout('}, 100);');
		cout('}');
		#cout('/*');
		#cout('$(".jg2").each(function(){');
		#	cout('fadesJG($(this));');
		#cout('});');
		#cout('*/');
	cout('});');

	
	cout('function loadMarquee() {');
		# basic version is: $("div.demo marquee").marquee() - but we\'re doing some sexy extras
		cout('$(".run-text marquee").marquee("pointer").mouseover(function () {');
			cout('$(this).trigger("stop");');
		cout('}).mouseout(function () {');
			cout('$(this).trigger("start");');
		cout('}).mousemove(function (event) {');
			cout('if ($(this).data("drag") == true) {');
				cout('this.scrollLeft = $(this).data("scrollX") + ($(this).data("x") - event.clientX);');
			cout('}');
		cout('}).mousedown(function (event) {');
			cout('$(this).data("drag", true).data("x", event.clientX).data("scrollX", this.scrollLeft);');
		cout('}).mouseup(function () {');
			cout('$(this).data("drag", false);');
		cout('});');
	cout('}');
	cout('$(window).load(function(){');
		$rsa=array();$qa="SELECT * FROM s_announcements WHERE isactive=1 ORDER BY tanggal DESC LIMIT 0,1";
		callRS($rsa, $qa);
		if (count($rsa)!=0) {
			cout('$(".pending-load-running-text").html("<marquee behavior=\"scroll\" scrollamount=\"1\" direction=\"left\"><a href=\"'.absDom.'/announcements/'.$rsa[0]["url"].'\">'.$rsa[0]["judul"].'</a></marquee>");');
			cout('loadMarquee();');
		}
		cout('setTimeout(function(){');
			cout('doScrollDP(0);');
			cout('doScrollWD(0);');
		cout('}, 100);');
	cout('});');
	#cout('$(function () {');
	#cout('});');
	cout('function doScrollDP(parCST) {');
		cout('var nST = parCST + 336;');
		cout('if (nST>500) { nST = 0; }');
		cout('setTimeout(function(){');
			cout('$(".forscrolldp").animate({ scrollTop: nST }, 3000, function(){');
				cout('doScrollDP(nST);');
			cout('});');
		cout('}, 4000);');
	cout('}');
	cout('function doScrollWD(parCST) {');
		cout('var nST = parCST + 336;');
		cout('if (nST>500) { nST = 0; }');
		cout('setTimeout(function(){');
			cout('$(".forscrollwd").animate({ scrollTop: nST }, 3000, function(){');
				cout('doScrollWD(nST);');
			cout('});');
		cout('}, 4000);');
	cout('}');
	cout('function showPop(parJenis, parKD) {');
		cout('$.ajax({');
			cout('type: "GET",');
			cout('url: "/_ajax/ajax_index.php",');
			cout('data: "a=getdetailgames&id="+ parKD +"",');
			cout('success: function(resp){');
				cout('var tsp1 = resp.split("$$$");');
				cout('var tsp2 = new Array();');
				cout('for (var i=0;i<tsp1.length;i++) {');
					cout('tsp2 = tsp1[i].split("$$");');
					cout('$("#modalGames ."+tsp2[0]).html(tsp2[1]);');
					cout('$("#modalGames").modal("show");');
				cout('}');
			cout('}');
		cout('});');
	cout('}');
cout('</script>');
if (!islocal()) {
	
	#cout('<!-- Start of LiveChat (www.livechatinc.com) code -->');
	cout('<script type="text/javascript">');
		cout('window.__lc = window.__lc || {};');
		cout('window.__lc.license = 7075911;');
		cout('(function() {');
			cout('var lc = document.createElement("script"); lc.type = "text/javascript"; lc.async = true;');
			cout('lc.src = ("https:" == document.location.protocol ? "https://" : "http://") + "cdn.livechatinc.com/tracking.js";');
			cout('var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(lc, s);');
		cout('})();');
	cout('</script>');
	#cout('<!-- End of LiveChat code -->');
	cout("<script>");
	  cout("(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){");
	  cout("(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),");
	  cout("m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)");
	  cout("})(window,document,'script','//www.google-analytics.com/analytics.js','ga');");

	  cout("ga('create', 'UA-66063032-1', 'auto');");
	  cout("ga('send', 'pageview');");

	cout("</script>");
}

cout('</body>');
cout('</html>');
### LOG VISITOR ######################################################
######################################################################
	$http_referer = $_SERVER["HTTP_REFERER"];
	$request_time_float = $_SERVER["REQUEST_TIME_FLOAT"];
	$request_time_float_s = date('l, d M Y, H:i:s', $_SERVER["REQUEST_TIME_FLOAT"]);
	$request_time = $_SERVER["REQUEST_TIME"];
	$request_time_s = date('l, d M Y, H:i:s', $_SERVER["REQUEST_TIME"]);
	$client_ip = get_client_ip();
	$client_ip2 = get_client_ip2();
	$client_ip3 = get_client_ip3();
	$session_id = session_id();
	$http_user_agent = $_SERVER["HTTP_USER_AGENT"];
	$server_name = $_SERVER["SERVER_NAME"];
	$http_host = $_SERVER["HTTP_HOST"];
	$http_host = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . $_SERVER["HTTP_HOST"] ."". $_SERVER["REQUEST_URI"];
	$last_clicked = time();
	$browser_info = $visitor_browser;
	$qi = "INSERT INTO _visitors (http_referer, request_time_float, request_time_float_s, request_time, request_time_s, client_ip, client_ip2, client_ip3, session_id, http_user_agent, server_name, http_host, browser_info, last_clicked) VALUES
		('$http_referer', '$request_time_float', '$request_time_float_s', '$request_time', '$request_time_s', '$client_ip', '$client_ip2', '$client_ip3', '$session_id', '$http_user_agent', '$server_name', '$http_host', '$browser_info', '$last_clicked')";
	execRSL($qi);
######################################################################
?>