// WINDOW.ONLOAD WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
window.onload = function(){
	clearTimeout(t);
	externalLinks();
	//IE6 check 66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
	if(navigator.appVersion=="4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"){
		loc = location.href;
		aloc= loc.split('?actie=');
		if(aloc[1]!='verdermetoudebrowser') {
			imagepath = 'browserwarning/images/';
			huidig = document.body.innerHTML;
			document.body.innerHTML='&nbsp;';
			container = "<div style='position:absolute;top:0;left:0;height:100%;width:100%;background:#000;opacity: 0.8;filter: alpha(opacity = 80);'></div>";
			wrapperopen = '<div style="position:relative;width:748px;height:220px;top:30%;margin:0 auto;border:1px dashed #999;background-color:#efefef;">';
			left = '<div style="float:left;width:220px;height:220px;padding:20px;border-right:1px dashed #999"><img src="'+imagepath+'icon-warning.gif" alt="Waarschuwing" style="margin-left:58px; margin-top: -7px;" /><br /><br /><p style="color:#000; font:11px Verdana, Arial; margin-top: -5px;">U probeert deze website te openen. Helaas maakt u gebruik van een verouderde internetbrowser.</p><p style="color:#000; font:11px Verdana, Arial; margin-bottom: 0;">Wij adviseren u deze browser te updaten, zodat u weer veilig alle websites kunt openen. Maak hier rechts een keuze om de update van uw gewenste browser te downloaden.</p></div>';
			middenContainer = '<div style="float:left;width:313px;height:200px;padding:20px;">';
			browser1 = '<div style="float:left;width:150px;height:90px;margin-top: 5px;margin-left:8px;margin-bottom:10px;text-align:center;"><a href="http://www.microsoft.com/windows/Internet-explorer/default.aspx" onclick="target=\'_blank\'" titel="Download Internet Explorer"><img src="'+imagepath+'icon-internet-explorer.gif" alt="Internet Explorer" width="87" height="74" style="display:block;" border="0" /></a><p style="font:11px Verdana, Arial;margin:0;"><a href="http://www.microsoft.com/windows/Internet-explorer/default.aspx" onclick="target=\'_blank\'" titel="Download Internet Explorer" style="color:#444;">Internet Explorer</a></p></div>';
			browser2 = '<div style="float:left;width:120px;height:90px;margin-top: 5px;margin-bottom:10px;text-align:center;"><a href="http://www.mozilla.com/firefox/" onclick="target=\'_blank\'" titel="Download Mozilla Firefox"><img src="'+imagepath+'icon-mozilla-firefox.gif" border="0" alt="Mozilla Firefox" width="87" height="74" style="display: block;" /></a><p style="font:11px Verdana, Arial;margin:0;"><a href="http://www.mozilla.com/firefox/" onclick="target=\'_blank\'" titel="Download Mozilla Firefox" style="color:#444;">Mozilla Firefox</a></p></div>';
			browser3 = '<div style="float:left;width:150px;height:90px;margin-left:8px;text-align:center;"><a href="http://www.google.com/chrome" onclick="target=\'_blank\'" titel="Download Google Chrome"><img src="'+imagepath+'icon-google-chrome.gif" alt="Google Chrome" border="0" width="87" height="74" style="display: block;" /></a><p style="color:#000;font:11px Verdana, Arial;margin:0;"><a href="http://www.google.com/chrome" onclick="target=\'_blank\'" titel="Download Google Chrome"  style="color:#444;">Google Chrome</a></p></div>';
			browser4 = '<div style="float:left;width:120px;height:90px;text-align:center;"><a href="http://www.apple.com/safari/" onclick="target=\'_blank\'" titel="Download Safari"><img src="'+imagepath+'icon-safari.gif" alt="Safari" width="87" height="74" border="0" style="display: block;" /></a><p style="font:11px Verdana, Arial;margin:0;"><a href="http://www.apple.com/safari/" onclick="target=\'_blank\'" titel="Download Safari" style="color:#444;">Safari</a></p></div>';
			middenContainerdicht = '</div>';
			rechts = '<div style="float:left;width:94px;height:220px;padding:20px;background: url(browserwarning/images/bg-continue.jpg);"><p style="color:#fff; font:11px Verdana, Arial;padding-top: 50px;text-align:center;">Site bezoeken met uw oude browser.</p><a onclick="location.href=location.href+\'?actie=verdermetoudebrowser\';" style="cursor:pointer"><img src="'+imagepath+'icon-continue.jpg" alt="Ga verder met oude browser" style="margin-left: 17px;" /></a></div>';
			wrapperdicht = '</div>';
			document.body.innerHTML=container+wrapperopen+left+middenContainer+browser1+browser2+browser3+browser4+middenContainerdicht+rechts+wrapperdicht;
		}
	}
	// EINDE IE 6 check 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666

	// Images fancybox
	$("a[rel=/]").fancybox({
			'transitionIn':'none',
			'transitionOut':'none',
			'titlePosition':'over',
			'titleFormat': function(title, currentArray, currentIndex, currentOpts) {
				 return '<div id="fancybox-title-over">Afbeelding ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</div>';
			}
	  });
	// Youtube fancybox - POS 3 en 5
	$("a.inline").fancybox({
		'type':'iframe',
		'autoScale':'auto',
		'hideOnContentClick': false
	});

	// Youtube fancybox - POS 1
	$("a.inline_klein").fancybox({
		'type':'iframe',
		'autoScale':'auto',
		'hideOnContentClick': false
	});
	
	// Youtube fancybox - YOUTUBE pagina
	$("a.inline_klein_y").fancybox({
		'type':'iframe',
		'autoScale':'auto',
		'hideOnContentClick': false
	});
	// Youtube fancybox - YOUTUBE pagina
	$("a.inline_link").fancybox({
		'type':'iframe',
		'autoScale':'auto',
		'hideOnContentClick': false
	});


	// flash 400 en medispa fancybox
	$("a.flash_groot").fancybox({
		'overlayOpacity':'0.7',
		'hideOnContentClick': false
	});

	// Ageing fancybox
	$("a.ageing_face").fancybox({
		'width':800,
		'height':485,
		'type':'iframe',
		'overlayOpacity':'0.7',
		'autoScale':false
		//'hideOnContentClick': false
	});
// hoogte bepalen van #container(- totaal(padding-bottom & padding-top) van #content_back_lr)
// en #content_back_lr even hoog maken ivm footer en achtergrond-verloop

	// var ch = $("#container").height()-107;
	var ch = $("#container").height()-107;
	$('#content_back_lr').height(ch);

	// hoogte submenu contact
	var hh = $("#sub_ul_c").height();
	$('#afb_lc,#afb_rc').height(hh-6);
	$('#sub_contact').height(hh+8);

	// hoogte submenu kliniek
	var kh = $("#sub_ul").height();
	$('#afb_l,#afb_r').height(kh-6);
	$('#sub_kliniek').height(kh+8);

	// hoogte submenu behandelingen
	var bh = $("#sub_ul_b").height();
	$('#afb_lb,#afb_rb').height(bh-6);
	$('#sub_behandelingen').height(bh+8);

	// hoogte submenu medische specialisten (medspec)
	var hh = $("#sub_ul_m").height();
	$('#afb_lm,#afb_rm').height(hh-6);
	$('#sub_medspec').height(hh+8);

	// hoogte submenu medische specialisten (medspec)
	var hh = $("#sub_ul_k").height();
	$('#afb_lk,#afb_rk').height(hh-6);
	$('#sub_kliniek').height(hh+8);

	// hoogte submenu vestigingen
	var vh = $("#sub_ul_v").height();
	$('#afb_lv,#afb_rv').height(vh-6);
	$('#sub_vestigingen').height(vh+8);

	// ALLE GOOGLEMAPS
	if(document.getElementById('map')){
			load();
	}

	// HOOFDMENU-dropdown padding-top -------------------
	/* de kliniek
	$('#sub_kliniek').css({'padding-top': '10px'});
	$('#sub_ul').css({'padding-top': '5px'});
	// behandelingen
	$('#sub_behandelingen').css({'padding-top': '10px'});
	$('#sub_ul_b').css({'padding-top': '5px'});
		// contact
	$('#sub_contact').css({'padding-top': '10px'});
	$('#sub_ul_c').css({'padding-top': '5px'});
	// medische specialisten
	$('#sub_medspec').css({'padding-top': '10px'});
	$('#sub_ul_m').css({'padding-top': '5px'});
	// EINDE HOOFDMENU-dropdown padding-top -------------
	//indien er een id="nieuws" de random_nieuws in gang zeten
	if(document.getElementById("nieuws")){
		setTimeout("random_nr()", 5000);
	}

	*/
	// bedankmeldingen highlights formulieren bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
	//informatie_aanvraag
	if( document.getElementById('ia_bedankt') ) {
		//alert('ia bestaat');
		$('p#ia_bedankt').highlightFade({start:'#ff7777',speed:1500,iterator:'lineair'});
	}
	//beauty bon
	if( document.getElementById('bb_bedankt') ) {
		$('p#bb_bedankt').highlightFade({start:'#ff7777',speed:1500,iterator:'lineair'});
	}
	//injectables
	if( document.getElementById('inject_bedankt') ) {
		$('p#inject_bedankt').highlightFade({start:'#ff7777',speed:1500,iterator:'lineair'});
	}
	//info bijeenkomsten
	if( document.getElementById('ib_bedankt') ) {
		$('p#ib_bedankt').highlightFade({start:'#ff7777',speed:1500,iterator:'lineair'});
	}
	// contact lease plan
	if( document.getElementById('clp_bedankt') ) {
		$('p#clp_bedankt').highlightFade({start:'#ff7777',speed:1500,iterator:'lineair'});
	}
	// contact borst (sleutelgat methode)
	if( document.getElementById('borst_bedankt') ) {
		$('p#borst_bedankt').highlightFade({start:'#ff7777',speed:1500,iterator:'lineair'});
	}
	// inschrijving bijenkorf
	if( document.getElementById('bij_bedankt') ) {
		$('p#bij_bedankt').highlightFade({start:'#ff7777',speed:1500,iterator:'lineair'});
	}
	// aanmelden nieuwsbrief
	if( document.getElementById('nb_bedankt') ) {
		$('p#nb_bedankt').highlightFade({start:'#ff7777',speed:1500,iterator:'lineair'});
	}
	if( document.getElementById('gastenboek_bedankt') ) {
		$('p#gastenboek_bedankt').highlightFade({start:'#ff7777',speed:1000,iterator:'lineair'});
	}

	// Einde bedankmeldingen highlights formulieren bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
	
	// telefoon op zijn plek
	if( document.getElementById('bel') ) {
		var beltop = document.getElementById('bel').offsetParent.offsetTop+document.getElementById('bel').offsetTop;
		document.getElementById('telefoon_afb').style.top = (beltop-16)+'px';
		document.getElementById('telefoon_afb').style.visibility='visible';
	}

	// disable autocomplete inputvelden //////////////////////////////////////////////////////////////////////////
	for(var i = 0, l = document.getElementsByTagName('input').length; i < l; i++) {
			if(document.getElementsByTagName('input').item(i).type == 'text') {
				document.getElementsByTagName('input').item(i).setAttribute('autocomplete', 'off');
			}
	}
	//////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
// EINDE WINDOW.ONLOAD WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW


// on resize
$(window).bind('resize', function() {
	var ch = $("#container").height()-107;
	$('#content_back_lr').height(ch);
});

/* Beautybon - terugbelformulier & inschrijfformulier bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb */
var t=0;
var i=0;
//IE 8 heeft een bug bij openklappen divs (margin-bottom wordt niet correct weergegeven)

function radio_footer_t(){
	var ch = $("#container").height()-107;
	//terugbelformulier
	if(document.getElementById('terugbel').style.display=='none'){
		document.getElementById('terugbel').style.display='block';
		document.getElementById('inschrij').style.display='none';
		//document.getElementById('naam').focus();
		var extra=0;
		if(t==0 && i==0){ extra=140; }
		if(t==0 && i!=0 || t!=0 && i!=0){ extra=140-360; }
		$('#content_back_lr').height(ch+extra);//footer positioneren
		t++;
	}
}

function radio_footer_i(){
	var ch = $("#container").height()-107;
	//inschrijfformulier
	if(document.getElementById('inschrij').style.display=='none'){
		document.getElementById('inschrij').style.display='block';
		document.getElementById('terugbel').style.display='none';
		//document.getElementById('afzender').focus();
		var extra=0;
		if(i==0 && t==0){ extra=360; }
		if(i==0 && t!=0 || i!=0 && t!=0){ extra=360-140; }
		$('#content_back_lr').height(ch+extra);//footer positioneren
		i++;
	}
}

/*Example message arrays for the two demo scrollers*/


/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

/* Einde Beautybon - terugbelformulier & inschrijfformulier bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb */
