var xmlreqs = new Array(); var xmlreqCount = 0; var ajaxWaitingElement; var ajaxWaitType = 'prefix'; function ajax_do (element, functie, params, object, waitingAnimation, doUrchinTracker) { if(waitingAnimation) { if(waitingAnimation == true) { startWaiting(element); } else { startWaiting(waitingAnimation, true); } } else { startWaiting(); } var query = 'object=' + object + '&element=' + element + '&functie=' + functie + '&' + params; var url = "/_BWF/ajax/ajax.php"; doXmlHttpRequest(url, query, doUrchinTracker, element); } function ajax_do_ssl (element, functie, params, object, waitingAnimation, doUrchinTracker) { if(waitingAnimation) { if(waitingAnimation == true) { startWaiting(element); } else { startWaiting(waitingAnimation, true); } } else { startWaiting(); } var query = 'object=' + object + '&element=' + element + '&functie=' + functie + '&' + params; var url = "/_BWF/ajax/ajax.php"; doXmlHttpRequest(url, query, doUrchinTracker, element); } /* Do an actual ajax request (used by ajax_do) functions manages an array of xmlHtpp objects, which is needed when multiple ajax requests overlap the xmlHtpp objects in array are recycled after they have returned their ajax data (so size of array will be max simultanious ajax calls since page refresh) */ function doXmlHttpRequest(url, query, doUrchinTracker, element) { var pos = -1; for (var i=0; i

" + document.getElementById(waitingElement).innerHTML; } else { document.getElementById(waitingElement).innerHTML = "

"; } } if(waitingElementSeperate) { ajaxWaitingElement = waitingElement; } } function finishWaiting(){ document.body.className = 'readyAjax'; if(ajaxWaitingElement && ajaxWaitingElement != '') { document.getElementById(ajaxWaitingElement).innerHTML = ""; ajaxWaitingElement = null; } } /* will parse part after hash in URL. no input required (for ajax deeplink/bookmark support) */ function parseHashURL() { if(location.hash.slice(1)!='') { return parseHashString(location.hash.slice(1)); } else { return false; } } /* will parse a string (assumed to be part after hash of a URL) and execute the command (e.g. for ajax back button and deeplink/bookmark support). */ function parseHashString(string) { if(string && string != '') { var data = string.split('/'); /* data[0] will always be '' because string begins with / */ if(data.length == 2) { doHashString(data[1]); return true; } if(data.length == 3) { doHashString(data[1], data[2]); return true; } if(data.length == 4) { doHashString(data[1], data[2], data[3]); return true; } if(data.length == 5) { doHashString(data[1], data[2], data[3], data[4]); return true; } } return false; } /* based on input a string is added after the current URL with hash */ function addHistoryEntry(p1, p2, p3, p4) { if(window.dhtmlHistory) { var string = '/'+encodeURIComponent(decodeURIComponent(p1)); if(p2) { string = string + '/'+encodeURIComponent(decodeURIComponent(p2)); } if(p3) { string = string + '/'+encodeURIComponent(decodeURIComponent(p3)); } if(p4) { string = string + '/'+encodeURIComponent(decodeURIComponent(p4)); } dhtmlHistory.add(string); } } /* only if RSH is included window.dhtmlHistory exists */ if(window.dhtmlHistory) { /* what will be defined here is what is executed in case back button is pressed, string will be the string defined in addHistoryEntry (that what is behind hash in URL) */ var rshListener = function(string, historyData) { parseHashString(string); }; window.dhtmlHistory.create({ toJSON: function(o) { return $.toJSON(o); }, fromJSON: function(s) { return $.evalJSON(s); } }); window.onload = function(){ window.dhtmlHistory.initialize(); window.dhtmlHistory.addListener(rshListener); }; }