// TSC JAVA van CPANEL


function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments,error=0,tac;
  for (i=0; i<(args.length-2); i+=3) { 
    tac=0;
    test=args[i+2]; 
	naam=args[i+1];
	val=MM_findObj(args[i]);
    if (val) { 
	  nm=val.name; 
	  if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { 
		  p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) {
		    errors+='- '+naam+' is geen correct e-mail adres.\n'; 
		    error++;
		  }
        } else if (test!='R' && test!='W') {
          if (isNaN(val) && (test.indexOf('inRange') == -1)) { 
		    errors+='- '+naam+' dient een getal te bevatten.\n';
		    error++;
		  }
          if (test.indexOf('inRange') != -1) {
			p=test.indexOf(':');
            min=test.substring(8,p); 
		    max=test.substring(p+1);
			if (!isNaN(val)) {
              if (eval(val)<=eval(min) || eval(max)<=eval(val)) {
		        errors+='- '+naam+' dient een getal te bevatten tussen '+min+' en '+max+'.\n';
		        error++;
			  }
		    }
          } 
	    } 
	  } else if (test.charAt(0) == 'R') errors += '| '+naam+'\n'; 
	  
	  }
    } if (errors) {
	  if (error==1) {
		alert('Het navolgende veld dient ingevuld te zijn:\n'+errors);
	  } else {
		alert('De navolgende velden dienen ingevuld te zijn:\n'+errors);
	  }
    }
        document.MM_returnValue = (errors == '');
    }

<!-- Favorieten wegschrijven via menuoptie
var url="http://www.chinesemuurede.nl";
var title="Welkom bij de Chinese Muur Ede, Chinees Specialiteiten & Wok Restaurant";
function favorites(){
if(document.all)
window.external.AddFavorite(url,title)
}


PositionX = 100;
PositionY = 100;
defaultWidth  = 500;
defaultHeight = 500;
var AutoClose = true;
// ================================
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='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popBeeld(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</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 reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(300,300);');
writeln('width=300-(document.body.clientWidth-document.images[0].width);');
writeln('height=300-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}



/******CAROUSEL*********** DO NOT EDIT BELOW **********************************/
	function carousel(){
		if(document.getElementById){
			for(i=0;i<Car_Image_Sources.length;i+=2){
				C_Pre_Img[i]=new Image();C_Pre_Img[i].src=Car_Image_Sources[i]}
			C_MaxW=Car_Image_Width/Math.sin(Math.PI/Car_NoOfSides)+C_HalfNo+1;
			Car_Div=document.getElementById("Carousel");
			for(i=0;i<C_HalfNo;i++){
				CW_I[i]=document.createElement("img");Car_Div.appendChild(CW_I[i]);	
				CW_I[i].style.position="absolute";
				CW_I[i].style.top=0+"px";
				CW_I[i].style.height=Car_Image_Height+"px";
				if(Car_Border){
					CW_I[i].style.borderStyle="solid";
					CW_I[i].style.borderWidth=1+"px";
					CW_I[i].style.borderColor=Car_Border_Color}
				CW_I[i].src=Car_Image_Sources[2*i];
				CW_I[i].lnk=Car_Image_Sources[2*i+1];
				CW_I[i].onclick=C_LdLnk;
				CW_I[i].onmouseover=C_Stp;
				CW_I[i].onmouseout=C_Rstrt}
			CarImages()}}

	function CarImages(){
		if(!C_Stppd){
			C_TotalW=0;
			for(i=0;i<C_HalfNo;i++){
				C_ClcW[i]=Math.round(Math.cos(Math.abs(C_Coef[C_CoefOf+i]+C_Angle))*Car_Image_Width);
				C_TotalW+=C_ClcW[i]}
			C_LeftOffset=(C_MaxW-C_TotalW)/2;
			for(i=0;i<C_HalfNo;i++){
				CW_I[i].style.left=C_LeftOffset+"px";
				CW_I[i].style.width=C_ClcW[i]+"px";
				C_LeftOffset+=C_ClcW[i]}
			C_Angle+=Car_Speed/720*Math.PI*(Car_Direction?-1:1);
			if((Car_Direction&&C_Angle<=0)||(!Car_Direction&&C_Angle>=Math.PI/C_HalfNo)){
				if(C_CrImg==Car_Image_Sources.length)C_CrImg=0;
				if(Car_Direction){
					CW_I[C_HalfNo]=CW_I[0];
					for(i=0;i<C_HalfNo;i++)CW_I[i]=CW_I[i+1];
					CW_I[C_HalfNo-1].src=Car_Image_Sources[C_CrImg];
					CW_I[C_HalfNo-1].lnk=Car_Image_Sources[C_CrImg+1]}
				else{	for(i=C_HalfNo;i>0;i--)CW_I[i]=CW_I[i-1];
					CW_I[0]=CW_I[C_HalfNo];
					CW_I[0].src=Car_Image_Sources[C_CrImg];
					CW_I[0].lnk=Car_Image_Sources[C_CrImg+1]}
				C_Angle=Car_Direction?Math.PI/C_HalfNo:0;C_CrImg+=2}}
		setTimeout("CarImages()",50)}

	function C_LdLnk(){if(this.lnk)window.location.href=this.lnk}
	function C_Stp(){this.style.cursor=this.lnk?"pointer":"default";C_Stppd=true;}
	function C_Rstrt(){C_Stppd=false}
	
/******CAROUSEL*********** DO NOT EDIT ABOVE **********************************/


/******CAROUSEL_HORIZONTAAL*********** DO NOT EDIT BELOW **********************************/

function carousel_h(params){
  if(!(params.width>0 && isFinite(params.width)))params.width=100;
  if(!(params.height>0 && isFinite(params.height)))params.height=100;
  if(!(params.sides>2 && isFinite(params.sides)))params.sides=4;
  if(!(params.steps>0 && params.steps<100 && isFinite(params.steps)))params.steps=20;
  if(!(params.speed>0 && isFinite(params.speed)))params.speed=8;
  if(!(params.image_border_width>=0 && isFinite(params.image_border_width)))params.image_border_width=0;
  if(isFinite(params.id)||!params.id)params.id='bad_id_given_'+Math.random();
  
  document.write("<div style='position:relative;overflow:hidden;' id='"+params.id.replace(/[^a-zA-Z0-9]+/g,'_')+"'></div>");
  var cdiv=document.getElementById(params.id.replace(/[^a-zA-Z0-9]+/g,'_'))
  cdiv.style.width=params.width+'px';
  cdiv.style.height=params.height+'px';
  cdiv.style.border=params.border;
  cdiv.style.position='relative';
  cdiv.style.overflow='hidden';
  cdiv.title=params.id;
    
  var counter=0,spinning=true,interval=Math.floor(60000/params.sides/params.steps/params.speed)-5;
  interval=isNaN(interval)?200:interval;
  var img_position=[],images=[],img_dimension=[];
  var img_index=params.images.length+1,img_index_cap=2*params.images.length;
  var faces=Math.ceil(params.sides/2), dimension, direction, targ, attr, faraway;

  function init(){
    if(params.direction=="left" || params.direction=="right"){
      direction=params.direction;
      dimension="width";
      }
    else if(params.direction=="top" || params.direction=="bottom"){
      direction=params.direction;
      dimension="height";
      }
    else {
      direction="left";
      dimension="width";
      }      
    faraway=(direction=="left"||direction=="top")?'-20000px':'20000px';
    cdiv.style[dimension]=params[dimension]/(params.size_mode=='image'?Math.sin(Math.PI/params.sides):1)+'px';
    var img=new Image();
    img.style.position='absolute';
    img.style[direction]=faraway;
    img.style.width=params.width-2*params.image_border_width+'px';
    img.style.height=params.height-2*params.image_border_width+'px';
    img.style.border=(params.image_border_width||0)+'px solid '+params.image_border_color;
  
    for(var i=0;i<params.images.length;i++){
      images[i]=img.cloneNode(true);
      images[i].src=params.images[i];
      if(params.links && params.links[i] && params.links[i]!=''){
        targ=params.lnk_targets && params.lnk_targets[i]||params.lnk_base||'new';
        if(targ=="_blank"){
          attr=(params.lnk_attr && params.lnk_attr[i])?",'"+params.lnk_attr[i]+"'":"";
          images[i].onclick=new Function("window.open('"+params.links[i]+"','"+targ+"'"+attr+")");
          }
        else if(targ.substr(0,1)=="_"){
          images[i].onclick=new Function(targ.substr(1)+".location='"+params.links[i]+"'");
          }
        else{
          attr=(params.lnk_attr && params.lnk_attr[i])?",'"+params.lnk_attr[i]+"'":"";
          images[i].onclick=new Function("var t='"+targ+"';if(window[t]){try{window[t].close()}catch(z){}}window[t]=window.open('"+params.links[i]+"',t"+attr+");window[t].focus()");
          }
        images[i].style.cursor=document.all?'hand':'pointer';
        }

      if(params.titles && params.titles[i] && params.titles[i]!='')
        images[i].title=params.titles[i];
      if(document.all)
        images[i].alt=images[i].title;
      images[i+params.images.length]=images[i];
      if(params.images.length==faces)
        images[i+2*params.images.length]=images[i];
      cdiv.appendChild(images[i]);
      }
  
    var face_size=params.size_mode=='image'?params[dimension]:params[dimension]*Math.sin(Math.PI/params.sides);
    var face_offset=params[dimension]*Math.cos(Math.PI/params.sides)/(params.size_mode=='image'?Math.sin(Math.PI/params.sides):1)/2-.5;
    var pi_piece=2*Math.PI/params.steps/params.sides;
    for(i=0;i<=params.steps*faces;i++){
      img_dimension[i]=face_size*Math.sin(pi_piece*i);
      img_position[i]=(i<params.steps*params.sides/2)?Math.floor(params[dimension]/2/(params.size_mode=='image'?Math.sin(Math.PI/params.sides):1)-face_offset*Math.cos(pi_piece*i)-img_dimension[i]/2)+'px':faraway;
      img_dimension[i]=img_dimension[i]-2*params.image_border_width>1?Math.ceil(img_dimension[i])-2*params.image_border_width+'px':'1px';
      }
    }
  init();

  cdiv.rotate = function(){
    setTimeout('document.getElementById("'+cdiv.id+'").rotate()',interval);
    if(!spinning) return;
    if(++counter>=params.steps){
      counter=0;
      if(++img_index>=img_index_cap)
        img_index=params.images.length;
      }
    images[img_index-faces].style[direction]=faraway;
    for(var i=faces-1;i>=0;i--){
      images[img_index-i].style[direction]=img_position[counter+i*params.steps];
      images[img_index-i].style[dimension]=img_dimension[counter+i*params.steps];
      }
    }
  cdiv.onmouseover=function(){
    spinning=false;
    }
  cdiv.onmouseout=function(){
    spinning=true;
    }
  setTimeout('document.getElementById("'+cdiv.id+'").rotate()',100);
  }



/******CAROUSEL_HORIZONTAAL*********** DO NOT EDIT ABOVE **********************************/

/******BOEK*********** DO NOT EDIT BELOW **********************************/
	function ImageBook(){
		if(document.getElementById){
			for(i=0;i<Book_Image_Sources.length;i+=2){
				B_Pre_Img[i]=new Image();B_Pre_Img[i].src=Book_Image_Sources[i]}
			Book_Div=document.getElementById("Book");
			B_LI=document.createElement("img");Book_Div.appendChild(B_LI);	
			B_RI=document.createElement("img");Book_Div.appendChild(B_RI);
			B_MI=document.createElement("img");Book_Div.appendChild(B_MI);	
			B_LI.style.position=B_MI.style.position=B_RI.style.position="absolute";
			B_LI.style.zIndex=B_RI.style.zIndex=0;B_MI.style.zIndex=1;
			B_LI.style.top=(Book_Vertical_Turn?Book_Image_Height+1:0)+"px";
			B_LI.style.left=0+"px";
			B_MI.style.top=0+"px";
			B_MI.style.left=(Book_Vertical_Turn?0:Book_Image_Width+1)+"px";
			B_RI.style.top=0+"px";
			B_RI.style.left=(Book_Vertical_Turn?0:Book_Image_Width+1)+"px";
			B_LI.style.height=Book_Image_Height+"px";
			B_MI.style.height=Book_Image_Height+"px";
			B_RI.style.height=Book_Image_Height+"px";
			B_LI.style.width=Book_Image_Width+"px";
			B_MI.style.width=Book_Image_Width+"px";
			B_RI.style.width=Book_Image_Width+"px";
			if(Book_Border){
				B_LI.style.borderStyle=B_MI.style.borderStyle=B_RI.style.borderStyle="solid";
				B_LI.style.borderWidth=1+"px";
				B_MI.style.borderWidth=1+"px";
				B_RI.style.borderWidth=1+"px";
				B_LI.style.borderColor=B_MI.style.borderColor=B_RI.style.borderColor=Book_Border_Color}
			B_LI.src=B_Pre_Img[0].src;
			B_LI.lnk=Book_Image_Sources[1];
			B_MI.src=B_Pre_Img[2].src;
			B_MI.lnk=Book_Image_Sources[3];
			B_RI.src=B_Pre_Img[4].src;
			B_RI.lnk=Book_Image_Sources[5];
			B_LI.onclick=B_MI.onclick=B_RI.onclick=B_LdLnk;
			B_LI.onmouseover=B_MI.onmouseover=B_RI.onmouseover=B_Stp;
			B_LI.onmouseout=B_MI.onmouseout=B_RI.onmouseout=B_Rstrt;
			BookImages()}}

	function BookImages(){
		if(!B_Stppd){
			if(Book_Vertical_Turn){
				B_MSz=Math.abs(Math.round(Math.cos(B_Angle)*Book_Image_Height));
				MidOffset=!B_Direction?Book_Image_Height+1:Book_Image_Height-B_MSz;
				B_MI.style.top=MidOffset+"px";
				B_MI.style.height=B_MSz+"px"}
			else{	B_MSz=Math.abs(Math.round(Math.cos(B_Angle)*Book_Image_Width));
				MidOffset=B_Direction?Book_Image_Width+1:Book_Image_Width-B_MSz;
				B_MI.style.left=MidOffset+"px";
				B_MI.style.width=B_MSz+"px"}
			B_Angle+=Book_Speed/720*Math.PI;
			if(B_Angle>=Math.PI/2&&B_Direction){
				B_Direction=0;
				if(B_CrImg==Book_Image_Sources.length)B_CrImg=0;
				B_MI.src=B_Pre_Img[B_CrImg].src;
				B_MI.lnk=Book_Image_Sources[B_CrImg+1];
				B_CrImg+=2}
			if(B_Angle>=Math.PI){
				B_Direction=1;
				B_TI=B_LI;
				B_LI=B_MI;
				B_MI=B_TI;
				if(Book_Vertical_Turn)B_MI.style.top=0+"px";
				else B_MI.style.left=Book_Image_Width+1+"px";			
				B_MI.src=B_RI.src;
				B_MI.lnk=B_RI.lnk;

				setTimeout("Book_Next_Delay()",Book_NextPage_Delay)}
			else setTimeout("BookImages()",50)}
		else setTimeout("BookImages()",50)}

	function Book_Next_Delay(){
			if(B_CrImg==Book_Image_Sources.length)B_CrImg=0;
			B_RI.src=B_Pre_Img[B_CrImg].src;
			B_RI.lnk=Book_Image_Sources[B_CrImg+1];
			B_MI.style.zIndex=2;
			B_LI.style.zIndex=1;
			B_Angle=0;
			B_CrImg+=2;
		setTimeout("BookImages()",50)}

	function B_LdLnk(){if(this.lnk)window.location.href=this.lnk}
	function B_Stp(){B_Stppd=true;this.style.cursor=this.lnk?"pointer":"default"}
	function B_Rstrt(){B_Stppd=false}
/******BOEK*********** DO NOT EDIT ABOVE **********************************/

function validate_wachtwoord()
{
	
    var totaal = "";
    if( wachtwoord.a.value != wachtwoord.ww.value )
     {
 		totaal = totaal + ('| Wachtwoord is onjuist')+ ("\r");
    }
    if( wachtwoord.b.value == "" )
     {
 		totaal = totaal + ('| Nieuw wachtwoord invoeren')+ ("\r");
    }
    if( wachtwoord.c.value == "" )
     {
 		totaal = totaal + ('| Controle wachtwoord invoeren')+ ("\r");
    }
    if( wachtwoord.b.value != wachtwoord.c.value )
     {
 		totaal = totaal + ('| Nieuw wachtwoord <> controle')+ ("\r");
    }
     if (totaal != "")
      {
	  totaal = ("De navolgende velden dienen correct gevuld te zijn:") + ("\n") + totaal;
	  alert (totaal);
       event.returnValue=false;
	  }
}

var TCP = new TColorPicker();

function TCPopup(field, palette) {
	this.field = field;
	this.initPalette = !palette || palette > 3 ? 0 : palette;
	var w = 194, h = 240,
	move = screen ? 
		',left=' + ((screen.width - w) >> 1) + ',top=' + ((screen.height - h) >> 1) : '', 
	o_colWindow = window.open('picker.html', null, "help=no,status=no,scrollbars=no,resizable=no" + move + ",width=" + w + ",height=" + h + ",dependent=yes", true);
	o_colWindow.opener = window;
	o_colWindow.focus();
}

function TCBuildCell (R, G, B, w, h) {
	return '<td bgcolor="' + this.dec2hex((R << 16) + (G << 8) + B) + '"><a href="javascript:P.S(\'' + this.dec2hex((R << 16) + (G << 8) + B) + '\')" onmouseover="P.P(\'' + this.dec2hex((R << 16) + (G << 8) + B) + '\')"><img src="pixel.gif" width="' + w + '" height="' + h + '" border="0"></a></td>';
}

function TCSelect(c) {
	if (this.field.type == "textarea") {
	  this.field.value=this.field.value.replace('k#','k' + c.toUpperCase());
	} else {
	  this.field.value='' + c.toUpperCase();
	}
	this.win.close();
}

function TCPaint(c, b_noPref) {
	c = (b_noPref ? '' : '') + c.toUpperCase();
	if (this.o_samp) {
		if (c.length>6)
		  c="Kies kleur";
		this.o_samp.innerHTML = '<font face=Tahoma size=2>' + c +' <font color=white>' + c + '</font></font>'
	}
	if(this.doc.layers)
		this.sample.bgColor = c;
	else { 
		if (this.sample.backgroundColor != null) this.sample.backgroundColor = c;
		else if (this.sample.background != null) this.sample.background = c;
	}
}

function TCGenerateSafe() {
	var s = '';
	for (j = 0; j < 12; j ++) {
		s += "<tr>";
		for (k = 0; k < 3; k ++)
			for (i = 0; i <= 5; i ++)
				s += this.bldCell(k * 51 + (j % 2) * 51 * 3, Math.floor(j / 2) * 51, i * 51, 8, 10);
		s += "</tr>";
	}
	return s;
}

function TCGenerateWind() {
	var s = '';
	for (j = 0; j < 12; j ++) {
		s += "<tr>";
		for (k = 0; k < 3; k ++)
			for (i = 0; i <= 5; i++)
				s += this.bldCell(i * 51, k * 51 + (j % 2) * 51 * 3, Math.floor(j / 2) * 51, 8, 10);
		s += "</tr>";
	}
	return s	
}
function TCGenerateMac() {
	var s = '';
	var c = 0,n = 1;
	var r,g,b;
	for (j = 0; j < 15; j ++) {
		s += "<tr>";
		for (k = 0; k < 3; k ++)
			for (i = 0; i <= 5; i++){
				if(j<12){
				s += this.bldCell( 255-(Math.floor(j / 2) * 51), 255-(k * 51 + (j % 2) * 51 * 3),255-(i * 51), 8, 10);
				}else{
					if(n<=14){
						r = 255-(n * 17);
						g=b=0;
					}else if(n>14 && n<=28){
						g = 255-((n-14) * 17);
						r=b=0;
					}else if(n>28 && n<=42){
						b = 255-((n-28) * 17);
						r=g=0;
					}else{
						r=g=b=255-((n-42) * 17);
					}
					s += this.bldCell( r, g,b, 8, 10);
					n++;
				}
			}
		s += "</tr>";
	}
	return s;
}

function TCGenerateGray() {
	var s = '';
	for (j = 0; j <= 15; j ++) {
		s += "<tr>";
		for (k = 0; k <= 15; k ++) {
			g = Math.floor((k + j * 16) % 256);
			s += this.bldCell(g, g, g, 9, 7);
		}
		s += '</tr>';
	}
	return s
}

function TCDec2Hex(v) {
	v = v.toString(16);
	for(; v.length < 6; v = '0' + v);
	return v;
}

function TCChgMode(v) {
	for (var k in this.divs) this.hide(k);
	this.show(v);
}

function TColorPicker(field) {
	this.build0 = TCGenerateSafe;
	this.build1 = TCGenerateWind;
	this.build2 = TCGenerateGray;
	this.build3 = TCGenerateMac;
	this.show = document.layers ? 
		function (div) { this.divs[div].visibility = 'show' } :
		function (div) { this.divs[div].visibility = 'visible' };
	this.hide = document.layers ? 
		function (div) { this.divs[div].visibility = 'hide' } :
		function (div) { this.divs[div].visibility = 'hidden' };
	// event handlers
	this.C       = TCChgMode;
	this.S       = TCSelect;
	this.P       = TCPaint;
	this.popup   = TCPopup;
	this.draw    = TCDraw;
	this.dec2hex = TCDec2Hex;
	this.bldCell = TCBuildCell;
	this.divs = [];
}

function TCDraw(o_win, o_doc) {
	this.win = o_win;
	this.doc = o_doc;
	var 
	s_tag_openT  = o_doc.layers ? 
		'layer visibility=hidden top=54 left=5 width=182' : 
		'div style=visibility:hidden;position:absolute;left:6px;top:54px;width:182px;height:0',
	s_tag_openS  = o_doc.layers ? 'layer top=32 left=6' : 'div',
	s_tag_close  = o_doc.layers ? 'layer' : 'div'
		
	this.doc.write('<' + s_tag_openS + ' id=sam name=sam><table cellpadding=0 cellspacing=0 border=1 width=181 align=center class=bd><tr><td align=center height=18><div id="samp"><font face=Tahoma size=2>sample <font color=white>sample</font></font></div></td></tr></table></' + s_tag_close + '>');
	this.sample = o_doc.layers ? o_doc.layers['sam'] : 
		o_doc.getElementById ? o_doc.getElementById('sam').style : o_doc.all['sam'].style

	for (var k = 0; k < 4; k ++) {
		this.doc.write('<' + s_tag_openT + ' id="p' + k + '" name="p' + k + '"><table cellpadding=0 cellspacing=0 border=1 align=center>' + this['build' + k]() + '</table></' + s_tag_close + '>');
		this.divs[k] = o_doc.layers 
			? o_doc.layers['p' + k] : o_doc.all 
				? o_doc.all['p' + k].style : o_doc.getElementById('p' + k).style
	}
	if (!o_doc.layers && o_doc.body.innerHTML) 
		this.o_samp = o_doc.all 
			? o_doc.all.samp : o_doc.getElementById('samp');
	this.C(this.initPalette);
	if (this.field.value) this.P(this.field.value, true)
}

		
var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge,vertical_offset){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth,vertical){
if ((ie||ns6) && document.getElementById("hintbox")){
dropmenuobj=document.getElementById("hintbox")
dropmenuobj.innerHTML=menucontents
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge",vertical)+obj.offsetWidth+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge",vertical)+"px"
dropmenuobj.style.visibility="visible"
obj.onmouseout=hidetip
}
}

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px"
}

function createhintbox(){
var divblock=document.createElement("div")
divblock.setAttribute("id", "hintbox")
document.body.appendChild(divblock)
}

if (window.addEventListener)
window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox

function BackMainPage() {
  locatie="main";
  var main800x600 = "../plaatjes/"+locatie+"/back_plaat.jpg";   
  document.body.background=main800x600;
}


/******GALLERY HORIZONTAL*********** DO NOT EDIT BELOW **********************************/

var restarea=60//1) width of the "neutral" area in the center of the gallery in px
var endofgallerymsg="" //3) message to show at end of gallery. Enter "" to disable message.

function enlargeimage(path, optWidth, optHeight){ //function to enlarge image. Change as desired.
var actualWidth=typeof optWidth!="undefined" ? optWidth : "550px" //set 600px to default width
var actualHeight=typeof optHeight!="undefined" ? optHeight : "550px" //set 500px to  default height
var winattributes="width="+actualWidth+",height="+actualHeight+",resizable=yes"
window.open(path,"", winattributes)
}

////NO NEED TO EDIT BELOW THIS LINE////////////

var iedom=document.all||document.getElementById
var scrollspeed=0
var movestate=""

if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-10000;"></span>')

var actualwidth=''
var cross_scroll, ns_scroll
var loadedyes=0

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function creatediv(){
statusdiv=document.createElement("div")
statusdiv.setAttribute("id","statusdiv")
document.body.appendChild(statusdiv)
statusdiv=document.getElementById("statusdiv")
statusdiv.innerHTML=endofgallerymsg
}

function positiondiv(){
menuheight=parseInt(crossmain.offsetHeight)
mainobjoffsetH=getposOffset(crossmain, "top")
statusdiv.style.left=mainobjoffset+(menuwidth/2)-(statusdiv.offsetWidth/2)+"px"
statusdiv.style.top=menuheight+mainobjoffsetH+"px"
}

function showhidediv(what){
if (endofgallerymsg!="")
statusdiv.style.visibility=what
}

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft: what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function moveleft(){
if (loadedyes){
movestate="left"
if (iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth)){
cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+"px"
showhidediv("hidden")
}
else
showhidediv("visible")
}
lefttime=setTimeout("moveleft()",10)
}

function moveright(){
if (loadedyes){
movestate="right"
if (iedom&&parseInt(cross_scroll.style.left)<0){
cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+"px"
showhidediv("hidden")
}
else
showhidediv("visible")
}
righttime=setTimeout("moveright()",10)
}

function motionengine(e){
var dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft;
var dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop;
var curposy=window.event? event.clientX : e.clientX? e.clientX: ""
curposy-=mainobjoffset-dsocx
var leftbound=(menuwidth-restarea)/2
var rightbound=(menuwidth+restarea)/2
if (curposy>rightbound){
scrollspeed=(curposy-rightbound)/((menuwidth-restarea)/2) * maxspeed
if (window.righttime) clearTimeout(righttime)
if (movestate!="left") moveleft()
}
else if (curposy<leftbound){
scrollspeed=(leftbound-curposy)/((menuwidth-restarea)/2) * maxspeed
if (window.lefttime) clearTimeout(lefttime)
if (movestate!="right") moveright()
}
else
scrollspeed=0
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function stopmotion(e){
if ((window.event&&!crossmain.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget))){
if (window.lefttime) clearTimeout(lefttime)
if (window.righttime) clearTimeout(righttime)
movestate=""
}
}

function fillup(){
if (iedom){
crossmain=document.getElementById? document.getElementById("motioncontainer") : document.all.motioncontainer
menuwidth=parseInt(crossmain.style.width)
mainobjoffset=getposOffset(crossmain, "left")
cross_scroll=document.getElementById? document.getElementById("motiongallery") : document.all.motiongallery
document.getElementById("temp").innerHTML=cross_scroll.innerHTML //NEW stuff
actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById("temp").offsetWidth
//alert ("menuwidth: "+menuwidth+" actualwidth: "+actualwidth+" mainobjoffset: "+mainobjoffset);
if (!window.opera) document.getElementById("temp").style.display="none"

crossmain.onmousemove=function(e){
motionengine(e)
}

crossmain.onmouseout=function(e){
stopmotion(e)
showhidediv("hidden")
}
}
loadedyes=1
if (endofgallerymsg!=""){
creatediv()
positiondiv()
}
}

/******GALLERY HORIZONTAL*********** DO NOT EDIT ABOVE **********************************/

/******GALLERY VERTIKAAL*********** DO NOT EDIT BELOW **********************************/
var restarea_v=60//1) width of the "neutral" area in the center of the gallery in px
var endofgallerymsg_v="" //3) message to show at end of gallery. Enter "" to disable message.

function enlargeimage_v(path_v, optWidth_v, optHeight_v){ //function to enlarge image. Change as desired.
  var actualWidth_v=typeof optWidth_v!="undefined" ? optWidth_v : "550px" //set 600px to default width
  var actualHeight_v=typeof optHeight_v!="undefined" ? optHeight_v : "550px" //set 500px to  default height
  var winattributes_v="width="+actualWidth_v+",height="+actualHeight_v+",resizable=yes"
  window.open(path_v,"", winattributes_v)
}
   
   
var iedom_v=document.all||document.getElementById
var scrollspeed_v=0
var movestate_v=""

if (iedom_v)
  document.write('<span id="temp_v" style="visibility:hidden;position:absolute;top:-100;left:-10000;"></span>')

var actualWidth_v=''
var cross_scroll_v, ns_scroll_v
var loadedyes_v=0

function ietruebody_v(){
  return (document.compatMode_v && document.compatMode_v!="BackCompat")? document.documentElement : document.body
}

function creatediv_v(){
  statusdiv_v=document.createElement("div_v")
  statusdiv_v.setAttribute("id_v","statusdiv_v")
  document.body.appendChild(statusdiv_v)
  statusdiv_v=document.getElementById("statusdiv_v")
  statusdiv_v.innerHTML=endofgallerymsg_v
}

function positiondiv_v(){
menuheight_v=parseInt(crossmain_v.offsetHeight)
mainobjoffset_vH_v=getposOffset_v(crossmain_v, "top")
statusdiv_v.style.left=mainobjoffset_v+(menuwidth_v/2)-(statusdiv_v.offsetWidth/2)+"px"
statusdiv_v.style.top=menuheight_v+mainobjoffset_vH_v+"px"
}

function showhidediv_v(what_v){
  if (endofgallerymsg_v!="")
    statusdiv_v.style.visibility=what_v
}

function getposOffset_v(what_v, offsettype_v){
  var totaloffset_v=(offsettype_v=="left")? what_v.offsetLeft: what_v.offsetTop;
  var parentEl_v=what_v.offsetParent;
  while (parentEl_v!=null){
    totaloffset_v=(offsettype_v=="left")? totaloffset_v+parentEl_v.offsetLeft : totaloffset_v+parentEl_v.offsetTop;
    parentEl_v=parentEl_v.offsetParent;
  }
  return totaloffset_v;
}


function movetop_v(){
  if (loadedyes_v){
    movestate_v="left"
//alert("menuwidth_v: "+menuwidth_v+"actualWidth_v: "+actualWidth_v);
    if (iedom_v&&parseInt(cross_scroll_v.style.top)>(menuwidth_v-actualWidth_v)){
      cross_scroll_v.style.top=parseInt(cross_scroll_v.style.top)-scrollspeed_v+"px"
      showhidediv_v("hidden")
    }
  else
    showhidediv_v("visible")
  }
  lefttime_v=setTimeout("movetop_v()",10)
//alert ("lefttime_v: "+lefttime_v);
}

function movebottom(){
  if (loadedyes_v){
    movestate_v="right"
    if (iedom_v&&parseInt(cross_scroll_v.style.top)<0){
//alert ("right");
      cross_scroll_v.style.top=parseInt(cross_scroll_v.style.top)+scrollspeed_v+"px"
       showhidediv_v("hidden")
    }
  else
    showhidediv_v("visible")
  }
  righttime_v=setTimeout("movebottom()",10)
}

function motionengine_v(e_v){
  var dsocx_v=(window.pageXOffset)? pageXOffset: ietruebody_v().scrollLight;
  var dsocy_y=(window.pageYOffset)? pageYOffset : ietruebody_v().scrollTop;
  var curposy_v=window.event? event.clientY : e_v.clientY? e_v.clientY: ""
// alert ("curposy_v: "+curposy_v);
  curposy_v-=mainobjoffset_v-dsocy_y
  var leftbound_v=(menuwidth_v-restarea_v)/2
  var rightbound_v=(menuwidth_v+restarea_v)/2
//alert ("curposy_v: "+curposy_v+" leftbound_v: "+leftbound_v+" rightbound_v: "+rightbound_v);
  if (curposy_v>rightbound_v){
    scrollspeed_v=(curposy_v-rightbound_v)/((menuwidth_v-restarea_v)/2) * maxspeed_v
//alert ("scrollspeed_v: "+scrollspeed_v+" leftbound_v: "+leftbound_v+" rightbound_v: "+rightbound_v);
      if (window.righttime_v)
	    clearTimeout(righttime_v)
      if (movestate_v!="left") 
	    movetop_v()
  }
  else if (curposy_v<leftbound_v){
    scrollspeed_v=(leftbound_v-curposy_v)/((menuwidth_v-restarea_v)/2) * maxspeed_v
    if (window.lefttime_v) 
	  clearTimeout(lefttime_v)
    if (movestate_v!="right") 
	  movebottom()
  }
  else
    scrollspeed_v=0
}

function contains_ns6_v(a, b) {
  while (b.parentNode)
  if ((b = b.parentNode) == a)
    return true;
  return false;
}

function stopmotion_v(e_v){
  if ((window.event&&!crossmain_v.contains(event.toElement)) || (e_v && e_v.currentTarget && e_v.currentTarget!= e_v.relatedTarget && !contains_ns6_v(e_v.currentTarget, e_v.relatedTarget))){
    if (window.lefttime_v) 
	  clearTimeout(lefttime_v)
    if (window.righttime_v) 
	  clearTimeout(righttime_v)
    movestate_v=""
  }
}

function fillup_v(){
  if (iedom_v){
    crossmain_v=document.getElementById? document.getElementById("motioncontainer_v") : document.all.motioncontainer_v
    menuwidth_v=parseInt(crossmain_v.style.height)
    mainobjoffset_v=getposOffset_v(crossmain_v, "top")
    cross_scroll_v=document.getElementById? document.getElementById("motiongallery_v") : document.all.motiongallery_v
    document.getElementById("temp_v").innerHTML=cross_scroll_v.innerHTML //NEW stuff
    actualWidth_v=document.all? cross_scroll_v.offsetHeight : document.getElementById("temp_v").offsetHeight
//alert ("menuwidth_v: "+menuwidth_v+" actualWidth_v: "+actualWidth_v+" mainobjoffset_v: "+mainobjoffset_v);
    if (!window.opera) 
	  document.getElementById("temp_v").style.display="none"
    crossmain_v.onmousemove=function(e_v){
      motionengine_v(e_v)
    }
    crossmain_v.onmouseout=function(e_v){
      stopmotion_v(e_v)
      showhidediv_v("hidden")
    }
  }
  loadedyes_v=1
  if (endofgallerymsg_v!=""){
    creatediv_v()
    positiondiv_v()
  }
}
/******GALLERY VERTIKAAL*********** DO NOT EDIT ABOVE **********************************/



function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
//-->
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}

/******ALBUM*********** DO NOT EDIT BELOW **********************************/
function buildimage(i){
var tempcontainer=galleryarray[i][3]!=""? '<a href="'+galleryarray[i][3]+'" target="'+galleryarray[i][4]+'">' : ""
tempcontainer+='<img src="'+galleryarray[i][0]+'"  style="border-color:#'+album_color+'" border="'+album_border+'" width="'+album_width+'" height="'+album_height+'" title="'+galleryarray[i][1]+'">'
tempcontainer=galleryarray[i][3]!=""? tempcontainer+'</a>' : tempcontainer
tempcontainer=galleryarray[i][2]!=""? tempcontainer+'<br \/>'+galleryarray[i][2] : tempcontainer
return tempcontainer
}

function jumptopage(p){
var startpoint=(p-1)*totalslots
var y=1;
for (i=0; i<totalslots; i++){
document.getElementById("slide"+i).innerHTML=(typeof galleryarray[startpoint+i]!="undefined")? buildimage(startpoint+i) : ""
}
while(document.getElementById("navlink"+y)!=null){
document.getElementById("navlink"+y).className=""
y++
}
document.getElementById("navlink"+p).className="current"
}
/******ALBUM*********** DO NOT EDIT ABOVE **********************************/


/******FIELD LIMIT*********** DO NOT EDIT BELOW **********************************/

var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}

function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}


function displaylimit(thename, theid, thelimit, source){
var theform=theid!=""? document.getElementById(theid) : thename
var limit_text='<b><span style="color:#999999" id="'+theform.toString()+'">'+(thelimit-source)+'</span></b>'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
}
}
/******FIELD LIMIT*********** DO NOT EDIT ABOVE **********************************/

/******FOTO ZOOM*********** DO NOT EDIT BELOW **********************************/

var zoomfactor=0.05 //Enter factor (0.05=5%)

function zoomhelper(){
if (parseInt(whatcache.style.width)>10&&parseInt(whatcache.style.height)>10){
whatcache.style.width=parseInt(whatcache.style.width)+parseInt(whatcache.style.width)*zoomfactor*prefix
whatcache.style.height=parseInt(whatcache.style.height)+parseInt(whatcache.style.height)*zoomfactor*prefix
}
}

function zoom(originalW, originalH, what, state){
if (!document.all&&!document.getElementById)
return
whatcache=eval("document.images."+what)
prefix=(state=="in")? 1 : -1
if (whatcache.style.width==""||state=="restore"){
whatcache.style.width=originalW
whatcache.style.height=originalH
if (state=="restore")
return
}
else{
zoomhelper()
}
beginzoom=setInterval("zoomhelper()",100)
}

function clearzoom(){
if (window.beginzoom)
clearInterval(beginzoom)
}

////////////////////////////////////////////////////////////////////////////////
// GLOBALS
////////////////////////////////////////////////////////////////////////////////
var is = new getClient();

////////////////////////////////////////////////////////////////////////////////
// GETTERS
////////////////////////////////////////////////////////////////////////////////
// Methode om te achterhalen welke browser het is
function getClient() {
  var agt      = navigator.userAgent.toLowerCase();
  var apv      = navigator.appVersion.toLowerCase();

  this.major   = parseInt(navigator.appVersion);
  this.minor   = parseFloat(navigator.appVersion);
  this.opera   = (agt.indexOf('opera')!=-1);
  this.ns      = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)));
  this.ns4     = (this.ns && (this.minor >= 4.03) && (this.major < 5));
  this.ns6     = (this.ns && (this.major == 5) || this.opera);
  this.gecko   = (this.ns && (this.major >= 5));
  this.ie      = (agt.indexOf('msie') != -1);
  this.ie4     = (this.ie && (this.major == 3));
  this.ie45    = (agt.indexOf('msie 4.5') != -1);
  this.ie5     = (this.ie && (this.major == 4));
  this.mac     = (apv.indexOf('macintosh')>0);
  this.win     = (apv.indexOf('win')>0);
  this.ie4comp = ((this.ie4 && !this.mac) || this.ie45 || this.ie5);
  this.ns4comp = (this.ns4);
  this.ns6comp = (this.gecko || this.ns6);
  this.comp    = (this.ie4comp || this.ns4comp || this.ns6comp);

  return (this)
}

var curMouseX = 0;
var curMouseY = 0;

if (is.ns4comp) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

function getMouseXY(e) {
  curMouseY = getMouseWinTop(e);
  curMouseX = getMouseWinLeft(e);
  if (curMouseY < 0) curMouseY = 0;
  if (curMouseX < 0) curMouseX = 0;
  return true;
}

function getMouseWinTop(e) {
  if (is.ns4comp) return(e.pageY - window.pageYOffset);
  else if (is.ie4comp) return(event.clientY);
  else if (is.ns6comp) return(e.pageY - window.pageYOffset);
}

function getMouseWinLeft(e) {
  if (is.ns4comp) return(e.pageX - window.pageXOffset);
  else if (is.ie4comp) return(event.clientX);
  else if (is.ns6comp) return(e.pageX - window.pageXOffset);
}

// Functie om een methode 'onResize' uit te voeren
function onResize(method) {
  if(is.ns4comp || is.ns6comp) {
    return window.onresize = method;
  } else {
    document.body.onresize = method;
  }
}

// Functie om een methode 'onScroll' uit te voeren
function onScroll(method) {
  if(is.ns4comp || is.ns6comp) {
    return window.onscroll = method;
  } else {
    document.body.onscroll = method;
  }
}

function setEltInnerHtml(elt,value) {
  if(is.ns4comp){
    with(elt.document){
      open();
      write(value);
      close();
    }
  } else {
    elt.innerHTML = value;
  }
}


// Geeft de breedte van het venster
function getWindowWidth() {
  if(is.ns4comp) {
    return window.innerWidth;
  } else if(is.ns6comp) {
    return document.body.clientWidth - 2;
  } else if(is.ie4comp) {
    return document.body.clientWidth;
  }
}

// Geeft de hoogte van het venster
function getWindowHeight() {
  if(is.ns4comp) {
    return window.innerHeight;
  } else if(is.ns6comp) {
    return document.body.clientHeight - 2;
  } else if(is.ie4comp) {
    return document.body.clientHeight;
  }
}

function getWindowScrollTop() {
  if(is.ns4comp || is.ns6comp) {
    return(window.pageYOffset);
  } else if(is.ie4comp) {
    return(document.body.scrollTop);
  }
}

// Geeft het element
function getElt() {
  if(is.ns4comp) {
    var currentLayer = document.layers[getElt.arguments[0]];

    for (var i=1; i<getElt.arguments.length && currentLayer; i++) {
      currentLayer = currentLayer.document.layers[getElt.arguments[i]];
    }
    return currentLayer;
  } else if(is.ie4comp) {
    var elt = eval('document.all.' + getElt.arguments[getElt.arguments.length-1]);
    return(elt);
  } else if(is.ns6comp) {
    var elt = document.getElementById(getElt.arguments[getElt.arguments.length-1]);
    return(elt);
  }
}

// Geeft de 'display' van het element
function getEltDisplay(elt) {
  if(!elt || elt == null) {
    return;
  }
  if(is.ns4comp) {
    return (elt.display);
  } else if(is.ie4comp) {
    return (elt.style.display);
  } else if(is.ns6comp) {
    return (elt.style.display);
  }
}

// Geeft de 'visibility' van het element
function getEltVisibility(elt) {
  if(!elt || elt == null) {
    return;
  }
  if(is.ns4comp) {
    return (elt.visibility);
  } else if(is.ie4comp) {
    return (elt.style.visibility);
  } else if(is.ns6comp) {
    return (elt.style.visibility);
  }
}

// Geeft de 'bottom' van het element
function getEltBottom(elt) {
  if(!elt || elt == null) {
    return 0;
  }
  if(is.ns4comp) {
    return (elt.bottom);
  } else if(is.ie4comp) {
    return (elt.style.pixelBottom);
  } else if(is.ns6comp) {
    return (elt.offsetBottom);
  }
}

// Geeft de 'top' van het element
function getEltTop(elt) {
  if(!elt || elt == null) {
    return;
  }
  if(is.ns4comp) {
    return (elt.top);
  } else if(is.ie4comp) {
    return (elt.style.pixelTop);
  } else if(is.ns6comp) {
    return (elt.offsetTop);
  }
}

// Geeft de 'left' van het element
function getEltLeft(elt) {
  if(!elt || elt == null) {
    return;
  }
  if(is.ns4comp) {
    return (elt.left);
  } else if(is.ie4comp) {
    return (elt.style.pixelLeft);
  } else if(is.ns6comp) {
    return (elt.offsetLeft);
  }
}

// Geeft de 'width' van het element
function getEltWidth(elt) {
  if(!elt || elt == null) {
    return 0;
  }
  if(is.ns4comp) {
    return(elt.document.width);
  } else if(is.ie4comp) {
    return (elt.offsetWidth);
  } else if(is.ns6comp) {
    return (elt.offsetWidth);
  }
}

// Geeft de 'height' van het element
function getEltHeight(elt) {
  if(!elt || elt == null) {
    return 0;
  }
  if(is.ns4comp) {
    return(elt.document.height);
  } else if(is.ie4comp) {
    return (elt.offsetHeight);
  } else if(is.ns6comp) {
    return (elt.offsetHeight);
  }
}

// Geeft de omringende 'form' van een element
function getForm(formName,elt) {
  if(is.opera || is.ns6comp) {
    return document.forms[formName];
  }
  else if(is.ns4comp || is.ie4comp) {
    if(getForm.arguments.length == 2) {
      return eval("elt.document." + formName);
    } else {
      return eval("document." + formName);
    }
  }
}

// Verstuur het formulier
function formSubmit(formName,elt) { 
  formRef = getForm(formName,elt);
  formRef.submit();
}

////////////////////////////////////////////////////////////////////////////////
// SETTERS
////////////////////////////////////////////////////////////////////////////////
// Zet de 'position' van het element
function setEltPosition(elt, value) {
  if(!elt || elt == null) {
    return;
  }
  elt.style.position = value;
}

// Zet de 'class' van het element
function setEltClass(elt, value) {
  if(!elt || elt == null) {
    return;
  }
  elt.className = value;
}

// Zet de 'display' van het element
function setEltDisplay(elt, value) {
  if(!elt || elt == null) {
    return;
  }
  if(is.ns4comp) {
    elt.display = value;
  } else if(is.ie4comp) {
    elt.style.display = value;
  } else if(is.ns6comp) {
    elt.style.display = value;
  }
}

// Zet de 'visibility' van het element
function setEltVisibility(elt, value) {
  if(!elt || elt == null) {
    return;
  }
  if(is.ns4comp) {
    elt.visibility = value;
  } else if(is.ie4comp) {
    elt.style.visibility = value;
  } else if(is.ns6comp) {
    elt.style.visibility = value;
  }
}

// Zet de 'left' van het element
function setEltLeft(elt, x) {
  if(!elt || elt == null) {
    return;
  }
  if(is.ns4comp) {
    elt.left=x;
  } else if(is.ie4comp) {
    elt.style.pixelLeft=x;
  } else if(is.ns6comp) {
    elt.style.left = (x + 'px');
  }
}

// Zet de 'right' van het element
function setEltRight(elt, x) {
  if(!elt || elt == null) {
    return;
  }
  if(is.ns4comp) {
    elt.right=x;
  } else if(is.ie4comp) {
    elt.style.pixelRight=x;
  } else if(is.ns6comp) {
    elt.style.right = (x + 'px');
  }
}

// Zet de 'top' van het element
function setEltTop(elt, y) {
  if(!elt || elt == null) {
    return;
  }
  if(is.ns4comp) {
    elt.top=y;
  } else if(is.ie4comp) {
    elt.style.pixelTop=y;
  } else if(is.ns6comp) {
    elt.style.top= (y + 'px');
  }
}

function updateTopButton() {
  if(getElt("top_button")) {
    var topButton = getElt("top_button");
    
    if(getWindowScrollTop() > 0) {
      setEltVisibility(topButton,'visible');
      setEltDisplay(topButton,'block');
      setEltPosition(topButton,'absolute');

      // aanpassing tbv schaalbaar maken //
      if (offsetRight==74) {
        setEltLeft(topButton,offsetRight+109);
      } else
      if (offsetRight!=0) {
        if (getWindowWidth() > 780)
          var difR = offsetRight + ((getWindowWidth() - 800) / 2);
        else difR = offsetRight-20;      
        setEltLeft(topButton,difR);
      }
      else {
      //  if (getWindowWidth() > 1006)      
          setEltLeft(topButton,getWindowWidth()-206);
      //  else setEltLeft(topButton,800);
      }
      var difT = (getWindowHeight() - offsetBottom) + (getWindowScrollTop()+4);
      setEltTop(topButton,difT);
    } else {
      setEltVisibility(topButton,'hidden');
      setEltDisplay(topButton,'none');
    }
  }
}

////////////   einde setters voor #top ////////////////////////////////



