/* GOD HAVE MERCY */





/* PARALLAX BACKGROUND  ---------------------------------- */

function calcParallax(tileheight, speedratio, scrollposition) {
	return (tileheight - (Math.floor(scrollposition / speedratio) % (tileheight+1)));
}

$(document).ready(function () {
	window.onscroll = function() {
		var posY = (document.documentElement.scrollTop) ? document.documentElement.scrollTop : window.pageYOffset;
		
		var para_buro = document.getElementById('para_buro');
		var para_buroparallax = calcParallax(3000, 4, posY);
		para_buro.style.backgroundPosition = "0 " + para_buroparallax + "px"; 

		var para_buro_1 = document.getElementById('para_buro_1');
		var para_buro_1parallax = calcParallax(3000, 3, posY);
		para_buro_1.style.backgroundPosition = "0 " + para_buro_1parallax + "px";
		
	}
});


/* SLIDES NAV ROLLOVERS 1  ---------------------------------- */

$(function(){
	$('.prevButton img').css({'left':0});

	$(".prevButton a").hover(function(){
		$("img", this).stop().animate({left:"-44px"},{queue:false,duration:200});
	}, function() {
		$("img", this).stop().animate({left:"0px"},{queue:false,duration:200});
	});
	
});

$(function(){
	$('.nextButton img').css({'right':0});

	$(".nextButton a").hover(function(){
		$("img", this).stop().animate({right:"-44px"},{queue:false,duration:200});
	}, function() {
		$("img", this).stop().animate({right:"0px"},{queue:false,duration:200});
	});
});






	

/* FADE IN SITE  ---------------------------------- 

    $(document).ready(function () {
	
		$('#wrap').hide().delay(500).fadeIn(1000);
	
    });
	
	
*/


/* scroll ease  ---------------------------------- */

$(function() {
                $('ul.sub a, #button_1 a, #button_2 a, , #button_3 a, #button_4 a, #button_5 a, #button_b1 a, #button_b2 a, #button_b3 a').bind('click',function(event){
                    var $anchor = $(this);
                    
                    $('html, body').stop().animate({
                        scrollTop: $($anchor.attr('href')).offset().top
                    }, 1500,'easeInOutExpo');
                    event.preventDefault();
                });
            });


/* overlay  ---------------------------------- */

$(document).ready(function () {
	
		$('#overlay').delay(500).fadeOut(1000);
	
    });

