I second this request.
Anwers elsewhere in the forum generally run along the lines of "don't load javascript from site template, then", which isn't enormously helpful and rather misses the point.
I've come up with a quick and dirty hack to get around the issue for the time being :-
File: $your_joomla_directory/administrator/components/com_virtuemart/helpers/config.php
Change part of public static function js() ...
line: 1012 (in VM 2.0.22)
from
$document->addScript( $file );
to
$document->addScript( $file, $type="text/javascript" , $defer=true );
This adds defer="defer" to the <script> element that vmJsApi::js() loads into <head>
i.e.
from
<script src="/joomla/components/com_virtuemart/assets/js/fancybox/jquery.fancybox-1.3.4.pack.js" type="text/javascript"></script>
to
<script src="/joomla/components/com_virtuemart/assets/js/fancybox/jquery.fancybox-1.3.4.pack.js" type="text/javascript" defer="defer"></script>
It doesn't really address the real load-order issue properly, but at least it gets the VM script's activation out of the way till everything that should be loaded before it has done it's stuff.
--
kurai