Code: Select all
<script type="text/javascript">
<!--
/* preload the pictures necessary for the image flips */
chaton= new Image(90,47); // when over the option
chaton.src="sitepics/chaton.png"; // picture source
chatoff= new Image(90,47); // when not over the image
chatoff.src="sitepics/chatoff.png"; // picture source
controlon= new Image(90,47); // when over the option
controlon.src="sitepics/controlon.png"; // picture source
controloff= new Image(90,47); // when not over the image
controloff.src="sitepics/controloff.png"; // picture source
faqon= new Image(90,47); // when over the option
faqon.src="sitepics/faqon.png"; // picture source
faqoff= new Image(90,47); // when not over the image
faqoff.src="sitepics/faqoff.png"; // picture source
/*
finduseron= new Image(90,47); // when over the option
finduseron.src="sitepics/finduseron.png"; // picture source
finduseroff= new Image(90,47); // when not over the image
finduseroff.src="sitepics/finduseroff.png"; // picture source
*/
forumson= new Image(90,47); // when over the option
forumson.src="sitepics/forumson.png"; // picture source
forumsoff= new Image(90,47); // when not over the image
forumsoff.src="sitepics/forumsoff.png"; // picture source
loginon= new Image(90,47); // when over the option
loginon.src="sitepics/loginon.png"; // picture source
loginoff= new Image(90,47); // when not over the image
loginoff.src="sitepics/loginoff.png"; // picture source
logouton= new Image(90,47); // when over the option
logouton.src="sitepics/logouton.png"; // picture source
logoutoff= new Image(90,47); // when not over the image
logoutoff.src="sitepics/logoutoff.png"; // picture source
newon= new Image(90,47); // when over the option
newon.src="sitepics/newon.png"; // picture source
newoff= new Image(90,47); // when not over the image
newoff.src="sitepics/newoff.png"; // picture source
searchon= new Image(90,47); // when over the option
searchon.src="sitepics/searchon.png"; // picture source
searchoff= new Image(90,47); // when not over the image
searchoff.src="sitepics/searchoff.png"; // picture source
signupon= new Image(90,47); // when over the option
signupon.src="sitepics/signupon.png"; // picture source
signupoff= new Image(90,47); // when not over the image
signupoff.src="sitepics/signupoff.png"; // picture source
topon= new Image(90,47); // when over the option
topon.src="sitepics/topon.png"; // picture source
topoff= new Image(90,47); // when not over the image
topoff.src="sitepics/topoff.png"; // picture source
/* functions that do the image flips */
function selopt(which){ // switch what is selected
switch(which){ // which switch is executed?
case 'chat': document.chat.src=chaton.src; return true; break;
case 'control': document.control.src=controlon.src; return true; break;
case 'faq': document.faq.src=faqon.src; return true; break;
// case 'finduser': document.finduser.src=finduseron.src; return true; break;
case 'forums': document.forums.src=forumson.src; return true; break;
case 'login': document.login.src=loginon.src; return true; break;
case 'logout': document.logout.src=logouton.src; return true; break;
case 'new': document.nouveau.src=newon.src; return true; break;
case 'search': document.search.src=searchon.src; return true; break;
case 'signup': document.signup.src=signupon.src; return true; break;
case 'top': document.top.src=topon.src; return true; break;
}
}
function deselopt(which){ // switch what is un-selected
switch(which){ // which switch is executed?
case 'chat': document.chat.src=chatoff.src; return true; break;
case 'control': document.control.src=controloff.src; return true; break;
case 'faq': document.faq.src=faqoff.src; return true; break;
// case 'finduser': document.finduser.src=finduseroff.src; return true; break;
case 'forums': document.forums.src=forumsoff.src; return true; break;
case 'login': document.login.src=loginoff.src; return true; break;
case 'logout': document.logout.src=logoutoff.src; return true; break;
case 'new': document.nouveau.src=newoff.src; return true; break;
case 'search': document.search.src=searchoff.src; return true; break;
case 'signup': document.signup.src=signupoff.src; return true; break;
case 'top': document.top.src=topoff.src; return true; break;
}
}
-->
</script>Code: Select all
<script type="text/javascript">
<!--
/* array for various uses */
var buttons=new Array('chaton','chatoff','controlon','controloff','faqon','faqoff','finduseron','finduseroff','forumson','f
orumsoff','loginon','loginoff','logouton','logoutoff','newon','newoff','searchon','searchoff','signupon','signupoff','topon
','topoff');
for(i=0;i<22;i++){ // preload the pictures necessary for the image flips
var pic=buttons[i];
pic= new Image(90,47); // create variable for picture
pic.src='sitepics/'+pic+'.png'; // get picture source
}
/* functions that do the image flips */
function selopt(which){ // switch what is selected
switch(which){ // which switch is executed?
case 'chat': document.chat.src=chaton.src; return true; break;
case 'control': document.control.src=controlon.src; return true; break;
case 'faq': document.faq.src=faqon.src; return true; break;
// case 'finduser': document.finduser.src=finduseron.src; return true; break;
case 'forums': document.forums.src=forumson.src; return true; break;
case 'login': document.login.src=loginon.src; return true; break;
case 'logout': document.logout.src=logouton.src; return true; break;
case 'new': document.nouveau.src=newon.src; return true; break;
case 'search': document.search.src=searchon.src; return true; break;
case 'signup': document.signup.src=signupon.src; return true; break;
case 'top': document.top.src=topon.src; return true; break;
}
}
function deselopt(which){ // switch what is un-selected
switch(which){ // which switch is executed?
case 'chat': document.chat.src=chatoff.src; return true; break;
case 'control': document.control.src=controloff.src; return true; break;
case 'faq': document.faq.src=faqoff.src; return true; break;
// case 'finduser': document.finduser.src=finduseroff.src; return true; break;
case 'forums': document.forums.src=forumsoff.src; return true; break;
case 'login': document.login.src=loginoff.src; return true; break;
case 'logout': document.logout.src=logoutoff.src; return true; break;
case 'new': document.nouveau.src=newoff.src; return true; break;
case 'search': document.search.src=searchoff.src; return true; break;
case 'signup': document.signup.src=signupoff.src; return true; break;
case 'top': document.top.src=topoff.src; return true; break;
}
}
-->
</script>it seems to be that the images are not being given names. not sure where to go from here to fix the new one. not quite sure how to make it evalutate out to the name from the variable becasue "pic" just made it have an error there.
any pointers to getting the condensed version to work would be appreciated.