﻿// Define all ID's which should be have a dynamic font size
// Specify the defaults (default, min and max font size) in the function changeFontSize();
// Also specify which ID's have font sizes which deviate from the default font sizes
// At least copy and paste the variable content to the function fontsizeCookie();
var contents = new Array("titel","introductie","content");

/* Function loaded in the body of the website */
function init()
{
	// Set right font size
	// fontsizeCookie();

	//set body height
	SetBodyHeight();

	// Set height of Left SubNavMenu
	SubNavHeight();
	
	/* set cookie for masterpage */
	var ref = window.location.href;
	var strQueryString = ref.substr(ref.indexOf("/")).toLowerCase();
	var aQueryString = strQueryString.split("/");
	var masterpage = aQueryString[3];
	if(masterpage == 'particulier' || masterpage == 'zakelijk')
	{
		createCookie('masterpage',masterpage,365);
	}
	/* load right masterpage */
	init_MasterPage();
	
	/* left navigation hover*/
	LeftNavHover();

	MM_preloadImages('/SiteCollectionImages/btn_login_mm_hover.gif','/SiteCollectionImages/btn_login_mm_link.gif','/SiteCollectionImages/panel_klantserv_hover.gif','');

	if(document.getElementById('MSOTlPn_MainTD')) // Fix the height of page when editing a web part
	{
		document.getElementById('MSOTlPn_MainTD').style.height = 500 + "px";
	}
	
	Hidevoor404();
}

/* hide div */
function HideContent(d)
{
	if(d.length < 1)
	{
		return;
	}
	document.getElementById(d).style.display = "none";
	document.getElementById(d + '_a').className = "icon_plus";
}

/* show div */
function ShowContent(d)
{
	if(d.length < 1)
	{
		return;
	}
	document.getElementById(d).style.display = "block";
}

/* show or hide divs */
function ReverseContentDisplay(d)
{
	//var div = document.getElementsByTagName(d);
	if(d.length < 1)
	{
		return;
	}
	if(document.getElementById(d).style.display == "none")
	{
		document.getElementById(d).style.display = "block";
		document.getElementById(d + '_a').className = "icon_min";
	}
	else
	{
		document.getElementById(d).style.display = "none";
		document.getElementById(d + '_a').className = "icon_plus";
	}
}

/* change font size at website */
function changeFontSize2(inc,contents)
{
	var size; var minsize; var maxsize;
	
	//--set default font sizes for web pages --//
	var default_min_size = 8;
	var default_size = 11;
	var default_max_size = 16;

	//--set specific font sizes for some DIV's with unique ID's--//
	// new array("name of ID",min font size,default font size for reset,max font size)
	// var specific_sizes = new Array("titel",11,14,19,"introductie",8,11,18);
	var specific_sizes = new Array("titel",11,14,19);

	if(inc>1) // check if cookieFontSize is set
	{
		if(contents != 'paragraph' && document.getElementById(contents) && !document.getElementById(contents) == '') // for all ID's check if ellement with ID=content exists and is not empty
		{
			document.getElementById(contents).style.fontSize = inc + "px";
		}
		else if(contents == 'paragraph' && document.getElementsByTagName('p')) // check if a cookie paragraph is set and at this page a parapragh exists
		{
			var p = document.getElementsByTagName('p');
			for(i=0;i<p.length;i++)
			{
				p[i].style.fontSize = inc + "px";
			}
		}
	}
	else // cookieFontSize is not set
	{
		for (var i=0; i<contents.length; i++) // for each content ID in array
		{
			var content = contents[i];			
			if (document.getElementById(content) && !document.getElementById(content) == '') // check if ellement with ID=content exists and is not empty
			{
				var specific_size = 0; // check if content is a specific font size
				var z;
				for (z=0; z<specific_sizes.length; z++)
				{
					if(content == specific_sizes[z])
					{
						specific_size = 1;
						break;
					}
				}
				if (specific_size == 1) //set specific font size
				{
					if(inc==0)
					{
						j = z+2;
						size = specific_sizes[j];
					}
					else
					{
						var fontsize = parseInt(document.getElementById(content).style.fontSize.replace("px", ""));
						minsize = z+1;
						minsize = specific_sizes[minsize];
						maxsize = z+3;
						maxsize = specific_sizes[maxsize];
						if (fontsize <= minsize) //check if font size is not too small
						{
							if(inc==-1){/*no action*/}
							else
							{
								size = fontsize + inc;
							}		
						}
						if (fontsize >= maxsize) //check if font size is not too large
						{
							if(inc==1){/*no action*/}
							else 
							{
								size = fontsize + inc;
							}
						}			
						if (fontsize != maxsize && fontsize != minsize)
						{
							size = fontsize + inc;
						}
					}
					if(size)
					{
						document.getElementById(content).style.fontSize = size + "px";
						createCookie(content,size,365);
					}
				}
				else //set default font size
				{
					if(inc==0)
					{
						size = default_size;
					}
					else
					{
						var fontsize = parseInt(document.getElementById(content).style.fontSize.replace("px", ""));
						if (fontsize <= default_min_size) //check if font size is not too large
						{
							if(inc==-1){/*no action*/}
							else
							{
								size = fontsize + inc;
							}		
						}
						if (fontsize >= default_max_size) //check if font size is not too small
						{
							if(inc==1){/*no action*/}
							else 
							{
								size = fontsize + inc;
							}
						}
						if (fontsize != default_max_size && fontsize != default_min_size) //fontsize is not too large or too small
						{
							size = fontsize + inc;
						}
					}
					if(size)
					{
						document.getElementById(content).style.fontSize = size + "px";
						createCookie(content,size,365);
					}
				}
			}
		}
		if (document.getElementsByTagName('p')) //set paragraph font size
		{
			var p = document.getElementsByTagName('p');
			for(i=0;i<p.length;i++)
			{
				if(inc==0)
				{
					size = default_size + 'px';
					p[i].style.fontSize = size;
				}
				else
				{
					if(p[i].style.fontSize)
					{
						var fontsize = parseInt(p[i].style.fontSize.replace("px",""));
						
						if (fontsize <= default_min_size)
						{
							if(inc==-1){/*no action*/}
							else 
							{
								size = fontsize + inc;
							}		
						}
						if (fontsize >= default_max_size)
						{
							if(inc==1){/*no action*/}
							else 
							{
								size = fontsize + inc;
							}
						}			
						if (fontsize != default_max_size && fontsize != default_min_size)
						{
							size = fontsize + inc;
						}
					}
					if(size)
					{
						p[i].style.fontSize = size + "px";
					}
					createCookie('paragraph',size,365);
				}
			}
		}
	}
}

/* change font size at website v2 */

// --------------------------------------------------------------------
// Javascript Magnifier v 0.97
// Written by Dino Termini - termini@email.it - May 9, 2003
// This script is freeware (GPL) but if you use it, please let me know!
//
// Portions of code by zoomIN, zoomOUT
// Author: Nguyen Duong Minh (Obie) - obie4web@yahoo.com
// WWW: http://ObieWebsite.SourceForge.net
// License: GNU (GPL)
//
// Portions of code by Webreference Javascript Cookie Functions
// Jupirmedia Corporation
// http://www.internet.com
// --------------------------------------------------------------------
//
// Please refer to DEMO.htm file for details and usage
//
// --------------------------------------------------------------------

// Configuration parameters
// ------------------------
// Measure unit in pixel (px) or points (pt)
// measureUnit = "pt"
measureUnit = "px"

// Minimum size allowed for SIZE attribute (like in <FONT SIZE="1"> )
minSize = 7;

// Minimum size allowed for STYLE attribute (like in <FONT STYLE="font-size: 10px"> )
minStyleSize = 9;

// Maximum size allowed for SIZE attribute
maxSize = 11;

// Maximum size allowed for STYLE attribute
maxStyleSize = 15;

// Start size for tags with no SIZE attribute defined
startSize = 8;

// Start size for tags with no font-size STYLE or CLASS attribute defined
startStyleSize = 11;

// Increasing and decreasing step
stepSize = 1;

// Increasing step for STYLE definition (measure previously declared will be used)
stepStyleSize = 1;

// To set your own hotkeys, use key generator tool page included
// Keys to zooming in (with and without CAPS lock). Default: "+"
var keyin = 61;
var keyinCAPS = 43;

// Keys to zooming out (with and without CAPS lock). Default: "-"
var keyout = 45;
var keyoutCAPS = 95;

// Keys for "hard" zooming in (with and without CAPS lock). Default: ">"
var keyinIe = 46;
var keyinIeCAPS = 62;

// Keys for "hard" zooming out (with and without CAPS lock). Default: "<"
var keyoutIe = 44;
var keyoutIeCAPS = 60;

// "Hard" zoom factor
var zoomFactor = 1.1;

// Max zoom allowed
var maxZoom = 4.096;

// Min zoom allowed
var minZoom = 0.625;

// Initial decrease zoom
var startDecZoom = 0.7;

// Initial increase zoom
var startIncZoom = 1.3;

// Cookie expiry (default one year, actually 365 days)
// 365 days in a year
// 24 hours in a day
// 60 minutes in an hour
// 60 seconds in a minute
// 1000 milliseconds in a second
userExpiry = 365 * 24 * 60 * 60 * 1000;

// Enable or disable alert messages
alertEnabled = false;

// Allow input fields resize (text, buttons, and so on)
allowInputResize = false;

// End of configuration parameters. Please do not edit below this line
// --------------------------------------------------------------------------------

// Input values:
// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments

function setCookie(name, value, expires, path, domain, secure) {
  // Check whether cookies enabled
  document.cookie = "Enabled=true";
  var cookieValid = document.cookie;

  // if retrieving the VALUE we just set actually works
  // then we know cookies enabled
  if (cookieValid.indexOf("Enabled=true") != -1) {
    var curCookie = name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");

    document.cookie = curCookie;
    return(true);
  }
  else {
    return(false);
  }
}

// Input value:
// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}



// Input values:
// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// Input value:
// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

function searchTags(childTree, level) {
  var retArray = new Array();
  var tmpArray = new Array();
  var j = 0;
  var childName = "";
  for (var i=0; i<childTree.length; i++) {
    childName = childTree[i].nodeName;
    if (childTree[i].hasChildNodes()) {
      if ((childTree[i].childNodes.length == 1) && (childTree[i].childNodes[0].nodeName == "#text"))
        retArray[j++] = childTree[i];
      else {
        tmpArray = searchTags(childTree[i].childNodes, level+1);
        for (var k=0;k<tmpArray.length; k++)
          retArray[j++] = tmpArray[k];
        retArray[j++] = childTree[i];
      }
    }
    else
      retArray[j++] = childTree[i];
  }
  return(retArray);
}

function changeFontSize(stepSize, stepStyleSize, useCookie) {

  if (document.body) {
    if( document.getElementById('ThreeColumnsMiddle') ) {
    	var myObj = searchTags(document.getElementById('ThreeColumnsMiddle').childNodes, 0);
    }
    if( document.getElementById('TwoColumnsLeft') ) {
    	var myObj = searchTags(document.getElementById('TwoColumnsLeft').childNodes, 0);	
    }
    var myCookieSize = parseInt(getCookie("incrSize"));
    var myCookieStyleSize = parseInt(getCookie("incrStyleSize"));
    var myStepSize = stepSize;
    var myStepStyleSize = stepStyleSize;

    var now = new Date();

    // Fix the bug in Navigator 2.0, Macintosh
    fixDate(now);

    if (isNaN(myCookieSize)) myCookieSize = 0;
    if (isNaN(myCookieStyleSize)) myCookieStyleSize = 0;

    // For debug purpose only
    // if (!confirm("COOKIE: SIZE ["+myCookieSize+"] STYLESIZE ["+myCookieStyleSize+"]")) return(0);

    // Check valid increment/decrement sizes or useCookie parameter
    if (useCookie) {
      myStepSize = myCookieSize;
      myStepStyleSize = myCookieStyleSize;
    }

    now.setTime(now.getTime() + userExpiry);

    myObjNumChilds = myObj.length;
    for (i=0; i<myObjNumChilds; i++) {
      myObjName = myObj[i].nodeName;

      // Only some tags will be parsed
      if (myObjName != "#text" && myObjName != "HTML" &&
          myObjName != "HEAD" && myObjName != "TITLE" &&
          myObjName != "STYLE" && myObjName != "SCRIPT" &&
          myObjName != "BR" && myObjName != "TBODY" &&
          myObjName != "#comment" && myObjName != "FORM") {

        // Skip INPUT fields, if required
        if (!allowInputResize && myObjName == "INPUT") continue;

        size = parseInt(myObj[i].getAttribute("size"));

        // Internet Explorer uses a different DOM implementation
        if (myObj[i].currentStyle)
          styleSize = parseInt(myObj[i].currentStyle.fontSize);
        else 
          styleSize = parseInt(window.getComputedStyle(myObj[i], null).fontSize);

        // For debug purpose only. Note: can be very annoying
        // if (!confirm("TAG ["+myObjName+"] SIZE ["+size+"] STYLESIZE ["+styleSize+"]")) return(0);

        if (isNaN(size) || (size < minSize) || (size > maxSize))
          size = startSize;

        if (isNaN(styleSize) || (styleSize < minStyleSize) || (styleSize > maxStyleSize))
          styleSize = startStyleSize;

        if ( ((size > minSize) && (size < maxSize)) || 
             ((size == minSize) && (stepSize > 0)) || 
             ((size == maxSize) && (stepSize < 0)) || useCookie) {
          myObj[i].setAttribute("size", size+myStepSize);
        }

        if ( ((styleSize > minStyleSize) && (styleSize < maxStyleSize)) || 
             ((styleSize == minStyleSize) && (stepStyleSize > 0)) ||
             ((styleSize == maxStyleSize) && (stepStyleSize < 0)) || useCookie) {
          newStyleSize = styleSize+myStepStyleSize;
          myObj[i].style.fontSize = newStyleSize+measureUnit;
        }
      } // End if condition ("only some tags")
    } // End main for cycle

    // Set the cookies
    if (!useCookie) {
      cookieIsSet = setCookie("incrSize", myStepSize+myCookieSize, now);
      cookieIsSet = setCookie("incrStyleSize", myStepStyleSize+myCookieStyleSize, now);
      if (alertEnabled && !cookieIsSet) {
        alert("Per mantenere in memoria la dimensione scelta, abilita i cookie nel browser");
      }
    }

  } // End if condition ("document.body exists")
} // End function declaration

function increaseFontSize() {
  if (document.body) {
    changeFontSize(stepSize, stepStyleSize, false);
  }
  else {
    if (alertEnabled) {
      alert("Uw browser ondersteunt deze functie niet.");
    }
  }
}

function decreaseFontSize() {
  if (document.body) {
    myStepSize = -stepSize;
    myStepStyleSize = -stepStyleSize;
    changeFontSize(myStepSize, myStepStyleSize, false);
  }
  else {
    if (alertEnabled) {
      alert("Uw browser ondersteunt deze functie niet.");
    }
  }
}

function zoomin() {
  if (window.parent.document.body.style.zoom < maxZoom) {
    if (window.parent.document.body.style.zoom > 0) {
      window.parent.document.body.style.zoom *= zoomFactor; 
    }
    else { 
      window.parent.document.body.style.zoom = startIncZoom;
    }
  }
  else {
    if (alertEnabled) {
      alert("Warning: Max size reached");
    }
  }
}

function zoomout() {
  if ( (window.parent.document.body.style.zoom > minZoom) ||
       (window.parent.document.body.style.zoom == 0) ) {
    if (window.parent.document.body.style.zoom > 0) {
      window.parent.document.body.style.zoom /= zoomFactor; 
    }
    else {
      window.parent.document.body.style.zoom = startDecZoom;
    }
  }
  else {
    if (alertEnabled) {
      alert("Warning: Min size reached");
    }
  }
}

function checkzoom(e) {

  if (document.all) {
    myEvent = event.keyCode;
  }
  else {
    myEvent = e.which;
  }

  switch(myEvent) {
    case keyinIe:
    case keyinIeCAPS:
      //zoomin();
      break;

    case keyoutIe:
    case keyoutIeCAPS:
      //zoomout();
      break;

    case keyin:
    case keyinCAPS:
      //increaseFontSize();
      break;

    case keyout:
    case keyoutCAPS:
      //decreaseFontSize();
      break;

    default:
      break;
  }
}

if (document.layers) {
  //document.captureEvents(Event.KEYPRESS);
}

//document.onkeypress = checkzoom;

/* read fontsize cookie and load right font size */
function fontsizeCookie(contents)
{
	var contents = new Array("titel","introductie","content");
	for (var i=0; i<contents.length; i++) // for each content ID in array
	{
		var content = contents[i];
		var cookieFontSize = getCookie(content);
		if(cookieFontSize)
		{
			changeFontSize(cookieFontSize,content);
		}
	}
	
	var cookieFontSize = getCookie('paragraph');
	if(cookieFontSize)
	{
		changeFontSize(cookieFontSize,'paragraph');
	}
}


/* print item */
function CreatePrintWindow()
{
	if (navigator.appName == "Microsoft Internet Explorer")
	{
		var wPrint = window.open('', 'wPrint', 'toolbar=1,status=0,scrollbars=1,width=750,height=600');
	}
	else
	{
		var wPrint = window.open('', 'wPrint', 'toolbar=1,status=0,scrollbars=1,width=611,height=600');
	}
    if (wPrint)
    {
		wPrint.document.write('<html><head>');
		wPrint.document.write('<title>Meeùs</title>');

		wPrint.document.write('<!--[if IE]><LINK href="/Style%20Library/meeus.css" type=text/css rel=stylesheet><![endif]--><!--[if !IE]><!--><LINK href="/Style%20Library/meeus_ff.css" type=text/css rel=stylesheet><!--<![endif]-->');

		//wPrint.document.write('<link rel="stylesheet" type="text/css" href="/Style%20Library/Meeus.css"/>');
		wPrint.document.write('<link rel="stylesheet" type="text/css" href="/Style%20Library/MeeusPrintNews.css"/>');
		wPrint.document.write('</head><body>');
        
        wPrint.document.write('<div class="top_print"></div><div class="canvas_print" style="border-right:1px #cfcfcf solid;">');
        
		wPrint.document.write('<table cellpadding=0 cellspacing=0 width=568px height=17px>');
		wPrint.document.write('<tr><td class="header_print">');

		wPrint.document.write('<table cellpadding=0 cellspacing=0 width=568px><tr><td class="logo_print">');
		wPrint.document.write('<img src="/SiteCollectionImages/logo.gif" border="0" alt="Home"/>');
		wPrint.document.write('</td></tr></table>');

		wPrint.document.write('</td></tr>');

		if (!document.getElementById('titel') == '')
		{
			wPrint.document.write('<tr><td class="TitleField_print"><br/>');
			var Title = document.getElementById('TitleField');
			wPrint.document.write(document.title);
			wPrint.document.write('</td></tr></table>');
		}
		wPrint.document.write('</table>');

		if (!document.getElementById('introductie') == '')
		{
			wPrint.document.write('<table cellpadding=0 cellspacing=0 width=568px>');
			wPrint.document.write('<tr><td class="introductie">');         
			var intro = document.getElementById('introductie');         
			wPrint.document.write(intro.innerHTML);
			wPrint.document.write('</td></tr>');       
			wPrint.document.write('</table>');
		}

		if (!document.getElementById('content') == '')
		{
			wPrint.document.write('<table cellpadding=0 cellspacing=0 width=568px>');
			wPrint.document.write('<tr><td class="content" style="font-size:11px; line-height:15px;"><p>');         
			var mainContent = document.getElementById('content');         
			wPrint.document.write(mainContent.innerHTML);
			wPrint.document.write('</p></td></tr>');       
			wPrint.document.write('</table>');
		}
		
		wPrint.document.write('<table cellpadding="0" cellspacing="0" width="568px" height="20px">');
		wPrint.document.write('<tr height="20px"><td align="center">');
		wPrint.document.write('<table cellpadding="0" cellspacing="0" height="20px">');
		wPrint.document.write('<tr valign="middle"><td class="footernav_holder">');
		wPrint.document.write('<ul class="ul_footernav">');
		wPrint.document.write('<li class="li_footernav">Meeùs is onderdeel van AEGON</li>');
		wPrint.document.write('<li class="li_footernav_last" style="color:#000">2009 &copy; - Meeùs</li>');
		wPrint.document.write('</ul>');
		wPrint.document.write('</td></tr></table>');
		wPrint.document.write('</td></tr></table>');
		
		wPrint.document.write('</div><div class="bottom_print">&nbsp;</div>');
		
        wPrint.document.write('</body></html>');
		//wPrint.document.location.reload();
                  
		wPrint.focus();
        
		wPrint.setTimeout('print()', 1500);
    }
}

/* preload images */
function MM_preloadImages() { //v3.0
	var d=document;
	if(d.images)
	{
		if(!d.MM_p) d.MM_p=new Array();
    	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
    	for(i=0; i<a.length; i++)
    	if (a[i].indexOf("#")!=0)
    	{ 
    		d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
    	}
    }
}

/* Create cookie */
function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

/* read cookie */
function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

/* delete cookie */
function eraseCookie(name)
{
	createCookie(name,"",-1);
}

/* read cookie */
function getCookie(name)
{
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1)
	{
    	begin = dc.indexOf(prefix);
	    if (begin != 0) return null;
	}
	else begin += 2;
	var end = document.cookie.indexOf(";", begin);
	if (end == -1)
	end = dc.length;
	return unescape(dc.substring(begin + prefix.length, end));
} 

/* two functions for the page 'Veel gestelde vragen' to show or hide questions/ question blocks */
function HideContentFAQ(d)
{
	if(!document.getElementById('antwoord_' + d))
	{
		return;
	}
	document.getElementById('antwoord_' + d).style.display = "none";
	document.getElementById('vraag_' + d).className = "icon_plus";
}
function ReverseContentDisplayFAQ(d)
{
	var z = 200;
	if(document.getElementById('antwoord_' + d).style.display == "none")
	{
		document.getElementById('antwoord_' + d).style.display = "block";
		document.getElementById('vraag_' + d).className = "icon_min";
	}
	else
	{
		document.getElementById('antwoord_' + d).style.display = "none";
		document.getElementById('vraag_' + d).className = "icon_plus";
	}
	for(var i=1;i<z;i++)
	{
		if(i != d)
		{
			HideContentFAQ(i)
		}
	}
}

/* function to load the right masterpage for some pages outside 'Particulier' and 'Zakelijk' */
function init_MasterPage()
{
	var ref = window.location.href;
	var strQueryString = ref.substr(ref.indexOf("/")).toLowerCase();
	var aQueryString = strQueryString.split("/");
	var masterpage = aQueryString[3];
	if(masterpage != 'particulier' && masterpage != 'zakelijk' && masterpage != 'pages' && masterpage != '404')
	{
		var loadmasterpage = getCookie('masterpage');
		if (loadmasterpage == 'zakelijk')
		{
			document.getElementById('navigation_particulier').style.background = "transparent url('/SiteCollectionImages/nav_zakelijk_bg2.gif') no-repeat left top";
			document.getElementById('login_mijnmeeus').style.display = "none";
			document.getElementById('zakelijk_nav').className = "zakelijk_active";
			document.getElementById('particulier_nav').className = "particulier";
			//var test = '<a href="#zz1_TopNavigationMenu2_SkipLink"><img alt="Skip Navigation Links" src="/WebResource.axd?d=coWkKXi0feD3ghAqtMjX4Q2&amp;t=633573335273101854" width="0" height="0" style="border-width:0px;" /></a><table id="zz1_TopNavigationMenu2" class="subnav_menu zz1_TopNavigationMenu2_5 zz1_TopNavigationMenu2_2" cellpadding="0" cellspacing="0" border="0"><tr><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(this)" id="zz1_TopNavigationMenu2n0"><table class="subnav_items zz1_TopNavigationMenu2_4" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td style="white-space:nowrap;"><a class="zz1_TopNavigationMenu2_1 subnav_items zz1_TopNavigationMenu2_3" href="/zakelijk/verzekeringen/Pages/default.aspx" accesskey="1" style="border-style:none;font-size:1em;">Verzekeringen</a></td></tr></table></td><td style="width:10px;"></td><td style="width:10px;"></td><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(this)" id="zz1_TopNavigationMenu2n1"><table class="subnav_items zz1_TopNavigationMenu2_4" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td style="white-space:nowrap;"><a class="zz1_TopNavigationMenu2_1 subnav_items zz1_TopNavigationMenu2_3" href="/zakelijk/onroerendgoed/Pages/default.aspx" style="border-style:none;font-size:1em;">Onroerend goed</a></td></tr></table></td>';
			var test ='<td class="navigation_zakelijk"><a href="#zz1_TopNavigationMenu2_SkipLink"><img alt="Skip Navigation Links" src="/WebResource.axd?d=ST24YHriJilANa717HMp_Q2&amp;t=633632308043862087" width="0" height="0" style="border-width: 0px;" /></a><table id="zz1_TopNavigationMenu2" class="subnav_menu zz1_TopNavigationMenu2_5 zz1_TopNavigationMenu2_2" cellpadding="0" cellspacing="0" border="0"><tr><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(this)" id="zz1_TopNavigationMenu2n0"><table class="subnav_items zz1_TopNavigationMenu2_4" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td style="white-space: nowrap;"><a class="zz1_TopNavigationMenu2_1 subnav_items zz1_TopNavigationMenu2_3" href="/Zakelijk/verzekeringen/Pages/default.aspx" accesskey="1" style="border-style: none; font-size: 1em;">Verzekeringen</a></td></tr></table></td><td style="width: 10px;"></td><td style="width: 10px;"></td><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(this)" id="zz1_TopNavigationMenu2n1"><table class="subnav_items zz1_TopNavigationMenu2_4" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td style="white-space: nowrap;"><a class="zz1_TopNavigationMenu2_1 subnav_items zz1_TopNavigationMenu2_3" href="/Zakelijk/Bedrijfshuisvesting/Pages/default.aspx" style="border-style: none; font-size: 1em;">Bedrijfshuisvesting</a></td></tr></table></td><td style="width: 10px;"></td></tr></table><a id="zz1_TopNavigationMenu2_SkipLink"></a></td>';
			document.getElementById('navigation_particulier').innerHTML = test;
		}
	}
}

/* create url to go up one level - for the 404 page */
function urlBack()
{
	var url = getURLParam("ref");
	var aQueryString = url.split("/");
	var count = (aQueryString.length)-1;
	//alert('0: ' + aQueryString[0] + '    1: ' + aQueryString[1] + '    2: ' + aQueryString[2] + '    3: ' + aQueryString[3] + '     4: ' + aQueryString[4] + '    5: ' + aQueryString[5]) + '    6: ' + aQueryString[6] + '    7: ' + aQueryString[7];
	var back = 'http://';
	for(var i=2;i<count;i++)
	{
		if (i<=count)
		{
			back = back + aQueryString[i] + '/';
		}
		else
		{
			back = back + aQueryString[i];
		}
	}
	return back;
}

/* get parameter from url - for exmaple to show the right div at the page 'Veel gestelde vragen' */
function getURLParam(strParamName)
{
	var strReturn = "";
	var strHref = window.location.href;
	if ( strHref.indexOf("?") > -1 )
	{
		var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
		var aQueryString = strQueryString.split("&");
		for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
		{
			if(aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 )
			{
				var aParam = aQueryString[iParam].split("=");
				strReturn = aParam[1];
				break;
			}
		}
		return unescape(strReturn);
	}
}

function SubNavHeight() //set height of Left SubNavigation DIV
{	
//!!!!!!! FF does not get elementById !!!!!!!!!//
	var BodyHeight = 0;
	var MSO_ContentTable = 0;
	var doit = 0;
	var divLeft = 0;
	var divMiddle = 0;
	var divRight = 0;
	var MSO_ContentTable = document.getElementById('MSO_ContentTable').offsetHeight; //Height of MSO_ContentTable
	var morespace = 0;
	
	// Get height of left div (div with SubNavMenu
	if (document.getElementById('TwoColumnsNavigation') || document.getElementById('ThreeColumnsLeft'))
	{
		if(document.getElementById('TwoColumnsNavigation'))
		{
			divLeft = document.getElementById('TwoColumnsNavigation').offsetHeight;
			divLeftName = "TwoColumnsNavigation";
		}
		else
		{
			divLeft = document.getElementById('ThreeColumnsLeft').offsetHeight;
			divLeftName = "ThreeColumnsLeft";
		}
	}
	// Get height of middle div
	if(document.getElementById('ThreeColumnsMiddle') || document.getElementById('TwoColumnsLeft'))
	{
		if(document.getElementById('ThreeColumnsMiddle'))
		{
			divMiddle = document.getElementById('ThreeColumnsMiddle').offsetHeight;
		}
		else
		{
			divMiddle = document.getElementById('TwoColumnsLeft').offsetHeight;
		}
	}
	// Get height of right div
	if(document.getElementById('ThreeColumnsRight') || document.getElementById('TwoColumnsRight') || document.getElementById('TwoColumnsMiddle'))
	{
		if(document.getElementById('ThreeColumnsRight'))
		{
			divRight = document.getElementById('ThreeColumnsRight').offsetHeight;
		}
		else if(document.getElementById('TwoColumnsRight'))
		{
			divRight = document.getElementById('TwoColumnsRight').offsetHeight;
		}
		else
		{
			divRight = document.getElementById('TwoColumnsMiddle').offsetHeight;
		}
	}
	//alert('Left = ' + divLeft + 'px   Middle = ' + divMiddle + 'px   Right = ' + divRight + 'px');
	if (divLeft != 0)
	{
		if (divLeft < divMiddle || divLeft < divRight)
		{
			doit = 1;
		}
	}
	if(doit == 1)
	{
		divLeft = divLeft;
		if (divMiddle < divRight) // Heigthest div is divRight
		{
			var subnavleftspace = divRight - divLeft;
		}
		else // Heigthest div is divMiddle
		{
			var subnavleftspace = divMiddle - divLeft;
		}

		// Set calculated height of left DIV
		document.getElementById('subnavigatie_space').style.height = subnavleftspace + 10 + 'px'; // + 10, because of margin-bottom of LeftDiv
		document.getElementById('subnavigatie_space').style.background = "url(/SiteCollectionImages/subnav_space.gif) repeat-y left top";
		
		// check if the left DIV is near the footer else the left DIV needs to be bigger
		var differ = MSO_ContentTable - document.getElementById(divLeftName).offsetHeight;
		if (differ > 7)
		{
			var divLeftActual = document.getElementById('subnavigatie_space').offsetHeight;
			morespace = differ - 7 + divLeftActual;
			document.getElementById('subnavigatie_space').style.height = morespace;
		}
	}
	else {/*do noting*/}
}

function SetBodyHeight()
{
	var ContentWidth = 0; //Width of content area in Browser
	var ContentHeight = 0; //Height of content area in Browser
	var PageHeight = document.getElementById('bodyheight').offsetHeight; //Height of content in page
	var MSO_ContentTable = document.getElementById('MSO_ContentTable').offsetHeight; //Height of MSO_ContentTable

	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	if (typeof window.innerWidth != 'undefined')
	{
		ContentWidth = window.innerWidth,
		ContentHeight = window.innerHeight
	}
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
	{
		ContentWidth = document.documentElement.clientWidth,
		ContentHeight = document.documentElement.clientHeight
	}
	// older versions of IE
	else
	{
		ContentWidth = document.getElementsByTagName('body')[0].clientWidth,
		ContentHeight = document.getElementsByTagName('body')[0].clientHeight
	}

	if(PageHeight < ContentHeight)
	{
		var extrasize = ContentHeight-PageHeight;
		document.getElementById('MSO_ContentTable').style.height = MSO_ContentTable + extrasize + 'px';
	}
	else {/*do nothing*/}
	
	if(document.getElementById('MSOTlPn_MainTD')) // Fix the height of page when editing a web part
	{
		document.getElementById('MSOTlPn_MainTD').style.height = 500 + "px";
	}
}

function Contactformlabel()
{
	var ref = document.referrer;
	var strQueryString = ref.substr(ref.indexOf("/")).toLowerCase();
	var aQueryString = strQueryString.split("/");
	var masterpage = aQueryString[3];
	if(masterpage == 'zakelijk')
	{
		document.getElementById('huisnummer').innerHTML = "Pandnummer<span class='ms-formvalidation'>*</span>";
	}
	else {/*do nothing*/}
}

function ChangeBackGround() //Change background Search button
{
	var temp3 = document.getElementById('ctl00_m_g_7c88c0f5_9495_461a_921a_1437ea23cbd2').getElementsByTagName('td');
	//temp3[1].className = "ms-sbgo2 ms-sbcell";
}

function getTagFromIdentifierAndTitle(tagName, identifier, title)
{
	var len = identifier.length;
	var tags = document.getElementsByTagName(tagName);
	for (var i=0; i < tags.length; i++)
	{
		var tempString = tags[i].id;
		if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len))
		{
			tags[i].value = document.referrer;
		}
	}
}

function LeftNavHover() {
	if (document.all&&document.getElementById) 
	{
		var menuRoot = document.getElementsByTagName("div");
		
		for(k=0; k<menuRoot.length; k++) {
			if( menuRoot[k].className == "Ettu-Meeus-Navigation") {		
				var navRoot = menuRoot[k].getElementsByTagName("ul");
				for( j=0; j<navRoot.length; j++) {
					for (i=0; i<navRoot[j].childNodes.length; i++) {
						node = navRoot[j].childNodes[i];
						if (node.nodeName=="LI") {					
							node.onmouseover=function() {					
								this.className+=" over";
							}
							node.onmouseout=function() {
								this.className=this.className.replace(" over", "");
							}
						}
					}
				}
			} else {}
		}
	}	
}

/*
function BreadcrumbFirstPadding()
{
	if (document.getElementById('ctl00_PlaceHolderMain_ContentMap') && !document.getElementById('ctl00_PlaceHolderMain_ContentMap') == '')
	{
		var spans = document.getElementById('ctl00_PlaceHolderMain_ContentMap').getElementsByTagName('span');
		for (var i=0; i < spans.length; i++)
		{
			//alert(spans[i].innerHTML);
			spans[0].innerHTML = "<A class='breadcrumb_item' style='padding-left:0px;' href='/Pages/default.aspx'>Home</A>";
		}
	}
	else{}
}
*/

function AdvancedSearch()
{
	// Set table width = 100%
	document.getElementById('ctl00_m_g_7c88c0f5_9495_461a_921a_1437ea23cbd2_ASB_OT').width = "100%";
	
	// Change the text 'Find documents with...'
	document.getElementById('ctl00_m_g_7c88c0f5_9495_461a_921a_1437ea23cbd2_ASB_TQS_SL').getElementsByTagName('h3')[0].innerHTML = "Zoek op de volgende zoektermen";
	document.getElementById('ctl00_m_g_7c88c0f5_9495_461a_921a_1437ea23cbd2_ASB_TQS_SL').getElementsByTagName('h3')[0].className = "results_pagingbalk";
	document.getElementById('ctl00_m_g_7c88c0f5_9495_461a_921a_1437ea23cbd2_ASB_TQS_SL').getElementsByTagName('h3')[0].style.width = "768px";
	document.getElementById('ctl00_m_g_7c88c0f5_9495_461a_921a_1437ea23cbd2_ASB_TQS_SL').getElementsByTagName('td')[0].style.backgroundColor = "white";
	document.getElementById('ctl00_m_g_7c88c0f5_9495_461a_921a_1437ea23cbd2_ASB_TQS_SL').getElementsByTagName('h3')[0].style.paddingLeft = "10px";
	
	var trs = document.getElementById('ctl00_m_g_7c88c0f5_9495_461a_921a_1437ea23cbd2_ASB_OT').getElementsByTagName('tr');
	
	document.getElementById('ctl00_m_g_7c88c0f5_9495_461a_921a_1437ea23cbd2_ASB_OT').getElementsByTagName('tr')[1].getElementsByTagName('td')[1].style.width = "420px";
	
	document.getElementById('ctl00_m_g_7c88c0f5_9495_461a_921a_1437ea23cbd2_ASB_OT').getElementsByTagName('tr')[1].getElementsByTagName('td')[0].style.fontWeight = "bold";
	document.getElementById('ctl00_m_g_7c88c0f5_9495_461a_921a_1437ea23cbd2_ASB_OT').getElementsByTagName('tr')[2].getElementsByTagName('td')[0].style.fontWeight = "bold";
	document.getElementById('ctl00_m_g_7c88c0f5_9495_461a_921a_1437ea23cbd2_ASB_OT').getElementsByTagName('tr')[3].getElementsByTagName('td')[0].style.fontWeight = "bold";
	
	// Change the value of the submit button
	var z = trs.length -1;
	var inputs = trs[z].getElementsByTagName('td')[1].innerHTML;
	trs[z].getElementsByTagName('td')[1].getElementsByTagName('input')[0].value = "Zoek";
	trs[z].getElementsByTagName('td')[1].getElementsByTagName('input')[0].className = "button";
	trs[z].getElementsByTagName('td')[1].getElementsByTagName('input')[0].style.marginTop = "0px";
	trs[z].getElementsByTagName('td')[1].getElementsByTagName('input')[0].style.paddingLeft = "6px";
}

function HeightNews()
{
	var divs = document.getElementById('TwoColumnsRight').getElementsByTagName('div');
	for (var i=0; i<divs.length; i++)
	{
		if (divs[i].className == "panel")
		{
			var actualheight = divs[i].offsetHeight;
			var newheight = actualheight - 15;
			divs[i].style.height = newheight + "px";
		}
	}
}

function Hidevoor404()
{
	if (window.location.href.indexOf("paginanietgevonden")!=-1)
	{
		document.getElementById('hidevoor404_1').style.display = "none";
		document.getElementById('hidevoor404_2').style.display = "none";
		document.getElementById('hidevoor404_3').style.display = "none";
		document.getElementById('hidevoor404_4').style.display = "none";
		document.getElementById('hidevoor404_5').style.display = "none";
		document.getElementById('hidevoor404_6').style.width = "305px";
	}
}