// Interactieve kaart var oFilterstatus = {startdate : null, enddate : null, tagid : null, cityid : null}; function InteractiveMap() { this.zoom = false; this.provincieHover = function(provincie) { if (! this.zoom) document.getElementById("kaartdiv").className = provincie; } this.showProvincie = function(provincie) { this.zoom = true; document.getElementById("kaart1").useMap = "#kaart_" + provincie; document.getElementById("kaartdiv").className = provincie + " detail"; } this.doMouse0ver = function(locatie) { $("#overlay").addClass("locatie" + locatie); } this.doMouseOut = function(locatie) { $("#overlay").removeClass("locatie" + locatie); } this.showFullMap = function() { document.getElementById("kaartdiv").className = document.getElementById("kaartdiv").className.replace(" detail", ""); ; document.getElementById("kaart1").useMap = "#kaart_nederland"; this.zoom = false; } } function getSortedAgenda(sortcolumn, sortdirection) { //alert(oFilterstatus.startdate + " - " + oFilterstatus.enddate + " - " + oFilterstatus.tagid + " - " + oFilterstatus.cityid + " - " + sortcolumn + " - " + sortdirection); getAgenda(oFilterstatus.startdate, oFilterstatus.enddate, oFilterstatus.tagid, oFilterstatus.cityid, sortcolumn, sortdirection); } function getAgenda(startdate, enddate, tagid, cityid, sortcolumn, sortdirection) { oFilterstatus.startdate = startdate; oFilterstatus.enddate = enddate; oFilterstatus.tagid = tagid; oFilterstatus.cityid = cityid; setButtonStyles(sortcolumn); var arMonths = ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"]; var arDays = ["zo","ma","di","wo","do","vr","za"] $("#agendalijst tbody").html("loading..."); //alert(type + " " + param); $.getJSON('/agenda.json.aspx', { "startdate": startdate, "enddate": enddate, "tagid": tagid, "cityid": cityid, "sortcolumn": sortcolumn, "sortdirection": sortdirection }, function(data) { var arAgenda = []; var l = data.length; for (var n=0; n" if (data[n].SROEventID == 0) { bestelButton ='' ; } var d = new Date(data[n].StartDateTime); var strAgenda = " \ \ \ \ " + arDays[d.getDay()] + " " + d.getDate() + " " + arMonths[d.getMonth()]+" \ \ " + d.getHours() + ":" + pad2(d.getMinutes()) + " \ \ \ \ " + data[n].CityName + "/ \ \ " + shorten(data[n].LocationName, 12) + " \ \ \ \ " + shorten(data[n].Groupnames, 35) + " \ \ \ \ \ " + shorten(data[n].ProductionTitle, 40) + " \ \ \ " +bestelButton +" \
\ "; arAgenda.push(strAgenda); } $("#agendalijst tbody").html(arAgenda.join("")); }); } function setButtonStyles(sortcolumn) { $(".sortorder").removeClass("active") $("#so_" + sortcolumn).addClass("active"); } function shorten(mystring, length) { if (mystring.length < length) { return mystring; } else { return mystring.substr(0,length) + "..."; } } // Accordeon // first=true; to open first box on load, first=false; to have them all closed var first = false; var colHeight = 0; var ocolHeight = 0; var boxHeight = 0; var curHeight = 0; var ocurHeight = 0; var obj; var objo; var oid = -1; var timer; var timer2; var cid; var allclosed = true; var imBusy = false; // functions that deal with opening a box function openbox(id) { if (imBusy == false) { imBusy = true; obj = faqAmount[id - 1]; boxHeight = faqItem[id - 1]; colHeight = qHeight[id - 1]; curHeight = colHeight; cid = id; // call to close open box after opening a new one if (id != oid && allclosed == false) { closeBox(oid); } else { imBusy = false; } if ((obj.offsetHeight - 1) <= colHeight) { allclosed = false; obj.firstChild.className += " qhover"; if (id == 1) { myMap.showFullMap(); }; if (id == 2) { showMonthButtons() }; if (id == 3) { $("#btngrpTags").html(makeButtons(null)); }; openAni(); } else { allclosed = true; objo = obj; ocolHeight = colHeight; closeBox(oid); } } } function openAni() { timer = setInterval("moveDown();", 5); } function moveDown() { if (curHeight < boxHeight) { curHeight = curHeight + 10; obj.style.height = curHeight + "px"; } else { clearInterval(timer); obj.style.height = boxHeight + "px"; oid = cid; } } // functions that deal with closing a box function closeBox(oid) { objo = faqAmount[oid - 1]; ocolHeight = qHeight[oid - 1]; ocurHeight = faqItem[oid - 1]; objo.firstChild.className = objo.firstChild.className.replace(new RegExp(" qhover\\b"), ""); closeAni(); } function closeAni() { timer2 = setInterval("moveUp();", 5); } function moveUp() { if (ocurHeight > ocolHeight) { ocurHeight = ocurHeight - 10; objo.style.height = ocurHeight + "px"; } else { clearInterval(timer2); objo.style.height = ocolHeight + "px"; imBusy = false; } } // get heights for each box both open(=faqItem) and closed(=qHeight), close all boxes and if required, open the first (var first=true;) or any specific box using #[number] in the url var faqItem = new Array(); var qHeight = new Array(); var faqAmount = new Array(); function boAccordeon() { if (document.getElementById('accordeon')) { document.getElementById('accordeon').onclick = function() { document.getElementById('blurme').focus(); } liList = document.getElementById('accordeon').getElementsByTagName("li"); var q; for (var i = 0 , q = liList.length; i < q; i++) { if (liList[i].parentNode.id == "accordeon") { faqAmount.push(liList[i]); } } var stopit = faqAmount.length; for (var i = 1; i <= stopit; i++) { if (i < stopit) faqItem.push(faqAmount[i - 1].offsetHeight); else faqItem.push(200); qHeight.push(faqAmount[i - 1].firstChild.offsetHeight); faqAmount[i - 1].nr = i; faqAmount[i - 1].firstChild.onclick = function() { openbox(this.parentNode.nr); $('a.question').toggleClass('active', false); } } for (var i = 1, q = faqItem.length; i <= q; i++) { faqAmount[i - 1].style.height = qHeight[(i - 1)] + "px"; } var loc=""+window.location+""; if (loc.indexOf("buurt")>=1) { openbox(1); } if (loc.indexOf("wanneer")>=1) { openbox(2); } if (loc.indexOf("smaak")>=1) { openbox(3); } //if (location.hash) { var id = location.hash; id = id.replace(/#/, ""); openbox(id); } //else if (first == true) { // openbox(1); //} } } // ontdek oude muziek var oTags = {}; var myMap = new InteractiveMap(); var tt = new Tooltips(); $(document).ready(function() { var flag = false; $.getJSON('/days.json.aspx', function(data) { var l = data.length; while (l--) { var d = new Date(data[l]); myDate.push({ "Date": pad2(d.getDate()) + "-" + pad2(d.getMonth() + 1) + "-" + d.getFullYear() }); } showCal(); }); $.getJSON('/months.json.aspx', function(data) { var arMonths = []; var l = data.length; while (l--) { arMonths.push(new Date(data[l])); } $("#btngrpMonths").html(makeMonthButtons(arMonths)); (flag == true) ? boAccordeon() : flag = true; }); $.getJSON('/tags.json.aspx', function(data) { oTags = data; $("#btngrpTags").html(makeButtons(null)); (flag == true) ? boAccordeon() : flag = true; }); }); function makeButtons(parentid) { var strButtons = ""; var p = null; var naam = ""; for (var n = 0; n < oTags.categories.length; n++) { if (oTags.categories[n].id == parentid) { p = n; naam = oTags.categories[n].naam; } } if (p != null) { strButtons += "

" + naam + "

"; for (var n = 0; n < oTags.categories[p].tags.length; n++) { strButtons += "" + oTags.categories[p].tags[n].buttontekst + ""; } } else { for (var n = 0; n < oTags.categories.length; n++) { strButtons += "" + oTags.categories[n].buttontekst + ""; } } return (strButtons); } function makeMonthButtons(arMonths) { var now = new Date(); var arMonthNames = ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"]; var myMonth = now.getMonth(); var myYear = now.getFullYear(); var strButtons = ""; for (var n = 0; n < 15; n++) { var status = ((n == 0) ? " active" : " " + getButtonStatus(arMonths, myMonth, myYear)); var strOnClick = (status != " inactive") ? "onclick='showCalendar(" + (myMonth + 1) + "," + myYear + ")'" : ""; strButtons += "" + arMonthNames[myMonth] + "" + myYear + ""; if (myMonth++ > 10) { myMonth = 0; myYear++; } } return (strButtons); } function getButtonStatus(arMonths, m, y) { /* var l = faqItem.length; for (var n = 0; n < l; n++) { if (m == arMonths[n].getMonth() && y == arMonths[n].getFullYear()) { return (""); break; } } return ("inactive"); */ for(var n = 0; n < arMonths.length; n++) { if(""+arMonths[n].getMonth() == ""+m && ""+arMonths[n].getFullYear() == ""+y) { return ("active"); } } return ("inactive"); } function makeTagButtons(parentid) { $("#btngrpTags").html(makeButtons(parentid)); } function showCalendar(m, y) { var d = new Date(y + "/" + m + "/1"); //alert(d.valueOf()); A_TCALS['0'].f_update(d.valueOf()); $("#btngrpMonths").hide(); $("#bocal").show(); } function showMonthButtons() { $("#bocal").hide(); $("#btngrpMonths").show(); } function pad2(number) { return (number < 10 ? '0' : '') + number; }