<script>
    var themeHasJQuery = !!window.jQuery;
</script>
<?php $_helper = Mage::registry('templateHelper') ?>
<script src="<?php
    echo $this->getSkinUrl('jquery.js') . '?version=' . ($_helper ? $_helper->getThemeVersion() : '')
?>"></script>
<script>
    window.designer = {};
    window.@jQuery = jQuery.noConflict(themeHasJQuery);
</script>