var tabbladenHistory = new Array();
$(document).ready(function() {
$('th.uitgcell').hide();
$('td.uitgcell').hide();
$('th.systcell').hide();
$('td.systcell').hide();
$('th.vrcell').hide();
$('td.vrcell').hide();
if (window.parent && window.parent.setTitel && document.title)
window.parent.setTitel(document.title);
renderRoundedCorners();
$('ul#nav li a').mousedown(function() {
var id = $(this).parent().get(0).id;
if ($('ul#nav li.activelink').length > 0) {
var currentactiveid = $('ul#nav li.activelink').get(0).id;
if (id == currentactiveid)
return;
try {
if (frames["contentframe"].GetRequestUrl)
tabbladenHistory[currentactiveid] = frames["contentframe"].GetRequestUrl();
else
tabbladenHistory[currentactiveid] = frames["contentframe"].location.href;}
catch (error) {
tabbladenHistory[currentactiveid] = "";}}
this.parentNode.className = 'activelink';
var links = $('ul#nav li');
for (var i = 0; i < links.length; i++)
if (links[i].className.indexOf('active') >-1 && links[i] != this.parentNode)
links[i].className = '';
var basesrc = document.location.href.substring(0, document.location.href.indexOf('?'));
var text = (this.text) ? this.text : this.innerText;
if (!tabbladenHistory[id] || tabbladenHistory[id] == 'undefined' || tabbladenHistory[id] == "") {
document.getElementById('contentframe').src = getTemplateNaam(text);} else {
document.getElementById('contentframe').src = tabbladenHistory[id];}
return false;}).click(function() { return false; });
$('table.koektrommel a, div.pathcolumn a').mousedown(function() {
switch (this.id) {
case 'zoeken':{
var url = zoekSchermFile;
window.parent.document.getElementById('contentframe').src = url;
break;}
case 'uzoeken':{
$(this.parentNode).hide();
$('td.zoekveld').hide();
if ($("#soortkeuze input:visible[type='checkbox']").length == 1) {
$("#soortkeuze input:visible[type='checkbox']").attr("checked", "checked");
showVraag();} else
$('td.uitgcell').show();
$('th.uitgcell').show();
$('a#zoeken').show();
break;}
case 'szoeken':{
$(this.parentNode).hide();
$('th.systcell').show();
$('td.systcell').show();
$('a#zoeken').show();
break;}
case 'soort_uitgebreid':{
$(this.parentNode).hide();
$('td.uitgcell').show();
$('th.uitgcell').show();
$('th.vrcell').hide();
$('td.vrcell').hide();
if ($("#soortkeuze input:visible[type='checkbox']").length == 1) {
$("#soortkeuze input:visible[type='checkbox']").attr("checked", "checked");
showVraag();}
break;}
case 'soort_systematisch':{
$(this.parentNode).hide();
$('th.systcell').show();
$('td.systcell').show();
$('th.vrcell').hide();
$('td.vrcell').hide();
break;}
case 'soortnext':{
showVraag();
break;}
case 'resultaat':{
document.forms['zoekform'].submit();
break;}
case 'resultaat_uitgebreid':{
document.forms['zoekform'].submit();
break;}
case 'detail':{
document.forms['detailform'].submit();
break;}
case 'detail_uitgebreid':{
document.forms['detailform'].submit();
break;}
case 'detail_dossier':{
document.forms['detailform'].submit();
break;}
case 'vraag_nazoeken':{
var url = zoekSchermFile+'?column=vraag';
window.parent.document.getElementById('contentframe').src = url;
break;}
case 'soort_nazoeken':{
var url = zoekSchermFile+'?column=soort';
window.parent.document.getElementById('contentframe').src = url;
break;}}});
koppelEventsDropDownLists();
$('div.viewswitcher').click(function() {
if (document.getElementById('view').value != 'galerij')
document.getElementById('view').value = 'galerij';
else
document.getElementById('view').value = 'lijst';
document.forms['settings'].submit();});
$('img.winkelwagen').parent().click(function() { return false; });
$('img.winkelwagen').click(function() {
var id = this.id.substring(this.id.indexOf('_', 0)+1);
var image = document.getElementById('img_'+id);
if (!image) {
var possibleImage = $('#cell_'+id+' img');
if (possibleImage.length > 0)
image = possibleImage.get(0);
else
return;}
var images = $('img.img');
var div = $('div.besteldiv')[0];
$('div.besteldiv').hide();
var left = ($(image).offset().left)+$(image).width()+6;
var top = $(image).offset().top;
if (left < 0)
left = 0;
if ($(this).offset().left+$(div).width() > $(document).width())
left = ($(document).width()-$(div).width()-21);
div.style.left = left;
div.style.top = top;
$('html,body').animate({ scrollTop: (top-150) }, "", "swing", '');
if ($('div.besteldiv').is(':visible')) {
$('div.besteldiv').hide();}
else {
$('div.besteldiv').fadeIn()
Nifty('div.besteldiv', 'bottom right');
document.getElementById('bestelframe').src = document.getElementById('bestelframeurl_'+id).value;}});
$('span.close').click(function() {
closeBestelPopup();});
$('a.verwijderdocument').mousedown(function() {
if (confirm('Weet u zeker dat u dit document wilt verwijderen?')) {
var xmlbeschrijvingid = this.id.substring(this.id.indexOf('_', 0)+1);
$('#'+this.id+' img').attr({ src: "images/loading.gif", title: "Bezig ...", alt: "Bezig ..." });
makeAjaxRequest($('input#XSLTServiceURL').val()+'/deleteDocument?id='+xmlbeschrijvingid+'&volgnummer='+$('input#volgnummer').val(), function(Req) {
if (req.readyState == 4 && req.status == 200) {
var root = req.responseXML.documentElement;
if (root.textContent) //Fx
var data = root.textContent;
else //IE
var data = root.parentNode.text;
if (data == 'true') {
verwijderenGelukt();}
else {
alert('Het document is niet succesvol verwijderd.');}
$('#'+this.id+' img').attr({ src: "images/ontwerp/icons/trash.png", title: "Verwijder", alt: "Verwijder" });}});}});
$('a.sorteerkolom').click(function() {
var currentsort = $('input#sortering')[0].value;
$('input#sortering')[0].value = $(this).text();
var newsort = $('input#sortering')[0].value;
if (currentsort.toLowerCase() == newsort.toLowerCase())
$('input#schikking').val($('input#schikking').val().toLowerCase() != 'desc' ? 'desc' : 'asc'); // eerst asc
else
$('input#schikking').val('asc'); // eerst asc
document.forms['settings'].submit();
return false;});
$('table.uzoekvelden input, div#zoekscherm_panelen form input').keyup(function(e) {
if (e.which == 13) {
$(this).parents('form')[0].submit();}});
$('textarea.icoon').each(function() {
$(this).after($(this).val());});
$('td.center table.center td.icoon img').mouseover(function() {
var id = this.id.substring(this.id.indexOf('_', 0)+1);
var xmlid = findFirstParentTag(this, 'TD').id.replace('cell_', '');
var balloon = $('div.balloon')[0];
$('div.balloon').html($('div#beschrijving_'+xmlid).html().substring(0, 250));
if ($('div#beschrijving_'+xmlid).html().length > 250)
$('div.balloon').html($('div.balloon').html()+"...");
balloon.innerHTML+= '<br/><br/>';
var left = ($(this).offset().left+3)-(($(balloon).width()-$(this).width()) / 2);
var top = $(document).scrollTop()+($(this).offset().top-$(document).scrollTop())+$(this).height()+2;
if (left < 0)
left = 0;
var viewHeight = document.body.offsetHeight ? document.body.offsetHeight : window.innerHeight;
if (top+$(balloon).height() > (viewHeight+$(document).scrollTop()))
top = ($(this).offset().top-$(balloon).height())+2;
if ($(this).offset().left+$(balloon).width() > $(document).width())
left = ($(document).width()-$(balloon).width()-21);
balloon.style.left = left;
balloon.style.top = top;
showBalloon();});
$('td.center table.center td.icoon img').mouseout(function() {
hideBalloon();});});
window.onscroll = function(){
if($('div.relatiebalk')[0]){
var balk = $('div.relatiebalk')[0];
var relatiediv = $('div.relaties')[0];
var viewHeight = document.body.offsetHeight ? document.body.offsetHeight : window.innerHeight;
if($('div.relaties').is(':visible')){
balk.style.top = viewHeight+$(document).scrollTop()-$(balk).height()-$('div.relaties').height()-2+'px';
relatiediv.style.top = $('div.relatiebalk').offset().top+$('div.relatiebalk').height()+2+'px';}
else
balk.style.top = viewHeight+$(document).scrollTop()-$(balk).height()-2;}}
function setActiveTab(newActiveLi){
var links = $('ul#nav li');
for(var i=0; i<links.length; i++)
if(links[i].className.indexOf('active') >-1)
links[i].className = '';
$('ul#nav li#'+newActiveLi).each(function() { this.className = 'activelink'; });}
function koppelEventsDropDownLists(){
Nifty('div.uzoektext','small transparent');
Nifty('div.uzoeklookup','small transparent');
Nifty('div.uzoekrange','small transparent');
Nifty('div.downdropper','small transparent');
Nifty('div.daginvoer','small transparent');
Nifty('div.jaarinvoer','small transparent');
$('div.dropdownlist').click(function() //Openklikken van een dropdown keuze{
var thisvelden = $('#'+this.id+' div.velden');
Nifty('div.velden', 'small transparent'); // 'achtergrond' van keuzelijst
Nifty('a.cmveldfilter', 'small transparent'); //Hover over de zoekmethodekeuze
Nifty('a.vanmaandveldfilter', 'small transparent');         // Hover over de maandselectie
Nifty('a.totmaandveldfilter', 'small transparent');         // Hover over de maandselectie
Nifty('a.sortering', 'small transparent'); // Hover over de resultaatsorteringskeuze
Nifty('a.annotatiedropdown', 'small transparent'); // Hover over de annotaties.
Nifty('a.relatiedropdown', 'small transparent'); //Hover over de relatielijst
if (!thisvelden.is(':visible')) {
$('div.velden').hide();}
thisvelden.toggle();});
$('div.velden a.sortering').click( function() {
$('div.velden').hide();
$('input#sortering')[0].value = this.id;
$('input#schikking').val('asc'); // eerst asc
document.forms['settings'].submit();
return false;});
$('div.velden a.relatiedropdown').click( function() {
var value = this.id.substring(this.id.indexOf('_',0)+1);
$('#waarde_relatie').val(value);
$('div.dropdownlist .downdropper').html($(this).html());});
$('div#ddl_sortering_vlg').click( function() {
var schikspan = $('span#schikspan');
var title = schikspan.title;
if($('input#schikking').val() == '' || $('input#schikking').val() == 'asc'){
$('input#schikking').val('desc');}
else{
$('input#schikking').val('asc');}
Nifty('div#ddl_sortering_vlg', 'small transparent');
document.forms['settings'].submit();});
$('div.velden a.cmveldfilter').click(function() //zoekoptie dropdownkeuze{
$('div.velden').hide();
var value = this.id.substring(this.id.indexOf('_', 0)+1); // veld waarde
var dropdownid = this.id.substring(0, this.id.indexOf('_', 0));  // id van input veld
$('#waarde_'+dropdownid).val(value);
$('#cmveldFilter_'+dropdownid).val(value);
$('#ddl_'+dropdownid+' .downdropper').html($(this).html());
return false;});
$('div.velden a.vanmaandveldfilter').click( function()  // VANmaandselectie dropdownkeuze{
$('div.velden').hide();
var value = this.id.substring(this.id.indexOf('_',0)+1); // veld waarde
var dropdownid = this.id.substring(0, this.id.indexOf('_',0));  // id van input veld
$('#waarde_'+dropdownid).val(value);
$('#ddl_'+dropdownid+' .downdropper').html($(this).html());
Nifty('div#ddl_vandatummaand','small transparent');
return false;});
$('div.velden a.totmaandveldfilter').click( function()  // TOTmaandselectie dropdownkeuze{
$('div.velden').hide();
var value = this.id.substring(this.id.indexOf('_',0)+1); // veld waarde
var dropdownid = this.id.substring(0, this.id.indexOf('_',0));  // id van input veld
$('#waarde_'+dropdownid).val(value);
$('#ddl_'+dropdownid+' .downdropper').html($(this).html());
Nifty('div#ddl_totdatummaand','small transparent');
return false;});
$('div.velden a.publicatiesoorten').click( function()  // publicatiesoort dropdownkeuze{
$('div.velden').hide();
var value = this.id.substring(this.id.indexOf('_',0)+1); // veld waarde
var dropdownid = this.id.substring(0, this.id.indexOf('_',0));  // id van input veld
$('#waarde_'+dropdownid).val(value);
$('#ddl_'+dropdownid+' .downdropper').html($(this).html());
Nifty('div#ddl_publicatiesoorten','small transparent');
return false;});
$('div.annotatievelden a.annotatiedropdown').click( function() {
$('div.annotatievelden').hide();
var value = this.id.substring(this.id.indexOf('_',0)+1); // veld waarde
var dropdownid = this.id.substring(0, this.id.indexOf('_',0));  // id van input veld
$('#waarde_'+dropdownid).val(value);
$('#ddl_'+dropdownid+' .downdropper').html($(this).html());
Nifty('div.downdropper','small transparent');
return false;});}
function submitStatistieken(){
var invalid = false;
$("input.daginvoer").each(function() {
var daginvoerwaarde = $(this).val();
if(isNaN(daginvoerwaarde)){
invalid = true;}});
if(invalid) {
alert('u heeft geen geldige dag ingevoerd');
return;}
$("input.jaarinvoer").each(function(){
var jaarinvoerwaarde = $(this).val();
if(isNaN(jaarinvoerwaarde)){
invalid = true;}});
if(invalid) {
alert('u heeft geen geldig jaar ingevoerd');
return;}
var vanDatum = new Date($('#vanDatumY').val(), $('#waarde_vandatummaand').val()-1, $('#vanDatumD').val());
if($('#vanDatumY').val() != vanDatum.getFullYear()){
alert('Ongeldige datum ingevoerd');
return;}
if($('#waarde_vandatummaand').val()-1 != vanDatum.getMonth()){
alert('Ongeldige datum ingevoerd');
return;}
var totDatum = new Date($('#totDatumY').val(), $('#waarde_totdatummaand').val()-1, $('#totDatumD').val());
if($('#totDatumY').val() != totDatum.getFullYear()){
alert('Ongeldige datum ingevoerd');
return;}
if($('#waarde_totdatummaand').val()-1 != totDatum.getMonth()){
alert('Ongeldige datum ingevoerd');
return;}
submit(document.forms['statistieken']);}
function koppelEventsUitgebreidzoekscherm() {
$('.zoekenselectielijst').mousedown(function() {
var cmveldnaam = this.id.substring(this.id.indexOf('_', 0)+1);
var image = this;
var div = $('div.zoekenselectielijstdiv')[0];
$('div.zoekenselectielijstdiv').hide();
var left = ($(image).offset().left)-402;
var top = $(image).offset().top;
if (left < 0)
left = 0;
div.style.left = left;
div.style.top = top;
$('html,body').animate({ scrollTop: (top-150) }, "", "swing", '');
if ($('div.zoekenselectielijstdiv').is(':visible')) {
$('div.zoekenselectielijstdiv').hide();
document.getElementById('zoekenselectielijstframe').src = '';} else {
document.getElementById('zoekenselectielijstframe').src = '';
document.getElementById('zoekenselectielijstframe').src = document.getElementById('zoekenselectielijsturl_'+cmveldnaam).value;
setTimeout(function() {
Nifty('div.zoekenselectielijstdiv', 'bottom left');
$('div.zoekenselectielijstdiv').show();}, 100);}});
$('table.uzoekvelden input').keyup(function(e) {
if (e.which == 13) {
$(this).parents('form')[0].submit();}});
$('span.zoekenselectielijstclose').click( function() {
$('div.zoekenselectielijstdiv').hide();});}
function setUitgebreidZoekenPanelsWidth(){
var width = $('#cmvelden .uzoekvelden').width();
$('#modereerdkeuze .uzoekvelden').width(width);
if (jQuery.browser.version <= 6 && jQuery.browser.msie) {
var cmveldendiv = $('#cmvelden');
var modereerdkeuzediv = $('#modereerdkeuze');
if(cmveldendiv.length > 0)
$('#modereerdkeuze').css('top', (cmveldendiv.offset().top+cmveldendiv.outerHeight()+10)+'px');
if (modereerdkeuzediv.length > 0)
$('#verbredenversmallen').css('top', (modereerdkeuzediv.offset().top+modereerdkeuzediv.outerHeight()+10)+'px');
else if(cmveldendiv.length > 0)
$('#verbredenversmallen').css('top', (cmveldendiv.offset().top+cmveldendiv.outerHeight()+10)+'px');}
$('#verbredenversmallen .uzoekvelden').width(width);}
function showBalloon(){
$('div.balloon').show()
Nifty('div.balloon','');}
function hideBalloon(){
$('div.balloon').hide()}
function submit(form){
form.submit();}
function resetView(current){}
function getNextSibling(startBrother){
endBrother=startBrother.nextSibling;
while(endBrother.nodeType!=1){
endBrother = endBrother.nextSibling;}
return endBrother;}
function getParameter(strParamName){
var strReturn = "";
var strHref = window.location.href;
var bFound=false;
var cmpstring = strParamName+"=";
var cmplen = cmpstring.length;
if ( strHref.indexOf("?") >-1 ){
var strQueryString = strHref.substr(strHref.indexOf("?")+1);
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++){
if (aQueryString[iParam].substr(0,cmplen)==cmpstring){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
bFound=true;
break;}}}
if (bFound==false) return null;
return strReturn;}
function showVraag(){
var cbs = $('div#soortkeuze input');
var volgnr = document.getElementById('vorigezoekvraag').value;
var selected = "";
for(var i=0; i<cbs.length; i++)
if(cbs[i].checked)
selected+= (cbs[i].value+",");
selected = selected.substring(0, selected.length-1);
if(selected.length < 1){
alert("Selecteer één of meer soorten.");
return;}
$('td.uitgcell').hide();
$('th.vrcell').show();
$('td.vrcell').show();
$('th.leftrowspan a#zoeken').show();
document.getElementById('eenvoudig_zoeken').value = "false";
document.getElementById('uitgebreid_zoeken').value = "true";
var url = document.getElementById('URL_XSLTSERVICE').value+'/getCMVelden?beschrijvingssoorten='+selected+'&volgnr='+volgnr+'&xslttemplate=CMVelden.xsl';
loadXMLDoc(url, 'cmvelden', false, function(){
Nifty("div.zoekvelden", "small transparent");
Nifty('a.zoeknext','small transparent');
setUitgebreidZoekenPanelsWidth();
koppelEventsUitgebreidzoekscherm();
koppelEventsDropDownLists();});}
function resizeImages(){/*
$('.img:visible').each( function() {
var height = $(this).height();
var width = $(this).width();
if(height > 100 || width > 100){
$(this).width(100);
var newheight = (100 / width) * height;
$(this).height(newheight);
if(newheight > 100) {
$(this).height(100);
$(this).width(((100 / height) * width));}
var parentdiv = $(this).parent().parent(0).get(0);
$(parentdiv).width($(this).width());
$(parentdiv).height($(this).height());}});*/}
function openWindow(url){
window.open(url);}
function closeBestelPopup(){
var images = $('img.img');
$('div.besteldiv').hide();}
function findFirstParentTag(element, tagname){
if(!element)
return element;
else if(element.tagName == tagname)
return element;
else
return findFirstParentTag(element.parentNode, tagname);}
function loadHttpHandlerIcoons() {}
function showHelp(url) {
newwindow = window.open('help/'+url+'.htm.axd', 'name', 'height=500,width=400,scrollbars=yes');
if (window.focus) { newwindow.focus() }
return false;}
