None of that is PHP code. The pages linked to in the last script are PHP pages though, but that may or may not be part of the problem I think you are asking about. Probably not.
The last script is from:
http://www.dynamicdrive.com/dynamici.../dowiframe.htm
and is lacking its script credit.
Please restore the credit first.
Anyways, the real problem appears to be with the first script not accepting more than two times/images, right?
You could use this script instead of the pixTimeChange() function. If you do, get rid of it and all references to it from your page:
Keep a backup of the page first though, just in case.
Code:
<script type="text/javascript">
// Time of Day Images Script (c)2012 John Davenport Scheuer
// as first seen in http://www.dynamicdrive.com/forums/
// username: jscheuer1 - This Notice Must Remain for Legal Use
/* Simply place this script where you want your time of day image to appear.
* Edit image properties as required.
* criteria start and end may be set in terms of hours(h) and minutes(m), or just hours(h) - see below for examples.
* Use hours in 24hr notatation
*/
;(function(){
var ims = [ //set in order from the earliest to the latest with the last ('default') being shown if none of the other criteria are met
{name: 'Morning', // name for this image for use in the alt attribute
criteria: {start: '7h', end: '12h'},// morning is 7am or later and before noon
image: 'morning.jpg' // source for this image for use as the src attribute
},
{name: 'Afternoon',
criteria: {start: '12h', end: '18h30m'}, // afternoon is noon or later and before 6:30pm
image: 'afternoon.jpg'
},
{name: 'Evening',
criteria: 'default', // all other times show evening
image: 'evening.jpg'
} // <-- no comma after last ims object !IMPORTANT! for some browsers, as ims objects may be added or taken away
//////////////////// No Need To Edit Below Here ////////////////////
], d = new Date(), m = d.getHours() * 60 + d.getMinutes(), i = 0, im, stime, etime;
for(i; i < ims.length; ++i){
if(typeof ims[i].criteria === 'object'){
stime = ims[i].criteria.start.split(/\D/);
etime = ims[i].criteria.end.split(/\D/);
stime = stime.length > 1? stime[0] * 60 + +stime[1] : stime[0] * 60;
etime = etime.length > 1? etime[0] * 60 + +etime[1] : etime[0] * 60;
if(m >= stime && m < etime){
im = ims[i];
break;
}
}
im = ims[i];
}
document.write('<img src="' + im.image + '" alt="' + im.name + ' Image" title="">');
})();
</script>
In any case though, the code you posted for the load function is incomplete. The first script could be fixed up independently to accept multiple times/pics, but that's no guarantee it would work with the rest of the page. And the substitute script I offered is already much easier to work with if you want to edit in more images and times and/or change the images or criteria for the existing ones. The iframe script doesn't appear to really work with the time/image script, perhaps just coexists with it via the Multiple onload function, that's not clear because we can't see all of that in your post. Give the substitute script a go. Place it in the body where you want the image to appear. Don't forget to get rid of the pixTimeChange() function and all references to it. Keep a backup of the page first though, just in case.
If you want more help:
Please post a link to the page on your site that contains the problematic code so we can check it out.
Bookmarks