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();
var activeButton=null;
if(browser.isIE)document.onmousedown=pageMousedown;else document.addEventListener("mousedown",pageMousedown,true);
	
function pageMousedown(event){
	var el;
	if(activeButton==null)return;
	if(browser.isIE)el=window.event.srcElement;	else el=(event.target.tagName?event.target:event.target.parentNode);
	if(el== activeButton)return;
	if(getContainerWith(el,"DIV","menu")==null){resetButton(activeButton);}
}

function buttonClick(event,menuId){
	var button;
	if(browser.isIE)button=window.event.srcElement;
	else button=event.currentTarget;button.blur();
	if(button.menu==null){button.menu = document.getElementById(menuId);
	if(button.menu.isInitialized==null)menuInit(button.menu);}
	if(activeButton!=null)resetButton(activeButton);
	if(button!=activeButton){depressButton(button);activeButton = button;}
	elseactiveButton=null;
	//return false;
}

function buttonMouseover(event, menuId){
	var button;
	if(browser.isIE)button=window.event.srcElement;else button=event.currentTarget;
	if(activeButton!=null&&activeButton!=button)buttonClick(event, menuId);
}


function depressButton(button){
	var x,y;button.className+=" WinKnopActive";
	x=getPageOffsetLeft(button);y=getPageOffsetTop(button)+ button.offsetHeight;
	if (browser.isIE){x+=button.offsetParent.clientLeft;
	y+=button.offsetParent.clientTop;}
	button.menu.style.left=x+"px";button.menu.style.top=y+"px";
	button.menu.style.visibility="visible";
}

function resetButton(button){
	removeClassName(button,"WinKnopActive");
	if(button.menu!=null){closeSubMenu(button.menu);button.menu.style.visibility="hidden";}
	activeButton = null;
}

function menuMouseover(event){
	var menu;
	if(browser.isIE)menu=getContainerWith(window.event.srcElement,"DIV","menu");
	else menu=event.currentTarget;if(menu.activeItem!=null)closeSubMenu(menu);
}

function WinItemMouseover(event,menuId){
	var item,menu,x,y;
	if(browser.isIE)item=getContainerWith(window.event.srcElement,"A","WinItem");
	else item=event.currentTarget;menu=getContainerWith(item,"DIV","menu");
	if(menu.activeItem!=null)closeSubMenu(menu);menu.activeItem=item;
	item.className+=" WinItemOplichten";
	if(item.subMenu==null){item.subMenu=document.getElementById(menuId);
	if(item.subMenu.initialized==null)menuInit(item.subMenu);}
	x=getPageOffsetLeft(item)+item.offsetWidth;y=getPageOffsetTop(item);var maxX,maxY;
	if(browser.isNS){maxX=window.scrollX+window.innerWidth;
	maxY=window.scrollY+window.innerHeight;}
	if(browser.isIE){maxX=(document.documentElement.scrollLeft!=0?document.documentElement.scrollLeft:document.body.scrollLeft)+(document.documentElement.clientWidth!=0?document.documentElement.clientWidth:document.body.clientWidth);
	maxY=(document.documentElement.scrollTop!=0?document.documentElement.scrollTop:document.body.scrollTop)+(document.documentElement.clientHeight!=0?document.documentElement.clientHeight:document.body.clientHeight);}
	maxX-=item.subMenu.offsetWidth;maxY-=item.subMenu.offsetHeight;
	if(x>maxX)x=Math.max(0,x-item.offsetWidth-item.subMenu.offsetWidth+(menu.offsetWidth-item.offsetWidth));y=Math.max(0,Math.min(y, maxY));
	item.subMenu.style.left=x+"px";item.subMenu.style.top=y+"px";
	item.subMenu.style.visibility="visible";
	if(browser.isIE)window.event.cancelBubble=true;else event.stopPropagation();
}

function closeSubMenu(menu){
	if(menu==null||menu.activeItem==null)return;
	if(menu.activeItem.subMenu!=null){closeSubMenu(menu.activeItem.subMenu);
	menu.activeItem.subMenu.style.visibility="hidden";menu.activeItem.subMenu=null;}
	removeClassName(menu.activeItem,"WinItemOplichten");menu.activeItem=null;
}

function menuInit(menu){
	var itemList,spanList;var textEl,pijltjeEl;var itemWidth;var w,dw;var i,j;
	if(browser.isIE){menu.style.lineHeight="2.5ex";
	spanList=menu.getElementsByTagName("SPAN");
	for(i=0;i< spanList.length; i++)
		if(hasClassName(spanList[i],"WinItempijltje")){spanList[i].style.fontFamily="Webdings";spanList[i].firstChild.nodeValue="4";}}
	itemList=menu.getElementsByTagName("A");
	if(itemList.length>0)itemWidth=itemList[0].offsetWidth;else return;
	for(i=0; i < itemList.length; i++) {
		spanList=itemList[i].getElementsByTagName("SPAN")
		textEl=null
		pijltjeEl = null;
		for(j=0; j < spanList.length; j++) {
			if(hasClassName(spanList[j],"WinItemText"))textEl=spanList[j];
			if(hasClassName(spanList[j],"WinItempijltje"))pijltjeEl=spanList[j];}
		if(textEl!=null&&pijltjeEl!=null)
		textEl.style.paddingRight=(itemWidth-(textEl.offsetWidth+pijltjeEl.offsetWidth))+"px";}
	if (browser.isIE){w=itemList[0].offsetWidth;
	itemList[0].style.width=w+"px";dw=itemList[0].offsetWidth-w;w-=dw;
	itemList[0].style.width=w+"px";}
	menu.initialized=true;
}

function getContainerWith(node,tagName,className){
	while(node!=null){
	if(node.tagName!=null&&node.tagName==tagName&&hasClassName(node,className))
	return node;node=node.parentNode;}return node;
}

function hasClassName(el,name){
	var i,list;list=el.className.split(" ");
	for(i=0;i<list.length;i++)if(list[i]==name)return true;return false;
}

function removeClassName(el,name){
	var i,curList,newList;if(el.className==null)return;
	newList=new Array();curList=el.className.split(" ");
	for(i=0;i<curList.length;i++)
	if(curList[i]!=name)newList.push(curList[i]);el.className=newList.join(" ");
}

function getPageOffsetLeft(el){
	var x;x=el.offsetLeft;
	if(el.offsetParent!=null)x+=getPageOffsetLeft(el.offsetParent);return x;
}

function getPageOffsetTop(el){
	var y;y=el.offsetTop;
	if(el.offsetParent!=null)y+=getPageOffsetTop(el.offsetParent);return y;
}

function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
		}
	}
	return curleft;
}

function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curtop += obj.offsetTop
		}
	}
	return curtop;
}



/*   dw_scroll.js    version date: Feb 2004    */

/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
*************************************************************************/

dw_scrollLayers = {};
dw_scrollLayer.speed = 100; // default speed for mouseover scrolling


function dw_scrollLayer(wnId, lyrId, cntId) {
  this.id = wnId; dw_scrollLayers[this.id] = this;
  this.animString = "dw_scrollLayers." + this.id;
  this.loadLayer(lyrId, cntId);
}

dw_scrollLayer.prototype.loadLayer = function(lyrId, cntId) {
  if (!document.getElementById) return;
  var wndo, lyr;
  if (this.lyrId) {
    lyr = document.getElementById(this.lyrId);
    lyr.style.visibility = "hidden";
  }
  lyr = document.getElementById(lyrId);
  wndo = document.getElementById(this.id);
  lyr.style.top = this.y = 0; lyr.style.left = this.x = 0;
  this.maxY = (lyr.offsetHeight - wndo.offsetHeight > 0)? lyr.offsetHeight - wndo.offsetHeight: 0;
  this.wd = cntId? document.getElementById(cntId).offsetWidth: lyr.offsetWidth;
  this.maxX = (this.wd - wndo.offsetWidth > 0)? this.wd - wndo.offsetWidth: 0;
  this.lyrId = lyrId; // hold id of currently visible layer
  lyr.style.visibility = "visible";
  this.on_load(); this.ready = true;
}

dw_scrollLayer.prototype.on_load = function() {}

dw_scrollLayer.prototype.shiftTo = function(lyr, x, y) {
  lyr.style.left = (this.x = x) + "px"; 
  lyr.style.top = (this.y = y) + "px";
}

// called onmouseover. arguments: direction (possible values: 'up', 'down', 'left', 'right')
// speed (optional) to override default speed (set in dw_scrollLayer.speed)
dw_scrollLayer.prototype.startScroll = function(dir, speed) {
  if (!this.ready) return; if (this.timerId) clearInterval(this.timerId);
  this.speed = speed || dw_scrollLayer.speed;
  this.lyr = document.getElementById(this.lyrId);
  if (dir == "up" || dir == "down") {
    this.xdir = 0; this.endX = parseInt(this.lyr.style.left);
    this.ydir = (dir == "down")? -1: 1; this.endY = (dir == "down")? -this.maxY: 0;
  } else if (dir == "right" || dir == "left") {
    this.ydir = 0; this.endY = parseInt(this.lyr.style.top);
    this.xdir = (dir == "right")? -1: 1; this.endX = (dir == "right")? -this.maxX: 0;
  } else {
    alert("Up, down, left, and right are the only scroll directions currently supported.");
    return; 
  }
  this.lastTime = ( new Date() ).getTime();
  this.on_scroll_start();  
  this.timerId = setInterval(this.animString + ".scroll()", 10); 
}

dw_scrollLayer.prototype.scroll = function() {
  var now = ( new Date() ).getTime();
  var x = this.x + this.xdir * (now - this.lastTime)/1000 * this.speed;
  var y = this.y + this.ydir * (now - this.lastTime)/1000 * this.speed;
  if ( ( this.xdir == -1 && x > -this.maxX ) || ( this.xdir == 1 && x < 0 ) || 
    ( this.ydir == -1 && y > -this.maxY ) || ( this.ydir == 1 && y < 0 ) ) {
    this.lastTime = now;
    this.shiftTo(this.lyr, x, y);
    this.on_scroll(x, y);
  } else {
    clearInterval(this.timerId); this.timerId = 0;
    this.shiftTo(this.lyr, this.endX, this.endY);
    this.on_scroll_end(this.endX, this.endY);
  }
}

dw_scrollLayer.prototype.stopScroll = function() {
  if (!this.ready) return;
  if (this.timerId) clearInterval(this.timerId);
  this.timerId = 0;  this.lyr = null;
}
  
dw_scrollLayer.prototype.on_scroll = function() {}
dw_scrollLayer.prototype.on_scroll_start = function() {}
dw_scrollLayer.prototype.on_scroll_end = function() {}
  
// remove layers from table for ns6+/mozilla (needed for scrolling inside tables)
function GeckoTableBugFix() {
  var i, wndo, holderId, holder, x, y;
	if ( navigator.userAgent.indexOf("Gecko") > -1 ) {
    dw_scrollLayer.hold = []; // holds id's of wndo and its container
    for (i=0; arguments[i]; i++) {
      if ( dw_scrollLayers[ arguments[i] ] ) {
        wndo = document.getElementById( arguments[i] );
        holderId = wndo.parentNode.id;
        holder = document.getElementById(holderId);
        document.body.appendChild( holder.removeChild(wndo) );
        wndo.style.zIndex = 1000;
        x = holder.offsetLeft; y = holder.offsetTop;
        wndo.style.left = x + "px"; wndo.style.top = y + "px";
        dw_scrollLayer.hold[i] = [ arguments[i], holderId ];
      }
    }
   window.addEventListener("resize", rePositionGecko, true);
  }
}

// ns6+/mozilla need to reposition layers onresize when scrolling inside tables.
function rePositionGecko() {
  var i, wndo, holder, x, y;
  if (dw_scrollLayer.hold) {
    for (i=0; dw_scrollLayer.hold[i]; i++) {
      wndo = document.getElementById( dw_scrollLayer.hold[i][0] );
      holder = document.getElementById( dw_scrollLayer.hold[i][1] );
      x = holder.offsetLeft; y = holder.offsetTop;
      wndo.style.left = x + "px"; wndo.style.top = y + "px";
    }
  }
}

function checkFormNL(pFormName) {	//v1.1 by dash mp
	try {
		var pValue, pType, pName, pMsg="", pRegExp;
		var jColorOK = "#ffffff", jColorNotOK = "#FFB7B7";
		for (var i = 0; i < document.forms[pFormName].elements.length; i++) {   
			pName = document.forms[pFormName].elements[i].name; pType = document.forms[pFormName].elements[i].type;
			if  (pType.toUpperCase() == 'SELECT') { pValue = document.forms[pFormName].elements[i].options[document.forms[pFormName].elements[i].selectedIndex].value;
			} else { pValue = document.forms[pFormName].elements[i].value; }
			if (pValue == null) { pValue = ""; }
			if ((pName.indexOf("!") > -1) && (pName.indexOf("##") > -1)) { pRegExp = new RegExp(pName.substring((pName.indexOf("!")+1),pName.indexOf("##")),"i");
				if (pRegExp.test(pValue) == false) { pMsg += "- " + pName.substring(0,pName.indexOf("$$")) + "\n"; document.forms[pFormName].elements[i].style.backgroundColor = jColorNotOK; } else { document.forms[pFormName].elements[i].style.backgroundColor = jColorOK; }
		} }
		if (pMsg.length > 0) { alert("Onderstaande verplichte velden zijn niet (correct) ingevuld.\n \n"+pMsg+"\n Controleer alle ingevulde gegevens en probeer het opnieuw."); return false; }

		//set page action
		document.forms[pFormName].action = '/pw-contact.asp';
		document.forms[pFormName].elements['sendingformallowed'].value = '556d699968986a989a9869986e989a986c709d98989898989b996c986a9869';
		document.getElementById("Verstuur").disabled=true;
		return true;
	} catch (excp) { alert(excp+'Uw webbrowser wordt niet ondersteund.'); return false; }
}


function checkSignNL() {
	try {
		var jValue, jType, jMsg="", jRegExp, jFormObj;
		var jColorOK = "#ffffff", jColorNotOK = "#FFB7B7";
		
		//username
		jFormObj = document.forms[0].elements['SSMusername'];
		jValue = jFormObj.value;
		jValue = jValue.replace(/^\s+|\s+$/g,"gi"); jRegExp = new RegExp(".{3,}","gi"); 
		if (jRegExp.test(jValue) == false) { jMsg += "- Gebruikersnaam \n"; jFormObj.style.backgroundColor = jColorNotOK; } else { jFormObj.style.backgroundColor = jColorOK }
			
		//password	
		jFormObj = document.forms[0].elements['SSMpassword'];
		jValue = jFormObj.value;
		jValue = jValue.replace(/^\s+|\s+$/g,"gi"); jRegExp = new RegExp(".{3,}","gi"); 
		if (jRegExp.test(jValue) == false) { jMsg += "- Wachtwoord \n"; jFormObj.style.backgroundColor = jColorNotOK; } else { jFormObj.style.backgroundColor = jColorOK }

		//set page action
		document.forms[0].action = '/pw-signin.asp';
		document.forms[0].elements['SSMsendingallowed'].value = '556d699968986a989a9869986e989a986c709d98989898989b996c986a9869';

		// normal handling
		if (jMsg.length> 0) { alert("Onderstaande verplichte velden zijn niet (correct) ingevuld.\n \n"+jMsg+"\n Controlleer alle ingevulde gegevens en probeer het opnieuw."); return false; }
		if (jMsg.length==0) { document.getElementById("SignInButton").disabled=true; }

	} catch (excp) { alert(excp+'Uw webbrowser wordt niet ondersteund.'); return false; }
}