/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * checkCookies.js
 * 
 * check cookies
 * 
 * LICENSE: This source file is subject to version 1.0 of the OpenFlyers license
 * that is available through the world-wide-web at the following URI:
 * http://www.openflyers.com/license/semifreelicense1_0.txt. If you did not
 * receive a copy of the OpenFlyers License and are unable to obtain it through
 * the web, please send a note to contact@openflyers.com so we can mail you a
 * copy immediately.
 * 
 * @category Javascript
 * @package OpenFlyers
 * @author Christophe LARATTE <christophe.laratte@openflyers.com>
 * @copyright 2008 OPENFLYERS S.A.R.L. <contact@openflyers.com>
 * @link http://www.openflyers.com
 * @since Mon May 21 2012
 */

function checkCookies() {
    // @link https://work.openflyers.com/OF4-Cookie#OFDummyCookie
    document.cookie = 'OFDummyCookie';
    var cookieEnabled = (document.cookie.indexOf('OFDummyCookie') != -1) ? true
            : false;

    if (!cookieEnabled) {
        alertBox(translationTag['COOKIES_NOT_ALLOWED']);
    }
}
$(document).ready(checkCookies);