Im.swf won't open on page load

I need to change how my [COLOR=red]im.swf[/COLOR] loads. As you can see there is a [COLOR=red]onClick="javascript:[/COLOR] that allows you to open the [COLOR=red]im.swf[/COLOR] but I need it changed to onload. Please Help! Here is my code:

  • Return code for IM window
    */
    function RetIM()
    {
    global $site;
    global $im_width;
    global $im_input;
    global $im_height;
    global $im_input_height;
    global $boxbg;
    global $tmpl;
    $ID = (int)$_COOKIE[‘memberID’];
    $im_width = strstr($im_width,’%’) ? $im_width : $im_width-1;
    $im_win = $_COOKIE[‘im_win’] ? $_COOKIE[‘im_win’] : ‘none’;
    $add = ($tmpl == ‘rec’ || $tmpl == ‘rem’ || $tmpl == ‘rej’ || $tmpl == ‘ae9’) ? ‘<td width=“150” height=“35”>’ . _t("_IM title") . ‘</td>’ : “”;
    $add1 = ($tmpl == ‘rec’ || $tmpl == ‘rem’ || $tmpl == ‘rej’ || $tmpl == ‘ae9’) ? ‘colspan=“2”’ : “”;
    $add3 = ($tmpl == ‘g4’ || $tmpl == ‘act’) ? “<br />”: " | “;
    $s00 = _t(”_Open in new window");
    $s01 = _t("_Show");
    $s02 = _t("_Hide");

if ($search_hide)
{
$div_hide = “none”;
$div_show = “inline”;
}
else
{
$div_hide = “inline”;
$div_show = “none”;
}
$ret = “<div align=right>”;
$ret .= “<div id=“div_hide_$name2” name=“div_hide_$name2” style=“display:$div_hide”>”;
$ret .= “<a href=“javascript: void(0)” onClick=“javascript: ShowHideHide(document.getElementById(‘div_show_$name2’),document.getElementById(‘table_hide_$name2’),document.getElementById(‘div_hide_$name2’));”>”.t(“Hide")."</a>";
$ret .= “</div>”;
$ret .= "<div id="div_show
$name2” name="div_show
$name2" style=“display:$div_show”>";
$ret .= “<a href=“javascript: void(0)” onClick=“javascript: ShowShowHide(document.getElementById(‘table_hide_$name2’),document.getElementById(‘div_hide_$name2’),document.getElementById(‘div_show_$name2’));”>”._t("_Show")."</a>";
$ret .= “</div>”;
$ret .= “</div>”;

$out .= <<<EOF
<script langiage=“javascript”>
<!–
function imShowHide()
{
var im_win = document.getElementById(‘im_win’);
var show = document.getElementById(‘show’);
var hide = document.getElementById(‘hide’);
if (im_win.style.display == ‘none’)
{
document.cookie = “im_win=inline;”;
im_win.style.display = ‘inline’;
show.style.display= ‘none’;
hide.style.display = ‘inline’;
}
else
{
document.cookie = “im_win=none;”;
im_win.style.display = ‘none’;
show.style.display= ‘inline’;
hide.style.display = ‘none’;
}
}
–>
</script>
<table name=“zzz” width="$im_width" cellspacing=“0” cellpadding=“0” class=“text” border=“0”>
<tr>
$add
<td width="$im_width" bgcolor="$boxbg" align=center height=20>
<a target="_blank" href="{$site[‘url’]}im.php">$s00</a>$add3<a href=“javascript: void(0);” onClick=“javascript: imShowHide();”><div id=“show” style=“display:inline”>$s01</div><div id=“hide” style=“display:none”>$s02</div></a>
</td>
</tr>
<tr>
<td width=$im_width $add1>
<div name=“im_win” id=“im_win” [COLOR=red]style=“display: $im_win;”>
[/COLOR]<IFRAME ID=“IFrameIMFL” name=“IFrameIMFL” FRAMEBORDER=“0” SCROLLING=“NO” HEIGHT="$im_height" WIDTH="$im_width" SRC="{$site[‘url’]}im.php">
</IFRAME>
</div>
</td>
</tr>
EOF;
$out .= “</table>”;
$im_width = strstr($im_width,’%’) ? $im_width : $im_width+1;
if ($tmpl == ‘act’)
{
return DesignBoxContent ( _t("_IM title"), $im_width, $out, ‘’, ‘’, 2 );
}
else if ($tmpl == ‘frt’ || $tmpl == ‘hip’)
{
return DesignBoxContent ( _t("_IM title"), $im_width, $out );
}
else
{
return $out;
}
}