<script>
    var themeHasJQuery = !!window.jQuery;
</script>
<script type="text/javascript" src="<?php echo $base_path . '/js/jquery.js' . $version; ?>"></script>
<script>
    window.@jQuery = jQuery.noConflict(themeHasJQuery);
</script>