// form-value
	jQuery.fn.toggleVal = function(focusClass) {
		this.each(function() {
			$(this).focus(function() {
				// clear value if current value is the default
				if($(this).val() == this.defaultValue) { $(this).val(""); }
				
				// if focusClass is set, add the class
				if(focusClass) { $(this).addClass(focusClass); }
			}).blur(function() {
				// restore to the default value if current value is empty
				if($(this).val() == "") { $(this).val(this.defaultValue); }
				
				// if focusClass is set, remove class
				if(focusClass) { $(this).removeClass(focusClass); }
			});
		});
	}


$(document).ready(function(){

// png voor IE -------------------------------------------------------------------------------------------
		$('body').pngFix();

// mouse over img
		$('a img').hover(function(){
				$(this).css('opacity',.8);
		}, function(){
				$(this).css('opacity',1);
		});

// dotted linkline ---------------------------------------------------------------------------------------
		$('a').focus(function() {this.blur();});

// formval ------------------------------------------------------------------------------------------
		$('#zoek,#collectiezoek,#sitezoek').toggleVal();

// zoek ------------------------------------------------------------------------------------------
		$('input[type="text"]').addClass("idleField");
		$('input[type="text"]').focus(function() {
			$(this).removeClass("idleField").addClass("focusField");
		});
		$('input[type="text"]').blur(function() {
			$(this).removeClass("focusField").addClass("idleField");
		});

		$('#zoekbox #form_submit').hover(function(){
				$(this).css('opacity',.5);
		}, function(){
				$(this).css('opacity',1);
		});

		$('#collectiezoekbox .submit').hover(function(){
				$(this).css('opacity',.5);
		}, function(){
				$(this).css('opacity',1);
		});

$(".iframe").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'autoScale'     		: false,
		'width'			: 660	,
		'height'			: 450,
		'type'				: 'iframe',
		'scrolling'   		: 'no',
		'padding'   		         : 0,
		'margin'   		         : 0
	});

// zoek
		$('#zoek_btn').toggle(function(){
			$('#subnav').animate({ marginTop: "55px"}, "fast" );
			$('#zoek_btn').addClass('active');},function(){
			$('#subnav').animate({ marginTop: "15px"}, "fast" );
			$('#zoek_btn').removeClass('active');});

});

// zoek switch	
		$('#collectiewrap h4, #sitewrap h4,').css('cursor', 'pointer');
		$('#collectiewrap h4').live('click', function(){
			$('#collectiewrap').css({'z-index':100});
			$('#collectiewrap form').css({'visibility':'visible'});
			$('#collectiewrap h4').css({'background-color':'#DFF3F9'});
			$('#sitewrap').css({'z-index':99});
			$('#sitewrap form').css({'visibility':'hidden'});
			$('#sitewrap h4').css({'background-color':'#FFF'});
		});
		$('#sitewrap h4').live('click', function(){
			$('#collectiewrap').css({'z-index':99});
			$('#collectiewrap form').css({'visibility':'hidden'});
			$('#collectiewrap h4').css({'background-color':'#FFF'});
			$('#sitewrap').css({'z-index':100});
			$('#sitewrap form').css({'visibility':'visible'});
			$('#sitewrap h4').css({'background-color':'#DFF3F9'});
		});


