I'm trying to get some javascript working, unfortunately I didn't write it - and the person who did is on holiday!
This seems to work on some machines and not others (even with the same version of ie, 6).
I think the problem is something to do with the eval function, but i'm not sure what to use instead.
any help would be greatly appreciated
thanks
Emma
manu=navigator.appName;
vers=navigator.appVersion;
ie3=0;
window.searchmap.debug.value = document.images;
if (manu.indexOf("Microsoft"
>=0 && vers.indexOf("3"
>=0) ie3=1;
if (document.images && ie3==0 ) {
var ukon = new Image();
ukon.src = "/home/images/newnav/btn-ukprop-active.gif";
var ukoff = new Image();
ukoff.src = "/home/images/newnav/btn-ukprop.gif";
var euroon = new Image();
euroon.src = "/home/images/newnav/btn-europrop-active.gif";
var eurooff = new Image();
eurooff.src = "/home/images/newnav/btn-europrop.gif";
var agentson = new Image();
agentson.src = "/home/images/newnav/btn-agents-active.gif";
var agentsoff = new Image();
agentsoff.src = "/home/images/newnav/btn-agents.gif";
var contacton = new Image();
contacton.src = "/home/images/newnav/btn-contact-active.gif";
var contactoff = new Image();
contactoff.src = "/home/images/newnav/btn-contact.gif";
var companyon = new Image();
companyon.src = "/home/images/newnav/btn-companyinfo-active.gif";
var companyoff = new Image();
companyoff.src = "/home/images/newnav/btn-companyinfo.gif";
}
function imgOn(imgName) {
if (document.images) {
window.searchmap.debug.value = eval(imgName + "on.src"
;
document
.src = eval(imgName + "on.src"
;
}
return true;
}
function imgOff(imgName) {
if (document.images) {
window.searchmap.debug.value = eval(imgName + "off.src"
;
document
.src = eval(imgName + "off.src"
;
}
return true;
}
This seems to work on some machines and not others (even with the same version of ie, 6).
I think the problem is something to do with the eval function, but i'm not sure what to use instead.
any help would be greatly appreciated
thanks
Emma
manu=navigator.appName;
vers=navigator.appVersion;
ie3=0;
window.searchmap.debug.value = document.images;
if (manu.indexOf("Microsoft"
if (document.images && ie3==0 ) {
var ukon = new Image();
ukon.src = "/home/images/newnav/btn-ukprop-active.gif";
var ukoff = new Image();
ukoff.src = "/home/images/newnav/btn-ukprop.gif";
var euroon = new Image();
euroon.src = "/home/images/newnav/btn-europrop-active.gif";
var eurooff = new Image();
eurooff.src = "/home/images/newnav/btn-europrop.gif";
var agentson = new Image();
agentson.src = "/home/images/newnav/btn-agents-active.gif";
var agentsoff = new Image();
agentsoff.src = "/home/images/newnav/btn-agents.gif";
var contacton = new Image();
contacton.src = "/home/images/newnav/btn-contact-active.gif";
var contactoff = new Image();
contactoff.src = "/home/images/newnav/btn-contact.gif";
var companyon = new Image();
companyon.src = "/home/images/newnav/btn-companyinfo-active.gif";
var companyoff = new Image();
companyoff.src = "/home/images/newnav/btn-companyinfo.gif";
}
function imgOn(imgName) {
if (document.images) {
window.searchmap.debug.value = eval(imgName + "on.src"
document
}
return true;
}
function imgOff(imgName) {
if (document.images) {
window.searchmap.debug.value = eval(imgName + "off.src"
document
}
return true;
}