//Popupmaten en tijdsduur

var PopupWidth=275;
var PopupHeight=150;
var popupposition=-1;	//kan overschreven worden vanuit xslt voor het aangeven van een vaste positie waar popup verschijnt
var AtlasMapPopup=650;
var PopupTime=0; //tijd dat popup op het scherm blijft in seconden, is deze waarde 0 dan gaat deze niet naar beneden
var windowStep = 4; // stapgrootte popup
var moveSpeed = 5; // snelheid popup (groter is langzamer)
// breedte van messagebox
var MsgBoxWidth=600;
var MsgBoxHeight=400;
var blnAddEventLog=false;
var strAddEventLog="";
var XlinkDivReminder="";
if (document.layers) 
{
        document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove=getMouseXY;
vtvHelpOnScreen=false;
var mouseX=0;
var mouseY=0;
var mouseXAbs=0;
var mouseYAbs=0;
var windowX = 0;
var windowY = 0;
var window0=0;
var windowYnow=0;
var windowYstop=0;
var timer;
var timer2;
var Yoffset=0;
var windowW=0;
var windowH=0;
var activeLayer="";
var PopupLayerName="PopupLaag";
var DragOffsetX=0;
var DragOffsetY=0;
var MouseDown=false;
var LayerIdCounter=0;
document.write("<div>");
if (navigator.appName.indexOf("Netscape")>-1 && navigator.appVersion.indexOf('4.')>-1)
		{
			document.write("<layer id=\"" + PopupLayerName + "\"   left='" + windowX + "' top='" +  windowY + "' VISIBILITY='hidden'\" class=\"alertFrame\">&nbsp;</layer>\n");
		}
		else
		{		
			document.write("<span id=\"" + PopupLayerName + "\" style='position:absolute; visibility:hidden;z-index:400001;left:" +  windowX + "px;top:" +  windowY + "px; width=" + windowW + "px;height="+ windowH + "px;' class=\"alertFrame\">&nbsp;</span>\n");
		}
		if (navigator.appName.indexOf("Netscape")>-1 && navigator.appVersion.indexOf('4.')>-1)
		{
			document.write("<layer id=\"" + PopupLayerName + "Twee\"   left='" + windowX + "' top='" +  windowY + "' VISIBILITY='hidden'\" >&nbsp;</layer>\n");
		}
		else
		{		
			document.write("<span id=\"" + PopupLayerName + "Twee\" style='position:absolute; visibility:hidden;z-index:400001;left:" +  windowX + "px;top:" +  windowY + "px; width=" + windowW + "px;height="+ windowH + "px;' >&nbsp;</span>\n");
		}
		if (navigator.appName.indexOf("Netscape")>-1 && navigator.appVersion.indexOf('4.')>-1)
		{
			document.write("<layer id=\"" + PopupLayerName + "Drie\"   left='" + windowX + "' top='" +  windowY + "' VISIBILITY='hidden'\">&nbsp;</layer>\n");
		}
		else
		{		
			document.write("<span id=\"" + PopupLayerName + "Drie\" style='position:absolute; visibility:hidden;z-index:400100;left:" +  windowX + "px;top:" +  windowY + "px; width=" + windowW + "px;height="+ windowH + "px;'>&nbsp;</span>\n");
		}
	document.write("</div>");	
// Algemene functies
function layerGetStyleObject(objectId) {
	// cross-browser function to get an object's style object given its id
	if(document.getElementById && document.getElementById(objectId)) 
    {
	// W3C DOM
		return document.getElementById(objectId).style;
    } 
	else if (document.all && document.all(objectId)) 
	{
		// MSIE 4 DOM
		return document.all(objectId).style;	
	} 
		else if (document.layers && document.layers[objectId]) 
		{
			// NN 4 DOM.. note: this won't find nested layers
			return document.layers[objectId];
	    } 
	else 
	{
		return false;
    }
} 
function layerGetObject(objectId) {
	// cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) 
	{
	// W3C DOM
		return document.getElementById(objectId);
	} 
	else if (document.all && document.all(objectId)) 
	{
		// MSIE 4 DOM
		return document.all(objectId);
	} 
	else if (document.layers && document.layers[objectId]) 
	{
		// NN 4 DOM.. note: this won't find nested layers
		return document.layers[objectId];
	} 
	else 
	{
		return false;
	}
} 
function layerChangeVisibility(objectId, newVisibility) 
{
	// get a reference to the cross-browser style object and make sure the object exists
	var styleObject = layerGetStyleObject(objectId);
	if(styleObject) {
		styleObject.visibility = newVisibility;
    } 
    else 
    {
		// we couldn't find the object, so we can't change its visibility
		//	return false;
	}
}
function layerMove(objectId, newXCoordinate, newYCoordinate) {
	// get a reference to the cross-browser style object and make sure the object exists
	// alert(getStyleObject(objectId)+ " "+ objectId)
	//alert(objectId + " " + newXCoordinate + " " + newYCoordinate);
	
	var styleObject = layerGetStyleObject(objectId);
	
	if ((newXCoordinate+" ").indexOf("px")==-1)
	{
		newXCoordinate+= "px";
		
	}
	if ((newYCoordinate+" ").indexOf("px")==-1)
	{
		newYCoordinate+= "px";
		
	}
	if(styleObject) 
	{
	// JB: px toegevoegd anders gaat FireFox over de zeik....
		styleObject.left = newXCoordinate; 
		styleObject.top = newYCoordinate;
	} 
	else 
	{
		// we couldn't find the object, so we can't very well move it
		//	return false;
	}
	//alert(styleObject.left);
}
function getlayerLeft(objectId) 
{
	var styleObject = layerGetStyleObject(objectId);
	if(styleObject) 
    {
		return styleObject.left ;
	}
	else
	{
		return 0;
	}
}
function getlayerTop(objectId) 
{
	// get a reference to the cross-browser style object and make sure the object exists
	var styleObject = layerGetStyleObject(objectId);
	if(styleObject) 
	{
		return styleObject.top;
	}
	else
	{
		return 0;
	}
} 
function layerWrite(objectId,txt) {

	if(document.getElementById && document.getElementById(objectId)) 
	{
		// W3C DOM
		document.getElementById(objectId).innerHTML=txt;
	} 
	else if (document.all && document.all(objectId)) 
	{
		// MSIE 4 DOM
		document.all(objectId).innerHTML=txt;
	} 
	else if (document.layers && document.layers[objectId]) 
	{
		// NN 4 DOM.. note: this won't find nested layers
		document.layers[objectId].document.open();
		document.layers[objectId].document.write(txt);
		document.layers[objectId].document.close();
	} 
	else 
	{
	}
}
function getLayerHeight(objectId) 
{
	if(document.getElementById && document.getElementById(objectId)) 
	{
		// W3C DOM
		return document.getElementById(objectId).height;
    } 
	else if (document.all && document.all(objectId)) 
	{
		// MSIE 4 DOM
		return document.all(objectId).style.height;
	} 
	else if (document.layers && document.layers[objectId]) 
	{
		// NN 4 DOM.. note: this won't find nested layers
		return document.layers[objectId].clip.height;
		} 
	else 
	{
		return 0;
	}
}
function getLayerWidth(objectId) 
{
	if(document.getElementById && document.getElementById(objectId)) 
	{
		// W3C DOM
		return document.getElementById(objectId).style.width;
	} 
	else if (document.all && document.all(objectId)) 
	{
		// MSIE 4 DOM
		return document.all(objectId).style.width;
	} 
	else if (document.layers && document.layers[objectId]) 
	{
		// NN 4 DOM.. note: this won't find nested layers
		return document.layers[objectId].clip.width;
	} 
	else 
	{
		return 0;
	}
}
function layerResizeTo(objectId,wL,hL) 
{
	if(document.getElementById && document.getElementById(objectId)) 
	{
		// W3C DOM
		document.getElementById(objectId).height=hL;
		document.getElementById(objectId).style.width=wL;
	} 
	else if (document.all && document.all(objectId)) 
	{
		// MSIE 4 DOM
		document.all(objectId).style.height=hL;
		document.all(objectId).style.width=wL;
	} 
	else if (document.layers && document.layers[objectId]) 
	{
		// NN 4 DOM.. note: this won't find nested layers
		document.layers[objectId].clip.height=hL ;
		document.layers[objectId].clip.width=wL;
	} 
	else 
	{
	}
}
function getImageLeft(imageId, layerId) 
{
	pos=0;
	layerPos = getlayerLeft(layerId);
	if (document.all && document.all(imageId)) 
	{
		pos = layerPos + document.all[imageId].offsetLeft;
	} 
	else if (document.getElementById && document.getElementById(imageId)) 
	{
		pos = document.getElementById(imageId).offsetLeft;
	} 
	else 
	{
		if (document.layers[layerId])
		{
			if (layerId != null && document.layers[layerId].document.images[imageId]) 
			{
				pos = layerPos + document.layers[layerId].document.images[imageId].x;
			}
		} 
		else 
		{
			if (document.images[imageId])
			{
				pos = document.images[imageId].x;
			}
		}
	}
	return pos;
}
function getImageTop(imageId, layerId) 
{
	pos=0;
	layerPos = getlayerTop(layerId);
	if (document.all && document.all(imageId)) 
	{
		pos = layerPos + document.all[imageId].offsetTop;
	} 
	else if (document.getElementById && document.getElementById(imageId)) 
	{
		pos = document.getElementById(imageId).offsetTop;
	} 
	else 
	{
		if (document.layers[layerId])
		{
			if (layerId != null && document.layers[layerId].document.images[imageId]) 
			{
				pos = layerPos + document.layers[layerId].document.images[imageId].y;
			}
		} 
		else 
		{
			if (document.images[imageId])
			{
				pos = document.images[imageId].y;
			}
		}
	}
	return pos;
}
function util_getAbsoluteTop(oName,oElement)
{
	if(document.all)
	{
		if(oElement.offsetParent == null)
		{
			return oElement.offsetTop;
		}
		else
		{
			return oElement.offsetTop + util_getAbsoluteTop("",oElement.offsetParent);
		}
	}
	else
	{
		if(document.getElementById )
		{
			if(oElement.offsetParent)
			{       
				if (oElement.offsetTop!=0)
				{
					return oElement.offsetTop; 
				}
				else
				{
					if(oElement.offsetParent == null)
					{
						return oElement.offsetTop ;
					}
					else
					{
						return oElement.offsetTop + util_getAbsoluteTop("",oElement.offsetParent);     
					}
				}
			}
			else
			{
				return 0;
			}
		}
		else
		{
			return document.images[oName].y;
		} 
	}
}
function util_getAbsoluteLeft(oName, oElement)
{
	if(document.all)
	{
		if(oElement.offsetParent== null)
		{
			return oElement.offsetLeft;
		}
		else
		{
			return oElement.offsetLeft + util_getAbsoluteLeft("",oElement.offsetParent);
		}
	}
	else
	{
		if(document.getElementById )
		{
			if(oElement.offsetParent)
			{
				if(oElement.offsetParent == null)
				{
					return oElement.offsetLeft; 
				}
				else
				{
					return oElement.offsetLeft + util_getAbsoluteLeft("",oElement.offsetParent);     
				}
			}
			else
			{
				return 0;
			}
		}
		else
		{
			return document.images[oName].x;
		}
	} 
	return 0;
}
function getMouseXYOld(e) 
{
	if (document.all) 
	{ // grab the x-y pos.s if browser is IE
		mouseX=  event.x;
		mouseY = event.y;
		var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body;
		var scrollYoffset=document.all? iebody.scrollTop : pageYOffset;
		var scrollXoffset=document.all? iebody.scrollLeft : pageXOffset;
		//		windowY = iebody.clientHeight+scrollYoffset;
		mouseXAbs= scrollXoffset+event.x;
		mouseYAbs=scrollYoffset+event.y;
		//alert(e.pageX)
	} 
	else 
	{  // grab the x-y pos.s if browser is NS
		mouseX =e.pageX;
		mouseY =e.pageY; 
		mouseXAbs = e.pageX;
		mouseYAbs = e.pageY; 
	}  
	// catch possible negative values in NS4
	if (mouseX < 0)
	{
		mouseX = 0;
	}
	if (mouseY < 0)
	{
		mouseY = 0;
	}  
	if (MouseDown==true)
	{
		PopupLayerDrag();
	}
	return true;
}
function getMouseXY(e) // works on IE6,FF,Moz,Opera7
{ 
  if (!e) e = window.event; // works on IE, but not NS (we rely on NS passing us the event)

  if (e)
  { 
    if (e.pageX || e.pageY)
    { // this doesn't work on IE6!! (works on FF,Moz,Opera7)
      mouseX = e.pageX;
      mouseY = e.pageY;
      mouseXAbs = e.pageX;
      mouseYAbs = e.pageY;
     //alert(mouseX);
      //algor = '[e.pageX]';
      //if (e.clientX || e.clientY) algor += ' [e.clientX] '
    }
    else if (e.clientX || e.clientY)
    { // works on IE6,FF,Moz,Opera7
      mouseX = e.clientX;
      mouseY = e.clientY ;
      var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body;
	  var scrollYoffset=document.all? iebody.scrollTop : pageYOffset;
	  var scrollXoffset=document.all? iebody.scrollLeft : pageXOffset;
      mouseXAbs = mouseX + scrollXoffset;
      mouseYAbs = mouseY + scrollYoffset;
      //if (e.pageX || e.pageY) algor += ' [e.pageX] '
    }  
  }
}

function util_toId(str) 
{
	// filter 'bad' characters and make a neat id
	badChars = '\'.-+=\\\/" &';
	newStr = '';
	for(var i=0; i<str.length; i++) 
	{
		if (badChars.indexOf(str.charAt(i)) == -1) newStr += str.charAt(i);
	}
	return newStr.toLowerCase();
}
	
// Specifiek voor redactiesysteem ontwikkelde functies
function menuObj(strName, strHelpText, strImageName, strURL, blnEnabled, strTarget)
{
	// in tegenstelling tot vorige versies dient het volledige pad ingegeven te worden bij de naam van een plaatje
	if (strImageName=="blank_0.gif")
	{
		strImageName=ImageDir() + "images/blank_0.gif";
	}
	this.items = new Array();  
	this.add=menuObj_add;
	this.addSeperator=menuObj_addSeperator;
	this.clear=menuObj_clear;
	this.align=menuObj_align;
	this.show=menuObj_show;
	this.addSubMenu=menuObj_addSubMenu;
	this.writeHtml=menuObj_writeHtml;
	this.setItemEnabled=menuObj_setItemEnabled;
	this.boxleft=0;
	this.boxtop=0;
	this.boxwidth=0;
	this.boxheight=0;
	this.CheckAlignment=null;
	this.writeMenuItems=true;
	strImg2="";
	if(!strName && !strHelpText && !strImageName && !strURL && !blnEnabled && !strTarget)
	{
		this.name = "lay"+LayerIdCounter;
		LayerIdCounter++;
		this.helpText="";
		this.imageName="";
		this.url = "";
		this.enabled=true;
		this.target="";
		strImgName="";
	}
	else
	{
		this.name = strName;
		this.helpText=strHelpText;
		this.imageName=strImageName;
		this.url = strURL;
		this.enabled=blnEnabled;
		this.target=strTarget;
		strImgName=util_toId(this.name+"img");
		strImg1=this.imageName.substring(0,this.imageName.length-5);
		strImg2=this.imageName.substring(this.imageName.length-5,this.imageName.length-4);
		strImg3=this.imageName.substring(this.imageName.length-4);
	}
	this.strImgName=strImgName;
	strHtml="";
	if (this.enabled==true)
	{
		if (this.url!="")
		{
			strHtml="&nbsp;<a class='menuItem' href='" + this.url + "' title='" + this.helpText + "'";
			if (this.target)
			{
				strHtml=strHtml + " target='" + this.target + "'";
			}
		}
		else
		{
			strHtml="&nbsp;<a class='menuItem' href='javascript:alignMenus();layersHide();activeLayer=\"" + util_toId(this.name+"sub") + "\";layerChangeVisibility(\"" + util_toId(this.name+"sub") + "\", \"visible\")' title='" + this.helpText + "'";
		}
		statusBarText="window.status=\"" +strHelpText + "\"";
		if (strImg2=="0" )
		{
			strHtml=strHtml + " onMouseOver='document.images[\"" + strImgName + "\"].src=\""+strImg1+"1"+strImg3+"\";" + statusBarText + "'";
			strHtml=strHtml + " onMouseOut='document.images[\"" + strImgName + "\"].src=\""+ strImg1+"0"+strImg3+"\";window.status=\"\"'";
		}
		else
		{
			strHtml=strHtml + " onMouseOver='" + statusBarText + "'";
			strHtml=strHtml + " onMouseOut='window.status=\"\"'";
		}
		strHtml=strHtml + ">";
		
		if (this.imageName=="blank_0.gif" || this.imageName.substring(this.imageName.length-11)=="blank_0.gif")
		{
			strHtml= strHtml + "<img src='"+ this.imageName +  "' id='" + strImgName + "' name='" + strImgName + "' border='0' align='absmiddle' width='1' height='1'>" +  this.name + "</a>";       
		}
		else
		{
			strHtml= strHtml + "<img  src='"+ this.imageName +  "' id='" + strImgName + "' name='" + strImgName + "' border='0' align='absmiddle' width='16' height='16'>&nbsp;" +  this.name + "</a>";
		}
		strHtml="<span  class='menuItem'>" + strHtml + "</span>";
		if(!strName && !strHelpText && !strImageName && !strURL && !blnEnabled && !strTarget)
		{
			theTopcor=0;
			theLeftcor=0;
		}
		else
		{
			document.write(strHtml);
			theTopcor=getImageTop(strImgName,this)+20;         
			theLeftcor= getImageLeft(strImgName, util_toId(this.name+"_0"));
			this.boxtop=theTopcor;
			this.boxleft=theLeftcor;
		}
		if (this.url=="")
		{
			if (navigator.appName.indexOf("Netscape")>-1 && navigator.appVersion.indexOf('4.')>-1)
			{
				document.write("<layer id=\"" + util_toId(this.name+"sub") + "\"   left='" + theLeftcor + "' top='" +  theTopcor + "' VISIBILITY='hidden'  onMouseOut=\"layerChangeVisibility('" + util_toId(this.name+"sub") + "','hidden')\">&nbsp;</layer>\n");       
			}
			else
			{
			
				document.write("<span id=\"" + util_toId(this.name+"sub") + "\" onClick=\"layerChangeVisibility('" + util_toId(this.name+"sub") + "','hidden')\"  style='position:absolute; visibility:hidden;z-index:" + (LayerIdCounter + 400002) + ";left:" +  theLeftcor + "px;top:" +  theTopcor + "px;'>&nbsp;</span>\n");
			}                
		}
	}
	else
	{
		strHtml="<span class='menuItemMemberOff'>&nbsp;<img src='"+ strImg1 + "d.gif' name='" + strImgName  + "' border='0' align='absmiddle' width='16' height='16'>&nbsp;" +  this.name + "</span>\n";
		document.write(strHtml);
	}
}
	
function menuObj_addSubMenu(strName, strHelpText, strImageName,objMenuItem,strArrowImageName,CheckAlignment)
{
if (strImageName=="blank_0.gif")
	{
		strImageName=ImageDir() + "images/blank_0.gif";
	}
	imgName=util_toId("img"+LayerIdCounter);                        
	LayerIdCounter++;
	if(CheckAlignment)
	{
		this.add(strName + "&nbsp;<span align='right'><img src='" +strArrowImageName+ "' border=0 align='absmiddle' name='" + imgName  + "'></span>", strHelpText,strImageName,"javascript:"+ objMenuItem +".show(util_getAbsoluteLeft(\""+ imgName + "\",layerGetObject(\"" + imgName + "\"))+15,util_getAbsoluteTop(\""+ imgName + "\",layerGetObject(\"" + imgName + "\"))-3," + CheckAlignment + ")",true);
	}
	else
	{
		this.add(strName + "&nbsp;<span align='right'><img src='" +strArrowImageName+ "' border=0 align='absmiddle' name='" + imgName  + "'></span>", strHelpText,strImageName,"javascript:"+ objMenuItem +".show(util_getAbsoluteLeft(\""+ imgName + "\",layerGetObject(\"" + imgName + "\"))+15,util_getAbsoluteTop(\""+ imgName + "\",layerGetObject(\"" + imgName + "\"))-3)",true);
	}
}
function menuObj_clear()
{
	layerWrite(util_toId(this.name+"sub"),"&nbsp;");
	this.items = new Array();  
}
function removePopupLayerFromHideList()
{
	layerArr=activeLayer;
	layerArr=layerArr.split(',');
	for (i=0; i<layerArr.length; i++) {
		if (layerArr[i]!=PopupLayerName)
		{
			activeLayer+=layerArr[i] + ","
		}
		//alert(layerArr[i]);
	}
}
function layersHide()
{

	layerArr=activeLayer;
	if (layerArr!="")
	{
	layerArr=layerArr.split(',');
		for (i=0; i<layerArr.length; i++) {
		layerChangeVisibility(layerArr[i],'hidden');
		}
	}
}
function menuObj_show(theLeftcor,theTopcor,CheckAlignment)
{

	if(this.writeMenuItems==false)
	{
		this.writeHtml();
	}
	if(theTopcor<0)
	{       
		theLeftcor=mouseX;
		theTopcor=mouseY;
	}
	//alert(mouseX + " " + mouseY)
	var windowWidth=0;
	if(CheckAlignment)
	{
	this.CheckAlignment=CheckAlignment;
	if (document.all) 
	{
		if (document.body)
		{
			windowWidth = document.body.clientWidth;
			
			
		}
	}
	else
	{	windowWidth = window.innerWidth;
	}
		if(Math.abs(windowWidth-theLeftcor)<150)
		{
			theLeftcor=theLeftcor-150;
		}
	}
		
	//alert(layerGetStyleObject(util_toId(this.name+"sub")).zIndex)
	//alert (theLeftcor + "  " + theTopcor)
	layerMove(util_toId(this.name+"sub"),theLeftcor,theTopcor);
    layerArr=activeLayer;
	layerArr=layerArr.split(',');
	if (layerArr.length>1)
	{
		activeLayer=layerArr[0];
	}
	if (activeLayer=="")
	{
		activeLayer=util_toId(this.name+"sub");
	}
	else
	{
		activeLayer=activeLayer + "," + util_toId(this.name+"sub");
	}
	
	layerArr=activeLayer;
	layerArr=layerArr.split(',');
	for (i=0; i<layerArr.length; i++) {
		layerChangeVisibility(layerArr[i],'visible');
	}
}
function menuObj_align()
{
	if (this.url=="")
	{
		theTopcor=util_getAbsoluteTop(this.strImgName,layerGetObject(this.strImgName))+12;
		theLeftcor=util_getAbsoluteLeft(this.strImgName,layerGetObject(this.strImgName) ) ;
		this.boxleft=theLeftcor;
		this.boxtop=theTopcor;
		layerMove(util_toId(this.name+"sub"),theLeftcor,theTopcor)       ;
		layerResizeTo(util_toId(this.name+"sub"),240,550)       ;
	}
}
function menuItemObj(strName, strHelpText, strImageName, strURL, blnEnabled, strTarget,strExternalId)
{
	this.name = strName;
	this.helpText=strHelpText;
	this.imageName=strImageName;
	this.url = strURL;
	this.enabled=blnEnabled;
	this.target=strTarget;
	this.externalId=strExternalId;
}
function layersHideNetscape()
{
        if (navigator.appName.indexOf("Netscape")>-1 && navigator.appVersion<5)
        {   
			layersHide();
		}
}
function menuObj_addSeperator()
{
	this.add("add_seperator")
}
function menuObj_add(strName, strHelpText, strImageName, strURL, blnEnabled, strTarget,strExternalId)
{
	this.items[this.items.length] = new menuItemObj(strName, strHelpText, strImageName, strURL, blnEnabled, strTarget,strExternalId);
	if(this.writeMenuItems==true)
	{
		this.writeHtml();
	}
}
function menuObj_writeHtml()
{
	if (navigator.appName.indexOf("Netscape")>-1 && navigator.appVersion.indexOf('4.')>-1)
	{
		strHtml="<table class='menuTable'  border=2 bordercolor='#003333' cellspacing='0' cellpadding='0'><tr class='menuItemFrame'><td class='menuItemFrame'>";
	}
	else
	{
		strHtml="<table class='menuTable'  border=0><tr><td style='white-space:nowrap;' class='menuItemFrame'>";
	}
	for (i=0; i<this.items.length; i++) 
	{
		if(this.items[i].name == "add_seperator"){
			strHtml+="<img src='" + ImageDir() + "images/menuseperator.gif' width='200' height='3'><br>";
		}
		else
		{
		strImgName="img"+LayerIdCounter;
		
		LayerIdCounter++;
		
		  //util_toId("img"+Math.random()*100+"_"+Math.random()*100);
		if (this.items[i].imageName!="")
		{
			strImg1=this.items[i].imageName.substring(0,this.items[i].imageName.length-5);
			strImg2=this.items[i].imageName.substring(this.items[i].imageName.length-5,this.items[i].imageName.length-4);
			strImg3=this.items[i].imageName.substring(this.items[i].imageName.length-4);
		}
		else
		{
			strImg1="";
			strImg2="";
			strImg3="";
		}
		if (this.items[i].enabled==true)
		{
			if (this.items[i].imageName!=""){
				strHtml2="<span class='menuItemImageColor'>&nbsp;</span>";
			}
			strExterNalId="";
			strExterNalText="";
			if (this.items[i].externalId!="" && this.items[i].externalId!=null)
			{
				strExterNalId="Id='" + this.items[i].externalId + "'";
				strImgName="" + this.items[i].externalId + "Img";
				strExterNalText="Id='" + this.items[i].externalId + "Txt'";
				
			}
			if (this.items[i].url!="")
			{
				
				strHtml2="<a " + strExterNalId + " class='menuItemMember' href='" + this.items[i].url + "' title='" + this.items[i].helpText + "'";
			}
			else
			{
				strHtml2="<a " + strExterNalId + " class='menuItemMember' href='javascript:activeLayer=\"" + util_toId(this.items[i].name+"_1") + "\";layerChangeVisibility(\"" + util_toId(this.items[i].name+"_1") + "\", \"visible\")' title='" + this.items[i].helpText + "'";
			}
			if (strImg2=="0" )
			{
				strHtml2=strHtml2 + " onMouseOver='document.images[\"" + strImgName + "\"].src=\""+ strImg1+"1"+strImg3+"\"'";
				strHtml2=strHtml2 + " onMouseOut='document.images[\"" + strImgName + "\"].src=\""+ strImg1+"0"+strImg3+"\"'";
			}
			if (this.items[i].target)
			{
				strHtml2=strHtml2 + " target='" + this.items[i].target + "'";
			}
			strHtml2=strHtml2 + ">";
			if (this.items[i].imageName!=""){
		
				if (this.items[i].imageName=="blank_0.gif" || this.items[i].imageName.substring(this.items[i].imageName.length-11)=="blank_0.gif")
				{
					strHtml2= strHtml2 + "<span class='menuItemImageColor'><img  src='"+ this.items[i].imageName +  "' id='" + strImgName + "' name='" + strImgName + "' border='0' align='absmiddle' width='1' height='1'></span>";
				}
				else
				{
					strHtml2= strHtml2 + "<span class='menuItemImageColor'><img  src='"+ this.items[i].imageName +  "' id='" + strImgName + "' name='" + strImgName + "' border='0' align='absmiddle' width='16' height='16'></span>&nbsp;";
				}
			}
			strHtml2= strHtml2 + this.items[i].name + "</a>&nbsp;<br>";
			strHtml=strHtml+"" + strHtml2 + "";
		}
		else
		{
			strHtml=strHtml + "<span class='menuItemMemberOff'>";
			if (this.items[i].imageName!="")
			{
				strHtml=strHtml + "<span class='menuItemImageColor'>";
				if (this.items[i].externalId!='')
				{
					strHtml=strHtml + "<img src='"+ this.items[i].imageName + "' style='filter:gray() alpha(opacity=35)' name='" + strImgName  + "' border='0' align='absmiddle' width='16' height='16'></span>";
				}
				else
				{
					strHtml=strHtml + "<img src='"+ strImg1 + "d.gif' name='" + strImgName  + "' border='0' align='absmiddle' width='16' height='16'></span>";
				}
			}
			strHtml=strHtml + "&nbsp;" +  this.items[i].name + "</span><br>";
			
		}}
	}
	strHtml=strHtml + "</td></tr></table> ";
	layerWrite(util_toId(this.name+"sub"),strHtml);
}
function menuObj_setItemEnabled(ItemId,Enable,blnWriteHtml)
{
	for (ppi=0; ppi<this.items.length; ppi++) 
	{
		if(this.items[ppi].externalId==ItemId)
		{
		
			this.items[ppi].enabled=Enable;
		}
	}
	if (blnWriteHtml==true){
		this.writeHtml();
	}
}
function showHelp(strHelpText, imgName,intWidthBox,intHeightBox,intTimeout)
{
		
        if(imgName)
        {
        }
        else
        {
			if (ImgPath){
				imgName=ImgPath+"help_1.gif";
			}
			else
			{
				imgName="help_1.gif";
			}
        }
        if (intWidthBox)
        {
        }
        else
        {
			intWidthBox=PopupWidth;
        }
        if (intHeightBox)
        {
        }
        else
        {
			intHeightBox=PopupHeight;
        }
        if (intTimeout)
        {
        }
        else
        {
			intTimeout=PopupTime;
        }
        //PopupLayerName=util_toId("img"+Math.random()*100+"_"+Math.random()*100);
        if(strHelpText.length>350 & intHeightBox==PopupHeight)
		{
			if(strHelpText.length>350){
				intHeightBox+=100;
			}
			else
			{
				intHeightBox+=60;
			}
		}
        if(document.layers)
		{
			tmpStr="<table class='AlertTable' cellspacing='0' width='" + intWidthBox + "' border='0'><tr><td onmouseup='PopupLayerDragEnd();' onmousedown='PopupLayerDragStart();' bgcolor='#EEEEEE'  background='" + ImageDir() + "images/popup_background.jpg' valign='top' class='alertHead'    bgcolor='#EEEEEE' height='22'><p align='right'><img src='" + imgName +"' align='left'><a href='javascript:layerChangeVisibility(\"" + PopupLayerName + "\", \"hidden\");' title='" + getResourceNW("rsi.aspx.close") + "'><img src='" + ImageDir() + "images/popup_close.jpg' align='absmiddle' border='0'></a></td></tr><tr  bgcolor='#EEEEEE'><td class='alertBodyBorder' height='" + (intHeightBox - 22) + "'><p align='Center'>" + strHelpText +"</p></td></tr></table>";
		}
		else
		{
			
			tmpStr="<table  class='AlertTable' cellspacing='0' width='" + intWidthBox + "' border='0'><tr><td   bgcolor='#EEEEEE' onmouseup='PopupLayerDragEnd();' onmousedown='PopupLayerDragStart();' background='" + ImageDir() + "images/popup_background.jpg' valign='top' class='alertHead'   bgcolor='#EEEEEE' height='22'><div  align='right'><img src='" + imgName+"' align='left' ><a href='javascript:layerChangeVisibility(\"" + PopupLayerName + "\", \"hidden\");' class='alertHead'><img src='" + ImageDir() + "images/popup_close.jpg' align='absmiddle' border='0'></a></div></td></tr><tr bgcolor='#EEEEEE'><td  class='alertBodyBorder' height='" + (intHeightBox - 22) + "'><div align='Center'>" + strHelpText + "</div></td></tr></table>";
		}
		strHelpText= tmpStr;
		
		showPopup(strHelpText,intWidthBox,intHeightBox,intTimeout,PopupLayerName);
	
}
function showHelpCmsApp(strHelpText, imgName,intWidthBox,intHeightBox,intTimeout)
{
		
        if(imgName)
        {
        }
        else
        {
			if (ImgPath){
				imgName=ImgPath+"help_1.gif";
			}
			else
			{
				imgName="help_1.gif";
			}
        }
        if (intWidthBox)
        {
        }
        else
        {
			intWidthBox=PopupWidth;
        }
        if (intHeightBox)
        {
        }
        else
        {
			intHeightBox=PopupHeight;
        }
        if (intTimeout)
        {
        }
        else
        {
			intTimeout=PopupTime;
        }
        //PopupLayerName=util_toId("img"+Math.random()*100+"_"+Math.random()*100);
        if(strHelpText.length>350 & intHeightBox==PopupHeight)
		{
			if(strHelpText.length>350){
				intHeightBox+=100;
			}
			else
			{
				intHeightBox+=60;
			}
		}
        if(document.layers)
		{
			tmpStr="<table class='AlertTableCms' cellspacing='0' width='" + intWidthBox + "' border='0'><tr><td onmouseup='PopupLayerDragEnd();' onmousedown='PopupLayerDragStart();' bgcolor='#EEEEEE'  background='" + ImageDir() + "images/popup_background.jpg' valign='top' class='alertHeadCms'    bgcolor='#EEEEEE' height='22'><p align='right'><img src='" + imgName +"' align='left'><a href='javascript:layerChangeVisibility(\"" + PopupLayerName + "\", \"hidden\");' title='" + getResourceNW("rsi.aspx.close") + "'><img src='" + ImageDir() + "images/popup_close.jpg' align='absmiddle' border='0'></a></td></tr><tr  bgcolor='#EEEEEE'><td class='alertBodyBorderCms' height='" + (intHeightBox - 22) + "'><p align='Center'>" + strHelpText +"</p></td></tr></table>";
		}
		else
		{
			
			tmpStr="<table  class='AlertTableCms' cellspacing='0' width='" + intWidthBox + "' border='0'><tr><td   bgcolor='#EEEEEE' onmouseup='PopupLayerDragEnd();' onmousedown='PopupLayerDragStart();' background='" + ImageDir() + "images/popup_background.jpg' valign='top' class='alertHeadCms'   bgcolor='#EEEEEE' height='22'><div  align='right'><img src='" + imgName+"' align='left' ><a href='javascript:layerChangeVisibility(\"" + PopupLayerName + "\", \"hidden\");' class='alertHeadCms'><img src='" + ImageDir() + "images/popup_close.jpg' align='absmiddle' border='0'></a></div></td></tr><tr bgcolor='#EEEEEE'><td  class='alertBodyBorderCms' height='" + (intHeightBox - 22) + "'><div align='Center'>" + strHelpText + "</div></td></tr></table>";
		}
		strHelpText= tmpStr;
		
		showPopup(strHelpText,intWidthBox,intHeightBox,intTimeout,PopupLayerName);
	
}
function PopupLayerDragStart()
{
//
	MouseDown=true;
	clearTimeout(timer);
	clearTimeout(timer2);
	DragOffsetX=getlayerLeft(PopupLayerName).replace("px","")-mouseX;
	DragOffsetY=getlayerTop(PopupLayerName).replace("px","")-mouseY;
	document.body.style.cursor="move";
	//document.onmouseenter=PopupLayerDragEnd;
	window.event.returnValue = false;
	//window.event.cancelBubble = true;
//window.status="PopupLayerDragStart";
}
function PopupLayerDrag()
{
	
		//getMouseXY();
		layerMove(PopupLayerName,(mouseX+DragOffsetX),(mouseY+DragOffsetY));
	//	window.status="PopupLayerDrag";
		window.document.selection.empty();
		//document.body.style.cursor="move";
		//window.status=(mouseX+DragOffsetX) + " "  + (mouseY+DragOffsetY)
	
	//window.event.returnValue = false;
	//window.event.cancelBubble = true;
}
function PopupLayerDragEnd()
{
	//getMouseXY();

	//layerMove(PopupLayerName,(mouseX+DragOffsetX),(mouseY+DragOffsetY))
	document.body.style.cursor="default";
	MouseDown=false;
	
	window.event.returnValue = false;
	window.event.cancelBubble = true;
window.status="PopupLayerDragEnd";
}
function showHelpInfo(strHelpText, imgName,intWidthBox,intHeightBox,intTimeout)
{
        if(imgName)
        {
        }
        else
        {
                        imgName="help_1.gif";
        }
        if (intWidthBox)
        {
        }
        else
        {
			intWidthBox=400;
        }
        if (intHeightBox)
        {
        }
        else
        {
			intHeightBox=250;
        }
        if (intTimeout)
        {
        }
        else
        {
			intTimeout=0;
        }
        showHelp(strHelpText,imgName,intWidthBox,intHeightBox,intTimeout);
        //PopupLayerName=util_toId("img"+Math.random()*100+"_"+Math.random()*100);
        
	
}
function showMsgBox(strMessage,imgName, backgroundImgName,hideExtraLayer)
{
	extraHideJs="";
	if (hideExtraLayer)
	{
			extraHideJs="top.window.layerChangeVisibility(\"" + hideExtraLayer + "\",\"hidden\");";
			if (hideExtraLayer=="disableeditandundo")
			{
				extraHideJs+="edxid.undo();"
			
			}
			if (hideExtraLayer=="disableeditandundo2x")
			{
			hideExtraLayer="disableeditandundo";
				extraHideJs+="edxid.undo();edxid.undo();"
			
			}
	}	
	if(imgName)
	{
	}
	else
	{
		imgName="help_1.gif";
	}
	tmpStr=strMessage; 
	tmpClass="alertBody";
	if (strMessage.indexOf('http:')>-1 || strMessage.indexOf('https:')>-1) 
	{
		tmpHeight=MsgBoxHeight-20;
		tmpStr="<iframe src='" + strMessage +  "' width='" + MsgBoxWidth + "' height='" + tmpHeight + "' scrolling='auto'><a href='" + strMessage +"' class='alertBody'>No Iframes, follow this link</a></iframe>";
		//tmpClass="vtvTabon"
	}
	else
	{
	}
   // PopupLayerName=util_toId("img"+Math.random()*100+"_"+Math.random()*100);
	if(document.layers)
	{
		if (strMessage.indexOf('http:')>-1 || strMessage.indexOf('https:')>-1) 
		{
			window["Subwindow"] = window.open(strMessage, "Subwindow", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=yes,width="+ MsgBoxWidth + ",height="+MsgBoxHeight); 
		}
		else
		{
			tmpHeight=MsgBoxHeight-20;
			tmpStr="<table  cellspacing='0' width='" + MsgBoxWidth + "' border='1'><tr><td onmouseup='PopupLayerDragEnd();' onmousedown='PopupLayerDragStart();'  valign='top' class='alertBody'  height='" + tmpHeight + "' background='" + backgroundImgName + "'><p align='right'><img src='" + imgName +"' align='left'><a href='javascript:layerChangeVisibility(\"" + PopupLayerName + "\",\"hidden\");' title='" + getResourceNW("rsi.aspx.close") + "'><img src='" + ImageDir() + "images/popup_close.jpg' border='0' align='absmiddle'></a></p><p align='Center'>" + tmpStr +"</p></td></tr></table>";
		}
	}
	else
	{
		tmpStr="<table  cellspacing='0' width='" + MsgBoxWidth + "' border='1'><tr ><td onmouseup='PopupLayerDragEnd();' onmousedown='PopupLayerDragStart();'  valign='top' class='" + tmpClass + "'  height='" + MsgBoxHeight + "' ><div   align='right'><img    src='" + imgName+"' align='left'><a class='" + tmpClass + "' href='javascript:layerChangeVisibility(\"" + PopupLayerName + "\",\"hidden\");" + extraHideJs + "' class='alertHead'><img src='" + ImageDir() + "images/popup_close.jpg' border='0' align='absmiddle'></a></div><br><div align='Center'>" + tmpStr + "</div></td></tr></table>";
	}
	strMessage=tmpStr;
	if(document.layers & strMessage.indexOf('http')>-1)
	{
	}
	else
	{
		
		scrollYoffset=0;
		if (document.all) 
		{
			if (document.body)
			{
				windowX = document.body.clientWidth/2-MsgBoxWidth/2;
				windowY = document.body.clientHeight/2 -MsgBoxHeight/2;
			}
		}
		else
		{	
			windowX = window.innerWidth/2-MsgBoxWidth/2;
			windowY = window.innerHeight/2 -MsgBoxHeight/2		;
		}
		layerWrite(PopupLayerName,strMessage);
		layerMove(PopupLayerName,windowX,windowY);
		layerResizeTo(PopupLayerName,MsgBoxWidth,MsgBoxHeight);
		layerChangeVisibility(PopupLayerName,"visible");
	}
}
//function showPopupAtMousePosition(strMessage,intWidth,intHeight,intTime,PopupLayerName)
//{
	//if (PopupLayerName)
	//{
//	}
//	else
//	{
	//	PopupLayerName=util_toId("img"+Math.random()*100+"_"+Math.random()*100);
//	}
	
	
//	vtvHelpOnScreen=false;
//	windowX=mouseX; //+window.document.body.scrollLeft;
//	windowY=mouseY; //+window.document.body.scrollTop;
//	alert(windowX+ " "+ windowY)
//	activeLayer=activeLayer+PopupLayerName;
//	layerWrite(PopupLayerName,strMessage);
//	layerMove(PopupLayerName,windowX,windowY);
//	layerResizeTo(PopupLayerName,intWidth,0);
//	layerChangeVisibility(PopupLayerName,"visible");
//	
//}
function showPopup(strMessage,intWidth,intHeight,intTime,PopupLayerName,FixedX)

{
	if (PopupLayerName)
	{
	}
	else
	{
	//	PopupLayerName=util_toId("img"+Math.random()*100+"_"+Math.random()*100);
	}
	
	if (vtvHelpOnScreen==true)
	{
		clearTimeout(timer);
		clearTimeout(timer2);
	}
	vtvHelpOnScreen=false;
	scrollYoffset=0;
	if(FixedX)
	{
		windowX=FixedX;
		if (document.all) 
		{	
			if (document.body)
			{
				
				scrollYoffset=window.document. body. scrollTop;
				windowY = document.body.clientHeight+scrollYoffset;
			}	
		}
		else
		{	
			windowY = window.innerHeight+self.pageYOffset;
		}
	}
	else
	{
		if (document.all) 
		{
			if (document.body)
			{
				if (popupposition==-1)
				{
					windowX = document.body.clientWidth-intWidth-20;
				}
				else
				{
					windowX = popupposition;
				}
				var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body;
				var scrollYoffset=document.all? iebody.scrollTop : pageYOffset;
				windowY = iebody.clientHeight+scrollYoffset;
			}
		}
		else
		{	
			windowX = window.innerWidth-intWidth-20;
			windowY = window.innerHeight+self.pageYOffset;
		}
	}
	window0=windowY;
	windowYnow=windowY;
	windowYstop = windowY-intHeight-Yoffset;
	windowW=intWidth;
	windowH=intHeight;
	if (navigator.appName.indexOf("Netscape")>-1 && navigator.appVersion.indexOf('4.')>-1)
	{
	//	document.write("<layer id=\"" + PopupLayerName + "\"   left='" + windowX + "' top='" +  windowY + "' VISIBILITY='hidden'\">&nbsp;</layer>\n");       
	}
	else
	{
		
	//	document.write("<span id=\"" + PopupLayerName + "\" style='position:absolute; visibility:hidden;z-index:1;left:" +  windowX + "px;top:" +  windowY + "px; width=" + windowW + "px;height="+ windowH + "px;'>&nbsp;</span>\n");
	
	}
	// alert(PopupLayerName);
	activeLayer=activeLayer+PopupLayerName;
	layerWrite(PopupLayerName,strMessage);
	layerMove(PopupLayerName,windowX,windowY);
	layerResizeTo(PopupLayerName,intWidth,0);
	layerChangeVisibility(PopupLayerName,"visible");
	util_vtvMessagePopup(PopupLayerName);
	if (intTime>0)
	{
		timer2=setTimeout("util_vtvMessagePopdown('"+PopupLayerName+"')",intTime*1000);
	}
}
function util_vtvMessagePopup(PopupLayerName)
{
	//alert(vtvHelpOnScreen)
	if (vtvHelpOnScreen==false)
	{
		tmpInt=window0-windowYnow-Yoffset;
		if (windowYnow>=windowYstop) 
		{
			layerMove(PopupLayerName,windowX,windowYnow);
			tmpInt=window0-windowYnow-Yoffset;
			layerResizeTo(PopupLayerName,windowW,tmpInt);
			//window.status=getLayerHeight(PopupLayerName);
			windowYnow=windowYnow-windowStep;
			//util_vtvMessagePopup(PopupLayerName);
			timer=setTimeout("util_vtvMessagePopup('" + PopupLayerName + "');",moveSpeed);
			//alert(moveSpeed)
		}
		else
		{
			clearTimeout(timer);
			vtvHelpOnScreen=true;
			layerMove(PopupLayerName,windowX,windowYstop);
			layerResizeTo(PopupLayerName,windowW,windowH);
		}
	}	
}
function util_vtvMessagePopdown(PopupLayerName)
{
	if (vtvHelpOnScreen==true)	
	{
		tmpInt=window0-windowYnow-Yoffset;
		if (windowYnow<=windowY) 
		{
			layerMove(PopupLayerName,windowX,windowYnow);
			tmpInt=window0-windowYnow-Yoffset;
			layerResizeTo(PopupLayerName,windowW,tmpInt);
			windowYnow=windowYnow+windowStep;
			timer=setTimeout("util_vtvMessagePopdown('" + PopupLayerName + "')",moveSpeed);
		}
		else
		{
			clearTimeout(timer);
			vtvHelpOnScreen=false;
			layerMove(PopupLayerName,0,0);
			layerChangeVisibility(PopupLayerName,"hidden");
		}	
	}
}
function showLabel(labelIn)
{

re = /&qt;/gi;
				
        tmpStr=labelIn.replace(re,"'"); 
        tmpClass="mapLabel";
        if(document.layers)
        {
	       tmpHeight=MsgBoxHeight-20;
               tmpStr="<table  cellspacing='0'  border='0'><tr><td valign='top' class='" + tmpClass + "'><p align='Center'>" + tmpStr +"</p></td></tr></table>";
        }
	else
	{
                tmpStr="<table  cellspacing='0'  border='0'><tr><td valign='top' class='" + tmpClass + "'>" + tmpStr + "</td></tr></table>";
                //'tmpStr="<table  cellspacing='0'  border='1'><tr><td valign='top' class='" + tmpClass + "'>" + tmpStr + "</td></tr></table>";
	}
        strMessage=tmpStr;
	
                layerChangeVisibility(PopupLayerName + "Twee","hidden");
	
	       //vtvHelpOnScreen=false;
                scrollYoffset=0;
	       
        
        
	       layerWrite(PopupLayerName + "Twee",strMessage);
	       layerMove(PopupLayerName + "Twee",mouseXAbs+10,mouseYAbs+10);
	       //layerResizeTo(popuplayername,0,0);
	       layerChangeVisibility(PopupLayerName + "Twee","visible");
	
               
	       
}
function hideLabel()
{
        layerChangeVisibility(PopupLayerName + "Twee","hidden");
}

function gTD(tableLabelID, textStr)
{
        if (textStr=="")
        {
                textStr="&nbsp;"
        }
//                return "<tr><td class=vtvMessageTable>"  + tableLabelsArr[tableLabelID] + "</td><td class=vtvMessageTable>" + textStr + "</td></tr>";

		if (textStr.indexOf('http:/' + '/')>-1 || textStr.indexOf('https:')>-1)
                {
                               return "<tr><td class='alertBody'>" + tableLabelsArr[tableLabelID].replace("&qt;","'") + "</td><td class='alertBody'><a class='alertBodyURL' href='" + textStr +"' target='_new'>" + textStr.replace("&qt;","'") + "</a></td></tr>";
                }
                else
                {
                        return "<tr><td class='alertBody'>" + tableLabelsArr[tableLabelID].replace("&qt;","'") + "</td><td class='alertBody'>" + textStr.replace("&qt;","'") + "</td></tr>";
                }       
		
}
function shTbl(strHelpText, imgName)
{
        if(imgName)
        {
        }
        else
        {
	      imgName= ImageDir() + "images/source_0.gif";
        }
        if(document.layers)
	{
//	tmpStr="<table cellspacing='0' width='" + PopupWidth + "' border='1'><tr><td valign='top' colspan='2' class='vtvTabon' background='" + locations.images + "greenback_large_rot.jpg'><p align='right'><img src='" + locations.images +imgName +"' align='left'><a href='javascript:util_vtvMessagePopdown();' title='Sluiten'>x</a></p></td></tr>" + strHelpText +"</table>";
	tmpStr="<table cellspacing='0' width='" + PopupWidth + "' border='0'><tr><td valign='top' colspan='2' class='alertHeadMapInfo'><p align='right'><img src='" +  imgName +"' align='left'><a class='alertHeadMapInfo' href='javascript:layerChangeVisibility(\"" + PopupLayerName + "\", \"hidden\");' title='" + getResourceNW("rsi.aspx.close") + "'>x</a></p></td></tr>" + strHelpText +"</table>";
	}
	else
	{
//		tmpStr="<table  cellspacing='0' width='" + .PopupWidth + "' border='1'><tr><td colspan='2' valign='top' class='vtvTabon'><div  align='right'><img src='" + locations.images + imgName+"' align='left'><a class='vtvTabOn' href='javascript:util_vtvMessagePopdown();' class='vtvMessageTable'>Sluiten</a></div></td></tr>" + strHelpText + "</table>";
// WV 17-5-2002 : nieuwe stijlen
		tmpStr="<table cellspacing='1' cellpadding='2' width='" + PopupWidth + "' border='0'><tr><td colspan='2' valign='top' class='alertHeadMapInfo'><div  align='right'><img src='"  + imgName+"' align='left'><a class='alertHeadMapInfo' href='javascript:layerChangeVisibility(\"" + PopupLayerName+ "\", \"hidden\");'>" + getResourceNW("rsi.aspx.close") + "</a></div></td></tr>" + strHelpText + "</table>";
			
	}
	strHelpText= tmpStr;
      
        windowX=AtlasMapPopup;
    
	showPopup(strHelpText,PopupWidth,PopupHeight,PopupTime,PopupLayerName,AtlasMapPopup);
	
	if (document.all) {
		if (document.body){
		     
                      scrollYoffset=window.document. body. scrollTop;
		      windowYstop =  scrollYoffset + 120;
                      windowYnow =  scrollYoffset + 150;
		}
	}
	else
	{	
		
		
                windowYstop =  self.pageYOffset + 120;
                
                 windowYnow =  self.pageYOffset + 150;
	}
}
function showDetailMap(mapLocationStr, blnIsRedaction)
{
	//alert(mapLocationStr);
	// KompasRedactie/data/atlas directory vervangen met zorgatlasdata
	//mapLocationStr = mapLocationStr.replace("KompasRedactie/data","zorgatlasdata");
	showMapLayer( mapLocationStr +  ".gif"); 
}
function showMapLayer(strFileName,strMaximiseTarget,showIndexUrl)
{

        MenuBarHeight=67;
        layerLeft=490;
        layerTop=MenuBarHeight;
        tmpIntWidth=1024;
        tmpStrFrameName=PopupLayerName ;
        if (document.all) {
		
		      tmpIntWidth=document.body.clientWidth;
                            
		
	}
	else
	{	
		tmpIntWidth = window.innerWidth;
	}
        if (tmpIntWidth<600){
                layerLeft=0;
                layerTop=0;
                tmpStrFrameName=PopupLayerName ;    
        }
        layerChangeVisibility(tmpStrFrameName+"Drie","hidden");
        layerWidth=501;
        layerHeight=500;
        imageWidth=500;
        imageHeight=532;
        sliderWidth=0; // altijd smal nu
        scrolling="auto";
		
        // KompasRedactie/data/atlas directory vervangen met zorgatlasdata
        strFileName = strFileName.replace("KompasRedactie/data/atlas","zorgatlasdata");
        if (strFileName.indexOf('_cr.html')>0 || strFileName.indexOf('atlas/detail/')>0)
		{
			scrolling="no";
			sliderWidth=0;
		}
	layerChangeVisibility(PopupLayerName ,"hidden");
        layerWrite(tmpStrFrameName,"&nbsp;");
	if (document.all) {
		if (document.body){
		      layerWidth = Math.max(document.body.clientWidth-layerLeft,imageWidth+2*sliderWidth);
		      layerHeight = Math.max(document.body.clientHeight-layerTop,layerHeight+2*sliderWidth);
                      
		}
	}
	else
	{	
                layerWidth = Math.max( window.innerWidth-layerLeft,imageWidth+sliderWidth);
		layerHeight = Math.max(window.innerHeight-layerTop,layerHeight+sliderWidth);
	}
        layerHeight=Math.min(layerHeight,imageHeight+16);
        //alert(layerHeight);
        //alert (document.body.clientWidth + " "+ layerWidth);
        iFrameWidth=imageWidth+sliderWidth;//layerWidth-2*sliderWidth;
        iFrameHeight=imageHeight+sliderWidth;  //layerHeight-18;
        layerWidth=iFrameWidth;
	
	
		tmpLayer3Content=""
        tmpStr="<table border='0' cellpadding='0' cellspacing='0' width='" + iFrameWidth + "'><tr><td align='right' class='MenuStatus' height='16'>";
        if (showIndexUrl)
		{
		tmpStr+="<a class='MenuStatus' href='javascript:showMapLayer(\"" + showIndexUrl + "\");'>";
			   tmpStr+="<img src='" + ImageDir() + "images/popup_list.jpg' border='0' alt='Laat inhoudsopgave weer zien'></a>";
			   tmpLayer3Content+="<a class='MenuStatus' href='javascript:showMapLayer(\"" + showIndexUrl + "\");'>";
			   tmpLayer3Content+="<img src='" + ImageDir() + "images/mapBack.gif' border='0' alt='Laat inhoudsopgave weer zien'></a>";
		}
        if (strMaximiseTarget)
        {
			tmpStr+="<a class='MenuStatus' href='" +strMaximiseTarget + "'>";
			   tmpStr+="<img src='" + ImageDir() + "images/popup_maximize.jpg' border='0' alt='Kaart naar links verplaatsen'></a>";
			   tmpLayer3Content+="<a class='MenuStatus' href='" +strMaximiseTarget + "'>";
			   tmpLayer3Content+="<img src='" + ImageDir() + "images/mapToLeft.gif' border='0' alt='Kaart naar links verplaatsen'></a>";
		}
		
        tmpStr+="<a class='MenuStatus' href='javascript:layerChangeVisibility(\""+ tmpStrFrameName+ "\",\"hidden\");layerChangeVisibility(\"" + tmpStrFrameName + "Drie\",\"hidden\");'>";
        tmpStr+="<img src='" + ImageDir() + "images/popup_close.jpg' border='0' alt='" + getResourceNW("rsi.aspx.close") + "'></a></td></tr></table>";
  
        tmpStr+="<iframe class='vtvIframeTest'  src='" + strFileName +  "' width='" + iFrameWidth + "' height='" + iFrameHeight + "' frameborder =0 scrolling ='" + scrolling +  "' marginwidth=0 marginheight =0><a href='" + strFileName + "'>No Iframes, follow this link</a></iframe>";
   
        layerWrite(tmpStrFrameName,tmpStr);
	layerMove(tmpStrFrameName,layerLeft,layerTop);
	layerResizeTo(tmpStrFrameName,layerWidth,layerHeight);
	layerChangeVisibility(tmpStrFrameName,"visible");
	if (showIndexUrl || strMaximiseTarget){
	layerWrite(tmpStrFrameName+"Drie",tmpLayer3Content);
	layerMove(tmpStrFrameName+"Drie",layerLeft+15,layerTop+495);
	layerResizeTo(tmpStrFrameName+"Drie",layerWidth,layerHeight);
	layerChangeVisibility(tmpStrFrameName+"Drie","visible");
	activeLayer+=","+ tmpStrFrameName+"Drie"
	}
}

function showFlashMapLayer(strFileName,strMaximiseTarget,showIndexUrl)
{
       strIdName=strFileName.replace(".swf","");
	      strBasePath=strIdName.substring(0,strIdName.lastIndexOf('/')) + "/";		      
              strIdName=strIdName.substring(strIdName.lastIndexOf('/')+1);
	      
	     // alert(strBasePath);
strLayerContent = '<DIV ID="flashMovieLayer" STYLE="z-index: 1;"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:/' + '/download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="500" HEIGHT="531" id="'+ strIdName + '" ALIGN=""><param name="wmode" value="transparent"><PARAM Name=BASE VALUE="' + strBasePath + '"><PARAM NAME=movie VALUE="' + strFileName + '"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="' + strFileName + '" menu=false quality=high bgcolor=#FFFFFF wmode="transparant"  WIDTH="500" HEIGHT="531" NAME="' + strIdName + '" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http:/' + '/www.macromedia.com/go/getflashplayer" BASE="' + strBasePath + '"></EMBED> </OBJECT></DIV> ';
        MenuBarHeight=67;
        layerLeft=499;
        layerTop=MenuBarHeight;
        tmpIntWidth=1024;
        tmpStrFrameName=PopupLayerName ;
        if (document.all) {
		
		      tmpIntWidth=document.body.clientWidth;
                            
		
	}
	else
	{	
		tmpIntWidth = window.innerWidth;
	}
        if (tmpIntWidth<600){
                layerLeft=0;
                layerTop=0;
                tmpStrFrameName=PopupLayerName ;    
        }
        layerChangeVisibility(tmpStrFrameName+"Drie","hidden");
        layerWidth=500;
        layerHeight=500;
        imageWidth=501;
        imageHeight=532;
        sliderWidth=20;
	layerChangeVisibility(PopupLayerName ,"hidden");
        layerWrite(tmpStrFrameName,"&nbsp;");
	if (document.all) {
		if (document.body){
		      layerWidth = Math.max(document.body.clientWidth-layerLeft,imageWidth+2*sliderWidth);
		      layerHeight = Math.max(document.body.clientHeight-layerTop,layerHeight+2*sliderWidth);
                      
		}
	}
	else
	{	
                layerWidth = Math.max( window.innerWidth-layerLeft,imageWidth+sliderWidth);
		layerHeight = Math.max(window.innerHeight-layerTop,layerHeight+sliderWidth);
	}
        layerHeight=Math.min(layerHeight,imageHeight+16);
        //alert(layerHeight);
        //alert (document.body.clientWidth + " "+ layerWidth);
        iFrameWidth=imageWidth;//layerWidth-2*sliderWidth;
        iFrameHeight=imageHeight;  //layerHeight-18;
        layerWidth=iFrameWidth;
	scrolling="auto";
		tmpLayer3Content=""
        tmpStr="<table border='0' cellpadding='0' cellspacing='0' width='" + iFrameWidth + "'><tr><td align='right' class='MenuStatus' height='16'>";
        if (showIndexUrl)
		{
			   tmpStr+="<a class='MenuStatus' href='javascript:showMapLayer(\"" + showIndexUrl + "\");'>";
			   tmpStr+="<img src='" + ImageDir() + "images/popup_list.jpg' border='0' alt='Laat inhoudsopgave weer zien'></a>";
			   tmpLayer3Content+="<a class='MenuStatus' href='javascript:showMapLayer(\"" + showIndexUrl + "\");'>";
			   tmpLayer3Content+="<img src='" + ImageDir() + "images/mapBack.gif' border='0' alt='Laat inhoudsopgave weer zien'></a>";
		}
        if (strMaximiseTarget)
        {
			tmpStr+="<a class='MenuStatus' href='" +strMaximiseTarget + "'>";
			   tmpStr+="<img src='" + ImageDir() + "images/popup_maximize.jpg' border='0' alt='Kaart weergeven'></a>";
			   tmpLayer3Content+="<a class='MenuStatus' href='" +strMaximiseTarget + "'>";
			   tmpLayer3Content+="<img src='" + ImageDir() + "images/mapToLeft.gif' border='0' alt='Kaart weergeven'></a>";
		}
		
        tmpStr+="<a class='MenuStatus' href='javascript:layerChangeVisibility(\""+ tmpStrFrameName+ "\",\"hidden\");layerChangeVisibility(\"" + tmpStrFrameName + "Drie\",\"hidden\");'>";
        tmpStr+="<img src='" + ImageDir() + "images/popup_close.jpg' border='0' alt='" + getResourceNW("rsi.aspx.close") + "'></a></td></tr></table>";
    tmpStr+= strLayerContent;
  
        //tmpStr+="<iframe class='vtvIframeTest'  src='" + strFileName +  "' width='" + iFrameWidth + "' height='" + iFrameHeight + "' frameborder =0 scrolling ='" + scrolling +  "' marginwidth=0 marginheight =0><a href='" + strFileName + "'>No Iframes, follow this link</a></iframe>";
   
        layerWrite(tmpStrFrameName,tmpStr);
	layerMove(tmpStrFrameName,layerLeft,layerTop);
	layerResizeTo(tmpStrFrameName,layerWidth,layerHeight);
	layerChangeVisibility(tmpStrFrameName,"visible");
	if (showIndexUrl || strMaximiseTarget){
	layerWrite(tmpStrFrameName+"Drie",tmpLayer3Content);
	layerMove(tmpStrFrameName+"Drie",layerLeft+15,layerTop+495);
	layerResizeTo(tmpStrFrameName+"Drie",layerWidth,layerHeight);
	layerChangeVisibility(tmpStrFrameName+"Drie","visible");
	}
}
function detectFlash() { 
	var requiredVersion=6;
	var hasRightVersion=false;
//	var flash2Installed = false;
//var flash3Installed = false;
//var flash4Installed = false;
//var flash5Installed = false;
//var flash6Installed = false;

var actualVersion = 0;
	var maxVersion = 8;
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

jsVersion = 1.1;

		if(isIE && isWin){
		for (var i = 2; i <= maxVersion; i++) {  
		document.write('<script>var flash' + i + 'Installed = false;</script>'); }
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  for (var i = 2; i <= maxVersion; i++) {  
  document.write('flash' + i + 'Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+ i + '"))) \n');
  }
  document.write('</SCR' + 'IPT\> \n');
}

  if (navigator.plugins) {
    if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
      var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
        flash2Installed = flashVersion == 2;    
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion >= 6;
    }
  

    
  }

  for (var i = 2; i <= maxVersion; i++) {  
    if (eval("flash" + i + "Installed") == true) 
	{ 
	actualVersion = i;
	}
  }
  if(navigator.userAgent.indexOf("WebTV") != -1) 
   {
	actualVersion = 3;  
   }
  if (actualVersion >= requiredVersion) {
    hasRightVersion = true;                
    
  }
  else
  {
  alert(actualVersion);
	showHelp('<p>Helaas beschikt uw web browser niet over een (recente versie van de) Flash Player plugin. Deze kunt u <a href="http://www.macromedia.com/go/getflashplayer/" title="Via deze link kunt u de Flash Player ophalen.">downloaden</a> van de Macromedia website. Het is mogelijk, dat u geen toegangsrechten heeft om de plugin zelf te installeren. Neem dan contact op met uw systeembeheerder.</p>');
  }
}

function ieupdate(){
// Met deze functie wordt een flash kaart direct interactief (er hoeft niet meer eerste geklikt te worden om te activeren).
// Is alleen nodig in IE.
browserName=navigator.appName;
if (browserName=='Microsoft Internet Explorer')
    {
	objects = document.getElementsByTagName("object");
	for (var i = 0; i < objects.length; i++)
	{
		objects[i].outerHTML = objects[i].outerHTML;
}}
}

function showClassMenuDiv(DivId)
{
	DivName="node" + DivId;
	//ImgName="nodeimg" + DivId;
	//ImgLeft=getImageLeft(ImgName);
	//ImgTop=getImageTop(ImgName);
	//layerMove(DivName,ImgLeft,ImgTop+10);
	layerChangeVisibility(DivName,"visible");
	activeLayer=activeLayer+","+DivName
}
function showEventLog()
{
	showHelp("<div style='width=250px;height=250px;overflow-y:auto'>" + strAddEventLog + "</div>")
}
function AddEventLog(strHelpText)
{
	if (blnAddEventLog==true){
			now=new Date();
			hour=now.getHours();
			min=now.getMinutes();
			sec=now.getSeconds();
			strAddEventLog+=""+ hour + ":" + min + ":" + sec + "-" +  strHelpText + "\n<br>";
	}
}
function setXlinkStyle(XlinkId,blnOn)
{
	if (XlinkDivReminder!="")
	{
		buttonimage=layerGetStyleObject(XlinkDivReminder);
		buttonimage.border="0px";
	}
	buttonimage=layerGetStyleObject(XlinkId);
	if (blnOn==true)
	{
		buttonimage.border="#006584 5px dashed"
		
	}
	else
	{
		buttonimage.border="0px"
	}
	XlinkDivReminder=XlinkId;
}


function KeyDownHandler(btn)
    {
        // process only the Enter key
        if (event.keyCode == 13)
        {
            // cancel the default submit
            event.returnValue=false;
            event.cancel = true;
            // submit the form by programmatically clicking the specified button
            btn.click();
        }
    }

function ImageDir()
{
var strURL;
	strURL = document.URL;
	strURL = strURL.toLowerCase();
	if (strURL.indexOf('vtvredactie')>0  || strURL.indexOf('netwritergui')>0 )
		{
		return "/vtvRedactieGuiPublic/";
		}
	else
		{
		return "../";
		}
}
function EchimSetTab(TabId)
{
	
	layerChangeVisibility("Echim_Tab1",TabId == 1? "visible" : "hidden");
	layerGetObject("Echim_Tab1").style.display=TabId == 1? "block" : "none";
	layerGetObject("Echim_TabLink1").className=TabId == 1? "EchimTabOn" : "EchimTabOff";
	///layerGetObject("Echim_Tab1").style=TabId == 1? "EchimTabOn" : "EchimTabOff";
	layerChangeVisibility("Echim_Tab2",TabId == 2? "visible" : "hidden");
	layerGetObject("Echim_Tab2").style.display=TabId == 2? "block" : "none";
	layerGetObject("Echim_TabLink2").className=TabId == 2? "EchimTabOn" : "EchimTabOff";
	//layerGetObject("Echim_Tab2").class=TabId == 2? "EchimTabOn" : "EchimTabOff";
	layerChangeVisibility("Echim_Tab3",TabId == 3? "visible" : "hidden");
	layerGetObject("Echim_Tab3").style.display=TabId == 3? "block" : "none";
	layerGetObject("Echim_TabLink3").className=TabId == 3? "EchimTabOn" : "EchimTabOff";
	//layerGetObject("Echim_Tab3").class=TabId == 3? "EchimTabOn" : "EchimTabOff";
}
function writeAuthorList(strText) { 
	// Check that the browser is DOM compliant 
	if (window.document.getElementById	&& window.document.createElement && window.document.appendChild) 
	{ 
		var	links =	window.document.getElementsByTagName('span');	
		for	(var i = 0;	i <	links.length; i++) 
		{ 
		link=links[i];
			if (link.className.indexOf("authorlistprintversion")>-1 )
			{
								layerWrite(link.id, strText);
			} 
		}
	}	 
} 

//MC stands for MultipleColumns
function gTDMC(tableLabelID, textArray, numOfColumn, informationRow)
{
    var returnString;
    var colspan;
    var className;
    if (tableLabelID == -1)
    {
        className = "alertBodyHeader";
    }
    else
    {
        className = "alertBody";       
    }
    
    //if tableLabelID == -1 then the row doesn't need a headername
    if (tableLabelID == -1)
    {
        returnString = "<tr><td class='" + className + "'>&nbsp;</td>";
    }
    else
    {
        returnString = "<tr><td class='" + className + "'>" + tableLabelsArr[tableLabelID].replace("&qt;","'") + "</td>";
    }
    
    for (var i = 0; i < textArray.length; i++)
    {
            
        if (className == "alertBody" && informationRow)
        {
            className = "alertBodyRight";
        }
        //check if the last column is created in this loop
        if ((i == textArray.length-1) && ((numOfColumn - textArray.length) > 1))
        {
            colspan = numOfColumn - textArray.length;
            returnString += "<td class='" + className + "' colspan='" + colspan + "'>";
        }
        else
        {
            returnString += "<td class='" + className + "'>";
        }
        
        if (textArray[i].indexOf('http:/' + '/') > -1 || textArray[i].indexOf('https:') > -1)
        {
            returnString += "<a class='alertBodyURL' href='" + textArray[i] +"' target='_new'>" + textArray[i].replace("&qt;","'") + "</a>";
        }
        else
        {
            returnString += textArray[i].replace("&qt;","'");
        }  
        returnString += "</td>";
    }    
	return returnString;
}
//MC stands for MultipleColumns
function shTblMC(strHelpText, imgName, numOfColumn)
{
    if(imgName == "")
    {
        imgName= ImageDir() + "images/source_0.gif";
    }
    
    if(document.layers)
    {
        tmpStr = "<table cellspacing='0' width='" + PopupWidth + "' border='0'><tr><td valign='top' colspan='" + numOfColumn + "' class='alertHeadMapInfo'><p align='right'><img src='" +  imgName +"' align='left'><a class='alertHeadMapInfo' href='javascript:layerChangeVisibility(\"" + PopupLayerName + "\", \"hidden\");' title='" + getResourceNW("rsi.aspx.close") + "'>x</a></p></td></tr>" + strHelpText +"</table>";
    }
    else
    {
        tmpStr = "<table cellspacing='1' cellpadding='2' width='" + PopupWidth + "' border='0'><tr><td colspan='" + numOfColumn + "' valign='top' class='alertHeadMapInfo'><div  align='right'><img src='"  + imgName+"' align='left'><a class='alertHeadMapInfo' href='javascript:layerChangeVisibility(\"" + PopupLayerName+ "\", \"hidden\");'>" + getResourceNW("rsi.aspx.close") + "</a></div></td></tr>" + strHelpText + "</table>";
    }
    strHelpText= tmpStr;
    windowX=AtlasMapPopup;

    showPopup(strHelpText,PopupWidth,PopupHeight,PopupTime,PopupLayerName,AtlasMapPopup);

    if (document.all) {
        if (document.body){
            scrollYoffset=window.document. body. scrollTop;
            windowYstop =  scrollYoffset + 120;
            windowYnow =  scrollYoffset + 150;
        }
    }
    else
    {
        windowYstop =  self.pageYOffset + 120;
        windowYnow =  self.pageYOffset + 150;
    }
}
