# Im.swf won't open on page load

**URL:** <https://forum.kirupa.com/t/im-swf-wont-open-on-page-load/201759>\
**Category:** Uncategorized\
**Created:** [September 24, 2006, 9:54pm UTC](https://forum.kirupa.com/t/im-swf-wont-open-on-page-load/201759 "2006-09-24T21:54:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![theghini](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@theghini](https://forum.kirupa.com/u/theghini)\
**Post date:** [September 24, 2006, 9:54pm UTC](https://forum.kirupa.com/t/im-swf-wont-open-on-page-load/201759/1 "2006-09-24T21:54:38Z")

</div>

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 /\>”: "&nbsp;|&nbsp;“;  
$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;  
}  
}
