T
The Master
As the subject states, I'm having issues with if else statements that
are testing true in IE but false in Mozilla. At first I Thought maybe
the way I was splitting the string was leaving trailing white spaces
in Mozilla, but that was not the case (as the alert in the else
statement shows). So I'm at a complete loss here. The reason for this
script is to make the button mouse overs to remain active on their
respective pages, without having to hard code it on each respective
page. The reason is because the buttons are in an include file (which
is a temp fix until we get the whole site running on a database).
Here is the code (for whatever reason Mozila only runs the alert in
the else statement.):
function PageName() {
var NextPage = new String(location.href);
var ArrNextPage = NextPage.split("/");
var NextPage2 = new String(ArrNextPage[eval(ArrNextPage.length -
1)]);
var ArrNextPage2 = NextPage2.split(".");
var NextPage3 = new String(ArrNextPage2[0]);
if (NextPage3 == "massage") {
VV_swapImage('massage','','./images/massageOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('massageLink','','show');
} else if (NextPage3 == "ballFitness") {
VV_swapImage('ballFitness','','./images/ballFitnessOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('ballFitnessLink','','show');
} else if (NextPage3 == "bellydance") {
VV_swapImage('bellydance','','./images/bellydanceOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('bellydanceLink','','show');
} else if (NextPage3 == "danceFitness") {
VV_swapImage('dance','','./images/danceOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('danceFitnessLink','','show');
} else if (NextPage3 == "yoga") {
VV_swapImage('yoga','','./images/yogaOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('yogaLink','','show');
} else if (NextPage3 == "wellness") {
VV_swapImage('taiChi','','./images/taiChiOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('taiChiLink','','show');
} else if (NextPage3 == "pilates") {
VV_swapImage('pilates','','./images/pilatesOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('pilatesLink','','show');
} else if (NextPage3 == "transform") {
VV_swapImage('fitness','','./images/fitnessOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('fitnessLink','','show');
} else if (NextPage3 == "pregnancyFitness") {
VV_swapImage('pregnancy','','./images/pregnancyOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('pregnancyLink','','show');
} else if (NextPage3 == "relaxation") {
VV_swapImage('relaxation','','./images/relaxationOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('relaxationLink','','show');
} else if (NextPage3 == "backcare") {
VV_swapImage('backcare','','./images/backcareOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('backcareLink','','show');
} else {
alert('3' + NextPage3 + '3');
}
}
are testing true in IE but false in Mozilla. At first I Thought maybe
the way I was splitting the string was leaving trailing white spaces
in Mozilla, but that was not the case (as the alert in the else
statement shows). So I'm at a complete loss here. The reason for this
script is to make the button mouse overs to remain active on their
respective pages, without having to hard code it on each respective
page. The reason is because the buttons are in an include file (which
is a temp fix until we get the whole site running on a database).
Here is the code (for whatever reason Mozila only runs the alert in
the else statement.):
function PageName() {
var NextPage = new String(location.href);
var ArrNextPage = NextPage.split("/");
var NextPage2 = new String(ArrNextPage[eval(ArrNextPage.length -
1)]);
var ArrNextPage2 = NextPage2.split(".");
var NextPage3 = new String(ArrNextPage2[0]);
if (NextPage3 == "massage") {
VV_swapImage('massage','','./images/massageOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('massageLink','','show');
} else if (NextPage3 == "ballFitness") {
VV_swapImage('ballFitness','','./images/ballFitnessOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('ballFitnessLink','','show');
} else if (NextPage3 == "bellydance") {
VV_swapImage('bellydance','','./images/bellydanceOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('bellydanceLink','','show');
} else if (NextPage3 == "danceFitness") {
VV_swapImage('dance','','./images/danceOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('danceFitnessLink','','show');
} else if (NextPage3 == "yoga") {
VV_swapImage('yoga','','./images/yogaOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('yogaLink','','show');
} else if (NextPage3 == "wellness") {
VV_swapImage('taiChi','','./images/taiChiOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('taiChiLink','','show');
} else if (NextPage3 == "pilates") {
VV_swapImage('pilates','','./images/pilatesOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('pilatesLink','','show');
} else if (NextPage3 == "transform") {
VV_swapImage('fitness','','./images/fitnessOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('fitnessLink','','show');
} else if (NextPage3 == "pregnancyFitness") {
VV_swapImage('pregnancy','','./images/pregnancyOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('pregnancyLink','','show');
} else if (NextPage3 == "relaxation") {
VV_swapImage('relaxation','','./images/relaxationOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('relaxationLink','','show');
} else if (NextPage3 == "backcare") {
VV_swapImage('backcare','','./images/backcareOver.jpg',1);
VV_changeProp('navChange','','src','./images/navChangeOver.jpg','IMG');
VV_showHideLayers('backcareLink','','show');
} else {
alert('3' + NextPage3 + '3');
}
}