Are you sure you have OS 9.1? Your last post made it sound like you were running system 7. If that is true, you are sporting a performa, not an imac. If it is an imac, does it have a tray to put cd's in? If that is so, you can only go to 10.3.
To do any OSX upgrade you will need to buy 2 128mb sticks of ram at least. Depending on what model you have (tray or slot), you should be able to do this for $15 slot or 20-25 tray. The next step is to find another mac person with an OSX cd.
Also at the extreme least get 10.2. Shoot for panther 10.3. Even with a 266 G3. Firefox will work fine. (youtube will be disappointing even if you right-click>quality>low)
If you really just have a performa that someone painted, check out system 7 today.