$(function() {
    $("ul#menu-menu-principal").lavaLamp();
    $("ul#menu-main-menu").lavaLamp();

});


$(document).ready(function() {	
swfobject.registerObject("superflash", "8.0.0");
smartColumns();//Execute the function when page loads

$("ul.soptions").hide();
$("li.strigger").toggle(
  function() {
    $(this).parent().find("ul.soptions").slideDown('fast');
  },
  function() {
    $(this).parent().find("ul.soptions").slideUp('fast');
  }
);
});

function smartColumns() { //Create a function that calculates the smart columns
        //Reset column size to a 100% once view port has been adjusted
	$(".ngg-galleryoverview").css({ 'width' : "100%"});
	var colWrap = $(".ngg-galleryoverview").width(); //Get the width of row
	var colNum = Math.floor(colWrap / 220); //Find how many columns of 200px can fit per row / then round it down to a whole number
	var colFixed = Math.floor(colWrap / colNum); //Get the width of the row and divide it by the number of columns it can fit / then round it down to a whole number. This value will be the exact width of the re-adjusted column
	$(".ngg-galleryoverview").css({ 'width' : colWrap}); //Set exact width of row in pixels instead of using % - Prevents cross-browser bugs that appear in certain view port resolutions.
	$(".ngg-gallery-thumbnail-box").css({ 'width' : colFixed}); //Set exact width of the re-adjusted column	
}	

function smartColumns2() { //Create a function that calculates the smart columns
        //Reset column size to a 100% once view port has been adjusted
	$(".vevent").css({ 'width' : "100%"});
	var colWrap = $(".vevent").width(); //Get the width of row
	var colNum = Math.floor(colWrap / 220); //Find how many columns of 200px can fit per row / then round it down to a whole number
	var colFixed = Math.floor(colWrap / colNum); //Get the width of the row and divide it by the number of columns it can fit / then round it down to a whole number. This value will be the exact width of the re-adjusted column
	$(".vevent").css({ 'width' : colWrap}); //Set exact width of row in pixels instead of using % - Prevents cross-browser bugs that appear in certain view port resolutions.
	$(".vevent").css({ 'width' : colFixed}); //Set exact width of the re-adjusted column	
} 

$(window).resize(function () { //Each time the viewport is adjusted/resized, execute the function
	smartColumns();
	smartColumns2();

});

$("a.myfancybox").fancybox({
	'titleShow'		: false,
	'transitionIn':'none',
	'transitionOut':'none',
	'easingIn':'swing', 
	'easingOut':'swing'
});


$(function(){$window=$(window);$link=$("#scrollToTop");$link.click(function(){$("html, body").animate({scrollTop:0},"slow")});$window.scroll(function(){if($window.scrollTop()<=0){$link.fadeOut("fast")}else{$link.fadeIn("fast")}})});
  $("#scrollToTop").hover(function () {
  $(this).animate({
  	opacity: 1.0 }, "slow");
  },	 
  function () {	 
  $(this).animate({
  	opacity: 0.5}, "slow");
  });

$('#lang li').hover(function () {
	$('#lang ul li').animate(
		{ paddingTop: "1em"}, 
		{duration: 200, easing: 'easeOutBack' })
	},
	function () {
	$('#lang ul li').animate(
		{ paddingTop: "0.7em"}, 
		{duration: 200, easing: 'easeOutBack' });
	}
);

$('#socialshare ul').hover(function () {
	$('#socialshare ul li:first-child').animate(
		{ paddingTop: "1em"}, 
		{duration: 200, easing: 'easeOutBack' })
	},
	function () {
	$('#socialshare ul li:first-child').animate(
		{ paddingTop: "0.7em"}, 
		{duration: 200, easing: 'easeOutBack' });
	}
);

$("#masthead").hover(function () {
$(this).animate({
	opacity: 1.0 }, "slow");
},	 
function () {	 
$(this).animate({
	opacity: 0.5}, "slow");
});

$("div.ngg-gallery-thumbnail-box").hover(function () {
$(this).animate({
	opacity: 1.0 }, "slow");
},	 
function () {	 
$(this).animate({
	opacity: 0.4}, "slow");
});

$("div.ngg-gallery-thumbnail-box").hover(function () {
$(this).animate({
	opacity: 1.0 }, "slow");
},	 
function () {	 
$(this).animate({
	opacity: 0.4}, "slow");
});
