// JavaScript Document
//google analytics
/*
 var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-22116806-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  */
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-22225222-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
//end google analytics
var absoluutpad;
var htcode;
var domein;
var linknummer;
function openDeeltekst(nummer) {
	if (nummer==linknummer) {
		document.getElementById("open_"+nummer).style.display = "none";
		linknummer = null;
	}
	else {
		document.getElementById("open_"+nummer).style.display = "block";
		if (linknummer!=null) {
			document.getElementById("open_"+linknummer).style.display = "none";
		}
		linknummer = nummer;
	}
}
// Get and set positions
function getAbsLeft(o) {
	var ob = document.getElementById(o);
    var oLeft = ob.offsetLeft;
    while(ob.offsetParent!=null) {
          oParent = ob.offsetParent;
          oLeft += oParent.offsetLeft;
          ob = oParent;
     }
     return oLeft; 
}
function getAbsTop(o) {
	var ob = document.getElementById(o);
    var oTop = ob.offsetTop;
    while(ob.offsetParent!=null) {
          oParent = ob.offsetParent;
          oTop += oParent.offsetTop;
          ob = oParent;
     }
     return oTop; 
}
if (location.href.indexOf("www")==-1) {
	htcode = "http://";
}
else htcode = "http://www.";
if (location.href.indexOf("netclienten.com")!=-1) {
	domein = "netclienten.com";
}
else if (location.href.indexOf("netclienten.nl")!=-1) {
	domein = "netclienten.nl";
}
else domein = "ervaringswijzer.nl";
absoluutpad = htcode+domein;
/*
if (absoluutpad.indexOf("ervaringswijzer.nl")==-1) {
	absoluutpad = absoluutpad.replace("netclienten", "ervaringswijzer");
	absoluutpad = absoluutpad.replace(".com", ".nl");
	
}
*/
locatie = location.href;
//alert(locatie);
if (locatie.indexOf("netclienten")!=-1) {
	locatie = locatie.replace("netclienten", "ervaringswijzer");
	locatie = locatie.replace(".com", ".nl");
	location.replace(locatie);
}

/*var adres = location.href;
var delen = adres.split("/");
absoluutpad = delen[0];
alert(absoluutpad);*/
String.prototype.trim = function() {
	var nieuwetekst = "", wit=true, i;
	for (i=0;i<this.length;i++) {
		if (this.charAt(i)!=" ") wit = false;
		if (!wit) nieuwetekst += this.charAt(i);
	}
	wit = true;
	for (i=nieuwetekst.length-1;i>=0;i--) {
		if (nieuwetekst.charAt(i)!=" ") wit = false;
		if (wit) nieuwetekst = nieuwetekst.substr(0, nieuwetekst.length-1);
	}
	return nieuwetekst;
}
function isArray(obj) {
   if (obj.constructor.toString().indexOf("Array") == -1)
      return false;
   else
      return true;
}
function addslashes(str) {
	str=str.replace(/\\/g,'\\\\');
	str=str.replace(/\'/g,'\\\'');
	str=str.replace(/\"/g,'\\"');
	str=str.replace(/\0/g,'\\0');
	return str;
}
function stripslashes(str) {
	str=str.replace(/\\'/g,'\'');
	str=str.replace(/\\"/g,'"');
	str=str.replace(/\\0/g,'\0');
	str=str.replace(/\\\\/g,'\\');
	return str;
}
function test() {
	alert("test");	
}
function isDatum(datum) {
	if (datum !="" && !datum.match(/^\d{8}$/)) {
		return false;
	}
	else {
		var dag = parseInt(datum.substr(0,2));
		var maand = parseInt(datum.substr(2,2));
		var jaar = parseInt(datum.substr(4));
		if (maand>12) return false;
		if (dag>aantal_maanddagen(jaar, maand)) return false;
	}
	return true;
}
function ontcijferDatum(cijferdatum) {
	cijferdatum = cijferdatum.trim();
	if (!isDatum(cijferdatum)) return "Incorrecte datum";
	else {
		var dag = parseInt(cijferdatum.substr(0,2), 10);
		var maand = parseInt(cijferdatum.substr(2,2), 10);
		var jaar = parseInt(cijferdatum.substr(4), 10);
		var maanden = new Array(null, "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december");
		return dag+" "+maanden[maand]+" "+jaar;
	}
}
function is_schrikkel(jaar) {
	if (jaar%4!=0) return false;
	else {
		if (jaar%100==0) {
			if (jaar%400==0) return false;
			else return true;
		}
		else return true;
	}
}
function aantal_maanddagen(jaar, maand) {
	if (maand==4 || maand==6 || maand==9 || maand==11) return 30;
	else if (maand==2) {
		if (is_schrikkel(jaar)) return 29;
		else return 28;
	}
	else return 31;
}
/*
function plaatsGeluidsobject(object) {
	var maplocatie = "";
	if (object.indexOf("/")==-1) {
		var adres = location.href;
		var delen = adres.split("/");
		var i;
		for (i=0;i<delen.length-1;i++) {
			maplocatie += delen[i]+"/";
		}
	}
	else {
		var delen = object.split("/");
		object = delen.pop();
		maplocatie = delen.join("/");
		//maplocatie = absoluutpad+"/"+maplocatie+"/";
	}
	var objectdelen = object.split(".");
	var delen = object.split("/");
	var objectdeel = delen.pop();
	var objectdelen = objectdeel.split(".");
	var id = objectdelen[0];
	document.write('<object id="'+id+'" width=245 height=64 classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"><param name="URL" ref valuetype="ref" value="'+object+'">');
	document.write('<param name="rate" value="1"><param name="balance" value="0"><param name="currentPosition" value="0"><param name="defaultFrame" value><param name="playCount" value="1"><param name="autoStart" value="0"><param name="currentMarker" value="0"><param name="invokeURLs" value="-1"><param name="baseURL" value><param name="mute" value="0"><param name="uiMode" value="full"><param name="stretchToFit" value="0"><param name="windowlessVideo" value="0"><param name="enabled" value="-1"><param name="enableContextMenu" value="1"><param name="fullScreen" value="0"><param name="SAMIStyle" value><param name="SAMILang" value><param name="SAMIFilename" value><param name="captioningID" value><param name="enableErrorDialogs" value="0"><param name="_cx" value="4233"><param name="_cy" value="714"><param name="volume" value="50">');
	document.write('<embed src="'+object+'" width="300" height="64" autostart="0" url="'+object+'" rate="1" balance="0" currentposition="0" defaultframe="value" playcount="1" currentmarker="0" invokeurls="-1" baseurl="value" mute="0" uimode="full" stretchtofit="0" windowlessvideo="0" enabled="-1" enablecontextmenu="1" fullscreen="0" samistyle="value" samilang="value" samifilename="value" captioningid="value" enableerrordialogs="0" _cx="4233" _cy="714" volume="50"></embed>');	  
	document.write('</object>');	
}
*/
function plaatsGeluidsobject(object) {
	var objectdelen = object.split("/");
	var laatstedeel = objectdelen.pop();
	var delen = laatstedeel.split(".");
	var id = delen[0];
	document.write('<object id="'+id+'" width=300 height=64 classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"><param name="URL" ref valuetype="ref" value="'+object+'">');
	document.write('<param name="rate" value="1"><param name="balance" value="0"><param name="currentPosition" value="0"><param name="defaultFrame" value><param name="playCount" value="1"><param name="autoStart" value="0"><param name="currentMarker" value="0"><param name="invokeURLs" value="-1"><param name="baseURL" value><param name="mute" value="0"><param name="uiMode" value="full"><param name="stretchToFit" value="0"><param name="windowlessVideo" value="0"><param name="enabled" value="-1"><param name="enableContextMenu" value="1"><param name="fullScreen" value="0"><param name="SAMIStyle" value><param name="SAMILang" value><param name="SAMIFilename" value><param name="captioningID" value><param name="enableErrorDialogs" value="0"><param name="_cx" value="4233"><param name="_cy" value="714"><param name="volume" value="50">');
	document.write('<embed id="'+id+'" src="'+object+'" type="application/x-mplayer2" width="300" height="64" autostart="0" url="'+object+'" rate="1" balance="0" currentposition="0" defaultframe="value" playcount="1" currentmarker="0" invokeurls="-1" baseurl="value" mute="0" uimode="full" stretchtofit="0" windowlessvideo="0" enabled="-1" enablecontextmenu="1" fullscreen="0" samistyle="value" samilang="value" samifilename="value" captioningid="value" enableerrordialogs="0" _cx="4233" _cy="714" volume="50"></embed>');			   
	document.write('</object>');	
}
/*
function plaatsOnzichtbaarGeluidsobject(object) {
	var adres = location.href;
	var objectdelen = object.split(".");
	var id = objectdelen[0];
	var i;
	adresdelen = adres.split("/");
	var maplocatie = "";
	for (i=0;i<adresdelen.length-1;i++) {
		maplocatie += adresdelen[i]+"/";
	}
	document.write('<div style="position:absolute; visibility:hidden"><object id="'+id+'" width=0 height=0 classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"><param name="URL" ref valuetype="ref" value="'+object+'">');
	document.write('<param name="rate" value="1"><param name="balance" value="0"><param name="currentPosition" value="0"><param name="defaultFrame" value><param name="playCount" value="1"><param name="autoStart" value="0"><param name="currentMarker" value="0"><param name="invokeURLs" value="-1"><param name="baseURL" value><param name="mute" value="0"><param name="uiMode" value="full"><param name="stretchToFit" value="0"><param name="windowlessVideo" value="0"><param name="enabled" value="-1"><param name="enableContextMenu" value="1"><param name="fullScreen" value="0"><param name="SAMIStyle" value><param name="SAMILang" value><param name="SAMIFilename" value><param name="captioningID" value><param name="enableErrorDialogs" value="0"><param name="_cx" value="4233"><param name="_cy" value="714"><param name="volume" value="50">');
	document.write('<embed src="'+maplocatie+object+'" width="0" height="0" autostart="0" url="'+maplocatie+object+'" rate="1" balance="0" currentposition="0" defaultframe="value" playcount="1" currentmarker="0" invokeurls="-1" baseurl="value" mute="0" uimode="full" stretchtofit="0" windowlessvideo="0" enabled="-1" enablecontextmenu="1" fullscreen="0" samistyle="value" samilang="value" samifilename="value" captioningid="value" enableerrordialogs="0" _cx="4233" _cy="714" volume="50"></embed>');				   
	document.write('</object></div>');	
}
*/
function plaatsOnzichtbaarGeluidsobject(object) {
	var adres = location.href;
	var objectdelen = object.split(".");
	var id = objectdelen[0];
	var i;
	adresdelen = adres.split("/");
	var maplocatie = "";
	for (i=0;i<adresdelen.length-1;i++) {
		maplocatie += adresdelen[i]+"/";
	}
	document.write('<div style="position:absolute; visibility:hidden">');
	document.write('<object src="'+maplocatie+object+'"><param name="autoStart" value="1"><embed id="'+id+'" src="'+maplocatie+object+'" type="application/x-mplayer2" width="0" height="0" autostart="0"></embed></object>');				   
	document.write('</div>');	
}
function plaatsVideoobject(object) {
	var adres = location.href;
	var i;
	adresdelen = adres.split("/");
	var maplocatie = "";
	for (i=0;i<adresdelen.length-1;i++) {
		maplocatie += adresdelen[i]+"/";
	}
	document.write('<table width="300" height="300" border="0" cellpadding="0" cellspacing="0"><tr><td height="300"><object id="WindowsMediaPlayer2" width=330 height=320 classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"><param name="URL" ref valuetype="ref" value="'+object+'">');
	document.write('<param name="rate" value="1"><param name="balance" value="0"><param name="currentPosition" value="0"><param name="defaultFrame" value="0"><param name="playCount" value="1"><param name="autoStart" value="0"><param name="currentMarker" value="0"><param name="invokeURLs" value="-1"><param name="baseURL" value><param name="mute" value="0"><param name="uiMode" value="full"><param name="stretchToFit" value="0"><param name="windowlessVideo" value="0"><param name="enabled" value="-1"><param name="enableContextMenu" value="1"><param name="fullScreen" value="0"><param name="SAMIStyle" value><param name="SAMILang" value><param name="SAMIFilename" value><param name="captioningID" value><param name="enableErrorDialogs" value="0"><param name="_cx" value="4233"><param name="_cy" value="1714"><param name="volume" value="50">');
	document.write('<embed src="'+maplocatie+object+'" width="330" height="320" autostart="0" url="'+maplocatie+object+'" rate="1" balance="0" currentposition="0" defaultframe="value" playcount="1" currentmarker="0" invokeurls="-1" baseurl="value" mute="0" uimode="full" stretchtofit="0" windowlessvideo="0" enabled="-1" enablecontextmenu="1" fullscreen="0" samistyle="value" samilang="value" samifilename="value" captioningid="value" enableerrordialogs="0" _cx="4233" _cy="714" volume="50"></embed>');				   
	document.write('</object></td></tr></table>');	
}
var filmnummer = 0;
var paden = new Array();
function speelFilm(ditpad) {
	paden[filmnummer] = ditpad;
	document.write('<script language="javascript" src="'+absoluutpad+'/code/filmpje.js.php?nummer='+filmnummer+'"></script>');
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="320" height="280" id="filmpje'+filmnummer+'" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+absoluutpad+'/code/filmpje.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#000000" /><embed src="'+absoluutpad+'/code/filmpje.swf" quality="high" wmode="transparent" bgcolor="#000000" width="320" height="280" name="filmpje'+filmnummer+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');	
	//setInterval('setFilmpje('+filmnummer+', "'+absoluutpad+pad+'", 0)', 500);
	//setFilmpje(filmnummer, absoluutpad+pad, 1);
	//setTimeout('setFilmpje('+filmnummer+', "'+absoluutpad+pad+'", 0)', 1500);
	filmnummer++;
}
function plaatsFilm(pad, plek) {
	document.getElementById(plek).innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="320" height="280" id="filmpje'+filmnummer+'" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+absoluutpad+'/code/filmpje.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#000000" /><embed src="'+absoluutpad+'/code/filmpje.swf" quality="high" wmode="transparent" bgcolor="#000000" width="320" height="280" name="filmpje'+filmnummer+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';	
	//setInterval('setFilmpje('+filmnummer+', "'+absoluutpad+pad+'", 1)', 500);
	setFilmpje(filmnummer, absoluutpad+pad, 1)
	filmnummer++;
}
function sluitFilm(pad, plek) {
	document.getElementById(plek).innerHTML = '';
}
function setFilmpje(nummer, pad, speel) {
	eval("document.filmpje"+nummer).SetVariable("absoluutpad", absoluutpad);
	eval("document.filmpje"+nummer).SetVariable("pad", pad);
	eval("document.filmpje"+nummer).SetVariable("speel", speel);
	//document.filmpje.Play();
}
function toonDia(dia, breedte, hoogte, overgang, toontijd, overgangstijd) {
	
}
var speelt = false;
function speelGeluidsobject(id) {
	if (speelt) {
		document.getElementById(id).Stop();
		speelt = false;
	}
	else {
		document.getElementById(id).Play();	
		speelt = true;
	}
}
function isEmail(adres) {
	delen = adres.split("@");
	if (delen.length!=2) return false;
	else {
		delen = delen[1].split(".");
		if (delen.length==1) return false;
		else return true;
	}
}
function schrijf(ontvanger) {
	var xpos = (screen.width-310)/2;
	var ypos = (screen.height-200)/2;
	window.open(absoluutpad+"/mail/index.php?ontvanger="+ontvanger, "", "width=310,height=360,left="+xpos+",top="+ypos);
}
function openBrief() {
	if (typeof(selecteer)=="function") {
		selecteer('brief');
	}
	var xpos = (screen.width-310)/2;
	var ypos = (screen.height-200)/2;
	window.open(absoluutpad+"/nieuwsbrief/nieuwsbrief.php", "", "width=310,height=200,left="+xpos+",top="+ypos);
}
var plaats;
var uiterstrechts = 540
function openVenster(pagina) {
	if (plaats==null) {
		var top = (screen.height-480)/2;
		var links = (screen.width-640)/2;
	}
	else {
		var top = 0;
		var links = plaats;
		if (plaats<=uiterstrechts) plaats += 100;
		else plaats = 0;
	}
	window.open(pagina,  "", "width=640,height=480,top="+top+",left="+links+",scrollbars=YES");
}
var maning = new Array();
var maanteller = 0;
maning[0] = "Geduld.....";
maning[1] = "Geduld&nbsp;.....";
maning[2] = "Geduld&nbsp;&nbsp;.....";
maning[3] = "Geduld&nbsp;&nbsp;&nbsp;.....";
maning[4] = "Geduld&nbsp;&nbsp;&nbsp;&nbsp;.....";
maning[5] = "Geduld&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....";
maning[6] = "Geduld.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....";
maning[7] = "Geduld..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....";
maning[8] = "Geduld...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....";
maning[9] = "Geduld....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....";
maning[10] = "Geduld.....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....";//terugkeerpunt
maning[11] = "Geduld&nbsp;.....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....";
maning[12] = "Geduld&nbsp;&nbsp;.....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....";
maning[13] = "Geduld&nbsp;&nbsp;&nbsp;.....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....";
maning[14] = "Geduld&nbsp;&nbsp;&nbsp;&nbsp;.....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....";
maning[15] = "Geduld&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....";
maning[16] = "Geduld.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;....";
maning[17] = "Geduld..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...";
maning[18] = "Geduld...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;..";
maning[19] = "Geduld....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.";
function maan() {
	document.getElementById("boodschap").innerHTML = maning[maanteller];
	if (maanteller<19) maanteller++;
	else maanteller = 10;
}
function setQuerystring(thing, value) {
	if (querystring!="") {
		if (querystring.indexOf(thing+"=")!=0 && querystring.indexOf("&"+thing+"=")==-1) {
			querystring += "&"+thing+"="+value;
		}
		else {
			queryitems = querystring.split("&");
			for (i=0;i<queryitems.length;i++) {
				if (queryitems[i].indexOf(thing+"=")==0) {
					queryitems[i] = thing+"="+value;
					break;
				}
			}
			querystring = queryitems.join("&");
		}
	}
	else querystring = thing+"="+value;	
	querystring = querystring.replace(/&amp;/g, "&");
}
function deleteFromQuerystring(thing) {
	while (querystring.indexOf(thing+"=")==0 || querystring.indexOf("&"+thing+"=")!=-1) {	
		queryitems = querystring.split("&");	
		for (i=0;i<queryitems.length;i++) {
			if (queryitems[i].indexOf(thing+"=")==0) {
				queryitems.splice(i,1);
				break;
			}
		}
		querystring = queryitems.join("&");
	}
}
var eerstekeer = true;
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE);

// Set-up to use getMouseXY function onMouseMove
//document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0;
var tempY = 0;

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
  	if (document.documentElement && document.documentElement.scrollTop) {
		theTop = document.documentElement.scrollTop;
		theLeft = document.documentElement.scrollLeft;
	}
	else if (document.body) {
		theTop = document.body.scrollTop;
		theLeft = document.body.scrollLeft;
	}
    tempX = event.clientX + theLeft; //document.documentElement.scrollLeft;
    tempY = event.clientY + theTop; //document.documentElement.scrollTop;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  //alert(tempX+" "+tempY);
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  return true
}
function showHint(tekst) {
	document.onmousemove = getMouseXY;
	document.getElementById("hinttekst").innerHTML = tekst;
	if (tempX>screen.width-300) {
		document.getElementById("hint").style.left = (tempX-180)+"px";
	}
	else {		
		document.getElementById("hint").style.left = (tempX+20)+"px";
	}
	if (tempY>40) {
		document.getElementById("hint").style.top = (tempY-30)+"px";
	}
	else {
		document.getElementById("hint").style.top = (tempY)+"px";
	}
	if (eerstekeer) {
		setTimeout('document.getElementById("hint").style.visibility = "visible"', 500);
		eerstekeer = false;
	}
	else document.getElementById("hint").style.visibility = "visible";
}
function wegHint() {
	document.getElementById("hint").style.visibility = "hidden";
}
function filter(tekst) {
	var nieuwetekst = tekst;	
	nieuwetekst = nieuwetekst.replace(/ class=('|")?MsoNormal('|")?/gi, "");	
	nieuwetekst = nieuwetekst.replace(/<[^>]*mso-[^>]*>/gi, "");
	nieuwetekst = nieuwetekst.replace(/<style>[^>]*<\/style>/gi, "");
	nieuwetekst = nieuwetekst.replace(/<w:[^>]*>/gi, "");
	nieuwetekst = nieuwetekst.replace(/<\/w:[^>]*>/gi, "");
	nieuwetekst = nieuwetekst.replace(/<xml>[^>]*<\/xml>/gi, "");
	/*
	
	nieuwetekst = nieuwetekst.replace(/<w:View>[^>]*<\/w:View>/gi, "");
	nieuwetekst = nieuwetekst.replace(/<w:Zoom>[^>]*<\/w:Zoom>/gi, "");
	nieuwetekst = nieuwetekst.replace(/<w:HyphenationZone>[^>]*<\/w:HyphenationZone>/gi, "");
	*/
	nieuwetekst = nieuwetekst.replace(/<font [^>]*>/gi, "");
	nieuwetekst = nieuwetekst.replace(/<\/font>/gi, "");
	nieuwetekst = nieuwetekst.replace(/ class=('|")?Apple-style-span('|")?/gi, "");
	nieuwetekst = nieuwetekst.replace(/<!--\[if [^>\]]*\]>*<!\[endif\]-->/gi, "");
	//nieuwetekst = nieuwetekst.replace(/<!--\[if gte mso 10\]> <!\[endif\]-->/gi, "");
	return nieuwetekst;
}
/*
function filter(tekst) {
	var nieuwetekst = tekst;	
	nieuwetekst = nieuwetekst.replace(/<style>[^>]*<\/style>/gi, "");
	nieuwetekst = nieuwetekst.replace(/<w:BrowserLevel>[^>]*<\/w:BrowserLevel>/gi, "");
	nieuwetekst = nieuwetekst.replace(/<w:View>[^>]*<\/w:View>/gi, "");
	nieuwetekst = nieuwetekst.replace(/<w:Zoom>[^>]*<\/w:Zoom>/gi, "");
	nieuwetekst = nieuwetekst.replace(/<w:HyphenationZone>[^>]*<\/w:HyphenationZone>/gi, "");
	
	nieuwetekst = nieuwetekst.replace(/<\/p>/gi, "%br%%br%");
	nieuwetekst = nieuwetekst.replace(/<BR>/gi, "%br%");
	nieuwetekst = nieuwetekst.replace(/<BR \/>/gi, "%br%");
	
	nieuwetekst = nieuwetekst.replace(/<UL( [^>]*)?>/gi, "%ul%");
	nieuwetekst = nieuwetekst.replace(/<OL( [^>]*)?>/gi, "%ol%");
	nieuwetekst = nieuwetekst.replace(/<LI( [^>]*)?>/gi, "%li%");
	
	nieuwetekst = nieuwetekst.replace(/<\/UL>/gi, "%ule%");
	nieuwetekst = nieuwetekst.replace(/<\/OL>/gi, "%ole%");
	nieuwetekst = nieuwetekst.replace(/<\/LI>/gi, "%lie%");
	
	nieuwetekst = nieuwetekst.replace(/<STRONG( [^>]*)?>/gi, "%b%");
	nieuwetekst = nieuwetekst.replace(/<B( [^>]*)?>/gi, "%b%");
	nieuwetekst = nieuwetekst.replace(/<EM( [^>]*)?>/gi, "%i%");
	nieuwetekst = nieuwetekst.replace(/<I( [^>]*)?>/gi, "%i%");
	nieuwetekst = nieuwetekst.replace(/<U( [^>]*)?>/gi, "%u%");
	
	nieuwetekst = nieuwetekst.replace(/<\/STRONG>/gi, "%be%");
	nieuwetekst = nieuwetekst.replace(/<\/B>/gi, "%be%");
	nieuwetekst = nieuwetekst.replace(/<\/EM>/gi, "%ie%");
	nieuwetekst = nieuwetekst.replace(/<\/I>/gi, "%ie%");
	nieuwetekst = nieuwetekst.replace(/<\/U>/gi, "%ue%");
	
	//nieuw
	/*
	var kopieer = true;
	var oudetekst = nieuwetekst;
	nieuwetekst = "";
	for (i=0;i<oudetekst.length;i++) {
		deel =  oudetekst.charAt(i);
		if (deel == "<") kopieer = false;
		if (deel == ">") kopieer = true;
		if (kopieer && deel != ">") nieuwetekst += deel;
	}
	
	//end nieuw
	
	nieuwetekst = nieuwetekst.replace(/<[^>]*>/g, " ");
	nieuwetekst = nieuwetekst.replace(/[^<]*>/, " ");	
	nieuwetekst = nieuwetekst.replace(/\n/g, " ");
	nieuwetekst = nieuwetekst.replace(/\r/g, " ");

	nieuwetekst = nieuwetekst.replace(/%br%/g, "<BR>");
	nieuwetekst = nieuwetekst.replace(/%ul%/g, "<UL>");
	nieuwetekst = nieuwetekst.replace(/%ol%/g, "<OL>");
	nieuwetekst = nieuwetekst.replace(/%ule%/g, "</UL>");
	nieuwetekst = nieuwetekst.replace(/%ole%/g, "</OL>");
	nieuwetekst = nieuwetekst.replace(/%li%/g, "<LI>");
	nieuwetekst = nieuwetekst.replace(/%lie%/g, "</LI>");
	
	nieuwetekst = nieuwetekst.replace(/%b%/gi, "<STRONG>");
	nieuwetekst = nieuwetekst.replace(/%i%/gi, "<EM>");
	nieuwetekst = nieuwetekst.replace(/%u%/gi, "<U>");
	
	nieuwetekst = nieuwetekst.replace(/%be%/gi, "</STRONG>");
	nieuwetekst = nieuwetekst.replace(/%ie%/gi, "</EM>");
	nieuwetekst = nieuwetekst.replace(/%ue%/gi, "</U>");
	
	nieuwetekst = nieuwetekst.replace(/<BR>&nbsp;/gi, "<BR>");
	nieuwetekst = nieuwetekst.replace(/<BR> /gi, "<BR>");
	nieuwetekst = nieuwetekst.replace(/&nbsp;<BR>/gi, "<BR>");
	nieuwetekst = nieuwetekst.replace(/ <BR>/gi, "<BR>");
	while (nieuwetekst.indexOf("<BR><BR><BR>")!=-1) {
		nieuwetekst = nieuwetekst.replace(/<BR><BR><BR>/gi, "<BR><BR>");
	}
	nieuwetekst = nieuwetekst.replace(/<BR><BR><UL>/gi, "<BR><UL>");
	nieuwetekst = nieuwetekst.replace(/<\/UL><BR><BR>/gi, "</UL>");
	nieuwetekst = nieuwetekst.replace(/<\/OL><BR><BR>/gi, "</OL>");
	
	return nieuwetekst.trim();
}
*/
function filterNieuw(oud, nieuw) {
	var start=0, eind=0;
	for (i=0;i<nieuw.length;i++) {
		if (nieuw.charAt(i)!=oud.charAt(i)) {
			start = i;
			break;
		}
	}
	for (i=0;i<nieuw.length;i++) {
		if (nieuw.charAt(nieuw.length-i-1)!=oud.charAt(oud.length-i-1)) {
			eind = nieuw.length-i-1;
			break;
		}
			
	}
	var extra = nieuw.substring(start, eind+1);
	extra = extra.replace(/<style>[^>]*<\/style>/gi, "");
	extra = extra.replace(/<w:BrowserLevel>[^>]*<\/w:BrowserLevel>/gi, "");
	extra = extra.replace(/<w:View>[^>]*<\/w:View>/gi, "");
	extra = extra.replace(/<w:Zoom>[^>]*<\/w:Zoom>/gi, "");
	extra = extra.replace(/<w:HyphenationZone>[^>]*<\/w:HyphenationZone>/gi, "");
	var oudstart = nieuw.substr(0, start);
	var oudeind = nieuw.substr(eind+1);
	//alert(extra);
	extra = extra.replace(/<\/P>/gi, "%br%%br%");
	extra = extra.replace(/<BR>/gi, "%br%");
	extra = extra.replace(/<BR \/>/gi, "%br%");
	
	extra = extra.replace(/<UL( [^>]*)?>/gi, "%ul%");
	extra = extra.replace(/<OL( [^>]*)?>/gi, "%ol%");
	extra = extra.replace(/<LI( [^>]*)?>/gi, "%li%");
	
	extra = extra.replace(/<\/UL>/gi, "%ule%");
	extra = extra.replace(/<\/OL>/gi, "%ole%");
	extra = extra.replace(/<\/LI>/gi, "%lie%");
	
	extra = extra.replace(/<STRONG( [^>]*)?>/gi, "%b%");
	extra = extra.replace(/<B( [^>]*)?>/gi, "%b%");
	extra = extra.replace(/<EM( [^>]*)?>/gi, "%i%");
	extra = extra.replace(/<I( [^>]*)?>/gi, "%i%");
	extra = extra.replace(/<U( [^>]*)?>/gi, "%u%");
	
	extra = extra.replace(/<\/STRONG>/gi, "%be%");
	extra = extra.replace(/<\/B>/gi, "%be%");
	extra = extra.replace(/<\/EM>/gi, "%ie%");
	extra = extra.replace(/<\/I>/gi, "%ie%");
	extra = extra.replace(/<\/U>/gi, "%ue%");
	//alert(extra);
	
	extra = extra.replace(/<[^>]*>/g, " ");
	extra = extra.replace(/[^<]*>/, " ");	
	extra = extra.replace(/\n/g, " ");
	extra = extra.replace(/\r/g, " ");
	
	extra = extra.replace(/%br%/g, "<BR>");
	extra = extra.replace(/%ul%/g, "<UL>");
	extra = extra.replace(/%ol%/g, "<OL>");
	extra = extra.replace(/%ule%/g, "</UL>");
	extra = extra.replace(/%ole%/g, "</OL>");
	extra = extra.replace(/%li%/g, "<LI>");
	extra = extra.replace(/%lie%/g, "</LI>");
	
	extra = extra.replace(/%b%/gi, "<STRONG>");
	extra = extra.replace(/%i%/gi, "<EM>");
	extra = extra.replace(/%u%/gi, "<U>");
	
	extra = extra.replace(/%be%/gi, "</STRONG>");
	extra = extra.replace(/%ie%/gi, "</EM>");
	extra = extra.replace(/%ue%/gi, "</U>");
	
	extra = extra.replace(/<BR>&nbsp;/gi, "<BR>");
	extra = extra.replace(/<BR> /gi, "<BR>");
	extra = extra.replace(/&nbsp;<BR>/gi, "<BR>");
	extra = extra.replace(/ <BR>/gi, "<BR>");
	while (extra.indexOf("<BR><BR><BR>")!=-1) {
		extra = extra.replace(/<BR><BR><BR>/gi, "<BR><BR>");
	}
	extra = extra.replace(/<BR><BR><UL>/gi, "<BR><UL>");
	extra = extra.replace(/<\/UL><BR><BR>/gi, "</UL>");
	extra = extra.replace(/<\/OL><BR><BR>/gi, "</OL>");
	return oudstart+extra+oudeind;
	//return nieuw;
}
