// JavaScript Document
$(document).ready(function(){
	/* Navigation */

	$(".nav ul ul").each(function(i){ $(this).hide().css('top', '29px'); });
	$(".nav ul li").hover(
		function(){
			$(this).addClass('activesub');
			$('ul', this).show();
			//$('ul', this).stop(true, true).slideDown('fast');
		},
		function(){
			$(this).removeClass('activesub');
			$('ul', this).hide();
			//$('ul', this).stop(true, true).slideUp('fast');
		}
	);
	
	
	/* thumbs rollover */
	
	if($(".thumbs").length > 0 ){
		/*
		$('.thumbs .thumb').hover(
			function(){ //mouseover   
				$(this).animate({backgroundColor: "#009CE4"}, 500);   
			},
			function(){  
				$(this).animate({backgroundColor: "#ffffff"}, 300);   
			}
		);
		*/
		$(".thumbs a").fancybox({
			'overlayShow':	true
		});
	}
	
	$("p.movielink a").fancybox({
		'overlayShow':	true,
		'frameWidth': 450,
		'frameHeight': 252,
		'hideOnContentClick': false
	});
	
	$("a.inlmov").fancybox({
		'overlayShow':	true,
		'frameWidth': 450,
		'frameHeight': 252,
		'hideOnContentClick': false
	});
	
	if($(".refblock_img").length > 0 ){
		$(".refblock_img a").fancybox({
			'overlayShow':	true
		});
	}
	

	/* save notes form */ 
	if($('#form_waterdicht').length > 0 ){
		$('#form_waterdicht').ajaxForm(function(response){
			if(response.indexOf('error') == -1){
				//this means the form is ok to send, so hide it or something
				
				$('#form_waterdicht').hide();
				$('#formholder').html(response);
			}
			$('#submit').show();
			$('#loader').hide();
			$('#fb_ins').html(response);
			$('#fb').show();
			return false; 
		});
	}
	


}); //ends doc.ready


function sc(pn){
	np=-1*(pn*552);
	$('.slides').stop().animate({left:np});
}

function sd(pn, id){
	np=-1*(pn*552);
	$('#'+id).stop().animate({left:np});
}



function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=650,height=600');");
}


