$(document).ready(function(){   
	
	$(document).pngFix();
	
	$('#imagechanger').innerfade({
		speed: 3000,
		timeout: 6000,
		type: 'sequence',
		containerheight: '290px'
	});
	
	$(".fancybox").fancybox({
		'titleShow': false
	});
	
	$(".fancyframe").fancybox({
		'width': 540,
		'height': 500
	});	
	
	$(".fancyframesmall").fancybox({
		'width': 540,
		'height': 220
	});
	
	$(".foldouttoggle").click(function(){
	   $(this).parent().children(".foldoutbox").slideToggle("slow");
	   $(this).toggleClass("foldoutopen");
	});
					
	$("form").submit(function () {
		error = false;
		i = 0;
		$('.required', this).each(function() {
			if ($(this).val() == '') {
				$(this).addClass("requirederror");
				error = true;
			} else {
				$(this).removeClass("requirederror");
			}
			i++;
		});
		if (i > 0) {
			if (error == true) {
				return false;
			} else {
				return true;
			}
		}
	});
									  
});
