// php/JavaScript Document
// taalafhankelijke teksten plaatsen als VAR in inc/javascripts.php en inc/lan

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

var d = document;
function toTop() {
    var viewport_height = (self.innerHeight) ? self.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : (document.body) ? document.body.clientHeight : 0;
    var page_height = d.getElementsByTagName('body')[0].offsetHeight;
    var ttl = d.getElementById('to_top_link');
    if (page_height < viewport_height) ttl.style.visibility = 'hidden';
}
window.onload = function() { 
  toTop();
}
/*
// MENU
function startList() {
	// code for IE
	if(!document.body.currentStyle) return;
	var subs = document.getElementsByName('submenu');
	for(var i=0; i<subs.length; i++) {
		var li = subs[i].parentNode;
		if(li && li.lastChild.style) {
			li.onmouseover = function() {
				this.lastChild.style.visibility = 'visible';
			}
			li.onmouseout = function() {
				this.lastChild.style.visibility = 'hidden';
			}
		}
	}
}

window.onload = function() { 
  startList();
  toTop();
}
// -Menu
*/

function SymError(){
	return true;
}
window.onerror = SymError;


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function allowReset(){
	return window.confirm(resettxt)
}

function emailCheck (emailStr) {
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

	var matchArray=emailStr.match(emailPat)
	if (matchArray==null) {
		alert(emailtxt1)
		return false
	}
	var user=matchArray[1]
	var domain=matchArray[2]

	if (user.match(userPat)==null) {
		alert(emailtxt2)
		return false
	}

	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) {
		  for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert(emailtxt3)
			return false
			}
		}
		return true
	}

	var domainArray=domain.match(domainPat)
	if (domainArray==null) {
		alert(emailtxt4)
		return false
	}

	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length<2 || 
		domArr[domArr.length-1].length>4) {
	   alert(emailtxt5)
	   return false
	}

	if (len<2) {
	   alert(emailtxt6)
	   return false
	}
	// If we've gotten this far, everything's valid!
	return true;
}


function Mailto_Thankyou_Fever(which) {   
	var pass=true;
	if (document.images) {
		for (i=0;i<which.length;i++) {
			var tempobj=which.elements[i];
			if (tempobj.name.substring(0,1)!=="`") {
				if (((tempobj.type=="text"||tempobj.type=="textarea")&&
				tempobj.value=='')||((tempobj.type=="text"||tempobj.type=="textarea")&&
				tempobj.value=='0')||(tempobj.type.toString().charAt(0)=="s"&&
				tempobj.selectedIndex==0)) {
					pass=false;
					break;
			 }
		  }
	   }
	}
	if (!pass) {
		shortFieldName=tempobj.name.substring(0,30).toUpperCase();
		alert(alerttxt);
		tempobj.focus();
		return false;
	} else {
		return emailCheck(document.form1.email.value);
	}
}

function resizewindownews(){
	if (document.images['popupimage']){
		b=document.images['popupimage'].width;
		h=document.images['popupimage'].height;
		var mm = screen.width / 2 - b / 2;
		var nn = -75 + screen.height / 2 - h / 2;
		if ((h+130)>screen.height){
			window.resizeTo(b,screen.height);
			self.moveTo(0,0);
			document.body.focus()
		} else if ((b+52)>screen.width){
			window.resizeTo(screen.height,h);
			self.moveTo(0,0);
			document.body.focus()
		} else {
			window.resizeTo(b+52,h+130);
			self.moveTo(mm, nn+30);
			document.body.focus()
		}
	}
}
function resizewindow(){
	if (document.images['popupimage']){
		b=document.images['popupimage'].width;
		h=document.images['popupimage'].height;
		if (h>b){
			s = h;	
		} else {
			s = b;	
		}
		
		var mm = screen.width / 2 - s / 2;
		var nn = -75 + screen.height / 2 - s / 2;
		if ((s+130)>screen.height){
			window.resizeTo(s,screen.height);
			self.moveTo(0,0);
			document.body.focus()
		} else if ((s+52)>screen.width){
			window.resizeTo(screen.height,s);
			self.moveTo(0,0);
			document.body.focus()
		} else {
			window.resizeTo(s+52,s+130);
			self.moveTo(mm, nn+30);
			document.body.focus()
		}
	}
}
function change(id){ 
     ID = document.getElementById(id); 
     
     if(ID.style.display == "") 
          ID.style.display = "none"; 
     else 
          ID.style.display = ""; 
}