$(function() {
	/**
	 * IE check
	 */
	if ($.browser.msie)
	{
		$('html').addClass('ie');
	
		if($.browser.version.substr(0,1)<7) {
	        $("div#top").before('<div id="IE6check"><span class="close"><img src="public/templates/frontend/img/icons/cross-ie6.gif" width="16" height="16" alt="Sluiten" /></span>U gebruikt momenteel Internet Explorer 6. Wij raden u aan zo spoedig mogelijk de broser te upgraden naar een moderne browser omdat wij de functionaliteit in uw verouderde browser niet kunnen garanderen. Download <a href="http://www.getfirefox" target="_blank">Firefox &raquo;</a> of de laatste versie van <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx" target="_blank">Internet Explorer &raquo;</a>.</div>');
	        $("div#IE6check").click(function () { 
	            $(this).slideUp('slow'); 
	        });
		}
	}
	
	/**
     * INLINE labels in form 
     */
    $('input[title]').each(function() {
        var $this = $(this);
        
        if($this.val() === '')
            $this.val($this.attr('title')).addClass('inactive');    
        
        $this.focus(function() {
            if($this.val() == $this.attr('title'))
                $this.val('').removeClass('inactive');  
        });
        
        $this.blur(function() {
            if($this.val() === '')
                $this.val($this.attr('title')).addClass('inactive');    
        });
        
        $this.trigger('labelready');
    });
	
	/**
	 * ANTI-SPAM
	 */
	$('.emailReplacement')
		.html(AppConfig['email'])
		.bind( 'click', function(){
			window.location.href = "mailto:"+AppConfig['email'];
		});

	/**
	 * Lees meer... linkje in content pagina's
	 */
	$('#extraButton').bind ( 'click', function () {
		$('#extraContent').slideToggle();
	})

	/**
	 * Messages weergeven
	 *   trekt aandacht door animatie
	 */
	$('.msg').slideDown();
	
	
	/**
	 *	FancyBox voor afbeeldingen
	 **/
	if ( typeof($.fn.fancybox) != 'undefined' )
		$('a.fancybox:has(> img)').fancybox( { overlayColor: '#333' } );
	
	/**
	 *	FancyBox voor links
	 **/
	if ( typeof($.fn.fancybox) != 'undefined' )
		$('a.fancybox').fancybox( { 
			type: 'iframe', 
			overlayColor: '#333', 
			width: 630, 
			autoDimensions: false
		} );

});
