	var clkone = 1;
	function Browser() {
	var ua,s,i;this.isIE=false;this.isNS=false;this.version=null;
	  ua = navigator.userAgent;
	  s="MSIE";
	  if((i=ua.indexOf(s))>=0){
		this.isIE=true;
	    this.version=parseFloat(ua.substr(i + s.length));
		return;
	  }
          s="Netscape6/";
	  if((i=ua.indexOf(s))>=0){
		this.isNS=true;
		this.version=parseFloat(ua.substr(i+s.length));
	    return;
	  }
	  s="Gecko";
	  if((i=ua.indexOf(s))>=0){
		this.isNS=true;
		this.version=6.1;
	    return;
	  }
        }
	var browser=new Browser();

	function showmenu(elmnt)
	{
	  if (document.all(elmnt) != null) {
	    document.all(elmnt).style.visibility="visible";
	  }
	}
	function hiddenmenu(elmnt)
	{
	  if (document.all(elmnt) != null) {
	     document.all(elmnt).style.visibility="hidden";
	  }
	}
	function doBtn(event, aClsName, fntcolor, bgcolor, bgimg, btntype, elmnt) {
		var doit = event.type;

		if(browser.isIE) {
		  var oEl = event.srcElement;
    		  oEl=window.event.srcElement;
		}
		else {
		  var oEl;
    		  oEl=(event.target.tagName?event.target:event.target.parentNode);
		}
      	  	while (-1 == oEl.className.indexOf( aClsName )) {
       	  		oEl = oEl.parentElement;
      	  		if (!oEl) {
      	  			return;
      	  		}
      	  	}
		if (btntype == "3D") {
		  if (doit == "mouseover" || doit == "mouseup") {
     	  	    oEl.className = "clsBtnOn";
     	  	  } else if (doit == "mousedown") {
     	  	    oEl.className = "clsBtnDown";
     	  	  } else {
     	  	    oEl.className = "clsBtnOff";
     	  	  }
		}
		else if (btntype == "flat") {  //flat
     	  	  if (doit == "mouseover" || doit == "mouseup" || doit == "mousedown") {
     	  	   oEl.className = "clsflatBtnOn";
     	  	  } else {
     	  	   oEl.className = "clsflatBtnOff";
     	  	  }
		}
		else if (btntype == "flatmenu") {
//		  alert(elmnt);
     	  	  if (doit == "mouseover" || doit == "mouseup" || doit == "mousedown") {
     	  	   oEl.className = "clsflatMenuOn";
     	  	  } else {
     	  	   oEl.className = "clsflatMenuOff";
     	  	  }
		  showmenu(elmnt);
		}
		if (fntcolor != '') {
		  oEl.style.color = fntcolor;
		}
		//alert(bgcolor);
		if (bgcolor != '') {
		  oEl.style.background = bgcolor;
		}
		if (bgimg != '') {
		  oEl.style.background = 'url(' + bgimg + ') no-repeat';
		}
	}

	function tboff(event, aClsName, fntcolor,bgcolor,bgimg, btntype, elmnt){
		if(browser.isIE) {
		  var oEl = event.srcElement;
    		  oEl=window.event.srcElement;
		}
  		else {
		  var oEl;
    		  oEl=(event.target.tagName?event.target:event.target.parentNode);
		}
      	  	while (-1 == oEl.className.indexOf( aClsName )) {
		  oEl = oEl.parentElement;
		  if (!oEl) {
		  	return;
		  }
		}
		if (btntype == "3D") {
		  oEl.className = "topBtnOff";
		}
		else if (btntype == "flat") {
		  oEl.className = "flatBtnOff";
		}
		else if (btntype == "flatmenu") {
		  oEl.className = "flatMenuOff";
		  hiddenmenu(elmnt);
		}
		if (fntcolor != '') {
		  oEl.style.color = fntcolor;
		}
		if (bgcolor != '') {
		  oEl.style.background = bgcolor;
		}
		if (bgimg != '') {
		  oEl.style.background = 'url(' + bgimg + ') no-repeat';
		}
	}
	function doTab(event,fntcolor, bgcolor, bgimg, isact) {
		var doit = event.type;

		if(browser.isIE) {
		  var oEl = event.srcElement;
    		  oEl=window.event.srcElement;
		}
		else {
		  var oEl;
    		  oEl=(event.target.tagName?event.target:event.target.parentNode);
		}

      	  	while (-1 == oEl.className.indexOf( "tab" )) {
      	  		oEl = oEl.parentElement;
      	  		if (!oEl) {
      	  			return;
      	  		}
      	  	}
		if (isact == 'True') {
		  oEl.className = "tabOn";
		}
		else
		{
		  oEl.className = "tabOff";
		}

		if (fntcolor != '') {
		  oEl.style.color = fntcolor;
		}
		//alert(bgcolor);
		if (bgcolor != '') {
		  oEl.style.background = bgcolor;
		}
		if (bgimg != '') {
		  oEl.style.background = 'url(' + bgimg + ') no-repeat';
		}
	}

	function clickBtn(gotourl) {
	   if (clkone == 1) {
	     clkone = 0;
//	     alert(gotourl);
	     document.location.href = gotourl;

	   }
	}
//specify interval between slide (in mili seconds)
var slidespeed=3000

//specify images
var slideimages=new Array("images/banners/sp_fade_1.jpg"
,"images/banners/sp_fade_2.jpg"
,"images/banners/sp_fade_3.jpg"
,"images/banners/sp_fade_4.jpg"
,"images/banners/sp_fade_5.jpg"
,"images/banners/sp_fade_6.jpg"
,"images/banners/sp_fade_7.jpg"
,"images/banners/sp_fade_8.jpg"
,"images/banners/sp_fade_9.jpg")

var newwindow=1 //open links in new window? 1=yes, 0=no

var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}


function externalLinks()
{
	if (!document.getElementsByTagName)
		return;

	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++)
	{
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external" )
		{
			anchor.target = "_blank";
			anchor.setAttribute('title', 'Deze koppeling zal in een nieuw venster worden geopend');
		}
	}
}
activateMenu = function(nav) {
/* currentStyle restricts the Javascript to IE only */
	if (document.all &&

 document.getElementById(nav).currentStyle) {
        var navroot = document.getElementById(nav);

        /* Get all the list items within the menu */
        var lis=navroot.getElementsByTagName("LI");
        for (i=0; i<lis.length; i++) {

           /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {
                   /* display the inner menu */
					if ( parseFloat(navigator.appVersion.split("MSIE")[1]) == 7 )
						this.style.marginBottom = '0px';
				   this.className='hover';
                }
                lis[i].onmouseout=function() {
				   this.style.marginBottom = '0px';
				   this.className='';
                }
            }
        }
    }
}


			window.onload= function(){
				activateMenu('vertnav');
				externalLinks();
			}

		$(function(){
			$("#g1").mbGallery( {
				galleryMaxWidth:0,
				galleryWidth:300,
				galleryHeight:300,
				galleryColor:"#333",
				galleryFrameBorder: 12,
				galleryFrameColor:"#fff",

				thumbStripPos: "right",
				thumbStripWidth:250,
				thumbSelectColor: "#fff",
				thumbOverColor : "#cccccc",
				thumbStripColor: "#333333",
				thumbsBorder: 4,
				thumbHeight:50,
				headerOpacity: .8,

				labelColor: "#333333",
				labelColorDisactive:"#333333",
				labelTextColor: "#ffffff",
				labelTextSize:"11px",
				labelHeight:20,

				startFrom:"random",
				fadeTime: 500,
				autoSlide:true,
				autoSize : true,
				slideTimer: 6000,
				iconFolder: "elements/white",
				startTimer:0
			}
				)}
			);
  $(document).ready(function(){
     $.fn.wait = function(time, type) {
        time = time || 1000;
        type = type || "fx";
        return this.queue(type, function() {
            var self = this;
            setTimeout(function() {
                $(self).dequeue();
            }, time);
        });

    };
    $('#fade_box').crossSlide({
           sleep: 4,
           fade: 2
          }, [
              { src: '/images/backgrounds/beeld1.jpg' },
              { src: '/images/backgrounds/beeld2.jpg'   }
    ]);

    function animateIt() {
       $('#fade_box_over').hide();
       $("#fade_box_over").wait(15000);
       $("#fade_box_over").fadeTo("slow", 0.6);
       $("#fade_box_over").show();

    }
    animateIt();
  });
