
//jQuery.fn.addEvent = jQuery.fn.bind;
	
$(function(){
	
	if ($.browser.msie && $.browser.version < 7)
		$('img[src$=.png]').pngfix();

	$('img[hover],input[hover]').imghover();
		
	$('input.reset-default').focus(function() {
        if(this.value == this.defaultValue) {
	        $(this).removeClass('reset-default');
	        this.value = '';
        }
    }).blur(function() {
        if($(this).attr('value').replace(/ +/, '') == '') {
	        $(this).addClass('reset-default');
            this.value = this.defaultValue;
        }
    }).parents('form').submit(function() {
        $('input.reset-default', this).attr('value', '');
    });

	// language choice
	$('#languageSwitch').change(function () {
		var loc = $("select option:selected").val();
		alert(loc);
		//location.href=loc
	});
	
	
	/* accordions */
	$(".accordion dt a").click(function () {
		var temp = this;
        if ( $(this).parent().next().is(":hidden") ) {			
			$(this).parent().next().slideDown("slow", function(){
				//$(temp).text("Sluit");
				$(temp).addClass('active'); 
			}); 
            return false;			
        } else {
			$(this).parent().next().slideUp("slow", function(){
				//$(temp).text("Meer info");
				$(temp).removeClass('active');
			});		
		    return false;
        }
    });	
	
				 
});




;(function($){

	$.fn.pngfix = function () {	
		if ($.browser.msie && $.browser.version < 7) {
			return this.each (function () {
				$(this).css({
					filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.src+"')"
				});
				this.src = 'images/blank.gif';
			});
		} else {
			return this;
		}
	};

	$.prefetch = function() {
		for(var i = 0; i<arguments.length; i++)  {
			$("<img>").attr("src", arguments[i]);
		}
	}

	$.fn.imghover = function () {
		return this.each (function () {
			$(this).data('__img__original', this.src);
			$.prefetch($(this).attr('hover'));
		}).hover(function(){
			this.src = $(this).attr('hover');
		},function(){
			this.src = $(this).data('__img__original');
		});
	};
	
	
	
})(jQuery);

