/**
 * Horde JavaScript Detection.
 *
 * This script will only be run if javascript has been disabled in the session
 * but then has been re-enabled in the browser. It will call the toggle_js.php
 * script to remove the session setting and return back to the originating URL.
 *
 * $Horde: horde/templates/javascript/test_javascript.js,v 1.2.2.1 2005/10/18 11:34:07 jan Exp $
 *
 * See the enclosed file COPYING for license information (LGPL). If you did not
 * receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 */

/* Set the URL for the script to toggle the session settings. */
var url = '<?php echo Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/toggle_js.php', true), 'value', '1'); ?>';

/* Add the originating URL, less the http://<domain> value. */
url += '&url=' + encodeURIComponent(location.href.match(/http:\/\/.*?(\/.*)/)[1]);

location.replace(url);
