$(document).ready(function () {
	
	var link;
	$('#content a[@href^="http://"]').each(function(){
		link=$(this).html();
		$(this).html(link+'<span class="externallink">&nbsp;</span>');
		//console.log($(this).html());
	})
	
	$('#content a[@href$=".pdf"]').each(function(){
		link=$(this).html();
		$(this).html('<span class="pdflink">&nbsp;</span>'+link);
		//console.log($(this).html());
	})
	
	$('#content a[@href^="mailto:"]').each(function(){
		link=$(this).html();
		$(this).html('<span class="mailto"></span>'+link);
		//console.log($(this).html());
	})
	
	$('a:contains("Google Maps")').each(function(){
		$(this).parent().after('<div class="googlemap"><iframe width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+$(this).attr('href')+'"></iframe></div>');
		$(this).parent().hide();
	});
	
	$('a:contains("YouTube")').each(function(){
		$(this).parent().after('<div class="youtube"><object width="425" height="344"><param name="movie" value="'+$(this).attr('href')+'"></param><embed src="'+$(this).attr('href')+'" type="application/x-shockwave-flash" width="425" height="344"></embed></object></div>');
		$(this).parent().hide();
	});
	       	
	$('#adverteerders').cycle('fade');
	$('#sponsoren').cycle('fade');
	$('#hoofdsponsoren').cycle('fade');
	
	$('#headercontainer').cycle('fade');
		
	$('#menuul').accordion({
		header: '.ui-accordion-link',
		active: false,
		alwaysOpen: false, 
		autoHeight: false,
		navigation: true,
		event: 'mouseover'
    });
    
	$('#menuul ul').accordion({
		header: '.ui-accordion-link2',
		active: false,
		alwaysOpen: false, 
		autoHeight: false,
		navigation: true
	});
    
	$("#menu a").each(function(){
        var href = this.getAttribute('href',2);

        var location = new String( document.location );
        location = location.substr(0, href.length );

        if ( location == href) {
            $(this).addClass("active");
        }
	});
    
});



