#!/bin/sh
#
# open URL in new Mozilla process if there isn't one,
# otherwise open URL in a new window of existing Mozilla process.
#
# Greg Hammett: This was needed to get RealPlayer10 to interact
# correctly with Mozilla.

MBIN=/usr/local/bin  # location of original mozilla command
$MBIN/mozilla -remote 'ping()' &> /dev/null
if [ $? -eq 0 ]; then
  # open a new window
  # mozilla -remote "openURL(www.google.com, new-window)" &
  $MBIN/mozilla -remote "openURL($@,new-window)" &
else
  #open new instance
  $MBIN/mozilla $@ &
fi
