$(document).ready(function(){
	jQuery(function(){jQuery(document).pngFix();});

	$("a.zoom").fancybox();
	
	$("a[rel=fotogroep]").fancybox({
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over"><span style="float:right">Afbeelding ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>' + (title && title.length ? title : '&nbsp;' ) + '</span>';
		}
	});

	$("div.fadehover").hover(
		function() {
			$(this).find("img.a").stop().animate({"opacity": "0"}, {duration:100, queue:false});
			if($(this).find("img.a").attr("name") =='rb')
			{
				$('#rb a').animate({
					right: '10',
					top: '110',
					backgroundColor: "#4e82c2"
				}, {duration:100, queue:false});
			}
			if($(this).find("img.a").attr("name") =='lb')
			{
				$('#lb a').animate({
					left: '10',
					top: '110',
					backgroundColor: "#4e82c2"
				}, {duration:100, queue:false});
			}
			if($(this).find("img.a").attr("name") =='lt')
			{
				$('#lt a').animate({
					left: '10',
					top: '10',
					backgroundColor: "#4e82c2"
				}, {duration:100, queue:false});
			}
			if($(this).find("img.a").attr("name") =='rt')
			{
				$('#rt a').animate({
					right: '10',
					top: '10',
					backgroundColor: "#4e82c2"
				}, {duration:100, queue:false});
			}
		},
		function() {
			$(this).find("img.a").stop().animate({"opacity": "1"}, {duration:100, queue:false});
			if($(this).find("img.a").attr("name") =='rb')
			{
				$('#rb a').animate({
			    right: '0',
				top: '120',
				backgroundColor: "#3a3a3a"
				}, {duration:100, queue:false});
			}
			if($(this).find("img.a").attr("name") =='lb')
			{
				$('#lb a').animate({
			    left: '0',
				top: '120',
				backgroundColor: "#3a3a3a"
				}, {duration:100, queue:false});
			}
			if($(this).find("img.a").attr("name") =='lt')
			{
				$('#lt a').animate({
			    left: '0',
				top: '0',
				backgroundColor: "#3a3a3a"
				}, {duration:100, queue:false});
			}
			if($(this).find("img.a").attr("name") =='rt')
			{
				$('#rt a').animate({
			    right: '0',
				top: '0',
				backgroundColor: "#3a3a3a"
				}, {duration:100, queue:false});
			}
		}
	);
});

function clearText(thefield){
	if (thefield.defaultValue==thefield.value)
	thefield.value = ""
} 

//$('jp-mute').click();
function StilEs(){
days=30; // number of days to keep the cookie
myDate = new Date();
myDate.setTime(myDate.getTime()+(days*24*60*60*1000));
document.cookie = 'stil=1; expires=' + myDate.toGMTString() + 'domain= http://www.jouwnotaris.nl; path=/;';
}

function deletecookie() {
var expdate = new Date();
expdate.setTime(expdate.getTime() - 1);
document.cookie = "stil=0; expires=" + expdate.toGMTString() + 'domain= http://www.jouwnotaris.nl; path=/;';
}

Cufon.replace('#menu ul li a', { color: '#FFF'}); 
Cufon.replace('a.homea'); 
Cufon.replace('h1', { color: '#4E82C2'}); 
Cufon.replace('h2', { color: '#4E82C2'}); 
Cufon.replace('p.cuf', { color: '#4E82C2'})
Cufon.replace('p.mensen', { color: '#FFF'}); 
Cufon.replace('p.cuf span', { color: '#989898'});

