Use following code to turn off/remove Mootools in Joomla template on frontend.
01.
$user
=& JFactory::getUser();
02.
if
(
$user
->get(
'guest'
) == 1) {
03.
$search
=
array
(
'mootools'
,
'caption.js'
);
04.
// remove the js files
05.
foreach
(
$this
->_scripts
as
$key
=>
$script
) {
06.
foreach
(
$search
as
$findme
) {
07.
if
(
stristr
(
$key
,
$findme
) !== false) {
08.
unset(
$this
->_scripts[
$key
]);
09.
}
10.
}
11.
}
12.
}