var DDSPEED = 5;var DDTIMER = 15;function do_ShowHide(contentId,headerId,d)	{	var h = document.getElementById(headerId);	var c = document.getElementById(contentId);	clearInterval(c.timer);	if(d == 1)		{	clearTimeout(h.timer);		if(c.maxh && c.maxh <= c.offsetHeight)			{			return			}		else if(!c.maxh)			{			c.style.display = 'block';			c.style.height = 'auto';			c.maxh = c.offsetHeight;			c.style.height = '0px';			}		c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);		}	else		{	h.timer = setTimeout(function(){ddCollapse(c)},50);		}	}// dichtvouwen menu //function ddCollapse(c){  c.timer = setInterval(function(){ddSlide(c,-1)},DDTIMER);}// Sluiten van het menu //function cancelHide(id){  var h = document.getElementById(id + '-ddheader');  var c = document.getElementById(id + '-ddcontent');  clearTimeout(h.timer);  clearInterval(c.timer);  if(c.offsetHeight < c.maxh){    c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);  }}// bij het openen en sluiten de opacity aanpassen //function ddSlide(c,d){  var currh = c.offsetHeight;  var dist;  if(d == 1){    dist = (Math.round((c.maxh - currh) / DDSPEED));  }else{    dist = (Math.round(currh / DDSPEED)) +1;  }  if(dist <= 1 && d == 1){    dist = 1;  }  c.style.height = currh + (dist * d) + 'px';  c.style.opacity = currh / c.maxh;  c.style.filter = 'alpha(opacity=' + (currh * 100 / c.maxh) + ')';  if((currh < 2 && d != 1) || (currh > (c.maxh - 2) && d == 1)){    clearInterval(c.timer);  }}function ajaxRequest(){	var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP", "Microsoft.XMLHTTP.3.0", "Microsoft.XMLHTTP.6.0", "Microsoft.XMLHTTP.5.0", "Microsoft.XMLHTTP.4.0"] //activeX versions to check for in IE	if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)		for (var i=0; i<activexmodes.length; i++){			try{			return new ActiveXObject(activexmodes[i])			}			catch(e){			//suppress error			}		}	}	else if (window.XMLHttpRequest) // if Mozilla, Safari etc		return new XMLHttpRequest()	else	return false}function alertMe(waarde)	{	alert(waarde);	}function getValue(SourceID, cbName){	nocache = Math.random();	cb = document.getElementsByName(SourceID)[0];	var Value = cb.options[cb.selectedIndex].value;	var mygetrequest = new ajaxRequest();	mygetrequest.open("GET", "php/getCombobox.php?id=" + Value + '&nocache=' + nocache + '&cbName=' + cbName, true);	mygetrequest.send(null);	mygetrequest.onreadystatechange = function(){		if (mygetrequest.readyState==4){			if (mygetrequest.status==200 || window.location.href.indexOf("http")==-1){				document.getElementById(cbName).innerHTML = mygetrequest.responseText;			}		}	}}function confirmDelete(delUrl) {  if (confirm("Weet je zeker dat je dit record wilt verwijderen?")) {    document.location = delUrl;  }}function goURL(Url) {	document.location = Url;}function goEdit(editUrl) {	document.location = editUrl;}function toonFoto(srt,foto,nr){	if(srt == "AutoImage"){		document.getElementById("preview").innerHTML = "<img src=\""+foto+"\" class=\"preview_foto\" />";	}}function set_Disabled(naam,waarde){	if(waarde == -1)		{		document.getElementsByName(naam)[0].value = '';		document.getElementsByName(naam)[0].readOnly = false;		document.getElementsByName(naam)[0].style.backgroundColor = '#FFFFFF';		}	else		{		document.getElementsByName(naam)[0].value = '';		document.getElementsByName(naam)[0].readOnly = true;		document.getElementsByName(naam)[0].style.backgroundColor = '#E0E0E0';		}}//<! [CDATA[function load(){	if (GBrowserIsCompatible()) {		var map = new GMap2(document.getElementById("map"));		point = new GLatLng(53.11022, 7.03458);		map.setCenter(point, 13);		var marker = new GMarker(point);        map.addOverlay(marker);		marker.openInfoWindowHtml("<b>Autobedrijf Harjo Mulder</b><br />Turfweg 27<br />9697 XK Blijham<br /><a href='http://www.autobedrijf-mulder.nl' target='_blank'>http://www.autobedrijf-mulder.nl</a>");		map.addControl(new GSmallMapControl()); 	}}//]]>function is_numeric(input){		return parseInt(input);}function Left(str, n){	if (n <= 0)	    return "";	else if (n > String(str).length)	    return str;	else	    return String(str).substring(0,n);}function Right(str, n){    if (n <= 0)       return "";    else if (n > String(str).length)       return str;    else {       var iLen = String(str).length;       return String(str).substring(iLen, iLen - n);    }}function validateKenteken(field){	var tb = document.getElementById(field);	var val = tb.value;	var newVal = '';	if(val.length == 3 && Right(val,1) != '-'){		newVal = Left(val, 2) + '-' + Right(val, 1);	} else if (val.length == 6 && (is_numeric(Right(val,1)) || Right(val,1) == '0')) {		newVal = Left(val, (val.length - 1)) + '-' + Right(val,1);	} else if (val.length == 6 && !is_numeric(Right(val,1)) && Right(val,1) != '-') {		newVal = val + '-';	} else if (val.length == 8 && !is_numeric(Right(val,1)) && is_numeric(Left(val,1))) {		newVal = Left(val,5) + '-' + Left(Right(val,3),1) + Right(val,1);	}	//} else if (val.length > 5){		//	newVal = val + '-';	//	}	//}	if(newVal != ''){		tb.value = newVal;	}}
