// Variabelen:

  /*   
  ** CHANGELOG  
  **    ET  05-10-2004  add logInByEnter
  **    ET  02-02-2005  make right blocks clickable
  **    ET  03-05-2005  pwcheck function
  **
  */




var numTabs = 0;

var itemRequiredField = "*";

var openedDlg = "";

var winNew;

var browser = new Browser();

var dragObj = new Object();

dragObj.zIndex = 0;

var lastTabIndex = -1;

var allTabs = new Array();

var debugWindow;

var rowExtender = 3; 		// Clicking on this tab will make all the tabs after it appear (hidden otherwise) thus extending the row. Set to 0 to disable.

var hideExtenderTab = true; 	// When clicking on the rowExtender tab hide it.

var calendarSubmit;

var useMac = (navigator.platform.substr(0,3) == "Mac");

var dadname = "jerry";


			function gogogo(url, page) {
//            top.location.href=url;				
  //          return;
            
				var frm = document.createElement('FORM');
				frm.method = 'GET';
				frm.action = url;
				frm.target = '_top';

				var input = document.createElement('INPUT');
				input.name = 'page';
				input.type = 'hidden';
				input.value = page;
   			frm.appendChild(input);

				document.body.appendChild(frm)
				frm.submit();
			}

function goKandidaatInschrijving() {
   setMainPage('/pls/jerry/reg_prof.cgi');   
}

function goOrganisatieInschrijving() {
   setMainPage('/pls/jerry/reg_org.cgi');   
}

function kandidaat(id) {
   url = 'data_popup.show_frameset?p_uid='+id+'&p_scr=2&p_req=2';
   win=open(url, 'jobdetailwindow', 'toolbar=no,scrollbars=yes,statusbar=no,resizable=no,resize=no,locationbar=no,menubar=no,personalbar=no,titlebar=no,width=650,height=410,top=0,left=0,screenX=0,screenY=0,alwaysRaised');
   win.focus();   
}

function vacature(id) {
   url = 'data_popup.show_frameset?p_jid='+id+'&p_scr=1&p_req=1';
   win=open(url, 'jobdetailwindow', 'toolbar=no,scrollbars=yes,statusbar=no,resizable=no,resize=no,locationbar=no,menubar=no,personalbar=no,titlebar=no,width=650,height=410,top=0,left=0,screenX=0,screenY=0,alwaysRaised');
   win.focus();   
}


function logInByEnter(myfield,e) {
var keycode;

   if (window.event) 
      keycode = window.event.keyCode;
   else 
      if (e) 
         keycode = e.which;
      else 
         return true;
   
   if (keycode == 13) {
      myfield.form.submit();
      return false;
   } else {
      return true;
   }

}



// Tabjes:

// iemac reload frameset niet?!? dan maar zo:

//window.top.numTabs = 0;



function createTab(tabText, setStatus, linkTo, textcolor) {

// returns the html code for a tab

// tabText: the text to put on the tab. Use | to indicate a newline

// setStatus: sets the state of the tab (defines the image used). values are on, off, na and auto (depends on the value of window.top.currentPage)

// linkto: the onClick action

// textcolor: the RGB values of the textcolor for the tab as a string separated by commas (ie. "255,255,255").



	var textcolorstring = (textcolor ? "&fontcolor=" + textcolor : "");



	if (setStatus == "auto" && linkTo == getMainPageName()) setStatus = "on";

	else if (!setStatus) setStatus = "off";



	if (setStatus != "na") {

		return "<div><img class=\"pseudolink\" border=\"0\" src=\"/global/scripts/tabjes.php?sts=" + setStatus + "&txt=" + tabText + "&imgloc=" + urlencode("../../" + window.top.useDir + "/tabs/") + textcolorstring + "\" onClick=\"setMainPage_v2('" + linkTo + "');\"></div>";

	} else {

		return "<div><img border=\"0\" src=\"/global/scripts/tabjes.php?sts=" + setStatus + "&txt=" + tabText + "&imgloc=" + urlencode("../../" + window.top.useDir + "/tabs/") + textcolorstring + "\"></div>";

	}



	++numTabs;



}



function createTab_v2(tabText, linkTo, textcolor, textdisabledcolor, nosubmit, extraonclickaction) {

// returns the html code for a tab

// tabText: the text to put on the tab. Use | to indicate a newline

// linkto: the onClick action

// textcolor: the RGB values of the textcolor for the tab as a string separated by commas (ie. "255,255,255"). Default is specified in tables.php.

// textdisabledcolor: the RGB values of the textcolor for the disabled tab as a string separated by commas (ie. "255,255,255"). Default is specified in tables.php.

// nosubmit: if set to true the current registration process will be cancelled if available.

// extraonclickaction: stuff to do onclick (only for on/off tabs)

// uses an array to keep track of 3 different status types: on/off, enabled/disabled and visible/invisible.



	// Initially hide tabs that aren't supposed to be visible

	var hiddenString = (window.top.numTabs > window.top.rowExtender - 1 && window.top.rowExtender > 0 ? "style=\"display: none;\"" : "");



	// Text colors (if given)

	var textcolorstring = (textcolor ? "&fontcolor=" + textcolor : "");

	var textdisabledcolorstring = (textdisabledcolor ? "&fontdisabledcolor=" + textdisabledcolor : "");



	// Image sources

	var onSrc = "/global/scripts/tabjes.php?sts=on&txt=" + tabText //+ "&imgloc=" + urlencode("../../" + window.top.useDir + "/tabs/") + textcolorstring + textdisabledcolorstring;

	var offSrc = "/global/scripts/tabjes.php?sts=off&txt=" + tabText //+ "&imgloc="  + urlencode("../../" + window.top.useDir + "/tabs/") + textcolorstring + textdisabledcolorstring;

	var naSrc = "/global/scripts/tabjes.php?sts=na&txt=" + tabText //+ "&imgloc=" + urlencode("../../" + window.top.useDir + "/tabs/") + textcolorstring + textdisabledcolorstring;


	if (nosubmit) {

		var setMainLink = "setMainPage_v2('" + linkTo + "', true);";

	} else {

		var setMainLink = "setMainPage_v2('" + linkTo + "');";

	}



	var onclickaction = (extraonclickaction ? extraonclickaction : "");



	++window.top.numTabs;

	window.top.allTabs[window.top.numTabs] = new Array();

	window.top.allTabs[window.top.numTabs]['offsrc'] = offSrc;

	window.top.allTabs[window.top.numTabs]['onsrc'] = onSrc;

	window.top.allTabs[window.top.numTabs]['nasrc'] = naSrc;

	window.top.allTabs[window.top.numTabs]['target'] = linkTo;

	window.top.allTabs[window.top.numTabs]['on'] = false;

	window.top.allTabs[window.top.numTabs]['enabled'] = true;

	window.top.allTabs[window.top.numTabs]['visible'] = true;



	return "<img class=\"pseudolink\" id=\"taboff" + window.top.numTabs + "\" src=\"" + offSrc + "\" onClick=\"" + setMainLink + onclickaction + "\" " + hiddenString + "><img class=\"pseudolink\" id=\"tabon" + window.top.numTabs + "\" style=\"display: none;\" src=\"" + onSrc + "\" onClick=\"" + setMainLink + onclickaction + "\"><img id=\"tabna" + window.top.numTabs + "\" style=\"display: none;\" src=\"" + naSrc + "\">";



}



function setTabStatus(tabIndex, setOn) {

// Sets the status of a tab on or off and redirects to the linkpage



	if (setOn) {



		if (window.top.lastTabIndex > -1) {



			if (document.getElementById('tabon' + window.top.lastTabIndex)) {

				document.getElementById('tabon' + window.top.lastTabIndex).style.display = "none";

				document.getElementById('taboff' + window.top.lastTabIndex).style.display = "";

				document.getElementById('tabna' + window.top.lastTabIndex).style.display = "none";

				window.top.allTabs[window.top.lastTabIndex]['on'] = false;

			}

		}



		window.top.lastTabIndex = tabIndex;



	}



	if (window.top.allTabs[tabIndex] && document.getElementById('tabon' + tabIndex)) {



		document.getElementById('tabon' + tabIndex).style.display = "";

		document.getElementById('taboff' + tabIndex).style.display = "none";

		document.getElementById('tabna' + tabIndex).style.display = "none";

		window.top.allTabs[tabIndex]['enabled'] = true;

		window.top.allTabs[tabIndex]['visible'] = true;

		window.top.allTabs[tabIndex]['on'] = true;



		var expandedRow = (tabIndex >= window.top.rowExtender);

		var cStep = window.top.getCookie('stepApply');



		if (window.top.hideExtenderTab) {

		   setTabVisible(window.top.rowExtender, !expandedRow);

		}



		// Loop per tab om de status te bepalen adhv:

		// 1) is er op een tab geklikt waarvan de index >= rowExtender (alleen indien rowExtender > 0) = expandedRow

		// 2) is de tabIndex <= window.top.cStep, oftewel: de huidige stap in het registratie proces. Zo nee dan is die tab gedisabled.

		for (var vloop = window.top.rowExtender + 1; vloop <= window.top.numTabs; ++vloop) {



			if (expandedRow && window.top.rowExtender > 0) {



				// let op: als je de rowextender tab verbergt moet je 1 tab later

				// beginnen met het disablen van de tabs omdat anders je huidige

				// tab wordt gedisabled!



				setTabEnabled(vloop, (cStep >= vloop - (window.top.rowExtender + (window.top.hideExtenderTab ? 1 : 0))));



			}



			setTabVisible(vloop, expandedRow);



		}

	}



}



function setTabVisible(tabIndex, setVisible) {

	// Zet de tab onzichtbaar:

   	// Per aanroep van bovenstaande settab functie wordt per tab geloopt (beginnend bij global

   	// var rowExtender en deze functie aangeroepen met als waarde 'expandedRow', een boolean

   	// die waar is als de index van de huidige tab >= rowExpander.

   	// De functie werkt (logischerwijze) alleen als setVisible een andere waarde heeft dan

   	// de visible waarde van de tab waarvan je de index meegeeft aan deze functie.

	if (window.top.allTabs[tabIndex]['visible'] != setVisible) {

		document.getElementById('tabon' + tabIndex).style.display = (setVisible && window.top.allTabs[tabIndex]['on'] && window.top.allTabs[tabIndex]['enabled'] ? "" : "none");

		document.getElementById('taboff' + tabIndex).style.display = (setVisible && (!window.top.allTabs[tabIndex]['on']) && window.top.allTabs[tabIndex]['enabled'] ? "" : "none");

		document.getElementById('tabna' + tabIndex).style.display = (setVisible && (!window.top.allTabs[tabIndex]['enabled']) ? "" : "none");

		window.top.allTabs[tabIndex]['visible'] = setVisible;

	}



}



function setTabEnabled(tabIndex, setEnabled) {

   	// Mag je deze tab al bezoeken

	// Zelfde systeem als setTabVisible, echter wordt er hier gekeken of de huidige

	// registratie stap (cookie cStep) >= de index van de huidige tab.

	if (window.top.allTabs[parseInt(tabIndex)]['enabled'] != setEnabled) {

		document.getElementById('tabon' + tabIndex).style.display = (setEnabled && window.top.allTabs[tabIndex]['on'] && window.top.allTabs[tabIndex]['visible'] ? "" : "none");

		document.getElementById('taboff' + tabIndex).style.display = (setEnabled && (!window.top.allTabs[tabIndex]['on']) && window.top.allTabs[tabIndex]['visible'] ? "" : "none");

		document.getElementById('tabna' + tabIndex).style.display = ((!setEnabled) && window.top.allTabs[tabIndex]['visible'] ? "" : "none");

		window.top.allTabs[tabIndex]['enabled'] = setEnabled;

	}



}



function chTop(newTop) {

	window.top.setCookie('currentPage','');

	window.top.location.href = newTop;

}



function getIndexForPage(pageName) {

// used in setMainPage()



	for (var tmpLoop = 1; tmpLoop <= window.top.allTabs.length; ++tmpLoop) {



		if (window.top.allTabs[tmpLoop]) {

			if (window.top.allTabs[tmpLoop]['target'] == pageName) {

				return tmpLoop;

				break;

			}

		}



	}

}





// Gekleurde blokken rechts van de pagina:



function createRightBlockStart(blockurl) {

// returns the start of the blocks container div on the right of the page.

  	return "<div class=\"rightblocks\">";         

}



function createRightBlockEnd() {

// returns the start of the blocks container div on the right of the page.



	return "</div>";

}



function createRightBlock(topText, middleText, bottomText, useClass, useUrl) {

// returns the html code for a colored block to be used on the right of the page

// topText: the text/html to be put in the top portion of the block

// middleText: the text/html to be put in the middle portion of the block

// bottomText: the text/html to be put in the bottom portion of the block

// useClass: the class to use. the default class is "default". you can specify other classes in the stylesheet to create different colored blocks (syntax: block_[useClass]_top etc).

   if (useUrl) {
   	return "<table cellspacing=\"0\" width=\"100%\" onclick=\"window.top.location.href='"+useUrl+"';\"><tr><td class=\"block_" + useClass + "_top\">" + topText + "</td></tr><tr><td class=\"block_" + useClass + "_middle\">" + middleText + "</td></tr><tr><td class=\"block_" + useClass + "_bottom\">" + bottomText + "</td></tr></table>";
   } else {
   	return "<table cellspacing=\"0\" width=\"100%\"><tr><td class=\"block_" + useClass + "_top\">" + topText + "</td></tr><tr><td class=\"block_" + useClass + "_middle\">" + middleText + "</td></tr><tr><td class=\"block_" + useClass + "_bottom\">" + bottomText + "</td></tr></table>";      
   }



}



function createBlockLink(linkText, linkAction, useClass) {

// returns the html code for a link used in the colored blocks

// linkText: Text for the link

// linkAction: the onClick action

// useClass: the class to use. the default class is "default". you can specify other classes in the stylesheet to create different colored blocks (syntax: block_[useClass]_top etc).



	return "<div class=\"block_" + useClass + "_link\" onClick=\"" + linkAction + "\">" + linkText + "</div>";

}





// Misc



function createPageHeader(pageTitle, useClass, whenLoad, styleDir) {

// returns the html code for the page header including stylesheets, doctype, head and body

// pageTitle: the title to use for the page.

// useClass: the class to use for the body.

// whenLoad: onLoad action

// styleDir: manually specify which stylesheet to use



	if (!styleDir) {

		if (window.top.useDir) {

			styleDir = window.top.useDir;

		} else {

			styleDir = "home";

		}

	}


	//let op: ie mac ondersteund GEEN htmlElement.style als je een dtd opgeeft!

	//strHTML = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";

	strHTML = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">";

	strHTML += "<html><head><title>" + pageTitle + "</title>";

	strHTML += "<meta http-equiv=\"expires\" content=\"31 Dec 2000 23:59:00 GMT\">";

	strHTML += "<link rel=\"stylesheet\" href=\"/" + styleDir + "/htmlcontrols.css\" type=\"text/css\"><link rel=\"stylesheet\" href=\"/global/style.css\" type=\"text/css\">";

	strHTML += "<link rel=\"stylesheet\" href=\"/" + styleDir + "/style.css\" type=\"text/css\"><link rel=\"stylesheet\" href=\"/global/style.css\" type=\"text/css\"></head><body class=\"" + useClass + "\" " + whenLoad + ">";



	return strHTML;

}



function createPageFooter() {

// returns the html code for the page footer, typically the closing of the tags used in createPageHeader()



	return "</body></html>";

}



function getMainPageName() {

// returns the name of the page in the main frame. uses a variable located in the index.html file.



	//var cPagePath = new String(parent.main.location);

	//return cPagePath.substr(cPagePath.lastIndexOf("/") + 1);

	if (window.top.getCookie) {

		return window.top.getCookie("currentPage");

	}



}



function createInfobox(title, content) {

	// tbc

}



function redirectUser(newLocation, resetCP, cancelform) {

// resets the currentPage variable and redirects the top frame to the new location



	if (resetCP) window.top.setCookie("currentPage", "");



	if (cancelform) {



		if (!confirmCancelRegistration(newLocation, true)) {

			window.top.location.href = newLocation;

		}



	} else {

		window.top.location.href = newLocation;

	}



}



function confirmCancelRegistration(newLocation, settop) {

// if the page in the main frame contains a form with a hidden

// field called inreg the cancel_registration procedure in the package defined by

// the value of the inreg field will be called which redirects to newlocation



	var checkform;



	if (window.top.main.document.forms.length > 0  && window.top.main.document.forms.regcheck) checkform = window.top.main.document.forms.regcheck;



	if (checkform && (checkform.inreg)) {
   
		if (!confirm("Wilt u de tot nu toe ingevulde informatie behouden?")) {
            
			//window.top.main.location.href = '/pls/' + dadname + '/' + checkform.inreg.value + '.cancel_registration?newlocation=' + newLocation + '&settop=' + (settop ? '1' : '0');
			window.top.main.location.href =  newLocation;
   
			return true;
   
		}
   
	}



}



function setMainPage(newLocation, nosubmit) {

// sets the currentPage variable and redirects the 'main' frame to the new location

// use nosubmit to cancel the registration (see confirmCancelRegistration)



	var theform;

	var skipit;
	
	var donotsubmit = "false";



	window.top.setCookie("currentPage", newLocation, "/");

	if (window.top.main.document.forms.length > 0  && window.top.main.document.forms.cform) theform = window.top.main.document.forms.cform;



	if (nosubmit) skipit = confirmCancelRegistration(newLocation);



	if (!skipit && theform && (theform.whenSubmit && theform.whenSubmit.value == 'ever')) {



		if (theform.beforesubmit) {

    			eval(theform.beforesubmit.value);

    		}



		theform.newLocation.value = newLocation;

		
		if (donotsubmit == 'true') {
			//nothing
		} else {
			theform.submit();
		}


	} else {



		window.top.main.location.href = newLocation;



	}



}



function setMainPage_v2(newLocation, nosubmit) {

// sets the currentPage variable and redirects the 'main' frame to the new location

// wraps to setMainPage, still needs to be replaced...



	setMainPage(newLocation,nosubmit);



}



function setTab(location) {

// sets the currentPage variable and redirects the 'main' frame to the new location



	window.top.setCookie("currentPage", location);

	window.top.ltop.location.reload();

}



function setTab_v2(newLocation) {

	var tmpTabIndex;

   //alert(newLocation);

	if (window.top.ltop) {

		if (window.top.ltop.getIndexForPage) {

	   		tmpTabIndex = window.top.ltop.getIndexForPage(newLocation);

		}

	}



	if (tmpTabIndex && (tmpTabIndex != window.top.lastTabIndex)) {



		if (window.top.rowExtender > 0) {

			if (tmpTabIndex == window.top.rowExtender && window.top.hideExtenderTab) {

			   tmpTabIndex = window.top.rowExtender + 1;

			}

			if (window.top.getCookie('stepApply') < tmpTabIndex - (window.top.rowExtender + (window.top.hideExtenderTab ? 1 : 0))) {

			   window.top.setCookie('stepApply', tmpTabIndex - (window.top.rowExtender + (window.top.hideExtenderTab ? 1 : 0)));

			}

		}



		window.top.ltop.setTabStatus(tmpTabIndex, true);



	}

}



function createButton(caption, useClass, action, setEnabled, setWidth, setHeight, imgLeft, imgRight, setError, txtError) {

// creates a button by using a table.

// caption: text on the button

// useClass: the class to use. the default class is "button". you can specify other classes in the stylesheet to create different colored blocks (syntax: [useClass]_down etc).

// action: the onClick action

// setEnabled: specifies id the button is enabled. this setting ignores the action argument and uses the css class [useClass]_disabled.

// setWidth & setHeight: allows manual setting of the button width & height

// imgLeft & imgRight: used to specify an image to display on the left and/or right of the caption.



	//return "<table " + (setWidth || setHeight ? "style=\"" + (setWidth ? "width: " + setWidth + ";" : "") + (setHeight ? "height: " + setHeight + ";" : "") + "\" " : "") + "cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"" + useClass + (setEnabled ? "" : "_disabled") + "\" " + (setEnabled ? "onMouseDown=\"this.className='" + useClass + "_down'\" onMouseUp=\"this.className='" + useClass + "'\" onMouseOut=\"this.className='" + useClass + "'\" onClick=\"" + action + "\"" : "") + ">" + (imgLeft ? "<div style=\"float: left; padding-left: 5px;\"><img border=\"0\" src=\"" + imgLeft + "\"></div>" : "") + (imgRight ? "<div style=\"float: right; padding-right: 5px;\"><img border=\"0\" src=\"" + imgRight + "\"></div>" : "") + caption + "</td></tr></table>";

	//alert("<table " + (setWidth || setHeight ? "style=\"" + (setWidth ? "width: " + setWidth + ";" : "") + (setHeight ? "height: " + setHeight + ";" : "") + "\" " : "") + "cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"" + useClass + (setEnabled ? "" : "_disabled") + "\" " + (setEnabled ? "onMouseDown=\"this.className='" + useClass + "_down'\" onMouseUp=\"this.className='" + useClass + "'\" onMouseOut=\"this.className='" + useClass + "'\" onClick=\"" + action + "\"" : "") + ">" + (imgLeft ? "<div style=\"float: left; padding-left: 5px;\"><img border=\"0\" src=\"" + imgLeft + "\"></div>" : "") + (imgRight ? "<div style=\"float: right; padding-right: 5px;\"><img border=\"0\" src=\"" + imgRight + "\"></div>" : "") + caption + "</td></tr></table>");

	//return "<table " + (setWidth || setHeight ? "style=\"" + (setWidth ? "width: " + setWidth + "px;" : "") + (setHeight ? "height: " + setHeight + "px;" : "") + "\" " : "") + "cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"" + useClass + (setEnabled ? "" : "_disabled") + "\" " + (setEnabled ? "onMouseDown=\"this.className='" + useClass + "_down'\" onMouseUp=\"this.className='" + useClass + "'\" onMouseOut=\"this.className='" + useClass + "'\" onClick=\"" + action + "\"" : "") + ">" + (imgLeft ? "<div style=\"float: left; padding-left: 5px;\"><img border=\"0\" src=\"" + imgLeft + "\"></div>" : "") + (imgRight ? "<div style=\"float: right; padding-right: 5px;\"><img border=\"0\" src=\"" + imgRight + "\"></div>" : "") + caption + "</td></tr></table>";

	//return "<table " + (setWidth ? " width=\"" + setWidth + "\"" : "") + (setHeight ? " height=" + setHeight + "\"" : "") + " cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"" + useClass + (setEnabled ? "" : "_disabled") + "\" " + (setEnabled ? "onMouseDown=\"this.className='" + useClass + "_down'\" onMouseUp=\"this.className='" + useClass + "'\" onMouseOut=\"this.className='" + useClass + "'\" onClick=\"" + action + "\"" : "") + ">" + (imgLeft ? "<div style=\"float: left; padding-left: 5px;\"><img border=\"0\" src=\"" + imgLeft + "\"></div>" : "") + (imgRight ? "<div style=\"float: right; padding-right: 5px;\"><img border=\"0\" src=\"" + imgRight + "\"></div>" : "") + caption + "</td></tr></table>";



	if (!useClass) useClass = "button";

	var curClass = useClass + ((setEnabled || setError) ? "" : "_disabled");

	var widthHeight = (setWidth ? " width=\"" + setWidth + "\"" : "") + (setHeight ? " height=" + setHeight + "\"" : "");

	var clickAction = ((setEnabled || setError)? "onMouseDown=\"this.className='" + useClass + "_down'\" onMouseUp=\"this.className='" + useClass + "'\" onMouseOut=\"this.className='" + useClass + "'\" "+ (setEnabled?" onClick=\"" + action + "\"":" onClick=\"alert('" + txtError + "')\"") : "");

	var imgLeftHTML = (imgLeft ? "<div style=\"float: left; width:10px;\"><img border=\"0\" src=\"" + imgLeft + "\"></div>" : "" );

	var imgRightHTML = (imgRight ? "<div style=\"float: right; width:10px;\"><img border=\"0\" src=\"" + imgRight + "\"></div>" : "" );

        var cursor = (setEnabled ? "cursor: pointer;" : "cursor: default;");





	// leuk idee maar te traag op mac: onmouseover=\"this.style.border='1px solid #777777';\" onmouseout=\"this.style.border='0px none #000000';\"

	return "<table onselectstart=\"return false\" " + widthHeight + " cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"" + curClass + "\" " + clickAction + " style=\""+cursor+"\">" + imgLeftHTML + imgRightHTML + caption + "</td></tr></table>";



}



function dragDropNotify(label) {

	return "<div onDrop=\"debugPrint('onDrop');\" onDragStart=\"debugPrint('onDragStart');\" onDragOver=\"debugPrint('onDragOver');\" onDragLeave=\"debugPrint('onDragLeave');\" onDragEnter=\"debugPrint('onDragEnter');\" onDragEnd=\"debugPrint('onDragEnd');\" onDragDrop=\"debugPrint('onDragDrop');\" onDrag=\"debugPrint('onDrag');\">" + label + "</div>";

}



function writeTest(writeThis) {

// just a test to check if this page is included properly



	document.write(writeThis);

}



function createCompatibleDate(inDate, fmtString, sepChar) {



	if (!sepChar) sepChar = "-";

	var dateFormat = fmtString.split(sepChar);



	var indexDay = 0;

	var indexMonth = 1;

	var indexYear = 2;



	if (dateFormat[1] == 'd') indexDay = 1;

	if (dateFormat[2] == 'd') indexDay = 2;

	if (dateFormat[0] == 'm') indexMonth = 0;

	if (dateFormat[2] == 'm') indexMonth = 2;

	if (dateFormat[0] == 'y') indexYear = 0;

	if (dateFormat[1] == 'y') indexYear = 1;



	var retVal = inDate.split(sepChar);



	if (retVal[indexYear]) {

		if (retVal[indexYear].length == 2) {

			if (parseInt(retVal[indexYear]) > 30) {

				retVal[indexYear] = "19" + retVal[indexYear];

			} else {

				retVal[indexYear] = "20" + retVal[indexYear];

			}

		}

	}



	this.day = parseInt(retVal[indexDay]);

	this.month = parseInt(retVal[indexMonth]);

	this.year = parseInt(retVal[indexYear]);

	this.indexDay = indexDay;

	this.indexMonth = indexMonth;

	this.indexYear = indexYear;

	this.dateformat = fmtString;

	this.sepChar = sepChar;



}



function DoCal(parentElement, submitThis) {

// Calender popup function



	var winWidth = 250;

	var winHeight = 190;

	if (winNew) if (!winNew.closed) winNew.close();

	calendarSubmit = submitThis;



	if (!parentElement) {



		alert("Cannot open the date dialog because the supplied argument is not an object");



	} else {



		if (parentElement.value.length > 0) {



			var selDate = new createCompatibleDate(parentElement.value, "d-m-y", "-");

			winNew = window.open("/global/scripts/calendar/calendar.php?target_id=" + parentElement.id + "&day=" + selDate.day + "&month=" + selDate.month + "&year=" + selDate.year, "Kalender", "status=no,top=" + ((screen.height/2)-(winHeight/2)) + ",left=" + ((screen.width/2)-(winWidth/2)) + ",width=" + winWidth + ",height=" + winHeight + ",resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no");



		} else {



			winNew = window.open("/global/scripts/calendar/calendar.php?target_id=" + parentElement.id, "Kalender", "status=no,top=" + ((screen.height/2)-(winHeight/2)) + ",left=" + ((screen.width/2)-(winWidth/2)) + ",width=" + winWidth + ",height=" + winHeight + ",resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no");



		}



		winNew.focus();



	}



}



function dateSelected(forElementId, dateValue) {


	if (forElementId) {



		var il = document.getElementById(forElementId);



		if (il) {



			var dayString = new String(dateValue.getDate());

			var monthString = new String((dateValue.getMonth() + 1));



			if (dayString.length == 1) dayString = "0" + dayString;

			if (monthString.length == 1) monthString = "0" + monthString;



			il.value  = dayString + "-" + monthString + "-" + dateValue.getFullYear();

			if (calendarSubmit) document.forms[calendarSubmit].submit();



		}



	}



	winNew.close();



}



function urlencode(text) {

// urlencode function



	text = text.replace(/\//g,"%2F");

   	text = text.replace(/\?/g,"%3F");

  	text = text.replace(/=/g,"%3D");

 	text = text.replace(/&/g,"%26");

    	return text;

}



function openDlg(dlgID, parentObject) {



	closeDlg(openedDlg);

	var il = document.getElementById(dlgID);



	if (il) {



		var parentOffset = totalElementOffset(parentObject);

		var newLeft = parentOffset['x'] - il.offsetWidth + parentObject.parentNode.offsetWidth;

		var newTop = parentOffset['y'] + parentObject.offsetHeight;



		if (useMac) {

			newLeft += 60;

			newTop += 5;

		}



		if (newTop < 5) newTop = 5;

		if (newLeft < 60) newLeft = 60;

		il.style.left = newLeft;

		il.style.top = newTop;



		il.style.visibility = "visible";

		openedDlg = dlgID;



	}

}



function closeDlg(dlgID) {

	var il = document.getElementById(dlgID);

	if (il) il.style.visibility = "hidden";

}



function totalElementOffset(obj) {

// Make positioning compatible with mozilla

// Returns an array containing the total x and y offsets for obj relative to the document



	var yOffset = (obj.offsetTop ? obj.offsetTop : 0);

	var xOffset = (obj.offsetLeft ? obj.offsetLeft : 0);

	var elParent = obj.offsetParent;

	var retVal = new Array();



	while (elParent) {

		yOffset += (elParent.offsetTop ? elParent.offsetTop : 0);

		xOffset += (elParent.offsetLeft ? elParent.offsetLeft : 0);

		elParent = elParent.offsetParent;

	}



	retVal['y'] = yOffset;

	retVal['x'] = xOffset;

	return retVal;



}



function Browser() {



  var ua, s, i;



  this.isIE    = false;

  this.isNS    = false;

  this.version = null;



  ua = navigator.userAgent;



  s = "MSIE";

  if ((i = ua.indexOf(s)) >= 0) {

    this.isIE = true;

    this.version = parseFloat(ua.substr(i + s.length));

    return;

  }



  s = "Netscape6/";

  if ((i = ua.indexOf(s)) >= 0) {

    this.isNS = true;

    this.version = parseFloat(ua.substr(i + s.length));

    return;

  }



  s = "Gecko";

  if ((i = ua.indexOf(s)) >= 0) {

    this.isNS = true;

    this.version = 6.1;

    return;

  }

}



function dragStart(event, id) {

// Werkt in principe wel op de mac maar langzaam & returnvalue wordt genegeerd dus selecteer je

// text tijdens het slepen en dat ziet er niet uit



if (!useMac) {



  var el;

  var x, y;



  if (id)

    dragObj.elNode = document.getElementById(id);

  else {

    if (browser.isIE)

      dragObj.elNode = window.event.srcElement;

    if (browser.isNS)

      dragObj.elNode = event.target;

    if (dragObj.elNode.nodeType == 3)

      dragObj.elNode = dragObj.elNode.parentNode;

  }



  if (browser.isIE) {

  	if (!useMac) {

       x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;

       y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;

     } else {

       x = window.event.clientX + document.body.scrollLeft;

       y = window.event.clientY + document.body.scrollTop;

     }

  }

  if (browser.isNS) {

      x = event.clientX + window.scrollX;

      y = event.clientY + window.scrollY;

  }



  dragObj.cursorStartX = x;

  dragObj.cursorStartY = y;



  dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left, 10);

  dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);



  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;

  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 0;



  dragObj.elNode.style.zIndex = ++dragObj.zIndex;



  if (browser.isIE) {



    window.event.cancelBubble = true;

    window.event.returnValue = false;



    if (useMac) {

    	   document.onmousemove = dragGo;

    	   document.onmouseup = dragStop;

    } else {

        document.attachEvent("onmousemove", dragGo);

        document.attachEvent("onmouseup", dragStop);

    }



  }

  if (browser.isNS) {

    document.addEventListener("mousemove", dragGo,   true);

    document.addEventListener("mouseup",   dragStop, true);

    event.preventDefault();

  }



}



}



function dragGo(event) {



  var x, y;



  if (browser.isIE) {



    if (!useMac) {

        x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;

        y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;

    } else {

        x = window.event.clientX + document.body.scrollLeft;

        y = window.event.clientY + document.body.scrollTop;

    }



  }

  if (browser.isNS) {

    x = event.clientX + window.scrollX;

    y = event.clientY + window.scrollY;

  }



  dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";

  dragObj.elNode.style.top  = (dragObj.elStartTop  + y - dragObj.cursorStartY) + "px";



  if (browser.isIE) {

    window.event.cancelBubble = true;

    window.event.returnValue = false;

  }

  if (browser.isNS)

    event.preventDefault();

}



function dragStop(event) {

// Stop capturing mousemove and mouseup events.



  if (browser.isIE) {

    if (!useMac) {

        document.detachEvent("onmousemove", dragGo);

        document.detachEvent("onmouseup",   dragStop);

    } else {

    	   document.onmousemove = false;

    	   document.onmouseup = false;

    }

  }

  if (browser.isNS) {

    document.removeEventListener("mousemove", dragGo,   true);

    document.removeEventListener("mouseup",   dragStop, true);

  }

}



function debugPrint(debugText) {

// Opens a window if not already open and outputs debugText information to it



	if (!debugWindow) debugWindow = window.open("", "DebugWindow", "status=no,top=0,left=0,width=250,height=250,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no");

	if (debugWindow.closed) debugWindow = window.open("", "DebugWindow", "status=no,top=0,left=0,width=250,height=250,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no");

	if (debugWindow) debugWindow.document.write("<font size=\"1\" face=\"arial\">" + debugText + "</font><br>");

}



// Content blokken (midden)


function createContentBlock(contentTitle, contentText, drawLine) {
// returns the html code for a block of content in the center of the page.
	return "<div class=\"contentblock\"><span class=\"contenttitle\">" + contentTitle + "<br></span><span class=\"contenttext\">" + contentText + "</span>" + (drawLine ? "<hr class=\"contentline\">" : "") + "</div>";
}

function createContentBlockHome(contentTitle, contentText, drawLine) {
// returns the html code for a block of content in the center of the page.
	return "<div class=\"contentblock\"><span class=\"contenttitle\">" + contentTitle + "<br></span><span class=\"contenttexthome\">" + contentText + "</span>" + (drawLine ? "<hr class=\"contentline\">" : "") + "</div>";
}


function createSpacer(spacerWidth, spacerHeight) {
// returns the html code for a spacer div.
	return "<div style=\"width: " + spacerWidth + "px; height: " + spacerHeight + "px; font-size: 0pt;\"></div>";
}


// Form blokken (midden)

function createInfoBlockStart(useClass, bgImage) {

// returns the html code for an infoblock, typically used as a background for the forms.

// useClass: the class to use. the default class is "default". you can specify other classes in the stylesheet to create different colored blocks (syntax: block_[useClass]_info).



	if (!useClass) useClass = "default";

	return "<table><tr><td valign=\"top\" class=\"block_" + useClass + "_info\"" + (bgImage ? " style=\"background-image: url('" + bgImage + "');\"" : "") + ">";

}



function createInfoBlockEnd() {

// returns the html code to be used to close the infoblock created with createInfoBlockStart()



	return "</td></tr></table>";

}



function createFormBlockStart(useClass) {

// returns the html code for a form block. use this to make sure all fields are aligned properly and have the same width.

// useClass: currently unused



	return "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";

}



function createFormBlockEnd() {

// returns the html code to be used to close the formblock created with createFormBlockStart()



	return "</table>";

}



function createFormBlock(label, field, helptext, widthL, widthM, widthR) {   //                    _________

// returns the html code for a row in the order: [label][field][helptext], for instance: "name:   |_________| fill in your name here".

// the row is part of the table created with createFormBlockStart() and thus all columns have the same width.



	if (!label) label = "";

	if (!field) field = "";

	if (!helptext) helptext = "";

	if (widthL) widthL = "width=\"" + widthL + "\"";

	if (widthM) widthM = "width=\"" + widthM + "\"";

	if (widthR) widthR = "width=\"" + widthR + "\"";



	return "<tr><td nowrap class=\"field_label\" " + widthL + ">" + label + "</td><td class=\"field_input\" " + widthM + ">" + field + "</td><td class=\"field_label\" " + widthR + "><i>" + helptext + "</i></td></tr>";



}



function createFormSubItem(subText) {

// returns the html code for a row which only has text in the second column. use this to seperate different parts of the form or to insert an empty (spacer) row.



	return "<tr><td class=\"field_label\">&nbsp;</td><td class=\"field_subtext\" colspan=\"2\">&nbsp;&nbsp;&nbsp;&nbsp;" + subText + "</td><td></td></tr>";

}



function createFieldTable(fieldhtml, pretext, posttext, opentable, closetable, align, width) {

// returns the html code for a table which contains the field. use this to properly align pretext/posttext with previous rows and to create multiple fields in one formBlock row.

// fieldhtml: the html code for the field

// pretext: text to put before the field. this text is put inside a seperate <TD> to make sure the vertical align works properly. if you dont want a <TD> set this to null.

// posttext: text to put after the field. this text is put inside a seperate <TD> to make sure the vertical align works properly. if you dont want a <TD> set this to null.

// opentable: boolean value to specify that you want to include a <table> tag. set to false when this is not the first field in the same row.

// closetable: boolean value to specify that you want close the <table> tag. set to false if more fields will follow in the same row.



	if (!width) width = "100%";

	return (opentable ? "<table " + (align ? "align=\"" + align + "\"" : "") + " border=\"0\" width=\"" + width + "\" cellpadding=\"0\" cellspacing=\"0\"><tr>" : "") + (pretext.length > 0 ? "<td class=\"field_input_extra\" style=\"width:15px;\" nowrap>" + pretext + "</td>" : "") + "<td class=\"field_input\" " + (align && !opentable ? "align=\"" + align + "\"" : "") + " nowrap>" + fieldhtml + "</td>" + (posttext.length > 0 ? "<td class=\"field_input_extra\" nowrap>" + posttext + "</td>" : "") + (closetable ? "</tr></table>" : "");

}



function createSendApplicationButton(caption, useClass, actionAfterPress, whenActive, style) {
// returns the html code for a 'send your application' button

// voor reg_prof (default)
//    actionAfterPress: setMainPage('reg_prof.get_prof_final');
//    whenActive:       4

   if (!actionAfterPress) {
      actionAfterPress = "setMainPage_v2('/pls/jerry/reg_prof.handle_finish')";
   }

   if (!whenActive) {
      whenActive = 4;
   }

// voor reg_org
//    actionAfterPress: setMainPage('reg_org.get_org_final');
//    whenActive        3

   strHTML = "<table width=\"680\"><tr><td align=\"center\">";
   var txcolor = "";

   // bah
   if (window.top.useDir == "opdrachtgevers") {
   	txcolor="&fontcolor=0,145,118";
   }
   // ! gebruikt nieuwe dynamic image php pagina !
   if (window.top.getCookie('stepApply') > whenActive) {
   	//strHTML += "<img style=\"cursor: pointer; cursor: hand;\" src=\"/global/scripts/dynimg.php?sts=on&imgloc="+window.top.useDir+"&imgtype=btn&txt=Inschrijving%20Versturen&textoffset=40"+txcolor+"\" onclick=\""+ actionAfterPress +"\" border=\"0\">";
   	strHTML += "<img style=\"cursor: pointer; cursor: hand;\" src=\"/global/img/inschrijving.gif\" onclick=\""+ actionAfterPress +"\" border=\"0\">";
   } else {
   	//strHTML += "<img src=\"/global/scripts/dynimg.php?sts=off&imgloc="+window.top.useDir+"&imgtype=btn&txt=Inschrijving Versturen&textoffset=40"+txcolor+"\" border=\"0\">";
   	strHTML += "<img src=\"/global/img/inschrijving_grijs.gif\" border=\"0\">";
   }

   strHTML += "</td></tr></table><br>";

   return strHTML;

}

function createSendApplicationButton2(caption, useClass, actionAfterPress, whenActive, style) {
// returns the html code for a 'send your application' button

// voor reg_prof (default)
//    actionAfterPress: setMainPage('reg_prof.get_prof_final');
//    whenActive:       4

   if (!actionAfterPress) {
      actionAfterPress = "setMainPage_v2('/pls/jerry/reg_prof.handle_finish')";
   }

   if (!whenActive) {
      whenActive = 4;
   }

// voor reg_org
//    actionAfterPress: setMainPage('reg_org.get_org_final');
//    whenActive        3

   strHTML = "";
   var txcolor = "";

   // bah
   if (window.top.useDir == "opdrachtgevers") {
   	txcolor="&fontcolor=0,145,118";
   }
   // ! gebruikt nieuwe dynamic image php pagina !
   if (window.top.getCookie('stepApply') > whenActive) {
   	//strHTML += "<img style=\"cursor: pointer; cursor: hand;\" src=\"/global/scripts/dynimg.php?sts=on&imgloc="+window.top.useDir+"&imgtype=btn&txt=Inschrijving%20Versturen&textoffset=40"+txcolor+"\" onclick=\""+ actionAfterPress +"\" border=\"0\">";
   	strHTML += "<img style=\"cursor: pointer; cursor: hand;\" src=\"/global/img/inschrijving.gif\" onclick=\""+ actionAfterPress +"\" border=\"0\">";
   } else {
   	//strHTML += "<img src=\"/global/scripts/dynimg.php?sts=off&imgloc="+window.top.useDir+"&imgtype=btn&txt=Inschrijving Versturen&textoffset=40"+txcolor+"\" border=\"0\">";
   	strHTML += "<img src=\"/global/img/inschrijving_grijs.gif\" border=\"0\">";
   }

   strHTML += "";

   return strHTML;

}



function createCheckTreeItem(caption, level, name, value, checked) {

// returns the html code for a checkbox tree item. use level to specify the depth.



	var i;

	var lvString = "";



	for (i = 0; i < level; ++i) { lvString += "<td style=\"border-right: 1px solid #999999;\" width=10>&nbsp;</td>"; }

	return "<table cellspacing=\"1\"><tr>" + lvString + "</td>" + createFieldTable("<input type=\"checkbox\" name=\"" + name + "\" id=\"" + name + "\" value=\"" + value + "\"" + (checked?" checked":"") + ">", "", "<label class=\"pseudolink\" for=\"" + name + "\">" + caption + "</label>", false, true);



}



function createPrevNextButtons(nextEnabled, globalEnabled, lastPage, nextPage, nextStep, noPrevButton, noNextButton, text, usedir, useErrorEnabledStyle, txtError) {

// returns the html code for the previous and next buttons

// nextEnabled: determines if the next button is enabled

// globalEnabled: determines if both the buttons are enabled

// lastPage: target for the last button

// nextPage: target for the next button

// nextStep: will set window.top.stepApply

// noPrevButton: don't draw the 'previous' button

// noNextButton: don't draw the 'next' button



//return "<table><tr><td colspan=\"3\" class=\"field_label\">" + text + "</td></tr></table><table><tr><td>" + (noPrevButton ? "" : createButton("Vorige", "button", "setMainPage('" + lastPage + "');", globalEnabled, 75, 25, "/global/img/arrow_left_blue" + (!globalEnabled ? "_disabled" : "") + ".gif")) + "</td><td>" + (noNextButton ? "" : createButton("Volgende", "button", "if (window.top.stepApply < " + nextStep + ") window.top.setCookie('stepApply', " + nextStep + "); setMainPage('" + nextPage + "');", (globalEnabled && nextEnabled), 75, 25, null, "/global/img/arrow_right_blue" + (!globalEnabled || !nextEnabled > 0 ? "_disabled" : "") + ".gif")) + "</td></tr></table>";



   if (usedir ==  null) {

   		if (window.top.useDir) {

   			usedir = window.top.useDir;

   		} else {

      		usedir = "global";

     	}

   }

   prev_enabled = (globalEnabled && (!noPrevButton));
   next_enabled = (globalEnabled && (nextEnabled || useErrorEnabledStyle));
   streepje_enabled = (prev_enabled && next_enabled);
   
   if (globalEnabled && nextEnabled) {
      action_next = " onClick=\"setMainPage_v2('" + nextPage + "')\"";   
   } else if (next_enabled ) {
      action_next = " onClick=\"alert('" + txtError + "')\""
   } else {
      action_next = "  ";
   }   
   if (prev_enabled) {
      action_prev = " onClick=\"setMainPage_v2('" + lastPage + "')\"";   
   } else {
      action_prev = " ";
   }   
   class_next     = " class=\"knop_"+(next_enabled ? "" : "in")+"active\" ";
   img_next       = "<img src=\"/global/img/formulier-rechts" + (next_enabled ? "" : "-licht")+".gif\">";
   class_prev     = " class=\"knop_"+(prev_enabled ? "" : "in")+"active\" ";
   class_streep   = " class=\"knop_"+(streepje_enabled ? "" : "in")+"active\" ";
   img_prev       = "<img src=\"/global/img/formulier-links"+(prev_enabled ? "" : "-licht")+".gif\">";

   return "<table><tr><td colspan=\"3\" class=\"field_label\">" + text + "</td></tr></table>"+
          "<table><tr>" + 
          "<td " + class_prev + action_prev + ">" + img_prev + "</td>" +
          "<td " + class_prev + action_prev + ">vorige</td>" +          
          "<td " + class_streep + ">|</td>" +
          (noNextButton ? "<td style=\"width:100px\"></td>" :"<td " + class_next + action_next + ">volgende</td>" +
          "<td " + class_next + action_next + ">" + img_next + "</td>") +
          "</tr></table>";

          
          
          //(noPrevButton ? "" : "<td><img src='vorige.gif'></td>") +
          //createButton("Vorige", "button", "setMainPage_v2('" + lastPage + "');", globalEnabled, 75, 25, "/" + usedir + "/img/arrow_left" + (!globalEnabled ? "_disabled" : "") + ".gif")) + 
          //"</td><td>" + (noNextButton ? "" : createButton("Volgende", "button", "setMainPage_v2('" + nextPage + "');", (globalEnabled && nextEnabled), 75, 25, null, "/" + usedir + "/img/arrow_right" + (!useErrorEnabledStyle && (!globalEnabled || (!nextEnabled > 0)) ? "_disabled" : "") + ".gif", useErrorEnabledStyle, txtError)) 
          



}



// Koekjes



function getCookieVal (offset) {



	var endstr = document.cookie.indexOf (";", offset);



	if (endstr == -1) endstr = document.cookie.length;

	return unescape(document.cookie.substring(offset, endstr));



}



function getCookie (name) {



	// currentPage afvangen: ieder gebruikerstype heeft zo zijn eigen koekje

	if (window.top.useDir) name = (name == "currentPage" ? name + "_" + window.top.useDir : name);



	var arg = name + "=";

	var alen = arg.length;

	var clen = document.cookie.length;

	var i = 0;



	while (i < clen) {



		var j = i + alen;



		if (document.cookie.substring(i, j) == arg) return getCookieVal (j);

		i = document.cookie.indexOf(" ", i) + 1;

		if (i == 0) break;



	}



	return null;



}



function setCookie (name, value, thepath) {



	// currentPage afvangen

	if (window.top.useDir) name = (name == "currentPage" ? name + "_" + window.top.useDir : name);


	var argv = setCookie.arguments;

	var argc = setCookie.arguments.length;

	var expires = (argc > 2) ? argv[2] : null;

	var path = (argc > 3) ? argv[3] : null;

	var domain = (argc > 4) ? argv[4] : null;

	var secure = (argc > 5) ? argv[5] : false;



	document.cookie = name + "=" + escape (value) +

		

		((thepath == null) ? "; path=/" : ("; path=" + thepath)) +

		((domain == null) ? "" : ("; domain=" + domain)) +

		((secure == true) ? "; secure" : "");



}



function deleteCookie (name) {



	// currentPage afvangen

	if (window.top.useDir) name = (name == "currentPage" ? name + "_" + window.top.useDir : name);



	var exp = new Date();

	exp.setTime (exp.getTime() - 1);

	var cval = GetCookie (name);

	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();



}



function pwcheck(pc, num, cid, cty, strt) {

   if (pc != '' && num != '' && cid == 'NLD') {

      address = pc+num;

      theIframe = document.getElementById('replacePopup');
      theIframe.src = '/intra/postcode/pcpopup.php?address='+address+'&city='+cty+'&street='+strt,'Postcodecheck'

      //window.open('/intra/postcode/pcpopup.php?address='+address+'&city='+cty+'&street='+strt,'Postcodecheck','toolbar=no,scrollbars=no,status=no,width=300,height=100,left=5000,top=5000');

      self.focus();

   }

}


function debugHandler(aMessage, aURL, aLineNumber) {



   var myText = "An error has occurred in the current script:\n\n";

   myText += aMessage + "\n\n at URL\n";

   myText += aURL + "\n\non line number ";

   myText += aLineNumber;



   alert(myText);

   return true;



}



// Note that this may not work in Netscape

//java.lang.System.out.println(errMessage); of

//self.onerror = debugHandler("This is an example error", "local site", 21);

//myError = null.open();


function print_element(el) {
	the_element = el;
	windowHandler = window.open('about:blank','_blank');
	if (!windowHandler.opener) windowHandler.opener = self;

	contents = document.getElementById(the_element).outerHTML;
	if (typeof (contents) == 'undefined') {
	   contents = document.getElementById(the_element).innerHTML;
	}

	contents = contents.replace(/document\.write \((.*)\);/gi,'');
	
	//alert(contents);
   //return;

	windowHandler.document.open();
	windowHandler.document.write('<HTML><HEAD><TITLE>Jerry<\/TITLE><\/HEAD>\n');
	windowHandler.document.write('<LINK REL="stylesheet" TYPE="text\/css" HREF="/global/htmlcontrols.css">\n');
	windowHandler.document.write('<LINK REL="stylesheet" TYPE="text\/css" HREF="/global/style.css">\n');
	windowHandler.document.write('<LINK REL="stylesheet" TYPE="text\/css" HREF="/kandidaten/htmlcontrols.css">\n');
	windowHandler.document.write('<LINK REL="stylesheet" TYPE="text\/css" HREF="/kandidaten/style.css">\n');
	//windowHandler.document.write('<SCRIPT LANGUAGE="javascript" SRC="/global/scripts/javascript.js"></SCRIPT>\n');
	windowHandler.document.write('<BODY onLoad="window.print()">\n\n');
	windowHandler.document.write(contents);
	windowHandler.document.write('<\/BODY>\n');
	windowHandler.document.write('<\/HTML>\n');
	windowHandler.document.close();
}
