
function wijzigJaar(pagina, waarde) {
	location.href= pagina+"?jaar="+waarde;
}

function openExcel(soort,jaar) {
	window.open('excelexport.asp?s='+soort+'&j='+jaar,'excelexp','width=640,height=220');
}

function checkMaxNationaliteit(name, max) {
	var chk = document.getElementsByName(name);
	var ichk = 0;
	for(var x = 0;x<chk.length;x++) 
		if (chk[x].checked && chk[x].id != "nat_ALL")  ichk++;
	if (ichk <= max) {
		return true;
	}else{
		alert('U kunt maximaal ' + max + ' nationaliteiten selecteren.');
		return false;
	}
	
}

function checkFieldsProfile() {
	missinginfo = "";
	if(document.profielForm.naam.value == '') {
			missinginfo += "\n     - Uw naam";
	}
	if(document.profielForm.email.value == '') {
			missinginfo += "\n     - Uw emailadres";
	}
	if(document.profielForm.loginnaam.value == '') {
			missinginfo += "\n     - Uw loginnaam";
	}
	if(document.profielForm.wachtwoord.value == '') {
			missinginfo += "\n     - Uw password";
	}
	if(document.profielForm.wachtwoord.value != document.profielForm.wachtwoord2.value) {
			missinginfo += "\n     - Password komt niet overeen";
	}
	if (missinginfo != "") {
		missinginfo = "De volgende veld(en) zijn niet\ngoed ingevuld:\n" +
		missinginfo + "\n\nVul aub de ontbrekende velden in.";
		alert(missinginfo);			
		return false;
	} else { 
		document.profielForm.submit();
	}
}

dojo.provide("atcb.Popup");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit._Templated");
dojo.require("dijit.dijit");

dojo.declare(
	"atcb.Popup",
	[dijit.layout.ContentPane, dijit._Templated],
{

  templateString: '<div dojoattachpoint="containerNode"></div>',
  
  parent: "",
  doLayout: false,
  
  _open: false, 

	postCreate: function() {
		//inherited
	  this.inherited(arguments);
	  
	  //prepare
		dijit.popup.moveOffScreen(this.domNode);

 		this.parent = (this.parent != "") ? dojo.byId(this.parent) : null;

	  if (this.parent) {
	  	this.connect(this.parent, "onclick", "_onClick");
	  	this.connect(this.parent, "onmousedown", dojo.hitch(this, function() {this._preventBlur = true;}));
	  	this.connect(this.parent, "onmouseup", dojo.hitch(this, function() {this._preventBlur = false;}));
	  }
		this.connect(this.domNode, "onclick", "onExecute");	

 	},
 	
 	_onClick: function(e) {
 		if (this._open) {
 			 this.close();
 		}else{
 			this.open();
 		}	
 		e.preventDefault();
 	},
 	
 	open: function() {
 		this._open = true;
 		dijit.popup.open({
 			popup: this,
 			parent: this.parent,
 			around: this.parent,
 			onExecute: dojo.hitch(this, "close"),
 			onCancel: dojo.hitch(this, "close")
 		});
 		dijit.focus(this.domNode);
 	},
 	
 	onCancel: function() {/*jic*/},
 	onExecute: function() {/*jic*/},
 	onClose: function() {/*jic*/},
 	
 	close: function() {
 		this._open = false;
 		dijit.popup.close(this);
 	},
 	
 	_onBlur: function() {
 		if (!this._preventBlur) {
 			this.onCancel();
 		}
 	}
 
 	 	
});
