// JavaScript Document

// Sliding Boxes right-left-peak

$(document).ready(function(){
				//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
				//Horizontal Sliding right
				$('.boxgrid.slideright').hover(function(){
					$(".cover", this).stop().animate({left:'525px'},{queue:false,duration:300});
				}, function() {
					$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
				});
				
				$('.boxgrid.sliderleft').hover(function(){
				$(".cover", this).stop().animate({left:'-525px'},{queue:false,duration:300});
				}, function() {
					$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
				});
				
				
				//Horizontal Sliding left
				$('.boxgrid.slidertop').hover(function(){
					$(".cover", this).stop().animate({top:'220px'},{queue:false,duration:300});
				}, function() {
					$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
				});
			});

// fading menu on scroll

 $(function() {
                $(window).scroll(function(){
					var scrollTop = $(window).scrollTop();
					if(scrollTop != 0)
						$('#navbg').stop().animate({'opacity':'0.7'},400);
					else	
						$('#navbg').stop().animate({'opacity':'1'},400);
				});
				
				$('#navbg').hover(
					function (e) {
						var scrollTop = $(window).scrollTop();
						if(scrollTop != 0){
							$('#navbg').stop().animate({'opacity':'1'},400);
						}
					},
					function (e) {
						var scrollTop = $(window).scrollTop();
						if(scrollTop != 0){
							$('#navbg').stop().animate({'opacity':'0.7'},400);
						}
					}
				);
            });
