$(document).ready(function () {
							
	$("a[rel^='video']").prettyPhoto({animationSpeed:'fast',slideshow:10000});
	
	// PJ: Open link in new window to avoid target="_blank" which causes invalid xhtml strict
	$(function(){    
		$('a.new-window').click(function() 
		{
			if (this.href!="#")
				window.open(this.href);        
	   		return false;    
	   	});
	});

							
	jQuery('.link-terugbellen').click(function(){
	
		
		
		var w = jQuery(window).width();
		var h = jQuery(document).height();
		jQuery('.overlay').css('width', w).css('height', h).show();
		var l_w = jQuery('.custom-lightbox2').width();	
		
		var w_p = parseInt((w/2)-240);
		jQuery('#custom-lightbox2').css('left', w_p);
		jQuery('#custom-lightbox2 .lightbox-wrapper').html(jQuery('.custom-lightbox2').html());
		jQuery('#custom-lightbox2').fadeIn(300);
		Cufon.replace('#custom-lightbox H2');
		
		//initPlayer('wp-content/themes/xclusive/public',jQuery(this).attr('rel'),'video');
		
		jQuery('.overlay').click(function(){	
			jQuery('.overlay').hide();
			jQuery('#custom-lightbox2').hide();
			resuming();
			//slideshowTimer = setTimeout('SlideShowGo();', 5000);
		});
		
		jQuery('.close-lightbox').click(function(){	
			jQuery('.overlay').hide();
			jQuery('#custom-lightbox2').hide();
			//slideshowTimer = setTimeout('SlideShowGo();', 5000);
		});
		
	});


							
	jQuery('UL.gallery').cycle({ 
        fx:     'fade',         
        speed: 1000,
        timeout: 7000, 
       cleartypeNoBg:  true,

        pager:  '#cyclepag' 

    });
	
	$("a.thumb").live("click", function(e)
	{
		e.preventDefault();
		var full_pic= this.rel;
		$("#gallery-photo").attr("src", this.href).fadeIn("slow", function()
		{   // ook de href veranderen, zodat de juiste foto opent in de lightbox popup
			$("#full-photo").attr("href", full_pic);
		});
	});
							
	Cufon.replace('H1')('H2')('H3')('LABEL')('.jquery-selectbox')('.btn')('.livechat A')
	('#primary-navigation LI A')('#content #nav-bar UL LI A')('#content .sidebar-btn')('#content ul.pagination li a');

	$('.scroll').cycle({ 
		fx:      'scrollDown', 
		speed:    1000, 
		timeout:  5000 
	});
	
	$('.field').focus(function() {
	  if(this.value == this.title) 
		this.value = '';
	});
	$('.field').blur(function() {						  
	  if(this.value == '')
		this.value = this.title; 
	});	
	
});	








