Re: Trouble with Javascript in Mozilla!!!
Hey thank you all for responding. Yes it is working correctly in IE. The part that is not working in Mozilla is the red fading marquee with "Message 1, Message2, Message3". I will post the entire code below:
<head>
<title>NHC</title>
<!-- Favicon -->
<link rel="shortcut icon" href="" />
<!-- CSS -->
<link rel="stylesheet" href="css/styles.css" media="all" type="text/css" />
<!-- RSS -->
<link rel="alternate" href="" title="RSS Feed" type="application/rss+xml" />
<!-- Fading Txt -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
// add as many or as few messages as you would like
var msg=new Array()
msg[0]="Message 1";
msg[1]="Message 2";
msg[2]="Message 3";
// set your first set of colors. Use as many or as few as you wish.
var colors1=new Array("ffffff", "ffeeee", "ffdddd", "ffcccc", "ffbbbb", "ffaaaa", "ff9999",
"ff8888", "ff7777", "ff6666", "ff5555", "ff4444", "ff3333", "ff2222", "ff1111", "ff0000")
//set your second set of colors
// *** must have exactly the same number of colors as the array above ***
var colors2=new Array("ffffff", "ffeeee", "ffdddd", "ffcccc", "ffbbbb", "ffaaaa", "ff9999",
"ff8888", "ff7777", "ff6666", "ff5555", "ff4444", "ff3333", "ff2222", "ff1111", "ff0000")
//set the height of the display in pixels
high=1;
//set the width of the display in pixels
wide=205;
//set the pixel coordinates for the upper left hand corner of the display
Xpos=220;
Ypos=180;
// move the display away from the edges of the background
pad=15;
// set the background color of the display
bgcol="e7e7e7";
//add a background image if you want.
// *** for no image, just leave empty quotes (ex. cellbg=""; ) ***
cellbg="";
// set the font
fntFam="Times New Roman, Arial";
fntSize=12;
// set how how many seconds you want the message to stay remain at totality.
pause=3;
// Do not edit these values below!!!
icolor=0;
mcolor=1;
imsg=0;
spWidth=wide-(2*pad);
totality=false;
glowing=true;
var theMsg="";
var cellcontent="";
pause=pause*1000;
if(cellbg.length>4){cellbg=" background="+cellbg}
else{cellbg="";}
function doPause()**
totality=false; t=setTimeout("changecolor()",pause);
}
function initiate()**
getContentColor();
getMsg();
getCellContent();
if(document.all)**
msgbg.innerHTML=cellcontent;
msgfade.innerHTML=theMsg;
msgbg.style.posLeft=Xpos;
msgbg.style.posTop=Ypos;
msgfade.style.posLeft=Xpos+pad;
msgfade.style.posTop=Ypos+pad;
t=setTimeout("changecolor()",50);}
if(document.layers)**
document.msgbg.document.write(cellcontent);
document.msgbg.document.close();
document.msgfade.document.write(theMsg);
document.msgfade.document.close();
document.msgbg.left=Xpos;
document.msgbg.top=Ypos;
document.msgfade.left=Xpos+pad;
document.msgfade.top=Ypos+pad;
t=setTimeout("changecolor()",100);}
}
function changecolor()**
if(totality==true){doPause();}
else{
getMsg();
getContentColor();
if(document.all)**
msgfade.innerHTML=theMsg;
t=setTimeout("changecolor()",50);}
if(document.layers)**
document.msgfade.document.write(theMsg);
document.msgfade.document.close();
t=setTimeout("changecolor()",70);}
}
}
function getFadeColor()**
icolor=icolor-1;
if(mcolor==1){contentcolor=colors1[icolor];}
else{contentcolor=colors2[icolor];}
}
function getGlowColor()**
icolor=icolor+1;
if(mcolor==1){contentcolor=colors1[icolor];}
else{contentcolor=colors2[icolor];}
}
function changemsg()**
if(imsg==msg.length-1){imsg=0; mcolor=1;}
else if(imsg != msg.lenght-1 && mcolor==1){imsg=imsg+1; mcolor=0;}
else{imsg=imsg+1; mcolor=1;}
}
function getContentColor()**
if(icolor==colors1.length-1 && glowing==true)**
getFadeColor(); glowing=false; totality=true;}
else if(icolor < colors1.length && glowing==true)**
getGlowColor();}
else if(icolor < 1 && glowing==false){changemsg(); getGlowColor(); glowing=true;}
else{getFadeColor();}
}
function getMsg() **
theMsg="<span style='font-size:"+fntSize+"pt; font-family:"+fntFam+"; width:"+spWidth+";'>"
theMsg+="<B><font color="+contentcolor+">"+msg[imsg]+"</font></B> "
theMsg+="</span>"
}
function getCellContent()**
cellcontent="<TABLE height="+high+
" width="+wide+" bgcolor="+bgcol+" cellpadding=0 cellspacing=0><TR><TD"+cellbg+"> </TD></TR></TABLE>"}
// End -->
</script>
</head>
<BODY onLoad="initiate()">
<div id="header">
<div class="subContainer">
<div id="logo">
<div id="box">NHC</div>
<p>NHC Consulting</p>
</div><!-- /logo -->
</div><!-- /subContainer -->
</div><!-- header -->
<div id="navigation">
<ul>
<li id="active"><a href="index.html"><h6>Home</h6></a></li>
<li><a href="about.html">About NHC</a></li>
<li><a href="guarantee.html">Our Guarantee</a></li>
<li><a href="faq.html">FAQ</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ul>
</div><!-- /navigation -->
<div id="container">
<div id="primaryContent">
<h4>NHC can help you stay in your home.</h4>
<img src="images/House.jpg" alt="house" />
<p>Consulting message</p>
<ul>
<li>step one</li>
<li>step two</li>
<li>step three</li>
<li>step four</li>
<li>step five</li>
<li>step six</li>
<li>step seven</li>
<li>step eight</li>
</ul>
<br>
<p>message final</p>
<div id="comments">
<dl class="comment">
<Script type="text/javaScript">
// Get today's current date.
var now = new Date();
// Array list of days.
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
// Array list of months.
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
// Calculate four digit year.
function fourdigits(number) **
return (number < 1000) ? number + 1900 : number;
}
// Join it all together
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;
// Print out the data.
document.write(today);
// End -->
</script>
</dl>
</div><!-- /comments -->
</div><!-- /primaryContent -->
<div id="secondaryContent">
<div id=msgfade style="position: static;"></DIV><br><center><DIV id=msgbg style="position: static;"></DIV></center>
<h2>NHC is a professional accredited organization qualified to help homeowners in difficult situations.</h2>
<h3>This Is How We Help You:</h3>
<ul>
<li>uno</li>
<li>dos</li>
<li>tres</li>
</ul>
<h3>Call for a Free Consultation</h3>
<h5>1-866-555-XXXX</h5>
<h3>Have a Consultant Call You</h3>
<form action="phpmailform.php" method="post">
<p><input value="Name" name="box1" type="text" onfocus="if(box1.value=='Name')box1.value='';" onblur="if(box1.value=='')box1.value='Name';"></p>
<p><input value="Phone Number" name="box2" type="text" onfocus="if(box2.value=='Phone Number')box2.value='';" onblur="if(box2.value=='')box2.value='Phone Number';"></p>
<p><input value="Email Address" name="box3" type="text" onfocus="if(box3.value=='Email Address')box3.value='';" onblur="if(box3.value=='')box3.value='Email Address';"></p>
<select name="selbox">
<option>AL</option>
<option>AK</option>
<option>AZ</option>
<option>AR</option>
<option>CA</option>
<option>CO</option>
<option>CT</option>
<option>DE</option>
<option>DC</option>
<option>FL</option>
<option>GA</option>
<option>HI</option>
<option>ID</option>
<option>IL</option>
<option>IN</option>
<option>IA</option>
<option>KS</option>
<option>KY</option>
<option>LA</option>
<option>ME</option>
<option>MD</option>
<option>MA</option>
<option>MI</option>
<option>MN</option>
<option>MS</option>
<option>MO</option>
<option>MT</option>
<option>NE</option>
<option>NV</option>
<option>NH</option>
<option>NJ</option>
<option>NM</option>
<option>NY</option>
<option>NC</option>
<option>ND</option>
<option>OH</option>
<option>OK</option>
<option>OR</option>
<option>PA</option>
<option>RI</option>
<option>SC</option>
<option>SD</option>
<option>TN</option>
<option>TX</option>
<option>UT</option>
<option>VT</option>
<option>VA</option>
<option>WA</option>
<option>WV</option>
<option>WI</option>
<option>WY</option>
</select>
<p><Input type = "submit" VALUE = "Submit" onClick = "if(textbox1.value=='Name')alert('Please enter a Name before submitting'); else if(textbox2.value=='Phone Number')alert('Please enter a Phone Number before submitting'); else if(textbox3.value=='Email Address')alert('Please enter an Email Address before submitting')"></p>
</form>
<h3>Links</h3>
<!--
This part was designed to handle images
-->
<ul class="links">
<li><a href="http://www.federalreserve.gov/newsevents/speech/duke20090211a.htm">Housing Market Facts</a></li>
<li><a href="http://www.fdic.gov/consumers/loans/loanmod/index.html">FDIC Bank Reccomendations</a></li>
</ul>
</div><!-- /secondaryContent -->
<br class="clear" />
</div><!-- container -->
<div id="footer">
<ul>
<li id="copyright">© 2009 WR & A L.L.C.</li>
<li id="links">
<ul>
<li><a href="http://validator.w3.org/check/referer">XHTML</a> |</li>
<li><a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> |</li>
<li><a href="http://www.kulor.com/?ref=mighty_template">OWSD.org</a></li>
</ul>
</li>
</ul>
</div><!-- /footer -->
</body>
</html>