	//javascript
	
	//[start custom]
	function verwijderArtikel(vArtikelId,vArtikelTypeId,vStateArtikel){
		if(confirm('Het item verwijderen?')){
			location.href='artikel_verwijderd.asp?artikel_id='+vArtikelId+'&amp;artikel_type_id='+vArtikelTypeId+'&amp;pagType=b'+'&amp;state_artikel='+vStateArtikel;
		}
	}


	function checkInput(obj,waarde){
		re = /[^A-Za-z0-9^_ëèéï@ç.\s/]/g; //al deze characters mogen inclusief de spatie (/s)
		newStr = re.test(waarde);
		window.status=newStr;
		if (newStr){
			obj.style.backgroundColor="#ff8000";
			obj.value = obj.value.substr(0,obj.value.length-1)
		}else{
			obj.style.backgroundColor="#ffffff";
		}
	}


	//popup foto
	var linkerkant = 0;
	var bovenkant = 0;
	
	if (parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
	var optNN='scrollbars=no,width=10,height=10,left='+linkerkant+',top='+bovenkant;
	var optIE='scrollbars=no,width=10,height=10,left='+linkerkant+',top='+bovenkant;
	
	function popFoto(BeeldURL,BeeldTitel){
		if (isNN){imgWin=window.open('about:blank','',optNN);}
		if (isIE){imgWin=window.open('about:blank','',optIE);}
		with (imgWin.document){
		writeln('<html><head><title>Bezig met inladen ...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
		writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function aanpassen_aan_beeldgrootte(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
		writeln('width=100-(document.body.clientWidth-document.images[0].width);');
		writeln('height=100-(document.body.clientHeight-document.images[0].height);');
		writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
		writeln('window.innerWidth=document.images["BeeldNaam"].width;');writeln('window.innerHeight=document.images["BeeldNaam"].height;}}');
		writeln('function maak_titel(){document.title="'+BeeldTitel+'";}');writeln('</sc'+'ript>');
		writeln('</head><body bgcolor=000000 scroll="no" onload="aanpassen_aan_beeldgrootte();maak_titel();self.focus()" onblur="self.close()">');
		writeln('<img name="BeeldNaam" src='+BeeldURL+' style="display:block"></body></html>');
		close(); 
		}
	} 
function urlWhitespace(waarde){
	var regExp = /\s+/g;
	var aString = waarde;
	return aString.replace(regExp,'%20'); 
}

//AFSYS
	//gebruikers toevoegen
	function fnValidateForm() {
		var s = "";
		var selectedList = document.getElementById("selectedOptions");
		var r = "";
		for (var j=0; j<selectedList.length; j++){
			r += selectedList.item(j).value + ",";
		}
		document.form1.sSelectedOptions.value = r;
		//if (window.confirm('Gegevens opslaan')){
			document.form1.submit();
			//return true;
		//} 
	}
	//hb/20061029
	function removeDoubles() {
		var s = "";
		var availableList = document.getElementById("availableOptions");
		var selectedList = document.getElementById("selectedOptions");
		for (var i=0; i<selectedList.length; i++){
			for (var j=0; j<availableList.length; j++){
				for (var k=0; k<selectedList.length; k++){
					if (availableList.item(j).value==selectedList.item(k).value){
						availableList.removeChild(availableList.options.item(j));
					}
				}
			}
		}
	}

	function addAllOptions() {
	var selectedList = document.getElementById("selectedOptions");
	var availableList = document.getElementById("availableOptions");
	var len = availableList.length - 1;
	for (i=len; i>=0; i--){
	selectedList.appendChild(availableList.item(i));
	}
	selectNone(selectedList, availableList);
	}
	function addOption() {
	var selectedList = document.getElementById("selectedOptions");
	var availableList = document.getElementById("availableOptions");
	var addIndex = availableList.selectedIndex;
	if (addIndex < 0)
	return;
	selectedList.appendChild(availableList.options.item(addIndex));
	selectNone(selectedList, availableList);
	}
	function delOption() {
	var selectedList = document.getElementById("selectedOptions");
	var availableList = document.getElementById("availableOptions");
	var selIndex = selectedList.selectedIndex;
	if (selIndex < 0)
	return;
	availableList.appendChild(selectedList.options.item(selIndex));
	selectNone(selectedList, availableList);
	}
	function delAllOptions() {
	var selectedList = document.getElementById("selectedOptions");
	var availableList = document.getElementById("availableOptions");
	var len = selectedList.length;
	for (i=0; i<len; i++){
	availableList.appendChild(selectedList.item(0));
	}
	selectNone(selectedList, availableList);
	}
	function selectNone(list1, list2) {
	list1.selectedIndex = -1;
	list2.selectedIndex = -1;
	addIndex = -1;
	selIndex = -1;
	}
	
	function MM_jumpMenu(selObj){ //v3.0
	  eval("location='"+selObj.options[selObj.selectedIndex].value+"'");
	}
	
	function opslaanPatientenbrief(){
		//alert(gup("artikel_id"));
		location.href="/afsys/patientenbrief_gewijzigd.asp?artikel_id="+gup("artikel_id");
	}
	
	function wijzigTekstPatientenbrief(){
		location.href="sf.asp?pagID=artikelen_tab1&contentID=bewerk_bericht&artikel_type_id=26&artikel_id="+gup("artikel_id");	
	}
	function nieuweTekstPatientenbrief(){
		location.href="sf.asp?pagID=artikelen_tab1&artikel_type_id=26";
	}
	
//EIND AFSYS

//Get Url Parameter (GUP)
	function gup( name )
	{
	  var regexS = "[\\?&]"+name+"=([^&#]*)";
	  var regex = new RegExp( regexS );
	  var tmpURL = window.location.href;
	  var results = regex.exec( tmpURL );
	  if( results == null )
		return "";
	  else
		return results[1];
	}
	
//[todo: commentaar verwijderen of encoderen]
	function setCheckbox(artikel_type_id,waarde){
			form1.method = "post";
			form1.action = "publiceer.asp?artikel_type_id="+artikel_type_id;
			form1.submit();
	}
	function setSub(p_publicatie_id,p_artikel_type_id,p_sub){
			//form1.method = "post";
			//form1.action = "publiceer_sub.asp?artikel_id="+p_artikel_id+"&sub="+p_sub;
			//form1.submit();
			location.href = "publiceer_sub.asp?publicatie_id="+p_publicatie_id+"&artikel_type_id="+p_artikel_type_id+"&sub="+p_sub+"&pagType=b";
	}

	function ontgrendel(artikel_type_id,waarde,artikel_id_navLink,v_menu){
			form1.method = "post";
			form1.action = "ontgrendel.asp?artikel_type_id="+artikel_type_id+"&artikel_id="+waarde+"&artikel_id_navLink="+artikel_id_navLink+"&v_menu="+v_menu;
			form1.submit();
	}
	function publiceer_direct(artikel_type_id,waarde,titel,v_menu,functionaliteit){
			form1.method = "post";
			form1.action = "publiceer_direct.asp?artikel_type_id="+artikel_type_id+"&artikel_id="+waarde+"&titel="+titel+"&v_menu="+v_menu+"&functionaliteit="+functionaliteit;
			form1.submit();
	}
	
	function activeer_pijlerHome_direct(artikel_type_id,artikel_id,toggle,active,returncode,artikel_id_toekomst,active_toekomst){
		//alert(artikel_type_id+"-"+artikel_id);
			//form1.method = "post";
			location.href = "activeer_pijlerHome_direct.asp?artikel_type_id="+artikel_type_id+"&artikel_id="+artikel_id+"&toggle="+toggle+"&active="+active+"&returncode="+returncode+"&artikel_id_toekomst="+artikel_id_toekomst+"&active_toekomst="+active_toekomst;
			//form1.submit();
	}

//COPYTEXT
	function copyText(waarde) {
		if (!document.all) return; // IE only
		form2rememberLink.copyArea.value=waarde;
		r=form2rememberLink.copyArea.createTextRange();
		r.select();
		r.execCommand('copy');
	} 
		//fake form om tekst in hidden object te kunnen plaatsen en te copieren voor het clipboardd
		document.write("<form name=\"form2rememberLink\">");
		document.write("<input type=\"hidden\" name=\"copyArea\" value=\"\">");
		document.write("</form>");
//EIND COPYTEXT

function getImageWidth(myImage) {
	var x, obj;
	if (document.layers) {
		var img = getImage(myImage);
		return img.width;
	} else {
		return getElementWidth(myImage);
	}
	return -1;
}

function getImageHeight(myImage) {
	var y, obj;
	if (document.layers) {
		var img = getImage(myImage);
		return img.height;
	} else {
		return getElementHeight(myImage);
	}
	return -1;
}




function elfproef(waarde,waarde2,kleur1,kleur2){	
	//valideert een banknummer (gironummers moeten voorafgegaan worden door een p of P)
	//de achtergrondkleur kan ook worden gewijzigd voor bepaalde velden
	//argumenten: waarde (aangeven als this.value): een banknummer met 10 of 11 cijfers evt gescheiden door punten of leeg veld
	//			  waarde2(naam van invoerveld aangeven bij aanroep als this)
	//			  optioneel: kleur1, kleur2 (format: #rrggbb)
	//			  als er geen kleur1 of kleur2 wordt opgegeven worden de 
	//			  standkleuren (zie code hieronder) gebruikt
	//teruggave/resultaat: true: leeg veld of geldig banknummer (hoeft niet te bestaan)
	//					   false: ongeldig banknummer
	//		kleur1 als datum juist is
	//		kleur2 als datum onjuist is
	//resultaat: invoerveld kleurt kleur1 (banknummer geldig of veld is leeg = true)
	//           invoerveld kleurt kleur2 (banknummer ongeldig = false)
	//afhankelijkheden: geen
	
	//myString=String(waarde);
	//alert(myString.indexOf("p"));

	a = 0;
	
	re = /[\.]/g; //verwijder de punten
	str = waarde;
	newStr=str.replace(re,"");

	if(newStr.length==9||newStr.length==10){
		for(l=0;l<newStr.length;l++){
		
			a += newStr.charAt(l) * (newStr.length-l);
		}
	}else{
		a=-1; //om false te genereren bij modulus 11
	}		
	
	//deelbaar door 11 of geen waarde (leeg veld) geven true terug
	if(a%11==0||newStr.length==0||newStr.indexOf("p")==0||newStr.indexOf("P")==0){
		a = true;
	}else{
		a = false;
	}

	//kleuren van het invoerveld
	if (!kleur1||!kleur2){
		kleur1="#ff6633";kleur2="#ffffff"; //hier de 'default' kleuren instellen
	}
	//waarde2 = naam_van_het_formulier.naam_van_het_invoerveldje;
	if (!a){ //onjuiste invoer
		waarde2.style.backgroundColor = kleur1;			
	}else{ //juiste invoer
		waarde2.style.backgroundColor = kleur2;			
	}
}

//waarde bevat het veld dat gedimd moet worden (meestal form1.naam_van_het_veldje
function verberg(waarde){
//om letters in het tekstveld te 'dimmen'
	if (waarde.style.color=="#bbbbbb"){
		waarde.style.color="#000000";
	}else{
		waarde.style.color="#bbbbbb";
	}
}

////////////////////////////////////////////////////////////
function cSlash(waarde){
//converteert alle slashes in een datum naar mintekens
	re = /[/\.\s]/g; //detecteer alle slashes
	str = waarde;
	newStr=str.replace(re,"-");	
	o=newStr
	return o;
}
function valideer(waarde,waarde1,waarde2,kleur1,kleur2){
//valideert een datum of een tijd invoerveld
//de achtergrondkleur kan ook worden gewijzigd voor bepaalde velden
//argumenten: waarde : twee waarden: "tijd" en "datum" 
//			  waarde1(datum), waarde2(naam van invoerveld)
//			  optioneel: kleur1, kleur2 (format: #rrggbb)
//			  als er geen kleur1 of kleur2 wordt opgegeven worden de 
//			  standkleuren (zie code hieronder) gebruikt
//teruggave/resultaat: achtergrondkleur van invoerveld 
//		kleur1 als datum juist is
//		kleur2 als datum onjuist is
//resultaat: invoerveld kleurt kleur1 (datum geldig = true)
//           invoerveld kleurt kleur2 (datum geldig = false)
//afhankelijkheden: tstDatum(), tstTijd()
	if (!kleur1||!kleur2){
		kleur1="#ff6633";kleur2="#ffffff"; //hier de 'default' kleuren instellen
	}
	if (waarde=="datum"){
		a = tstDatum(waarde1);		
	}
	if (waarde=="tijd"){
		a = tstTijd(waarde1);
	}

	//waarde2 = form1.publiceren_startdatum;
	if (!a){ //onjuiste invoer
		waarde2.style.backgroundColor = kleur1;
		versturenOK=false;
	}else{ //juiste invoer
		waarde2.style.backgroundColor = kleur2;
		versturenOK=true;
	}
}
function tstTijd(waarde){
//test de geldigheid en het format van een tijd
//argument: tijd
//teruggave: true als tijd en format juist zijn
//           false als tijd of format onjuist zijn
//geldige formats: u.m | uu.m | u.mm | uu.mm


	//kijk eerst of er een punt in zit of iets anders dan een cijfer
	if(waarde){
		re = /[^0-9\.]/g;
		newStr = re.test(waarde);
		
		if (newStr){
			return false;
		}else{
			re = /[0-9]/g;
			str = waarde;
			newStr = str.match(re);
			if (!(newStr.length==3||newStr.length==4)){
				return false;
			}else{
				alert("hoi");
			}			
		}
		return true;
	}else{
		return false;
	}
}
function tstDatum(waarde){
//test de geldigheid en het format van een datum
//argument: datum
//teruggave: true als datum en format juist zijn
//           false als datum of format onjuist zijn
//geldige formats: d-m-jjjj | dd-mm-jjjj | dd-m-jjjj | d-mm-jjjj | 0d-0m-jjjj
//afhankelijkheden: maand()
	re = /[A-Za-z]/g; // uitleg: [A-Za-z] = alles wat een letter is. g = meerdere malen doorlopen tot alles er uit is
	str = waarde;
	//str = form1.publiceren_startdatum.value;
	newStr = str.match(re);	
	if(!newStr){
		re = /-/g; // uitleg: \W = alles wat niet een letter of cijfer is. g = meerdere malen doorlopen tot alles er uit is
		newStr = str.match(re);
		if(newStr){
			//document.write(newStr); //er is minimaal 1 streepje gevonden
			if(newStr.length==2){ //er zijn 2 streepjes gevonden		
				//document.write("<br>GOED! ER ZIJN 2 STREEPJES GEVONDEN");
				//document.write("<br>nu kan de string in stukjes worden gehakt:");		
				newStr = str.split("-", 3);
				//document.write(newStr);	
				if(newStr){
					for(l=0;l<3;l++){
						if(newStr[l]){
							//document.write("<br>"+"nummer "+l+" is gevuld!");
						}else{
							//document.write("<br>"+"nummer "+l+" is NIET GEVULD!");
							return false;
						}
					}
					//document.write("<br>dit is nummer 1: "+newStr[0]);
					if (newStr[0]<1||newStr[0]>31){ //controller 1e deeltje (dag)
						//document.write("<br>HEE, EEN MAAND HEEFT MINIMAAL 1 DAG EN MAXIMAAL 31 DAGEN HOOR!!");						
						return false;
					}else{
						if (newStr[1]<1||newStr[1]>12){ //controlleer 2e deeltje (maand)
							//document.write("<br>HEE, EEN JAAR HEEFT MINIMAAL 1 MAAND EN MAXIMAAL 12 MAANDEN HOOR!!");						
							return false;
						}else{
							if (newStr[2]<1000||newStr[2]>9999){ //controller 3e deeltje (jaar)
								//document.write("<br>HEE, VERKEERD JAARTAL!!");						
								return false;
							}
							//if (newStr[2]%4==0){alert("SCHRIKKELJAAR!!")}
						}
						if(newStr[0]>maand(newStr[1],newStr[2])){
							return false;
						}
						//alert(maand(newStr[1],newStr[2]))			
					}
				}else{
					//document.write("oops... daar gaat iets niet helemaal goed... sorry..");
					return false;
				}
			}else{
				//document.write("HEE, SUFFERD! JE MOET TWEE STREEPJES GEBRUIKEN HOOR!!!!");
				return false;
			} 
		}else{
			//document.write("HEE, STOMKOP! EEN DATUM MAG GEEN VREEMDE TEKENS BEVATTEN. STREEPJES GRAAG!!");
			return false;
		}
	}else{
		//document.write("<br>GEEN LETTERS GEBRUIKEN!")
		return false;
	}
	return true;
}

function maand(m,j){
//berekent aantal dagen in een maand
//argumenten: m,j (maand,jaartal)
//m = integer 1-31
//j = lange integer 4 cijferig
//teruggave: integer (28,29,30,31)
//			 false (error)
	if (m!=2){
		if (m==4||m==6||m==9||m==11){
			return 30;
		}else{
			if(m!=0&&m<=12){		
				return 31;
			}else{
				return false;
			}
		}
	}else{ //2e maand
		if(j%4==0){ //scrikkeljaar
			return 29;
		}else{
			return 28;
		}
	}
	return false;
}
////////////////////////////////////////////////////////////


//Function to format text in the text box
function FormatText(command, option){
	
  	frames.message.document.execCommand(command, true, option);
  	frames.message.focus();
}

//Function to add image
function plaatje_toevoegen_inleiding(){	
	imagePathInleiding = prompt('Vul het internetadres van het plaatje in', 'http://');				
	
	if ((imagePathInleiding != null) && (imagePathInleiding != "")){					
		//frames.message.document.execCommand('InsertImage', false, imagePath);
  		//frames.message.focus();
		frmJournal.plaatje.value = imagePathInleiding
	}
	//frames.message.focus();			
}

//Function to add image
function AddImage(){	
	imagePath = prompt('Vul het internetadres van het plaatje in', 'http://');				
	
	if ((imagePath != null) && (imagePath != "")){					
		frames.message.document.execCommand('InsertImage', false, imagePath);
  		frames.message.focus();
	}
	frames.message.focus();			
}

//Function to clear form
function ResetForm(){

	if (window.confirm('Weet je het zeker?')){
	 	frames.message.document.body.innerHTML = ''; 
	 	return true;
	 } 
	 return false;		
}

//Function to open pop up window
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}

//[todo: naam aanpassen]
//toggleScript
function test(waarde){
	oWaarde=eval(waarde);
	if (oWaarde.style.display == "none"){
		oWaarde.style.display="block";
	}else{
		oWaarde.style.display="none";
	}
	//alert(oWaarde.style.display);
	//x162.style.display="block";
}
//toggleScript2 (FireFox compatable)
function toggle(elem)
{
	while (elem.nodeName != 'SPAN')
		elem = elem.nextSibling;
	if (elem.style.display != 'block')
		elem.style.display = 'block';
	else elem.style.display = 'none';
}

// -->

/***********************************************
* Link Floatie script-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var floattext=new Array()
floattext[0]='- <a href="http://www.javascriptkit.com/cutpastejava.shtml">Free JavaScripts</a><br>- <a href="http://www.javascriptkit.com/javaindex.shtml">JavaScript Tutorials</a><br>- <a href="http://www.javascriptkit.com/dhtmltutors/index.shtml">DHTML/ CSS Tutorials</a><br>- <a href="http://www.javascriptkit.com/jsref/">JavaScript Reference</a><br><div align="right"><a href="javascript:hidefloatie()">Hide Box</a></div>'
floattext[1]='Some other floatie text'

var floatiewidth="250px" //default width of floatie in px
var floatieheight="60px" //default height of floatie in px. Set to "" to let floatie content dictate height.
var floatiebgcolor="lightyellow" //default bgcolor of floatie
var fadespeed=70 //speed of fade (5 or above). Smaller=faster.

var baseopacity=0
function slowhigh(which2){
	imgobj=which2
	browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
	instantset(baseopacity)
	highlighting=setInterval("gradualfade(imgobj)",fadespeed)
}

function instantset(degree){
	cleartimer()
	if (browserdetect=="mozilla")
	imgobj.style.MozOpacity=degree/100
	else if (browserdetect=="ie")
	imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
	if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
	if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
	cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
	else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
	cur2.filters.alpha.opacity+=10
	else if (window.highlighting)
	clearInterval(highlighting)
}

function ietruebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function paramexists(what){
	return(typeof what!="undefined" && what!="")
}

function showfloatie(thetext, e, optbgColor, optWidth, optHeight){
	var dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft;
	var dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop;
	var floatobj=document.getElementById("dhtmlfloatie")
	floatobj.style.left="-900px"
	floatobj.style.display="block"
	floatobj.style.backgroundColor=paramexists(optbgColor)? optbgColor : floatiebgcolor
	floatobj.style.width=paramexists(optWidth)? optWidth+"px" : floatiewidth
	floatobj.style.height=paramexists(optHeight)? optHeight+"px" : floatieheight!=""? floatieheight : ""
	floatobj.innerHTML=thetext
	var floatWidth=floatobj.offsetWidth>0? floatobj.offsetWidth : floatobj.style.width
	var floatHeight=floatobj.offsetHeight>0? floatobj.offsetHeight : floatobj.style.width
	var winWidth=document.all&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
	var winHeight=document.all&&!window.opera? ietruebody().clientHeight : window.innerHeight
	//e=window.event? window.event : e
	floatobj.style.left=dsocx+winWidth-floatWidth-5+"px"
	//if (e.clientX>winWidth-floatWidth && e.clientY+20>winHeight-floatHeight)
	//floatobj.style.top=dsocy+5+"px"
	//else
	floatobj.style.top=dsocy+winHeight-floatHeight-5+"px"
	slowhigh(floatobj)
}

function hidefloatie(){
	var floatobj=document.getElementById("dhtmlfloatie")
	floatobj.style.display="none"
}
/*********************************************************************************
* Einde Floatie script-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
*********************************************************************************/

function getBreedte(){
		//om de binnenBreedte van de browswer terug te krijgen
var x,y;
if (self.innerHeight) // all except Explorer
{
	x = self.innerWidth;
	y = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
{
	x = document.documentElement.clientWidth;
	y = document.documentElement.clientHeight;
}
else if (document.body) // other Explorers
{
	x = document.body.clientWidth;
	y = document.body.clientHeight;
}
return x;
}
function getHoogte(){
	//om de binnenHoogte van de browswer terug te krijgen
var x,y;
if (self.innerHeight) // all except Explorer
{
	x = self.innerWidth;
	y = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
{
	x = document.documentElement.clientWidth;
	y = document.documentElement.clientHeight;
}
else if (document.body) // other Explorers
{
	x = document.body.clientWidth;
	y = document.body.clientHeight;
}
return y;
}

function toggleStyle(oMijnElementje){
	//oMijnElementje is bijvoorbeeld: top.window.Layer2
	if (oMijnElementje.style.visibility=='hidden'){
		oMijnElementje.style.visibility='visible';
	}else{
		oMijnElementje.style.visibility='hidden';
	}
}

function positioneer(){
	//top.window.Layer//2.style.top = getHoogte()/2+"px";
	//top.window.Layer//2.style.height = getHoogte()/2+"px";
	//top.window.Layer//2.style.left = getBreedte()/4+"px";
	//top.window.Layer//2.style.width = getBreedte()/2+"px";
}

function welke(){
//http://drushel.cwru.edu/atm/keys.html
//80 = p
	//187 = =
	if (event.ctrlLeft==1&&event.keyCode==187){
		toggleStyle(top.window.userInteractionVenster);
	}else if (event.ctrlKey==1&&event.shiftKey==1&&event.keyCode==80){
		location.href("sf.asp?pagID=preview");
	}else if (event.ctrlKey==1&&event.shiftKey==1&&event.keyCode==68){
		location.href("sf.asp?pagID=debug");
	}else if (event.keyCode==13){
		if(/forum/.test(location.search)&&/tab4/.test(location.search)){			
			location.href= "sf.asp?pagID=forum_tab4&contentID=start&context=forumZoeken&pagType=b&zoekwoord="+form1.txt_zoek.value;
			form1.txt_zoek.focus();			
		}
	}
}

function kapAantLetters(waarde,nLetters,oNaam){
oNaam2 = eval(oNaam);
	if (waarde.length > nLetters){
		alert("Let op!\nTekst wordt ingekort!\nU mag maximaal "+nLetters+" letters\ngebruiken.");
		oNaam2.value = waarde.substring(0,nLetters);
		oNaam2.style.backgroundColor = "#ffffff";
	}
}

function telAantLetters(waarde,nLetters,oNaam){

	oNaam2 = eval(oNaam);
	if (waarde.length > nLetters){
		//alert("maximum aantal letters bereikt");
		oNaam2.style.backgroundColor = "#ff8855";
	}else{
		oNaam2.style.backgroundColor = "#f6f6f6";	
	}
}

//eerste keer gebruikt voor popupje om profielen te zoeken ten behoeve van forum selecties
var newwindow = '';
function popitup(url,hoogte,breedte)
{
	if (!newwindow.closed && newwindow.location)
	{
		newwindow.location.href = url;
	}
	else
	{
		newwindow=window.open(url,'name','height='+hoogte+',width='+breedte+',alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=1,z-lock=0');
		if (!newwindow.opener) newwindow.opener = self;
	}
	if (window.focus) {newwindow.focus()}
	newwindow.moveTo ( (screen.availWidth - breedte)/2,(screen.availHeight - hoogte)/2 );

	//return false;
}


    //
    //  Cookie Functions - Second Helping  (21-Jan-96)
    //  Written by:  Bill Dortch, hIdaho Design <bdortch@netw.com>
    //  The following functions are released to the public domain.
    //
    //  The Second Helping version of the cookie functions dispenses with
    //  my encode and decode functions, in favor of JavaScript's new built-in
    //  escape and unescape functions, which do more complete encoding, and
    //  which are probably much faster.
    //
    //  The new version also extends the SetCookie function, though in
    //  a backward-compatible manner, so if you used the First Helping of
    //  cookie functions as they were written, you will not need to change any
    //  code, unless you want to take advantage of the new capabilities.
    //
    //  The following changes were made to SetCookie:
    //
    //  1.  The expires parameter is now optional - that is, you can omit
    //      it instead of passing it null to expire the cookie at the end
    //      of the current session.
    //
    //  2.  An optional path parameter has been added.
    //
    //  3.  An optional domain parameter has been added.
    //
    //  4.  An optional secure parameter has been added.
    //
    //  For information on the significance of these parameters, and
    //  and on cookies in general, please refer to the official cookie
    //  spec, at:
    //
    //      http://www.netscape.com/newsref/std/cookie_spec.html    
    //
    //
    // "Internal" function to return the decoded value of a cookie
    //
    function getCookieVal (offset) {
      var endstr = document.cookie.indexOf (";", offset);
      if (endstr == -1)
        endstr = document.cookie.length;
      return unescape(document.cookie.substring(offset, endstr));
    }

    //
    //  Function to return the value of the cookie specified by "name".
    //    name - String object containing the cookie name.
    //    returns - String object containing the cookie value, or null if
    //      the cookie does not exist.
    //
    function GetCookie (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 to create or update a cookie.
    //    name - String object object containing the cookie name.
    //    value - String object containing the cookie value.  May contain
    //      any valid string characters.
    //    [expires] - Date object containing the expiration data of the cookie.  If
    //      omitted or null, expires the cookie at the end of the current session.
    //    [path] - String object indicating the path for which the cookie is valid.
    //      If omitted or null, uses the path of the calling document.
    //    [domain] - String object indicating the domain for which the cookie is
    //      valid.  If omitted or null, uses the domain of the calling document.
    //    [secure] - Boolean (true/false) value indicating whether cookie transmission
    //      requires a secure channel (HTTPS).  
    //
    //  The first two parameters are required.  The others, if supplied, must
    //  be passed in the order listed above.  To omit an unused optional field,
    //  use null as a place holder.  For example, to call SetCookie using name,
    //  value and path, you would code:
    //
    //      SetCookie ("myCookieName", "myCookieValue", null, "/");
    //
    //  Note that trailing omitted parameters do not require a placeholder.
    //
    //  To set a secure cookie for path "/myPath", that expires after the
    //  current session, you might code:
    //
    //      SetCookie (myCookieVar, cookieValueVar, null, "/myPath", null, true);
    //
    function SetCookie (name, value) {
      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) +
        ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
        ((path == null) ? "" : ("; path=" + path)) +
        ((domain == null) ? "" : ("; domain=" + domain)) +
        ((secure == true) ? "; secure" : "");
    }

    //  Function to delete a cookie. (Sets expiration date to current date/time)
    //    name - String object containing the cookie name
    //
    function DeleteCookie (name) {
      var exp = new Date();
      exp.setTime (exp.getTime() - 1);  // This cookie is history
      var cval = GetCookie (name);
      document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
    }
	
	function bevestig(oForm){	
		//alert(oForm.name);
		if (window.confirm('Gegevens opslaan')){
			document.formShowUsers.submit();			
			return true;
		} 
	}