// Checks if parent is GoAnywhereWebClientContainer then change its location to the current page location
function checkForContainer(){

    if(window.parent != null && window.parent.location != this.location)
    {
        if(window.parent.appContainer == "GoAnywhereWebClientContainer")
        {
            window.parent.location=this.location;
        }
    }

}

function getBotProtectionRequestHeaders() {
    // script loaded in the index.html of the respective apps will add a method called um_collect that we will want to call
    // in order to get bot protection headers, which we will pass on all API calls and will be evaluated by our CDN
    if (window.um_collect() && typeof window.um_collect === 'function') {
        return window.um_collect();
    } else {
        return { 'X-hybrid': 'false' };
    }
}

$.getScript('/AQPcU0JLYlniXb0s.js');

$(document).ready(function() {
    $( "form" ).on( "submit", function( event ) {
        var headers = getBotProtectionRequestHeaders();
        PrimeFaces.addSubmitParam(this.id, headers);
    });
});