OK, here is my problem

I'm working with tabs (CSS).
On mouseover, the tab changes, that works fine.
But I want it to remain like when on mouseover when I CLICK on the tab.
I have a JavaScript that changes the class of the tab that was clicked on so it looks the same as when on mouseover.
So, it would be logical that the tab that is clicked remains that way.
That works fine when the links are
href="#". When I stay on the same page.
Now the problem is, I work with PHP and I include my pages. The links become
index.php?p=...So, the page reloads... That way I loose the class, because It works only when link is clicked.
Here's the java script:
CODE
<script>
function changeClass(obj) {
var ppUl=obj.parentNode.parentNode;
var pLi=obj.parentNode;
var lis=ppUl.getElementsByTagName('LI');
for (var i=0; i<lis.length; i++) {
var lnk=lis[i].getElementsByTagName('A')[0];
if (lnk!=obj) {
lnk.className='';
}
}
obj.className='ITEM_ON';
}
</script>
And here are my tabs:
CODE
<ul id="tabsJ">
<li><a href="#" onClick="changeClass(this);"><span>Pocetna</span></a></li>
<li><a href="#" onClick="changeClass(this);"><span>Forum</span></a></li>
<li><a href="#" onClick="changeClass(this);"><span>Proft Calculator</span></a></li>
<li><a href="#" onClick="changeClass(this);"><span>Trade Calculator</span></a></li>
</ul>
Now I was thinking to keep the '#' in the link and change the $_GET variable onClick...
But when thinking further, that is stupid because the page would be reloaded when a page is included again.
I don't know how to fix this...
maybe change class AFTER link is clicked?
I don't know how to program JavaScript.
I found the script above somewhere on the net
This post has been edited by dinci5: 4 Mar, 2008 - 03:10 PM