jQuery(document).ready(function($) {

	$("#loopedSlider .container .slides").cycle({ 
		timeout: 8000,
		speed: 1125,
		next: '.slides', 
		pause: 1
	});
	
	$('a[rel|="gallery"]').fancybox({
		'overlayOpacity':0.6,
		'overlayColor':'#222',
		'transitionIn': 'fade',
		'transitionOut': 'fade',
		'titleShow': false
	//	'titlePosition': 'outside'
	});
	
	/*
	$("#contactform").validationEngine('attach', {
		promptPosition : "topRight", 
		scroll: false
	});
	*/
	
	//$(".ngg-gallery-thumbnail-box:nth-child(6n+1)").css({'margin-left': '83px'});
	
	//$(".ngg-albumoverview .ngg-album-compact:nth-child(6n+1)").css({'margin-left': '83px'});
	
	
	$(".ngg-albumoverview .ngg-album-compact:nth-child(3n)").css({'margin-right': '0'});
	$(".ngg-galleryoverview .ngg-gallery-thumbnail-box:nth-child(3n)").css({'margin-right': '0'});

});

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
