<?php
header('Content-type: application/javascript');

echo "var server = '" . $this->serverUrl() . $this->baseUrl('') . "';\n\n";

require_once(APPLICATION_PATH . '/../public/js/jquery-1.6.min.js');
require_once(APPLICATION_PATH . '/../public/js/both.js');
?>
/*global $, document, injectStatus */

$(document).ready(function()
{
	$("head").append('<link href="' + server + 'css/both.css" media="screen" rel="stylesheet" type="text/css" />');
	mqueue.monitorLinks(server);
});

/*global $, document, injectStatus */
(function(){
	<?php
	header('Content-type: application/javascript');
	require_once(APPLICATION_PATH . '/../public/js/jquery-1.6.min.js');
	?>
	jQuery.noConflict()(function(){
		var server = '<?php echo $this->serverUrl() . $this->baseUrl('') ?>';
		<?php require_once(APPLICATION_PATH . '/../public/js/both.js'); ?>

		$(document).ready(function()
		{
			$("head").append('<link href="' + server + 'css/both.css" media="screen" rel="stylesheet" type="text/css" />');
			mqueue.monitorLinks(server);
		});
	});
})();

Resolve JavaScripts conflicts with remote sites.
Resolve JavaScripts conflicts with remote sites.

Reddit.com comments were not collapsable and imdb.com "watch trailer" button did not work.
The use of jQuery.noConflict and anonymous function allows us to isolate our JS from theirs, thus avoiding conflicts.
