I'm trying to create a menu style but I'm having a little problem, hope someone can help.

I want to know if there is anyway I could put a PHP script on a onclick event. The menu is getting build in a php script

[code]
function dune_primary_links($title) {
$links = menu_primary_links();
$i = 1;

if ($links) {
foreach ($links as $link) {
if ($i == 1)
if ($title == "title")
$output .= '

' . $link . '

' . '

';
else
$output .= '
' . $link . '

' . '

';
else
$output .= '
' . $link . '

';

$i++;

}
}
return $output;
}
[/code]

what I need to do is change the "mirrortab_active_back" to the selected menu. How can I achieve that??