function sendPic(picture)
	{
	ext = 'width=620,height=680,top=0'
	ur = 'sendpic2.php?p='+picture
	send = window.open(ur,'Send',ext);
	
    //alert(picture);
	}
//=======================================================================	
function printPic(picture)
	{
	//alert(picture)
	ext = 'width=620,height=530,top=10'
	ur = 'printpic.php?p='+picture
	send = window.open(ur,'Print',ext);
	}
//=======================================================================	
function WisselKleur(what,onoff)
	{
	if (onoff == 1) what.style.backgroundColor = '#006FCA';
	if (onoff == 0) what.style.backgroundColor = '';
	}

function chBorder(what,onoff)
	{
	if (onoff == 1) what.style.borderColor = '#000000';
	if (onoff == 0) what.style.borderColor = '#bdbdbd';
	}

	
//=======================================================================	
function bigger()
{
document.getElementById('picture').style.display = 'block';
}	
//=======================================================================
function closediv()
{
document.getElementById('picture').style.display = 'none';
}
//=======================================================================
function CheckEmpty(what)
{
if (what == "") return false;
else return true;
}
//=======================================================================
function ShowBigger(pic,w,h,extra)
{
w = w + 20;
h = h + 60;

widthmid = screen.availWidth / 2;
heightmid = screen.availHeight / 2;
left = widthmid - (w / 2);
boven = heightmid - (h / 2);


ext = 'width='+w+',height='+h+',left='+left+',top='+boven;
if (extra != ''){
	ext = ext + ','+extra;
}
url = '../upload/'+pic;
win = window.open('./xhtml/blank.html','',ext);
win.document.write('<body style="background-color:#EDF4D3;font-family:Verdana;font-size:11px;">');
win.document.write('<img src="'+url+'" border="1" style="border-color:#00432C;padding:2px;"><p />');
win.document.write('<div align="center"><a href="javascript:window.close();" style="color:#00432C;">Sluit venster</a></div>');
}
//=======================================================================
function Popup(pagina,w,h)
{
w = w + 20;
h = h + 60;

widthmid = screen.availWidth / 2;
heightmid = screen.availHeight / 2;
left = widthmid - (w / 2);
boven = heightmid - (h / 2);

ext = 'width='+w+',height='+h+',left='+left+',top='+boven+',scrollbars=yes';
url = pagina
win = window.open(pagina,'',ext);
}
//=======================================================================
function sendLink(name, email)
{
url = 'sendlink.php?n='+name+'&e='+email;
ext = 'width=100,height=100';
wo = window.open(url,'send',ext);
wo.blur();
window.focus();
}
//=======================================================================
/***********************************************
* Required field(s) validation v1.10- By NavSurf
* Visit Nav Surf at http://navsurf.com
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function checkForm_en(formobj){
	// Enter name of mandatory fields
	var fieldRequired = Array("recipients", "Title", "Name", "City", "Country", "Email", "Message");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Department", "Title", "Name", "City", "Country", "Email", "Message");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].value == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}
//=======================================================================

function checkForm_de(formobj){
	// Enter name of mandatory fields
	var fieldRequired = Array("recipients", "Title", "Name", "City", "Country", "Email", "Message");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Department", "Title", "Name", "City", "Country", "Email", "Message");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].value == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}
//=======================================================================



/***********************************************
* Required field(s) validation v1.10- By NavSurf
* Visit Nav Surf at http://navsurf.com
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function checkForm_nl(formobj){
	// Enter name of mandatory fields
	var fieldRequired = Array("recipients", "Aanhef", "Naam", "Plaats", "Land", "Email", "Opmerking");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Afdeling","Aanhef", "Naam", "Plaats", "Land", "Email", "Opmerking");
	// dialog message
	var alertMsg = "U moet de volgende velden invullen:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].value == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}

//========================================
	function emailCheck (emailStr) {
    var checkTLD=1;
    var knownDomsPat=/^(biz|com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
    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("E-mail adres lijkt onjuist @ en punt");
       return false;
    }
    
    var user=matchArray[1];
    var domain=matchArray[2];

   for (i=0; i<user.length; i++) {
       if (user.charCodeAt(i)>127) {
            alert("Deze gebruikersnaam bevat onjuiste karakters.");
           return false;
       }
    }

   for (i=0; i<domain.length; i++) {
       if (domain.charCodeAt(i)>127) {
            alert("Deze domeinnaam bevat onjuiste karakters.");
           return false;
        }
    }

   if (user.match(userPat)==null) {
        alert("De gebruikersnaan is ongeldig.");
       return false;
    }

    var IPArray=domain.match(ipDomainPat);
    
   if (IPArray!=null) {
       for (var i=1;i<=4;i++) {
           if (IPArray[i]>255) {
                alert("Doel IP adres in ongeldig");
               return false;
            }
        }
       return true;
    }
 
    var atomPat=new RegExp("^" + atom + "$");
    var domArr=domain.split(".");
    var len=domArr.length;
   for (i=0;i<len;i++) {
       if (domArr[i].search(atomPat)==-1) {
            alert("Ongeldig domein.");
           return false;
        }
    }

   if (checkTLD && domArr[domArr.length-1].length!=2 && 
        domArr[domArr.length-1].search(knownDomsPat)==-1) {
        alert("Het adres moet eindigen op een domein of 2-letterige landcode");
       return false;
    }
   if (len<2) {
        alert("De hostname van dit adres mist");
       return false;
    }

return true;
}

// 

function matchHeight(){ 
     var divs,contDivs,maxHeight,divHeight,d; 
     // get all <div> elements in the document 
     divs=document.getElementsByTagName('div'); 
     contDivs=[]; 
     // initialize maximum height value 
     maxHeight=0; 
     // iterate over all <div> elements in the document 
     for(var i=0;i<divs.length;i++){ 
          // make collection with <div> elements with class attribute 'container' 
          if(/\bcontainer\b/.test(divs[i].className)){ 
                d=divs[i]; 
                contDivs[contDivs.length]=d; 
                // determine height for <div> element 
                if(d.offsetHeight){ 
                     divHeight=d.offsetHeight; 
                } 
                else if(d.style.pixelHeight){ 
                     divHeight=d.style.pixelHeight; 
                } 
                // calculate maximum height 
                maxHeight=Math.max(maxHeight,divHeight); 
          } 
     } 
     // assign maximum height value to all of container <div> elements 
     for(var i=0;i<contDivs.length;i++){ 
          contDivs[i].style.height=maxHeight+'px'; 
     } 
} 


function Upload(nr)
{
totwidth = screen.availWidth;
totheight = screen.availHeight;

leftx = eval((totwidth - 300) / 2)
topx  = eval((totheight - 130) / 2)

ext = 'width=300, height=130, left='+leftx+', top='+topx;
url = 'upload.php?nr='+nr;
win = window.open(url,"upload",ext);
}



function chButtonLang(what, onoff)
{
if(onoff == 1) document.getElementById(what).style.backgroundPosition = '0 -50px';
if(onoff == 0) document.getElementById(what).style.backgroundPosition = '0 0px';
}

function chButton2(what, onoff){
if(onoff == 1) document.getElementById(what).style.backgroundImage = 'url(../images/2010bulleto.gif)';
if(onoff == 0) document.getElementById(what).style.backgroundImage = 'url(../images/2010bullet.gif)';
}
