
/**
* BOOTSTRAP EXTENDED LEVEL 2 LAYOUT - JS INITIALIZE
* BY: Zul Zolkaffly (03/11/2016)
*/
$(document).ready(function() {
	var sclx = function() {
		var $sclx =  $('#sclx');
		
		if(Math.round( window.pageYOffset ) >= 200) {		
			$sclx.addClass('sclx');
		} else {		
			$sclx.removeClass('sclx');
		}
	};
	
	var prlx = function() {
		var o = Math.round( window.pageYOffset );
		var w = Math.round(	$(window).outerHeight()	);
		
		if(o <= 0) {		
			$('.parallax').css('background-position','50% 50%');
		} else {	
			$('.parallax').css('background-position','50% '+(Math.round(	(50 + ((o/(w/2)) * 50))	))+'%');
		}
	};
	
	$(window).scroll(function() {
		sclx();
		prlx();
	});
	
	sclx();
});



































