function inpFocus(obj, stdText) {
 if (obj.value == stdText) {
    obj.value = '';
 }
}
 
function inpBlur(obj, stdText) {
 if (obj.value == '') {
    obj.value = stdText;
 }
} 

function validateForm(form,field) {

	myform = document.getElementById(form)  ;
	myfield =  document.getElementById(field)  ;

	if (myfield.checked == false) 
	{
		alert ('U dient akkoord te gaan met de voorwaarden');
		return false;
	} else { 	
		myform.submit();
	}
}
 


  function showOnly(showId, parentId, tagName) {
                var parObj = document.getElementById(parentId);
                var tagType = "DIV";
                if (tagName) {
                    tagType = tagName.toUpperCase();
                }
                if (parObj) {
                    var children = parObj.childNodes;
                    // alert(db_DumpTree(children, ''));
                    for(c = 0; c < children.length; c++) {
                        if (children[c].nodeName == tagType ) {
                            if (children[c].id == showId) {
                                children[c].style.display = 'block';
                            } else {
                                children[c].style.display = 'none';
                            }
                        }
                    }
                }
            }  
  /******************************************/
 /***********Muis pos bepalene     *************/
/******************************************/
var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0;
var tempY = 0;
function getMouseXY(e) {
	if (IE) { // grab the x-y pos.s if browser is IE
		tempX = event.clientX + document.body.scrollLeft;
		tempY = event.clientY + document.body.scrollTop;
	}else {  // grab the x-y pos.s if browser is NS
		tempX = e.pageX;
		tempY = e.pageY;
}  

if (tempX < 0){tempX = 0;}
if (tempY < 0){tempY = 0;}  
return true;
}

  /******************************************/
 /***********Abs top pos bepalene      **********/
/******************************************/
function getTopPosition(obj){
    var topValue= 0;
    while(obj){
		topValue+= obj.offsetTop;
		obj= obj.offsetParent;
    }
    return topValue;
}
function getLeftPosition(obj){
    var leftValue= 0;
    while(obj){
		leftValue+= obj.offsetLeft;
		obj= obj.offsetParent;
    }
    return leftValue;
}



function slideVertical(id, width){
	if(document.getElementById(id)){
		var slide = document.getElementById(id);
		slide.style.overflow = "hidden";		
		var innerDiv = document.createElement('div');
		innerDiv.id = id+"_innerDiv";
		innerDiv.style.marginLeft = "0px";
		innerDiv.innerHTML = slide.innerHTML;
		innerDiv.style.width = width+"px";
		slide.innerHTML = "";
		slide.appendChild(innerDiv);
		var timer;
		slide.onmouseover=function(){
			timer = setInterval(function(){slideTheVerticalDiv(slide, innerDiv);},50);
		}
		slide.onmouseout=function(){
			clearInterval(timer);
		}
	}	
}
var rctzkm = 0;
function slideTheVerticalDiv(div, innerDiv){
	var divLeft = getLeftPosition(div);
	var divWidth = parseInt(div.style.width.replace('px', ''));
	var curLeft = parseInt(innerDiv.style.marginLeft.replace("px",""));
	var mouseLeft = tempX;
	var mouseFromLeft = (mouseLeft-divLeft);
	var innerMaxMin = parseInt("-"+innerDiv.style.width.replace('px', ''))+divWidth;
	
	var pixmove1 = Math.floor((mouseFromLeft - Math.ceil(divWidth) / 2) /10);
	var pixmove = ((pixmove1 > 2 || pixmove1 < -2) ? pixmove1 : 0);

	// boel inversen 
	pixmove = (pixmove >= 0 ? parseInt("-"+pixmove) : pixmove * -1);
	if(curLeft >= (innerMaxMin - pixmove) && (curLeft + pixmove) <= 0){
		innerDiv.style.marginLeft = curLeft + pixmove + "px";
		rctzkm = curLeft + pixmove;
	}
	
	//document.getElementById('test').innerHTML = curLeft + " | " + innerMaxMin + " | " + pixmove + " | " + Math.ceil(divWidth);		
}

  /******************************************/
 /***********Slide functie met timer        ********/
/******************************************/
function slideDiv(id, margin){
	if(document.getElementById(id)){
	if(!margin){
		margin = 0;
	}
	var slide = document.getElementById(id);
	slide.style.overflow = "hidden";
	var innerDiv = document.createElement('div');
	innerDiv.id = id+"_innerDiv";
	innerDiv.style.marginTop = "0px";
	innerDiv.innerHTML = slide.innerHTML;
	slide.innerHTML = "";
	slide.appendChild(innerDiv);
	var timer;
	slide.onmouseover=function(){
		timer = setInterval(function(){slideTheDiv(slide, innerDiv, margin);},50);
	}
	slide.onmouseout=function(){
		clearInterval(timer);
	}
	}	
}
  /******************************************/
 /***********Slide functie callback          ********/
/******************************************/
function slideTheDiv(div, innerDiv, margin){
	var divTop = getTopPosition(div);
	var divHeight = div.offsetHeight-margin;
	var innerTop = getTopPosition(div);
	var innerHeight = innerDiv.offsetHeight+margin;
	var innerMaxMin = divHeight - innerHeight;
	var innerCurPos = divTop - innerTop;
	var mouseTop = tempY;
	var mouseFromTop = (mouseTop-divTop);

	var pixmove1 = Math.floor((mouseFromTop - Math.ceil(divHeight) / 2) /10);
	var pixmove = ((pixmove1 > 2 || pixmove1 < -2) ? pixmove1 : 0);

	// boel inversen 
	pixmove = (pixmove >= 0 ? parseInt("-"+pixmove) : pixmove * -1);
	
	var curTop = parseInt(innerDiv.style.marginTop.replace("px",""));
	if(curTop >= (innerMaxMin - pixmove) && (curTop + pixmove) <= 0){
		innerDiv.style.marginTop = curTop + pixmove + "px";
	}	
	//document.getElementById('test').innerHTML = pixmove1 + " | " + pixmove + " | " + innerMaxMin + " | " + pixmove ;		
}
