Double image swap on mouse-over HELP

Have a look at my new website www.wordsandpeople.com an ERROR MESSAGE appears in the browser screen. How can I correct it? I think it is because of the Java Script code for my double image swaps when the mouse is over any of the images of strawberrys.
KapowAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cheekycjCommented:
I looked at the code and I didn't see the function MM_preloadImages('but1_up.jpg','text1.gif','text2.gif','text3.gif','text4.gif') defined anywhere?

CJ
0
KapowAuthor Commented:
My code has the following: <body onLoad="MM_preloadImages('but1_up.jpg','text1.gif','text2.gif','text3.gif','text4.gif')" bgcolor="#FFFFFF" text="#183888" link="#183888" vlink="#183888" alink="#183888">
Is that what your talking about? or are you saying that something else is missing???
0
cheekycjCommented:
I was just wondering where that function was defined, I didn't see it in the code.

CJ
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

mgfranzCommented:
Look at your OnMouse calls, whats wrong with this line?

onMouseOut="di20('strawb1','but1_dwn.jpg');di20('textBlnk.gif','textBlnk.gif');"  onMouseOver="di20('strawb1','but1_up.jpg');di20('textBlnk.gif','text1.gif');

You are passing two sets of values to di20, try this;

onMouseOut="di20('strawb1','but1_dwn.jpg');"  onMouseOver="di20('strawb1','but1_up.jpg');"
0
KapowAuthor Commented:
To mqfranz: I tried it and lost the 2nd image swap.  What should I do to my code so that both images swap on mouse over without an ERROR MESSAGE appearing in the browser?
0
mgfranzCommented:
I have fixed your page, but I need you to send me the but1_up.jpg file for verification.  My email is mark.franz@lpl.com.  There were a couple things that needed modifying.

Mark
0
mgfranzCommented:
Here ya go Andy!  Let me know if you have any problems;

Mark

<html>
<head>
<title>WordsAndPeople - WebSites for the new Milleneum</title>

<SCRIPT LANGUAGE="JavaScript">
<!--
ImageSrc = new Array ("but1_up.jpg","text1.gif","text2.gif","text3.gif","text4.gif");
ImageList = new Array ();

for (counter in ImageSrc) {
ImageList[counter] = new Image();
ImageList[counter].src =
ImageSrc[counter];
}
// -->
</SCRIPT>

</head>
<body bgcolor="#FFFFFF" text="#183888" link="#183888" vlink="#183888" alink="#183888">
<table width="100%" border="0" cellspacing="3" cellpadding="0" height="100%">
  <tr>
    <td colspan="2">
      <div align="right"><img width="250" height="91" name="Website_logo" alt="Words &amp; People" border="0" src="images/My_Logo.gif"></div>
    </td>
    <td colspan="2">
      <div align="center"><img width="113" height="118" name="internet_site" alt="Web Sites" src="images/PCshort.gif"></div>
    </td>
  </tr>
  <tr>
    <td colspan="4">
      <div align="center"><applet code="RunningText.class" codebase = "html/" width="400" height="50" name="website" alt="Website Creation for the new Millennium">
          <param name=TEXT value="             Website Creation for the new Millennium">
          <param name=FONT value="Helvetica">
          <param name=FONTSTYLE  value=1>
          <param name=FONTSIZE value=20>
          <param name=FGCOLOR  value="000099">
          <param name=BGCOLOR value="ffffff">
          <param name=WIDTH value=600>
          <param name=HEIGHT value=50>
          <param name=SHADOW value=0>
        </applet></div>
    </td>
  </tr>
  <tr>
    <td colspan="4">
      <div align="center"><img name="textBlnk.gif" src="textBlnk.gif" border="0" usemap="#textBlnk.gif"></div>
    </td>
  </tr>
  <tr valign="top">
    <td width="25%">
      <div align="center"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif"><a href="html/sites.html" onMouseOut="di20('strawb1','but1_dwn.jpg');di21('textBlnk.gif','textBlnk.gif');"  onMouseOver="di20('strawb1','but1_up.jpg');di21('textBlnk.gif','text1.gif');" target="_self" ><img name="strawb1" src="but1_dwn.jpg" border="0"><br>
        All About WebSites</a></font></b></font></div>
    </td>
    <td width="25%">
      <div align="center"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif"><a href="http://www.coachinghealth.com/" onMouseOut="di20('strawb2','but1_dwn.jpg');di21('textBlnk.gif','textBlnk.gif');"  onMouseOver="di20('strawb2','but1_up.jpg');di21('textBlnk.gif','text2.gif');" target="_blank" ><img name="strawb2" src="but1_dwn.jpg" border="0"><br>
        Example Site</a></font></b></font></div>
    </td>
    <td width="25%">
      <div align="center"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif"><a href="html/costs.htm" onMouseOut="di20('strawb3','but1_dwn.jpg');di21('textBlnk.gif','textBlnk.gif');"  onMouseOver="di20('strawb3','but1_up.jpg');di21('textBlnk.gif','text3.gif');" target="_self" ><img name="strawb3" src="but1_dwn.jpg" border="0"></a><br>
        <a href="html/costs.htm" target="_self"><font color="#183888">The Cost</font>
        </a> </font></b></font></div>
    </td>
    <td width="25%">
      <div align="center"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif"><a href="html/infoform.htm" onMouseOut="di20('strawb4','but1_dwn.jpg');di21('textBlnk.gif','textBlnk.gif');"  onMouseOver="di20('strawb4','but1_up.jpg');di21('textBlnk.gif','text4.gif');" target="_self" ><img name="strawb4" src="but1_dwn.jpg" border="0"><br>
        Apply or Enquire</a></font></b></font></div>
    </td>
  </tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="text1.gif" width="1" height="1"></td>
    <td><img src="text2.gif" width="1" height="1"></td>
  </tr>
  <tr>
    <td><img src="text3.gif" width="1" height="1"></td>
    <td><img src="text4.gif" width="1" height="1"></td>
  </tr>
</table>
<p>
  <script language="JavaScript">
<!-- hide this script from non-javascript-enabled browsers

if (document.images) {
strawb1_F1 = new Image(136,44); strawb1_F1.src = "but1_dwn.jpg";
strawb1_F2 = new Image(136,44); strawb1_F2.src = "but1_up.jpg";
textBlnk_F1 = new Image(73,82); textBlnk_F1.src = "textBlnk.gif";
text1 = new Image(10,10); text1.src = "text1.gif";
}

/* Function that swaps images. */

function di20(id, newSrc) {
    var theImage = FWFindImage(document, id, 0);
    if (theImage) {
        theImage.src = newSrc;
    }
}

function di21(id, newSrc) {
    var theImage = FWFindImage(document, id, 0);
    if (theImage) {
        theImage.src = newSrc;
    }
}

/* Functions that track and set toggle group button states. */

function FWFindImage(doc, name, j) {
    var theImage = false;
    if (doc.images) {
        theImage = doc.images[name];
    }
    if (theImage) {
        return theImage;
    }
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theImage = FWFindImage(doc.layers[j].document, name, 0);
            if (theImage) {
                return (theImage);
            }
        }
    }
    return (false);
}

// stop hiding -->
</script>
</p>
</body>
</html>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KapowAuthor Commented:
EXCELLENT !!!
That seems to do it.  I will upload it to my host this weekend and test it once more, and send you those 100 well earned points.

I was hoping to understand how to fix the problem myself. Did you write the code manually or use an authoring tool?
Where do you suggest I start so that I can learn to sort out that kind of problem?

Many thanks - Andy
0
KapowAuthor Commented:
Thankyou Mark
www.wordsandpeople.com is now error free. Thankyou

Do you authoring tools you mentioned create Java Script for you or is that all in your head?

0
mgfranzCommented:
Oh my.... do I store Javascript in my head?  No, it is mostly just regular scripting, it's knowing the objects and statements that work with JS as well as VBS that I keep upstairs... :-)

Although, there are a few authoring tools that create JS, Adobe ImageReady 2.0 is one that I have seen create JS, as well as DreamWeaver and DrumBeat, the later two are relatively expensive and difficult to learn for the beginner, check out Homesite 4.5 and CoffeCup 8.0 for nice editors.  CoffeeCup includes some nice JS script with the code.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.