maxbreedte)
{
$(this).width(maxbreedte);
}
});
}
function notitieEditor( textareaID) {
if($("#" + textareaID).html() == null) {
}
else {
var oFCKeditor = new FCKeditor( textareaID );
oFCKeditor.StartupFocus = false;
oFCKeditor.Width = "400";
oFCKeditor.Height = "124";
oFCKeditor.ToolbarSet = "Basic";
oFCKeditor.BasePath = "fckeditor/";
oFCKeditor.ReplaceTextarea();
}
}
// verwijder de spatie uit de editor (moet er in IE worden geplaatst, anders krijgt de editor focus na het laden en scrollt de pagina naar de editor)
function FCKeditor_OnComplete( editorInstance )
{
editorInstance.Events.AttachEvent( 'OnFocus', fckEditorFocus ) ;
}
function fckEditorFocus( editorInstance )
{
if (editorInstance.GetHTML() == '
')
{
editorInstance.SetHTML('');
}
}
function verwijderNotitie( notitieID) {
if( confirm('De notitie wordt definitief verwijderd. Weet u zeker dat u de notitie wilt weggooien?') ) {
document.location.href = 'notities_mod.asp?verwijderen=true¬itieID=' + notitieID;
}
}
function bewerkNotitie( notitieID) {
var textarea = '';
var revert = $('#tebewerkennotitietekst' + notitieID).html();
$('#tebewerkennotitietekst' + notitieID).after(textarea+button).remove();
$('.bewaarKnop').click(function(){bewaarNotitie(this, false);});
$('.annuleerKnop').click(function(){bewaarNotitie(this, revert);});
notitieEditor('notitie' + notitieID);
}
function bewaarNotitie(obj, cancel) {
var notitieID = $(obj).parents('.notitietekstcontainer').find('.notitieID').html();
if(!cancel) {
var oEditor = FCKeditorAPI.GetInstance('notitie' + notitieID);
t = oEditor.GetHTML() ;
var html = $.ajax({
url: "notities_mod.asp",
data: "updaten=true¬itieID=" + notitieID + "&documentXMLID=" + $('#documentID').html() + "¬itie=" + escape(t),
async: false
}).responseText;
}
else {
var t = cancel;
}
if(t=='') t='(geen tekst)';
$(obj).parent().parent().after('' + t.replace(/\n/g,'
') + '
').remove();
}
function schemafunctionaliteit() {
if(typeof(toonSchema) == 'function') {
toonSchema();
}
}
function toonVoetnoot(kennisbankafkorting,kruimel,melding){
var scherm, strs;
scherm=window.open("","voetnootscherm","toolbar=no,resizable,location=no,menubar=no,scrollbars=yes,width=400,height=300");
if(document.getElementById(melding) != undefined)
{
strs = '' +
'' +
"Voetnoot" +
"" +
"" +
"" +
"" +
"" +
"" +
"" + kruimel + '
"+
"";
}
else
{
strs = '' +
'' +
"Voetnoot" +
"" +
"" +
"" +
"" +
"" +
"" +
"" + kruimel + '
"+
"";
}
scherm.document.open();
scherm.document.write(strs);
scherm.document.close();
scherm.focus();
}
/*
* autoTab Kan worden opgeroepen vanuit de keyUp handler van een veld als
* onKeyUp="autoTab( this, 2, event)"
*/
function autoTab(input,len, e) {
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
var keyCode = (isNN) ? e.which : e.keyCode;
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].select();
input.form[(getIndex(input)+1) % input.form.length].focus();
}
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)
index = i;
else
i++;
return index;
}
function controleerDatum()
{
var gelukt = false;
if(isDatum(document.formulier.odag.value, document.formulier.omaand.value, document.formulier.ojaar.value))
{
gelukt = true;
}
else
{
document.formulier.odag.value = '';
document.formulier.omaand.value = '';
document.formulier.ojaar.value = '';
alert('Voer de datum in volgende de notatie: dd/mm/jjjj of gebruik de kalender.');
gelukt = false;
}
if(gelukt)
{
if(isDatum(document.formulier.vdag.value, document.formulier.vmaand.value, document.formulier.vjaar.value))
{
gelukt = true;
}
else
{
gelukt = false;
document.formulier.vdag.value = '';
document.formulier.vmaand.value = '';
document.formulier.vjaar.value = '';
alert('Voer de datum in volgende de notatie: dd/mm/jjjj of gebruik de kalender.');
}
if(gelukt)
{
if(isDatum(document.formulier.tdag.value, document.formulier.tmaand.value, document.formulier.tjaar.value))
{
gelukt = true;
}
else
{
gelukt = false;
document.formulier.tdag.value = '';
document.formulier.tmaand.value = '';
document.formulier.tjaar.value = '';
alert('Voer de datum in volgende de notatie: dd/mm/jjjj of gebruik de kalender.');
}
}
}
if(gelukt)
{
document.formulier.submit();
}
}
function isDatum( dag, maand, jaar)
{
var dagenInMaand = new Array( 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
/* Als alle waarden leeg zijn beschouwen we dit als een goede datum */
if( dag == '' && maand == '' && jaar == '') return true;
/* Controleer eerst of het allemaal nummers zijn */
if( !isNummer( dag) || !isNummer( maand) || !isNummer( jaar)) return( false);
/* Controleer range van de maand */
if( maand < 1 || maand > 12 ) return( false);
/* Controleer het jaar */
if( jaar < 1870 || jaar > 2100) return( false);
/* Controleer op een schrikkeljaar */
if( maand == 2 && dag == 29) {
if(!(jaar % 4 == 0 && (jaar % 100 != 0 || jaar % 400 == 0))) return false; /* We hebben geen schrikkeljaar */
}
/* Controleer de dag */
if( dag < 1 || dag > dagenInMaand[maand - 1]) return( false);
/* Als we hier zijn is de datum goed */
return( true);
}
/*
* isNummer( nummer) Controleert of de gegeven string een juist nummer is
*
* returned true wanneer het een goed nummer is anders false
*/
function isNummer( nummer)
{
var i;
nummer = trim( nummer);
/* Een leeg nummer is geen nummer */
if( isLeeg( nummer)) return false;
/* Kijk of het nummer alleen uit cijfers bestaat */
for( i = 0; i < nummer.length; i++) {
if( nummer.charAt(i) < '0' || nummer.charAt(i) > '9') return( false);
}
/* Geen fout gevonden */
return( true);
}
function kiesDatum( dag, maand, jaar, veldnaam, beginjaar)
{
var scherm, url;
url = 'selecteerDatum.asp?dag='+dag+'&maand='+maand+'&jaar='+jaar+'&veld='+veldnaam+'&beginjaar='+beginjaar;
scherm = window.open( url, 'kiesdatum', 'top=200,left=450,width=180,height=240,scrollbars=no');
scherm.focus();
}
function vulDatum(elem) {
var dag, maand, jaar
dag = document.forms['formulier'].elements[elem+'dag'].value;
if (dag.charAt(0) == '0') {dag = dag.charAt(1);}
maand = document.forms['formulier'].elements[elem+'maand'].value;
if (maand.charAt(0) == '0') {maand = maand.charAt(1);}
jaar = document.forms['formulier'].elements[elem+'jaar'].value;
}
function vulDatumUitKalender( dag, maand, jaar, veldnaam)
{
document.getElementById(veldnaam+'dag').value = dag;
document.getElementById(veldnaam+'maand').value = maand;
document.getElementById(veldnaam+'jaar').value = jaar;
vulDatum(veldnaam);
}
/*
* vergelijkDatum( dag1, maand1, jaar1, dag2, maand2, jaar2)
* Vergelijkt twee datums en returned de volgende waarden:
* -1 : datum1 is kleiner dan datum2
* 0 : datum1 en datum2 zijn gelijk
* 1 ; datum1 is groter dan datum2
*/
function vergelijkDatums( dag1, maand1, jaar1, dag2, maand2, jaar2)
{
var datum1, datum2;
if( dag1 == dag2 && maand1 == maand2 && jaar1 == jaar2) {
return 0;
}
datum1 = new Date( jaar1, maand1 - 1, dag1);
datum2 = new Date( jaar2, maand2 - 1, dag2);
if( datum1 < datum2) {
return -1;
}
else {
return 1;
}
}
// TOC functies
//var cssTocOpen = "url( layout/img/tocitem-open.gif) no-repeat 2px 8px";
//var cssTocGesloten = "url( layout/img/tocitem-gesloten.gif) no-repeat 3px 8px";
//var timerID = 0;
function tocfunctionaliteit()
{
$("dd:not(:first)").hide();
$("dd").each( function() { $(this).css("display","none"); } );
$(".toc dt").bind("click",
function() {
//$("dd:visible").hide();
$(this).parents("dd").show();
//$(this).parents("dd").prev().find(".pijltje").css("background",cssTocOpen);
$(this).parents("dd").prev().find(".pijltje").html("-");
if($(this).next().css("display") == 'none')
{
//$(this).find(".pijltje").css("background",cssTocOpen);
$(this).find(".pijltje").html("-");
$(this).next().show();
return false;
}
else
{
//$(this).find(".pijltje").css("background",cssTocGesloten);
$(this).find(".pijltje").html("+");
$(this).next().hide();
return false;
}
}
);
$(".toc dt").hover( tocitemHover, tocitemOut ) ;
$(".relatedContent dt").hover( relatedContentitemHover, relatedContentitemOut ) ;
$(".relatedBox dt").hover( relatedContentitemHover, relatedContentitemOut ) ;
$(".weblogmenu dt").hover( relatedContentitemHover, relatedContentitemOut ) ;
//$("#content").hover( verbergRolodexen, function() { return false; } ) ;
$(".relatedContentBox .tekstcontent").css("display","none");
}
var tocitemBackgroundColor = '';
var tocitemTekstColor = '';
function selecteerHoofdtab() {
var onderdeelID = $(".onderdeelID").html();
$("#hoofdmenu").find("li").each( function() {
var tabid = $(this).find(".id").html();
$(this).removeClass("hoofdtab");
if (tabid == onderdeelID)
{
$(this).addClass("hoofdtab");
$(this).find("div").each( function() {
var huidigeClass = $(this).attr("class");
$(this).removeClass(huidigeClass);
$(this).addClass(huidigeClass + "-selected");
$(this).css("cursor","default");
} );
}
else
{
$(this).find("div").each( function() {
var huidigeClass = $(this).attr("class");
if (huidigeClass.indexOf('-selected') > 0)
{
$(this).removeClass(huidigeClass);
$(this).addClass(huidigeClass.substring(0,huidigeClass.indexOf('-selected')));
}
$(this).css("cursor","hand");
} );
}
} );
tabfunctionaliteit();
}
// function verbergRolodexen()
// {
// $(".ui-dialog").each( function() {
// $(this).css({display: 'none'});
// } );
// }
// function toonRolodex( id, offsetTop, offsetLeft) {
// $("div#rolodex" + id).dialog("open");
// $(".ui-dialog").each( function() {
// if($(this).find(".id:first").html() == id)
// {
// $(this).css({display: 'block', position: 'absolute', top: offsetTop, left: offsetLeft, width: 499, height: 393, overflow: 'hidden', background: 'url( layout/img/rolodex.gif) no-repeat 0px 0px'});
// }
// else
// {
// $(this).css({display: 'none'});
// }
// } );
// }
// function verbergRolodex( id) {
// $(".ui-dialog").each( function() {
// if($(this).find(".id:first").html() == id)
// {
// $(this).css({display: 'none'});
// }
// } );
// }
function printDocument( id)
{
}
function tocitemHover() {
// verberg evt. de openstaande rolodex
//verbergRolodexen();
// pas de tekstkleur aan
tocitemTekstColor = $(this).find("a:first").css("color");
if (achtergrondkleur(".tochoveritemtekst") != undefined) {
$(this).find("a:first").each( function() { $(this).css("color", achtergrondkleur(".tochoveritemtekst")); } );
}
// pas de achtergrondkleur aan
tocitemBackgroundColor = $(this).css("background-color");
if (achtergrondkleur(".tochoveritem") != undefined) {
$(this).css("background-color", achtergrondkleur(".tochoveritem"));
}
// var offset = $(this).offset();
// var id = $(this).find(".id:first").html();
// toon de rolodex na 2 seconden
//timerID = setTimeout(function() {toonRolodex(id, offset.top - 135, offset.left + 310);}, 1000);
}
function tocitemOut() {
// zet de tekstkleur weer terug
$(this).find("a:first").each( function() { $(this).css("color", tocitemTekstColor); } );
// zet de achtergrondkleur weer terug
$(this).css("background-color", tocitemBackgroundColor);
// stop de timer, anders wordt het rolodexkaartje alsnog getoond
//clearTimeout ( timerID);
}
function relatedContentitemHover() {
tocitemBackgroundColor = $(this).css("background-color");
if (achtergrondkleur(".tochoveritem") != undefined) {
$(this).css("background-color", achtergrondkleur(".tochoveritem"));
}
}
function relatedContentitemOut() {
$(this).css("background-color", tocitemBackgroundColor);
}
function toonKinderen(documentID, allesDichtklappen) {
var docID = documentID.replace(/\./g,'x').replace(/\:/g,'d');
// alles dichtklappen
if(allesDichtklappen)
{
var voorouderIDs = '';
// de parents van het huidige item niet dichtklappen
$("dd#" + docID).parents("dd").each(function(){
if(!isLeeg(voorouderIDs)) voorouderIDs += ',';
voorouderIDs += $(this).attr('id');
} );
var arrVoorouderIDs = voorouderIDs.split(',');
// de hoogte van de openstaande subtocs moeten we later naar boven scrollen,
// om te voorkomen dat het item dat we openklappen buiten het scherm valt
var hoogte = 0;
$("dd#" + docID).prevAll("dd:visible").each(
function() {
hoogte = $(this).height();
}
);
$("dd:visible").each(
function() {
var ddID = $(this).attr('id');
if(ddID!=docID && !inArray(arrVoorouderIDs,ddID))
{
$(this).prev().find(".pijltje").html("+");
$(this).hide();
}
}
);
if(hoogte>0) {
document.getElementById('toc').scrollTop -= hoogte;
}
}
// controleer of er wel een tocitem is van het documentID
if (document.getElementById(docID) != null)
{
// controleer of de kinderen al opgehaald zijn
if (isLeeg($("dd#" + docID).html()))
{
var html = $.ajax({
url: "toc_mod.asp",
data: "haalKinderen=true&documentID=" + documentID,
async: false
}).responseText;
// toon overal een pijltje van dichtgeklapt item
//$("dd:visible").prev().find(".pijltje").css("background",cssTocGesloten);
$("dd:visible").prev().find(".pijltje").html("-");
// toon pijltje van opengeklapt item bij het huidige item
//$("dd#" + docID).prev().find(".pijltje").css("background",cssTocOpen);
$("dd#" + docID).prev().find(".pijltje").html("-");
// plaats de html met de kinderen
$("dd#" + docID).html(html);
// zorg voor inspringing adhv aantal voorouders
$("dd#" + docID).parents("dd").each(function(){$("dd#" + docID).find(".inspringen").append(' '); })
$("dd#" + docID).find(".inspringen").append(' ');
// uitklapfunctionaliteit toevoegen aan de nieuwe items
$("dd#" + docID).find("dd").each( function() { $(this).css("display","none"); } );
$("dd#" + docID).find("dt").bind("click",
function() {
//$("dd:visible").hide();
$(this).parents("dd").show();
//$(this).parents("dd").prev().find(".pijltje").css("background",cssTocOpen);
$(this).parents("dd").prev().find(".pijltje").html("-");
if($(this).next().css("display") == 'none')
{
//$(this).find(".pijltje").css("background",cssTocOpen);
$(this).find(".pijltje").html("-");
$(this).next().show();
return false;
}
else
{
//$(this).find(".pijltje").css("background",cssTocGesloten);
$(this).find(".pijltje").html("+");
$(this).next().hide();
return false;
}
}
);
// hoverfunctionaliteit toevoegen aan de nieuwe items
$("dd#" + docID).find("dt").hover( tocitemHover, tocitemOut ) ;
}
else
{
// de kinderen zijn al eens opgehaald, dus alleen weergeven/verbergen
}
}
}
function toonDocument(documentID) {
// loading();
// verberg eventueel de rolodex
// verbergRolodexen();
// haal de inhoud van het document op
// var document = $.ajax({
// url: "toc_mod.asp",
// data: "haalDocument=true&documentID=" + documentID,
// async: false
// }).responseText;
// $("#contentrechts").html(document);
// selecteerHoofdtab();
// haal de related content op
// var relatedContent = $.ajax({
// url: "toc_mod.asp",
// data: "haalRelatedContent=true&documentID=" + documentID,
// async: false
// }).responseText;
// $("#relatedContent").html(relatedContent);
// Rounded("div#tocVerwijzing","top","transparent","#ececec","border #ececec");
// Rounded("div#tocVerwijzing","bottom","transparent","#fff","border #ececec");
// $("#tocVerwijzing dt").hover( relatedContentitemHover, relatedContentitemOut ) ;
// Rounded("div.relatedContentBox","top","transparent","#ececec","border #ececec");
// Rounded("div.relatedContentBox","bottom","transparent","#fff","border #ececec");
// $(".relatedContentBox dt").hover( relatedContentitemHover, relatedContentitemOut ) ;
// checkTOCofRelatedContent();
// resizeFiguren();
// loadingVoltooid();
loading();
// stop de timer, anders wordt het rolodexkaartje alsnog getoond
//clearTimeout ( timerID);
//document.location.href = 'toon.asp?ID=' + documentID;
var url = 'toon.asp?ID=' + documentID;
window.location = url;
}
function toonWetgevingDocument(wetverwijzingID) {
loading();
var url = 'toon.asp?ID=' + wetverwijzingID + '&wvw=true';
window.location = url;
}
function toonTOC(documentID) {
$("#relatedContent").css("display","none");
$("#relatedContentVerwijzing").css("display","block");
$("#toc").css("display","block");
$("#tocVerwijzing").css("display","none");
uitklappen( documentID);
}
function toonRelatedContent(documentID) {
$("#toc").css("display","none");
$("#tocVerwijzing").css("display","block");
$("#relatedContent").css("display","block");
$("#relatedContentVerwijzing").css("display","none");
}
function toggle( id)
{
if($("#" + id).css("display") == 'block')
{
$("#" + id).css("display","none");
$("#" + id).parent().find(".teken").html("+");
$("#" + id).parent().find(".teken").css("padding-right","6px");;
}
else
{
$("#" + id).css("display","block");
$("#" + id).parent().find(".teken").html("-");
$("#" + id).parent().find(".teken").css("padding-right","8px");;
}
}
function checkTOCofRelatedContent( documentID)
{
if ( isLeeg($(".relatedContent").html()) )
{
// er is geen gerelateerde content, dus ook geen verwijzing tonen
$("#relatedContentVerwijzing").css("display","none");
$("#relatedContent").css("display","none");
}
else
{
// er is wel gerelateerde content, toon de toc en de related content onder elkaar
$("#relatedContentVerwijzing").css("display","none");
$("#relatedContent").css("display","block");
}
$("#toc").css("display","block");
$("#tocVerwijzing").css("display","none");
// TOC uitklappen tot op documentniveau
uitklappen( documentID);
}
function uitklappen( documentID)
{
var arrVoorouders = new Array();
// haal de voorouders op
var voorouders = $.ajax({
url: "toc_mod.asp",
data: "haalVoorouders=true&documentID=" + documentID,
async: false
}).responseText;
arrVoorouders = voorouders.split(",");
// klap alle voorouders open
for(var i=0; i ($(window).height()-350)) {
$('#toc').css("height",$(window).height()-350);
}
// scroll de inhoudsopgave en related content naar het huidge id
var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body;
var divOffset = $('#toc').offset().top;
var pOffset = $("#" + docID).prev().offset().top;
var pScroll = pOffset - divOffset;
pScroll = pScroll-100
document.getElementById('toc').scrollTop += pScroll;
// als er een td met class 'document' is, betreft het een documentniveau
if (achtergrondkleur(".tocgeselecteerditem") != undefined) {
$("#" + docID).prev().css("background-color",achtergrondkleur(".tocgeselecteerditem"));
}
if (achtergrondkleur(".tocgeselecteerditemtekst") != undefined) {
$("#" + docID).prev().find("a:first").css("color",achtergrondkleur(".tocgeselecteerditemtekst"));
}
}
else
{
// het betreft een niveau, toon de kinderen
toonKinderen(documentID, true);
}
}
function loading() {
//$("#loading").show();
$("#loading").css("display","block");
}
function loadingVoltooid() {
//$("#loading").hide();
$("#loading").css("display","none");
}
// Werkproces functies
function newSize(width, height)
{
if(document.all && !document.getElementById)
{
document.all['flashSchema'].style.pixelWidth = width;
document.all['flashSchema'].style.pixelHeight = height;
}
else
{
document.getElementById('flashSchema').style.width = width + "px";
document.getElementById('flashSchema').style.height = height + "px";
}
}
function setImgSize(imgSrc)
{
var newImg = new Image();
newImg.onload = function()
{
newSize(this.width, this.height);
return true;
}
newImg.src = imgSrc;
}
function highlight(documentTekst, zoekterm) {
var uitvoer = "";
var i = -1;
var lcZoekterm = zoekterm.toLowerCase();
var lcDocumentTekst = documentTekst.toLowerCase();
while (documentTekst.length > 0) {
i = lcDocumentTekst.indexOf(lcZoekterm, i+1);
if (i < 0) {
uitvoer += documentTekst;
documentTekst = "";
} else {
// alles binnen tags overslaan
if (documentTekst.lastIndexOf(">", i) >= documentTekst.lastIndexOf("<", i)) {
// alles binnen een evt