// JavaScript Document


function init_scr(url) {
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var check_name = 'height';
	var b_cookie_found = false;
	for ( i = 0; i<a_all_cookies.length; i++ ){		
		a_temp_cookie = a_all_cookies[i].split( '=' );
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');		
		if ( cookie_name == check_name ){			
			b_cookie_found = true;
			cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );	
			var myHeight = 0; 
			if( typeof( window.innerHeight ) == 'number' ) { 
				myHeight = window.innerHeight; 
			} else if( document.documentElement && 
				document.documentElement.clientHeight) { 
				myHeight = document.documentElement.clientHeight; 
			} else if( document.body && document.body.clientHeight ) { 
				myHeight = document.body.clientHeight; 
			}
			myHeight = myHeight- 140 - 15;
			if(myHeight != cookie_value){
				b_cookie_found = false;	
			}
			break;
		}
		a_temp_cookie = null;		
	}
	if (b_cookie_found == false){		
		var myHeight = 0; 
		if( typeof( window.innerHeight ) == 'number' ) { 
			myHeight = window.innerHeight; 
		} else if( document.documentElement && 
			document.documentElement.clientHeight) { 
			myHeight = document.documentElement.clientHeight; 
		} else if( document.body && document.body.clientHeight ) { 
			myHeight = document.body.clientHeight; 
		} 
		var today = new Date(); 
		var the_date = new Date("December 31, 2023"); 
		var the_cookie_date = the_date.toGMTString(); 	
		var the_cookie = "height="+ (myHeight - 140 - 15); 
		var the_cookie = the_cookie + ";expires=" + the_cookie_date; 
		document.cookie=the_cookie 
		var retrytimes = ""+window.location+"";
		var nr = retrytimes.length - 1;
		if(retrytimes.charAt(nr) == 1){		
			
		}
		else {		
			location = url+"mod=1"; 
		}
	}
}
 

function init_res(){		
	if (window.location.search == "") { 
		var height = document.body.clientHeight;
		var new_height = height - 140 - 15;		
		//this.document.getElementById('div_middle').style.height = new_height+"px";		
		//this.document.getElementById('div_content_right').style.height = (new_height-160)+"px";	
		//window.location.href = window.location + "?height=" + new_height; 
	}	
}
	
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_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_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 show_box(element){	
	if(this.document.getElementById(element).style.display == 'block'){
		this.document.getElementById(element).style.display = 'none';
	}
	else{
		this.document.getElementById(element).style.display = 'block';	
	}					
}

function checkEmail(email){
	if(email.length > 0){
		if (email.indexOf(' ') >= 0)
			alert("Een geldig emailadres bevat geen spaties");
		else if (email.indexOf('@') == -1)
			alert("Een geldig emailadres bevat een @");
		else if (email.indexOf('.') == -1)
			alert("Een geldig emailadres bevat minimaal één punt");
	}
}
var phone = "-0123456789";
var numm = "0123456789.,";
var numb = "0123456789";
var alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
function res(t,v){	
	var w = "";
	for (i=0; i < t.value.length; i++) {
		x = t.value.charAt(i);
		if (v.indexOf(x,0) != -1){
			w += x;
		}	
	}
	t.value = w;
}


function Popup(url,width,height,name){
	var winleft = screen.width/2 - width/2 ;
	var wintop =  0;
	winprops = 'height='+height+', width='+width+',top='+wintop+',left='+winleft+',scrollbars=yes,location=no,menubar=no,titlebar=no,status=no,toolbar=no,resizable=no,directories=no'
	win=window.open(url, name, winprops);
 	win.focus();

}

