<?php
header('Content-Type: application/javascript');
if(!defined("root")){define("root",$_SERVER['DOCUMENT_ROOT']);}
if(version_compare(phpversion(),'5.4.0','<')){if(session_id()==''){session_start();}}else{if(session_status()==PHP_SESSION_NONE){session_start();}}
require(root."/_common.php");
require(root."/lib/db.pdo.php");
require(root."/lib/main.php");

require(root."/js/jquery-3.3.1.min.js");
c("\n/****/\n");
require(root."/js/bootstrap.min.js");
c("\n/****/\n");
#require(root."/js/hammer.2.0.8.min.js");
#c("\n/****/\n");
#require(root."/js/jquery.bxslider.php");
#c("\n/****/\n");
#require(root."/js/jquery.easing.1.3.js");
#c("\n/****/\n");
require(root."/js/flickity.2.1.2.pkgd.min.js");
c("\n/****/\n");
#c('alert(1);');
c('var prevScroll = $(window).scrollTop();');
c('var currScroll = $(window).scrollTop();');
c('function headerStucking() {');
	c('currScroll = $(window).scrollTop();');
	c('if(currScroll<=0){$(".main-logo").removeClass("stuck");}else{$(".main-logo").addClass("stuck");}');
c('}');
c('$(window).scroll(function(){headerStucking();});');
c('$(window).on("load",function(){headerStucking();});');

#c('/*root*/');
#c('var mc = new Hammer(document.getElementById("homeSlide"));');
#c('/*mouse pointer state*/');
#c('var pointerXCoord = 0;');
#c('/*image lefting*/');
#c('var imageLeftCord = 0;');
#c('/*carousel width*/');
#c('var carouselWidth = $(".carousel-inner").width();');
#c('/*lastmove*/');
#c('var lastMove = "";');
#c('$("#homeSlide").carousel({');
#	c('/*interval: false*/');
#c('});');
#c('function initialize() {');
#	c('$("#homeSlide").carousel("cycle");');
#	c('carouselWidth = $(".carousel-inner").width();');
#	c('imageLeftCord = 0;');
#	c('pointerXCoord = 0;');
#	c('lastMove = "";');
#c('}');
#c('function snapLeft() {');
#	c('$(".item").css({ transition: "", transform: "" });');
#	c('$(".item").removeClass("prev");');
#	c('$(".item").removeClass("next");');
#	c('$("#homeSlide").carousel("prev");');
#	c('setTimeout(function() {');
#		c('initialize();');
#	c('}, 600);');
#c('}');
#c('function snapRight() {');
#	c('$(".item").css({ transition: "", transform: "" });');
#	c('$(".item").removeClass("prev");');
#	c('$(".item").removeClass("next");');
#	c('$("#homeSlide").carousel("next");');
#	c('setTimeout(function() {');
#		c('initialize();');
#	c('}, 600);');
#c('}');
#c('$(".carousel-control.left").click(function(){');
#	c('snapLeft();');
#c('});');
#
#c('$(".carousel-control.right").click(function(){');
#	c('snapRight();');
#c('});');
#c('/*CATCH PANNING EVENTS*/');
#c('mc.on("panstart panend panleft panright", function(ev) {');
#	c('/*PAUSE THE CAROUSEL*/');
#	c('$("#homeSlide").carousel("pause");');
#	c('/*set next and prev with circular searching*/');
#	c('var prev = $(".item.active").prev();');
#	c('if (prev[0] === undefined) {');
#		c('prev = $(".carousel-inner").children().last();');
#	c('}');
#	c('prev.addClass("prev");');
#	c('var next = $(".item.active").next();');
#	c('if (next[0] === undefined) {');
#		c('next = $(".carousel-inner").children().first();');
#	c('}');
#	c('next.addClass("next");');
#	c('/*if is panstart set position of cursor for calculationg different positions*/');
#	c('if (ev.type === "panstart"){');
#		c('pointerXCoord = ev.pointers[0].pageX;');
#		c('return 0;');
#	c('}');
#	c('/*MOVING*/');
#	c('if (pointerXCoord !== ev.pointers[0].pageX) {');
#		c('/*set last action [left-right]*/');
#		c('lastMove = ev.type;');
#		c('/*how much do you move?*/');
#		c('var diff = ev.pointers[0].pageX - pointerXCoord;');
#		c('$(".item.active").css({');
#			c('transition: "initial",');
#			c('transform: "translate3d(" + (imageLeftCord + diff) + "px, 0, 0)"');
#		c('});');
#		c('$(".item.next").css({');
#			c('transition:"initial",');
#			c('transform:"translate3d(" + (imageLeftCord + diff + carouselWidth) + "px, 0, 0)"');
#		c('});');
#		c('$(".item.prev").css({');
#			c('transition: "initial",');
#			c('transform:"translate3d(" + (imageLeftCord + diff - carouselWidth) + "px, 0, 0)"');
#		c('});');
#		c('/*set variables for next turn*/');
#		c('imageLeftCord += diff;');
#		c('pointerXCoord = ev.pointers[0].pageX;');
#	c('}');
#	c('/*end*/');
#	c('if (ev.type === "panend") {');
#		c('if (imageLeftCord > carouselWidth / 2){');
#			c('if (lastMove === "panright"){');
#				c('snapLeft();');
#				c('return 0;');
#			c('}');
#		c('}');
#		c('if (imageLeftCord < -(carouselWidth / 2)) {');
#			c('if (lastMove === "panleft") {');
#				c('snapRight();');
#				c('return 0;');
#			c('}');
#		c('}');
#		c('/*return to the start position*/');
#		c('$(".item").css({ transition: "", transform: "" });');
#		c('initialize();');
#	c('}');
#c('});');

#c('$(document).ready(function(){');
#	c('$(".slider").bxSlider({auto:true});');
#c('});');

c('$(".slider").flickity({');
	c('cellAlign:"left",');
	c('contain:true,');
	c('autoPlay:3500,');
	c('wrapAround:true,');
	c('draggable:">1",');
c('});');

c('$(".home-presentation").flickity({');
	c('cellAlign:"left",');
	c('contain:true,');
	c('autoPlay:true,');
	c('wrapAround:true,');
	c('draggable:">1",');
	c('prevNextButtons:false,');
	c('pageDots:false,');
c('});');
c('$(".latest-dp,.latest-wd").flickity({');
	c('cellAlign:"left",');
	c('contain:true,');
	c('autoPlay:3500,');
	c('wrapAround:true,');
	c('draggable:false,');
	c('prevNextButtons:false,');
c('});');

c('$(".banks-status").flickity({');
	c('cellAlign:"left",');
	c('contain:true,');
	c('autoPlay:1500,');
	c('wrapAround:true,');
	c('draggable:">1",');
	c('prevNextButtons:false,');
c('});');
c('function flickText(parEl, parTime){
	if (parEl.hasClass("unredup")){
		parEl.stop().animate({"opacity":".5"}, parTime, function(){
			parEl.removeClass("unredup");
			flickText(parEl, parTime);
		});
	} else {
		parEl.stop().animate({"opacity":"1"}, parTime, function(){
			parEl.addClass("unredup");
			flickText(parEl, parTime);
		});
	}
}');
c('$(".bank-online-status").each(function(){');
	c('var randX = Math.floor(Math.random() * 5);');
	c('randX = 450 + (randX * 80);');
	c('flickText($(this), randX);');
c('});');

c('function toggleIndexMenu(){
	if (!$(".trigger-button").hasClass("lagi-muncul")) {
		$(".mobile-main-menu-bg").fadeIn(100);
		$(".for-list-menu").stop().animate({"right":"5px"}, 200, function(){
			$(".trigger-button").addClass("lagi-muncul");
		});
	} else {
		$(".mobile-main-menu-bg").fadeOut(100);
		$(".for-list-menu").stop().animate({"right":"-105%"}, 200, function(){
			$(".trigger-button").removeClass("lagi-muncul");
		});
	}
}');
c('$(".trigger-button").on("click", function(){
	toggleIndexMenu();
});');
c('$(".mobile-main-menu-bg").on("click", function(){
	toggleIndexMenu();
});');
c('$(window).on("resize", function(){
	if($("html").width()>768){
		$(".mobile-main-menu-bg").fadeOut(100);
		$(".for-list-menu").stop().animate({ "padding":"0", "width":"100%", "position":"relative", "background":"none", "top":"auto", "right":"auto", "bottom":"auto", "left":"auto" }, 200, function(){
			$(".trigger-button").removeClass("lagi-muncul");
		});
	}
});');
?>