			$(function()
			{
				$('.scroll-pane').jScrollPane({showArrows: false});
			});   
   
    $(".btn-slide").hover(function() {
       $("#footer").slideDown(400);
        }, function() {
       $("#footer").slideUp(400);
    });   

$(window).bind("load",function(){  


	
	$(".gallery a").fancybox({
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'overlayOpacity' : 0.2,
		'showCloseButton' : false
	});

  	$("a.buy").fancybox({
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'overlayOpacity' : 0.2,
		'showCloseButton' : false
	});

$(window).resize(function(){
          var h = $(window).height();
          var diffH = h - 700;   
          if (h < 800) {
            $("html").css('background-position', 'right ' + diffH + 'px');
          }
}); 
   
   
    var $el, leftPos, newWidth,
    $mainNav2 = $("#menu-main-menu");
    
    $mainNav2.append("<li id='magic-line'></li>");
    
    var $magicLineTwo = $("#magic-line");
    
    $magicLineTwo
        .width($(".current_page_item").width())
        .height($mainNav2.height())
        .css("left", $(".current_page_item a").position().left)
        .data("origLeft", $(".current_page_item a").position().left)
        .data("origWidth", $magicLineTwo.width());
                
    $("#menu-main-menu li").find("a").hover(function() {
        $el = $(this);
        leftPos = $el.position().left;
        newWidth = $el.parent().width();
        $magicLineTwo.stop().animate({
            left: leftPos,
            width: newWidth,
        })
    }, function() {
        $magicLineTwo.stop().animate({
            left: $magicLineTwo.data("origLeft"),
            width: $magicLineTwo.data("origWidth"),
        });    
    });
    

}); 
