maxbreedte)
{
$(this).width(maxbreedte);
}
});
}
function notitieEditor( textareaID) {
if($("#" + textareaID).html() == null) {
}
else {
var oFCKeditor = new FCKeditor( textareaID );
oFCKeditor.StartupFocus = true;
oFCKeditor.Width = "450";
oFCKeditor.Height = "400";
oFCKeditor.ToolbarSet = "Basic";
oFCKeditor.BasePath = "fckeditor/";
oFCKeditor.ReplaceTextarea();
}
}
function verwijderNotitie( notitieID) {
if(window.opener.document.getElementById('annotatieimage') != null) {
window.opener.document.getElementById('annotatieimage').src = 'layout/img/annotatie_img.gif';
}
document.location.href = 'annotatie_mod.asp?verwijderen=true¬itieID=' + notitieID;
window.close();
}
function bewerkNotitie( notitieID) {
var textarea = '';
var revert = $('#tebewerkennotitietekst').html();
$('#tebewerkennotitietekst').after(textarea+button).remove();
$('#bewaarKnop').click(function(){bewaarNotitie(this, false);});
$('#previewKnop').click(function(){previewNotitie(this, false);});
$('#annuleerKnop').click(function(){bewaarNotitie(this, revert);});
$('#verwijderKnop').click(function(){verwijderNotitie(notitieID);});
$('.previewknoppen').css("display","none");
notitieEditor('notitie');
}
function previewNotitie(obj, cancel) {
if(!cancel) {
var oEditor = FCKeditorAPI.GetInstance('notitie');
var t = oEditor.GetHTML() ;
}
else {
var t = cancel;
}
if(t=='') t='(geen tekst)';
$(obj).parent().parent().after('' + t.replace(/\n/g,'
') + '
').remove();
$('.previewknoppen').css("display","block");
}
function bewaarNotitie(obj, cancel) {
var notitieID = $(obj).parents('.notitietekstcontainer').find('.notitieID').html();
if(!cancel) {
var oEditor = FCKeditorAPI.GetInstance('notitie');
var t = oEditor.GetHTML() ;
var html = $.ajax({
url: "annotatie_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();
window.close();
}
function toonVoetnoot(kruimel,melding){
var scherm, strs;
scherm=window.open("","voetnootscherm","toolbar=no,resizable,location=no,menubar=no,scrollbars=yes,width=400,height=300");
strs = '' +
'' +
"Voetnoot" +
"" +
"" +
"" +
"" +
"" +
"" + kruimel + '
"+
"";
scherm.document.open();
scherm.document.write(strs);
scherm.document.close();
scherm.focus();
}
function toonPopup(titel, kruimel,melding){
var scherm, strs;
scherm=window.open("","popupscherm","toolbar=no,resizable,location=no,menubar=no,scrollbars=yes,width=400,height=300");
strs = '' +
'' +
"" + titel + "" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" + kruimel + '
"+
"";
scherm.document.open();
scherm.document.write(strs);
scherm.document.close();
scherm.focus();
}
function toonFiguur(figuurhref){
var scherm, strs;
scherm=window.open("","figuurscherm","toolbar=no,resizable,location=no,menubar=no,scrollbars=yes,width=400,height=300");
strs = '' +
'' +
"Figuur" +
"" +
"" +
"" +
"" +
"" +
'"+
"";
scherm.document.open();
scherm.document.write(strs);
scherm.document.close();
scherm.focus();
}
function toonPopupBijlage( wid ){
var titel, kruimel, melding;
kruimel = '';
var velden = new Array();
var html = $.ajax({
url: "bijlage_mod.asp",
data: "wid=" + wid,
async: false
}).responseText;
if (!isLeeg(html)) {
velden = html.split("||");
kruimel = velden[0];
melding = velden[1];
}
var scherm, strs;
scherm=window.open("","popupscherm","toolbar=no,resizable,location=no,menubar=no,scrollbars=yes,width=400,height=300");
strs = '' +
'' +
"Bijlage" +
"" +
"" +
"" +
"" +
"" +
"" +
"" + 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 kiesDatum( dag, maand, jaar, veldnaam)
{
var scherm, url;
url = 'selecteerDatum.asp?dag='+dag+'&maand='+maand+'&jaar='+jaar+'&veld='+veldnaam;
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;
document.forms['formulier'].elements[elem+'datum'].value = dag + '-' + maand + '-' + jaar;
}
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;
}
}
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