$(window).load(function(){
	rondeRanden();
	$('#slider').css( 'visibility', 'visible' );
	$('#slider').css( 'height', '300px' );
	$('#slider_loader').css( 'display', 'none' );
	$('#slider').cycle({
		fx:     'fade',
		speed:  'slow',
		timeout: 5000,
		pager:  '#slider_nav',
		pagerAnchorBuilder: function(idx, slide) {
			// return sel string for existing anchor
			return '#slider_nav li:eq(' + (idx) + ') a';
		}
	});
});

function rondeRanden(){
	if ( hasBorderRadius() ) { //ondersteund de browser ronde randen?
		$( "img.roundedCorners" ).each( function() { //voor elke afbeelding met classe roundedCorners
			$( this ).wrap( '<div class="roundedCorners slider-item" />' ); //div rondplaatsen.
			var imgSrc = $( this ).attr( "src" );  //foto bron
			var imgHeight = $( this ).height(); 
			var imgWidth = $( this ).width(); 
			$( this ).parent() //de nieuwe aangemaakte div waarin de foto zich bevind.
				.css( "background-image", "url(" + imgSrc + ")" ) //achtergrond instellen
				.css( "background-repeat", "no-repeat" )
				.css( "height", imgHeight + "px" )
				.css( "width", imgWidth + "px" ); 
			$( this ).remove();  //oorsprongkelijk img element verwijderen.
		});
	}
}

function hasBorderRadius() {
	var d = document.createElement("div").style;
	if (typeof d.borderRadius !== "undefined") return true;
	if (typeof d.WebkitBorderRadius !== "undefined") return true;
	if (typeof d.MozBorderRadius !== "undefined") return true;
	return false;
};


//nieuwsbrief

$(document).ready( function(){
	/*var txt = document.getElementById('txtEmail');
	txt.onclick = function(){
		txt.value = '';
	}
	txt.onblur = function(){
		if( txt.value == '' ){
			txt.value = 'vul hier uw email adres in';
		}
	}*/

	$('#map').colorbox({iframe:true, width:"840px", height:"600px"});
});
