﻿jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') {
        options = options || {}; if (value === null) { value = ''; options.expires = -1; }
        var expires = ''; if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date; if (typeof options.expires == 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); } else { date = options.expires; }
            expires = '; expires=' + date.toUTCString();
        }
        var path = options.path ? '; path=' + (options.path) : ''; var domain = options.domain ? '; domain=' + (options.domain) : ''; var secure = options.secure ? '; secure' : ''; document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else {
        var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } }
        return cookieValue;
    }
};
; (function($) {
    $.fn.loadWithoutCaching = function(url, data, callback) {
        var safe = url; var timestamp = new Date().getTime(); if (safe.indexOf('?') > 0) { safe += '&'; } else { safe += '?'; }
        safe += 'timestamp=' + timestamp; $(this).load(safe, data, callback);
    }
    var xhr; $.fn.loadPage = function(nodeUrl, url) {
        var contentId = $(this); contentId.html(''); $('<div id="load" class="loader">Bezig met laden</div>').insertAfter(contentId).show(); if (xhr !== undefined) { xhr.abort(); }
        while (url.indexOf('+') >= 0) { url = url.replace('+', "%20"); }
        xhr = $.ajax({ type: 'POST', url: nodeUrl + '&' + url, beforeSend: function(xhr) { xhr.setRequestHeader("X-MicrosoftAjax", "Delta=true"); }, success: function(data, textStatus, XMLHttpRequest) { if (xhr.status == 200 && !xhr.responseText.match(/pageRedirect/)) { if (textStatus == 'success') { $('#load').remove(); contentId.html(data).fadeIn(); if (typeof BindEditableContent == 'function') { BindEditableContent(); } } else if (textStatus == 'error') { $('#load').remove(); contentId.html('<div class="text">Er is een fout opgetreden tijdens het laden van de pagina.</div>'); } } else if (xhr.responseText.match(/pageRedirect/)) { $('#load').remove(); contentId.html('<div class="text"><p>Helaas de pagina kon niet worden geladen uw sessie is verlopen, u moet opnieuw inloggen over enkele seconden wordt u terug geleid naar de inlog pagina.</p></div>').delay(2500).queue(function() { location.reload(); ; }); } }, error: function(xhr, ajaxOptions, thrownError) { $('#load').remove(); contentId.html('<div class="text"><p>Helaas de pagina kon niet worden geladen, neem contact op als dit probleem zich blijft voortdoen.</p><p>De pagina geeft de volgende foutmelding status: ' + xhr.status + '</p></div>'); } });
    }
    var multiple; $.fn.loadMultiplePage = function(nodeUrl, url) {
        var contentId = $(this); contentId.html(''); $('<div id="multipleLoad" class="loader">Bezig met laden</div>').insertAfter(contentId).show(); if (multiple !== undefined) { multiple.abort(); }
        while (url.indexOf('+') >= 0) { url = url.replace('+', "%20"); }
        multiple = $.ajax({ type: 'POST', url: nodeUrl + '&' + url, success: function(data, textStatus, XMLHttpRequest) { if (textStatus == 'success') { $('#multipleLoad').remove(); contentId.html(data).fadeIn(); if (typeof BindEditableContent == 'function') { BindEditableContent(); } } else if (textStatus == 'error') { $('#multipleLoad').remove(); contentId.html('<div class="text">Er is een fout opgetreden tijdens het laden van de pagina.</div>'); } }, error: function(xhr, ajaxOptions, thrownError) { $('#multipleLoad').remove(); contentId.html('<div class="text"><p>Helaas de pagina kon niet worden geladen, neem contact op als dit probleem zich blijft voortdoen.</p><p>De pagina geeft de volgende foutmelding status: ' + xhr.status + '</p></div>'); } });
    }
})(jQuery);$(function() {
var valueUser = $.trim($('.label:even', '#logon_buildingblock').text()); var valuePassword = $.trim($('.label:odd', '#logon_buildingblock').text()); var valueSearch = $.trim($('.fakeLabels', '#search').text()); if (wms_editor_live_data) { $('input#username').val(valueUser); $('input#password').after('<span class="fakeLabel">' + valuePassword + '</span>'); $('input', '#search').val(valueSearch); $('#username').focus(function() { if ($(this).val() == valueUser) { $(this).val(''); } }); $('input#username').blur(function() { if ($(this).val() == '') { $(this).val(valueUser); } }); $('#password').focus(function() { $('.fakeLabel').hide(); }); $('input#password').blur(function() { if ($(this).val() == '') { $('.fakeLabel').show(); } }); $('.fakeLabel').click(function() { $('.fakeLabel').hide(); $('input#password').focus(); }); $('input', '#search').focus(function() { if ($(this).val() == valueSearch) { $(this).val(''); } }); $('input', '#search').blur(function() { if ($(this).val() == '') { $(this).val(valueSearch); } }); } else { $('.label', '#logon_buildingblock').css('display','block'); $('.fakeLabels', '#search').css('display','block'); }
    $('#large').click(function() { $.cookie('fontSize', null); $.cookie('fontSize', 'large', { path: '/' }); $('body').css('font-size', '67.5%'); $('li a', '#topNav').removeClass('active'); $(this).addClass('active'); }); $('#normal').click(function() { $.cookie('fontSize', null); $.cookie('fontSize', 'normal', { path: '/' }); $('body').css('font-size', '62.5%'); $('li a', '#topNav').removeClass('active'); $(this).addClass('active'); }); $('#small').click(function() { $.cookie('fontSize', null); $.cookie('fontSize', 'small', { path: '/' }); $('body').css('font-size', '58.5%'); $('li a', '#topNav').removeClass('active'); $(this).addClass('active'); });
});
