// Cufon
	Cufon.replace('.box_medium h1', { hover: true,  fontFamily: 'Futura LtCn BT' });
	Cufon.replace('.box_medium_rechts h1', { fontFamily: 'Futura LtCn BT' });
	Cufon.replace('.rechts h1', { fontFamily: 'Futura LtCn BT' });
	Cufon.replace('.box_medium_rechts h3', { fontFamily: 'Futura LtCn BT' });
	Cufon.replace('#reactie_paneel h2', { fontFamily: 'Futura LtCn BT' });
	Cufon.replace('.artikel_heading h1 a', { hover: true, fontFamily: 'Futura LtCn BT' });
	Cufon.replace('.artikel_top h1 a', { hover: true, fontFamily: 'Futura LtCn BT' });
	Cufon.replace('.artikel_wrapper h1', { fontFamily: 'Futura LtCn BT' });
	Cufon.replace('.artikel_wrapper h2', { fontFamily: 'Futura LtCn BT' });
	Cufon.replace('.artikel_wrapper h3', { fontFamily: 'Futura LtCn BT' });
	Cufon.replace('.artikel_wrapper h4', { fontFamily: 'Futura LtCn BT' });
	Cufon.replace('.artikel_wrapper h5', { fontFamily: 'Futura LtCn BT' });
	Cufon.replace('.artikel_wrapper h6', { fontFamily: 'Futura LtCn BT' });
	Cufon.replace('h1', { hover: true, fontFamily: 'Futura LtCn BT'	});
	Cufon.replace('.poll h2', {	hover: true, fontFamily: 'Futura LtCn BT' });
	Cufon.replace('#logo h2', { fontFamily: 'Myriad Pro' });
	

// Eind Cufon

// Eind Reactie paneel
animatedcollapse.addDiv( 'reactie_paneel', 'fade=0, speed=400, persist=1, hide=1' )
animatedcollapse.ontoggle=function($, divobj, state){}
animatedcollapse.init()
// Eind Reactie paneel

// Colorbox
			$(document).ready(function(){
				//Examples of how to assign the ColorBox event to elements
				$("a[rel='example1']").colorbox();
				$(".doorsturen").colorbox({iframe:true, scrolling:false, width:"460px", height:"540px"});
			});
// Eind Colorbox

// Tab
(function($){ 
     $.fn.extend({  
         tabify: function() {
			function getHref(el){
				hash = $(el).find('a').attr('href');
				if(hash)
					return hash.substring(0,hash.length-4);
				else
					return false;
				}
		 	function setActive(el){
				$(el).addClass('active');
				if(getHref(el))
					$(getHref(el)).show();
				else
					return false;
				$(el).siblings('li').each(function(){
					$(this).removeClass('active');
					$(getHref(this)).hide();
				});
			}
			return this.each(function() {
				var self = this;
				
				$(this).find('li>a').each(function(){
					$(this).attr('href',$(this).attr('href') + '-tab');
				});
				
				function handleHash(){
					if(location.hash)
						setActive($(self).find('a[href=' + location.hash + ']').parent());
				}
				if(location.hash)
					handleHash();
				setInterval(handleHash,100);
				$(this).find('li').each(function(){
					if($(this).hasClass('active'))
						$(getHref(this)).show();
					else
						$(getHref(this)).hide();
				});
            }); 
        } 
    }); 
})(jQuery);

// <![CDATA[
	$(document).ready(function () {
	$('#tab_poll').tabify();  });
// ]]>
// Eind Tab

// Header Menu core
var headermenu={

arrowimages: {down:['downarrowclass', '/images/pijl_beneden.gif', 19], right:['rightarrowclass', '/images/pijl_rechts.gif', 19]},

transition: {overtime:0, outtime:50},
shadow: {enable:false, offsetx:1, offsety:1},

detectwebkit: navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1,
detectie6: document.all && !window.XMLHttpRequest,

getajaxmenu:function($, setting){
	var $menucontainer=$('#'+setting.contentsource[0])
	$menucontainer.html("Menu laden...")
	$.ajax({
		url: setting.contentsource[1],
		async: true,
		error:function(ajaxrequest){
			$menucontainer.html('Error fetching content. Server Response: '+ajaxrequest.responseText)
		},
		success:function(content){
			$menucontainer.html(content)
			headermenu.buildmenu($, setting)
		}
	})
},

buildmenu:function($, setting){
	var smoothmenu=headermenu
	var $mainmenu=$("#"+setting.mainmenuid+">ul")
	$mainmenu.parent().get(0).className=setting.classname || "headermenu"
	var $headers=$mainmenu.find("ul").parent()
	$headers.hover(
		function(e){
			$(this).children('a:eq(0)').addClass('selected')
		},
		function(e){
			$(this).children('a:eq(0)').removeClass('selected')
		}
	)
	$headers.each(function(i){ 
		var $curobj=$(this).css({zIndex: 200-i})
		var $subul=$(this).find('ul:eq(0)').css({display:'block'})
		this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
		this.istopheader=$curobj.parents("ul").length==1? true : false 
		$subul.css({top:this.istopheader && setting.orientation!='v'? this._dimensions.h+"px" : 0})
		$curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: smoothmenu.arrowimages.down[2]} : {}).append(
			'<img src="'+ (this.istopheader && setting.orientation!='v'? smoothmenu.arrowimages.down[1] : smoothmenu.arrowimages.right[1])
			+'" class="' + (this.istopheader && setting.orientation!='v'? smoothmenu.arrowimages.down[0] : smoothmenu.arrowimages.right[0])
			+ '" style="border:0;" />'
		)
		if (smoothmenu.shadow.enable){
			this._shadowoffset={x:(this.istopheader?$subul.offset().left+smoothmenu.shadow.offsetx : this._dimensions.w), y:(this.istopheader? $subul.offset().top+smoothmenu.shadow.offsety : $curobj.position().top)}
			if (this.istopheader)
				$parentshadow=$(document.body)
			else{
				var $parentLi=$curobj.parents("li:eq(0)")
				$parentshadow=$parentLi.get(0).$shadow
			}
			this.$shadow=$('<div class="ddshadow'+(this.istopheader? ' toplevelshadow' : '')+'"></div>').prependTo($parentshadow).css({left:this._shadowoffset.x+'px', top:this._shadowoffset.y+'px'})
		}
		$curobj.hover(
			function(e){
				var $targetul=$(this).children("ul:eq(0)")
				this._offsets={left:$(this).offset().left, top:$(this).offset().top}
				var menuleft=this.istopheader && setting.orientation!='v'? 0 : this._dimensions.w
				menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader && setting.orientation!='v'? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
				if ($targetul.queue().length<=1){ 
					$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).animate({height:'show',opacity:'show'}, headermenu.transition.overtime)
					if (smoothmenu.shadow.enable){
						var shadowleft=this.istopheader? $targetul.offset().left+headermenu.shadow.offsetx : menuleft
						var shadowtop=this.istopheader?$targetul.offset().top+smoothmenu.shadow.offsety : this._shadowoffset.y
						if (!this.istopheader && headermenu.detectwebkit){
							this.$shadow.css({opacity:1})
						}
						this.$shadow.css({overflow:'', width:this._dimensions.subulw+'px', left:shadowleft+'px', top:shadowtop+'px'}).animate({height:this._dimensions.subulh+'px'}, headermenu.transition.overtime)
					}
				}
			},
			function(e){
				var $targetul=$(this).children("ul:eq(0)")
				$targetul.animate({height:'hide', opacity:'hide'}, headermenu.transition.outtime)
				if (smoothmenu.shadow.enable){
					if (headermenu.detectwebkit){
						this.$shadow.children('div:eq(0)').css({opacity:0})
					}
					this.$shadow.css({overflow:'hidden'}).animate({height:0}, headermenu.transition.outtime)
				}
			}
		)
	})
	$mainmenu.find("ul").css({display:'none', visibility:'visible'})
},

init:function(setting){
	if (typeof setting.customtheme=="object" && setting.customtheme.length==2){ //override default menu colors (default/hover) with custom set?
		var mainmenuid='#'+setting.mainmenuid
		var mainselector=(setting.orientation=="v")? mainmenuid : mainmenuid+', '+mainmenuid
		document.write('<style type="text/css">\n'
			+mainselector+' ul li a {background:'+setting.customtheme[0]+';}\n'
			+mainmenuid+' ul li a:hover {background:'+setting.customtheme[1]+';}\n'
		+'</style>')
	}
	this.shadow.enable=(document.all && !window.XMLHttpRequest)? false : this.shadow.enable //in IE6, always disable shadow
	jQuery(document).ready(function($){ //ajax menu?
		if (typeof setting.contentsource=="object"){ //if external ajax menu
			headermenu.getajaxmenu($, setting)
		}
		else{ //else if markup menu
			headermenu.buildmenu($, setting)
		}
	})
}

} //end headermenu variable

//Initialize Menu instance(s):

// Eind Header Menu core

// Zoekbox
$(document).ready(function(){
	//global vars
	var searchBoxes = $(".text");
	var searchBox2 = $("#zoek_box");
	var searchBox2Default = "Zoek op trefwoord";

	searchBoxes.focus(function(e){
		$(this).addClass("active");
	});
	searchBoxes.blur(function(e){
		$(this).removeClass("active");
	});
	
	searchBox2.focus(function(){
		if($(this).attr("value") == searchBox2Default) $(this).attr("value", "");
	});
	searchBox2.blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", searchBox2Default);
	});
	// nep captcha
	$('#controle').watermark(' beauty');
	//
});
// Eind Zoekbox

// Header Menu
headermenu.init({
	mainmenuid: "header_menu", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'headermenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
// Eind Header Menu


