$(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();
	});
	
	if($("#ref_missie-visie").length >0){
		$('#frame').css("background-position","20% -10%");
		$('#missie_hover').attr('src','uploads/i/missie_hover.gif');
     }
     
	if($("#ref_millaa").length >0){
		$('#frame').css("background-position","-20% 20%");
		$('#millaa_hover').attr('src','uploads/i/millaa_hover.gif');
     }
	
	if($("#ref_nieuws").length >0){
		$('#frame').css("background-position","-30% 60%");
		$('#nieuws_hover').attr('src','uploads/i/nieuws_hover.gif');
	}
	
	if($("#ref_training").length >0){
		$('#frame').css("background-position","-20% 20%");
		$('#training_hover').attr('src','uploads/i/training_hover.gif');
     }

	if($("#ref_coaching").length >0){
		$('#frame').css("background-position","10% -12%");
		$('#coaching_hover').attr('src','uploads/i/coaching_hover.gif');
     }
     
	if($("#ref_therapie").length >0){
		$('#frame').css("background-position","-30% 60%");
		$('#therapie_hover').attr('src','uploads/i/therapie_hover.gif');
     }

	if($("#ref_contact").length >0){
		$('#frame').css("background-position","10% -12%");
		$('#contact_hover').attr('src','uploads/i/contact_hover.gif');
     }
     
	if($("#ref_links").length >0){
		$('#frame').css("background-position","-20% 10%");
		$('#links_hover').attr('src','uploads/i/links_hover.gif');
     }
     
     $('#welkomblaadje').hover(function(){
     	$(this).attr('src','uploads/i/welkomblaadje.gif');
     }, function() {
     	$(this).attr('src','uploads/i/button.gif');
     });
     
     $('#homecontact').attr('src','uploads/i/button.gif');
     $('#homenieuws').attr('src','uploads/i/button.gif');
     
     $('#homecontact').hover(function(){
     	$(this).attr('src','uploads/i/contactblaadje.jpg');
     }, function() {
     	$(this).attr('src','uploads/i/button.gif');
     });
     
     $('#homemillaa').hover(function(){
     	$(this).attr('src','uploads/i/millaablaadje.gif');
     }, function() {
     	$(this).attr('src','uploads/i/button.gif');
     });     
     
     $('#hometraining').hover(function(){
     	$(this).attr('src','uploads/i/trainingblaadje.gif');
     }, function() {
     	$(this).attr('src','uploads/i/button.gif');
     });    
     
     $('#homemissie').hover(function(){
     	$(this).attr('src','uploads/i/missieblaadje.gif');
     }, function() {
     	$(this).attr('src','uploads/i/button.gif');
     });     

     $('#hometherapie').hover(function(){
     	$(this).attr('src','uploads/i/therapieblaadje.gif');
     }, function() {
     	$(this).attr('src','uploads/i/button.gif');
     });
     
     $('#homecoaching').hover(function(){
     	$(this).attr('src','uploads/i/coachingblaadje.gif');
     }, function() {
     	$(this).attr('src','uploads/i/button.gif');
     });
     
     
     $('#homenieuws').hover(function(){
     	$(this).attr('src','uploads/i/nieuwsblaadje.jpg');
     }, function() {
     	$(this).attr('src','uploads/i/button.gif');
     });
     
     $('#homelinks').hover(function(){
     	$(this).attr('src','uploads/i/linksblaadje.gif');
     }, function() {
     	$(this).attr('src','uploads/i/button.gif');
     });
     
     
     
     
     
     
     
     
     $('#home_hover').hover(function(){
     	$(this).attr('src','uploads/i/home_hover.gif');
     }, function() {
		if($("#ref_home").length==0){
     		$(this).attr('src','uploads/i/button.gif');
     	}
     });
     
     $('#missie_hover').hover(function(){
     	$(this).attr('src','uploads/i/missie_hover.gif');
     }, function() {
		if($("#ref_missie").length==0){
     		$(this).attr('src','uploads/i/button.gif');
     	}
     });
     
     $('#millaa_hover').hover(function(){
     	$(this).attr('src','uploads/i/millaa_hover.gif');
     }, function() {
		if($("#ref_millaa").length==0){
     		$(this).attr('src','uploads/i/button.gif');
     	}
     });
     
     $('#nieuws_hover').hover(function(){
     	$(this).attr('src','uploads/i/nieuws_hover.gif');
     }, function() {
		if($("#ref_nieuws").length ==0){
     		$(this).attr('src','uploads/i/button.gif');
     	}
     });
     
     $('#training_hover').hover(function(){
     	$(this).attr('src','uploads/i/training_hover.gif');
     }, function() {
		if($("#ref_training").length==0){
     		$(this).attr('src','uploads/i/button.gif');
     	}
     });
     
     $('#coaching_hover').hover(function(){
     	$(this).attr('src','uploads/i/coaching_hover.gif');
     }, function() {
		if($("#ref_coaching").length==0){
     		$(this).attr('src','uploads/i/button.gif');
     	}
     });
     
     $('#therapie_hover').hover(function(){
     	$(this).attr('src','uploads/i/therapie_hover.gif');
     }, function() {
		if($("#ref_therapie").length==0){
     		$(this).attr('src','uploads/i/button.gif');
     	}
     });
     
     $('#contact_hover').hover(function(){
     	$(this).attr('src','uploads/i/contact_hover.gif');
     }, function() {
		if($("#ref_contact").length ==0){
     		$(this).attr('src','uploads/i/button.gif');
     	}
     });
    
    $('#links_hover').hover(function(){
     	$(this).attr('src','uploads/i/links_hover.gif');
     }, function() {
		if($("#ref_links").length==0){
     		$(this).attr('src','uploads/i/button.gif');
     	}
     });

});
