shmn=new Object;
function OpenMenu(n)
	{
	document.getElementById("StartMenu").style.left=(xOffsetLeft(document.getElementById("menuBalk"))+80)+"px";
    document.getElementById("StartMenu").style.top=(xOffsetTop(document.getElementById("menuBalk"))+182)+"px";
    document.getElementById("StartMenu").style.visibility="visible";
	document.getElementById("StartMenu2").style.visibility="hidden";
	}
function HideMenu(n)
	{
	document.getElementById("StartMenu").style.visibility="hidden";
	}
function OpenMenu2(n)
	{
    document.getElementById("StartMenu2").style.left=(xOffsetLeft(document.getElementById("menuBalk"))+160)+"px";
    document.getElementById("StartMenu2").style.top=(xOffsetTop(document.getElementById("menuBalk"))+182)+"px";
    document.getElementById("StartMenu2").style.visibility="visible";
	document.getElementById("StartMenu").style.visibility="hidden";
	}
function HideMenu2(n)
	{
	document.getElementById("StartMenu2").style.visibility="hidden";
	}
function HoverMenu(n)
	{
	clearTimeout(shmn);
	document.getElementById(n).className="hoverMenu";
	}
function OuterMenu(n)
	{
	document.getElementById(n).className="menuRef";
	}
function openCalc()
	{
	window.open("/uitvaartkostenmeter/uitvaartkostenmeter.html","_new","width=700,height=400,left=20,top=20");
	}
function LoadItem(n)
	{
	document.location.href=filenaam[n];
	}
function setMenu(n)
	{
	document.getElementById("StartMenu").style.left=(xOffsetLeft(document.getElementById("menuBalk"))+80)+"px";
    document.getElementById("StartMenu").style.top=(xOffsetTop(document.getElementById("menuBalk"))+182)+"px";
    document.getElementById("StartMenu2").style.left=(xOffsetLeft(document.getElementById("menuBalk"))+160)+"px";
    document.getElementById("StartMenu2").style.top=(xOffsetTop(document.getElementById("menuBalk"))+182)+"px";
    }
function change1(n,o)
	{
	lastBackgroundColor=document.getElementById(n).style.backgroundColor;
	document.getElementById('portret').src=n+".jpg";
	document.getElementById(n).style.backgroundColor="#efefef";
	lastColor=document.getElementById(n).style.color;
	document.getElementById(n).style.color="black";
	if (o<3)
		{
		document.getElementById('uitleg01').innerHTML=uitleg[o];
		document.getElementById('uitleg01').style.backgroundColor=colors[o];
		document.getElementById('uitleg01').style.visibility="visible";
		document.getElementById('uitleg02').style.visibility="hidden";
		}
		else
		{
		document.getElementById('uitleg02').innerHTML=uitleg[o];
		document.getElementById('uitleg02').style.backgroundColor=colors[o];
		document.getElementById('uitleg02').style.visibility="visible";
		document.getElementById('uitleg01').style.visibility="hidden";
		}
	}
function change2(n)
	{
	document.getElementById(n).style.backgroundColor=lastBackgroundColor;
	document.getElementById(n).style.color=lastColor;
	document.getElementById('uitleg01').style.visibility='hidden';
	document.getElementById('uitleg02').style.visibility='hidden';
	}
function HoverMenu(n)
	{
	clearTimeout(shmn);
	document.getElementById(n).style.backgroundColor="#8192c2";
	document.getElementById(n).style.color="white";
	}
function OuterMenu(n)
	{
	document.getElementById(n).style.backgroundColor="";
	document.getElementById(n).style.color="black";
	}
function LoadItem(n)
	{
	if (n<4) eval(filenaam[n]);
	if (n>3) document.location.href=filenaam[n];
	}
function LoadItem2(n)
	{
	document.location.href=filenaam2[n];
	}
// xGetElementById, Copyright 2001-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL

function xGetElementById(e)
{
  if(typeof(e)=='string') {
    if(document.getElementById) e=document.getElementById(e);
    else if(document.all) e=document.all[e];
    else e=null;
  }
  return e;
}

// xDef, Copyright 2001-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL

function xDef()
{
  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}
  return true;
}

// xOffsetLeft, Copyright 2001-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL

function xOffsetLeft(e)
{
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.offsetLeft)) return e.offsetLeft;
  else return 0;
}

// xClientWidth r5, Copyright 2001-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL

function xClientWidth()
{
  var v=0,d=document,w=window;
  if((!d.compatMode || d.compatMode == 'CSS1Compat') && !w.opera && d.documentElement && d.documentElement.clientWidth)
    {v=d.documentElement.clientWidth;}
  else if(d.body && d.body.clientWidth)
    {v=d.body.clientWidth;}
  else if(xDef(w.innerWidth,w.innerHeight,d.height)) {
    v=w.innerWidth;
    if(d.height>w.innerHeight) v-=16;
  }
  return v;
}
// xClientHeight r5, Copyright 2001-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL

function xClientHeight()
{
  var v=0,d=document,w=window;
  if((!d.compatMode || d.compatMode == 'CSS1Compat') && !w.opera && d.documentElement && d.documentElement.clientHeight)
    {v=d.documentElement.clientHeight;}
  else if(d.body && d.body.clientHeight)
    {v=d.body.clientHeight;}
  else if(xDef(w.innerWidth,w.innerHeight,d.width)) {
    v=w.innerHeight;
    if(d.width>w.innerWidth) v-=16;
  }
  return v;
}
// xOffsetTop, Copyright 2001-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
function xOffsetTop(e)
{
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.offsetTop)) return e.offsetTop;
  else return 0;
}
function checkInvoer(n)
	{
	waarsch1=0;
	waarsch2=1;
	if (document.forms.AP_Form.geschatte_kosten.value!='')
		{waarsch1++;}
	if (waarsch1==1 && waarsch2==1)
		{
		document.forms.AP_Form.submit();
		}
		else
		{
		toev='';
		if (waarsch1==0){toev+="\nVul een gewenst verzekerd bedrag in, weet u dit niet vul dan de uitvaartkostenmeter in.";}
		if (waarsch2==0){toev+="\nKlik de maatschappij van uw keuze aan";}
		
		alert("U heeft niet alle velden ingevuld\n"+toev);
		return false;
		}
	}

// VOOR BOUNCING POP UP met Eddy Rakers

yAs=-600;
dropY=12;
tel=0;
bot=65;
tp=bot-30;
direction=1;

	
	
function drop(n)
	{
	if (direction==1) 
		{
		yAs+=dropY;
		}
		else
		{
		yAs-=dropY;
		}
	document.getElementById("bounceBox").style.top=(yAs+"px");
	document.getElementById("bounceBox").style.left=(xClientWidth()/2-300)+"px";
	if (yAs>bot & tel==0)				{dropY--;direction=-1;tel++;}
	if (yAs<tp+(tel*4) & tel==1)		{dropY--;direction=1;tel++;}
	if (yAs>bot & tel==2)				{dropY--;direction=-1;tel++;}
	if (yAs<tp+(tel*4) & tel==3)		{dropY--;direction=1;tel++;}
	if (yAs>bot & tel==4)				{clearInterval(bounce);}
	if (yAs<tp+(tel*4) & tel==5)		{dropY--;direction=1;tel++;}
	if (yAs>bot & tel==6) 				{clearInterval(bounce);}
	}

// Cookie functies

function Set_Cookie( name, value, expires, path, domain, secure ) 
	{
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	/*
	if the expires variable is set, make the correct 
	expires time, the current script below will set 
	it for x number of days, to make it for hours, 
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires )
		{
		expires = expires * 1000 * 60 * 60 * 24;
		}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
	}

// this function gets the cookie, if it exists
function Get_Cookie( name )
	{
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) )
		{
		return null;
		}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
	}
