﻿/**
 * This file includes common cms helper methods.
 */

/**
 * Logout method from nice extranets. Removes the auth-cookie and reloads the page, or, if specified, redirects to @param url.
 */
function logout(url) {
    document.cookie = 'nice_auth=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/';
    document.cookie = 'nice_client_id=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/';
    if (url) {
        window.location = url;
    } else {
        window.location.reload();
    }
}

function login(url) {
    window.location = url + '#?username=' + document.getElementById('username').value + '&password=' + document.getElementById('password').value;
    return false;
}

