Hello everyone,
i need help with a this choice i made to implement button swapping.
Basically, the idea is : you have two buttons, each of them links to different pages and is represented by an image (a button of course). When one button is clicked i want it to become active (so as to call this different image of the same button active i.e. with another color) and the other to swicht to its image inactive. Here is this simple script i managed to put together:
var interneti=true;
function swapimage(interneti)
{
if (interneti){
this.location.href = "telefoni.html";
document.images['internet'].src ="a_files/FirstNonActiveButton.jpg" ;
document.images['telefoni'].src = "a_files/SecondActiveButon.jpg";
interneti = true;
}else if(!interneti) {
this.location.href = "<$mt:BlogURL$>internet.html";
document.images['internet'].src ="<$mt:BlogURL$>a_files/FirstActiveButton.jpg" ;
document.images['telefoni'].src = "<$mt:BlogURL$>a_files/SecondNonActiveButton.jpg";
}
}
// --> </script>
and the part where it is called
<div id="residential_current">
<img src="a_files/FirstActiveButton.jpg" id = "internet" onclick="javascript:swapimage(false)" />
</div>
<div class="bus_divider">
<img src="a_files/SecondNonActiveButton.jpg" id="telefoni" onclick="javascript:swapimage(true)" />
******
Now, what happens is that the change of images that represent the buttons takes place only before the page it links to is loaded. Afterwards it seems like the page is reset. The buttons are in the header module called from every page in my site.
I cannot understand how to make it possible that the document.images.src ="a_files/FirstNonActiveButton.jpg" ; happens in the page called. :(
Please give me a clue... i am so out of time to restart another way.... :(
Thanks in advance