mstemmer 0 Newbie Poster

Hello all,
I'd like to embed a javascript code into this part of the php/html

?>
   <a href="<?=$images[$k][0]?>" target="blank">
    <img src="<?=$thumbdir."/".$images[$k][0]?>" border="0"><br />
    <?=$images[$k][0]?>
   </a><br />
   <?=round($images[$k][2]/1024)?>Kb, <?=date("d-m-y",$images[$k][1])?>

<?

I'd like to add this javascript to it:

<script language=JavaScript>
<!--
//Disable right mouse click Script
//By Maximus ([EMAIL="maximus@nsimail.com"]maximus@nsimail.com[/EMAIL]) w/ mods by DynamicDrive
//For full source code, visit [URL]http://www.dynamicdrive.com[/URL]
var message="Function Disabled!";
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
// --> 
</script>

My problem is that when I add this myself, a blank page will open but I'm still able to rightclick my mouse.
Can anyone give me an example how to correct this?

Thanks.