
function call_req_document_popup() {
   frmLoad = open("web_open_status$status.load_req_document" + "?P_OSE_ID=" + document.forms[1].P_OPENSTAANDE_ID[0].value, "winLoad", "scrollbars=no,resizable=yes,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_beoor_popup() {
   frmLoad = open("web_kand_beoor$beoordeling.laadverslag" + "?P_BEOOR_ID=" + document.forms[1].P_BEOORDELING_ID[0].value, "winLoad", "scrollbars=no,resizable=no,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_gesprek_popup() {
   frmLoad = open("web_kand_gesprek$gesprek.laadverslag" + "?P_GESPREK_ID=" + document.forms[1].P_GESPREK_ID[0].value, "winLoad", "scrollbars=no,resizable=no,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_aanbieding_popup() {
   frmLoad = open("web_kand_proc_aanb$pce_pag.laaddocument" + "?P_AANBIEDING_ID=" + document.forms[1].P_PAG_ID[0].value, "winLoad", "scrollbars=no,resizable=no,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}


function call_contactdoc_popup() {
   frmLoad = open("web_kand_contact$contact.laaddocument" + "?P_CONTACT_ID=" + document.forms[1].P_CONTACT_ID[0].value, "winLoad", "scrollbars=no,resizable=no,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_reldoc_popup() { 
   frmLoad = open("web_relatie$.laaddocument" + "?P_RELATIE_ID=" + document.forms[0].P_RELATIE_ID[0].value, "winLoad", "scrollbars=no,resizable=no,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_crmdoc_popup() {
   frmLoad = open("crm_contacts$.laaddocument" + "?P_CONT_ID=" + document.forms[0].P_CONT_ID[0].value, "winLoad", "scrollbars=no,resizable=no,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_cv_popup() {
   frmLoad = open("web_kand_status$status.loadcv" + "?P_KANDIDAAT_ID=" + document.forms[1].P_KANDIDAAT_ID[0].value, "winLoad", "scrollbars=no,locationbar=no,resizable=no,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_overeenkomst_popup() {
   frmLoad = open("web_cpn_status_hm$cpn.loadovereenkomst" + "?P_CPN_ID=" + document.forms[1].P_CPN_ID[0].value, "winLoad", "scrollbars=no,resizable=no,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_accountplan_popup() {
   frmLoad = open("web_cpn_target$.loadaccountplan" + "?P_CGT_ID=" + document.forms[0].P_CGT_ID[0].value, "winLoad", "scrollbars=no,resizable=no,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_newcv_popup(kid) {
   frmLoad = open("web_new_kand$.loadcv" + "?P_KANDIDAAT_ID=" + kid, "winLoad", "scrollbars=no,resizable=no,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_cvext_popup() {
   frmLoad = open("web_kand_status$status.loadextcv" + "?P_KANDIDAAT_ID=" + document.forms[1].P_KANDIDAAT_ID[0].value, "winLoad", "scrollbars=no,resizable=no,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_attachment_popup() {
   frmLoad = open("web_email$.loadattachment", "winLoad", "scrollbars=no,resizable=no,width=500,height=150");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_popup() {
   var filter = "";
   var the_pathname = location.pathname;
   var i            = the_pathname.indexOf ('/:');
   var j            = the_pathname.indexOf ('/', ++i);

   if (i != -1)
   {
     // Syntactically incorrect url so it needs to be corrected
     the_pathname = the_pathname.substring (j, the_pathname.length);
   }; // (i != -1)

   if (document.forms[0].P_ZOEKTEXT[0].value.length == 0)
   {
	 document.forms[0].P_ZOEKTEXT[0].value = " ";
   };

   frmLOV = open("web_zoek_detail$filters.call_popup" + "?Z_FILTER=" + escape(filter) + "&Z_MODE=Q" + "&Z_CALLER_URL=" + escape(location.protocol + '//' + location.host + the_pathname + location.search) + "&Z_LISTNAME=" + document.forms[0].P_ZOEKVELD[0].options[document.forms[0].P_ZOEKVELD[0].selectedIndex].value + "&Z_ISSUE_WAIT=Y", "winLOV", "scrollbars=yes,resizable=yes,width=400,height=400");
   if (frmLOV.opener == null) {
      frmLOV.opener = self;
   }
}

function kand_back()
{   parent.frames[0].history.back();
    parent.frames[1].location="web_zoek$zoekfilter.textframe?Z_FOOTER=Y";
}

function call_email(kid,cid,email,csum)
{   if (kid=='')
      ewin = open("web_email_cpn$.startemail?Z_CTT_CPN_ID="+cid+"&Z_MEMO="+email+"&Z_CHK="+csum,"emailLOV","scrollbars=yes,resizable=yes,width=460,height=520");
    else
      ewin = open("web_email$.startemail?Z_KAN_KANDIDAAT_ID="+kid+"&Z_CTT_CPN_ID="+cid+"&Z_MEMO="+email+"&Z_CHK="+csum,"emailLOV","scrollbars=yes,resizable=yes,width=520,height=640");
    if (ewin.opener == null) {
	  ewin.opener = self;
    }
}


function call_crm_email(coid,cid,email,csum)
{   ewin = open("crm_email$.startup?Z_CONT_COMPANY_ID="+coid+"&Z_CP_CP_ID="+cid+"&Z_MEMO="+email+"&Z_CHK="+csum,"emailLOV","scrollbars=yes,resizable=yes,width=460,height=450");
    if (ewin.opener == null) {
	  ewin.opener = self;
    }
}

function call_passon(kid,csum)
{   ewin = open("web_passon$.startup?Z_KAN_KANDIDAAT_ID="+kid+"&Z_CHK="+csum,"emailLOV","scrollbars=yes,resizable=yes,width=460,height=470");
    if (ewin.opener == null) {
          ewin.opener = self;
    }
}

function call_passon_flow(kid)
{   ewin = open("web_kand_status$.passon?P_KANDIDAAT_ID="+kid,"emailLOV","scrollbars=yes,resizable=yes,width=530,height=550");
    if (ewin.opener == null) {
          ewin.opener = self;
    }
}

function call_memos(cid,csum)
{   ewin = open("web_cpn_memo$cpn.queryview?P_CPN_ID="+cid+"&Z_CHK="+csum,"emailLOV","scrollbars=yes,resizable=yes,width=700,height=470");
    if (ewin.opener == null) {
          ewin.opener = self;
    }
}


function call_reacties(fid,csum)
{   ewin = open("web_flow_reacties$.startup?Z_INT_FLOW_INT_FLOW_ID="+fid+"&Z_CHK="+csum,"emailLOV","scrollbars=yes,resizable=yes,width=460,height=470");
    if (ewin.opener == null) {
          ewin.opener = self;
    }
}

function call_passon_eb(oid,taal)
{   ewin = open("web_open_vert$.passon_eb?P_OPENSTAANDE_ID="+oid+"&P_TAAL="+taal,"passonLOV","scrollbars=yes,resizable=yes,width=660,height=470");
    if (ewin.opener == null) {
          ewin.opener = self;
    }
}

function call_proc_aanb(pid,csum) {
   frmLoad = open("web_kand_proc_aanb$.startup?Z_PAG_PCE_ID="+pid+"&Z_CHK="+csum, "winLoad", "scrollbars=no,resizable=yes,width=900,height=500");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_proc_contact(kid,pid,csum) {
   frmLoad = open("web_kand_contact$.startup?Z_KAN_KANDIDAAT_ID="+kid+"&Z_CTT_PCE_ID="+pid+"&Z_CHK="+csum, "winLoad", "scrollbars=yes,resizable=yes,width=900,height=500");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_proc_gesprek(kid,pid,csum) {
   frmLoad = open("web_kand_gesprek$.startup?Z_KAN_KANDIDAAT_ID="+kid+"&Z_GPN_PCE_ID="+pid+"&Z_CHK="+csum, "winLoad", "scrollbars=yes,resizable=yes,width=900,height=500");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}

function call_proc_beoor(kid,pid,csum) {
   frmLoad = open("web_kand_beoor$.startup?Z_KAN_KANDIDAAT_ID="+kid+"&Z_BDG_PCE_ID="+pid+"&Z_CHK="+csum, "winLoad", "scrollbars=yes,resizable=yes,width=900,height=500");
   if (frmLoad.opener == null) {
      frmLoad.opener = self;
   }
}


function call_help(hvar)
{   hwin = open(hvar, "helpWIN", "scrollbars=yes,resizable=yes,width=450,height=500");
    if (hwin.opener == null) {
        hwin.opener = self;
    }
}

function call_additional_dbentry(strvar)
{   addLOV = open(strvar, "addLOV", "scrollbars=yes,resizable=yes,width=450,height=500");
    if (addLOV.opener == null) {
        addLOV.opener = self;
    }
}

var locstr;

locstr = window.location.pathname;
if (locstr.search("_lov") != -1)
{   var strvar;
    if (locstr.search("opl_opl") != -1)
	strvar = "web_richting$.startup";
    if (locstr.search("l_studie") != -1)
	strvar = "web_richting$.startup";
    if (locstr.search("l_divisie") != -1)
	strvar = "web_div$divisie.querylist?Z_ACTION=INSERT&Z_CHK=0";
    if (locstr.search("l_relatie") != -1)
	strvar = "web_relatie$relaties.querylist?Z_ACTION=INSERT&Z_CHK=0";
    if (locstr.search("l_functiegr") != -1)
	strvar = "web_functiegroep$functiegroep.querylist?Z_ACTION=INSERT&Z_CHK=0";
    if (locstr.search("l_functie_") != -1)
	strvar = "web_functie$functies.querylist?Z_ACTION=INSERT&Z_CHK=0";
    if (locstr.search("l_afd") != -1)
	strvar = "web_afdeling$afdelingen.querylist?Z_ACTION=INSERT&Z_CHK=0";
    if (locstr.search("cap_cap") != -1)
	strvar = "web_kennis$.startup";
    if (locstr.search("l_kencap") != -1)
	strvar = "web_kennis$.startup";
    if (locstr.search("l_land") != -1)
	strvar = "web_land$landen.querylist?Z_ACTION=INSERT&Z_CHK=0";
    if (locstr.search("l_publi") != -1)
	strvar = "web_publ$publicatie.querylist?Z_ACTION=INSERT&Z_CHK=0";
    if (locstr.search("l_org") != -1)
	strvar = "web_org$organisaties.querylist?Z_ACTION=INSERT&Z_CHK=0";
    if (locstr.search("l_unit") != -1)
	strvar = "web_new_out$.startup";
if (strvar != null)
    	document.write('<A HREF="javascript:call_additional_dbentry(strvar)"><IMG SRC="/images/voeg_toe_aan_lijst.jpg" ALIGN="CENTER" ALT="Voeg toe" BORDER="0"></A>');
}

function datumAanvullen(ctl)
{
  var datePat = /^(\d{1,2})(\-)(\d{1,2})\2(\d{2}|\d{4})$/;
  var matchArray = ctl.value.match(datePat);
 
  if (matchArray != null)
  {  month = matchArray[3];
     day = matchArray[1];
     year = matchArray[4];


     if (day.length == 1)
     {         day = "0" + day;
     }
     if (month.length == 1)
     {
        month = "0" + month;
     }
 
     ctl.value = day +"-"+ month +"-"+ year;
  }
  return isValidDate(ctl.value);
}

function isValidDate(dateStr)
{
// Checks for the following valid date formats:
// MM/DD/YY   MM/DD/YYYY   MM-DD-YY   MM-DD-YYYY
// Also separates date into month, day, and year variables

    var datePat = /^(\d{1,2})(\-)(\d{1,2})\2(\d{2}|\d{4})$/;

// To require a 4 digit year entry, use this line instead:
// var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;

    var matchArray = dateStr.match(datePat); // is the format ok?

    if (dateStr.length == 0) return true;

    if (matchArray == null) {
	alert("Datumformaat moet zijn dd-mm-yyyy.")
	return false;
    }
    month = matchArray[3]; // parse date into variables
    day = matchArray[1];
    year = matchArray[4];
    if (month < 1 || month > 12) { // check month range
	alert("Maand moet tussen de 1 en de 12 liggen.");
	return false;
    }
    if (day < 1 || day > 31) {
	alert("Dag moet tussen de 1 en 31 liggen.");
	return false;
    }
    if ((month==4 || month==6 || month==9 || month==11) && day==31) {
	alert("Maand "+month+" heeft geen 31 dagen!")
	return false;
    }
    if (month == 2) { // check for february 29th
	var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
	if (day>29 || (day==29 && !isleap)) {
	    alert("Februari " + year + " heeft geen " + day + " dagen!");
	    return false;
	}
    }
    return true;  // date is valid
}


function isValidEmail(txt)
{
/*    if (txt.length == 0) return true;
    if(!RegExp("^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$").test(txt))	{ //returns true or false
		alert("A username and/or a '@' sign is missing in the e-mail address.");
		return false;
    }
    return true;
*/
    if (txt.length == 0) return true;
    if (txt.indexOf("@")<1)    {
		alert("Er ontbreekt een gebruiker en/of een '@' teken in het e-mail adres.");
		return false;
    }
    return true;
}

function MM_findObj(n, d) { //v3.0
  el = xbGetElementById(n, d);
  if (el!=null) return el;
  ellist = xbGetElementsByName(n, d);
  if (ellist==null) return null;
  return ellist[0];
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

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];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


					// Colorvariables:
					// Color variables take HTML predefined color names or "#rrggbb" strings
					// For transparency make colors and border color ""
var LowBgColor="";			// Background color when mouse is not over
var HighBgColor="";			// Background color when mouse is over
var FontLowColor="yellow";		// Font color when mouse is not over
var FontHighColor="blue";		// Font color when mouse is over
var BorderColor="";			// Border color
var BorderWidthMain=1;			// Border width main items
var BorderWidthSub=1;			// Border width sub items
var BorderBtwnMain=1;			// Border between elements main items 1 or 0
var BorderBtwnSub=1;			// Border between elements sub items 1 or 0
var FontFamily="Helvetica, Arial, MS Sans Serif, Sans-Serif";	// Font family menu items
var FontSize=8;				// Font size menu items
var FontBold=1;				// Bold menu items 1 or 0
var FontItalic=0;			// Italic menu items 1 or 0
var MenuTextCentered="left";		// Item text position left, center or right
var MenuCentered="center";		// Menu horizontal position can be: left, center, right, justify,
					//  leftjustify, centerjustify or rightjustify. PartOfWindow determines part of window to use
var MenuVerticalCentered="bottom";	// Menu vertical position top, middle,bottom or static
var ChildOverlap=.2;			// horizontal overlap child/ parent
var ChildVerticalOverlap=.2;		// vertical overlap child/ parent
var StartTop=0;				// Menu offset x coordinate. If StartTop is between 0 and 1 StartTop is calculated as part of windowheight
var StartLeft=0;			// Menu offset y coordinate. If StartLeft is between 0 and 1 StartLeft is calculated as part of windowheight
var VerCorrect=0;			// Multiple frames y correction
var HorCorrect=0;			// Multiple frames x correction
var LeftPaddng=3;			// Left padding
var TopPaddng=2;			// Top padding
var FirstLineHorizontal=1;		// First level items layout horizontal 1 or 0
var MenuFramesVertical=0;		// Frames in cols or rows 1 or 0
var DissapearDelay=100;			// delay before menu folds in
var UnfoldDelay=100;			// delay before sub unfolds	
var TakeOverBgColor=1;			// Menu frame takes over background color subitem frame
var FirstLineFrame="F1";		// Frame where first level appears
var SecLineFrame="F2";			// Frame where sub levels appear
var DocTargetFrame="F2";		// Frame where target documents appear
var TargetLoc="";			// span id for relative positioning
var MenuWrap=1;				// enables/ disables menu wrap 1 or 0
var RightToLeft=0;			// enables/ disables right to left unfold 1 or 0
var BottomUp=0;				// enables/ disables Bottom up unfold 1 or 0
var UnfoldsOnClick=0;			// Level 1 unfolds onclick/ onmouseover
var BaseHref="";			// BaseHref lets you specify the root directory for relative links. 
					// The script precedes your relative links with BaseHref
					// For instance: 
					// when your BaseHref= "http://www.MyDomain/" and a link in the menu is "subdir/MyFile.htm",
					// the script renders to: "http://www.MyDomain/subdir/MyFile.htm"
					// Can also be used when you use images in the textfields of the menu
					// "MenuX=new Array("<img src=\""+BaseHref+"MyImage\">"
					// For testing on your harddisk use syntax like: BaseHref="file:///C|/MyFiles/Homepage/"
//var Arrws=["/images/menuimg/tri.gif",5,10,"/images/menuimg/tridown.gif",10,5,"/images/menuimg/trileft.gif",5,10,"/images/menuimg/triup.gif",10,5];
var Arrws=["",5,10,"",10,5,"",5,10,"",10,5];
					// Arrow source, width and height.
					// If arrow images are not needed keep source ""
var MenuUsesFrames=1;			// MenuUsesFrames is only 0 when Main menu, submenus,
					// document targets and script are in the same frame.
					// In all other cases it must be 1
var RememberStatus=0;			// RememberStatus: When set to 1, menu unfolds to the presetted menu item. 
					// When set to 2 only the relevant main item stays highligthed
					// The preset is done by setting a variable in the head section of the target document.
					// 2_2_1 represents the menu item Menu2_2_1=new Array(.......
var PartOfWindow=.8;			// PartOfWindow: When MenuCentered is justify, sets part of window width to stretch to
					// Below some pretty useless effects, since only IE6+ supports them
					// I provided 3 effects: MenuSlide, MenuShadow and MenuOpacity
					// If you don''t need MenuSlide just leave in the line var MenuSlide="";
					// delete the other MenuSlide statements
					// In general leave the MenuSlide you need in and delete the others.
					// Above is also valid for MenuShadow and MenuOpacity
					// You can also use other effects by specifying another filter for MenuShadow and MenuOpacity.
					// You can add more filters by concanating the strings
var BuildOnDemand=0;			// 1/0 When set to 1 the sub menus are build when the parent is moused over
var MenuSlide="";

var MenuShadow="";
var MenuOpacity="";
var F2Location="";
var F2Loaded=0;

function BeforeStart(){return}
function AfterBuild(){
if (F2Location && !F2Loaded) {
    parent.frames["F2"].location = F2Location;
    F2Loaded = 1;
  }
}
function BeforeFirstOpen(){
if (parent.frames["F2"] && parent.frames["F2"].document.all) {
    var coll = parent.frames["F2"].document.all.tags("SELECT");
    if (coll!=null)
    {
        for (i=0; i<coll.length; i++)
          if (i<4) coll[i].style.visibility='hidden';
    }
  }
}
function AfterCloseAll(){
if (parent.frames["F2"] && parent.frames["F2"].document.all) {
    var coll = parent.frames["F2"].document.all.tags("SELECT");
    if (coll!=null)
    {
        for (i=0; i<coll.length; i++)
          if (i<4) coll[i].style.visibility='visible';
    }
  }
}


/*
xbDOM.js v 0.002 2002-01-19

Contributor(s): Bob Clary, Netscape Communications, Copyright 2001, 2002

Netscape grants you a royalty free license to use, modify and 
distribute this software provided that this copyright notice 
appears on all copies.  This software is provided "AS IS," 
without a warranty of any kind.

Change Log: 

2002-01-19: v 0.02
  bclary - 
    nav4FindElementsByName
      removed erroneous obj and return
      added search of form elements
    xbFindElementsByNameAndType
      renamed from FindElementsByNameAndType
      removed erroneouse obj and return
    xbSetInnerHTML
      ported over from xbStyle since it is more
      appropriate here.

2001-11-27: v 0.01
  bclary - 
    removed from xbStyle
*/

function xbToInt(s)
{
  var i = parseInt(s, 10);
  if (isNaN(i))
    i = 0;

  return i;
}

function xbGetWindowWidth(windowRef)
{
  var width = 0;

  if (!windowRef)
    windowRef = window;
  
  if (typeof(windowRef.innerWidth) == 'number')
    width = windowRef.innerWidth;
  else if (windowRef.document.body && typeof(windowRef.document.body.clientWidth) == 'number')
    width = windowRef.document.body.clientWidth;  
    
  return width;
}

function xbGetWindowHeight(windowRef)
{
  var height = 0;
  
  if (!windowRef)
    windowRef = window;

  if (typeof(windowRef.innerWidth) == 'number')
    height = windowRef.innerHeight;
  else if (windowRef.document.body && typeof(windowRef.document.body.clientWidth) == 'number')
    height = windowRef.document.body.clientHeight;    

  return height;
}

function nav4FindLayer(doc, id)
{
  var i;
  var subdoc;
  var obj;
  
  for (i = 0; i < doc.layers.length; ++i)
  {
    if (doc.layers[i].id && id == doc.layers[i].id)
      return doc.layers[i];
      
    subdoc = doc.layers[i].document;
    obj    = nav4FindLayer(subdoc, id);
    if (obj != null)
      return obj;
  }
  return null;
}

function nav4FindElementsByName(doc, name, elmlist)
{
  var i;
  var j;
  var subdoc;
  
  for (i = 0; i < doc.images.length; ++i)
  {
    if (doc.images[i].name && name == doc.images[i].name)
      elmlist[elmlist.length] = doc.images[i];
  }

  for (i = 0; i < doc.forms.length; ++i)
  {
    for (j = 0; j < doc.forms[i].elements.length; j++)
      if (doc.forms[i].elements[j].name && name == doc.forms[i].elements[j].name)
        elmlist[elmlist.length] = doc.forms[i].elements[j];

    if (doc.forms[i].name && name == doc.forms[i].name)
      elmlist[elmlist.length] = doc.forms[i];
  }

  for (i = 0; i < doc.anchors.length; ++i)
  {
    if (doc.anchors[i].name && name == doc.anchors[i].name)
      elmlist[elmlist.length] = doc.anchors[i];
  }

  for (i = 0; i < doc.links.length; ++i)
  {
    if (doc.links[i].name && name == doc.links[i].name)
      elmlist[elmlist.length] = doc.links[i];
  }

  for (i = 0; i < doc.applets.length; ++i)
  {
    if (doc.applets[i].name && name == doc.applets[i].name)
      elmlist[elmlist.length] = doc.applets[i];
  }

  for (i = 0; i < doc.embeds.length; ++i)
  {
    if (doc.embeds[i].name && name == doc.embeds[i].name)
      elmlist[elmlist.length] = doc.embeds[i];
  }

  for (i = 0; i < doc.layers.length; ++i)
  {
    if (doc.layers[i].name && name == doc.layers[i].name)
      elmlist[elmlist.length] = doc.layers[i];
      
    subdoc = doc.layers[i].document;
    nav4FindElementsByName(subdoc, name, elmlist);
  }
}

function xbGetElementsByNameAndType(name, type, windowRef)
{
  if (!windowRef)
    windowRef = window;

  var elmlist = new Array();

  xbFindElementsByNameAndType(windowRef.document, name, type, elmlist);

  return elmlist;
}

function xbFindElementsByNameAndType(doc, name, type, elmlist)
{
  var i;
  var subdoc;
  
  for (i = 0; i < doc[type].length; ++i)
  {
    if (doc[type][i].name && name == doc[type][i].name)
      elmlist[elmlist.length] = doc[type][i];
  }

  if (doc.layers)
  {
    for (i = 0; i < doc.layers.length; ++i)
    {
      subdoc = doc.layers[i].document;
      xbFindElementsByNameAndType(subdoc, name, type, elmlist);
    }
  }
}

if (document.layers)
{
  xbGetElementById = function (id, windowRef)
  {
    if (!windowRef)
      windowRef = window;

    return nav4FindLayer(windowRef.document, id);
  };

  xbGetElementsByName = function (name, windowRef)
  {
    if (!windowRef)
      windowRef = window;

    var elmlist = new Array();

    nav4FindElementsByName(windowRef.document, name, elmlist);

    return elmlist;
  };

}
else if (document.all)
{
  xbGetElementById = function (id, windowRef) { if (!windowRef) windowRef = window; var elm = windowRef.document.all[id]; if (!elm) elm = null; return elm; };
  xbGetElementsByName = function (name, windowRef)
  {
    var i;
    var idnamelist = document.all[name];
    var elmlist = new Array();
    if (!idnamelist) return elmlist;
    for (i = 0; i < idnamelist.length; i++)
    {
      if (idnamelist[i].name == name)
        elmlist[elmlist.length] = idnamelist[i];
    }

    return elmlist;
  }

  }
else if (document.getElementById)
{
  xbGetElementById = function (id, windowRef) { if (!windowRef) windowRef = window; return windowRef.document.getElementById(id); };
  xbGetElementsByName = function (name, windowRef) { if (!windowRef) windowRef = window; return windowRef.document.getElementsByName(name); };
}
else 
{
  xbGetElementById = function (id, windowRef) { return null; }
  xbGetElementsByName = function (name, windowRef) { return new Array(); }
}

if (typeof(window.pageXOffset) == 'number')
{
  xbGetPageScrollX = function (windowRef) { if (!windowRef) windowRef = window; return windowRef.pageXOffset; };
  xbGetPageScrollY = function (windowRef) { if (!windowRef) windowRef = window; return windowRef.pageYOffset; };
}
else if (document.all)
{
  xbGetPageScrollX = function (windowRef) { if (!windowRef) windowRef = window; return windowRef.document.body.scrollLeft; };
  xbGetPageScrollY = function (windowRef) { if (!windowRef) windowRef = window; return windowRef.document.body.scrollTop; };
}
else
{
  xbGetPageScrollX = function (windowRef) { return 0; };
  xbGetPageScrollY = function (windowRef) { return 0; };
}

if (document.layers)
{
  xbSetInnerHTML = function (element, str) { element.document.write(str); element.document.close(); };
}
else if (document.all || document.getElementById)
{
  xbSetInnerHTML = function (element, str) { if (typeof(element.innerHTML) != 'undefined') element.innerHTML = str; };
}
else
{
  xbSetInnerHTML = function (element, str) {};
}



function ReqListEntered(txt, fieldname)
{
// Checks if a required popuplist field has a value before submitting it 
// to the database  rza07052002
   

  if (!txt)
    txt= 1;
   
   if (txt.selectedIndex >= 1) return true;

   
   if (txt.selectedIndex < 1)  {
	alert("Voer waarde in voor "+fieldname+"");
	return false;
    }
 return true;
     
}


function CheckLength(txt, fieldname, MaxLength)
// Checks if a  field does not exceed the maximum length 
// before submitting to the database  rza07052002
{
 
  if (!txt)
    txt= 1;

  
  if (txt.value.length > MaxLength)
    {
	alert("U heeft meer dan de maximale hoeveelheid van "+MaxLength+" tekens gebruikt in het veld "+fieldname+"");
	return false;
    }
 return true;
}

   
<!-- Original:  Richard Gorremans (RichardG@spiritwolfx.com) -->
<!-- Web Site:  http://www.spiritwolfx.com -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
// Check browser version
var isNav4 = false, isNav5 = false, isIE4 = false
var strSeperator = "-";
// If you are using any Java validation on the back side you will want to use the / because
// Java date validations do not recognize the dash as a valid date separator.
var vDateType = 3; // Global value for type of date format
//                1 = mm/dd/yyyy
//                2 = yyyy/dd/mm  (Unable to do date check at this time)
//                3 = dd-mm-yyyy
var vYearType = 4; //Set to 2 or 4 for number of digits in the year for Netscape
var vYearLength = 2; // Set to 4 if you want to force the user to enter 4 digits for the year before validating.
var err = 0; // Set the error code to a default of zero
if(navigator.appName == "Netscape") {
  if (navigator.appVersion < "5") {
    isNav4 = true;
    isNav5 = false;
  }
  else
    if (navigator.appVersion > "4") {
      isNav4 = false;
      isNav5 = true;
    }
  }
else {
  isIE4 = true;
}

function DateFormat(vDateName, vDateValue, e, dateCheck, dateType) {
vDatetype = dateType;
// vDateName = object name
// vDateValue = value in the field being checked
// e = event
// dateCheck
// True  = Verify that the vDateValue is a valid date
// False = Format values being entered into vDateValue only
// vDateType
// 1 = mm/dd/yyyy
// 2 = yyyy/mm/dd
// 3 = dd-mm-yyyy

var whichCode = (window.Event) ? e.which : e.keyCode;
// Check to see if a seperator is already present.
// bypass the date if a seperator is present and the length greater than 8
if (vDateValue.length > 8 && isNav4) {
  if ((vDateValue.indexOf("-") >= 1) || (vDateValue.indexOf("/") >= 1))
    return true;
}

//Eliminate all the ASCII codes that are not valid
var alphaCheck = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/-";
if (alphaCheck.indexOf(vDateValue) >= 1) {
  if (isNav4) {
    vDateName.value = "";
    vDateName.focus();
    vDateName.select();
    return false;
  }
  else {
    vDateName.value = vDateName.value.substr(0, (vDateValue.length-1));
    return false;
  }
}
if (whichCode == 8) //Ignore the Netscape value for backspace. IE has no value
  return false;
else {
//Create numeric string values for 0123456789/
//The codes provided include both keyboard and keypad values
  var strCheck = '47,48,49,50,51,52,53,54,55,56,57,58,59,95,96,97,98,99,100,101,102,103,104,105';
  if (strCheck.indexOf(whichCode) != -1) {
    if (isNav4) {
      if (((vDateValue.length < 6 && dateCheck) || (vDateValue.length == 7 && dateCheck)) && (vDateValue.length >=1)) {
        alert("Datum formaat is gelijk aan dd-mm-jjjj");
        vDateName.value = "";
        vDateName.focus();
        vDateName.select();
        return false;
      }
      if (vDateValue.length == 6 && dateCheck) {
        var mDay = vDateName.value.substr(2,2);
        var mMonth = vDateName.value.substr(0,2);
        var mYear = vDateName.value.substr(4,4)
        //Turn a two digit year into a 4 digit year
        if (mYear.length == 2 && vYearType == 4) {
          var mToday = new Date();
          //If the year is greater than 30 years from now use 19, otherwise use 20
          var checkYear = mToday.getFullYear() + 30;
          var mCheckYear = '20' + mYear;
          if (mCheckYear >= checkYear)
            mYear = '19' + mYear;
          else
            mYear = '20' + mYear;
          }
          var vDateValueCheck = mMonth+strSeperator+mDay+strSeperator+mYear;
          if (!dateValid(vDateValueCheck)) {
            alert("Datum formaat is gelijk aan dd-mm-jjjj");
            vDateName.value = "";
            vDateName.focus();
            vDateName.select();
            return false;
          }
          return true;
        }
        else {
          // Reformat the date for validation and set date type to a 1
          if (vDateValue.length >= 8  && dateCheck) {
            if (vDateType == 1) // mmddyyyy
            {
              var mDay = vDateName.value.substr(2,2);
              var mMonth = vDateName.value.substr(0,2);
              var mYear = vDateName.value.substr(4,4)
              vDateName.value = mMonth+strSeperator+mDay+strSeperator+mYear;
            }
            if (vDateType == 2) // yyyymmdd
            {
              var mYear = vDateName.value.substr(0,4)
              var mMonth = vDateName.value.substr(4,2);
              var mDay = vDateName.value.substr(6,2);
              vDateName.value = mYear+strSeperator+mMonth+strSeperator+mDay;
            }
            if (vDateType == 3) // ddmmyyyy
            {
              var mMonth = vDateName.value.substr(2,2);
              var mDay = vDateName.value.substr(0,2);
              var mYear = vDateName.value.substr(4,4)
              vDateName.value = mDay+strSeperator+mMonth+strSeperator+mYear;
            }
            //Create a temporary variable for storing the DateType and change
            //the DateType to a 1 for validation.
            var vDateTypeTemp = vDateType;
            vDateType = 1;
            var vDateValueCheck = mMonth+strSeperator+mDay+strSeperator+mYear;
            if (!dateValid(vDateValueCheck)) {
              alert("Datum formaat is gelijk aan dd-mm-jjjj");
              vDateType = vDateTypeTemp;
              vDateName.value = "";
              vDateName.focus();
              vDateName.select();
              return false;
            }
            vDateType = vDateTypeTemp;
            return true;
          }
          else {
            if (((vDateValue.length < 8 && dateCheck) || (vDateValue.length == 9 && dateCheck)) && (vDateValue.length >=1)) {
              alert("Datum formaat is gelijk aan dd-mm-jjjj");
              vDateName.value = "";
              vDateName.focus();
              vDateName.select();
              return false;
            }
          }
        }
      }
      else {
        // Non isNav Check
        if (((vDateValue.length < 8 && dateCheck) || (vDateValue.length == 9 && dateCheck)) && (vDateValue.length >=1)) {
          alert("Datum formaat is gelijk aan dd-mm-jjjj");
          vDateName.value = "";
          vDateName.focus();
          return true;
        }
        // Reformat date to format that can be validated. mm/dd/yyyy
        if (vDateValue.length >= 8 && dateCheck) {
          // Additional date formats can be entered here and parsed out to
          // a valid date format that the validation routine will recognize.
          if (vDateType == 1) // mm/dd/yyyy
          {
            var mMonth = vDateName.value.substr(0,2);
            var mDay = vDateName.value.substr(3,2);
            var mYear = vDateName.value.substr(6,4)
          }
          if (vDateType == 2) // yyyy/mm/dd
          {
            var mYear = vDateName.value.substr(0,4)
            var mMonth = vDateName.value.substr(5,2);
            var mDay = vDateName.value.substr(8,2);
          }
          if (vDateType == 3) // dd-mm-yyyy
          {
            var mDay = vDateName.value.substr(0,2);
            var mMonth = vDateName.value.substr(3,2);
            var mYear = vDateName.value.substr(6,4)
          }
          if (vYearLength == 4) {
            if (mYear.length < 4) {
              alert("Datum formaat is gelijk aan dd-mm-jjjj");
              vDateName.value = "";
              vDateName.focus();
              return true;
            }
          }
          // Create temp. variable for storing the current vDateType
          var vDateTypeTemp = vDateType;
          // Change vDateType to a 1 for standard date format for validation
          // type will be changed back when validation is completed.
          vDateType = 1;
          // Store reformatted date to new variable for validation.
          var vDateValueCheck = mMonth+strSeperator+mDay+strSeperator+mYear;
          if (mYear.length == 2 && vYearType == 4 && dateCheck) {
            //Turn a two digit year into a 4 digit year
            var mToday = new Date();
            //If the year is greater than 30 years from now use 19, otherwise use 20
            var checkYear = mToday.getFullYear() + 30;
            var mCheckYear = '20' + mYear;
            if (mCheckYear >= checkYear)
              mYear = '19' + mYear;
            else
              mYear = '20' + mYear;
            vDateValueCheck = mMonth+strSeperator+mDay+strSeperator+mYear;
            // Store the new value back to the field.  This function will
            // not work with date type of 2 since the year is entered first.
            if (vDateTypeTemp == 1) // mm/dd/yyyy
              vDateName.value = mMonth+strSeperator+mDay+strSeperator+mYear;
            if (vDateTypeTemp == 3) // dd-mm-yyyy
              vDateName.value = mDay+strSeperator+mMonth+strSeperator+mYear;
          }
          if (!dateValid(vDateValueCheck)) {
            alert("Datum formaat is gelijk aan dd-mm-jjjj");
            vDateType = vDateTypeTemp;
            vDateName.value = "";
            vDateName.focus();
            return true;
          }
          vDateType = vDateTypeTemp;
          return true;
        }
        else {
          if (vDateType == 1) {
            if (vDateValue.length == 2) {
              vDateName.value = vDateValue+strSeperator;
            }
            if (vDateValue.length == 5) {
              vDateName.value = vDateValue+strSeperator;
            }
          }
          if (vDateType == 2) {
            if (vDateValue.length == 4) {
              vDateName.value = vDateValue+strSeperator;
            }
            if (vDateValue.length == 7) {
              vDateName.value = vDateValue+strSeperator;
            }
          }
          if (vDateType == 3) {
            if (vDateValue.length == 2) {
              vDateName.value = vDateValue+strSeperator;
            }
            if (vDateValue.length == 5) {
              vDateName.value = vDateValue+strSeperator;
            }
          }
          return true;
        }
      }
      if (vDateValue.length == 10 && dateCheck) {
        if (!dateValid(vDateName)) {
        // Un-comment the next line of code for debugging the dateValid() function error messages
        //alert(err);
          alert("Datum formaat is gelijk aan dd-mm-jjjj");
          vDateName.focus();
          vDateName.select();
        }
      }
      return false;
    }
    else {
    if (isNav5){return false;}
    // If the value is not in the string return the string minus the last
    // key entered.
      if (isNav4) {
        vDateName.value = "";
        vDateName.focus();
        vDateName.select();
        return false;
      }
      else
      {
        if (vDateValue.length>1 && vDateValue[vDateValue.length-1]==strSeperator && vDateValue[vDateValue.length-2]!=strSeperator) {
          prevChar = vDateValue[vDateValue.length-2];
          vDateName.value = vDateName.value.substr(0, (vDateValue.length-2));
          vDateName.value = vDateName.value + "0" + prevChar + strSeperator;
        }
        else
          vDateName.value = vDateName.value.substr(0, (vDateValue.length-1));
        return false;
      }
    }
  }
}

// eof: xbDOM.js
