Basically, you need to modify the VIEW CART button code to enable a callback function after the cart renders. Then in the function that gets called, you can check for the variable set by the cart and take user to a URL of your choice or do anything else you want to do.
So, replace the JS in your VIEW CART code with -
<script language="javascript" type="text/javascript">
<!--
function EJEJC_lc(th) { return false; }
function EJEJC_config() {
EJEJC_POSTCALL=true;
}
function EJEJC_shown() {
if (EJEJC_STATUS=='outofstock') {
// take the action you need
}
}
// -->
</script>
<script type="text/javascript" src="
http://www.e-junkie.com/ecom/box.js"></script>