Hi there I have 2 actions that i want to do once the user has clicked on the link.

<a onclick='return showPic(this)' href='/php/img.php?id=$t&ref=$r' title=''>$t</a>
<a href="#" onClick="toggleactive(this);return false;">$t</a>

i also would like that the $t should get the active css class how can i combine this 2 scripts to one ?
DISPLAY IMAGE

Code JavaScript:
function showPic (whichpic) {
 if (document.getElementById) {
  document.getElementById('placeholder').src = whichpic.href;
  if (whichpic.title) {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
  } 
  return false;
 } else {
  return true;
 }
}


CHANGE CLASS

Code JavaScript:
var currLink = null;  
function toggleactive(elm) 
{  
  if(currLink)  
    currLink.className = currLink.className.replace(/\bactive\b/,''); 
  currLink = elm;  
  currLink.className += " active"; 
}