Copy this to your theme's theme.php file:
/******************************************************************************
** Section <<<theme_javascript_head>>> - START
******************************************************************************/
// Function for the JavaScript inside the <head>-section
function theme_javascript_head()
{
global $JS, $LINEBREAK;
$return = '';
// Check if we have any variables being set using set_js_vars function
if (!empty($JS['vars'])) {
// Convert the $JS['vars'] array to json object string
$json_vars = json_encode($JS['vars']);
// Output the json object
$return = <<< EOT
<script type="text/javascript">
/* <![CDATA[ */
var js_vars = $json_vars;
/* ]]> */
</script>
EOT;
}
// Check if we have any js includes
if (!empty($JS['includes'])) {
// Bring the jquery core library to the very top of the list
if (in_array('js/jquery-1.3.2.js', $JS['includes']) == TRUE) {
$key = array_search('js/jquery-1.3.2.js', $JS['includes']);
unset($JS['includes'][$key]);
array_unshift($JS['includes'], 'js/jquery-1.3.2.js');
}
$JS['includes'] = CPGPluginAPI::filter('javascript_includes',$JS['includes']);
// Include all the files which were set using js_include() function
foreach ($JS['includes'] as $js_file) {
$return .= js_include($js_file, true) . $LINEBREAK;
}
}
// Disable right mouse button (context menu)
global $album;
if ($album == 2) {
$return .= <<< EOT
<script type="text/javascript">$(document).ready(function(){
document.oncontextmenu = function() {return false;};
$(document).mousedown(function(e){
if( e.button == 2 ) {
return false;
}
return true;
});
});
</script>
EOT;
}
return $return;
}
/******************************************************************************
** Section <<<theme_javascript_head>>> - END
******************************************************************************/